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

Setting up an Icon for my app.

Hi. I just created this small Win32 Console Application. It runs in a DOS window. I need to setup an Icon for it different from the one setup automatically by Windows.

How can I do this????

p.s. I am using Visual C++ 6.0 for development.
Thanks in advance.
  • 4
  • 3
1 Solution
Add an Icon resource to your project, that's it.
dyma82Author Commented:
I did that, but my project keeps having the default windows Icon for Console applications. Do I have to change any setting for the project????

Thanks a lot!
Hmm, you will also have to make sure that the resource ID for the icon is '1'
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

dyma82Author Commented:
Let me try that...
jkr is correct, dyma.
Just create a resource icon,
resource value doesn't have to be "1," though.

If you didn't see your app with your custom icon,
you tried running it inside VC++. It seems like VC++ IDE
doesn't set the icon for the console app.

Look at your executable file, you'll see it has your
custom icon. Run it from outside VC++, it will display your icon.

give jkr the points. :)

hope that helps!

dyma82Author Commented:
Hi. I did all you guys said. It still does not work.
Does it have any importance the fact that this is a
Win32 console application???

I was able to create the Icon in Visual C++ (That's the IDE I am using). Then, I compiled my code, but nothing special happen. My app kept it blue-and-white little window as an icon.

How can I check the resource ID for the icon???

Thanks a lot for your help.
Check your .rc file - there should be an entry like

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
1           ICON    DISCARDABLE     "myicon.ico"

BTW - you have added the .rc file to your project, have you?
dyma82Author Commented:
Hey "jkr", I was missing just that. Adding the d... .rc file to my project. Now it is working fine!!!

Thanks a lot everybody.
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

Featured Post

Live webcast with Pinal Dave

Pinal Dave will teach you tricks to help identify the real root cause of database problems rather than red herrings. Attendees will learn scripts that they can use in their environment to immediately figure out their performance Blame Shifters and fix them quickly.

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