-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
当前打开文件夹方法:
| _openDirectory(filePath); |
来自 open_dir 包
static bool OpenDir(const std::string& path, const std::string highlightedFileName = "") {
std::wstring wpath = Utf8ToWide(path);
HINSTANCE result;
if (highlightedFileName.empty()) {
result = ShellExecuteW(NULL, L"open", wpath.c_str(), NULL, NULL, SW_SHOW);
} else {
std::wstring wHighlightedFileName = Utf8ToWide(highlightedFileName);
std::wstring wCommand = L"/select,\"" + wpath + L"\\" + wHighlightedFileName + L"\"";
result = ShellExecuteW(NULL, L"open", L"explorer.exe", wCommand.c_str(), NULL, SW_SHOW);
}
return (result > reinterpret_cast<HINSTANCE>(32));
}
使用硬编码调用 explorer.exe 打开文件夹。
希望可以改为:
从注册表 HKEY_CLASSES_ROOT\Directory\shell\open\command 获取 打开文件夹方法 , 以支持 第三方文件资源管理器。
Metadata
Metadata
Assignees
Labels
No labels