From: "Peter Below (TeamB)" <100113.1101@compuXXserve.com> Subject: Re: Using SystemParametersInfo Date: 20 Mar 1999 00:00:00 GMT Message-ID: Content-Transfer-Encoding: 8bit References: <36F346EA.52BCFFC3@sprint.com.au> Content-Type: text/plain; charset=iso-8859-1 Organization: TeamB Mime-Version: 1.0 Reply-To: 100113.1101@compuXXserve.com Newsgroups: borland.public.delphi.winapi > > What is the correct way to use this Function in User32.dll. Thankyou > Just call it, it is defined for you in the Windows unit. The help for it is in win32.hlp, in your delphi\help directory. The exact parameter usage depends on the SPI_ flag you use. Here are a couple of examples: procedure TForm1.BtnGetStatusClick(Sender: TObject); var status: Bool; begin If SystemParametersInfo( SPI_GETSCREENSAVEACTIVE, 0, @status, 0) Then If status Then label1.Caption := 'Screensaver is enabled' Else label1.Caption := 'Screensaver is disabled' Else label1.Caption := 'System error: '+SysErrorMessage(GetLastError); end; SystemParametersInfo( SPI_SETDESKWALLPAPER, 0, PChar( newwallpaperfilename ), SPIF_UPDATEINIFILE or SPIF_SENDWININICHANGE ); Function GetCaptionFont: TFont; var ncMetrics: TNonClientMetrics; begin ncMetrics.cbSize := sizeof(TNonClientMetrics); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(TNonClientMetrics), @ncMetrics, 0); Result := TFont.Create; Result.Handle := CreateFontIndirect(ncMetrics.lfCaptionFont); end; Peter Below (TeamB) 100113.1101@compuserve.com) No replies in private e-mail, please, unless explicitely requested!