Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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

by palkia (Monk)
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 ?

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://995110]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2018-06-25 20:41 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (128 votes). Check out past polls.