修复'文件夹项目'带有特殊符号时,打开文件夹失败的问题。

This commit is contained in:
unknown 2025-03-16 17:40:05 +08:00
parent 2cd721263e
commit 881fbc9f56

View File

@ -743,6 +743,10 @@ pub fn shell_execute(
path.parent().unwrap().display().to_string()
}
});
// 文件夹
let dir_param = format!("\"{}\"", file.to_string());
let dir_param = HSTRING::from(dir_param.as_str());
let dir_param = PCWSTR(dir_param.as_ptr());
// HSTRING
let operation = HSTRING::from(operation.as_str());
let file = HSTRING::from(file.as_str());
@ -759,7 +763,7 @@ pub fn shell_execute(
None,
w!("open"),
w!("explorer.exe"),
file,
dir_param,
None,
SW_SHOWDEFAULT,
);