绍兴上虞房价是多少:Visual Basic 6.0 怎样做超连结

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/03 06:14:05
例如我想连结至 http://www.baidu.com/ 应怎样编 ?

给你个API函数和自定义的超链接的函数

API函数声明:

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

自定义函数
'############################
'# 网络链接 #
'#--------------------------#
'# 调用API: #
'# GetDesktopWindow #
'# ShellExecute #
'############################
Public Function StartURL(URL As String) As Long '网络链接
Dim Scr_hDC As Long
Scr_hDC = GetDesktopWindow()
StartURL = ShellExecute(Scr_hDC, "Open", URL, vbNullString, "C:\", 1)
End Function