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
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就是你要的窗体标题了