Re: SystemParametersInfo API

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Randy Birch (rgb_removethis_at_mvps.org)
Date: 10/29/04


Date: Thu, 28 Oct 2004 22:23:56 -0400

This will show you how to retrieve the info using SysParamInfo ..
http://vbnet.mvps.org/code/screen/systemparaminfononclientarea.htm .. and to
set the font you use that same call with the SPI_SETNONCLIENTMETRICS mesasge
along with a populated NONCLIENTMETRICS and SYSTEMFONTINFO struture. You
also want to set fWinIni = SPIF_SENDCHANGE Or SPIF_SENDWININICHANGE.

SPI_SETNONCLIENTMETRICS: Sets the metrics associated with the nonclient
area of nonminimized windows. The pvParam parameter must point to a
NONCLIENTMETRICS structure that contains the new parameters. Set the cbSize
member of this structure and the uiParam parameter to
sizeof(NONCLIENTMETRICS). Also, the lfHeight member of the LOGFONT structure
must be a negative value.

The fuWinIni argument of SystemParametersInfo updates the WIN.INI file (or
registry):

   Const SPIF_SENDWININICHANGE = &H2
   Const SPIF_UPDATEINIFILE = &H1

-- 
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
"John" <John@hotmail.com> wrote in message
news:%23xWt$oVvEHA.940@TK2MSFTNGP14.phx.gbl...
: Does anyone know how to set the desktop menu font size under Advanced
: Appearance / Item:Menu / Font and Size programmatically? I believe it's
the
: SystemParametersInfo API but don't know if I can do that with menu. Anyone
: has any idea? Thanks
:
:


Relevant Pages

  • Re: How to Get and Set Default Font on Forms and Controls?
    ... or SystemParametersInfo. ... I'd search for DlgFont or something like that ... it looks to me like MsgBox does use the UI font, whereas a label on a VB6 ...
    (microsoft.public.vb.general.discussion)
  • Re: How to Get and Set Default Font on Forms and Controls?
    ... or SystemParametersInfo. ... I'd search for DlgFont or something like that as ... it looks to me like MsgBox does use the UI font, whereas a label on a VB6 ...
    (microsoft.public.vb.general.discussion)
  • Re: Windows XP and the Large Fonts Setting
    ... > menus correctly when the user has selected Large or Extra-Large fonts on ... > the Appearance tab of Display Properties (even if he/she does it while my ... SystemParametersInfo() is reserved for things the user can change, ... default menu font. ...
    (microsoft.public.vc.mfc)
  • Re: Große Schriftarten bzw. Dialogfeld-Schriftart
    ... Ich möchte bei geändertem Font in der Anwendung darauf reagieren. ... Es dürfte über WM_SETTINGCHANGE laufen, da diese Nachricht gesendet wird, ... wenn über SystemParametersInfo() eine Einstellung geändert wird - und damit ...
    (microsoft.public.de.vc)