User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 425,824 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,976 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 742 | Replies: 9
Reply
Join Date: Nov 2006
Posts: 37
Reputation: Firestone is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Firestone Firestone is offline Offline
Light Poster

Changing my C++ program's icon

  #1  
Jun 25th, 2008
How can I change my program's icon for anyone who uses the program? Obviously I would have to include the .ico file with it, but beyond that, I'm stumped.
=================================
There are 10 types of people in the world,
Those who understand binary, and those who don't
=================================
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,876
Reputation: Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold 
Rep Power: 11
Solved Threads: 193
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: Changing my C++ program's icon

  #2  
Jun 25th, 2008
Typically the main icon is linked in at compilation. How exactly you do it depends on your compiler. In all cases, a Windows resource named MAINICON is in your exe.

You can also check out Resource Hacker, which you can use to manually change a program's icon.
Reply With Quote  
Join Date: Nov 2006
Posts: 37
Reputation: Firestone is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Firestone Firestone is offline Offline
Light Poster

Re: Changing my C++ program's icon

  #3  
Jun 26th, 2008
How would I add it in with Code::Blocks? I can't figure it out
=================================
There are 10 types of people in the world,
Those who understand binary, and those who don't
=================================
Reply With Quote  
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,876
Reputation: Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold 
Rep Power: 11
Solved Threads: 193
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: Changing my C++ program's icon

  #4  
Jun 27th, 2008
I don't know.

If you know how to link windows resources to your project, create an icon resource named MAINICON.

Otherwise you'll have to use resource hacker.

Good luck!
Reply With Quote  
Join Date: Mar 2008
Location: UK - Lymm
Posts: 436
Reputation: williamhemsworth is a jewel in the rough williamhemsworth is a jewel in the rough williamhemsworth is a jewel in the rough williamhemsworth is a jewel in the rough 
Rep Power: 4
Solved Threads: 43
williamhemsworth's Avatar
williamhemsworth williamhemsworth is offline Offline
Posting Pro in Training

Re: Changing my C++ program's icon

  #5  
Jun 27th, 2008
Its possible to do, ive never tried this but I think it should work.
  1. SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(NULL,
  2. MAKEINTRESOURCE(ICON_ID)));
Reply With Quote  
Join Date: Apr 2008
Posts: 27
Reputation: marco93 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 4
marco93 marco93 is offline Offline
Light Poster

Re: Changing my C++ program's icon

  #6  
Jun 28th, 2008
Originally Posted by williamhemswort View Post
ive never tried


If you've never tried, then try.
It takes 2 seconds...
Last edited by marco93 : Jun 28th, 2008 at 9:15 am.
Reply With Quote  
Join Date: Mar 2008
Location: UK - Lymm
Posts: 436
Reputation: williamhemsworth is a jewel in the rough williamhemsworth is a jewel in the rough williamhemsworth is a jewel in the rough williamhemsworth is a jewel in the rough 
Rep Power: 4
Solved Threads: 43
williamhemsworth's Avatar
williamhemsworth williamhemsworth is offline Offline
Posting Pro in Training

Re: Changing my C++ program's icon

  #7  
Jun 28th, 2008
No it doesn't, you have to create a Win32 project, make a window and then make it change the icon at runtime.. The point is I dont need to try it because im not the one with the problem, hes the one who should be putting in the effort to test it, im just giving suggestions.
Reply With Quote  
Join Date: Apr 2008
Posts: 81
Reputation: dmanw100 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 6
dmanw100's Avatar
dmanw100 dmanw100 is offline Offline
Junior Poster in Training

Re: Changing my C++ program's icon

  #8  
Jun 28th, 2008
Is there a simple way to do this in Dev-Cpp? There doesn't seem to be an area to compile linked .ico's into the project. I have tried using IconFX but it cannot add icons to a project that has already been compiled.
Reply With Quote  
Join Date: Feb 2008
Location: Hyderabad,India
Posts: 17
Reputation: msk88 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
msk88 msk88 is offline Offline
Newbie Poster

Re: Changing my C++ program's icon

  #9  
Jun 28th, 2008
To dmanw100...

You can do it in Dev C++.Create a project & then go to Project->Project Options & in the "General" page you will find Icon Option for your project(for the .exe).

Done..!!
Reply With Quote  
Join Date: Mar 2008
Posts: 52
Reputation: Maulth is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 5
Maulth Maulth is offline Offline
Junior Poster in Training

Re: Changing my C++ program's icon

  #10  
Jun 29th, 2008
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 4:23 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC