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 a As String
a = Space(255) '此句相当于空隔
GetWindowText hwnd, a, 255 'hwnd为窗体句柄
Text1 = a
End Sub