如何在C#中使用WIN32API创建快捷方式? [英] How to create shortcut using WIN32API in C#?

查看:223
本文介绍了如何在C#中使用WIN32API创建快捷方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不想在VC#2008中使用"Windows Scrip Host"和"VBSTKIT.DLL"来创建快捷方式吗?我的想法是:除了上面两个库之外,哪个库包含一个为我的应用程序创建快捷方式文件的API?那是什么API?谢谢.

I dont want to use "Windows Scrip Host" and "VBSTKIT.DLL" in VC#2008 to create shortcut? My idea is: which library besides two libraries above that contains an API to create shortcut file for my app? What API is that? Thanks.

推荐答案

我不是100%知道在这里您称其为快捷方式",但是,如果没有WSH,似乎就是您想要的正在使用ShellLink对象.如果是这样,则可以使用.NET包装器.请参阅:
http://www.vbaccelerator.com/home/NET/Code/Libraries/Shell_Projects/Creating_and_Modifying_Shortcuts/article.asp [ ^ ].

另请参阅此问题的第一个答案:
http://stackoverflow.com/questions/234231/creating-application-shortcut-in-一个目录 [^ ].

如果您要这样做,我基本上会同意您不使用WSH的想法-我的意思是出于这个目的.

—SA
I''m not 100% sure what do you call a "shortcut" here, but, without WSH, it seems to be that what you want is using ShellLink object. If so, you can use the .NET wrapper for it. Please see:
http://www.vbaccelerator.com/home/NET/Code/Libraries/Shell_Projects/Creating_and_Modifying_Shortcuts/article.asp[^].

See also the first answer to this question:
http://stackoverflow.com/questions/234231/creating-application-shortcut-in-a-directory[^].

If this is what you want, I would basically agree with your idea of not using WSH — I mean, for this very purpose.

—SA


这篇关于如何在C#中使用WIN32API创建快捷方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆