1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

Windows: Replace legacy file/dir selection APIs with modern IFileDialog interface

We remove usage of GetOpenFileNameW/GetSaveFileNameW/SHBrowseForFolderW which are deprecated by Microsoft
This commit is contained in:
Mounir IDRASSI
2023-09-03 23:42:41 +02:00
parent 201d09ff5a
commit 2a6726b00e
7 changed files with 321 additions and 247 deletions

View File

@@ -45,8 +45,8 @@ enum wizard_pages
HWND hCurPage = NULL; /* Handle to current wizard page */
int nCurPageNo = -1; /* The current wizard page */
wchar_t WizardDestInstallPath [TC_MAX_PATH];
wchar_t WizardDestExtractPath [TC_MAX_PATH];
wchar_t WizardDestInstallPath [TC_MAX_PATH] = { 0 };
wchar_t WizardDestExtractPath [TC_MAX_PATH] = { 0 };
wchar_t SelfFile [TC_MAX_PATH];
HBITMAP hbmWizardBitmapRescaled = NULL;
@@ -646,7 +646,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
switch (lw)
{
case IDC_BROWSE:
if (BrowseDirectories (hwndDlg, "SELECT_DEST_DIR", WizardDestExtractPath))
if (BrowseDirectories (hwndDlg, "SELECT_DEST_DIR", WizardDestExtractPath, WizardDestExtractPath))
{
if (WizardDestExtractPath [wcslen(WizardDestExtractPath)-1] != L'\\')
{
@@ -667,7 +667,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
switch (lw)
{
case IDC_BROWSE:
if (BrowseDirectories (hwndDlg, "SELECT_DEST_DIR", WizardDestInstallPath))
if (BrowseDirectories (hwndDlg, "SELECT_DEST_DIR", WizardDestInstallPath, WizardDestInstallPath))
{
if (WizardDestInstallPath [wcslen(WizardDestInstallPath)-1] != L'\\')
{