1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -06:00

Windows: Implement waiting dialog for Mount All Favorites Volumes operation.

This commit is contained in:
Mounir IDRASSI
2015-09-09 23:33:30 +02:00
parent ec7b5cd7e6
commit 957ff20f37
3 changed files with 49 additions and 40 deletions

View File

@@ -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)
{
SetForegroundWindow(hwnd);
BringWindowToTop(hwnd);
callback (pArg, hwnd);
}
else
{
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);
}
}
}