Как программно нажать клавишу?
|
Приведу пример для клавиши "NumLock":
В 9x:
BYTE KeyboardState[256]; GetKeyboardState(KeyboardState); KeyboardState[VK_NUMLOCK] = KeyboardState[VK_NUMLOCK] ^ 1; SetKeyboardState(KeyboardState);
В NT/2000/XP :
keybd_event( VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0 ); keybd_event( VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
|