View Single Post
  #3  
Old 11-17-2007, 05:32 PM
Surf Surf is offline
Senior Member
 
Join Date: Apr 2004
Location: Blogging
Posts: 5,619
Default Re: prevent focus stealing in Vista? messing up my AHK script

I found a decent workaround in case anyone has the same problem. When I first register a button click on a table i use MouseGetPos,,tableId to retrieve the ID # of the table under the cursor. Then, before I send a command like ControlClick or whatnot, I first use WinActivate, %tableId% to activate the table that was under the mousepointer when the click initially happened.

It's still possible that another table will steal focus in between the time the table is activated and the time the click is sent (in between 2 lines of code) but it is extremely unlikely.

Surf
Reply With Quote