How to set Windows 7 Wallpaper slideshow programmatically?
Setting a normal wallpaper
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern Int32 SystemParametersInfo(UInt32 uiAction, UInt32 uiParam, String pvParam, UInt32 fWinIni);
private static UInt32 SPI_SETDESKWALLPAPER = 20;
private static UInt32 SPIF_UPDATEINIFILE = 0x1;
public void SetImage(string filename)
{
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, filename, SPIF_UPDATEINIFILE);
}
What i found until now:
There is an ini-file for the slideshow in
C:\Users\CurrentUser\AppData\Roaming\Microsoft\Windows\Themes\
The wallpaper has to be in the following folder during the slideshow:
C:\Users\CurrentUser\AppData\Roaming\Microsoft\Windows\Themes\TranscodedWallpaper.jpg
(during a slideshow the file is changing automatically)