Howdy,

Marcus wrote,
>How do you use PeekMessage?

Yes, How do you use Peekmessage, my feeble attempt follows
it dosnt work. Can any one help or is it truly broken or Am I just plain
wrong?

JohnR

#!perl 
use strict;
use Win32::GUI;
use Win32::API;
#Put the name of the window
my $winname="Test Window";
my $handle=0;
&gethandle;
print "The Decimal value of the handle for $winname is $handle\n";
#0s are all messages ?
my $min=0;
my $max=0;
#docs said values go in ref to a array so
my @message;
my [EMAIL PROTECTED];

#run in a while loop untill a message happens peekmessage returns 1 ?
my $test=0;
while($test == 0){$test=Win32::GUI::PeekMessage($handle,$min,$max,$messref);
                        sleep 1;}
print "@message\n";
print "finished\n";


#my $waitin=<>;

####Returns handle of window specified in $winname
sub gethandle{
                my $desktop = GUI::GetDesktopWindow();
                print "Desktop Window: $desktop\n";
                my $window = GUI::GetWindow($desktop, GW_CHILD);
                while($window) {my $title = GUI::Text($window);
                        if($title eq "$winname"){print "found $title\n";
                                                        $handle=$window;
                                                        }
                        $window = GUI::GetWindow($window, GW_HWNDNEXT);
                        }  
}


Reply via email to