Click to See Complete Forum and Search --> : GetMessage on different thread?


Brad1011
May 31st, 2009, 01:24 AM
This might be really complicated to do, but how would I go about using GetMessage on a different thread. What I'm trying to do it "hook" a program and intercept messages. I already have the window handle (HWND).


Also, SetWindowLong doesn't work on different threads does it?

yaniv_av
May 31st, 2009, 11:29 AM
In order to intercept program's messages, you should use SetWindowsHookEx with WH_CBT.
You can find a lot of information in the MSDN, and lots of examples on the net.

Igor Vartanov
June 4th, 2009, 10:12 AM
What I'm trying to do it "hook" a program and intercept messages. I already have the window handle (HWND).


Also, SetWindowLong doesn't work on different threads does it?
It does work, but within the same process. ;) What SetWindowLong does is sets the function pointer as window procedure. And a valid pointer within one process is meaningless outside of it.

wigga
June 8th, 2009, 07:34 AM
u will have to inject code todo this.