Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a C++ Console Program in full screen

Tags:

c++

visual-c++

How to run a C++ Console Program in full screen ? , using VS2008

like image 392
Sudantha Avatar asked Oct 29 '10 15:10

Sudantha


2 Answers

Just tested this with cl fullscreen.cpp :

#include <iostream>
#include <windows.h>

#pragma comment(lib, "user32")

int main()
{
    ::SendMessage(::GetConsoleWindow(), WM_SYSKEYDOWN, VK_RETURN, 0x20000000);

    std::cout << "Hello world from full screen app!" << std::endl; 
    std::cin.get();
}

Unfortunatelly it had duplicated the text on the second monitor :)

like image 176
Cristian Adam Avatar answered Oct 14 '22 22:10

Cristian Adam


try:

#include <iostream>

using namespace std;

int main(){
system("mode 650");

system("pause");
return 0;
}
like image 9
user3127325 Avatar answered Oct 14 '22 23:10

user3127325