Jump to content

Control get text does not work


 Share

Recommended Posts

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

Link to comment
Share on other sites

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!"

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

I had limited success automating cheat engine once, and I think that is delphi.

try

#Include <GuiButton.au3>

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

$buttontext = _GUICtrlButton_GetText($button)

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

And if I remember correctly the controls needed focus

#Include <GuiButton.au3>

$button = ControlGetHandle("Statics Control","","[CLASS:TStaticButton; INSTANCE:20]");
ControlFocus("Statics Control","",$button)
$buttontext = _GUICtrlButton_GetText($button)

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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