From 957ff20f37d25927cf48efb52289f6c6a60f1e0b Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 9 Sep 2015 23:33:30 +0200 Subject: Windows: Implement waiting dialog for Mount All Favorites Volumes operation. --- src/Common/Dlgcode.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'src/Common') 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); + } } } -- cgit v1.2.3