Sign in to follow this  
Followers 0
VijayKumarLikhi

Read text from TextBox

10 posts in this topic

Hi All,

Not able to get content from TextBox control of Class:BEDIT type.

The application is developed in VC++.

I have tried 'ControlGetText()' function, it is returning the name/Text of control.

Below is the information about TextBox control using "AutoIt Window Info" tool.

Please share solution for the same. I am in need of urgent help... please respond as soon as possible

Thanks a lot in advance.

>>>> Window <<<<

Title: DPM8016_1 - Matrix

Class: #32770

Position: 198, 107

Size: 592, 504

Style: 0x94C800C4

ExStyle: 0x00010181

Handle: 0x004906BE

>>>> Control <<<<

Class: BEDIT

Instance: 2

ClassnameNN: BEDIT2

Name:

Advanced (Class): [CLASS:BEDIT; INSTANCE:2]

ID: 106

Text: DPM8016_1 - Matrix - OutChannelRampTime 1

Position: 69, 454

Size: 31, 15

ControlClick Coords: 16, 6

Style: 0x50000080

ExStyle: 0x00000010

Handle: 0x004B081A

>>>> Mouse <<<<

Position: 286, 588

Cursor ID: 0

Color: 0xFFFFFF

Share this post


Link to post
Share on other sites



Help somebody help you. Show the code you've tried. So somebody doesn't say 'try this', and you reply 'I've already tried that'.. Posting what you've done already saves everybody alot of time..


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Thanks for reply..

'ControlGetText()' works fine with TextBox of CLASS:EDIT.

But it seems that it does not work with TextBox of CLASS:BEDIT

if you have any alternative solution for getting the content from BEDIT type text box control, please let me know.

Thanks

Share this post


Link to post
Share on other sites

I agree, post your efforts, so people can see exactly what you tried.

You can mess about all day long just writing "ControlGetText()' works fine with TextBox of CLASS:EDIT" and the like.

But it is not code.

Its only your "urgent" time you are wasting if you cannot be bothered.


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

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Here is Code

$txt = ControlGetText("[Title:DPM8016_1 - Matrix]","","[CLASS:BEDIT;INSTANCE:2]")

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Does this work for you? $txt = ControlGetText("Title:DPM8016_1 - Matrix", "", "BEDIT2")

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

No, it is giving the Text of control not the content of TextBox.

Share this post


Link to post
Share on other sites

Can you post a screenshot of this program you're trying to get stuff from? Edit, if you can, the pic to draw lines around where you want to get stuff from and where you're getting from instead (the textbox and the control (which should be the same I think..)). Look again thru the Info tool output, is what you want listed in the 'visible text' section? Maybe the WinGetText function can be used..


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Since I seems to be having the same issue, I'm just continuing here, rather than starting a new one.

I have the same issue with being unable to read a textbox (which seems to be of type FastFileEdit).

I can read the button on the window, but not the textbox.

Part of the issue might be that the title of the window is empty (but that's just a guess).

The only method that finally worked for me (and might help others in a similar situation) was to copy the text into the clipboard, and to then read it from there. But that seems a bit clumsy, and I'm wondering if I'm overlooked some more "appropriate" method of retrieving the text.

The application I'm trying to automate is EasyCHM (whose demo version is fully functional).

The methods I tried (and their effect) are listed below, as well as a screenshot of the window in question, along with the data AutoIt's Window Info is retrieving:

$txt = ControlGetText ("","","[CLASS:FastFileEdit; INSTANCE:1]")
ConsoleWrite ("txt: " &amp; $txt &amp; @CRLF) ; returns nothing

$txt = ControlGetText ("[CLASS:TFormCompileStatus]","","[CLASS:FastFileEdit; INSTANCE:1]")
ConsoleWrite ("txt: " &amp; $txt &amp; @CRLF) ; returns nothing

$txt = WinGetText ("[CLASS:TFormCompileStatus]")
ConsoleWrite ("txt: " &amp; $txt &amp; @CRLF) ; returns &amp;Close

WinActivate ("[CLASS:TFormCompileStatus]")
ControlClick ("[CLASS:TFormCompileStatus]","","[CLASS:FastFileEdit; INSTANCE:1]")
Send ("^A")
Sleep (100)
Send ("^C")
$txt = _ClipBoard_GetData ()
ConsoleWrite ("txt: " &amp; $txt &amp; @CRLF) ; returns full content

post-68799-0-33539300-1327253817_thumb.g

Edited by Frescard

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