Thank you.
But the hotkeys do not work when they meet a loop in a funtion. Just simply try this:
#Include <HotKey.au3>
Global Const $VK_ESCAPE = 0x1B
Global Const $VK_F12 = 0x7B
; Assign "F12" with Message() and set extended function call
_HotKeyAssign($VK_F12, 'Message', BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL))
; Assign "CTRL-ESC" with Quit()
_HotKeyAssign(BitOR($CK_CONTROL, $VK_ESCAPE), 'Quit')
While 1
Sleep(10)
WEnd
Func Message($iKey)
MsgBox(0, 'Hot key Test Message', 'F12 (0x' & Hex($iKey, 4) & ') has been pressed!')
while 1
Sleep(100)
WEnd
EndFunc ;==>Message
Func Quit()
Exit
EndFunc ;==>Quit