CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    22

    Help: getting Font-Size of desktop window

    Hi
    Can anyone help me to get the Font-Size of the desktop window?
    Thanks a lot
    Rene´


  2. #2
    Join Date
    May 1999
    Location
    Toronto, Ontario, Canada
    Posts
    155

    Re: Help: getting Font-Size of desktop window

    You can use

    ZeroMemory((PVOID)&m_lf, sizeof(LOGFONT));
    NONCLIENTMETRICS nm;
    nm.cbSize = sizeof(NONCLIENTMETRICS);

    // Get the system metrics for the Caption from here
    VERIFY (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &nm, 0));



    to get the LOGFONT structure for Menu, StatusBars, and MessageBoxes.

    On the other hand, you can use

    CFont *pFont = GetDesktopWindow()->GetFont();
    if (pFont)
    {
    LOGFONT logFont;
    pFont->GetLogFont(&logFont);
    }




    All the information is in the LOGFONT structure.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured