MarcoM Posted August 22, 2008 Share Posted August 22, 2008 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) Sleep(50) Wend 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 ? Link to comment Share on other sites More sharing options...
Aceguy Posted August 22, 2008 Share Posted August 22, 2008 you can click anymore because your stuck in the loop. try using do until... do whatever until $win_handle_active=true and $win_has_focus=true above is just an example [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
MarcoM Posted August 22, 2008 Author Share Posted August 22, 2008 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) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now