josephspurrier / goversioninfo

Golang Microsoft Windows File Properties/Version Info and Icon Resource Generator
MIT License
836 stars 114 forks source link

Setting the IDI_APPLICATION icon? #60

Open precisionpete opened 2 years ago

precisionpete commented 2 years ago

I have a Go application on Windows 10+ that is using WebView for the GUI. It works great but I am having trouble setting the Window icon. This is not the icon on the EXE. That part works great. But I need to set the icon on the top left corner of the windows that WebView creates. In the resource file, it is referred to as the IDI_APPLICATION icon (32512). 100 is the EXE icon I believe.

See: https://github.com/webview/webview

e.g. https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadiconw

100  ICON "icons\\main.ico"
32512 ICON "icons\\small.ico"

Does goversioninfo have an undocumented entry to set this?

Unfortunately, I'm not a Win32 expert. Thanks

packet-sent commented 2 years ago

If you are using a versioninfo.json file and put the icon path properly the icon should be on the exe and on the program when opened. It works perfectly for my CLI & GUI program. image

image