First make an iconresource with both an 16x16 4 color and a 32x32 4
color icon. Give the Icon an ID of 1.
WNDCLASS wc;
wc.hIcon = (HICON)LoadIcon(hInstance, MAKEINTRESOURCE(1));
SendMessage(hWnd,WM_SETICON, FALSE,(LPARAM)LoadImage(hInstance,
MAKEINTRESOURCE(1), IMAGE_ICON, 16, 16,
LR_DEFAULTCOLOR));
The above code assigns an icon to the window and sends a message to
the taskbar to put icon next to the application name, because the default
is a rather dull icon.
|