none
How do I create a full-screen console program in VC++ under windows 7?

    Question

  • So as I understand it the complete removal of DOS under windows 7/Vista (an emulator existed under XP, right?) means that we can no longer run native console programs in full screen. So my question is, what is the simplest way of creating a full-screen console-like application? Do I have to do use forms?

    My program is a simulation which really just outputs text to the screen, and it would be nice if it could be displayed in full screen, rather than in a window...

    Sunday, January 15, 2012 9:15 AM

Answers

  • AFAIK, console programs cannot be fullscreen.  If you want fullscreen, go with a Windows application.
    Jose R. MCP
    • Proposed as answer by Helen Zhao Tuesday, January 17, 2012 4:45 AM
    • Unproposed as answer by Helen Zhao Tuesday, January 17, 2012 4:59 AM
    • Marked as answer by Helen Zhao Monday, January 23, 2012 2:33 AM
    Monday, January 16, 2012 2:36 PM
  • During the Windows XP/Vista transition, the ability to fullscreen a console window was removed completely. So an application which uses the console subsystem on Vista/7 will not be able to go into fullscreen mode. If you can get a console subsystem application to go into fullscreen mode, then you are not running Vista/7 (the OP wanted a way to do it under these operating systems).

    If you want to do this, you will have to emulate everything yourself in a GUI application. I think forms would be just as difficult as native in this case since you would have to write everything yourself, so you will be stuck writing a mini console for yourself regardless of what route you take.

    Oh and a final note, there was never any "DOS" under Windows XP. Cmd.exe has always been an emulator in the Windows NT line of operating systems. I'm pretty sure the removal of the fullscreen console mode was due to the change from XDM to WDDM. But I could be misremebering that.


    This is a signature

    Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.
    Visit my (not very good) blog at
    http://ccprogramming.wordpress.com/
    • Marked as answer by Helen Zhao Monday, January 23, 2012 2:33 AM
    Thursday, January 19, 2012 10:35 AM

All replies

  • AFAIK, console programs cannot be fullscreen.  If you want fullscreen, go with a Windows application.
    Jose R. MCP
    • Proposed as answer by Helen Zhao Tuesday, January 17, 2012 4:45 AM
    • Unproposed as answer by Helen Zhao Tuesday, January 17, 2012 4:59 AM
    • Marked as answer by Helen Zhao Monday, January 23, 2012 2:33 AM
    Monday, January 16, 2012 2:36 PM
  • Hi arman_sch,
     
    I have been watching and researching on the issue for a while now. I found we are not able to make console window full-screen in win7/Vista. while in other windows OS, I think you can try the following ways to have the console window full-screen:
     
    1->Make the console window be full-screen, and then you will see it full-screen next time when you run the application. Right-click the top of the console window, and choose "Properties". Then you will see a windows disappear. Choose Font tab, and choose "Size" according to the "Window Preview" to make sure the console window will be full-screen. Finally click "OK" to save the change. You will see a full-screen console window when you run the application next time.
     
    2->Have a try on pressing Alt+Enter. This combination will toggle between full-screen and a window.
     
    3->Make use of Windows API SetConsoleDispalyMode function. This function can set the display mode of the specified console screen buffer. You should choose CONSOLE_FULLSCREEN_MODE for the second parameter in this situation.
     
    I hope this reply is helpful to you. If you have any other questions, please feel free to let me know.
    Best regards,

    Helen Zhao [MSFT]
    MSDN Community Support | Feedback to us

    • Proposed as answer by Pintu Shukla Wednesday, January 18, 2012 9:44 PM
    • Edited by Helen Zhao Monday, January 23, 2012 2:32 AM
    Tuesday, January 17, 2012 5:14 AM
  • Hi Helen,
     
    None of these suggestions worked for me.  I clicked the Maximize button in the upper right corner of the console frame but all it did was increase the height of the console window to be the entire screen’s working area; the width was unaffected.  Alt+Enter had no effect.  I didn’t try SetConsoleDisplayMode.
     
    Thanks,
    David
     
     

    Efficiently read and post to forums with newsreaders: http://communitybridge.codeplex.com
    Tuesday, January 17, 2012 7:16 PM
  • You also can try GetConsoleWindow() Function with ShowWindow().

    Thanks


    Rupesh Shukla
    Wednesday, January 18, 2012 9:46 PM
  • Right-click the top of the console window, and choose "Properties". Then you will see a windows disappear. Choose Font tab, and choose "Size" according to the "Window Preview" to make sure the console window will be full-screen. Finally click "OK" to save the change.  


    David, we should get the console window full screel in the way described in Quoted area.

    And Alt+Enter works for me when exchange between full-screen and normal-size.


    Please mark this reply as answer if it helps you! Thanks for your cooperation! Good Luck to you.
    Thursday, January 19, 2012 8:22 AM
  • During the Windows XP/Vista transition, the ability to fullscreen a console window was removed completely. So an application which uses the console subsystem on Vista/7 will not be able to go into fullscreen mode. If you can get a console subsystem application to go into fullscreen mode, then you are not running Vista/7 (the OP wanted a way to do it under these operating systems).

    If you want to do this, you will have to emulate everything yourself in a GUI application. I think forms would be just as difficult as native in this case since you would have to write everything yourself, so you will be stuck writing a mini console for yourself regardless of what route you take.

    Oh and a final note, there was never any "DOS" under Windows XP. Cmd.exe has always been an emulator in the Windows NT line of operating systems. I'm pretty sure the removal of the fullscreen console mode was due to the change from XDM to WDDM. But I could be misremebering that.


    This is a signature

    Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.
    Visit my (not very good) blog at
    http://ccprogramming.wordpress.com/
    • Marked as answer by Helen Zhao Monday, January 23, 2012 2:33 AM
    Thursday, January 19, 2012 10:35 AM
  • @Rebecca:  On Win 7, instead of the Font tab, you need to choose the Layout Tab.  Alter the Window Size and Window Position (must uncheck “Let system position window” first) to fill the screen in Window Preview.  By initially selecting the “Properties” menu item, this changes the size of the current window.  But if you instead select the “Defaults” menu item, this changes the default of all new cmd windows.
     
    On Win 7, Alt+Enter simply does nothing.
     
    Thanks,
    David

    Efficiently read and post to forums with newsreaders: http://communitybridge.codeplex.com
    Thursday, January 19, 2012 8:27 PM
  • Spend some time to learn OpenGL or SDL enough so that you can render text with the graphics card directly. There are plenty of game-oriented tutorials on this. It will be difficult, but fun and worth your while. Then just use this program to display your console input and output. If you can generalize this to emulate all cmd.exe functionality and open-source it. People will love you. Microsoft not including this functionality in the console subsystem is as dumb as Apple not including Aero Snap like functionality in Mac OS X. You might want to consider switching to Linux if you are doing console heavy work anyway, you can still use C# or VB.NET with mono if that's the concern.
    Tuesday, March 26, 2013 2:40 PM