Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: GUITEST module - FindWindow Question

by kelan (Deacon)
on Oct 21, 2003 at 20:33 UTC ( #301056=note: print w/replies, xml ) Need Help??

in reply to GUITEST module - FindWindow Question

The first parameter of FindWindowLike is window ID to start searching from. Usually you probably use 0, so that it starts with the Desktop (which is the ultimate parent of every window). What you should do is first use FindWindowLike to get your main apps window ID, then use that as the first argument in a subsequent call that loops until it finds the new window, like batkins suggested above. Something like this:

my ($mainapp) = FindWindowLike(0, 'FOO'); my $childwin; while (!$childwin) { select(undef, undef, undef, 0.1); # sleep for 1/10th second ($childwin) = FindWindowLike($mainapp, 'FOO'); } # do stuff with $childwin
Remember that FindWindowLike returns a list, so you need the parentheses around the variable if you're assigning to a scalar.


Perl6 Grammar Student

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://301056]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2022-12-05 20:34 GMT
Find Nodes?
    Voting Booth?

    No recent polls found