Thread: Console size

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

    Console size

    I'm working on a program and I want to display more lines than what the console seems to support... I believe it has 20 lines, and I need 38 or so, as seen in
    http://www.winntmag.com/Files/301/Screen_01.gif

    I don't want it to scroll offscreen.

    Is there any way to do this?

    Also, how do I get rid of the flashing underscore (cursor)?
    Last edited by Trauts; 10-03-2002 at 09:36 PM.

  2. #2
    Banal internet user
    Join Date
    Aug 2002
    Posts
    1,380
    Code:
    COORD ScreenSize = {80,50};
    SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE),ScreenSize);
    Will change the console (assuming your in Win32) size to 50 rows (rather than 25)

    And...
    Code:
    void HideCursor()
    {
    	CONSOLE_CURSOR_INFO lpCursor;	
    	lpCursor.bVisible = 0;
    	lpCursor.dwSize = 20;
    	SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&lpCursor);
    }
    Will hide the cursor (blinking underscore)

    Don't forget to #include <windows.h> !
    Last edited by BMJ; 10-03-2002 at 09:46 PM.

  3. #3
    Banal internet user
    Join Date
    Aug 2002
    Posts
    1,380
    Oh!

    And this will disable mouse input, thereby removing the mouse cursor in the console...
    Code:
    SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), ENABLE_LINE_INPUT);
    This requires windows.h too.

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    417

    THANK YOU!!!

    Thank you so much!

  5. #5
    Banal internet user
    Join Date
    Aug 2002
    Posts
    1,380
    It worked, right?

  6. #6
    . Driveway's Avatar
    Join Date
    May 2002
    Posts
    469
    No, it didn't, that's why he's thanking you

  7. #7
    Banal internet user
    Join Date
    Aug 2002
    Posts
    1,380
    IT DIDN'T!?!?

    *tosses banana into the air*

  8. #8
    Registered User
    Join Date
    Sep 2002
    Posts
    417
    It worked perfect. I'll show you what I was working on when I finish the Windows 98 version... The XP/2000 version is ready.

  9. #9
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    post the xp version

  10. #10
    Registered User
    Join Date
    Sep 2002
    Posts
    417
    Its really not that great... all it does is display the BSOD and password protect your computer. I don't know how to disable the alt-enter, though. I'll try disabling enter.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 09:42 PM
  2. Error with a vector
    By Tropicalia in forum C++ Programming
    Replies: 20
    Last Post: 09-28-2006, 07:45 PM
  3. Problems with a simple console game
    By DZeek in forum C++ Programming
    Replies: 9
    Last Post: 03-06-2005, 02:02 PM
  4. char problem
    By eXistenZ in forum Windows Programming
    Replies: 36
    Last Post: 02-21-2005, 06:32 AM
  5. Replies: 11
    Last Post: 03-25-2003, 05:13 PM