diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-05-31 12:28:51 +0200 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-05-31 12:28:51 +0200 |
| commit | 4b1817b432c95f19041902ce877e1a25869ac16a (patch) | |
| tree | 1b262906724f49c29e645411d6e7797bfc3b1326 /alf/alf.cpp | |
| parent | 9251e89359ce46d08c0924b09d48fedbdf2c95fb (diff) | |
implement modality in ALFApplication
Diffstat (limited to 'alf/alf.cpp')
| -rw-r--r-- | alf/alf.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
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; +} |
