![]() |
Wallpaper ermitteln/setzen
Hi,
wie ist es möglich, dass aktuelle Hintergrundbild zu ermitteln, bzw. zu ersetzen? Müsste irgendein Key in der Registry sein. Aber ich finde mal wieder nix.. Chris |
Ich habe hier von Swissdelphicenter etwas für dich:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var sWallPaperBMPPath: string; begin sWallPaperBMPPath := 'C:\[WinDIR]\wall.bmp'; if not SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, Pointer(sWallPaperBMPPath), SPIF_SENDWININICHANGE) then ShowMessage('Succesful.') else ShowMessage('Failed!'); end; // 3. Set the wallpaper for the Active Desktop. { You may have noticed that using SystemParametersInfo to change the wallpaper when ActiveDesktop is turned on doesn't work. The reason is because you need to use the IActiveDesktop COM interface. Using SystemParametersInfo still works, but it doesn't update the wallpaper. Requires Internet Explorer 4.0 or later). } uses ShlObj, ComObj; function ChangeWallpaper(aFile: String): Boolean; const CLSID_ActiveDesktop: TGUID = '{75048700-EF1F-11D0-9888-006097DEACF9}'; var hObj: IUnknown; ADesktop: IActiveDesktop; str: string; wstr: PWideChar; begin hObj := CreateComObject(CLSID_ActiveDesktop); ADesktop := hObj as IActiveDesktop; wstr := AllocMem(MAX_PATH); try StringToWideChar(aFile, wstr, MAX_PATH); ADesktop.SetWallpaper(wstr, 0); ADesktop.ApplyChanges(AD_APPLY_ALL or AD_APPLY_FORCE); finally FreeMem(wstr); end; end; |
Danke, habe aber bereits selbst herausgefunden wo:
Code:
Chris
HKEY_CURRENT_USER\Control Panel\Desktop
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:20 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz