Application icon lazarus / 10-Designer ---------------------------------------------------------------------- Anonymous · 2005-06-17 10:26 How do I change the icon for my Lazarus application? I have tried using the Icon property of the form but it doesn't work - it still shows the generic Windows application icon. ---------------------------------------------------------------------- Forest · 2005-06-18 06:52 must be as first resource in EXE. try create RC file with ICON "icon.ico" (if icon.ico is in project directory) however i don't know yet how it will be compiled under Lazarus (this is how must be done in delphi, sorry i'm newbie in Lazarus) ---------------------------------------------------------------------- Anonymous · 2005-08-21 11:58 I also have problems with changing the icon with Lazarus. Here is what I made so far to solve this problem even thought I didn't solve it fully:  1) First I drew an icon. To do it you can use alot of applications like IconCoolStudio. More about this software you can see at the web site: http://www.iconcool.com/  2) After that I created a shortcut to the aplication. To do it in Windows rightclick over the compiled aplication and from the menu choose "Create Shortcut". You can rename the shortcut by rightclicking the shortcut and choose "Rename".  3) I changed the icon of the shortcut. To do it rightclick over the shortcut and choose properties. On the form that appears there is a button named "Change Icon". Press it and after that browse the directories, find your new icon and select it for a new icon. After thet the shortcut will turn in the new icon. Then to start the aplication doubleclick over the shortcut.  It would be perfect if I knew the normal way to change the icon with Lazarus but until then this can be an alternative. ---------------------------------------------------------------------- thebigdax · 2005-11-19 18:00 i have this problem too ---------------------------------------------------------------------- thebigdax · 2005-11-19 20:26 you can download something about the windows xp style there is thread in this forum ---------------------------------------------------------------------- ciana · 2005-12-02 22:22 Quote from: "Forest"must be as first resource in EXE. try create RC file with ICON "icon.ico" (if icon.ico is in project directory) however i don't know yet how it will be compiled under Lazarus (this is how must be done in delphi, sorry i'm newbie in Lazarus) hm...  :roll: Lazarus IDE have an Icon and XP style implented in the exe file... But how should we do for do so in our applications to... if someone could make an component smiliar to "Xp Manifest" to lazarus, so XP style where implented when the component was implented, it should be very good. And the icon problem MUST be fixed in some future version, because an main icon for all applications made with lazarus will make all applications made with lazarus orginal! ---------------------------------------------------------------------- Marc · 2005-12-05 11:05 The XP manifest component isn't needed in the future since lazarus will be using it by default ---------------------------------------------------------------------- jixiany · 2007-03-01 02:43 {$R Project.Res} The Project.Res is the same as Delphi projects' which include MainIcon. ---------------------------------------------------------------------- davesimplewear · 2007-05-13 05:48 Hi, You need to create a .res file (with the same name as your program executable) and then include in the program code after uses and before program begins. Quoteprogram master; {$mode objfpc}{$H+} uses   {$IFDEF UNIX}{$IFDEF UseCThreads}   cthreads,   {$ENDIF}{$ENDIF}   Interfaces, // this includes the LCL widgetset   Forms   { add your units here }, uMain, DBFLaz, uentry, usales, rxnew, uStock; {$R *.RES} begin   Application.Initialize;   Application.CreateForm(TfMain, fMain);   Application.CreateForm(TfEntry, fEntry);   Application.CreateForm(TfSales, fSales);   Application.CreateForm(TfStock, fStock);   Application.Run; end. ---------------------------------------------------------------------- LazaruX · 2007-05-16 09:45 I have made a program where you can change the icon of your applications, and where you can apply the XP or Vista style to your applications. Tha program is Wi(n)XtaP, it now is FREEWARE, it may become open source in the future. THe actual version is 0.4.0, so it does not work perfectly. You can download the program at the following address: http://files-upload.com/231253/WinXtaP0.4.0.rar.html PS. The program is in multi language, but you have to selecte the right language, it actually does not get it automatically This is  a preview of version 0.5.0 (http://freewebs.com/bpsoftware/Wi(n)XtaP/Wi(n)XtaP_0_5_0/wi(n)xtap_0_ 5_0-1.png) (http://freewebs.com/bpsoftware/Wi(n)XtaP/Wi(n)XtaP_0_5_0/wi(n)xtap_0_ 5_0-2.png) ---------------------------------------------------------------------- LazaruX · 2007-06-06 12:18 Version 0.5.0 is uploaded, minor changes where apported http://freewebs.com/bpsoftware/Wi(n)XtaP/Wi(n)XtaP_0_5_0/wi(n)xtap_0_5 _0.RAR ---------------------------------------------------------------------- antonio · 2007-06-11 19:49 Or you can try our tool, LazVisual, http://br.geocities.com/antoniog123456/ ---------------------------------------------------------------------- beli0135 · 2007-06-12 00:08 How it is done in linux? ---------------------------------------------------------------------- antonio · 2007-06-12 00:19 It's not done. You can -- eventually should -- put IFDEF's around your code. Like this: Code: [Select]{$IFDEF WINDOWS} {$R WINRES.RES} {$ENDIF} ---------------------------------------------------------------------- banhof · 2007-07-26 09:59 I have it solved this way: 1.) Download resource editor, I have used XNResourceEditor (http://www.wilsonc.demon.co.uk/d10resourceeditor.htm). 2.) In XNResourceEditor create new file. 3.) In menu choose Resource > Import Image Resource 4.) Choose *.ico file which you want to use as main icon of your application Rename group with your icon (it's name is 1) to MAINICON  by clicking on it and pressing F2 5.) Save file as resource file with name same as *.lpi file of your application is (name should be somethink like yourapplicationname.res) and place it to your application directory 6.) Open lazarus, in menu click on Project > Project Inspector and open lpr file of your project. It should be somethink like this: Code: [Select] program master; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Interfaces, // this includes the LCL widgetset Forms { add your units here }, uMain, DBFLaz, uentry, usales, rxnew, uStock; begin Application.Initialize; Application.CreateForm(TfMain, fMain); Application.CreateForm(TfEntry, fEntry); Application.CreateForm(TfSales, fSales); Application.CreateForm(TfStock, fStock); Application.Run; end. You have to add {$R *.RES} directive: Code: [Select] program master; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Interfaces, // this includes the LCL widgetset Forms { add your units here }, uMain, DBFLaz, uentry, usales, rxnew, uStock; //Add this: {$IFDEF Win32} {$R *.RES} {$ENDIF} begin Application.Initialize; Application.CreateForm(TfMain, fMain); Application.CreateForm(TfEntry, fEntry); Application.CreateForm(TfSales, fSales); Application.CreateForm(TfStock, fStock); Application.Run; end. 7.) Recompile your application and enjoy ---------------------------------------------------------------------- LBAWinOwns · 2007-08-18 22:33 Quote from: "banhof"I have it solved this way: 1.) Download resource editor, I have used XNResourceEditor (http://www.wilsonc.demon.co.uk/d10resourceeditor.htm). 2.) In XNResourceEditor create new file. 3.) In menu choose Resource > Import Image Resource 4.) Choose *.ico file which you want to use as main icon of your application Rename group with your icon (it's name is 1) to MAINICON  by clicking on it and pressing F2 5.) Save file as resource file with name same as *.lpi file of your application is (name should be somethink like yourapplicationname.res) and place it to your application directory 6.) Open lazarus, in menu click on Project > Project Inspector and open lpr file of your project. It should be somethink like this: Code: [Select] program master; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Interfaces, // this includes the LCL widgetset Forms { add your units here }, uMain, DBFLaz, uentry, usales, rxnew, uStock; begin Application.Initialize; Application.CreateForm(TfMain, fMain); Application.CreateForm(TfEntry, fEntry); Application.CreateForm(TfSales, fSales); Application.CreateForm(TfStock, fStock); Application.Run; end. You have to add {$R *.RES} directive: Code: [Select] program master; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Interfaces, // this includes the LCL widgetset Forms { add your units here }, uMain, DBFLaz, uentry, usales, rxnew, uStock; //Add this: {$IFDEF Win32} {$R *.RES} {$ENDIF} begin Application.Initialize; Application.CreateForm(TfMain, fMain); Application.CreateForm(TfEntry, fEntry); Application.CreateForm(TfSales, fSales); Application.CreateForm(TfStock, fStock); Application.Run; end. 7.) Recompile your application and enjoy Well put, important note, so you dont get mad and stuck at this, remember that the icon cant be as big as u want, I dont know the limits, but if its not working, the size of the icon might be the fault. ---------------------------------------------------------------------- LazaruX · 2007-08-24 07:07 HI, yeah , this is the hard way, if somebody wants to know an easyer way then there are also  simple tools to do that. Examples are: Wi(n)XtaP (created by me, LazWin, and many others, just look a bit in the forum ---------------------------------------------------------------------- Technos · 2007-09-22 17:58 Another way of assigning icon to the application is to create a resource file, i.e., app_ico.rc with the following content: Code: [Select] MAINICON ICON "./images/dbman.ico" then compile into a resource: Code: [Select] winres -i app_ico.rc -o app_ico.res Then in your main program adjust to include the new resource file, like: Code: [Select] program dbman; {$mode objfpc}{$H+} uses   {$IFDEF UNIX}{$IFDEF UseCThreads}   cthreads,   {$ENDIF}{$ENDIF}   Interfaces, // this includes the LCL widgetset   Forms   { add your units here }, main, sqlite3laz; {$R manifest.res} {$R dbman.res} {$R app_ico.res} //<-this line here begin   Application.Initialize;   Application.CreateForm(TFormMain, FormMain);   Application.Run; end. Regards, Technos[/code] ---------------------------------------------------------------------- antonio · 2007-09-23 20:06 Using a tool is a way to reduce errors. ---------------------------------------------------------------------- erlk · 2008-04-18 12:26 Hello, everybody I Have some problem with GUI my Application, when i migrate to linux(CENTOS), and my GUI Application is diferent with Win32. i use manifest.res for my GUI Application on Win32. if somebody know how, please tell me