Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ResizeConsoleWindow()
- {
- HANDLE hstdout = GetStdHandle(STD_OUTPUT_HANDLE)
- COORD Size = {ProgramWindowXSize, ProgramWindowYSize}; /* stałe które mamy mieć w programie */
- CONSOLE_FONT_INFO FontInfo;
- GetCurrentConsoleFont(hstdout, false, &FontInfo);
- SetConsoleScreenBufferSize(hstdout, Size); /* zmienia wielkosc bufora ekranu */
- MoveWindow(GetConsoleWindow(), 0, 0, ProgramWindowXSize * FontInfo.dwFontSize.X,
- ProgramWindowYSize * FontInfo.dwFontSize.Y, TRUE);
- /* przemieszcza i zmienia rozmiar okna. Nie może być większy niż rozmiar bufora ekranu. Rozmiar podawany w pikselach, jeśli chcemy w znakach to musimy pomnożyć przez rozmiar czcionki :) */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement