mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 18:00:02 +08:00
parent
9bd765d2c8
commit
e4f2bfe699
@ -611,7 +611,9 @@ func (f *Frontend) navigationCompleted(sender *edge.ICoreWebView2, args *edge.IC
|
|||||||
|
|
||||||
func (f *Frontend) ShowWindow() {
|
func (f *Frontend) ShowWindow() {
|
||||||
f.mainWindow.Invoke(func() {
|
f.mainWindow.Invoke(func() {
|
||||||
|
if f.mainWindow.IsMinimised() {
|
||||||
f.mainWindow.Restore()
|
f.mainWindow.Restore()
|
||||||
|
}
|
||||||
w32.SetForegroundWindow(f.mainWindow.Handle())
|
w32.SetForegroundWindow(f.mainWindow.Handle())
|
||||||
w32.SetFocus(f.mainWindow.Handle())
|
w32.SetFocus(f.mainWindow.Handle())
|
||||||
})
|
})
|
||||||
|
@ -11,6 +11,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
WS_MAXIMIZE = 0x01000000
|
WS_MAXIMIZE = 0x01000000
|
||||||
|
WS_MINIMIZE = 0x20000000
|
||||||
|
|
||||||
GWL_STYLE = -16
|
GWL_STYLE = -16
|
||||||
)
|
)
|
||||||
@ -36,6 +37,10 @@ func IsWindowMaximised(hwnd uintptr) bool {
|
|||||||
style := uint32(getWindowLong(hwnd, GWL_STYLE))
|
style := uint32(getWindowLong(hwnd, GWL_STYLE))
|
||||||
return style&WS_MAXIMIZE != 0
|
return style&WS_MAXIMIZE != 0
|
||||||
}
|
}
|
||||||
|
func IsWindowMinimised(hwnd uintptr) bool {
|
||||||
|
style := uint32(getWindowLong(hwnd, GWL_STYLE))
|
||||||
|
return style&WS_MINIMIZE != 0
|
||||||
|
}
|
||||||
|
|
||||||
func dwmExtendFrameIntoClientArea(hwnd uintptr, margins *MARGINS) error {
|
func dwmExtendFrameIntoClientArea(hwnd uintptr, margins *MARGINS) error {
|
||||||
ret, _, _ := procDwmExtendFrameIntoClientArea.Call(
|
ret, _, _ := procDwmExtendFrameIntoClientArea.Call(
|
||||||
|
@ -230,5 +230,8 @@ func (w *Window) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
|
|||||||
|
|
||||||
func (w *Window) IsMaximised() bool {
|
func (w *Window) IsMaximised() bool {
|
||||||
return win32.IsWindowMaximised(w.Handle())
|
return win32.IsWindowMaximised(w.Handle())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w *Window) IsMinimised() bool {
|
||||||
|
return win32.IsWindowMinimised(w.Handle())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user