先用 Findwindow 找到符合条件的窗口,再用 FindwindowEx 根据找到类名找到文本框的句柄。

解决方案 »

  1.   

    用pgfan的方法获得句柄,然后用SendMessage(句柄,WM_GETTEXT,缓冲大小,缓冲区名称)就可以了
      

  2.   

    还可以用GetCursorPos()获得鼠标的坐标,然后用WindowFromPoint()获得此坐标下的文本框的句柄.
      

  3.   

        Dim Pt As POINTAPI, mWnd As Long
        'Get the current cursor position
        GetCursorPos Pt
        'Get the window under the cursor
        mWnd = WindowFromPoint(Pt.X, Pt.Y)