[windows] Disable icon fix pt 2 - The revenge of

This commit is contained in:
Lea Anthony
2021-09-08 21:27:49 +10:00
parent b54a94135d
commit 4468edc939

View File

@@ -40,8 +40,14 @@ func NewWindow(parent winc.Controller, options *options.App) *Window {
result.SetHandle(winc.CreateWindow("wailsWindow", parent, uint(exStyle), uint(dwStyle)))
result.SetParent(parent)
if ico, err := winc.NewIconFromResource(winc.GetAppInstance(), uint16(winc.AppIconID)); err == nil {
result.SetIcon(0, ico)
loadIcon := true
if options.Windows != nil && options.Windows.DisableWindowIcon == true {
loadIcon = false
}
if loadIcon {
if ico, err := winc.NewIconFromResource(winc.GetAppInstance(), uint16(winc.AppIconID)); err == nil {
result.SetIcon(0, ico)
}
}
result.SetSize(options.Width, options.Height)
@@ -51,12 +57,6 @@ func NewWindow(parent winc.Controller, options *options.App) *Window {
result.SetMinSize(options.MinWidth, options.MinHeight)
result.SetMaxSize(options.MaxWidth, options.MaxHeight)
// Dlg forces display of focus rectangles, as soon as the user starts to type.
w32.SendMessage(result.Handle(), w32.WM_CHANGEUISTATE, w32.UIS_INITIALIZE, 0)
winc.RegMsgHandler(result)
result.SetFont(winc.DefaultFont)
if options.Windows != nil {
if options.Windows.WindowBackgroundIsTranslucent {
result.SetTranslucentBackground()
@@ -67,6 +67,12 @@ func NewWindow(parent winc.Controller, options *options.App) *Window {
}
}
// Dlg forces display of focus rectangles, as soon as the user starts to type.
w32.SendMessage(result.Handle(), w32.WM_CHANGEUISTATE, w32.UIS_INITIALIZE, 0)
winc.RegMsgHandler(result)
result.SetFont(winc.DefaultFont)
if options.Fullscreen {
result.Fullscreen()
}