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 Label1_Click(Index As Integer)
Select Case Index
Case 3
ret& = ShellExecute(PropertyPage.hwnd, "Open", "mailto:[email protected]", "", App.Path, 1)
Case 4
ret& = ShellExecute(PropertyPage.hwnd, "Open", "http://www.d1vb.com", "", App.Path, 1)
Case 5
ret& = ShellExecute(PropertyPage.hwnd, "Open", "http://dyqing.533.net", "", App.Path, 1)
Case 6
ret& = ShellExecute(PropertyPage.hwnd, "Open", "http://go8.163.com/dbcontrols", "", App.Path, 1)
End Select
End Sub
Private Sub Label1_Click(Index As Integer)
Select Case Index
Case 3
ret& = ShellExecute(PropertyPage.hwnd, "Open", "mailto:[email protected]", "", App.Path, 1)
Case 4
ret& = ShellExecute(PropertyPage.hwnd, "Open", "http://www.d1vb.com", "", App.Path, 1)
Case 5
ret& = ShellExecute(PropertyPage.hwnd, "Open", "http://dyqing.533.net", "", App.Path, 1)
Case 6
ret& = ShellExecute(PropertyPage.hwnd, "Open", "http://go8.163.com/dbcontrols", "", App.Path, 1)
End Select
End Sub
===================================================================
d = ShellExecute(Me.hwnd, "Open", "mailto:[email protected]", "", App.Path, 1)
你的方法有时候不能用,如:在控件的属性页里面,不信你试一试。
ShellExecute hwnd, "Open", "mailto:[email protected]", "", "", 5
ShellExecute hwnd, "Open", "http://nomey.myetang.com/", "", "", 5
通用方法。
Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: [email protected]
'Send an E-Mail to the KPD-Team
ShellExecute Me.hwnd, vbNullString, "mailto:[email protected]", vbNullString, "C:\", SW_SHOWNORMAL
End Sub
如果用你上面的方法是行不通的,我试过不下十几次了,它只是简简单单的打开了Foxmail4.0。有没有别的办法?
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 LongPrivate Sub Command1_Click()
ShellExecute Me.hwnd, "", "MAILTO:我的信箱", "", "", 3
End Sub