コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: Click.cs プロジェクト: KagefumiMerry/OverParse
        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);
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: himie/OverParse-1
        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;
        }
コード例 #4
0
        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();
            }
        }
コード例 #5
0
        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();
            }
        }