From e388e6cd8d7ca242c0ef477c04552be339115b02 Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Fri, 5 Jul 2024 00:20:01 +0100 Subject: [PATCH] Bring message box to the front. --- internal/win/user32.go | 1 + msg_windows.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/win/user32.go b/internal/win/user32.go index 59b52d6..98b5c8d 100644 --- a/internal/win/user32.go +++ b/internal/win/user32.go @@ -37,6 +37,7 @@ const ( MB_DEFBUTTON1 = windows.MB_DEFBUTTON1 MB_DEFBUTTON2 = windows.MB_DEFBUTTON2 MB_DEFBUTTON3 = windows.MB_DEFBUTTON3 + MB_SETFOREGROUND = windows.MB_SETFOREGROUND // Window messages WM_DESTROY = 0x0002 diff --git a/msg_windows.go b/msg_windows.go index 26a8048..15b6fa3 100644 --- a/msg_windows.go +++ b/msg_windows.go @@ -7,7 +7,7 @@ import ( ) func message(kind messageKind, text string, opts options) error { - var flags uint32 + var flags uint32 = win.MB_SETFOREGROUND switch { case kind == questionKind && opts.extraButton != nil: