i cant set the small icon for my dialog. here is what i have tried.

Code:
HICON hIcon = LoadIcon(Instance, MAKEINTRESOURCE(IDI_ICON));
			if(hIcon == NULL)
			{
				sprintf(str, "%i", GetLastError());
				MessageBox(hwnd_main, str, "NOTE", MB_OK);
			}
				
			SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
but it just makes a blank space in the taskbar next to the dialog name. Any ideas?