Thx for you help!
The script is working now:
Code:
#include <iostream>
#include <windows.h>

using namespace std;

int main()
{
    POINT point;
    int x;
    int y;

    while(true) {
        if(!GetCursorPos(&point))
        {
            cout << "An error occurred: " << endl;
            cout << GetLastError();
        }
        else
        {
           x = point.x;
           y = point.y;
           cout << x << endl;
           cout << y << endl;
        }
        Sleep(100);
        system("cls");
    }
    return 0;
}