GetCursorPos

 

Description

To retrieve the cursor's position, in screen coordinates. The cursor position is always specified in screen coordinates and is not affected by the mapping mode of the window that contains the cursor.

Syntax

BOOL GetCursorPos( POINT * lpPoint )

Parameters

lpPoint
[output] Pointer to a POINT structure that receives the screen coordinates of the cursor.

Return

If the function succeeds, the return value is TRUE.

Examples

EX1

void GetCursorPos_ex1()
{
        POINT pt;
        bool bRet = GetCursorPos(&pt);
        printf("Current cursor position (%d, %d)\n", pt.x, pt.y);
}

Remark

See Also

header to Include

origin.h

Reference