他要的是ShellExecuteEX,不是ShellExecute,呵呵
'Example Name:Implementing the API File Property Page
'------------------------------------------------------------------------------
'
' Form Code
'
'------------------------------------------------------------------------------
Option Explicit
Private Type SHELLEXECUTEINFO
cbSize As Long
fMask As Long
hwnd As Long
lpVerb As String
lpFile As String
lpParameters As String
lpDirectory As String
nShow As Long
hInstApp As Long
lpIDList As Long 'Optional
lpClass As String 'Optional
hkeyClass As Long 'Optional
dwHotKey As Long 'Optional
hIcon As Long 'Optional
hProcess As Long 'Optional
End Type
一个发邮件的例子:
模块中内容
Public 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
Public Const SW_SHOW = 5
窗体中内容
Private Sub Label3_Click()
Dim HyperJump
Dim w
w = Label3.Caption
HyperJump = ShellExecute(0&, vbNullString, w, vbNullString, vbNullString, vbNormalFocus)
End Sub
Private Sub Command1_Click()
k = "mailto:" + Text1.Text
ShellExecute hwnd, "open", k, vbNullString, vbNullString, SW_SHOW
End Sub
【VB声明】
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