mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-11 09:40:42 +00:00
Clicking a "Recent Folder" item shows the native dialog in the correct folder
Reported here: https://community.aseprite.org/t/1155
This commit is contained in:
parent
358265e3e1
commit
233bae8dc9
@ -111,6 +111,23 @@ private:
|
||||
return hr;
|
||||
}
|
||||
|
||||
if (std::wcslen(&m_initialDir[0]) > 0) {
|
||||
base::ComPtr<IShellItem> item;
|
||||
|
||||
// The SHCreateItemFromParsingName() function is available since
|
||||
// Windows Vista in shell32.dll
|
||||
hr = ::SHCreateItemFromParsingName(&m_initialDir[0], nullptr,
|
||||
IID_PPV_ARGS(&item));
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
if (item.get()) {
|
||||
hr = dlg->SetFolder(item.get());
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_defExtension.empty()) {
|
||||
std::wstring defExt = base::from_utf8(m_defExtension);
|
||||
hr = dlg->SetDefaultExtension(defExt.c_str());
|
||||
|
Loading…
x
Reference in New Issue
Block a user