internal void ShowWallpaper(Control renderControl) { IntPtr windowHandle = IntPtr.Zero; WallpaperManager.UIInvoke(() => { try { Controls.Clear(); renderControl.Dock = DockStyle.Fill; Controls.Add(renderControl); Opacity = 1; Refresh(); windowHandle = Handle; } catch (Exception ex) { } }); WallpaperHelper.GetInstance(_screenIndex).SendToBackground(windowHandle); }
public static RenderHost GetHost(uint screenIndex = 0, bool autoCreate = true) { if (!_hosts.ContainsKey(screenIndex)) { if (autoCreate) { WallpaperManager.UIInvoke(() => { var host = _hosts[screenIndex] = new RenderHost(screenIndex); host.Show(); }); } } if (_hosts.ContainsKey(screenIndex)) { return(_hosts[screenIndex]); } else { return(null); } }