콘솔 텍스트 출력하기

-콘솔의 원하는 위치에 텍스트를 출력합니다. ex:) printText(“Hello World!!”,3,DEFAULT,RIGHT); //오른쪽 정렬로 우측 3칸을 비우고 현재 라인에 문자열 출력 #include #include //텍스트 출력 정렬 #define LEFT -1 #define CENTER 0 #define RIGHT 1 //기본 좌표 #define DEFAULT -1 void printText(char* buffer,int x,int y,int align){         COORD cr;         CONSOLE_SCREEN_BUFFER_INFO info;         int width; //콘솔 너비         int height; //콘솔 높이 … 더 읽기

콘솔 창 숨기기

-현재 실행중인 콘솔 창을 보이지 않게 숨긴다. #include #define BUFSIZE 512 int main(){         HWND hwnd;         char title[BUFSIZE]=”My Title”;         SetConsoleTitle(title); //타이틀 설정         hwnd=FindWindow(NULL,title); //타이틀에 해당하는 윈도우 핸들 얻기         ShowWindow(hwnd,SW_HIDE); //숨김 옵션 설정           return 0; }
바로가기