Solved

No icon

Posted on 2004-09-08
4
205 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-
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
Jacco earned 20 total points
Comment Utility
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
Comment Utility
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-
Comment Utility
Thanks ;D
0
 
LVL 22

Expert Comment

by:Ferruccio Accalai
Comment Utility
oopss my mistake, misreaded the Q.

Jacco is right, of course :))

F68 ;-)
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now