#include <windows.h>
//编译环境:VC6.0
void hide_cursor()
{
CONSOLE_CURSOR_INFO cursor_info = {1, 0}; //0代表光标不可见
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);
}
void goto_xy(int x, int y)
{
HANDLE hout; //定义窗口句柄
COORD c; //定义坐标
c.X = x;
c.Y = y;
hout = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hout, c); //设置光标位置
}
时间: 2024-10-24 03:44:46