in reply to Re^8: Can't change icon with win32 module
in thread Can't change icon with win32 module
Here is my entire code (it is just an experiment at this stage)
When I target a non-existing file, it says
At this version it saysuse strict; use warnings; use Win32; use Win32::GUI(); use Win32::API; Win32::API->Import('kernel32','BOOL SetConsoleIcon(HWND icon)'); eval{SetConsoleIcon( Win32::GUI::Icon->new('box1.ico')->{-handle});}; +#eval 2 counter the die from undef return from "new" with "->" print 0+$^E; print " ---\n".'$^E = '; #separated \n just in case print $^E; print " ---\n".'$! = '; print $!; print " ---\n".'$@ = '; print $@; print " ---\n".'FormatMessage = '; print Win32::FormatMessage(Win32::GetLastError()); sleep 50; exit;
for box2.ico as well as for zzz.pl (instead of box1.ico) it says0 --- $^E = --- $! = Bad file descriptor --- $@ = --- FormatMessage = The operation completed successfully.
The practical difference between the 3 is that only box1.ico is showed, the other 2 don't change the icon.0 --- $^E = --- $! = Bad file descriptor --- $@ = Can't use an undefined value as a HASH reference at E:\perl exper +iments\change icon exp 2.pl line 8. --- FormatMessage = The operation completed successfully.
When I target a non-existing file, it says
It seems to me that Win32::GUI::Icon->new('box1.ico') is just undef when used on box2.ico as well as for zzz.pl.2 The system cannot find the file specified.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^10: Can't change icon with win32 module
by Anonymous Monk on Sep 24, 2012 at 04:48 UTC | |
Re^10: Can't change icon with win32 module
by bulk88 (Priest) on Sep 24, 2012 at 20:38 UTC |
In Section
Seekers of Perl Wisdom