VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Mount/Mount.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2018-08-28 16:54:51 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2018-08-28 16:57:53 +0200
commit638f717d905969c7d9d20c711c7d1c2c75665c2c (patch)
tree6a1993f972552a2b45e741c10798c5d971d5c951 /src/Mount/Mount.c
parent2576290e7b9cb17842e505f221852069d21c27e9 (diff)
downloadVeraCrypt-638f717d905969c7d9d20c711c7d1c2c75665c2c.tar.gz
VeraCrypt-638f717d905969c7d9d20c711c7d1c2c75665c2c.zip
Windows: Fix buttons at the bottom not shown when user sets a large system font under Window 7
Diffstat (limited to 'src/Mount/Mount.c')
-rw-r--r--src/Mount/Mount.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index aefafe94..6e6d601e 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -537,6 +537,21 @@ static void InitMainDialog (HWND hwndDlg)
SendMessage (GetDlgItem (hwndDlg, IDC_NO_HISTORY), BM_SETCHECK, bHistory ? BST_UNCHECKED : BST_CHECKED, 0);
EnableDisableButtons (hwndDlg);
+
+ // Ensure bottom buttons are visible if the user sets a large font size
+ RECT mainRectScreen, boxRectScreen;
+ ULONG mainHeigth, mainWidth, correctHeigth;
+ GetWindowRect (hwndDlg, &mainRectScreen);
+ GetWindowRect (GetDlgItem (hwndDlg, IDC_LOWER_BOX), &boxRectScreen);
+
+ mainHeigth = mainRectScreen.bottom - mainRectScreen.top;
+ mainWidth = mainRectScreen.right - mainRectScreen.left;
+ correctHeigth = boxRectScreen.bottom - mainRectScreen.top + CompensateYDPI (5);
+
+ if (mainHeigth < correctHeigth)
+ {
+ SetWindowPos (hwndDlg, NULL, 0, 0, mainWidth, correctHeigth , SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW);
+ }
}
}