Autor Beitrag
schlumsch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

alles Win :)
Delphi 2005 Prof, Delphi 2007
BeitragVerfasst: So 13.03.05 11:33 
Hi, also wie die Überschrift schon sagt möchte ich meinen Windows-Desktop aktualisieren nachdem ein neues Hintergrundbild (erfolgreich!) gesetzt wurde.
Habe dazu den folgenden Code mehrfach im Netz gefunden, welcher allerdings nicht so wirklich funktioniert. Kurzum: wich will den Desktoip nicht selber mittels "F5" aktualisieren.

ausblenden Delphi-Quelltext
1:
2:
3:
  SystemParametersInfo  (SPI_SETDESKWALLPAPER,0,  PChar(Bild),SPIF_SENDWININICHANGE);
  SystemParametersInfo  (SPI_SETDESKWALLPAPER,0,  PChar(Bild),SPIF_SENDWININICHANGE);
  SystemParametersInfo  (SPI_SETDESKWALLPAPER,0,  PChar(Bild),SPIF_SENDWININICHANGE);


Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.

_________________
icq 102779206
"God is real, unless declared integer..."
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: So 13.03.05 11:58 
Hallo,
das einfachste wäre an das Handle des Desktops den Tastendruck für F5 zu senden. Warum rufst du SystemParametersInfo eigentlich mehrmals auf?

Gruß,
maxk

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
schlumsch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

alles Win :)
Delphi 2005 Prof, Delphi 2007
BeitragVerfasst: So 13.03.05 12:10 
Ja, mehrfach aufgerufen hab ich`s eigentlich nur zum "debuggen" - man "steckt ja nicht drin was win so manchmal klar macht".
..Handle auf den Desktop klingt gut, hast zufällig nen Ansatz bzw nen Link wo ich mich da informieren kann?

Thx schlumsch

_________________
icq 102779206
"God is real, unless declared integer..."
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 13.03.05 12:23 
Unter Win9x gibt es dazu in der User32.dll eine Funktion, mit der der gesamte Desktop-Inhalt neu gezeichnet wird.

ausblenden Quelltext
1:
rundll32.exe user,repaintscreen					


Diesen von Delphi aus aufzurufen geht recht simpel: Funktion RepaintScreen importieren und dann aufrufen. ein Externer Shell-Aufruf ist nicht nötig.

Für die Deklaration bitte W32API-Hlp konsultieren oder im PSDK nachschlagen.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: So 13.03.05 12:38 
PattyPur
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 80

Win98, WinXP
Delphi 7
BeitragVerfasst: So 13.03.05 12:44 
Hui ich hab auch mal ein Programm geschrieben das in regelmässigen abständen das Hintergrundbild ändert.

Wenn Du in deinen Aufruf als letzten Parameter SPIF_updateinifile nimmst dann wird es direkt aktualisiert

_________________
Das Leben ist zum Spielen da,
alles andere ist Unsinn
schlumsch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

alles Win :)
Delphi 2005 Prof, Delphi 2007
BeitragVerfasst: So 13.03.05 13:05 
Aaaalso,

erstma Dank!
Der Code unter dem Link funzt einwandfrei.
"SPIF_updateinifile" agiert dagegen genausowenig wie meine Variante, aber des Problem is`ja gelöst.

mfg schlumsch

_________________
icq 102779206
"God is real, unless declared integer..."
PattyPur
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 80

Win98, WinXP
Delphi 7
BeitragVerfasst: So 13.03.05 13:11 
Also in meinem Prog funktioniert es und zwar unter Win9x und XP

_________________
Das Leben ist zum Spielen da,
alles andere ist Unsinn