$SelectAll = GUICtrlCreateDummy()
$SaveDoc = GUICtrlCreateDummy()
Global $AccelKeys[2][2] = [["^a", $SelectAll], ["^s", $SaveDoc]]
GUISetAccelerators($AccelKeys)
AutoItSetOption("GUIOnEventMode", 1)
GUISetOnEvent($GUI_EVENT_CLOSE, "FORM_Event", $hGUI)
GUISetOnEvent($GUI_EVENT_RESTORE, "FORM_Event", $hGUI)
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND_Event")
GUIRegisterMsg($WM_TIMER, "WM_TIMER_Event")
GUISetAccelerators($AccelKeys)
GUISetOnEvent($SaveDoc, "App_SaveDoc", $hGUI) ; !!! Здесь программа вылетает
Func FORM_Event()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
; ...
Case $GUI_EVENT_RESTORE
; ...
EndSwitch
EndFunc
Func WM_COMMAND_Event($hWnd, $Msg, $wParam, $lParam)
#forceref $hWnd, $Msg
Local $nNotifyCode = BitShift($wParam, 16) ; Hi Word
Local $nID = BitAND($wParam, 0x0000FFFF) ; Low Word
Local $hCtrl = $lParam
Switch $nNotifyCode
Case $BN_CLICKED
; ...
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc
Func Script_WM_TIMER($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg, $ilParam
; ...
EndFunc