Sign in to follow this  
_Phalanx_

Icon setting in wndclassex

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

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