What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » chat window's history control interaction-advance scripting

chat window's history control interaction-advance scripting
Author: Message:
effection
Full Member
***

Destroy The Runner

Posts: 135
Reputation: 4
– / Male / Flag
Joined: Sep 2006
RE: chat window's history control interaction-advance scripting
matt im trying to recreate your code in a C++ console application to investigate a bit further and im also interested in this method of hooks :)

ive got this
code:
HWINEVENTHOOK g_hook;

void CALLBACK HandleWinEvent(HWINEVENTHOOK hook, DWORD event, HWND hwnd,
                             LONG idObject, LONG idChild,
                             DWORD dwEventThread, DWORD dwmsEventTime)
{
    printf("called\n");
    IAccessible *pAcc = NULL;
    VARIANT varChild;
    HRESULT hr = AccessibleObjectFromEvent(hwnd, idObject, idChild, &pAcc, &varChild); 
    if ((hr == S_OK) && (pAcc != NULL))
    {
        char *classname;
        classname = (char*)malloc(15);
        GetClassName(GetParent(hwnd),(LPTSTR)classname,14);
        printf("Classname: %s\n", classname);
        if(strcmp(classname,"IMWindowClass") == 0){
            printf("found\n");
        }
   
    }
}

// Initializes COM and sets up the event hook.
//
void InitializeMSAA()
{
    CoInitialize(NULL);
    g_hook = SetWinEventHook(
        EVENT_SYSTEM_ALERT , EVENT_OBJECT_ACCELERATORCHANGE,  // Range of events
        NULL,                                          // Handle to DLL.
        HandleWinEvent,                                // callback.
        0, 0,              // Process and thread IDs of interest (0 = all)
        WINEVENT_SKIPOWNPROCESS); // Flags.
}

int main(array<System::String ^> ^args)
{
    InitializeMSAA();
    printf("init'd\n");
        while(1);
    system("pause");
    return 0;
}

but the "called" is never even printed in the callback, i'm guessing it has something to do with sitting in an infinite loop, what am i supposed to do instead?

This post was edited on 08-08-2007 at 11:50 PM by effection.
08-08-2007 11:49 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
chat window's history control interaction-advance scripting - by mondator on 08-08-2007 at 02:13 PM
RE: chat window's history control interaction-advance scripting - by matty on 08-08-2007 at 03:15 PM
RE: chat window's history control interaction-advance scripting - by mondator on 08-08-2007 at 03:33 PM
RE: chat window's history control interaction-advance scripting - by matty on 08-08-2007 at 03:41 PM
RE: chat window's history control interaction-advance scripting - by mondator on 08-08-2007 at 03:56 PM
RE: chat window's history control interaction-advance scripting - by matty on 08-08-2007 at 04:05 PM
RE: chat window's history control interaction-advance scripting - by mondator on 08-08-2007 at 04:21 PM
RE: chat window's history control interaction-advance scripting - by effection on 08-08-2007 at 11:49 PM
RE: RE: chat window's history control interaction-advance scripting - by TheSteve on 08-09-2007 at 12:46 AM
RE: chat window's history control interaction-advance scripting - by mondator on 08-12-2007 at 09:21 PM
RE: chat window's history control interaction-advance scripting - by TheSteve on 08-15-2007 at 01:54 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On