diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-07-20 21:27:49 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-07-20 23:23:26 +0200 |
commit | 0fb2befe3ab57696d5b4c9de6fee344bfd520bf6 (patch) | |
tree | f29a720148694700bc367ce6e40ea0304869db9e /src/Setup | |
parent | 1ab09916f6bcaf0b643295a1bd47ca41a5f098d4 (diff) | |
download | VeraCrypt-0fb2befe3ab57696d5b4c9de6fee344bfd520bf6.tar.gz VeraCrypt-0fb2befe3ab57696d5b4c9de6fee344bfd520bf6.zip |
Windows: fix truncated license text in installer wizard.
Diffstat (limited to 'src/Setup')
-rw-r--r-- | src/Setup/Setup.rc | 2 | ||||
-rw-r--r-- | src/Setup/Wizard.c | 16 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/Setup/Setup.rc b/src/Setup/Setup.rc index e6acb0d4..c2de7230 100644 --- a/src/Setup/Setup.rc +++ b/src/Setup/Setup.rc @@ -119,9 +119,9 @@ END IDD_INTRO_PAGE_DLG DIALOGEX 0, 0, 346, 152 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - CONTROL "",IDC_LICENSE_TEXT,"RichEdit20A",ES_MULTILINE | ES_READONLY | ES_NUMBER | WS_BORDER | WS_VSCROLL | WS_TABSTOP,0,23,345,108 + CONTROL "",IDC_LICENSE_TEXT,"RichEdit20W",ES_MULTILINE | ES_READONLY | ES_NUMBER | WS_BORDER | WS_VSCROLL | WS_TABSTOP,0,23,345,108 CONTROL "",IDC_AGREE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,2,137,126,10 LTEXT "",IDC_BOX_HELP,0,0,346,22 END diff --git a/src/Setup/Wizard.c b/src/Setup/Wizard.c index 91f1aa0a..fa877589 100644 --- a/src/Setup/Wizard.c +++ b/src/Setup/Wizard.c @@ -12,8 +12,9 @@ code distribution packages. */ #include "Tcdefs.h" #include <Shlobj.h> +#include <Richedit.h> #include <io.h> #include <stdio.h> #include <time.h> #include "SelfExtract.h" @@ -221,12 +222,22 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa case INTRO_PAGE: { char *licenseText = NULL; + // increase size limit of rich edit control + SendMessage (GetDlgItem (hwndDlg, IDC_LICENSE_TEXT), EM_EXLIMITTEXT, 0, -1); + // Left margin for license text + SendMessage (GetDlgItem (hwndDlg, IDC_LICENSE_TEXT), EM_SETMARGINS, (WPARAM) EC_LEFTMARGIN, (LPARAM) CompensateXDPI (4)); + licenseText = GetLegalNotices (); if (licenseText != NULL) { - SetWindowTextA (GetDlgItem (hwndDlg, IDC_LICENSE_TEXT), licenseText); + SETTEXTEX TextInfo = {0}; + + TextInfo.flags = ST_SELECTION; + TextInfo.codepage = CP_ACP; + + SendMessage(GetDlgItem (hwndDlg, IDC_LICENSE_TEXT), EM_SETTEXTEX, (WPARAM)&TextInfo, (LPARAM)licenseText); free (licenseText); } else { @@ -257,11 +268,8 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), bLicenseAccepted); EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), FALSE); EnableWindow (GetDlgItem (GetParent (hwndDlg), IDHELP), bLicenseAccepted); - - // Left margin for license text - SendMessage (GetDlgItem (hwndDlg, IDC_LICENSE_TEXT), EM_SETMARGINS, (WPARAM) EC_LEFTMARGIN, (LPARAM) CompensateXDPI (4)); } return 1; case WIZARD_MODE_PAGE: |