FLTK logo

Re: Change the icon of the .exe

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Change the icon of the .exe Edzard Egberts Mar 25, 2008  
 
Frank Eory schrieb:
> Is the .RES supposed to be the
> input to the resource compiler with a .O as an output?

No, you must use the msys ressource-compiler "Winres" (you get it on 
MinGW-Site) to create the .a-file. To set the apps icon, you must do the 
following steps:

1. Create the ressource "Icon.res" (or use any name you like ;o)

2. Compile  the static lib "windres Icon.res libicon.a". It is important 
to use the prefix "lib" for the name, but to include it as "icon".

3. Link the library to your project

4. Load the icon from within the app, using common windows-style:

#define IDI_MAIN	111	// Icon-Ressource
char* pIcon= (char *)LoadIcon(fl_display, MAKEINTRESOURCE(IDI_MAIN));

5. Final step: Assign the icon to the Fl_Window before first calling show:
Fl_Window Window;
if (pIcon) Window.icon(pIcon);
Window.show();

Now the window should show the icon from the static libicon.a.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.