you can use this API to get cursor information.
This API Retrieves information about the global cursor.
BOOL WINAPI GetCursorInfo
(
_Inout_ PCURSORINFO pci
);
Parameters
pci [in, out]
Type: PCURSORINFO
A pointer to a CURSORINFO structure that receives the information. Note that you must set the cbSize member to sizeof(CURSORINFO) before calling this function.
Return value
Type: BOOL
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.
you can also use
GetCursorPos
consider the example below.
POINT cordinate;
GetCursorPos(&cordinate);
cout << "The mouse is at:" << cordinate.x << cordinate.y << endl;