sendmessage(hwnd,wm_settext,0,int(yourstring))

解决方案 »

  1.   

    to outer2000(天外流星) :
    我试过了,不行
      

  2.   

    Sendmessage 和 WM_CHAR等在VB下都是要声明的,有C++下不用
      

  3.   

    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 SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As LongPrivate Sub AddText(dim mhWnd as long)
        Dim MyStr As String
        MyStr = String(100, Chr$(0))
        GetWindowText mhwnd, MyStr, 100
        MyStr = Left$(MyStr, InStr(MyStr, Chr$(0)) - 1)
        MyStr = MyStr + MyStr + MyStr
        SetWindowText mhWnd, MyStr
    End Sub