From a Perl script,I'm trying to use GUI or GuiTest to bring a minimized window to the foreground. Any ideas of what I'm doing wrong. I'm running on XP.
When running this program below, I do have paint up, but minimized.
C:\Perl\Win32-GuiTest-1.54\eg>active.pl
Windows:1843712:
* Could not set the window id: 1843712 a
* Window id: 1843712 brought to foregrou
1843712> 'untitled - Paint'
use Win32::GuiTest qw(:ALL);
use Win32::GUI;
$Win32::GuiTest::debug = 0; # Set to "1" to enable verbose mode
my @windows = FindWindowLike(0, "Paint", "");
print "Windows:@windows:\n";
for (@windows) {
$window=$_;
Win32::GUI::BringWindowToTop($window);
my $success = 1;
if ( SetActiveWindow($window) ) {
print "* Successfully set the window id: $window active\n";
}
else {
print "* Could not set the window id: $window active\n";
$success = 0;
}
if (SetForegroundWindow($window) ) {
print "* Window id: $window brought to foreground\n";
}
else {
print "* Window id: $window could not be brought to foreground\n";
$success = 0;
}
print "$_>\t'", GetWindowText($_), "'\n";
SendKeys("%f");
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
From a Perl script,I'm trying to use GUI or GuiTest to bring a minimized window to the foreground. Any ideas of what I'm doing wrong. I'm running on XP.
When running this program below, I do have paint up, but minimized.
C:\Perl\Win32-GuiTest-1.54\eg>active.pl
Windows:1843712:
* Could not set the window id: 1843712 a
* Window id: 1843712 brought to foregrou
1843712> 'untitled - Paint'
use Win32::GuiTest qw(:ALL);
use Win32::GUI;
$Win32::GuiTest::debug = 0; # Set to "1" to enable verbose mode
my @windows = FindWindowLike(0, "Paint", "");
print "Windows:@windows:\n";
for (@windows) {
$window=$_;
Win32::GUI::BringWindowToTop($window);
my $success = 1;
if ( SetActiveWindow($window) ) {
print "* Successfully set the window id: $window active\n";
}
else {
print "* Could not set the window id: $window active\n";
$success = 0;
}
if (SetForegroundWindow($window) ) {
print "* Window id: $window brought to foreground\n";
}
else {
print "* Window id: $window could not be brought to foreground\n";
$success = 0;
}
print "$_>\t'", GetWindowText($_), "'\n";
SendKeys("%f");
}
I am very keen to use win32-guitest. However, having difficulty getting started:
[snippet]
C:\Temp>dir win*
Volume in drive C has no label.
Volume Serial Number is 544E-949A
Directory of C:\Temp
12/15/2007 05:01 PM 430 Win32-GuiTest.ppd
12/15/2007 04:59 PM 177,055 Win32-GuiTest.tar.gz
2 File(s) 177,485 bytes
0 Dir(s) 47,754,022,912 bytes free
C:\Temp>ppm install c:\temp\win32-guitest.ppd
ppm install failed: The PPD does not provide code to install for this platform
C:\Temp>more win32-guitest.ppd
<SOFTPKG NAME="Win32-GuiTest" VERSION="1,55,0,0">
<TITLE>Win32-GuiTest</TITLE>
<ABSTRACT>Perl GUI Test Utilities.</ABSTRACT>
<AUTHOR>Dennis K. Paulsen (ctrondlp@cpan.org), Ernesto Guisado (erngui@acm.org)</AUTHOR>
<IMPLEMENTATION>
<OS NAME="MSWin32" />
<ARCHITECTURE NAME="MSWin32-x86-multi-thread-5.8" />
<CODEBASE HREF="Win32-GuiTest.tar.gz" />
</IMPLEMENTATION>
</SOFTPKG>
C:\Temp>
[/snippet]
I am willing to provide any description of my platform requested.
I am willing to try any fix/workaround suggested.
Thank you in advance for your aide.
eundv