How change console default font

This is a discussion on How change console default font within the Windows Programming forums, part of the Platform Specific Boards category; I found one API to do this, but i don't know use, if anyone can help-me API SetCurrentConsoleFontEx SetCurrentConsoleFontEx function ...

  1. #1
    Registered User
    Join Date
    Aug 2013
    Location
    Vila Velha, Brazil
    Posts
    2

    How change console default font

    I found one API to do this, but i don't know use, if anyone can help-me


    API SetCurrentConsoleFontEx
    SetCurrentConsoleFontEx function (Windows)
    Thank you for everything!

  2. #2
    Registered User
    Join Date
    Aug 2013
    Location
    Vila Velha, Brazil
    Posts
    2
    anyone?

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,855
    Having searched for the function name, it's pretty easy to find examples of code which use that function.

    Have you tried any of them?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    Have you googled for the sample?
    Have you compiled and run found sample?
    Does your sample working not as expected?

    Show your code and explain what is happening not as desired.
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  5. #5
    Registered User MyDoom's Avatar
    Join Date
    Jul 2013
    Posts
    9
    You need to get the console handle for the first argument:
    Code:
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    The second argument can probably be TRUE.

    Notice you need a struct for the third argument:
    Code:
    CONSOLE_FONT_INFOEX cfInfo;
    cfInfo.cbSize = sizeof(CONSOLE_FONT_INFOEX);
    You can fill in the rest of the struct members (remember to use fonts only available in the console).

    Then call the function:
    Code:
    BOOL result = SetCurrentConsoleFontEx(hConsole, TRUE, &cfInfo);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with default font in graphical mode
    By voldemarz in forum C Programming
    Replies: 16
    Last Post: 10-24-2008, 02:30 PM
  2. Set default font for all objects?
    By Dampy in forum Windows Programming
    Replies: 1
    Last Post: 05-31-2008, 06:57 PM
  3. Changing default font in Emacs
    By dra in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 02-26-2008, 02:53 AM
  4. default font
    By larry in forum Windows Programming
    Replies: 2
    Last Post: 02-13-2003, 05:22 AM
  5. setting default font to draw all further controls with
    By alandrums in forum Windows Programming
    Replies: 0
    Last Post: 12-03-2001, 10:31 PM

Tags for this Thread


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