HANDLE h = LoadImage(AfxGetResourceHandle(),"C:\\Burn.ico",IMAGE_ICON,0,0,LR_LOADFROMFILE);
::SendMessage(this->m_hWnd,WM_SETICON,ICON_SMALL,(LPARAM)h);
WM_SETICON
This message is sent by an application to associate a new big or small icon with a window.
WM_SETICON wParam = (WPARAM)(BOOL) fType;
lParam = (LPARAM)(HICON) hicon;
Parameters
fType
Specifies the type of icon being set. It is one of the following values:
Value Description
ICON_BIG Sets the large icon for the window.
ICON_SMALL Sets the small icon for the window.
hicon
Handle to the new large or small icon. If this parameter is NULL, the icon indicated by fType is removed.