| |
|
|
RGH | Ein Code-Schnipsel aus einem aktuell erstelltem Hilfsprogramm. Getestet unter Win XP SP 2.
' Bildschirmschoner ein-/ausschalten
'Hintergrundfarbe des Desktops einstellen
'Hintergrundbild auswählen oder entfernen
'RGH 17.07.2008
$H windows.ph
' Screensaver ein-/ausschalten
' -----------------------
' schalter% - 1 = ein / 0 = aus
proc setsaver
Parameters schalter%
if schalter% = 0
WriteIni "HKEY_1","Control Panel\Desktop", "ScreenSaveActive" = "0"
WriteIni "HKEY_1","Software\Policies\Microsoft\Windows\Control Panel\Desktop", "ScreenSaveActive" = "0"
else
WriteIni "HKEY_1","Control Panel\Desktop", "ScreenSaveActive" = "1"
WriteIni "HKEY_1","Software\Policies\Microsoft\Windows\Control Panel\Desktop", "ScreenSaveActive" = "1"
endif
endproc
'Hintergrundfarbe einstellen
' ---------------------------
' farbe& - RGB-Wert der Farbe
proc setcolor
parameters farbe&
declare elem&[0], color&[0]
elem&[0] = ~COLOR_DESKTOP
color&[0] = farbe&
~SetSysColors(1, addr(elem&[0]), addr(color&[0]))
endproc
'Hintergrundbild einstellen
' ---------------------------
' bild$ - Dateiname zum Hintergrundbild
proc setpic
parameters bild$
if bild$ > ""
WriteIni "HKEY_1","Control Panel\Desktop", "WallpaperStyle" = "3"
WriteIni "HKEY_1","Control Panel\Desktop", "TileWallpaper" = "2"
WriteIni "HKEY_1","Control Panel\Desktop", "Wallpaper" = bild$
~SystemParametersInfo(~SPI_SETDESKWALLPAPER, 0, addr(bild$), ~SPIF_SENDCHANGE)
else Hintergrundbild ausschalten
WriteIni "HKEY_1","Control Panel\Desktop", "WallpaperStyle" = "0"
WriteIni "HKEY_1","Control Panel\Desktop", "TileWallpaper" = "0"
WriteIni "HKEY_1","Control Panel\Desktop", "Wallpaper" = ""
~SystemParametersInfo(~SPI_SETDESKWALLPAPER, 0, addr(bild$), ~SPIF_SENDCHANGE)
endif
endproc
Saluto Roland |
|
|
| Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 17.07.2008 ▲ |
|
|
|
|
| Hallo Roland, XPSE [...] meckerte "unbekannte Escapesequenz" in
WriteIni "HKEY_1","Software\PoliciesMicrosoft\Windows\Control Panel\Desktop", "ScreenSaveActive" = "0"
habe Deinen Code oben dahingehend korrigiert.
Code funktioniert super! |
|
|
| |
|
|
|
RGH | iF
habe Deinen Code oben dahingehend korrigiert.
Danke!
Saluto Roland |
|
|
| Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 17.07.2008 ▲ |
|
|
|