From 881fbc9f564c8387c8722792d01549e1f083d373 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 16 Mar 2025 17:40:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D'=E6=96=87=E4=BB=B6=E5=A4=B9?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE'=E5=B8=A6=E6=9C=89=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E7=AC=A6=E5=8F=B7=E6=97=B6=EF=BC=8C=E6=89=93=E5=BC=80=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rust/windows.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rust/windows.rs b/rust/windows.rs index 9bff9ef..178641f 100644 --- a/rust/windows.rs +++ b/rust/windows.rs @@ -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, );