mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
Fix bug in runtime.Show(). Tidy up debug.
This commit is contained in:
parent
2f99ef7c94
commit
7ef6f7d2b9
5 changed files with 20 additions and 13 deletions
0
v2/examples/systray/frontend/dist/.gitkeep
vendored
0
v2/examples/systray/frontend/dist/.gitkeep
vendored
|
|
@ -374,11 +374,11 @@ func (f *Frontend) ScreenGetAll() ([]Screen, error) {
|
|||
}
|
||||
|
||||
func (f *Frontend) Show() {
|
||||
f.mainWindow.Show()
|
||||
f.WindowShow()
|
||||
}
|
||||
|
||||
func (f *Frontend) Hide() {
|
||||
f.mainWindow.Hide()
|
||||
f.WindowHide()
|
||||
}
|
||||
|
||||
func (f *Frontend) WindowIsMaximised() bool {
|
||||
|
|
|
|||
|
|
@ -13,20 +13,21 @@ type HANDLE uintptr
|
|||
type HMONITOR HANDLE
|
||||
|
||||
var (
|
||||
moduser32 = syscall.NewLazyDLL("user32.dll")
|
||||
procSystemParametersInfo = moduser32.NewProc("SystemParametersInfoW")
|
||||
procGetWindowLong = moduser32.NewProc("GetWindowLongW")
|
||||
procSetClassLong = moduser32.NewProc("SetClassLongW")
|
||||
procSetClassLongPtr = moduser32.NewProc("SetClassLongPtrW")
|
||||
procShowWindow = moduser32.NewProc("ShowWindow")
|
||||
procIsWindowVisible = moduser32.NewProc("IsWindowVisible")
|
||||
procGetWindowRect = moduser32.NewProc("GetWindowRect")
|
||||
procGetMonitorInfo = moduser32.NewProc("GetMonitorInfoW")
|
||||
procMonitorFromWindow = moduser32.NewProc("MonitorFromWindow")
|
||||
moduser32 = syscall.NewLazyDLL("user32.dll")
|
||||
procSystemParametersInfo = moduser32.NewProc("SystemParametersInfoW")
|
||||
procGetWindowLong = moduser32.NewProc("GetWindowLongW")
|
||||
procSetClassLong = moduser32.NewProc("SetClassLongW")
|
||||
procSetClassLongPtr = moduser32.NewProc("SetClassLongPtrW")
|
||||
procShowWindow = moduser32.NewProc("ShowWindow")
|
||||
procIsWindowVisible = moduser32.NewProc("IsWindowVisible")
|
||||
procGetWindowRect = moduser32.NewProc("GetWindowRect")
|
||||
procGetMonitorInfo = moduser32.NewProc("GetMonitorInfoW")
|
||||
procMonitorFromWindow = moduser32.NewProc("MonitorFromWindow")
|
||||
procLookupIconIdFromDirectoryEx = moduser32.NewProc("LookupIconIdFromDirectoryEx")
|
||||
procCreateIconFromResourceEx = moduser32.NewProc("CreateIconFromResourceEx")
|
||||
procCreateIconIndirect = moduser32.NewProc("CreateIconIndirect")
|
||||
procLoadImageW = moduser32.NewProc("LoadImageW")
|
||||
procBringWindowToTop = moduser32.NewProc("BringWindowToTop")
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
|||
|
|
@ -218,3 +218,10 @@ func GetMonitorInfo(hMonitor HMONITOR, lmpi *MONITORINFO) bool {
|
|||
)
|
||||
return ret != 0
|
||||
}
|
||||
|
||||
func BringWindowToTop(hwnd uintptr) bool {
|
||||
ret, _, _ := procBringWindowToTop.Call(
|
||||
hwnd,
|
||||
)
|
||||
return ret != 0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -314,7 +314,6 @@ func (p *Systray) Run() error {
|
|||
rt := win32.GetMessage(&msg)
|
||||
switch int(rt) {
|
||||
case 0:
|
||||
println("Quitting Run()")
|
||||
return nil
|
||||
case -1:
|
||||
return errors.New("run failed")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue