Skip to main content
gamedev.net
🔒 Locked

Setting a window's icon?

Started by Xtremehobo Aug 15, 2003 at 10:38 PM 1 replies 250+ views
Original Post
Xtremehobo
Xtremehobo
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
pixelwrench.com | [email="matt[nospam]@pixelwrench[nospam]com"]email[/email] lethalhamster: gamedev keeps taking my money, but im too lazy to not let them
Dobbs
Dobbs
You can send it a WM_SETICON message, although there are probably other ways.
CProgrammer
CProgrammer
Load in the icon when you register your window:


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
MAKEINTRESOURCE(your resource id)

-CProgrammer

[edited by - CProgrammer on August 16, 2003 5:25:06 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.