Q> Как программно нажать
клавишу (Num Lock например)?
A>
Win95/98:
{
BYTE KeyboardState[ 256 ];
GetKeyboardState( KeyboardState );
KeyboardState[ VK_NUMLOCK ] = KeyboardState[ VK_NUMLOCK ] ^ 1;
SetKeyboardState( KeyboardState );
}
WinNT:
{
keybd_event( VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0 );
keybd_event( VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY |
KEYEVENTF_KEYUP, 0
);
}