-1

The tray icon does not change. What could be the cause? I'm using latest Strawberry Perl v5.20.2 x86, Win32::GUI v1.11, Windows 7 x64.

use strict;
use warnings;
use Win32::GUI;


my $main = Win32::GUI::Window->new(
-name => 'Main',
-text => 'Perl',
-width => 200,
-height => 200
);

my $icon = new Win32::GUI::Icon('1-0.ico');
my $ni = $main->AddNotifyIcon(
-name => "NI",
-icon => $icon
);

my $icon2 = new Win32::GUI::Icon('0-0.ico');


Win32::GUI::Dialog();
while(1)
{
    $ni->Change( -icon => $icon );
    sleep(5);
    $ni->Change( -icon => $icon2 );
    sleep(5);
}
Sinan Ünür
  • 116,958
  • 15
  • 196
  • 339
Nick
  • 331
  • 3
  • 14

1 Answers1

-2
Win32::GUI::Dialog();

Must be put after while loop in order to work. :(

Nick
  • 331
  • 3
  • 14
  • Without an actual explanation of why this is a rather poor answer to a badly phrased question. "Does not work?" *Really?* – Sinan Ünür Mar 28 '15 at 22:00