Jump to content

controlclick() [Question]


Recommended Posts

the x and y is just within the control it clicks if you read the parameters properly

x [optional] The x position to click within the control. Default is center.

y [optional] The y position to click within the control. Default is center.

to just click using x & y and no controlID use MouseClick.

GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.
Link to comment
Share on other sites

Use autoit window info tool to get control names. Even tho I say controls, mostly they are buttons or radio buttons or check boxes = controls.

ControlClick("RF Online", "", "Button1") ; Window name, "", control name.

;~ Or if you cant find out control name. then you can use x & y coordinates
;~ -------------------------------------------------------------------------------------
Opt("MouseCoordMode", 1)        ;1=absolute, 0=relative to active window, 2=client
MouseClick("left", 0, 500, 2) ;, Left mouse,x,y, mouse movind speed
Edited by goldenix
My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
Link to comment
Share on other sites

ControlSend() is almost always preferable to Send() because it is more reliable and works on windows that are not active.

The X/Y position of a control can be used to identify it with an Advanced Control ID:

#include <GuiConstantsEx.au3>

$hGUI = GUICreate("Test", 300, 300)
For $n = 0 To 3
    ; Buttons are at X=100; Y=20, 70, 120, and 170
    GUICtrlCreateButton("Button_" & $n, 100, ($n * 50) + 20, 100, 30)
Next
$idTest = GUICtrlCreateButton("TEST", 100, 250, 100, 30)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $idTest
            $sTxt = ControlGetText($hGUI, "", "[X:100; Y:120]") 
            ConsoleWrite("Text = " & $sTxt & @LF) ; Should be Button_2
    EndSwitch
WEnd

When you click TEST on this demo, it reads the text of one button, identifying it by X/Y coordinate. That could just as easily be ControlClick() vice ControlGetText().

Note in this usage that X/Y are client area relative coordinates of the control itself (top/left corner), not just any point inside the control.

:idea:

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...