Actually, I don't have an .rc file. This application is a simple one that runs some initialization routines and launches another application. Looks like I might need a little handholding to get me through this one.
Main Topics
Browse All Topics
I have an .ico file that I want to use as my icon for a simple Win32API application that I am writing. In essence, the program is just your regular:
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
do stuff
}
without using any Microsoft Foundation Classes. By default when I build my .exe file, it gives me a plain old rectangle icon. How do I go about changing that to my .ico icon in Visual C++ 6?
Thanks for any input you can offer.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi!
In first, in VC++ go to Insert->Resource menu. Select "Icon" (you may create your oun icon ("New") or load from ico-file ("Import")).
After painting/importing save as *.rc file.
Next, go to Project->Add to project->Files and select saved rc-file.
After these steps, when you will be make build for you program, icon will be attached to exe like a resource.
In WinMain :
when you fill WNDCLASS structure, set hIcon member to value, returned by calling LoadIcon(hInstance, MAKEINTRESOURCE(IDI_YOURIC
And, in the last, include header file with resource definitions (if you name resource.rc, then resource.h). Done.
Sorry for my bad english :)
Business Accounts
Answer for Membership
by: pjknibbsPosted on 2003-01-03 at 06:58:32ID: 7662346
Add the icon as a resource in your .RC file (you DO have one of those, right?)--the first icon in there will become the default icon for the executable.