[Win32 API] How to change window icon?

Started by
2 comments, last by helloworld123 16 years, 1 month ago
how to change icons in a window in win32 api (c++)? i google'd, but my google-fu isn't very good it seems. :( a short sample code or something would help greatly. thanks!
Advertisement
If you want to set the icon initially you use the hIcon and hIconSm members of the WNDCLASS or WNDCLASSEX structures. If you want to change it later, you can send the WM_SETICON message.
in window registration phase (WinMain function), this line does it

wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;
alright i'll look into sending WM_SETICON message...i wish to change it midway while window is displayed.

thanks!

This topic is closed to new replies.

Advertisement