Exemplo n.º 1
0
        public static void Set(string wallpaperPath, WallpaperStyle style)
        {
            var key = Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop", true);

            key.SetValue(WALLPAPER_STYLE_KEY, style.GetWallpaperStyleKeyValue());
            key.SetValue(TILE_WALLPAPER_KEY, style.GetTileWallpaperKeyValue());

            SystemParametersInfo(SPI_SETDESKWALLPAPER,
                0,
                wallpaperPath,
                SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE);
        }
Exemplo n.º 2
0
        public static void Set(string wallpaperPath, WallpaperStyle style)
        {
            var key = Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop", true);

            key.SetValue(WALLPAPER_STYLE_KEY, style.GetWallpaperStyleKeyValue());
            key.SetValue(TILE_WALLPAPER_KEY, style.GetTileWallpaperKeyValue());

            SystemParametersInfo(SPI_SETDESKWALLPAPER,
                                 0,
                                 wallpaperPath,
                                 SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE);
        }