AutoCAD 3DMAX C语言 Pro/E UG JAVA编程 PHP编程 Maya动画 Matlab应用 Android
Photoshop Word Excel flash VB编程 VC编程 Coreldraw SolidWorks A Designer Unity3D
 首页 > VB编程

如何用VB建立快捷方式

51自学网 http://www.wanshiok.com
下面的代码向你演示在VB中如何创建一个快捷方式。

Private Declare Function fCreateShellLink Lib "STKIT432.DLL" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long
Sub Command1_Click()

Dim lReturn As Long

'添加到桌面
lReturn = fCreateShellLink("../../Desktop", "Shortcut to Calculator", "c:/windows/calc.exe", "")
'添加到程序组
lReturn = fCreateShellLink("", "Shortcut to Calculator", "c:/windows/calc.exe", "")
'添加到启动组
lReturn = fCreateShellLink("/Startup", "Shortcut to Calculator", "c:/windows/calc.exe", "")

End Sub

 

 

 
上一篇:用VB制作TopMost类型窗口  下一篇:在系统菜单上添加自定义菜单项