Re: [AD] Proposal for a set_icon function

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> > It would be more useful if it can be done by using a regular Allegro
> bitmap.

>What I was thinking was something like:

>int set_app_icon(BITMAP *large_icon, BITMAP *small_icon)

>Where large_icon is a 32x32 bitmap and small_icon is a 16x16 one. If
>one of them is not present, it is generated by stretching the other
>one. If both are NULL, the default application icon for the running
>platform is set. The function returns 0 on success.

>My idea is that this function sets the icon at runtime, but possibly as
>a resource of the program, so that once set, the new icon remains
>attached to the application file also while it is not being executed.

I only can talk about windows, were it would be very easy to set the windows
icon by getting an allegro bitmap and converting it to an ICO in memory
(HICON) and then changing the window class icon parameter

that is of course only for the window

about that about attaching a resource to an exe inside the same program (at
least
in windows) is very difficult, if not impossible

the user can attach a resource file with an icon (this is compiling with the
resource
compiler and then linking with the linker) to have that icon available in
the exe though, wich is not very difficult and not allegro incompatible (the
first icon in the
the resource in the exe is taken as the windows application default icon)

well, m 2 cents =)



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/