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 Resource4.) 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:
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:
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
