Thread: changing the size of the command prompt in c++

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    2

    changing the size of the command prompt in c++

    Is there a function in c++ that lets you change or increase the size of the window when a program is running (like in windows 95 where there's no way to scroll down if the output goes over 20 lines)?

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Code:
    mode
    I think you can use
    Code:
    mode /rows=50 /cols=90
    but I can't remember. Use mode /? to see all the possible arguments.

    (like in windows 95 where there's no way to scroll down if the output goes over 20 lines)
    Actually, it's 25.
    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
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377
    No there isn't. mode isn't a C\C++ command, it's a DOS command. Anyway you could use a C command System(char *string); to issue a DOS command which would change the size of a console window, without the user interference.
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

  4. #4
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    or you could use some of the win32 api console functions, such as GetConsoleWindow() to get the handle to the window, then change its size as a normal window. you have to include windows.h.

  5. #5
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Fixing my program
    By Mcwaffle in forum C Programming
    Replies: 5
    Last Post: 11-05-2008, 03:55 AM
  2. Changing font size of CStatic
    By earth_angel in forum Windows Programming
    Replies: 2
    Last Post: 08-12-2005, 10:51 AM
  3. An exercise in optimization
    By Prelude in forum Contests Board
    Replies: 10
    Last Post: 04-29-2005, 03:06 PM
  4. changing font size
    By rajesh23 in forum Linux Programming
    Replies: 2
    Last Post: 03-03-2005, 04:51 PM
  5. Changing text size in a program
    By RedTroja in forum C++ Programming
    Replies: 3
    Last Post: 10-12-2003, 03:53 AM