1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| Func _DesactivationFondecran()
If _FichierCacheExist("Fondecran") = 0 Then
Local $sWallpaper = RegRead("HKEY_CURRENT_USER\Control Panel\Desktop\", "WallPaper"), $bVerifWallpaper = False
If $sWallpaper <> "" Then
If Not FileExists($sWallpaper) Then
If FileExists(@AppDataDir & '\Microsoft\Windows\Themes\TranscodedWallpaper') Then
If FileCopy(@AppDataDir & '\Microsoft\Windows\Themes\TranscodedWallpaper', $sWallpaper) Then
_FileWriteLog($hLog, "Restauration du fond d'écran avant désactivation (" & $sWallpaper & ")")
$bVerifWallpaper = True
Else
_FileWriteLog($hLog, "Désactivation du fond d'écran impossible : copie de TranscodeWallpaper échouée")
EndIf
Else
_FileWriteLog($hLog, "Désactivation du fond d'écran impossible car l'image n'a pas été trouvée")
EndIf
Else
$bVerifWallpaper = True
EndIf
If $bVerifWallpaper Then
_FileWriteLog($hLog, "Désactivation du fond d'écran")
_FichierCache("Fondecran", $sWallpaper)
RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop","WallPaper","REG_SZ",'')
ControlSend('Program Manager', '', '', '{F5}')
EndIf
EndIf
EndIf
EndFunc
Func _ActivationFondecran()
If _FichierCacheExist("Fondecran") Then
Local $sWallpaper = _FichierCache("Fondecran")
If $sWallpaper <> "" Then
_FileWriteLog($hLog, "Réactivation du fond d'écran")
RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop","WallPaper","REG_SZ",$sWallpaper)
ControlSend('Program Manager', '', '', '{F5}')
EndIf
EndIf
EndFunc |
Partager