support context menu
This commit is contained in:
@@ -155,6 +155,18 @@ pub fn get_children(parent_path: String, state: &DiskState) -> Vec<FileTreeNode>
|
||||
results
|
||||
}
|
||||
|
||||
pub async fn open_explorer(path: String) -> Result<(), String> {
|
||||
const CREATE_NO_WINDOW: u32 = 0x08000000;
|
||||
// 使用 /select, 参数可以在打开目录的同时选中目标
|
||||
Command::new("explorer.exe")
|
||||
.arg("/select,")
|
||||
.arg(&path)
|
||||
.creation_flags(CREATE_NO_WINDOW)
|
||||
.spawn()
|
||||
.map_err(|e| e.to_string())?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// --- 快速模式配置与逻辑 ---
|
||||
|
||||
#[derive(Clone)]
|
||||
|
||||
Reference in New Issue
Block a user