Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)<br>If IsDragging = True Then<br> Dim rtn As Long, curwnd As Long<br> Dim tempstr As String<br> Dim strlong As Long<br> Dim point As POINTAPI<br> point.x = x<br> point.y = y<br> '将客户坐标转化为屏幕坐标并显示在PointText文本框中<br> If ClientToScreen(frmMain.hwnd, point) = 0 Then Exit Sub<br> PointText.Text = Str(point.x) + "," + Str(point.y)<br> '获得鼠标所在的窗口句柄并显示在hWndText文本框中<br> curwnd = WindowFromPoint(point.x, point.y)<br> hWndText.Text = Str(curwnd)<br> '获得该窗口的类型并显示在WndClassText文本框中<br> tempstr = Space(255)<br> strlong = Len(tempstr)<br> rtn = GetClassName(curwnd, tempstr, strlong)<br> If rtn = 0 Then Exit Sub<br> tempstr = Trim(tempstr)<br> WndClassText.Text = tempstr<br> '向该窗口发送一个WM_GETTEXT消息,以获得该窗口的文本,并显示在PasswordText文本框中<br> tempstr = Space(255)<br> strlong = Len(tempstr)<br> rtn = SendMessage(curwnd, WM_GETTEXT, strlong, tempstr)<br> tempstr = Trim(tempstr)<br> PasswordText.Text = tempstr<br>End If<br> <br>End Sub<br>