VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format/Tcformat.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-06-07 01:37:23 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-06-07 01:38:34 +0200
commitc3c1bdd29d932f2b38e7c3995498f9a4eab8702b (patch)
tree17442ccd96111eae10c729ac719f236e5e2ead21 /src/Format/Tcformat.c
parent550e2bcf3bc1626ccb950c6bc97f1348e94cca76 (diff)
downloadVeraCrypt-c3c1bdd29d932f2b38e7c3995498f9a4eab8702b.tar.gz
VeraCrypt-c3c1bdd29d932f2b38e7c3995498f9a4eab8702b.zip
Windows: Add support for PIN in favorites. Several enhancements to GUI handling of Dynamic Mode.
Diffstat (limited to 'src/Format/Tcformat.c')
-rw-r--r--src/Format/Tcformat.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index 574d61eb..a59ec4a4 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -3479,12 +3479,14 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
WORD lw = LOWORD (wParam);
WORD hw = HIWORD (wParam);
+ static BOOL PinValueChangedWarning = FALSE;
hCurPage = hwndDlg;
switch (uMsg)
{
case WM_INITDIALOG:
+ PinValueChangedWarning = FALSE;
LocalizeDialog (hwndDlg, "IDD_VOL_CREATION_WIZARD_DLG");
UpdateLastDialogId ();
@@ -4154,6 +4156,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
char szTmp[MAX_PIN + 1];
StringCbPrintfA(szTmp, sizeof(szTmp), "%d", volumePin);
SetWindowText (GetDlgItem (hwndDlg, IDC_PIN), szTmp);
+
+ PinValueChangedWarning = TRUE;
+ SetDlgItemTextW (hwndDlg, IDC_PIN_HELP, GetString (SysEncInEffect ()? "PIN_SYSENC_CHANGE_WARNING" : "PIN_CHANGE_WARNING"));
}
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable && !SysEncInEffect());
@@ -4913,6 +4918,20 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
AfterSysEncProgressWMInitTasks (hwndDlg);
return 1;
+ case WM_CTLCOLORSTATIC:
+ {
+ if (PinValueChangedWarning && ((HWND)lParam == GetDlgItem(hwndDlg, IDC_PIN_HELP)) )
+ {
+ // we're about to draw the static
+ // set the text colour in (HDC)lParam
+ SetBkMode((HDC)wParam,TRANSPARENT);
+ SetTextColor((HDC)wParam, RGB(255,0,0));
+ // NOTE: per documentation as pointed out by selbie, GetSolidBrush would leak a GDI handle.
+ return (BOOL)GetSysColorBrush(COLOR_MENU);
+ }
+ }
+ return 0;
+
case WM_COMMAND:
if (nCurPageNo == INTRO_PAGE)
@@ -5293,6 +5312,20 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
KeyFilesEnable && FirstKeyFile!=NULL && !SysEncInEffect());
volumePassword.Length = (unsigned __int32) strlen ((char *) volumePassword.Text);
+ if (lw == IDC_PIN)
+ {
+ if(GetPin (hwndDlg, IDC_PIN) != 0)
+ {
+ PinValueChangedWarning = TRUE;
+ SetDlgItemTextW (hwndDlg, IDC_PIN_HELP, GetString (SysEncInEffect ()? "PIN_SYSENC_CHANGE_WARNING" : "PIN_CHANGE_WARNING"));
+ }
+ else
+ {
+ PinValueChangedWarning = FALSE;
+ SetDlgItemTextW (hwndDlg, IDC_PIN_HELP, (wchar_t *) GetDictionaryValueByInt (IDC_PIN_HELP));
+ }
+ }
+
return 1;
}