WaitWindowOpen ignores WIN_USEHANDLE=1

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Baldrik
Junior Coder
Posts: 24
Joined: Mon Feb 14, 2005 11:11 pm
Location: TA7, UK

WaitWindowOpen ignores WIN_USEHANDLE=1

Post by Baldrik » Wed Feb 23, 2005 1:38 am

I can't get WaitWindowOpen to take any notice of the system variable that says whether the window parm is being specified by title or by handle. The pdf manual says GetActiveWindow AND WaitWindowOpen operate differently according to 0 or 1 in WIN_USEHANDLE.

For me, WaitWindowOpen always seems to timeout and sets result FALSE if I use a handle parm (after I set WIN_USEHANDLE=1).

This script demonstrates it - was expecting msg 3 to say TRUE (meaning found the window) and msg 4 FALSE, but when I run it msg 3 says FALSE and msg 4 says TRUE.

let>WW_TIMEOUT=2
let>VAREXPLICIT=1
let>MSG_STAYONTOP=1
let>WF_TYPE=1

// get the title & handle of an active window
let>WIN_USEHANDLE=0
getactivewindow>win_title,x,y
ask>msg 1 - WIN_USEHANDLE=%WIN_USEHANDLE% getactivewindow title is %win_title%,ok
let>WIN_USEHANDLE=1
getactivewindow>win_handle,x,y
ask>msg 2 - WIN_USEHANDLE=%WIN_USEHANDLE% getactivewindow handle is %win_handle%,ok

// test waitwindowopen - with USEHANDLE=1 expected msg3 TRUE & msg4 FALSE but got other way (as if WIN_USEHANDLE=0)
waitwindowopen>%win_handle%
ask>msg 3 - WIN_USEHANDLE=%WIN_USEHANDLE% waitwindowopen by handle - result is %WW_RESULT% (expect TRUE but got FALSE),ok
waitwindowopen>%win_title%
ask>msg 4 - WIN_USEHANDLE=%WIN_USEHANDLE% waitwindowopen by title - result is %WW_RESULT% (expect FALSE but got TRUE),ok

// test waitwindowopen - with USEHANDLE=0 - expect & got TRUE for msg6 (by title)
let>WIN_USEHANDLE=0
waitwindowopen>%win_handle%
ask>msg 5 - WIN_USEHANDLE=%WIN_USEHANDLE% waitwindowopen by handle - result is %WW_RESULT%,ok
waitwindowopen>%win_title%
ask>msg 6 - WIN_USEHANDLE=%WIN_USEHANDLE% waitwindowopen by title - result is %WW_RESULT%,ok


Does anyone else get the same?

Or is it a documentation error and WaitWindowOpen by handle isn't really provided?

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