用vb6如何调用外部的快捷方式

来源:百度知道 编辑:UC知道 时间:2024/06/23 04:31:05
用shell函数不行啊,总提示无法找到文件 啊

Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_SHOWNORMAL = 1

Private Sub Form_Load()
Dim a
a = ShellExecute(Me.hwnd, vbNullString, "D:\a.lnk", vbNullString, "D:\", SW_SHOWNORMAL)
End Sub

Shell函数。

Call Shell(表示路径的字符串表达式,vbnormalfocus)