I am trying to put an icon in a dialog box titlebar. The code I am using (unsuccessfully) is as follows:
case WM_INITDIALOG :
hIconSmall =(HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_32), IMAGE_ICON,
16, 16, 0);
SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIconSmall) ;
return TRUE ;
This doesn't work. The LoadImage function returns a non-NULL value for hIconSm, but no icon appears in the titlebar. The .ico resource (IDI_32) is a 32x32 pixel icon resource. I did not show the lines, but hIconSmall is declared as a static HICON in the dialogproc.