private void SetupPostInit() { if (Settings.Instance.EnableDesktop && !GroupPolicyManager.Instance.NoDesktop && Icons == null) { grid.Children.Add(Icons = new DesktopIcons()); NavigationManager.NavigateHome(); if (Settings.Instance.EnableDynamicDesktop) { TryAndEat(() => { DesktopNavigationToolbar nav = new DesktopNavigationToolbar() { Owner = this, NavigationManager = NavigationManager }; nav.Show(); }); } } Shell.HideWindowFromTasks(Handle); int result = NativeMethods.SetShellWindow(Handle); SendToBottom(); if (Settings.Instance.EnableDesktopOverlayHotKey) { HotKeyManager.RegisterHotKey(Settings.Instance.DesktopOverlayHotKey, OnShowDesktop); } }
private void Window_SourceInitialized(object sender, EventArgs e) { this.Top = 0; helper = new WindowInteropHelper(this); HwndSource source = HwndSource.FromHwnd(helper.Handle); source.AddHook(new HwndSourceHook(WndProc)); if (Settings.EnableDesktop && Icons == null) { Icons = new DesktopIcons(); grid.Children.Add(Icons); if (Settings.EnableDynamicDesktop) { try { DesktopNavigationToolbar nav = new DesktopNavigationToolbar() { Owner = this }; nav.Show(); } catch { } } } setupPostInit(); }
private void Window_SourceInitialized(object sender, EventArgs e) { Top = 0; helper = new WindowInteropHelper(this); Handle = helper.Handle; HwndSource.FromHwnd(helper.Handle).AddHook(new HwndSourceHook(WndProc)); if (Settings.Instance.EnableDesktop && Icons == null) { grid.Children.Add(Icons = new DesktopIcons()); string defaultDesktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); string userDesktopPath = Settings.Instance.DesktopDirectory; // first run won't have desktop directory set if (string.IsNullOrWhiteSpace(userDesktopPath)) { Settings.Instance.DesktopDirectory = defaultDesktopPath; userDesktopPath = defaultDesktopPath; } if (Directory.Exists(userDesktopPath)) { NavigationManager.NavigateTo(userDesktopPath); } else if (Directory.Exists(defaultDesktopPath)) { NavigationManager.NavigateTo(defaultDesktopPath); } if (Settings.Instance.EnableDynamicDesktop) { TryAndEat(() => { DesktopNavigationToolbar nav = new DesktopNavigationToolbar() { Owner = this, NavigationManager = NavigationManager }; nav.Show(); }); } } SetupPostInit(); }
private void Window_Activated(object sender, EventArgs e) { int result = NativeMethods.SetShellWindow(helper.Handle); Shell.ShowWindowBottomMost(helper.Handle); if (Properties.Settings.Default.EnableDesktop && Icons == null) { Icons = new DesktopIcons(); grid.Children.Add(Icons); if (Properties.Settings.Default.EnableDynamicDesktop) { DesktopNavigationToolbar nav = new DesktopNavigationToolbar() { Owner = this }; nav.Show(); } } }