设为首页 加入收藏

TOP

Atitit.创建快捷方式?windows快捷方式的原理(二)
2017-10-11 18:25:18 】 浏览:5997
Tags:Atitit. 创建 快捷 方式 windows 原理
p;com实现

Set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\学习天地.lnk")

 

2.4. Win没提供cli格式的方法

 

3.  

4. Attilax的总结

使用ini格式的url算兰..

5. Ref

java创建快捷方式(作者 ice古雨) - - ITeye技术网站.htm

()创建快捷方式到桌面的脚本命令_singularpoint_新浪博客.htm

Internet快捷方式-vivieu-ChinaUnix博客.htm

命令行创建快捷方式-vivieu-ChinaUnix博客.htm

CoCreateInstance_百度百科.htm

CoCreateInstance具体内部实现 - IT民工 博客频道 - CSDN.NET.htm

 

6. Winapi code

 

  hr = CoCreateInstance(CLSID_ShellLink, NULL,
       CLSCTX_INPROC_SERVER, IID_IShellLink, (void**)&pisl);

   IPersistFile* pIPF;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////

//这里是我们要创建快捷方式的原始文件地址
   pisl->SetPath("c:\\windows\\notepad.exe");
   hr = pisl->QueryInterface(IID_IPersistFile, (void**)&pIPF);
   if (SUCCEEDED(hr))
   {

/////////////////////////////////////////////////////////////////////////////////////////////////////////////

//这里是我们要创建快捷方式的目标地址


    pIPF->Save(L"c:\记事本.lnk", FALSE);
    pIPF->Release();

 

 

h = CoCreateInstance( CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,

IID_IShellLink, (PVOID*)&shellLink );

if (FAILED(h)) {

errStr = "Failed to create IShellLink";

goto err;

}

 

h = shellLink->QueryInterface(IID_IPersistFile, (PVOID*)&persistFile);

if (FAILED(h)) {

errStr = "Failed to get IPersistFile";

goto err;

}

 

 

7. --end

 

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇解决服务器SID引起虚拟机不能加入.. 下一篇最新电脑公司最新GHOST WIN7系统3..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目