Full Screen from console (Windows)
Apr 18, 2012 at 5:59pm UTC
Hi there,
I was wondering if there is a function to make the console full screen from the code, instead of setting it manually (alt+enter or going into the defaults menu)
Ben
Apr 18, 2012 at 6:01pm UTC
There may be a way to force it with Win32, but why would you want to do that?
Apr 18, 2012 at 7:33pm UTC
Here's how I do it, beenjaminnn..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
// Moving window.cpp : main project file.
//
#include "stdafx.h" // Used with MS Visual Express. Delete if using different compiler
#include <conio.h>
#include <iostream>
#include <string>
#include <windows.h>
using namespace std;
using namespace System;
void WaitKey();
int main()
{
int t,x;
const int width = 122, height = 60;
Console::SetWindowSize(width, height ); // Adjust values of width and height, to desired dimensions needed
cout << endl << endl << endl << "Console window, re-sizing!!" ;
int new_width=width;
for (x = height;x>height-33;x--)
{
Console::SetWindowSize(new_width, x );
new_width--;
Sleep(100);
}
WaitKey();
return 0;
}
void WaitKey()
{
cout << "\t\t\t Press ENTER to continue..." ;
while (_kbhit()) _getch(); // Empty the input buffer
_getch(); // Wait for a key
while (_kbhit()) _getch(); // Empty the input buffer (some keys sends two messages)
}
Last edited on Apr 18, 2012 at 7:35pm UTC
Topic archived. No new replies allowed.