Witam, poniżej przedstawiam fragment kodu, który mi nie działa. Na sztywno ustawiłem pozycję kursora na (0,0) a i tak zmienne x i y przyjmują różne wartości większe od 100, np x=539, y=189.
//...
gotoxy(0, 0);
POINT cursorPos;
GetCursorPos(&cursorPos);
int x = cursorPos.x;
int y = cursorPos.y;
cout << x << " " << y << endl;
//...
void gotoxy(const int x, const int y)
{
HANDLE hstdout = GetStdHandle(STD_OUTPUT_HANDLE);
COORD coord = { x, y };
SetConsoleCursorPosition(hstdout, coord);
}
Próbowałem także z GetPhysicalCursorPos ale też nie działa. Chyba, że jest jakiś inny sposób aby pobrać pozycję kursora z konsoli?