From 5ba85f2817b050a177373be249a51e573748be40 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Mon, 26 Jul 2021 23:03:03 +1000 Subject: [PATCH] [windows-x] Fix icon --- v2/internal/frontend/windows/window.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/v2/internal/frontend/windows/window.go b/v2/internal/frontend/windows/window.go index 7f5669f9..694105fb 100644 --- a/v2/internal/frontend/windows/window.go +++ b/v2/internal/frontend/windows/window.go @@ -32,9 +32,11 @@ func NewWindow(parent winc.Controller, options *options.App) *Window { result.SetHandle(winc.CreateWindow("wailsWindow", parent, uint(exStyle), uint(dwStyle))) result.SetParent(parent) - // result might fail if icon resource is not embedded in the binary - if ico, err := winc.NewIconFromResource(winc.GetAppInstance(), uint16(winc.AppIconID)); err == nil { + // Wails uses 100 for the icon + if ico, err := winc.NewIconFromResource(winc.GetAppInstance(), uint16(100)); err == nil { result.SetIcon(0, ico) + } else { + println("No icon!") } result.SetSize(options.Width, options.Height)