在XP下怎么用VB运行快捷方式呀,我今天发现在XP下运行快捷方式时会先跳出一个窗口然后才运行程序身呀 

解决方案 »

  1.   

    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 Sub Form_Load()
        ShellExecute Me.hwnd, "open", "c:\qq.lnk", vbNullString, vbNullString, vbNormalFocus
    End Sub
      

  2.   

    不会吧 ??  我这怎么不可以
    winxp sp1
      

  3.   

    来个简单点的~
    winxp sp1 +vb6sp6通过测试
    Option ExplicitPrivate Sub Command1_Click()
        Shell GetTargetPath("C:\Documents and Settings\bafony\桌面\RealOne.lnk")
    End SubFunction GetTargetPath(ByVal FileName As String)Dim Obj As Object
    Set Obj = CreateObject("WScript.Shell")Dim Shortcut As Object
    Set Shortcut = Obj.CreateShortcut(FileName)
    GetTargetPath = Shortcut.TargetPath
    Shortcut.SaveEnd Function