Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Can't change icon with win32 module

by palkia (Scribe)
on Sep 22, 2012 at 16:54 UTC ( #995110=note: print w/ replies, xml ) Need Help??


in reply to Re: Can't change icon with win32 module
in thread Can't change icon with win32 module

Won't seem to go online for me for some reason,
but I just wanted it to use my icons anyway,
so after some tweaking it worked gr8 (thank you very very much).
In my version

use Win32::GUI(); use Win32::API; Win32::API->Import('kernel32','BOOL SetConsoleIcon(HWND icon)'); SetConsoleIcon( Win32::GUI::Icon->new('box.ico')->{-handle} );
For some reason it only works for some icons.
It seems that Win32::GUI::Icon->new('box.ico') returns undef for some icons, or to be exact, it does the same as in the case I refer to a non-existing icon.
Some icon-format limitation ?


Comment on Re^2: Can't change icon with win32 module
Select or Download Code
Re^3: Can't change icon with win32 module
by bulk88 (Priest) on Sep 22, 2012 at 18:23 UTC
    Tried checking Win32::GetLastError() if creating an Win32::GUI::Icon failed?
      I used Win32::FormatMessage(Win32::GetLastError()) but it returns The operation completed successfully for both icons (those the do and doe that don't give undef).
      It even says the same thing if I use a pl file instead of ico,
      Seems to me to be pretty equivalent to the -e operator.

        I used ...

        Where did you use it? Where did you add it?

        Show your code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://995110]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (18)
As of 2014-04-16 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (432 votes), past polls