声明 ShellExecute 函数;在 form 上建立 label、line 控件各一个(myHttp、Line1),再仿照以下代码,即可打开浏览器登录 http://www.why100000.com 网站。
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 myHttp_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Line1.Visible = False
End Sub
Private Sub myHttp_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Line1.Visible = True
End Sub
Private Sub Form_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Line1.Visible = False
End Sub
Private Sub myHttp_Click()
Dim HttpJump
Dim MyUrl As String
MyUrl = “http://www.why100000.com”
HttpJump = ShellExecute(0&, vbNullString, MyUrl, vbNullString, vbNullString, vbNormalFocus)
End Sub