cYUYAN WINDOWS的相关
在VC下用gotoxy(x,y)输出光标,如何获取当前的坐标来充当(x,y)
/**
* 功能: 获取控制台当前光标位置
* 参数: x 坐标指针, y 坐标指标
* 返回值: int值,出错代码可用GetLastError()获取
*/
int console_get_xy(int *x, int *y)
{
CONSOLE_SCREEN_BUFFER_INFO csbInfo;
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
int result = GetConsoleScreenBufferInfo(handle, &csbInfo);
assert( handle != INVALID_HANDLE_VALUE );
*x = csbInfo.dwCursorPosition.X;
*y = csbInfo.dwCursorPosition.Y;
return result;
}