Cotino Posted May 10, 2016 Share Posted May 10, 2016 Hi, I recently learned about Control functions and I'm trying to put them to use on Paint. However i have a problem with ControlClick : it doesn't work when Paint is inactive (minimized or not on top) Here is what I'm doing ControlClick( WinGetHandle( "Untitled" ), "", "", "Left", 1, 500, 500 ) It works if Paint is active, it draws a dot at 500,500 even though my mouse is somewhere else. However, it does not work when the window is inactive. Am I missing something ? I searched for a while and tried #RequiredAdmin which did nothing more, and _MouseClickPlus from another member which doesn't work at all. Is there any other way to send a mouse click to an inactive window knowing its handle ? Link to comment Share on other sites More sharing options...
Trong Posted May 11, 2016 Share Posted May 11, 2016 ControlClick ( "title", "text", controlID [, button = "left" [, clicks = 1 [, x [, y]]]] ) controlID is not empty. WinActivate("Untitled - Paint") MouseClickDrag("left",300,200,400,500) MouseClickDrag("left",200,300,400,500) Regards, Link to comment Share on other sites More sharing options...
Cotino Posted May 11, 2016 Author Share Posted May 11, 2016 (edited) 15 minutes ago, Trong said: WinActivate("Untitled - Paint") MouseClickDrag("left",300,200,400,500) MouseClickDrag("left",200,300,400,500) This activates the window. I am trying to do the same thing while being on another window. On most examples I've seen, they leave controlID empty and it works. I tried using _WinAPI_GetDlgCtrlID() to get the controlID. Doesn't work either. Edited May 11, 2016 by Cotino Link to comment Share on other sites More sharing options...
HuaAi Posted May 12, 2016 Share Posted May 12, 2016 Found the same problem, had to activate the window before using ControlClick(). 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