Jump to content

Automating a custom application


Am3oo
 Share

Recommended Posts

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.

Link to comment
Share on other sites

  • Moderators

What about this?

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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...