1 Commits
Author SHA1 Message Date
weishaupt 40370fce29 Keep the bar on top: re-assert topmost if Windows drops it 2026-11-08 17:19:02 +00:00
+12
View File
@@ -437,6 +437,17 @@ func setTaskbarState(owner uintptr, state uintptr) {
appBar(abmSetState, &abd)
}
// keepOnTop puts the bar back in the topmost band if Windows or another program
// has knocked it out of it, which otherwise sinks it under every other window.
func keepOnTop(hwnd uintptr) {
ex, _, _ := pGetWindowLongPtr.Call(hwnd, neg(-20))
if ex&wsExTopmost != 0 {
return
}
const swpNoSize, swpNoMove = 0x0001, 0x0002
pSetWindowPos.Call(hwnd, hwndTopmost, 0, 0, 0, 0, swpNoSize|swpNoMove|swpNoActivate)
}
func hideTaskbar() {
tb := findTaskbar()
if tb == 0 {
@@ -983,6 +994,7 @@ func wndProc(hwnd, m, wparam, lparam uintptr) (result uintptr) {
return 0
}
hideTaskbar()
keepOnTop(hwnd)
tick++
changed := refreshApps(tick%16 == 0)
if gmTick(tick) {