Jump to content
Sign in to follow this  

ControlGetFocus stealing focus!

Recommended Posts


Hello, I'm new here.

I'd like to detect where is the focus in an other application.

But if I run the following code, I can't double-click anymore:

While 1

$CurrentWin = WinGetHandle("[Active]")

$CurrentControl = ControlGetFocus ($CurrentWin)



It seems that polling which control has the focus with ControlGetFocus()

resets somehow the click count... I can still double-click if I increase

the Sleep() duration, but that's not a good solution...

Any idea why this is happening ?

Share this post

Link to post
Share on other sites

No, I don't think that this is the reason. If you replace ControlGetFocus()

by an other function (like ControlGetHandle()), it doesn't end up with the same problem.

The simple script above should not prevent one to execute a double click action

in windows. Is there any work around this ? (I mean checking regularly which

external control has the focus without killing the mouse double click ?)

(do until loop is not a solution. It's not fundamentally different from a while...wend)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this