mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-22 23:48:08 -05:00
fix openFolder on Windows
This commit is contained in:
parent
a555f736d0
commit
154c5a2522
2 changed files with 12 additions and 3 deletions
|
@ -13,4 +13,4 @@ struct MyGameToolbox : Modify<MyGameToolbox, GameToolbox> {
|
|||
CCEGLView::get()->setScissorInPoints(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -75,8 +75,17 @@ std::string utils::clipboard::read() {
|
|||
}
|
||||
|
||||
bool utils::file::openFolder(ghc::filesystem::path const& path) {
|
||||
ShellExecuteA(NULL, "open", path.string().c_str(), NULL, NULL, SW_SHOWDEFAULT);
|
||||
return true;
|
||||
auto success = false;
|
||||
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(
|
||||
|
|
Loading…
Reference in a new issue