use strict; use warnings; use diagnostics; use Win32::GUI(); $|=1; my $thisWindow = Win32::GUI::GetPerlWindow(); until($thisWindow) #doesn't always work at 1st { #print "Rechecking winID\n"; sleep 1; $thisWindow = Win32::GUI::GetPerlWindow(); #print 'winID = '.$thisWindow."\n"; } my $icon = new Win32::GUI::Icon('box.ico'); print "beofre\n"; if(1) #tried if 0 as well { Win32::GUI::ChangeIcon($thisWindow, $icon ); Win32::GUI::ChangeSmallIcon($thisWindow, $icon ); }else { $thisWindow->ChangeIcon($icon ); $thisWindow->ChangeSmallIcon($icon ); } print "after\n"; sleep 5; exit;