I am creating a simple Win32 GUI application for windows 10. I want to set an icon that will appear in the taskbar when it is open. I have already defined an icon in my resource file, but it only appears next to the exe file in file explorer. when I open the app it still just shows the default icon. I'm a huge noob when it comes to windows programming, so I'm sorry if I'm missing something obvious.
Any help is appreciated.
My resources.rc file:
#include "winuser.h"
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "TDAssist.exe.manifest"
id ICON "icon.ico"
The taskbar uses the icon from the window, not the first icon in the resources.
Use LoadImage(GetModuleHandle(0),..., LR_SHARED)
to get a HICON
and assign it to the window when you register the window class or by sending WM_SETICON
.
The taskbar and Alt+Tab dialogs might display the .exe icon in some versions but it depends on the window style and other undocumented specifics.