Advertisement Jump to content

Archived

This topic is now archived and is closed to further replies.

KaptainKangaroo

Setting an Executable's Icon (win32)

This topic is 6341 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

Advertisement
If you are using VC++, then add a resource scruipt to your project, import your icon to the reource script, then when creating your window use this code(assuming wndClass is your window class, and ICONNAME is what you icon reource is named):

    wndClass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(ICONNAME));    


Edited by - cooltomk on September 10, 2001 3:16:07 PM

Share this post


Link to post
Share on other sites
Yep, I knew that. But I don''t like doing it that way. What if my application has multiple windows, and it isn''t always the same one which is registered first? What if I use a windowing library which doesn''t let me set the window''s icon? I guess that VC++ finds the first window you register, finds the icon and compiles it into your exe, so surely there must be a way to specify the icon you want to compile as your default without setting it in the source code. I know C++ Builder lets you choose, but I''m using VC++.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!