954,483 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to make console programs full screen?

err....... is there any command line in Dos to make it full screen, so that i can put it into a system(" ") line in my c++ console program? Thanks in advance.

j1979c
Light Poster
42 posts since Sep 2005
Reputation Points: 13
Solved Threads: 1
 

No, you have to simulate a few keystrokes with the Windows API function keybd_event. IIRC:

keybd_event ( VK_MENU, 0, 0, 0 ); 
keybd_event ( VK_RETURN, 0, 0, 0 ); 
keybd_event ( VK_RETURN, 0, KEYEVE­NTF_KEYUP, 0 ); 
keybd_event ( VK_MENU, 0, KEYEVENT­F_KEYUP, 0 );
Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

This works with Dev-C++ but not with VC++ 6.0 (I think it is a compiler bug)

HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd,SW_SHOWMAXIMIZED);
Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

Dev-C++ has a built in function in project options i believe

Electrohead
Junior Poster
150 posts since May 2005
Reputation Points: 10
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You