mfc >> Font used on buttons

by Mihai N. » Tue, 01 Feb 2005 14:09:37 GMT

> I am trying to create my own custom buttons.
> However, I can not determine what font
> MS uses with their buttons.
>
> What font does MS use with their buttons
> (see attachment)?

See GetThemeFont.

Working with the theme API allows your application to
look like a native one for Winows XP (and hopefully Longhorn).


If not interested in XP, see GetStockObject.

--
Mihai Nita [Microsoft MVP, Windows - SDK]
------------------------------------------
Replace _year_ with _ to get the real email


Similar Threads

1. Using Webdings as font for CDialog buttons problem

Hi,

I'm using VS2005 / MFC in a MBCS build.  For some of the buttons on my 
dialog I am using characters from the Webdings font and setting the button 
font like this (in OnInitDialog()):

    if(m_pfntMonotype == NULL)
    {
        m_pfntMonotype = new CFont;
        LOGFONT lf;
        CFont* pFont=((CButton*)GetDlgItem(IDC_UP_BUTTON))->GetFont();
        pFont->GetLogFont(&lf);
        strcpy(lf.lfFaceName, "Webdings");
        lf.lfCharSet=SYMBOL_CHARSET;
        lf.lfHeight=22;
        m_pfntMonotype->CreateFontIndirect(&lf);
    }
    ((CButton*)GetDlgItem(IDC_UP_BUTTON))->SetFont(m_pfntMonotype);
    etc..

This works fine, except for some (but not all) XP Themes that I have 
downloaded, where the characters on my buttons show the character "8" 
instead of the equivalent Webdings character for character code 56.  (Ditto 
for other characters (of course), not just 56!)

If I obtain the LOGFONT from m_pfntMonotype it is identical when the 
Webdings character is correctly rendered (in Luna, etc.) and incorrectly 
rendered.

Therefore, I am guessing the font mapper is incorrectly mapping the font.

Is there any way to guarantee that the Webdings characters are used on all 
themes, or am I using the font inappropriately?  Advice appreciated!

Thanks.

Pete 


2. Trouble using Rotated font, Canvas->Font->Handle not updated - Borland C++ Builder VCL Components

3. using buttons for scroll buttons

Is there any way to have buttons scroll up and down on a standard textbox?
The touchscreen we're using doesn't work very well on scroll bars, so I'd
like to create buttons to immitate the Page Up / Page Down functionality?

Thanks in advance,
Joshua Moore


4. C# Embedded font for button - CSharp / C#