MCPcopy Create free account
hub / github.com/VSCodeConfigHelper/v4 / create_lnk

Function create_lnk

src-tauri/src/utils/winapi.rs:95–113  ·  view source on GitHub ↗
(lnk: &str, target: &str, desc: &str, args: &str)

Source from the content-addressed store, hash-verified

93}
94
95pub fn create_lnk(lnk: &str, target: &str, desc: &str, args: &str) -> Result<()> {
96 pcwstr! {
97 let lnk;
98 let target;
99 let desc;
100 let args;
101 }
102 unsafe {
103 CoInitialize(None)?;
104 let shell_link: IShellLinkW = CoCreateInstance(&ShellLink, None, CLSCTX_INPROC_SERVER)?;
105 shell_link.SetPath(target)?;
106 shell_link.SetDescription(desc)?;
107 shell_link.SetArguments(args)?;
108 let persist_file: IPersistFile = Interface::cast(&shell_link)?;
109 persist_file.Save(lnk, true)?;
110 CoUninitialize();
111 }
112 Ok(())
113}
114
115pub fn free_console() -> bool {
116 // https://github.com/rust-lang/rust/issues/100884

Callers 1

createFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected