always send keyboard events

pull/1/head
Heiko Hund 2013-06-03 12:20:09 +02:00
parent 47cff87477
commit bc015578d5
1 changed files with 2 additions and 6 deletions

8
misc.c
View File

@ -191,13 +191,9 @@ ForceForegroundWindow(HWND hWnd)
{
BOOL ret = FALSE;
if ((GetKeyState(VK_MENU) & 0x8000) == 0)
keybd_event(VK_MENU, 0, 0, 0);
keybd_event(VK_MENU, 0, 0, 0);
ret = SetForegroundWindow(hWnd);
if (GetKeyState(VK_MENU) & 0x8000)
keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0);
return ret;
}