VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/Dlgcode.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index 4e8dc015..ef3b5662 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -134,6 +134,8 @@ BOOL MountVolumesAsSystemFavorite = FALSE;
BOOL FavoriteMountOnArrivalInProgress = FALSE;
BOOL MultipleMountOperationInProgress = FALSE;
+BOOL WaitDialogDisplaying = FALSE;
+
/* Handle to the device driver */
HANDLE hDriver = INVALID_HANDLE_VALUE;
@@ -6596,15 +6598,26 @@ void ShowWaitDialog(HWND hwnd, BOOL bUseHwndAsParent, WaitThreadProc callback, v
WaitThreadParam threadParam;
threadParam.callback = callback;
threadParam.pArg = pArg;
-
- DialogBoxParamW (hInst,
- MAKEINTRESOURCEW (IDD_STATIC_MODAL_WAIT_DLG), hParent,
- (DLGPROC) WaitDlgProc, (LPARAM) &threadParam);
- if (hwnd && IsWindowVisible(hwnd) && !bUseHwndAsParent)
+ if (WaitDialogDisplaying)
+ {
+ callback (pArg, hwnd);
+ }
+ else
{
- SetForegroundWindow(hwnd);
- BringWindowToTop(hwnd);
+ WaitDialogDisplaying = TRUE;
+
+ DialogBoxParamW (hInst,
+ MAKEINTRESOURCEW (IDD_STATIC_MODAL_WAIT_DLG), hParent,
+ (DLGPROC) WaitDlgProc, (LPARAM) &threadParam);
+
+ WaitDialogDisplaying = FALSE;
+
+ if (hwnd && IsWindowVisible(hwnd) && !bUseHwndAsParent)
+ {
+ SetForegroundWindow(hwnd);
+ BringWindowToTop(hwnd);
+ }
}
}