去看看 drag 的方法. 及 相关 属性. 你就会明白了.

解决方案 »

  1.   

    '下面能获取本线程文本框中的文本及系统窗口的标题。
    '若要取得其它程序中的文本框文本,必须在取得hwnd后向它发送更消息并用系统级钩子进行拦截得到。
    'formPrivate Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
    Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
    Private Type POINTAPI
    X As Long
    Y As Long
    End Type
    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 GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As LongDim DXD As POINTAPI
    Dim PHWND As Long
    Dim TXT As String
    Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Image1.MousePointer = 99
    Image1.Visible = False
    Image1.MouseIcon = Image1.Picture
    End SubPrivate Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    GetCursorPos DXD
    PHWND = WindowFromPoint(DXD.X, DXD.Y)
    End SubPrivate Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Image1.MousePointer = 0
    Image1.Visible = True
    TXT = String(GetWindowTextLength(PHWND) + 1, Chr(0))
     GetWindowText PHWND, TXT, GetWindowTextLength(PHWND) + 1
    Text1.Text = TXTEnd Sub
      

  2.   

    我太蠢了,能不能给出写文字到mouseup中的文本框中的代码