Solved

No icon

Posted on 2004-09-08
4
208 Views
Last Modified: 2010-04-05
Hello,

I have GUI application how can I make it have the icon that you would get if your making a console app.
0
Comment
Question by:-Karamja-
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
Jacco earned 20 total points
ID: 12009654
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
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 12009716
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
 
LVL 2

Author Comment

by:-Karamja-
ID: 12009741
Thanks ;D
0
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 12009768
oopss my mistake, misreaded the Q.

Jacco is right, of course :))

F68 ;-)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question