Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
运行环境,VB.NET 2005
Private Sub Command1_Click()
Dim Tlong as long,s as String
Tlong=GetWindowTextLength(hwnd)+1
s=String$(Tlong,chr(0)) '必须要的
GetWindowText hwnd,s,Tlong
Msgbox s
End Sub
hwnd是你获得的窗体句柄,s就是你要的窗体标题了
主帖获得的天涯分:0
楼主发言:1次 发图:0张 | 添加到话题 |