Microsoft KB Archive/130764

-

{| The information in this article applies to: Microsoft Win32 Application Programming Interface (API) included with: - Microsoft Windows 95 version 4.0
 * width="100%"|

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.
 * }

-

Last reviewed: September 29, 1995

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.