Jump to content
Sign in to follow this  

How to use Control ID if its changes every time i Start the program ?

Recommended Posts


I am trying to Use control ID functions in my script.

here is a copy paste from the Autoit window info when i hover the control i want to use

>>>> Window <<<<

Title: Magic Online 3.0

Class: WindowsForms10.window.8.app.0.378734a

Position: 152, 115

Size: 720, 508

Style: 0x16010000

ExStyle: 0x000D0000

Handle: 0x001706D8

>>>> Control <<<<

Class: WindowsForms10.STATIC.app.0.378734a

Instance: 5

ClassnameNN: WindowsForms10.STATIC.app.0.378734a5

ID: 19990634

Text: Starting up...

Position: 207, 330

Size: 330, 23

ControlClick Coords: 265, 9

Style: 0x5600000D

ExStyle: 0x00000000

Handle: 0x0131086A

>>>> Mouse <<<<

Position: 624, 454

Cursor ID: 2

Color: 0x3A6EA5

>>>> StatusBar <<<<

>>>> Visible Text <<<<



Starting up...

>>>> Hidden Text <<<<

Now i want to click the "Launch" button inside that window (as soon as the "Starting up..." is done )

what i did was

while 1
        WinActivate("Magic Online 3.0", "")
        sleep (1000)
        ConsoleWrite ("waiting for MTGO to be ready")
        if ProcessExists("kicker.exe") Then
            while ControlFocus ("Magic Online 3.0","Starting up...",[Class: WindowsForms10.STATIC.app.0.378734a])
            $handle= ControlGetHandle("Magic Online 3.0","Starting up...")
            consoleWrite ("The handle is  "&"  " &$handle)
                sleep (500)
            sleep (1000)
        ControlClick ( "Magic Online 3.0", "Launch",[Class: WindowsForms10.STATIC.app.0.378734a])       
            sleep (500)

Not working ...

I tried using the control ID - and i have no compiling errors there - but the function never works ( i guess because the ID is changing).

With the above script i have a compiling error...

what am i doing wrong ?

Share this post

Link to post
Share on other sites

You should use: [CLASSNN:WindowsForms10.STATIC.app.0.378734a5] And no spaces in it, beacuse they aren't ignored :D

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post

Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...