5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 23:20:51 +08:00
wails/v3/pkg/w32/wda.go
2025-04-27 08:02:24 +10:00

22 lines
503 B
Go

//go:build windows
package w32
const (
WDA_NONE = 0x00000000
WDA_MONITOR = 0x00000001
WDA_EXCLUDEFROMCAPTURE = 0x00000011 // windows 10 2004+
)
func SetWindowDisplayAffinity(hwnd uintptr, affinity uint32) bool {
if affinity == WDA_EXCLUDEFROMCAPTURE && !IsWindowsVersionAtLeast(10, 0, 19041) {
// for older windows versions, use WDA_MONITOR
affinity = WDA_MONITOR
}
ret, _, _ := procSetWindowDisplayAffinity.Call(
hwnd,
uintptr(affinity),
)
return ret != 0
}