How to Obtain Fonts, ToolTips, and Other Non-Client Metrics

Last reviewed: September 29, 1995
Article ID: Q130764
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows 95 version 4.0
    

SUMMARY

The SystemParametersInfo() API under Windows 95 has been expanded to include a new set of FLAGS to set or get system-wide parameters. One such flag is the SPI_GET/SETNONCLIENTMETRICS flag and the NONCLIENTMETRICS structure. This flag and the related structure when used with the SystemsParametersInfo() API can provide applications with a plethora of information on the non-client metrics system wide.

MORE INFORMATION

Windows 95 provides users with the ability to change the fonts used (displayed) by menus and message boxes and change the height of caption bars of windows by simply changing the settings in the Appearance property sheet. They need only right click the desktop to bring up the Display properties dialog box; then they can choose the Appearance page. This was not possible under Windows version 3.1.

Windows 95 applications can programatically change these features with the help of the SystemParametersInfo() function and the NONCLIENTMETRICS structure. Windows 95 applications should not randomly change these system settings unless absolutely necessary because system-wide changes occur.

To obtain the fonts used by message boxes, menus, status bars, and captions, applications can call SystemParametersInfo() with the SPI_GETNONCLIENTMETRICS flag, passing the address of the NONCLIENTMETRICS structure as the third parameter. The system then fills this structure with all sorts of information. The lfMessageFont, lfMenuFont, lfStatusFont members of the NONCLIENTMETRICS structure have the font information.

Similarly, applications can change the font used by menus, message boxes, status bars, and captions by calling SystemParametersInfo() with the SPI_SETNONCLIENTMETRICS flag. When this flag is spcified, a NONCLIENTMETRICS structure is filled with the appropriate values if its address is passed in as the third parameter. Once again, the changes made this way are reflected system wide, so application designers should use this flag sparingly.


Additional reference words: 4.00 user controls styles
KBCategory: kbui
KBSubcategory: UsrSys


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 29, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.