Thread: how can i make the console window go maximised?

  1. #1
    بابلی ریکا Masterx's Avatar
    Join Date
    Nov 2007
    Location
    Somewhere nearby,Who Cares?
    Posts
    497

    how can i make the console window go maximised?

    hello all, im seeking a way to make a console pane maximized when the user runs the application for the first time , ( by saying maximized i mean , pressing Alt+Enter ), so
    is there any way ? or bit of codes to do that ?
    tanx in advance
    Highlight Your Codes
    The Boost C++ Libraries (online Reference)

    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.."
    Bill Bryson


  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    I seem to recall some threads about this. For example:

    Just search for "full screen console" or "maximize dos window" or similar terms, you'll come up with something.

    As far as I remember, the options go like this:
    1. Don't do it. Seriously. If the user wants to maximize the window, they'll do it themselves.
    2. Trick the window into always going fullscreen. (For example, create a shortcut to your application, and change the settings so that it's in fullscreen by default.)
    3. Simulate ALT-ENTER to toggle fullscreen. (Hooray if it was already in fullscreen.)
    4. Maybe there's some Windows function to do it, I don't know.


    [edit] Just be warned that this is highly platform-specific. Just about any solution you use will require Windows (and possibly a specific version of Windows) to run properly. [/edit]
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    بابلی ریکا Masterx's Avatar
    Join Date
    Nov 2007
    Location
    Somewhere nearby,Who Cares?
    Posts
    497
    tanx , great stuff, got it .and ok i'll keep that it mind
    Highlight Your Codes
    The Boost C++ Libraries (online Reference)

    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.."
    Bill Bryson


  4. #4
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by dwks View Post
    [*]Trick the window into always going fullscreen. (For example, create a shortcut to your application, and change the settings so that it's in fullscreen by default.)
    I'd go with this option. At least then the user can alter the shortcut to not do it, if they want.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  5. #5
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Yeah, that's what I'd do too. Assuming I didn't go for option #1 for some reason.

    Just to clear something up:
    3. Simulate ALT-ENTER to toggle fullscreen. (Hooray if it was already in fullscreen.)
    What I mean by "Hooray" is that it will switch out of fullscreen and into windowed mode again.

    Oh, and also see Masterx's post at the end of this thread. C++ Full Screen
    I think s/he's found a solution. (An unportable one, but hey. It's inherently unportable.)
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  6. #6
    بابلی ریکا Masterx's Avatar
    Join Date
    Nov 2007
    Location
    Somewhere nearby,Who Cares?
    Posts
    497
    Quote Originally Posted by dwks View Post
    Yeah, that's what I'd do too. Assuming I didn't go for option #1 for some reason.

    Just to clear something up:

    What I mean by "Hooray" is that it will switch out of fullscreen and into windowed mode again.

    Oh, and also see Masterx's post at the end of this thread. C++ Full Screen
    I think s/he's found a solution. (An unportable one, but hey. It's inherently unportable.)
    yes , thats windows specific , i found it somewhere on the internet, and it is said that it is of the windows undocumented api! or stuff!
    Last edited by Masterx; 06-12-2009 at 06:07 PM.
    Highlight Your Codes
    The Boost C++ Libraries (online Reference)

    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.."
    Bill Bryson


  7. #7
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Here's a little more "robust" version - and a proper "send keys" version for 9x (if you care about that platform).
    fullscreening the dos window

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C or C++
    By AcerN30 in forum Game Programming
    Replies: 41
    Last Post: 05-30-2008, 06:57 PM
  2. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  3. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  4. dont want to use all params
    By stallion in forum Windows Programming
    Replies: 2
    Last Post: 02-18-2003, 08:10 AM
  5. how to make 2 text window
    By bluexrogue in forum C Programming
    Replies: 2
    Last Post: 09-15-2001, 08:51 PM