🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.misc
Article #382

Re: How to change the WallPaper ??

#382
From: Sonnich Jensen
Date: Mon, 24 May 1999 00:00
43 lines
2125 bytes
Just my 50 sents (2 comments) on this.....

Gerhard Grosse wrote in message <3748535F.E90FE04E@ph.tum.de>...

>begin
>  cReg := TRegistry.Create;
>  with cReg do try
>    RootKey := HKEY_CURRENT_USER;
>    OpenKey('Control Panel\desktop',False);
>    sOldWallPaper := ReadString('Wallpaper','');
>    WriteString('Wallpaper','c:\windows\mywallpaper.bmp');
>    CloseKey;
>  finally
>    Free;
>  end;
>end;


Note that win95 and 98 stores these information in the WIN.INI file under
DESKTOP. (above code for NT)
You have to check whether the unformation is in the Registry or in the INI
file.

I make a check whether it is present in the registry, and if not (KeyExists
or whatever) then I read from the INI file.


-----Original Message-----
From: Dirk Claessens <will.bounce@back.com>
>if not SystemParametersInfo(SPI_SETDESKWALLPAPER,
>                            0,
>                            PChar('MyWallPaper.bmp'),
>                            SPIF_UPDATEINIFILE) then
>ShowMessage( 'Oops : ' + SysErrorMessage(GetLastError));

A problem with SystemParametersInfo in _some_ versions of Win95 (and also NT
????) is that SystemParametersInfo in this case ALWAYS returns true !!!!!
I don't know the result for 98.

Therefore is it better to read the Registry/inifile to check whether the
change was successfull !

Sonnich
Technical Details
Message-ID: <37496b17$0$29036@diablo.uninet.ee>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <374834DD.6445E556@sftw.umac.mo> <3748535F.E90FE04E@ph.tum.de>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fd817,be2715f1a7fd097b
X-Google-Attributes: gidfd817,public
X-Google-Thread: 1043cf,be2715f1a7fd097b
X-Google-Attributes: gid1043cf,public
X-Google-Thread: 10baee,be2715f1a7fd097b
X-Google-Attributes: gid10baee,public
From: "Sonnich Jensen" <sonnich.jensen@novobcs.ee>
Subject: Re: How to change the WallPaper ??
Date: 1999/05/24
Message-ID: <37496b17$0$29036@diablo.uninet.ee>
X-Deja-AN: 481529590
References: <374834DD.6445E556@sftw.umac.mo> <3748535F.E90FE04E@ph.tum.de>
X-Trace: 927558423 29036 (none) 194.204.47.55
Newsgroups: comp.lang.pascal.delphi.misc,alt.comp.lang.borland-delphi,borland.public.delphi.objectpascal
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4