ccmt19 Posted April 1, 2008 Share Posted April 1, 2008 (edited) I tried to make my scrip run with inactive window, how can i use my mouseclick's coordinate with controlclick (I've check & that window has no controlID ) Edited April 1, 2008 by ccmt19 Link to comment Share on other sites More sharing options...
Squirrely1 Posted April 1, 2008 Share Posted April 1, 2008 ; Note GUI must be active for this to work ... Opt("MouseCoordMode", 0) $x = 48; use the real x coordinate to click, relative to GUI $y = 39; use the real y coordinate to click, relative to GUI MouseClick("left", $x, $y, 1, 0) Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
FreeFry Posted April 1, 2008 Share Posted April 1, 2008 I tried to make my scrip run with inactive window, how can i use my mouseclick's coordinate with controlclick (I've check & that window has no controlID ) Try using ControlClick with "" as the ControlID parameter, ex: ControlClick("Window", "", "", "left") Link to comment Share on other sites More sharing options...
ccmt19 Posted April 1, 2008 Author Share Posted April 1, 2008 i tried this run("C:\WINDOWS\system32\mspaint.exe") WinWaitActive("untitled - Paint") WinSetState ( "untitled - Paint", "", @SW_MINIMIZE ) sleep(2000) WinSetTitle("untitled - Paint","","ccmt19") sleep(2000) Opt("MouseCoordMode", 0) $x = 200 $y = 250 MouseClick("left", $x, $y, 1, 0) and this run("C:\WINDOWS\system32\mspaint.exe") WinWaitActive("untitled - Paint") WinSetState ( "untitled - Paint", "", @SW_MINIMIZE ) sleep(2000) WinSetTitle("untitled - Paint","","ccmt19") sleep(2000) ControlClick("ccmt19","","", "left", 1) sleep(2000) but didn't work. Did i make any mistake? Help me to correct it please Link to comment Share on other sites More sharing options...
FreeFry Posted April 1, 2008 Share Posted April 1, 2008 Try this(if it's mspaint you want to automate, it has a controlID you can use. called "Afx:1000000:81": Opt("WinTitleMatchMode", 4) Run("mspaint.exe") WinWait("[CLASS:MSPaintApp]") $wPos = ControlGetPos("[LAST]", "", "Afx:1000000:81") ; get the size of the control WinSetState("[LAST]", "", @SW_MINIMIZE) ; minimize the window Dim $x2 = Int(($wPos[2]/2)) ; funny stuff For $x = 1 To Int(($wPos[2]/2)) ConsoleWrite("x: " & $x & @TAB & "y: " & $x & @LF) ; show us where we're at! ControlClick("[LAST]", "", "Afx:1000000:81", "left", 1, $x, $x) ; click inside the paint control ControlClick("[LAST]", "", "Afx:1000000:81", "left", 1, $x2, $x) ; funny stuff $x2 -= 1 ; funny stuff Next That clicks in the control, and draws a cross.. Link to comment Share on other sites More sharing options...
ccmt19 Posted April 2, 2008 Author Share Posted April 2, 2008 (edited) i'm srr because i didn't mention it clearly ... i used mspaint as an example (so i can check if it has been clicked) the window that i worked with, it has no controlID . btw, it's useful stuff, i think i should try with some new functions Edited April 2, 2008 by ccmt19 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