mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-30 03:15:38 -05:00
fix openFolder on Windows
This commit is contained in:
parent
a555f736d0
commit
154c5a2522
2 changed files with 12 additions and 3 deletions
|
@ -75,8 +75,17 @@ std::string utils::clipboard::read() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool utils::file::openFolder(ghc::filesystem::path const& path) {
|
bool utils::file::openFolder(ghc::filesystem::path const& path) {
|
||||||
ShellExecuteA(NULL, "open", path.string().c_str(), NULL, NULL, SW_SHOWDEFAULT);
|
auto success = false;
|
||||||
return true;
|
if (CoInitializeEx(nullptr, COINIT_MULTITHREADED) == S_OK) {
|
||||||
|
if (auto id = ILCreateFromPathW(path.wstring().c_str())) {
|
||||||
|
if (SHOpenFolderAndSelectItems(id, 0, nullptr, 0) == S_OK) {
|
||||||
|
success = true;
|
||||||
|
}
|
||||||
|
ILFree(id);
|
||||||
|
}
|
||||||
|
CoUninitialize();
|
||||||
|
}
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<ghc::filesystem::path> utils::file::pickFile(
|
Result<ghc::filesystem::path> utils::file::pickFile(
|
||||||
|
|
Loading…
Reference in a new issue