1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -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

@@ -4514,7 +4514,7 @@ BOOL CALLBACK TravelerDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
wchar_t dstPath[MAX_PATH * 2];
GetDlgItemText (hwndDlg, IDC_DIRECTORY, dstPath, ARRAYSIZE (dstPath));
if (BrowseDirectories (hwndDlg, "SELECT_DEST_DIR", dstPath))
if (BrowseDirectories (hwndDlg, "SELECT_DEST_DIR", dstPath, dstPath))
SetDlgItemText (hwndDlg, IDC_DIRECTORY, dstPath);
return 1;
@@ -6567,7 +6567,7 @@ static void ResumeInterruptedNonSysInplaceEncProcess (BOOL bDecrypt)
BOOL SelectContainer (HWND hwndDlg)
{
if (BrowseFiles (hwndDlg, "OPEN_VOL_TITLE", szFileName, bHistory, FALSE, NULL) == FALSE)
if (BrowseFiles (hwndDlg, "OPEN_VOL_TITLE", szFileName, bHistory, FALSE) == FALSE)
return FALSE;
AddComboItem (GetDlgItem (hwndDlg, IDC_VOLUME), szFileName, bHistory);
@@ -10957,7 +10957,7 @@ noHidden:
goto ret;
/* Select backup file */
if (!BrowseFiles (hwndDlg, "OPEN_TITLE", szFileName, bHistory, TRUE, NULL))
if (!BrowseFiles (hwndDlg, "OPEN_TITLE", szFileName, bHistory, TRUE))
goto ret;
/* Conceive the backup file */
@@ -11240,7 +11240,7 @@ int RestoreVolumeHeader (HWND hwndDlg, const wchar_t *lpszVolume)
}
/* Select backup file */
if (!BrowseFiles (hwndDlg, "OPEN_TITLE", szFileName, bHistory, FALSE, NULL))
if (!BrowseFiles (hwndDlg, "OPEN_TITLE", szFileName, bHistory, FALSE))
{
nStatus = ERR_SUCCESS;
goto ret;