Sign in to follow this  

Icon setting in wndclassex

This topic is 4870 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 line: wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(104)); specifies the icon that is accosiated with the program, but the icon only shows up on the taskbar, the icon that is in the top border is still the default application icon, how do i change this?

Share this post


Link to post
Share on other sites
There are two icon handles in WNDCLASSEX. Simply put:
the large icon "hIcon" is for the task try and the small "hIconSm" which is for the window icon itself.
So just add the line below and it should fix your problem. :)

wc.hIconSm = LoadIcon(hInstance, MAKEINTRESOURCE(104));

Share this post


Link to post
Share on other sites
I forgot, when loading icons that are compiled with the exe itself pass NULL for the instance handle:

wc.hIcon = LoadIcon(NULL, MAKEINTRESOURCE(104));
wc.hIconSm = LoadIcon(NULL, MAKEINTRESOURCE(104));

Share this post


Link to post
Share on other sites

This topic is 4870 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this