EXE icons in a project with no form

Posted on 2000-01-11
Medium Priority
Last Modified: 2008-03-10
I have an application with no form, but I the compiled exe to have an icon. The only way I see to create an app icon is in Project Properties by setting the app icon to the icon of an existing form. Anyway to get around this without adding a form?
Question by:masterpoe
LVL 71

Expert Comment

by:Éric Moreau
ID: 2342174
You have to add a form even if you never show it!

Author Comment

ID: 2342196
I need to be able to run this program with going through an installation process. If you add a form, it requires an installation process. I need to get around adding a from; if it's possible.

Expert Comment

ID: 2342229
you have to go through an installation process with or without a form!  
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.


Expert Comment

ID: 2342238
Emoreau it's ok. Even if you don't need the window, you will find (sooner or later) that you need an installation process (VB library for example).

You won't need an installation process if the target PC has all the VB updates that the developer PC has.

I've tried to do the same thing (program with no installation) and found no other way.

Expert Comment

ID: 2342383
If it is a DLL/OCX you can register it with regsvr32.exe found in the system directory.

The icon can be changed later with the Shortcut to the program by hand. It should default with the default VB program icon, that square frame.

You can add an icon without using a form, by using the "Add ActiveX Designer" for things like Active Reports, which has a property page for an icon which can be set in the program properties.

Accepted Solution

aut earned 400 total points
ID: 2342448
1. Create a resource file (a text file, but with the extension ".rc"... You'll only need the following line in it:
   0 ICON c:\path\filename.ico
Make sure that "C:\path\filename.ico" actually points to your icon file. Note: the "0" is a ZERO...

2. Compile the resource file. You can do that using the resource compiler EXE file (RC.EXE). All you have to type is:
   RC myresfile.rc
You'll find the RC.EXE file on your VB CD, or on one of the Visual Studio CD's

3. Include the compiled resource file in your project.

4. That's it!


Author Comment

ID: 2342498
NICE JOB! Thanks.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

623 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