你这样写是不对的
"aa$" 这是一个字符串
你应该写成
Private Sub Form_Load()
dim aa as string
Text1.Text = ""
aa = Text1.Text
hwd = FindWindow(vbNullString, aa): Dim XX As Long '这里要改
XX = SetWindowPos(Me.Hwnd, Hwndx, 0, 0, 0, 0, 3)
End Sub
Private Sub Form_Load()
dim aa as string
'Text1.Text = "" 把这句删掉!!
aa = Text1.Text
hwd = FindWindow(vbNullString, aa):Dim XX As Long '这里要改
XX = SetWindowPos(Me.Hwnd, hwd, 0, 0, 0, 0, 3) '检查句柄参数名称!!
End Sub
aa$ = trim(Text1.Text)试试