use strict;
use Win32::GuiTest qw(FindWindowLike GetChildWindows GetWindowText
GetWindowID SetActiveWindow SetForegroundWindow
PostMessage);
sub WM_LBUTTONDOWN { 0x0201; }
sub WM_LBUTTONUP { 0x0202; }
my @winlst;
my $tries = 0;
while ($tries < 20) {
print "trying to find the window\n";
@winlst = FindWindowLike(0,'StatusBar','TkTopLevel');
last if scalar(@winlst) > 0;
$tries++;
sleep 1;
}
if (@winlst == 1) {
my $status = $winlst[0];
my $i;
my $x = 30;
my $y = 14;
my $xy = ($y << 16) + $x;
print "trying to send a click to the window\n";
SetForegroundWindow($status);
SetActiveWindow($status);
PostMessage($status, WM_LBUTTONDOWN, 0x0001, $xy);
PostMessage($status, WM_LBUTTONUP, 0, $xy);
}
####
use strict;
use Win32::CtrlGUI;
my $win = Win32::CtrlGUI::wait_for_window("ParpadStatus");
my $x = 30;
my $y = 14;
my $xy = ($y << 16) + $x;
print "trying to send a click to the window ",
sprintf("0x%lx",$win->handle),"\n";
$win->post_message('NN', "WM_LBUTTONDOWN", 0x0001, $xy);
$win->post_message('NN', "WM_LBUTTONUP", 0, $xy);
####
003000BE R WM_ACTIVATE
003000BE P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:30 yPos:14
003000BE P WM_LBUTTONUP fwKeys:MK_LBUTTON xPos:30 yPos:14
003000BE P message:0x118 [Unknown] wParam:0000FFF8 lParam:A00885B9
003000BE S WM_NCACTIVATE fActive:False
003000BE R WM_NCACTIVATE fDeactivateOK:True