GetActiveWindow does not reutrn title

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
harrellb
Newbie
Posts: 1
Joined: Wed Jul 11, 2007 8:07 pm

GetActiveWindow does not reutrn title

Post by harrellb » Wed Jul 11, 2007 8:11 pm

I am trying to find out if a window has been made active which will indicate the end of another process. But GetActiveWindow continues to return numbers to me instead of the title of the window. The following code is just a sample I wrote that allows me 5 seconds to click on any window and make it active and then it tries to retrieve the title and display it. I have made sure to explicitly set WIN_USEHANDLE to 0.

Code: Select all

Let>WIN_USEHANDLE=0
Wait>5
LET>MyTitle="Bill"
GetActiveWindow>MyTitle
MessageModal>MyTitle

Any help you can provide will be greatly appreciated.

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

Post by JRL » Wed Jul 11, 2007 8:43 pm

From GetActiveWindow help:
GetActiveWindow>window_title,X,Y[,Width,Height]
Retrieves information about the current active window. The window title, and top left coordinates of the active window are stored in window_title, X and Y
In other words, try this rewrite:

Code: Select all

Let>WIN_USEHANDLE=0
Wait>5
GetActiveWindow>MyTitle,Win_X,Win_Y
MessageModal>%MyTitle%

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