To get the cursor position you need a system call, or a library that does.
For Windows you can use the WINAPI Systemcall GetCursorPos().
You can get position of cursor like that:
POINT cursorpPos
GetCursorPos(&cursorPos);
int x = (int) cursorPos.x;
int y = (int) cursorPos.y;