DECLARE SUB keybd_event LIB "user32" ALIAS "keybd_event" (BYVAL bVk AS BYTE, BYVAL bScan _
AS BYTE, BYVAL dwFlags AS LONG, BYVAL dwExtraInfo AS LONG)
CONST KEYEVENTF_KEYUP = &H2
CONST WM_SETFOCUS = &H7&
CONST WM_KILLFOCUS = &H8&
SendMessage hWnd, WM_SETFOCUS, 0&, 0&
SUB SendKeysAPI(bytKeystack() AS BYTE, _
DelayMS AS LONG)
DIM nKeyCnt AS LONG
FOR nKeyCnt = LBOUND(bytKeystack) TO UBOUND(bytKeystack)
keybd_event bytKeystack(nKeyCnt), 0, 0, 0
DOEVENTS
IF DelayMS THEN SLEEP DelayMS
keybd_event bytKeystack(nKeyCnt), 0, KEYEVENTF_KEYUP, 0
DOEVENTS
NEXT nKeyCnt
END SUB
DEFBYTE vbKeyControl = 17
DEFBYTE vbKeyEscape = 27
SUB ShowStartMenu()
keybd_event vbKeyControl, 0, 0, 0
keybd_event vbKeyEscape, 0, 0, 0
DOEVENTS
keybd_event vbKeyControl, 0, KEYEVENTF_KEYUP, 0
keybd_event vbKeyEscape, 0, KEYEVENTF_KEYUP, 0
DOEVENTS
END SUB
|