Jump to content

Recommended Posts

Posted

For the longest time I have been running into a problem where I can’t control click unless the window is active. It will work on some programs and not others. I don’t have a specific program in mind at the moment but here Is some example code.

#RequireAdmin

HotKeySet("{ESC}","_exit")
HotKeySet("X","_Run")
Global $x= 45
Global $y= 30
$Title = "Program Name"
$hwnd = WinGetHandle($Title)

While 1
Sleep (100)
WEnd

Func _Run()
ControlClick($hwnd,"","","left",1,$x,$y)
EndFunc

Func _Exit()
   Exit
EndFunc

I know this is not very well written but it’s just an example. When the window is active it clicks as it should however it won’t in the background. My question is this, how can get a mouse click to a client without activating the window?

Posted

Try ControlClick ( "title", "text", controlID [, button = "left" [, clicks = 1 [, x [, y]]]] )

But as its description reads, "Some controls will resist clicking unless they are the active window."

Posted

Billy that is what I am using, note the _Run() Function. However as you pointed out the problem resisting the ControlClick more than anything that is what I am trying to find a way around

  • Moderators
Posted

What is the application? How about a screenshot of the control you are attempting to click? Without anything more than "it doesn't work on some application" we cannot do much to help.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted

example would be bluelstacks an android OS Emulator. But I don't have an app in mind at the moment more of a project to figure out a way around it. 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...