Click here to Skip to main content
15,896,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Normally in VC++ MFC application Wizard the title bar will be the project name comes along with MFC icon.
I want to replace that Default MFC icon with my company logo in my application.

Can any one help me in doing this.


Thank u
Posted

HICON hicon;
hicon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_MYICON));
SetIcon(hicon, true );


dont forget to add the new icon IDR_MYICON via resource.
if it is a dialog based MFC application do it in your OnInitDialog()
if SDI application do it in your CMainFrame::OnCreate() function
 
Share this answer
 
Check SetClassLong [^].
Sample[^]
 
Share this answer
 
Along with above solutions, if you generate the project with the wizard then there is one indirect method.Go to your project folder and res folder and replace the default icon(generated with wizard normally it will be <projectname>.icon ) with your icon.rebuild the project again.But this method wont help you to understand the framework.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900