943,893 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 14587
  • C++ RSS
Jun 25th, 2008
0

Changing my C++ program's icon

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Firestone is offline Offline
37 posts
since Nov 2006
Jun 26th, 2008
0

Re: Changing my C++ program's icon

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.
Featured Poster
Reputation Points: 1140
Solved Threads: 229
Postaholic
Duoas is offline Offline
2,039 posts
since Oct 2007
Jun 26th, 2008
0

Re: Changing my C++ program's icon

How would I add it in with Code::Blocks? I can't figure it out
Reputation Points: 10
Solved Threads: 0
Light Poster
Firestone is offline Offline
37 posts
since Nov 2006
Jun 27th, 2008
0

Re: Changing my C++ program's icon

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!
Featured Poster
Reputation Points: 1140
Solved Threads: 229
Postaholic
Duoas is offline Offline
2,039 posts
since Oct 2007
Jun 27th, 2008
0

Re: Changing my C++ program's icon

Its possible to do, ive never tried this but I think it should work.
CPP Syntax (Toggle Plain Text)
  1. SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(NULL,
  2. MAKEINTRESOURCE(ICON_ID)));
Reputation Points: 1429
Solved Threads: 129
Posting Virtuoso
William Hemsworth is offline Offline
1,542 posts
since Mar 2008
Jun 28th, 2008
-1

Re: Changing my C++ program's icon

ive never tried
If you've never tried, then try.
It takes 2 seconds...
Last edited by marco93; Jun 28th, 2008 at 10:15 am.
Reputation Points: -76
Solved Threads: 14
Junior Poster
marco93 is offline Offline
132 posts
since Apr 2008
Jun 28th, 2008
1

Re: Changing my C++ program's icon

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.
Reputation Points: 1429
Solved Threads: 129
Posting Virtuoso
William Hemsworth is offline Offline
1,542 posts
since Mar 2008
Jun 28th, 2008
0

Re: Changing my C++ program's icon

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.
Reputation Points: 104
Solved Threads: 27
Posting Whiz in Training
dmanw100 is offline Offline
239 posts
since Apr 2008
Jun 28th, 2008
0

Re: Changing my C++ program's icon

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..!!
Reputation Points: 10
Solved Threads: 2
Newbie Poster
msk88 is offline Offline
17 posts
since Feb 2008
Jun 29th, 2008
0

Re: Changing my C++ program's icon

Reputation Points: 15
Solved Threads: 6
Junior Poster in Training
Maulth is offline Offline
65 posts
since Mar 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Find then Show window.
Next Thread in C++ Forum Timeline: External/Internal Enumerations?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC