Clarify null-HWND doc note in ForegroundWindow

This commit is contained in:
2026-06-02 12:39:32 -04:00
parent d45a01eca5
commit 9546999acb
+2 -1
View File
@@ -17,7 +17,8 @@ var (
// ForegroundWindow returns the current foreground window's handle (as a uintptr
// so platform-neutral callers need not import windows), its title, and its
// on-task class (process exe base name; see ClassFromImagePath). ok is false
// when there is no foreground window (e.g. secure desktop / lock screen).
// when GetForegroundWindow returns null, which happens transiently during focus
// changes and some secure-desktop transitions (UAC / lock screen).
func ForegroundWindow() (hwnd uintptr, title, class string, ok bool) {
h := windows.GetForegroundWindow()
if h == 0 {