Quell
February 23rd, 2007, 10:30 PM
Hello.
I need to send some input to a program, and the problem is that keybdevent and sendinput refuse to give me any response at all. Any ideas how else i can send some keystorkes to another process?
HWND testp=FindWindow(NULL,L"test_window");
if(!testp)
MessageBox(0,L"Error finding test prog",0,0);
SetForegroundWindow(testp);
INPUT input;
input.type=INPUT_KEYBOARD;
KEYBDINPUT kb;
ZeroMemory(&kb,sizeof(KEYBDINPUT));
kb.wVk=VK_SPACE;
input.ki=kb;
SendInput(1,&input,sizeof(INPUT));
kb.dwFlags=KEYEVENTF_KEYUP;
input.ki=kb;
SendInput(1,&input,sizeof(INPUT));
return 1;
This code is called, but does absolutle nothing. Any ideas?
Thx
I need to send some input to a program, and the problem is that keybdevent and sendinput refuse to give me any response at all. Any ideas how else i can send some keystorkes to another process?
HWND testp=FindWindow(NULL,L"test_window");
if(!testp)
MessageBox(0,L"Error finding test prog",0,0);
SetForegroundWindow(testp);
INPUT input;
input.type=INPUT_KEYBOARD;
KEYBDINPUT kb;
ZeroMemory(&kb,sizeof(KEYBDINPUT));
kb.wVk=VK_SPACE;
input.ki=kb;
SendInput(1,&input,sizeof(INPUT));
kb.dwFlags=KEYEVENTF_KEYUP;
input.ki=kb;
SendInput(1,&input,sizeof(INPUT));
return 1;
This code is called, but does absolutle nothing. Any ideas?
Thx