|
From: Jeremy W. <jez...@ho...> - 2009-03-21 10:53:36
|
As a side, you dont need to define constants or use win32 api:
use strict;
use warnings;
use Win32::GUI qw(WS_CAPTION TME_HOVER TME_LEAVE HOVER_DEFAULT SWP_FRAMECHANGED SWP_NOMOVE SWP_NOSIZE SWP_NOZORDER SWP_NOACTIVATE);
my $state = 0; # 0 - out; 1 - in;
my $mw = Win32::GUI::Window->new(
-title => "Vanishing Title Bar",
-pos => [100,100],
-size => [400,300],
-onMouseOver => sub {print "Hover\n"; return 0;},
-onMouseOut => \&Out,
-onMouseMove => \&Move,
);
$mw->Show();
Win32::GUI::Dialog();
exit(0);
sub Out
{
print "Out\n";
$mw->Change(-pushstyle => WS_CAPTION),
$mw->SetWindowPos(0, 0, 0, 0, 0,SWP_FRAMECHANGED|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
$state = 0;
return 0;
}
sub Move
{
return unless $state == 0;
$mw->Change(-popstyle => WS_CAPTION),
$mw->SetWindowPos( 0, 0, 0, 0, 0,SWP_FRAMECHANGED|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
print "In\n";
$state = 1;
$mw->TrackMouse(1000,TME_HOVER|TME_LEAVE);
return 1;
}
> From: wb...@sa...
> To: per...@li...; jez...@ho...
> Subject: Re: [perl-win32-gui-users] I need mouse method!
> Date: Sat, 21 Mar 2009 11:17:05 +0100
>
>
> Oh Jeremy,
>
> you are perfectly right! I am so inpatient!
>
> Thank you for your help!
>
> Waldemar.
_________________________________________________________________
All your Twitter and other social updates in one place
http://clk.atdmt.com/UKM/go/137984870/direct/01/ |