![]() |
Fehler mit SetDesktopColor unter Windows 2000
Mit folgender Procedure soll das Desktophintergrundbild entfernt werden und ein Farbe als Hintergrund festgelegt werden:
Delphi-Quellcode:
Unter WinXP funzt das einwandfrei, aber als ich es auf den Rechner meiner Eltern (Win2000) ausprobiert habe, hat er das Hintergrundbild nicht entfernt und überall, wo weiß ist setzt er die angegebene Farbe. Weiß jemand, woran das liegen könnte.
procedure TForm1.SetDesktopColor(clr:DWord);
var colorID:Integer; color:COLORREF; begin // Remember current background color if FOldColor=CLR_INVALID then FOldColor:=GetSysColor(COLOR_BACKGROUND); // Set the desktop background color to the wanted one colorID:=COLOR_BACKGROUND; color:=clr; SetSysColors(1,colorID,color); // Remove the desktop wallpaper, without updating the registry SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, PChar(''), 0); end; |
Re: Fehler mit SetDesktopColor unter Windows 2000
Du solltest die Rückgabewerte prüfen und ggf. mit "GetLastError" nachgucken, was schief gelaufen ist. :)
|
Re: Fehler mit SetDesktopColor unter Windows 2000
Hi! (Ja, ich bin's wieder ;) )
Das ist mir auch schon 2mal untergekommen mit meinem Overlay Programm: Da ist die Farbauflösung "nur" auf 16bit eingestellt gewesen... Zumindest war das bei mir die Lösung des Problems... Was man dagegen machen kann, weiß ich noch nicht :gruebel: |
Re: Fehler mit SetDesktopColor unter Windows 2000
Ok also es muss an folgender Zeile liegen:
Delphi-Quellcode:
Und als Fehlermeldung gibt er mir "Der Aufruf einer Betriebssystemfunktion ist fehlgeschlagen" aus. Also ich muss schon sagen, der wäre ich selber nie drauf gekommen. :-D
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, PChar(''), 0);
Gibt es vielleicht noch eine andere Möglichkeit um das Desktophintergrundbild zu löschen. |
Re: Fehler mit SetDesktopColor unter Windows 2000
Zitat:
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:09 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 by Thomas Breitkreuz