Click to See Complete Forum and Search --> : Attaching to process


xmef
November 19th, 2007, 07:02 PM
Okay so this is it, im new with C++ and i want to make a application that will attach to certain program and press the f5 and f8 keys evert 5 seconds, can anyone help me? so far this is what i have:


#include <windows.h>

int main {}
{
for(;;){
Sleep(1000);
keydb_event(VkKeyScan('F5'),0,0,0);
keydb_event(VkKeyScan('F8'),0,0,0);
}
return 0;


it does not work =[ and it doesn't attach to the process.. can anyone help me fix it, thanks

Skizmo
November 20th, 2007, 03:21 AM
Your only sending a KEY_DOWN. you also need to send a KEY_UP. And add a sleep (10-20 milliseconds) between the 2 keys. Don't know if it will fix your problem, but that's how I did it.

...and it doesn't attach to the process
What do you mean by that ?

Marc G
November 20th, 2007, 05:44 AM
[ merged thread ]

Please do not start multiple threads about the same issue.