Console

This is a discussion on Console within the C Programming forums, part of the General Programming Boards category; I've a question how can you change dte size of a console window the standart has 80width and 25 height ...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    24

    Question Console

    I've a question how can you change dte size of a console window the standart has 80width and 25 height how can I changed it that it is 80width and 50 height

    thank you for your help

  2. #2
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    That's operating system specific. If you are using windows, you can do this with the SetConsoleScreenBufferSize functions in wincon.h (#include<windows.h>). It's parameters are a console screen buffer handle and the dimensions of the new buffer ( a COORD with the X components being the width and the Y component being the height ). You can get the current console screen buffer handle by calling GetStdHandle with the parameter STD_OUTPUT_HANDLE

    The default font is terminal which is a raster font at 8 pixels wide by 12 pixels tall, so rather than jumping to 80x50, i suggest you either go to 80x40 (which would be 640x480 resolution) or 100x50 (which is 800x600 resolution).

    Quick example:

    COORD BufferSize = { 100, 50 };

    SetConsoleScreenBufferSize( GetStdHandle( STD_OUTPUT_HANDLE ), BufferSize );

    voila (remember to include windows.h)

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    24
    Thanks a lot it is working, and now a another question how can i set up it that when the program starts it automatickly change in the full size window

    3 in the button and the one in the middle

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Originally posted by PawelK
    Thanks a lot it is working, and now a another question how can i set up it that when the program starts it automatickly change in the full size window

    3 in the button and the one in the middle
    You mean the max size capable of the user's desktop?
    There's a command to recall that information, Cant remember
    it though Try searching MSDN for it.

  5. #5
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Console, Terminal and Terminal Emulator
    By lehe in forum C Programming
    Replies: 4
    Last Post: 02-15-2009, 08:59 PM
  2. Full Screen Console
    By St0rmTroop3er in forum C++ Programming
    Replies: 1
    Last Post: 09-26-2005, 09:59 PM
  3. Problems with a simple console game
    By DZeek in forum C++ Programming
    Replies: 9
    Last Post: 03-06-2005, 01:02 PM
  4. Console Functions Help
    By Artist_of_dream in forum C++ Programming
    Replies: 9
    Last Post: 12-04-2004, 02:44 AM
  5. Just one Question?
    By Irish-Slasher in forum C++ Programming
    Replies: 6
    Last Post: 02-12-2002, 09:19 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21