views:

29

answers:

1

Hi,

I'm currently researching ways to hook a process and take control of it using mouse/keyboard events whilst it is in the background (Ala, not the active window). I guess you could think of it as a more advanced macro that doesn't require the targeted window/process to be active.

Now I know the process hooking code is abundantly well documented throughout the web, so no need to discuss that. My question is - How does one send keyboard/mouse events to a background process once it has been hooked?

I'm looking for links to articles, keywords to search with, or at best example code (Please try to keep the code to C++).

Thanks.

+2  A: 

Use PostThreadMessage and remember that the thread to which the message is posted must have a message queue created, or else the call fails.

AOI Karasu