diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-09-09 23:33:30 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-09-10 01:44:14 +0200 |
commit | 957ff20f37d25927cf48efb52289f6c6a60f1e0b (patch) | |
tree | 16da07185c5275486854fc19e214d2996ef89e5c /src/Common/Dlgcode.c | |
parent | ec7b5cd7e63bf78fa98c9b9713846b99b835dd71 (diff) | |
download | VeraCrypt-957ff20f37d25927cf48efb52289f6c6a60f1e0b.tar.gz VeraCrypt-957ff20f37d25927cf48efb52289f6c6a60f1e0b.zip |
Windows: Implement waiting dialog for Mount All Favorites Volumes operation.
Diffstat (limited to 'src/Common/Dlgcode.c')
-rw-r--r-- | src/Common/Dlgcode.c | 27 |
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);
+ }
}
}
|