Question

I want to "intercept" the WM_PAINT msg of an other process chatBox. the function: GetMessage(msg, hwnd, 0, 0) seems to be perfect but i'm not receiving any messages (I tryied as super user) from now my C++ code find the good child windows and try to "getMessage", What did I forget? I necessarily have to inject this code in a dll to my other process?

Was it helpful?

Solution

Message queues are per thread, so you cannot GetMessage for the other thread or process.

What you need is to install a window hook. See SetWindowsHookEx with WH_CALLWNDPROC hook type. Your dll will be loaded to all processes and intercept all window messages.

Then decide which messages/processes/windows you need to ignore and which to handle.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top