private void Window_Deactivated(object sender, EventArgs e) { Window window = (Window)sender; window.Topmost = AlwaysOnTop.IsChecked; if (Properties.Settings.Default.ClickthroughEnabled) { int extendedStyle = WindowsServices.GetWindowLong(hwndcontainer, WindowsServices.GWL_EXSTYLE); WindowsServices.SetWindowLong(hwndcontainer, WindowsServices.GWL_EXSTYLE, extendedStyle | WindowsServices.WS_EX_TRANSPARENT); } }
public void AlwaysOnTop_Key(object sender, EventArgs e) { AlwaysOnTop.IsChecked = !AlwaysOnTop.IsChecked; IntPtr wasActive = WindowsServices.GetForegroundWindow(); // hack for activating overparse window WindowState = WindowState.Minimized; Show(); WindowState = WindowState.Normal; Topmost = AlwaysOnTop.IsChecked; AlwaysOnTop_Click(null, null); WindowsServices.SetForegroundWindow(wasActive); }
private void AlwaysOnTop_Key(object sender, HotkeyEventArgs e) { // Console.WriteLine("Always-on-top hotkey pressed"); AlwaysOnTop.IsChecked = !AlwaysOnTop.IsChecked; IntPtr wasActive = WindowsServices.GetForegroundWindow(); // hack for activating overparse window this.WindowState = WindowState.Minimized; this.Show(); this.WindowState = WindowState.Normal; this.Topmost = AlwaysOnTop.IsChecked; AlwaysOnTop_Click(null, null); WindowsServices.SetForegroundWindow(wasActive); e.Handled = true; }
private void HideIfInactive(object sender, EventArgs e) { if (!Properties.Settings.Default.AutoHideWindow) { return; } string title = WindowsServices.GetActiveWindowTitle(); if (title != "OverParse" && title != "Phantasy Star Online 2") { this.Opacity = 0; } else { HandleOpacity(); } }
private void HideIfInactive(object sender, EventArgs e) { if (!Properties.Settings.Default.AutoHideWindow) { return; } string title = WindowsServices.GetActiveWindowTitle(); string[] relevant = { "OverParse", "OverParse Setup", "OverParse Error", "Encounter Timeout", "Phantasy Star Online 2" }; if (!relevant.Contains(title)) { Opacity = 0; } else { HandleWindowOpacity(); } }