Jump to content

Question About How Controlgettext Works.


Recommended Posts

I have a control that I want to get the text from. The control is THiStatic1. I know this is the right control because when I hide the control with...

ControlHide ( "Edit Membership", "", "THiStatic1" )

...the text I want disappears off the window. However, ControlGetText for this control returns NUL. My question is, Does ControlGetText do some error checking to prevent it from returning garbage or is there a way I can get the raw data from this control. Just not sure how ControlGetText gets it's text.

Thanks,

Fz

Link to comment
Share on other sites

did you check the @error? according to the help it'll return "" if there's an error... alot of apps work in ways that autoit doesn't play well with...

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

use AutoIt spy and move your mouse over the control, if no text shows, then controlgettext will give you the same. You can use other ways to get text from a control, like sending ^A^C to that control perhapse.

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

Yes, spy show nothing as well. Showes the control name with no text. I have given focus to that control and tryied ^C but I didn't try ^A first. I'll try that next.

Thanks!

Link to comment
Share on other sites

No, I gave focus to the control and then ^A^C and tried to past the contents but it just had my previous contents in the clipboard. I also tried to...

ControlSetText ( "Edit Membership", "", "THiStatic1", "Arrghh!" )

...with no luck. :D

Link to comment
Share on other sites

Nope, it's just static text...although there is some color at the end of it...it's actually in a dialog box from an NWAdmin32 app for GroupWise. It looks like:

Editing membership for Loan Authorities@Corpdom.Corppost.

Link to comment
Share on other sites

might not be a standard control, but anyway this is one more guess. Child window, or hidden control?

Opt("WinDetectHiddenText", 0) ;0=don't detect, 1=do detect

Opt("WinSearchChildren", 1) ;0=no, 1=search children also

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

Well, those are great ideas but they don't work. :D

I was already using the hiddentext one but hadn't tried the child thing.

Here's the dialog box:

Posted Image

I can get all of the text on this dlg except what I really need at the top. Obviously the text is in memory somewhere. Anyway to get access to this info short of a debugger?

Link to comment
Share on other sites

Strange, from the looks of that it should show up in standard text for that window. look in autoitspy under

>>>>>>>>>>>( Visible Window Text )<<<<<<<<<

does it show there?

if so, try a simple:

$x=WinGetText ( "Edit Membership" )

...edit, of course you would need to parse it afterwards.

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

ScriptKitty: No, ALL other text on that window does show up in Visible Window Text, but not what I need.

Larry: I too Googled it yesterday and saw no hits. /cry

I might try doing a search with a debugger in memory for the string and see if I can extract that same location when I need it. I'm starting to get out of my comfort zone though. =-)

Thanks for everyone's help!

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