已知Static控件的句柄 如何得到它的超级链接地址

来源:百度知道 编辑:UC知道 时间:2024/05/30 11:12:39
点击Static控件就会进入网站 如"http://www.baidu.com"
如何得到它其中的url地址 "http://www.baidu.com"

Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long

Function GetWndText(hWnd As Long) As String
Dim l As Long
l = GetWindowTextLength(hWnd)
If l = 0 Then Exit Function
GetWndText = String(l, 0)
GetWindowText hWnd, GetWndText, l + 1
End Function