Code: Select all
#Requires AutoHotkey v2.1-alpha.9
g := Gui()
editCtrl := g.AddEdit("w200", "Edit")
LV := g.AddListView("w200 h100", [1,2,3])
WM_MOUSEMOVE := 0x0200
editCtrl.OnMessage(WM_MOUSEMOVE, GuiControlCallback)
LV.OnMessage(WM_MOUSEMOVE, GuiControlCallback)
OnMessage(WM_MOUSEMOVE, OnMessageCallback)
g.Show()
GuiControlCallback(GuiOrCtrlObj, wParam, lParam, msg) {
; GuiOrCtrlObj is always Gui
OutputDebug("GuiControl.OnMessage: " Type(GuiOrCtrlObj))
}
OnMessageCallback(wParam, lParam, msg, hwnd) {
; If hovering over a control, hwnd is a handle to the control.
if CtrlObj := GuiCtrlFromHwnd(hwnd)
OutputDebug("OnMessage: " Type(CtrlObj))
}