在网上找了些例子,但都是用VB运行库来建立的,声明为
Declare Function fCreateShellLink Lib "VB5STKIT.DLL" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long
Declare Function fCreateShellLink Lib "VB6STKIT.DLL" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long
之类的,一运行总是说找不到运行库。有没有更好用的方法啊?另外,我可不可以为这个快捷方式指定一个特定的图标呢? 作者:
Nothing 时间: 2005-7-19 23:49
引用:Windows Script Host ...
'创建快捷方式
Public Sub CreateShortCutOnDeskTop(ByVal Name As String, ByVal Description As String, TargetPath As String, WorkingDirectory As String)
Dim X As New IWshRuntimeLibrary.IWshShell_Class
Dim Y As IWshRuntimeLibrary.IWshShortcut_Class
'Attribute VB_Name = "ShortCut"
Set Y = X.CreateShortcut(X.SpecialFolders.item("AllUsersDesktop") & "" & Name & ".lnk")
Y.TargetPath = TargetPath
Y.Description = Description
Y.WorkingDirectory = WorkingDirectory
Y.Save
End Sub
Declare Function fCreateShellLink Lib "VB5STKIT.DLL" (ByVal lpstrFolderName As String, & _
ByVal lpstrLinkName As String, & _
ByVal lpstrLinkPath As String, & _
ByVal lpstrLinkArgs As String) As Long
//比如这个fCreateShellLink不是VB6的API啊,你用AIP浏览器查下就知道了
---------------------------------------------------------------