Sign in to follow this  
Followers 0
alisichkin

Can not push button on ToolBar

1 post in this topic

Hello!

I try to automate the reception overhead. I tried several options but none earned :(

I write the following script:

#include <MsgBoxConstants.au3>
#include <GuiToolbar.au3>
#include <SendMessage.au3>

Local $is_run = ProcessExists("client.exe") ; Check if the SIA process is running.
If Not $is_run Then
   Run("C:\SiaWin\ client.exe")
EndIf

Local $hWin = WinWait("[CLASS:TSiaMainForm]","", 2)
if Not $hWin Then
   MsgBox($MB_SYSTEMMODAL, "", "SIA not running")
   Exit
EndIf

Ok, It's running.

Program has Toolbar with buttons one of them I need to press (Button has name "Принять").

Au3Info:

Title:     Клиент системы заказов

Class:   TSiaMainForm

Position:           -8, -8

Size:     1376, 744

Style:    0x17CF0000

ExStyle:           0x00010100

Handle:            0x000A015A

>>>> Control <<<<

Class:   TPaintPanel

Instance:          1

ClassnameNN: TPaintPanel1

Name: 

Advanced (Class):       [CLASS:TPaintPanel; INSTANCE:1]

ID:       1574130

Text:   

Position:           292, 42

Size:     1068, 621

ControlClick Coords:   398, 137

Style:    0x56000000

ExStyle:           0x00010000

Handle:            0x001804F2

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

EToolBar

StatusPanel

            Строка поиска

OToolBar

Параметры

>>>> Hidden Text <<<<

Заказ

Поиск

 режим поиска

по фрагменту

с начала

 

Unfortunately Toolbar buttons do not have a handle, and get a list CommandID I can not - it is empty :(

The following code:

Local $hToolBar = ControlGetHandle($hWin, "", "[CLASS:TToolBar; INSTANCE:1]")
Local $iCount = _GUICtrlToolbar_ButtonCount($hToolBar)
MsgBox($MB_SYSTEMMODAL, "", "$iCount=" & $iCount)

Return ZERO

I try to press button using short key (In my case it's CTRL+G)

Send("^G") ; Nothing

ControlSend($hWin, "", "[CLASS:TToolBar; INSTANCE:1]", "^G") ; Nothing

Please, help.

Alexander.

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  
Followers 0