Retrieve a Window Title

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
MikeSr
Junior Coder
Posts: 20
Joined: Sun Feb 07, 2010 8:31 pm
Location: Fort Myers, FL
Contact:

Retrieve a Window Title

Post by MikeSr » Sun Feb 07, 2010 8:39 pm

I have tried the GetWindowText command as shown:
GetControlText>SomeProgram - [C:\Users\Mikesr\Documents\01 BANYAN\01 Engineering\MCL.xxx] (Runtime 00:12:35),,1,strText

I need to examine the part of the title (Runtime 00:12:35), as it is constantly changing. I have replaced the Window name as follows:
GetControlText>SomeProgram - [C:\Users\Mikesr\Documents\01 BANYAN\01 Engineering\MCL.xxx] (Runtime *),,1,strText

The string returns: ##NOSUCHOBJECT##

Once I can read the Window Title, I can then parse the string "strText" to examin the time.

Just can't seem to read the Window Title.

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Post by gdyvig » Sun Feb 07, 2010 8:57 pm

Hi MikeSr,

Try "View System Windows" from the menu to see how/whether it is identified there.

The * must be the last character of your wildcarded window name.

Also, you just use Runtime* as the wildcard means "contains".


Gale

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

Post by JRL » Mon Feb 08, 2010 2:05 am


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