Adding an Icon to the Console Application [VC++6]
Adding an Icon to the Console Application [VC++6]
Adding an Icon to the Console Application [VC++6]
Adding an Icon to the Console Application [VC++6]
Adding an Icon to the Console Application [VC++6]
Adding an Icon to the Console Application [VC++6] Adding an Icon to the Console Application [VC++6] Adding an Icon to the Console Application [VC++6] Adding an Icon to the Console Application [VC++6] Adding an Icon to the Console Application [VC++6] Adding an Icon to the Console Application [VC++6] Adding an Icon to the Console Application [VC++6] Adding an Icon to the Console Application [VC++6]
Adding an Icon to the Console Application [VC++6] Adding an Icon to the Console Application [VC++6]
Adding an Icon to the Console Application [VC++6]
Go Back  Xtreme Visual Basic Talk > > > Adding an Icon to the Console Application [VC++6]


Reply
 
Thread Tools Display Modes
  #1  
Old 11-30-2005, 07:46 AM
Shaitan00 Shaitan00 is offline
Junior Contributor
 
Join Date: Apr 2003
Posts: 253
Question Adding an Icon to the Console Application [VC++6]


I made a CONSOLE (Command Line) application (.exe) in VC++6 and I want to add an ICON to the executable (so that when you look at it in Windows you see an icon and not the generic nothing that is currently there).
I know this is a CONSOLE application but the user CAN double-click on it in Windows and it will work perfectly fine...
Is there an easy way to add an icon? I already have the image (icon.ico) ready, just need to find a way to add it to my project?

Seeing as there are no FORMS I don't see how to do it.
Any help would be appreciated, thanks
Reply With Quote
  #2  
Old 12-06-2005, 07:54 PM
Val's Avatar
Val Val is offline
Senior Contributor
 
Join Date: May 2003
Location: Vancouver, WA
Posts: 1,268
Default

To add icon in VC++6, you import it so it gets added to your program's resource script. Windows is automatically going to use the icon with the lowest ID as the app's icon.

IF YOUR APP DOESN'T HAVE A RESOURCE SCRIPT:
1. Ctrl+R to bring up Insert Resource dialog
2. Click Import, select your icon and click OK.
3. Set some meaningful ID for your icon, like IDI_MYAPP
4. Save the icon and the resource file: Save/Save All commands. Name the resource file something meaningful as well, like MyApp.rc
5. Go to Project->Add Files
6. In the project directory, you should now have your resource file and a header file called "Resource.h", so add them both to the project
7. You now have a resource tab in your projectview, you can manipulate your resources from there. You are done! The icon in the resource file with the lowest ID will be automatically used as application's icon. Since you only have one icon, there is no question as to which icon is the main one.

IF YOUR APP HAS A RESOURCE SCRIPT:
Do the same steps as above, except the resource file and the header file will already exist, so you just save them (they will be saved automatically if you compile).
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Adding an Icon to the Console Application [VC++6]
Adding an Icon to the Console Application [VC++6]
Adding an Icon to the Console Application [VC++6] Adding an Icon to the Console Application [VC++6]
Adding an Icon to the Console Application [VC++6]
Adding an Icon to the Console Application [VC++6]
Adding an Icon to the Console Application [VC++6] Adding an Icon to the Console Application [VC++6] Adding an Icon to the Console Application [VC++6] Adding an Icon to the Console Application [VC++6] Adding an Icon to the Console Application [VC++6] Adding an Icon to the Console Application [VC++6] Adding an Icon to the Console Application [VC++6]
Adding an Icon to the Console Application [VC++6]
Adding an Icon to the Console Application [VC++6]
 
Adding an Icon to the Console Application [VC++6]
Adding an Icon to the Console Application [VC++6]
 
-->