j'essaye de changer mon fond d'écran, mais la fonction de Regis marche mal, alors j'ai fait ca:
Code : Tout sélectionner
Procedure SetWallpaper(FileName.s)
; style = 0 : centrer
; style = 2 : étirer
Style.s = "2"
Style2.s="0"
RegOpenKeyEx_(#HKEY_CURRENT_USER, "Software\Microsoft\Internet Explorer\Desktop\General\", #NULL, #KEY_ALL_ACCESS, @hKey)
RegSetValueEx_(hKey, "WallpaperStyle", #NULL, #REG_SZ, @Style, Len(Style) + 1 )
RegSetValueEx_(hKey, "TileWallpaper", #NULL, #REG_SZ, @Style2, Len(Style) + 1 )
RegSetValueEx_(hKey, "Wallpaper", #NULL, #REG_SZ, FileName, Len(Style) + 1 )
RegSetValueEx_(hKey, "BackupWallpaper", #NULL, #REG_SZ, FileName, Len(Style) + 1 )
SystemParametersInfo_(#SPI_SETDESKWALLPAPER, 0, FileName, #SPIF_UPDATEINIFILE | #SPIF_SENDWININICHANGE)
RegOpenKeyEx_(#HKEY_USERS, ".DEFAULT\Control Panel\Desktop\", #NULL, #KEY_ALL_ACCESS, @hKey)
RegSetValueEx_(hKey, "WallpaperStyle", #NULL, #REG_SZ, @Style, Len(Style) + 1 )
RegSetValueEx_(hKey, "TileWallpaper", #NULL, #REG_SZ, @Style2, Len(Style) + 1 )
RegSetValueEx_(hKey, "Wallpaper", #NULL, #REG_SZ, FileName, Len(Style) + 1 )
RegSetValueEx_(hKey, "BackupWallpaper", #NULL, #REG_SZ, FileName, Len(Style) + 1 )
SystemParametersInfo_(#SPI_SETDESKWALLPAPER, 0, FileName, #SPIF_UPDATEINIFILE | #SPIF_SENDWININICHANGE)
RegOpenKeyEx_(#HKEY_CURRENT_USER, "Control Panel\Desktop\", #NULL, #KEY_ALL_ACCESS, @hKey)
RegSetValueEx_(hKey, "WallpaperStyle", #NULL, #REG_SZ, @Style, Len(Style) + 1 )
RegSetValueEx_(hKey, "TileWallpaper", #NULL, #REG_SZ, @Style2, Len(Style) + 1 )
RegSetValueEx_(hKey, "Wallpaper", #NULL, #REG_SZ, FileName, Len(Style) + 1 )
RegSetValueEx_(hKey, "BackupWallpaper", #NULL, #REG_SZ, FileName, Len(Style) + 1 )
SystemParametersInfo_(#SPI_SETDESKWALLPAPER, 0, FileName, #SPIF_UPDATEINIFILE | #SPIF_SENDWININICHANGE)
EndProcedure
Car là le fond d'écran se change mais le bureau s'actualise pas...
Si qq sais...
merci