Jump to content

Recommended Posts

Posted (edited)

HI all,

I am trying to get text from a button.

I can click the button so my class name is right.

Here is some information about the button:

>>>> Window <<<<
Title:  Statics Control
Class:  TStaticsControlForm
Position:   862, 198
Size:   378, 488
Style:  0x16CC0000
ExStyle:    0x00010100
Handle: 0x00000000001606E0

>>>> Control <<<<
Class:  TStaticButton
Instance:   20
ClassnameNN:    TStaticButton20
Name:   
Advanced (Class):   [CLASS:TStaticButton; INSTANCE:20]
ID: 395060
Text:   
Position:   2, 2
Size:   140, 20
ControlClick Coords:    95, 15
Style:  0x54000000
ExStyle:    0x00000000
Handle: 0x0000000000060734

>>>> Mouse <<<<
Position:   967, 265
Cursor ID:  0
Color:  0xF0F0F0

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<


>>>> Hidden Text <<<<

The button has the name 01 strobe int.

I can use some commands like is visible but i can't use add string ischecked etc.

Check and uncheck works great.

Is there a way to get the text of my button?

This is my line i am using:

$check = ControlGetText("Statics Control","","[CLASS:TStaticButton; INSTANCE:20]")

I also would like to use the ischecked function to see if the button is checked but that does not work, is there also a solution for?

Hope you can help me :mellow:

Edited by Erik.

I little problem, hard to find and fix

Posted

Indeed it says it has no text but it has, that the strange thing.

Will GUICtrlRead work when it's an eternal program that has not been made with autoit?

I little problem, hard to find and fix

Posted

The control information looks very much like the app is written in Delphi and Delphi controls can be difficult to work with using normal automation methods.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Posted (edited)

What is the solution?

Edit:

I have found an example plugin program for the main program and it is programmed in Delphi.

The plugin program can control the main program and uses the function Sendmessage.

Edited by Erik.

I little problem, hard to find and fix

Posted (edited)

Tried that option, it does not matter if the button has been pressed or not i always get a 0 back.

Tried this:

$check = ControlCommand("[CLASS:TStaticsControlForm]","","[CLASS:TStaticButton; INSTANCE:20]","IsChecked","")
Edited by Erik.

I little problem, hard to find and fix

Posted

I will try that in a minute :mellow:

That is the button i want to read the text and if it has been pressed.

I little problem, hard to find and fix

Posted

Start at the beginning.

Does this work?

WinActivate("[CLASS:TStaticsControlForm]")

Yes that works fine.

I can also check the button with controlcommand, i can not uncheck the button.

I little problem, hard to find and fix

Posted

The state is always 0.

There is another way to see if the button is activated.

The button will color green if it's activated.

Only problem then is, you can only see if the button is programmed by the text at the button.

I little problem, hard to find and fix

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...