如何得到光标的屏幕坐标?我想得到的是输入文本时那个一闪一闪的光标的屏幕坐标.

解决方案 »

  1.   

    BOOL GetCursorPos(
      LPPOINT lpPoint   // cursor position
    );
      

  2.   

    GetCursorPos
    The GetCursorPos function retrieves the cursor's position, in screen coordinates. BOOL GetCursorPos(
      LPPOINT lpPoint   // cursor position
    );
    Parameters
    lpPoint 
    [out] Pointer to a POINT structure that receives the screen coordinates of the cursor. 
    Return Values
    If the function succeeds, the return value is nonzero.If the function fails, the return value is zero. To get extended error information, call GetLastError.Res
    The cursor position is always specified in screen coordinates and is not affected by the mapping mode of the window that contains the cursor. The calling process must have WINSTA_READATTRIBUTES access to the window station
      

  3.   

    GetCaretPos(LPPOINT lpPoint ); 得到输入焦点的客户区坐标.
    LPtoDP(HDC hdc,      // handle to device context
      LPPOINT lpPoints,  // array of points
      int nCount         // count of points in array
    );
    转换成屏幕坐标.
    可能是这样吧.