Re: Choosing font for dialog box, some advice please...

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: sigi (sigi_23_at_yahoo.de)
Date: 07/15/04


Date: Thu, 15 Jul 2004 16:02:19 +0200

this code includes some nice ideas (and uses functions i can use also
without mfc)

if it would continue querying LANG_JAPAN, LANG_KOREA, ... i would be
satisfied at all:)

thanks,
sigi

"Phlip" <phlip_cpp@yahoo.com> wrote in message
news:%23QpH40iaEHA.2792@TK2MSFTNGP09.phx.gbl...
>> *) is there a smarter way?
>
> I don't know.
>
> But here's trivial WTL code to set a font pro-actively:
>
> LRESULT
> ProjectDlg::OnInitDialog(UINT, WPARAM, LPARAM, BOOL &)
> {
> CListBox aList = GetDlgItem(IDC_LIST_CUSTOMERS);
> .
>
> if (LANG_SANSKRIT == PRIMARYLANGID(::GetThreadLocale()))
> {
> if (!m_fontSanskrit.m_hFont)
> m_fontSanskrit.
> CreatePointFont(180, TEXT("Sanskrit 2003"));
>
> CClientDC aDC(this->m_hWnd);
>
> CFontHandle oldFont = aDC.SelectFont(m_fontSanskrit);
> TEXTMETRIC metrics;
> aDC.GetTextMetrics(&metrics);
> aDC.SelectFont(oldFont);
> aList.SetItemHeight(0, metrics.tmHeight);
>
> CWindow first = GetWindow(GW_CHILD);
> CWindow next = first;
>
> do {
> next.SetFont(m_fontSanskrit);
> next = next.GetWindow(GW_HWNDNEXT);
> } while (next.m_hWnd);
> }
> return 0;
> }
>
> I'm unsure if that could help, but I had it laying around so pasting it
> into
> my editor can't hurt!
>
> --
> Phlip
> http://industrialxp.org/community/bin/view/Main/TestFirstUserInterfaces
>
>



Relevant Pages

  • Re: MFC updates and enhancements
    ... but having a fresh new look never hurt any programming platform. ... were working in MFC up til now aren't going to move to .Net and vice versa. ... Nobody is going to go from .Net to MFC just because Microsoft tossed in some poor 3rd party libraries. ...
    (microsoft.public.vc.mfc)
  • Re: Please use wxWidgets
    ... > Typical uninformed gibberish about MFC. ... Sounds like someone here has never tried to write a unit test for MFC ... Phlip ...
    (comp.programming)