From 74c851754c52adf74e611bc1533c8eb481439d84 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 2 Jun 2014 17:12:10 -0400 Subject: [PATCH] Gave message boxes on Windows the MB_TASKMODAL style, which does event modality to the other windows in the program. Does not affect resizes. --- dialog_windows.go | 1 + zconstants_windows_386.go | 1 + zconstants_windows_amd64.go | 1 + 3 files changed, 3 insertions(+) diff --git a/dialog_windows.go b/dialog_windows.go index ab1c2dd..9d529a5 100644 --- a/dialog_windows.go +++ b/dialog_windows.go @@ -21,6 +21,7 @@ func _msgBox(primarytext string, secondarytext string, uType uint32) (result int if secondarytext != "" { text += "\n\n" + secondarytext } + uType |= _MB_TASKMODAL // make modal to every window in the program (they're all windows of the uitask, which is a single thread) ret := make(chan uiret) defer close(ret) uitask <- &uimsg{ diff --git a/zconstants_windows_386.go b/zconstants_windows_386.go index fa0ab76..422b320 100644 --- a/zconstants_windows_386.go +++ b/zconstants_windows_386.go @@ -49,6 +49,7 @@ const _LF_FACESIZE = 32 const _MA_ACTIVATE = 1 const _MB_ICONERROR = 16 const _MB_OK = 0 +const _MB_TASKMODAL = 8192 const _MK_LBUTTON = 1 const _MK_MBUTTON = 16 const _MK_RBUTTON = 2 diff --git a/zconstants_windows_amd64.go b/zconstants_windows_amd64.go index 54bbae8..2a6d29c 100644 --- a/zconstants_windows_amd64.go +++ b/zconstants_windows_amd64.go @@ -49,6 +49,7 @@ const _LF_FACESIZE = 32 const _MA_ACTIVATE = 1 const _MB_ICONERROR = 16 const _MB_OK = 0 +const _MB_TASKMODAL = 8192 const _MK_LBUTTON = 1 const _MK_MBUTTON = 16 const _MK_RBUTTON = 2