Hello, I lost a lot of time trying to do a simple ControlClick on a 3d party window that ignores it. I thought that was a lost battle until a friend get it working on autoit. It was nice but I don't want to rewrite my script to autoit, I like AHK, his syntax and also I can't understand why autoit could do and ahk not.
Well, testing the same things that I've tested a lot of times I found the solution, If I send the ControlClick when cursor was over the button, IT WORKS. The @[email protected]€@ button is enable to detect the cursor over it, it changes his color and it seems that ignores LBUTTON messages if cursor isn't over it.
Inspired on this thread: http://www.autohotke...n-the-pos-mode/
I do this:
ControlClick2(X, Y, WinTitle="", WinText="", ExcludeTitle="", ExcludeText="")
hwnd:=ControlFromPoint(X, Y, WinTitle, WinText, cX, cY
, ExcludeTitle, ExcludeText)
PostMessage, 0x200, 0, cX&0xFFFF | cY<<16,, ahk_id %hwnd% ; WM_MOUSEMOVE
PostMessage, 0x201, 0, cX&0xFFFF | cY<<16,, ahk_id %hwnd% ; WM_LBUTTONDOWN
PostMessage, 0x202, 0, cX&0xFFFF | cY<<16,, ahk_id %hwnd% ; WM_LBUTTONUP
It works perfeclty! ¿Maybe is doing autoit this as default? It clicks without moving my cursor.
it's a happy day for me (a lot of time without success....). I hope it could help to do AHK better. Regards.
PD: I've also tried with WM_MOUSEHOVER 0x2A1 but doesn't work with my window. Maybe it works in another windows...