mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-30 23:13:31 +01:00
Windows: cleaner code for handling of disabling of parent dialog when waiting dialog displayed
This commit is contained in:
parent
5493de11d5
commit
4a246cb6ef
@ -7372,16 +7372,16 @@ void ShowWaitDialog(HWND hwnd, BOOL bUseHwndAsParent, WaitThreadProc callback, v
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
BOOL bIsForeground = FALSE;
|
BOOL bIsForeground = FALSE;
|
||||||
|
HWND creatorWnd = hwnd? hwnd : MainDlg;
|
||||||
WaitDialogDisplaying = TRUE;
|
WaitDialogDisplaying = TRUE;
|
||||||
if (hwnd)
|
if (creatorWnd)
|
||||||
{
|
{
|
||||||
if (GetForegroundWindow () == hwnd)
|
if (GetForegroundWindow () == creatorWnd)
|
||||||
bIsForeground = TRUE;
|
bIsForeground = TRUE;
|
||||||
EnableWindow (hwnd, FALSE);
|
EnableWindow (creatorWnd, FALSE);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
EnableWindow (MainDlg, FALSE);
|
finally_do_arg2 (HWND, creatorWnd, BOOL, bIsForeground, { if (finally_arg) { EnableWindow(finally_arg, TRUE); if (finally_arg2) BringToForeground (finally_arg);}});
|
||||||
finally_do_arg2 (HWND, hwnd, BOOL, bIsForeground, { if (finally_arg) {EnableWindow(finally_arg, TRUE); if (finally_arg2) BringToForeground (finally_arg);} else EnableWindow (MainDlg, TRUE);});
|
|
||||||
|
|
||||||
DialogBoxParamW (hInst,
|
DialogBoxParamW (hInst,
|
||||||
MAKEINTRESOURCEW (IDD_STATIC_MODAL_WAIT_DLG), hParent,
|
MAKEINTRESOURCEW (IDD_STATIC_MODAL_WAIT_DLG), hParent,
|
||||||
|
Loading…
Reference in New Issue
Block a user