


Here is the end result of either of these methods: SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon) SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon)

Wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_APPLICATION)) Ģ.You can send a WM_SETICON message to your main window like the following (Again, where EXAMPLE_ICON is your icon resource) HICON hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(EXAMPLE_ICON)) Wcex.lpszClassName = "ExampleIconWindowClass" Wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1) Wcex.hCursor = LoadCursor(nullptr, IDC_ARROW) Wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(EXAMPLE_ICON)) (Where EXAMPLE_ICON is your icon resource) WNDCLASSEX wcex = This is by no measure a complete list of available methods.ġ.Set the hIcon member of the WNDCLASSEX structure used to register your main window to an appropriate value like the following code does. I've found 2 methods of doing this after a quick search, assuming you are dealing the the WIN32 API in some form.
