- This topic has 22 replies, 4 voices, and was last updated 11 years ago by BattleStar-Galactica.
-
AuthorPosts
-
December 12, 2006 at 9:34 am #191331BattleStar-GalacticaMember
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
December 12, 2006 at 9:40 am #191330BattleStar-GalacticaMembereh you want to know if the message is sent by sendmessage or postmessage ❓
I dont know maybe dody know
December 12, 2006 at 11:51 am #191329nooobMembergreat 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
December 12, 2006 at 12:17 pm #191328BattleStar-GalacticaMemberit 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
December 12, 2006 at 2:24 pm #191327nooobMemberye dude…got all…lol
ty dude
December 12, 2006 at 3:46 pm #191326DodyMemberin 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
December 12, 2006 at 6:43 pm #191325nooobMemberok dody…i wil proceed with easy stuff…for now because i still got to get alot before i try the hard ones
thank you
June 21, 2013 at 1:07 pm #191324CoulombMemberUsing 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.
-
AuthorPosts
Related
- You must be logged in to reply to this topic.