呼叫内定的Brower以Open URL



利用ShellExecute()来做到内定Brower/Mail 的呼叫,而ShellExecute的用法请查
如何直接开启一个文件

'需2个 Label
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
Const SW_SHOW = 5
Const SW_SHOWMAXIMIZED = 3
Const SW_SHOWNOACTIVATE = 4

Private Sub Form_Load()
Label1.Caption = "VB心得笔记"
Label1.ForeColor = vbRed
Label2.Caption = "与我联络"
Label2.ForeColor = vbRed
End Sub
Private Sub Label1_Click()
  Call ShellExecute(Me.hWnd, "open", "http://sunh.hosp.ncku.edu.tw/~cww/", "", "", SW_SHOWMAXIMIZED)
End Sub

Private Sub Label2_Click()
  Call ShellExecute(Me.hWnd, "open", "mailto:cww5@mail.ncku.edu.tw", "", "", SW_SHOW)
End Sub

'但有一个更快的方式,便是使用Shell指令来呼叫 start.exe
'eg. Shell "Start mailto:cww5@mail.ncku.edu.tw"
'eg. Shell "Start http://http://sunh.hosp.ncku.edu.tw/~cww"