From 4b1817b432c95f19041902ce877e1a25869ac16a Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Sun, 31 May 2020 12:28:51 +0200 Subject: implement modality in ALFApplication --- alf/alf.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'alf/alf.cpp') diff --git a/alf/alf.cpp b/alf/alf.cpp index 84ba71d..a4abca6 100644 --- a/alf/alf.cpp +++ b/alf/alf.cpp @@ -411,3 +411,22 @@ ALF_SetFocus(HWND target) else SendMessage(target, WM_NEXTDLGCTL, (WPARAM)target, TRUE); } + +int +ALF_MessageBox(HWND hwnd, const TCHAR *text, const TCHAR *caption, UINT type) +{ + ALFApplication *app = NULL; + + if (GetWindowThreadProcessId(hwnd, NULL) == GetCurrentThreadId()) + app = ALF_Toplevel_Application(hwnd); + + if (app) + ALF_Application_DisableWindowsForModal(app, hwnd); + + int retval = MessageBox(hwnd, text, caption, type); + + if (app) + ALF_Application_ReenableWindowsForModal(app, hwnd); + + return retval; +} -- cgit v1.2.3