Skip to content

external hooking/subclassing

Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
    Posts
  • #191331

    in your callback function send message back to your window handle

    something like this

    LRESULT CALLBACK GetMsgProc (int nCode, WPARAM wParam, LPARAM lParam)
    {
    if (nCode < 0)
    {
    return CallNextHookEx(hmsgHooks, nCode, wParam, lParam);
    }
    else
    {
    SendNotifyMessage(hWndyourhandletoreceivemessagehere, msg->message,msg->wParam,msg->lParam);
    
    }
    return CallNextHookEx(hmsgHooks, nCode, wParam, lParam);
    }

    hope you can understand that, hWndyourhandletoreceivemessagehere is the window handle that you do the subclassing

    the hint it’s you send back message to your handle

    #191330

    eh you want to know if the message is sent by sendmessage or postmessage ❓

    I dont know maybe dody know

    #191329
    nooob
    Member

    great nano….now the picture is emerging….so you have to subclass something if you want to monitor some kind of message….

    ok got it thx alot

    nooob

    #191328

    it depend on what you want to do if you want to modify the message, you can do it directly in your dll, like on WM_DESTROY and you dont want that window to destroy on that message , you can put it to null 😆 something like that I never tested it

    #191327
    nooob
    Member

    ye dude…got all…lol

    ty dude

    #191326
    Dody
    Member

    in order to trace the Postmessage and Sendmessage you need to hook the API calls, this is a harder task than what you are starting with, I suggest you keep your trying with something easier until you got it working, then I can provide you with some usefull links according hooking api calls

    good luck

    #191325
    nooob
    Member

    ok dody…i wil proceed with easy stuff…for now because i still got to get alot before i try the hard ones

    thank you

    #191324
    Coulomb
    Member

    Using the direct-call subclassing, your subclass handlers will look like this:

    LRESULT CALLBACK
    mySubclassHandler( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
    {
    switch(msg)
    {
    case WM_whatever:
    // ... handlers look like this
    break; // continue with default handler
    case WM_other:
    // ... handlers look like this
    return value; // value as per message specification
    //...
    } //*msg*/
    return CallWindowProc(superClassHandler, hwnd, msg, wParam, lParam);
    }

    There are only three ways of subclassing in windows.

    1. direct-call subclassing << — Above example
    2. superclass-driven subclassing
    3. “classic” subclassing << — Most common in windows.

    There are some terms you can google 🙂

    Ill post more if people want me too.

Viewing 8 posts - 16 through 23 (of 23 total)
  • You must be logged in to reply to this topic.