Problem identifying Window

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Problem identifying Window

Post by Jerry Thomas » Thu Jan 20, 2011 4:29 pm

I am trying to grab text from a control - TVirtualTreeHintWindow.
The problem, there seems to be no parent window.

When I set the focus and then use GetWindowNames, the title is blank but the class is correct.

When I use View System Windows, I see the control (it matches the class from the previous comment) but it is under the top class.
This is what I get:

Code: Select all

65552 - #32769 ""
...
  396314-TVirtualTreeHintWindow


With GetWindowNames, title is blank.
But then if I use the returned handle and class:

Let>WIN_USEHANDLE=1

GetWindowText>WinHandle,rslt                  returns blank

GetWindowTextEx>WinHandle,rslt               returns blank

GetControlText>winHandle,winClass,1,rslt   returns ##NOSUCHOBJECT#
Any ideas?
Thanks,
Jerry

[email protected]

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Jan 20, 2011 6:48 pm

One quick thought. Using GetControlText> what happens if you set the instance to 0. Wouldn't that make sense if this window doesn't have a parent? The error message ##NOSUCHOBJECT## indicates either a class or instance failure.

Code: Select all

GetControlText>winHandle,winClass,0,rslt

Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Post by Jerry Thomas » Thu Jan 20, 2011 7:33 pm

GetControlText>winHandle,winClass,0,rslt returns ##NOSUCHOBJECT##
Thanks,
Jerry

[email protected]

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Jan 21, 2011 9:10 am

65552 - #32769 ""
...
396314-TVirtualTreeHintWindow
This tells us the classname is "TVirtualTreeHintWindow" and there is no exposed window/caption text. You're using winClass as the class name.

See:
http://www.mjtnet.com/blog/2009/02/19/v ... d-objects/

So GetWindowText will return nothing. GetControlText will return nothing. Your GetControlText has winClass as the class name which is why you're getting no such object.

The only things that *may* work are GetWindowTextEx, GetTextAtPoint or GetTextInRect. Specify coordinates for the latter or the MAIN window title for the former. GetWindowTextEx is really a wrapper for GetTextInRect - it focuses the given window, and gets it's screen bounds and then calls GetTextInRect with those bounds.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts