• Popular Now

• 13
• 27
• 9
• 9
• 20

Archived

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

Setting a window's icon?

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

Recommended Posts

Should be a fairly easy question (for those who know how to do it :S) How do I set the icon of a win32 dialog @ runtime? Thanks

Share on other sites
You can send it a WM_SETICON message, although there are probably other ways.

Share on other sites

	WNDCLASS wc;..	wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);..	if(!RegisterClass(&wc))	{		MessageBox(NULL, "Error registering Window", "Error", MB_OK);	}

I think you can substitute IDI_APPLICATION with