ankit.tayal560 has asked for the wisdom of the Perl Monks concerning the following question:
Hi , I've written a code which should do the following function :till the window which is matched is active my script should be paused and as soon as that window ends my script should end.
use strict; use warnings; use Win32::GuiTest qw(:ALL); my @window=FindWindowLike(undef,"Calculator"); while($window[0]) { print("calculator window is open"); sleep 2; }
Now this script is not performing the function I require it to do. what is happening is it is going in a infinite loop and after the calculator window is closed then also it is printing "calculator window is open" with 2 seconds gap each time and the script keeps running.
P.S. calculator is taken as an example only. I've tried this with few other windows as well. it does not work.
P.S. I am not getting any error message as the script keeps running and does not end.
Any suggestions or help is appreciated! Thanks in advance .
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::GuiTest module application problem
by GrandFather (Saint) on Oct 19, 2016 at 07:39 UTC | |
by ankit.tayal560 (Beadle) on Oct 19, 2016 at 10:13 UTC | |
|
Re: Win32::GuiTest module application problem
by Discipulus (Canon) on Oct 19, 2016 at 07:24 UTC |