VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Mount
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-10-14 23:18:25 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-10-14 23:36:15 (GMT)
commit41819270bbb7129a5568125a6b0cbfdf719680bd (patch)
treee47c9b527b2b0e89fbfe4f38045f8d67aff3e038 /src/Mount
parent8342d0d616a8340bc358b19146f1b2d8cdf41af8 (diff)
downloadVeraCrypt-41819270bbb7129a5568125a6b0cbfdf719680bd.zip
VeraCrypt-41819270bbb7129a5568125a6b0cbfdf719680bd.tar.gz
Windows: Solve lost focus for application after displaying the waiting dialog
Diffstat (limited to 'src/Mount')
-rw-r--r--src/Mount/Mount.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index 9ee5815..cd82c08 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -4598,9 +4598,10 @@ static BOOL Dismount (HWND hwndDlg, int nDosDriveNo)
void __cdecl mountThreadFunction (void *hwndDlgArg)
{
HWND hwndDlg =(HWND) hwndDlgArg;
+ BOOL bIsForeground = (GetForegroundWindow () == hwndDlg)? TRUE : FALSE;
// Disable parent dialog during processing to avoid user interaction
EnableWindow(hwndDlg, FALSE);
- finally_do_arg (HWND, hwndDlg, { EnableWindow(finally_arg, TRUE); bPrebootPasswordDlgMode = FALSE;});
+ finally_do_arg2 (HWND, hwndDlg, BOOL, bIsForeground, { EnableWindow(finally_arg, TRUE); if (finally_arg2) BringToForeground (finally_arg); bPrebootPasswordDlgMode = FALSE;});
Mount (hwndDlg, 0, 0, -1);
}
@@ -9102,7 +9103,7 @@ void CALLBACK mountFavoriteVolumeCallbackFunction (void *pArg, HWND hwnd)
void __cdecl mountFavoriteVolumeThreadFunction (void *pArg)
{
- ShowWaitDialog (NULL, FALSE, mountFavoriteVolumeCallbackFunction, pArg);
+ ShowWaitDialog (MainDlg, FALSE, mountFavoriteVolumeCallbackFunction, pArg);
}
static void SaveDefaultKeyFilesParam (HWND hwnd)