Thread: Erase and font

  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,263
    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,263
    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,263
    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, 02: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