I am trying to create a dialog box with an icon at the top, as shown below.

I am using a resource file to load an icon this way.
IDI_ICON1 ICON ".\\usb.ico"
I tried to set the window icon using the following code.
SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IDI_ICON1); SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)IDI_ICON1);
hwnd is a window. As a result, I get a blue circle that looks the same as the boot icon for Windows 7 and Vista. I am pretty sure that the icon loads correctly, because when I look at the taskbar, my program has this icon representing my program. If you need the code that I use for the dialog itself, let me know that I will publish it. I am using the mingw32 C ++ compiler on Windows 7. Thank you!
source share