Erase and font

This is a discussion on Erase and font within the C++ Programming forums, part of the General Programming Boards category; I have looked through a lot of books and still cant find out how to do these two things: 1)how ...

  1. #1
    Registered User Octorok101's Avatar
    Join Date
    May 2002
    Posts
    22

    Unhappy Erase and font

    I have looked through a lot of books and still cant find out how to do these two things:

    1)how do you clear the screen?(ie get rid of all the text)

    2) how do you change the font size of the text?

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    real dos or console?
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  3. #3
    Registered User Octorok101's Avatar
    Join Date
    May 2002
    Posts
    22

    Question ?

    what?

  4. #4
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    system ("c l s")

    header is <stdlib.h> i think
    with borland its clrscr or something .
    use the help on your compiler.

  5. #5
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    are you running a DOS looking window(the console) in windows? or is it pure DOS?
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  6. #6
    Registered User Octorok101's Avatar
    Join Date
    May 2002
    Posts
    22
    Dos in a window

  7. #7
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    from the Board Faq:

    Code:
    #include <windows.h>
    
    void clrscr()
    {
       COORD coordScreen = { 0, 0 };
       DWORD cCharsWritten;
       CONSOLE_SCREEN_BUFFER_INFO csbi;
       DWORD dwConSize;
       HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    
       GetConsoleScreenBufferInfo(hConsole, &csbi);
       dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
       FillConsoleOutputCharacter(hConsole, TEXT(' '), dwConSize, coordScreen, &cCharsWritten);
       GetConsoleScreenBufferInfo(hConsole, &csbi);
       FillConsoleOutputAttribute(hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten);
       SetConsoleCursorPosition(hConsole, coordScreen);
    }
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  8. #8
    Registered User Octorok101's Avatar
    Join Date
    May 2002
    Posts
    22
    thanks, now I only need to now about the font

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. CListBox with Font and Color can be moved(MoveWindow) as you will.
    By 梦雨林 in forum Windows Programming
    Replies: 1
    Last Post: 06-07-2007, 03:07 PM
  2. opengl program as win API menu item
    By SAMSAM in forum Game Programming
    Replies: 1
    Last Post: 03-03-2003, 07:48 PM

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