Jump to content
  • Advertisement
Sign in to follow this  
booom

Loading a Icon in c++

This topic is 3770 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This might be a noob question so sorry. But how do I add a icon to my program in c++. Thanks

Share this post


Link to post
Share on other sites
Advertisement
I think I no what it is, if it is what runs the code you type on the program. I use Dev-C++ it is free.

Share this post


Link to post
Share on other sites
Free but old, you should grab Visual Studio 2008 Express here http://www.microsoft.com/express/ it's free too. Or you can try Code::Blocks http://www.codeblocks.org/ some people here seems to recommend it.

Share this post


Link to post
Share on other sites
A windows app with a single main window typically has two icons: one that is associated with the window and displayed in the upper left corner, and one that is read by the shell and used as the icon in Explorer and in the taskbar. The first you associate with the window class when you call RegisterClassEx by specifying a handle to your icon. You obtain this handle by calling LoadImage and specifying either the resource or filename of your icon. The second gets associated "automatically", all you have to do is make it the first icon resource in your application. I don't remember if Dev-C++ has a resource editor or not (it's been a long time), but you really should be using Visual Studio anyway at this point if you're doing any serious Windows programming.

Your shell icon also need to have different sizes built in, typically you need 16x16, 32x32, and 48x48. XP supports 32-bit icons with alpha channel, but for previous versions you'll need to supply low-color versions as well. Vista also supports a 256x256 icon size with PNG compression.

Share this post


Link to post
Share on other sites
Thank you for your help every one. ANd I found out that you can just add it by the program.

[Edited by - booom on March 24, 2008 3:46:09 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!