Additional features for OnMessage function.
OutputVar := OnMessage(MsgNumber , HWND, Function, MaxThreads)Command Example: OnMessage 0x999, A_ScriptHwnd, WatchMessages Function Example: OnMessage(0x999, A_ScriptHwnd, WatchMessages)
The number of the message.
The HWND of the window to monitor, use 0 to monitor all windows.
The function object to call when the message is received. See AutoHotkey v2 docs.
See AutoHotkey v2 docs.
OnMessage 0x0201, MyGui.hwnd, LBUTTONDOWN ; register OnMessage 0x0201, MyGui.hwnd, LBUTTONDOWN, 0 ; delete OnMessage 0x0201, MyGui.hwnd, , 0 ; same as above, but will delete all registered functions for MsgNumber && HWND combination.