Is there any way to make WM_LButtonDown fire only once?
Or how to judge whether the main window or the child window is triggered?
Execute the following code, you can observe that when the child window is clicked once,
WM_LButtonDown will be triggered twice.
Code: Select all
gui,p:+OwnDialogs +hwndhm
gui,p:Color,White
gui,p:show,w800 h500
gui,child1:+Parentp +hwndhm1
gui,child1:color,00BFFF
gui,child1:show,x200 y100 w500 h300
gui,child2:+Parentp +hwndhm2
gui,child2:color,FF6347
gui,child2:show,x70 y150 w400 h200
OnMessage(0x201, "WM_LButtonDown")
Return
WM_LButtonDown(wparam, lparam, msg, hwnd )
{
global
ToolTip % A_Tickcount "`n" hwnd " = " ToBase(hwnd,16) " = " hm " = " hm1 " = " hm2 "`n" wparam " = " lparam " = " msg
sleep,1000
}
ToBase(n,b){
return (n < b ? "" : ToBase(n//b,b)) . ((d:=Mod(n,b)) < 10 ? d : Chr(d+55))
}
esc::ExitApp