However, omitting FunctionName or specifying an empty string both generate runtime errors when I try to use them. Am I doing something wrong? If not, how to I unregister for a message?OnMessage(MsgNumber [, "FunctionName", MaxThreads])
;...
FunctionName
A function's name, which must be enclosed in quotes if it is a literal string, or a reference to a function. This function will be called automatically when the script receives MsgNumber. Omit this parameter to retrieve the name of the function currently monitoring MsgNumber (blank if none). Specify an empty string ("") or an empty variable to turn off the monitoring of MsgNumber.
Code: Select all
Gui("TokenEntry: +LastFound")
OnMessage(0x201, "WM_LButtonDown")
GuiAddEntryHandle := WinExist()
WinWaitClose ahk_id %GuiAddEntryHandle%
OnMessage(0x201, "")