Hi,
I am trying to use this script (Guisetaccelerators) from helpfile (slightly modified).
After one use i want to unset all accelerators. The helpfile says "Passing this function a non-array will unset all accelerators for the given winhandle". What does this mean and how do I achieve it.
After one use it should not work.
Regards
Ajit
; A simple custom messagebox that uses the MessageLoop mode
#include <GUIConstantsEx.au3>
GUICreate("Custom Msgbox", 210, 80)
GUICtrlCreateLabel("Please click a button!", 10, 10)
$YesID = GUICtrlCreateButton("Yes", 10, 50, 50, 20)
$NoID = GUICtrlCreateButton("No", 80, 50, 50, 20)
$ExitID = GUICtrlCreateButton("Exit", 150, 50, 50, 20)
; Set accelerators for Ctrl+y and Ctrl+n
Dim $AccelKeys[2][2]=[["^y", $YesID], ["^n", $NoID]]
GUISetAccelerators($AccelKeys)
GUISetState() ; display the GUI
Do
$msg = GUIGetMsg()
Select
Case $msg = $YesID
ConsoleWrite(@CRLF & "pressed Ctrl Y ")
Case $msg = $NoID
ConsoleWrite(@CRLF & "pressed Ctrl N ")
Case $msg = $ExitID
MsgBox(0, "You clicked on", "Exit")
Case $msg = $GUI_EVENT_CLOSE
MsgBox(0, "You clicked on", "Close")
EndSelect
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID