RE: perl/tk make the taskbar button blink

"Jack D." <[email protected]>
Newsgroups gmane.comp.lang.perl.tk
Message-ID <[email protected]>
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of listmail
> Sent: January 9, 2006 9:45 AM
> To: [email protected]
> Subject: perl/tk make the taskbar button blink
> 
> I need to find out if it is possible to make the taskbar 
> button blink manually, perhaps through a module call such as Win32::*

Yep. Here is a sample from my hard drive ;)

###########################
use strict;

use Tk;
use Win32::API;

my $Handle; # Foreground window handle
my $FlashWindow; # API call addr to flash window

my $mw = tkinit;
$mw->update;

init_APIs (); # init APIs and get window handle (must be after update)

$mw->repeat(500, \&flashit);
$mw->OnDestroy(sub {$FlashWindow->DESTROY});
MainLoop;

#- - - - - - - - - - - - - - - - -

sub init_APIs {

my $GetActiveWindow = new Win32::API('user32', 'GetActiveWindow',
    [], 'N') or die Win32::FormatMessage(Win32::GetLastError());
$Handle = $GetActiveWindow->Call();
print "Window Handle: $Handle\n";
$FlashWindow = new Win32::API('user32', 'FlashWindow', ['N','N'], 'N') or
die
    Win32::FormatMessage(Win32::GetLastError());

}

#- - - - - - - - - - - - - - - - -

sub flashit {

my $ret = $FlashWindow->Call($Handle, 1);
$mw->update;
print "RETURN VAL:", $ret,"\n";
}


__END__

Jack
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.