Jump to content

WinGetText and ControlGetText not returning anything


Ruud
 Share

Recommended Posts

Hey everyone!

I'm stuck trying to get text from a control.

The control's info:

>>>> Window <<<<

Title: Glot Professional

Class: WindowsForms10.window.8.app.0.3553390

Position: -1579, 216

Size: 912, 666

Style: 0x16CF0000

ExStyle: 0x00050100

Handle: 0x001E0550

>>>> Control <<<<

Class: WindowsForms10.window.8.app.0.3553390

Instance: 8

ClassnameNN: WindowsForms10.window.8.app.0.35533908

Name: EuroglotGridBase

Advanced (Class): [NAME:EuroglotGridBase]

ID: 459892

Text:

Position: 17, 85

Size: 426, 415

ControlClick Coords: 163, 266

Style: 0x56010000

ExStyle: 0x00010200

Handle: 0x00070474

First I tried

ControlGetText($"Glot Professional", "", "WindowsForms10.Window.8.app.0.35533908")

and various variations on the control ID ("[Name:EuroglotGridBase]", etc.).

The control gets found, however, no text is returned.

Q1: What kind of control is this anyway? I'm thinking it's a subform, but have no idea how to interact with it.

Then I tried to target the entire window with

WinGetText("Glot Professional")

Some text is returned, e.g. text visible in other controls (textboxes, comboboxes, command buttons, ...), but not that which is visible in the control I'm trying to get the text of.

Q2: Does this automatically mean that any attempts to get the text by targeting the control directly (instead of the entire window) will fail?

Q3: Any suggestions how to tackle this problem?

Thank you!

Ruud

PS - I could post a screenshot if at all helpful.

Link to comment
Share on other sites

Hey John,

Thanks for your quick reply.

Unfortunately that doesn't work either.

Some additional information:

When I look at the 'visible text' and 'hidden text' tabs of AutoIt Window Info, the text i'm looking for is not there (but all the text I get with WinGetText is).

Does this mean I cannot obtain it?

Thanks again

Link to comment
Share on other sites

The thing is I can give the control focus, and also send keystrokes that make the selection jump from word to word. I'd almost say there has to be a way to get its text directly...

If worse came to worse I could of course use the sending-keystrokes-ability to copy-paste the words one by one to a location elsewhere. However this would have me loose non-selectable words/information that I need to. And I sure hope there's an easier, less error-prone way of interacting with this thing!

PS - The attached screenshot shows in green (red) the controls I can (cannot) interact with / get the text from; just to get an idea what I'm dealing with.

post-70958-0-72132300-1331845297_thumb.p

Link to comment
Share on other sites

Another thought - the control I'm trying to interact with seems to be a form in itself; it is of the same class as the form it's placed on. I'm not sure if that's helpful or usuable, but I thought I'd share my observations :oops:

Edited by Ruud
Link to comment
Share on other sites

I'm afraid that what you can do with keyboard input does not mean anything, nor does

the fact you can do one thing with one control, but not another.

If it not a standard windows control, and not giving up its secrets, there is really very

little you can do.

Of course, someone might come along who knows otherwise.

Best of luck with it .

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

Alright John, thanks for your help; I didn't expect these things to be so complicated! :oops:

Maybe I can try OCR... though that'll really slow things down of course, and things are already time-critical as they are.

I take it that the fact the control seems to be a form/window in itself is irrelevant, then?

Link to comment
Share on other sites

Thanks for that tip WSorich.

Currently I'm using OCR for some parts, but that's really slow and not an option if I don't want to let it run for 6 months or so before completing :oops:

I'll have a look and see if I can get some more info - but I'm afraid I'm too new to autoit so that we're at the mercy of more knowledgeable people :bye:

Link to comment
Share on other sites

If you can't directly read the text, there may be other ways. Using the menus of the window in the screenshot, can you export the text you see in the red controls to a file, or another dialog that you'd be able to read, or can you put the whole thing in the clipboard?

Link to comment
Share on other sites

Hey rodent1,

I tried all of that; on 1 control nothing works, on the other 2 controls only sending keystrokes works - I need to loop through the words and copy by sending {DOWN} and {^C}. Though this is cumbersome, it does work - I was just hoping for something a bit higher-level, I guess.

On the 1 other control, the only thing that works is OCR, which, as mentioned, is really really slow, and therefore unusable.

Other tips are appreciated, I guess I laid my hope on the thread that WSorich mentioned ()

Cheers!

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 years later...

As has been mentioned -- what about using the clipboard? For instance, can you send "^a" to select all of the text held by the control (if it is some sort of edit control), then "^c" to copy it, then finally get the clipboard contents with ClipGet()?

I was having a similar issue as OP and this solved the problem, thanks!

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