Jump to content
Sign in to follow this  
Am3oo

Automating a custom application

Recommended Posts

Am3oo

Hi,

I'm new to AutoIt, but not new to automation, although I've been only working with Web pages (Java and Selenium).

I'm not sure how to go about selecting any kind of item in the application I want to interact with.

Let's say The Window Info tool gives me this (it's a button on a toolbar):

>>>> Window <<<<
Title: Program - Home
Class: TfrmCentral
Position: 0, 0
Size: 1268, 768
Style: 0x16CF0000
ExStyle: 0x00050100
Handle: 0x00311762

>>>> Control <<<<
Class: TRzBMToolbarButton
Instance: 5
ClassnameNN: TRzBMToolbarButton5
Name:
Advanced (Class): [CLASS:TRzBMToolbarButton; INSTANCE:5]
ID: 1051362
Text: Repositories
Position: 5, 144
Size: 69, 68
ControlClick Coords: 40, 43
Style: 0x54010000
ExStyle: 0x00000000
Handle: 0x00100AE2

I've tried:

$handler= WinGetHandle("Program - Home");
WinActivate($handler);
;The 2 lines above work and the application is activated on the screen

Then:

_GUICtrlButton_SetState(1051362,True);

Also:

_GUICtrlButton_Click(1051362);
;didn't work

Also:

$item=_WinAPI_GetDlgItem($handler, 0x00100AE2);and with 1051362
_GUICtrlButton_Click($item);
;didn't work

Any pointer would be great.

Share this post


Link to post
Share on other sites
JLogan3o13

What about this?

ControlClick("Program - Home", "", "[CLASS:TRzBMToolbarButton; INSTANCE:5]")
  • Like 1

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Am3oo

You, sir..

are great! :)

Can I also get the window name when I have certain class name known? (then I'll stop asking these naive questions and only bother you people when I really can't find any documentation about something)

Edited by Am3oo

Share this post


Link to post
Share on other sites
JLogan3o13

Someone who is more knowledgeable than I may wander along and correct me, but I believe you have to include the window title in order for ControlSend to work properly, which would mean knowing the window name. If part of the window title will differ (e.g. Notepad - 123 or Notepad - 456), you can look at WinTitleMatchMode.

  • Like 1

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Am3oo

I've solved that issue with just selecting the class name provided by Window Info for the main window of the application.

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  

×