external hooking/subclassing

Here you can talk about C++ And C# And Other languages programming.

Postby BattleStar-Galactica » Tue Dec 12, 2006 4:34 am


in your callback function send message back to your window handle

something like this

Code: Select all
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
Big math problem
2 - 1 = 0 = without you I'm nothing
User avatar
BattleStar-Galactica
imFiles Master
imFiles Master
 
Posts: 565
Joined: Tue Sep 20, 2005 12:19 am
Location: safest place to hide

Postby BattleStar-Galactica » Tue Dec 12, 2006 4:40 am

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

I dont know maybe dody know
Big math problem
2 - 1 = 0 = without you I'm nothing
User avatar
BattleStar-Galactica
imFiles Master
imFiles Master
 
Posts: 565
Joined: Tue Sep 20, 2005 12:19 am
Location: safest place to hide

Postby nooob » Tue Dec 12, 2006 6:51 am

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
Water can make holes in rocks!
nooob
imFiles Junior
imFiles Junior
 
Posts: 52
Joined: Sun Jul 23, 2006 10:23 am

Postby BattleStar-Galactica » Tue Dec 12, 2006 7:17 am

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 :lol: something like that I never tested it
Big math problem
2 - 1 = 0 = without you I'm nothing
User avatar
BattleStar-Galactica
imFiles Master
imFiles Master
 
Posts: 565
Joined: Tue Sep 20, 2005 12:19 am
Location: safest place to hide

Postby nooob » Tue Dec 12, 2006 9:24 am

ye dude...got all...lol

ty dude
Water can make holes in rocks!
nooob
imFiles Junior
imFiles Junior
 
Posts: 52
Joined: Sun Jul 23, 2006 10:23 am

Postby Dody » Tue Dec 12, 2006 10:46 am

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
User avatar
Dody
imFiles Senior
imFiles Senior
 
Posts: 177
Joined: Tue Jan 04, 2005 2:44 pm

Postby nooob » Tue Dec 12, 2006 1:43 pm

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
Water can make holes in rocks!
nooob
imFiles Junior
imFiles Junior
 
Posts: 52
Joined: Sun Jul 23, 2006 10:23 am

Previous

Return to C++, C# And Others Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests