https://git.reactos.org/?p=reactos.git;a=commitdiff;h=96e6cee044b127b8e8507…
commit 96e6cee044b127b8e85075c6c046f4b2167dc225
Author: Jared Smudde <computerwhiz02(a)hotmail.com>
AuthorDate: Thu Apr 30 03:10:40 2020 -0500
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu Apr 30 11:10:40 2020 +0300
[DESK] Set some flags for Browse for Wallpaper dialog (#2699)
* [DESK] Add initial directory flag and set it to My Pictures. Also set OFN_EXPLORER
style.
* Use CSIDL_MYPICTURES instead of environment variable concoction.
* Fix formatting.
---
dll/cpl/desk/background.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dll/cpl/desk/background.c b/dll/cpl/desk/background.c
index 878b2f64bc1..8497f83f9f7 100644
--- a/dll/cpl/desk/background.c
+++ b/dll/cpl/desk/background.c
@@ -635,6 +635,7 @@ OnBrowseButton(HWND hwndDlg, PBACKGROUND_DATA pData)
OPENFILENAME ofn;
TCHAR filename[MAX_PATH];
TCHAR fileTitle[256];
+ TCHAR initialDir[MAX_PATH];
LPTSTR filter;
LPTSTR extensions;
BackgroundItem *backgroundItem = NULL;
@@ -652,6 +653,7 @@ OnBrowseButton(HWND hwndDlg, PBACKGROUND_DATA pData)
hwndBackgroundList = GetDlgItem(hwndDlg, IDC_BACKGROUND_LIST);
himl = ListView_GetImageList(hwndBackgroundList, LVSIL_SMALL);
+ SHGetFolderPathW(NULL, CSIDL_MYPICTURES, NULL, 0, initialDir);
ZeroMemory(&ofn, sizeof(OPENFILENAME));
@@ -706,8 +708,8 @@ OnBrowseButton(HWND hwndDlg, PBACKGROUND_DATA pData)
ofn.nFilterIndex = 0;
ofn.lpstrFileTitle = fileTitle;
ofn.nMaxFileTitle = 256;
- ofn.lpstrInitialDir = NULL;
- ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
+ ofn.lpstrInitialDir = initialDir;
+ ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_EXPLORER;
success = GetOpenFileName(&ofn);
HeapFree(GetProcessHeap(), 0, filter);