void UpdateStatus(string title, string message, string description = null) { Title = title; Message.Text = message ?? string.Empty; MessageDescription.Visibility = string.IsNullOrEmpty(description) ? Visibility.Collapsed : Visibility.Visible; MessageDescription.Text = description; AeroGlass.HideSystemMenu(this); }
protected override void OnLoad(EventArgs e) { Player_LocationSizeChanged(this, e); player.LocationChanged += Player_LocationSizeChanged; player.SizeChanged += Player_LocationSizeChanged; isLoad_ = true; base.OnLoad(e); SetSize(); AeroGlass.EnableBlur(this.Handle); }
/// <summary>Changes the Window Background when Aero Glass is enabled or disabled.</summary> /// <param name="sender">The object that called the event.</param> /// <param name="e">The <c>CompositionChangedEventArgs</c> instance containing the event data.</param> void ChangeWindowChrome(object sender, CompositionChangedEventArgs e) { this.Background = e.IsGlassEnabled ? Brushes.Transparent : Brushes.White; if (!e.IsGlassEnabled) { return; } AeroGlass.EnableGlass(this, new Margins(0, 32, 0, 41)); }
void UpdateStatusAndFinish(bool success, string message, string description = null) { isFinished = true; SetupButton.IsEnabled = false; // Use button as text box only UpdateStatus(success ? "ReShade Setup was successful!" : "ReShade Setup was not successful!", message, description); AeroGlass.HideSystemMenu(this, false); if (isHeadless) { Environment.Exit(success ? 0 : 1); } }
private void buttonAero_Click(object sender, RoutedEventArgs e) { if (buttonAero.Content.ToString().ToLower() == "enable aero") { AeroGlass.ExtendGlassFrame(this, new Thickness(-1)); buttonAero.Content = "Disable Aero"; return; } if (buttonAero.Content.ToString().ToLower() == "disable aero") { Background = Brushes.White; buttonAero.Content = "Enable Aero"; return; } }
/// <summary>Changes the Window Background when Aero Glass is enabled or disabled.</summary> /// <param name="sender">The object that called the event.</param> /// <param name="e">The <c>CompositionChangedEventArgs</c> instance containing the event data.</param> void ChangeWindowChrome(object sender, CompositionChangedEventArgs e) { if (e.IsGlassEnabled) { this.line.Visibility = Visibility.Collapsed; this.rectangle.Visibility = Visibility.Collapsed; this.Background = Brushes.Transparent; AeroGlass.EnableGlass(this, new Margins(0, 0, 0, 41)); } else { this.line.Visibility = Visibility.Visible; this.rectangle.Visibility = Visibility.Visible; this.Background = Brushes.White; } }
/// <summary>Enables Aero Glass on the Window.</summary> /// <param name="e">The <c>EventArgs</c> instance containing the event data.</param> protected override void OnSourceInitialized(EventArgs e) { base.OnSourceInitialized(e); AeroGlass.EnableGlass(this, new Margins(0, 0, 0, 41)); if (AeroGlass.IsGlassEnabled) { this.line.Visibility = Visibility.Collapsed; this.rectangle.Visibility = Visibility.Collapsed; this.Background = Brushes.Transparent; } else { this.line.Visibility = Visibility.Visible; this.rectangle.Visibility = Visibility.Visible; this.Background = Brushes.White; } }
private void Window_Loaded(object sender, RoutedEventArgs e) { AeroGlass.ExtendGlassFrame(this, new Thickness(-1)); RegistryKey IFEORegx64 = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options"); // TreeNode IFEONodex64 = new TreeNode("X64"); if (IFEORegx64 != null) { // IFEOTree.TopNode.Nodes.Add(IFEONodex64); foreach (string IFEOKey in IFEORegx64.GetSubKeyNames()) { RegistryKey CurIFEOKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\" + IFEOKey); if (CurIFEOKey.GetValue("debugger", null) != null) { IFEORegItem IFEOlist = new IFEORegItem(IFEOKey, "X64", (string)CurIFEOKey.GetValue("debugger", null)); //MessageBox.Show("Image:" + IFEOlist.ImageName + "\nPath:" + IFEOlist.ImagePath); listBox1.Items.Add("--------"); listBox1.Items.Add(IFEOlist.ImageName); listBox1.Items.Add(IFEOlist.ImagePath); } } } IFEORegx64.Close(); ////////////////////////// //RegistryKey IFEORegx86 = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Wow6432Node\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options"); //TreeNode IFEONodex86 = new TreeNode("X86"); //if (IFEORegx86 != null) //{ // IFEOTree.TopNode.Nodes.Add(IFEONodex86); //} //IFEORegx86.Close(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { AeroGlass.ExtendGlassFrame(this, new Thickness(-1)); //Thread updateWordListT = new Thread(updateWordList); updateWordList(); //updateWordListT.Start(); ////updateWordListT.Join(); ////while (!updateWordListT.IsAlive) ; //updateWordListT.Join(); progressBar1.Visibility = Visibility.Collapsed; thumbLoading.Visibility = Visibility.Collapsed; //Button btn = new Button(); //btn.Width = 32; //btn.Height = 32; //btn.Click += new RoutedEventHandler(wordButton_Click); //listViewWords.Items.Add(btn); }
/// <summary> /// On window loaded /// </summary> /// <param name="sender">the event provider</param> /// <param name="e">routed event arguments</param> private void Window_Loaded(object sender, RoutedEventArgs e) { AeroGlass.ExtendGlassFrame(this, new Thickness(-1)); using (ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\WMI", "SELECT * FROM WmiMonitorBrightness"))/// WMI is case-insensitive, but we here recommended that to use the proper upper case to improve readibility { foreach (ManagementObject obj in searcher.Get()) { BrightnessLevels = obj["Level"] as byte[]; slider1.Value = (byte)obj["CurrentBrightness"]; tb1.Text = BrightnessLevels.Count().ToString(); foreach (byte b in BrightnessLevels) { slider1.Ticks.Add(b); } break; } } BrightnessWatcher = new ManagementEventWatcher("root\\WMI", "SELECT * FROM WmiMonitorBrightnessEvent"); if (BrightnessWatcher != null) { BrightnessWatcher.EventArrived += new EventArrivedEventHandler(BrightnessWatcher_EventArrived); BrightnessWatcher.Start(); } }
private void Window_SourceInitialized(object sender, EventArgs e) { AeroGlass.ExtendGlassFrame(this, new Thickness(-1)); }
private void Window_Loaded(object sender, RoutedEventArgs e) { AeroGlass.ExtendGlassFrame(this, new Thickness(-1, -1, -1, -1)); }
/// <summary>Enables Aero Glass on the Window.</summary> /// <param name="e">The <c>EventArgs</c> instance containing the event data.</param> protected override void OnSourceInitialized(EventArgs e) { base.OnSourceInitialized(e); AeroGlass.EnableGlass(this, new Margins(0, 32, 0, 41)); this.Background = AeroGlass.IsGlassEnabled ? Brushes.Transparent : Brushes.White; }
void InstallationStep2() { ApiGroup.IsEnabled = false; SetupButton.IsEnabled = false; ApiGroup.Visibility = ApiD3D9.Visibility = ApiDXGI.Visibility = ApiOpenGL.Visibility = ApiVulkan.Visibility = Visibility.Visible; ApiVulkanGlobal.Visibility = ApiVulkanGlobalButton.Visibility = Visibility.Collapsed; UpdateStatus("Working on " + targetName + " ...", "Installing ReShade ..."); var targetDir = Path.GetDirectoryName(targetPath); var executableName = Path.GetFileName(targetPath); if (compatibilityIni != null && compatibilityIni.HasValue(executableName, "InstallTarget")) { targetDir = Path.Combine(targetDir, compatibilityIni.GetString(executableName, "InstallTarget")); } configPath = Path.Combine(targetDir, "ReShade.ini"); if (ApiVulkan.IsChecked != true) { if (ApiD3D9.IsChecked == true) { modulePath = "d3d9.dll"; } else if (ApiDXGI.IsChecked == true) { modulePath = "dxgi.dll"; } else if (ApiOpenGL.IsChecked == true) { modulePath = "opengl32.dll"; } else // No API selected, abort immediately { return; } modulePath = Path.Combine(targetDir, modulePath); var configPathAlt = Path.ChangeExtension(modulePath, ".ini"); if (File.Exists(configPathAlt)) { configPath = configPathAlt; } if (ReShadeExists(modulePath, out bool isReShade) && !isHeadless) { if (isReShade) { ApiGroup.Visibility = Visibility.Collapsed; InstallButtons.Visibility = Visibility.Visible; Message.Text = "Existing ReShade installation found. How do you want to proceed?"; // Do not hide exit button when asking about existing installation, so user can abort installation AeroGlass.HideSystemMenu(this, false); } else { UpdateStatusAndFinish(false, Path.GetFileName(modulePath) + " already exists, but does not belong to ReShade.", "Please make sure this is not a system file required by the game."); } return; } } if (!isHeadless) { if (ApiD3D9.IsChecked != true && ReShadeExists(Path.Combine(targetDir, "d3d9.dll"), out bool isD3D9ReShade) && isD3D9ReShade) { UpdateStatusAndFinish(false, "Existing ReShade installation for Direct3D 9 found.", "Multiple simultaneous ReShade installations are not supported. Please uninstall the existing one first."); return; } if (ApiDXGI.IsChecked != true && ReShadeExists(Path.Combine(targetDir, "dxgi.dll"), out bool isDXGIReShade) && isDXGIReShade) { UpdateStatusAndFinish(false, "Existing ReShade installation for Direct3D 10/11/12 found.", "Multiple simultaneous ReShade installations are not supported. Please uninstall the existing one first."); return; } if (ApiOpenGL.IsChecked != true && ReShadeExists(Path.Combine(targetDir, "opengl32.dll"), out bool isOpenGLReShade) && isOpenGLReShade) { UpdateStatusAndFinish(false, "Existing ReShade installation for OpenGL found.", "Multiple simultaneous ReShade installations are not supported. Please uninstall the existing one first."); return; } } InstallationStep3(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { labelBomb.Content = "Bombs : 0"; CountTime.Elapsed += new ElapsedEventHandler(CountTime_Elapsed); AeroGlass.ExtendGlassFrame(this, new Thickness(-1)); }
void InstallationStep2() { ApiGroup.IsEnabled = false; SetupButton.IsEnabled = false; ApiGroup.Visibility = ApiD3D9.Visibility = ApiDXGI.Visibility = ApiOpenGL.Visibility = ApiVulkan.Visibility = Visibility.Visible; ApiVulkanGlobal.Visibility = ApiVulkanGlobalButton.Visibility = Visibility.Collapsed; UpdateStatus("Working on " + targetName + " ...", "Installing ReShade ..."); string targetDir = Path.GetDirectoryName(targetPath); configPath = Path.Combine(targetDir, "ReShade.ini"); if (ApiVulkan.IsChecked != true) { modulePath = null; if (ApiD3D9.IsChecked == true) { modulePath = "d3d9.dll"; } if (ApiDXGI.IsChecked == true) { modulePath = "dxgi.dll"; } if (ApiOpenGL.IsChecked == true) { modulePath = "opengl32.dll"; } if (modulePath == null) { // No API selected, abort immediately return; } modulePath = Path.Combine(targetDir, modulePath); var alternativeConfigPath = Path.ChangeExtension(modulePath, ".ini"); if (File.Exists(alternativeConfigPath)) { configPath = alternativeConfigPath; } if (File.Exists(modulePath) && !isHeadless) { var moduleInfo = FileVersionInfo.GetVersionInfo(modulePath); if (moduleInfo.ProductName == "ReShade") { ApiGroup.Visibility = Visibility.Collapsed; InstallButtons.Visibility = Visibility.Visible; Message.Text = "Existing ReShade installation found. How do you want to proceed?"; // Do not hide exit button when asking about existing installation, so user can abort installation AeroGlass.HideSystemMenu(this, false); } else { UpdateStatusAndFinish(false, Path.GetFileName(modulePath) + " already exists, but does not belong to ReShade.", "Please make sure this is not a system file required by the game."); } return; } } InstallationStep3(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { SB = new SBarHook.SlideBar(SlideBarHandler, true); AeroGlass.ExtendGlassFrame(this, new Thickness(-1)); RefreshGameList(); }
void OnWindowInit(object sender, EventArgs e) { AeroGlass.HideIcon(this); AeroGlass.ExtendFrame(this); }
private void Window_SizeChanged(object sender, SizeChangedEventArgs e) { labelSize.Content = "Size: " + this.Width + "x" + this.Height; AeroGlass.ExtendGlassFrame(this, new Thickness(-1)); }