• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

No icon

Hello,

I have GUI application how can I make it have the icon that you would get if your making a console app.
0
-Karamja-
Asked:
-Karamja-
  • 2
1 Solution
 
JaccoCommented:
Hi there,

The icon the app eventually gets resides in the ProjectName.res file. The resource file is included with the project using the

{$R *.RES}

in the DPR file of your project. To view this file use the menu: project/view source.

If you have seen the *.RES in you code create a new project and view the source of the dpr to see where it is.

In this res-file the icon named MAINICON is the one used.

Regards Jacco

(In rare cases: Now it is possible the EXE created does not show this icon. This would be because the EXE standard specifies that the first ICON resource in the EXE will be used. If for some reason there is a resource used with $R that defines an ICON before the ProjectName.RES this icon will be used.)
0
 
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
mmm...
the easiest way that i know is the following


program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1};

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  application.Icon := nil; //the icon will be showed as in a console app
  Application.Run;
end.
0
 
-Karamja-Author Commented:
Thanks ;D
0
 
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
oopss my mistake, misreaded the Q.

Jacco is right, of course :))

F68 ;-)
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now