Example4you
Code:
;===Settings============================================================================
Hotkey = 1 ; default hotkey
;===Auto-execute continuation===========================================================
Hotkey, %Hotkey%, HotkeySubroutine
DefaultHotkeyBackup := Hotkey
Gui 1: Add, Hotkey, x5 y6 w130 vHotkey, %Hotkey%
Gui 1: Add, Button, x145 y5, Apply
Gui 1: show, w190, Change hotkey
Return ;===Auto-execute ends here===
;===Subroutines=========================================================================
ButtonApply:
Hotkey, %Hotkey%, HotkeySubroutine, off
Gui 1: submit, nohide
if Hotkey = ; security: if user didn't specified hotkey in dialog and clicked Apply, use default hotkey
Hotkey := DefaultHotkeyBackup
Hotkey, %Hotkey%, HotkeySubroutine, on
Return
GuiClose:
ExitApp
HotkeySubroutine:
MsgBox,,, Hotkey works.,1
Return