Jump to content

Controlclick?


Recommended Posts

; 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

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

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

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

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 by ccmt19
Link to comment
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
 Share

  • Recently Browsing   0 members

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