How to Obtain Fonts, ToolTips, and Other Non-Client MetricsLast reviewed: September 29, 1995Article ID: Q130764 |
The information in this article applies to:
SUMMARYThe 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 INFORMATIONWindows 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |