waynejfoster
Programmer
I've got a console window open in windows xp. I can set the cursor x y position, but I can't read the current x y position. How do I read the cursor x,y pos.
Here is the code to set the cursor x,y pos.
The only function I have seen is GetConsoleCursorInfo but this just returns the size,visibility.
/
// Moves the cursor to x, y in console window
// ie x=left\right y=top\bottom
//
void set_cursor_xy(int x, int y)
{
COORD point;
if((x < 0 || x > screensize.x) || (y < 0 || y > screensize.y))
return;
point.X = x; point.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), point);
}
Here is the code to set the cursor x,y pos.
The only function I have seen is GetConsoleCursorInfo but this just returns the size,visibility.
/
// Moves the cursor to x, y in console window
// ie x=left\right y=top\bottom
//
void set_cursor_xy(int x, int y)
{
COORD point;
if((x < 0 || x > screensize.x) || (y < 0 || y > screensize.y))
return;
point.X = x; point.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), point);
}