On Sunday, 5 January 2020 at 13:33:35 UTC, Marcone wrote:
I am using this code to load icon from local directory, but I want to load icon from resource.res file:

wndclass.hIcon = LoadImage( NULL, "icon.ico", IMAGE_ICON, 0, 0, LR_LOADFROMFILE| LR_SHARED | LR_LOADTRANSPARENT);

You cannot load icons from res files.

If you link your res file to the executable, you can load the icon using:

LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(youriconid));


The function LoadImage from above loads an icon from the file named icon.ico, not from a res file.

Reply via email to