Jump to content
Sign in to follow this  

Can't address control in window with blank title.

Recommended Posts



I'm trying to automate a drawing-program. I can activate the window and drive it generally. It has one dialogue which has no window title. Dialogue has groups, checkboxes, buttons (all 'Buttons' as seen by AutoIt WindowInfo). I'm trying to look at them and mouseclick them, initially using ControlGetPos but failing, @error = 1. I guess the problem is the blank window title, so how do I address it? Is there a way to use the #32770 to identify the window?

ControlGetPos(<Blank window title or class?>, "", "[CLASS:Static; INSTANCE:11]")

>>>> Window <<<<
Class: #32770
Position: 485, 246
Size: 470, 68
Style: 0x944000C4
ExStyle: 0x00010101
Handle: 0x000D0514

>>>> Control <<<<
Class: Button
Instance: 11
ClassnameNN: Button11
Advanced (Class): [CLASS:Button; INSTANCE:11]
ID: 2610
Text: Discrete
Position: 26, 39
Size: 83, 20
ControlClick Coords: 27, 12
Style: 0x50010000
ExStyle: 0x00000004
Handle: 0x002507FA

And I've tried reading the text from the main window (text looks right), and using that to identify the parent window:

$sText = WinGetText($sTitle, "")
ConFmtWr("WText ~%s~\n", $sText)
ControlGetPos("", $sText, "[CLASS:Static; INSTANCE:11]")
ConFmtWr("CGP %d\n", @error)

I hope someone can help, otherwise I'm going to have to find the window by pixel-searching, and reference all the controls by pre-recorded coordinates (yuk).


Share this post

Link to post
Share on other sites

Thanks, that was interesting, "[CLASS:#32770]" is the correct syntax. It must be a very common number, and ControlGetText is pulling some text from some other window that I don't see or recognise the text.


For $iIx = 1 To 10
$sCtrl = StringFormat("[CLASS:Button;INSTANCE:%d]", $iIx)
$sText = ""
$sText = ControlGetText("[CLASS:#32770]", "", $sCtrl)
ConFmtWr("MC %2d ~%s~\n", $iIx, $sText)

MC 1 ~18268(&A)~
MC 2 ~Message~
MC 3 ~&Remove Message~
MC 4 ~Close &Window~
MC 5 ~&Clean File~
MC 6 ~Delete &File~

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.