コード例 #1
0
ファイル: EventManager.cs プロジェクト: AskDrax/FocusMaster
        protected virtual void OnMouseWindowChanged(object sender, MouseWindowEventArgs e)
        {
            if (HWNDUnderMouse != currentForegroundHWND && WindowHelper.IsInWindowList(HWNDUnderMouse))
            {
                if (NoClickOnlyFocus)
                {
                    MouseInput.supressNext = true;
                    MouseInput.targetHWND  = HWNDUnderMouse;
                }
                else if (NoFocusOnlyClick)
                {
                    MouseInput.supressNext = false;
                    WindowHelper.RemoveWindowStyleEx(LastHWNDUnderMouse, new IntPtr(WS_EX.WS_EX_NOACTIVATE));
                    WindowHelper.AddWindowStyleEx(HWNDUnderMouse, new IntPtr(WS_EX.WS_EX_NOACTIVATE));
                }
                else
                {
                    MouseInput.supressNext = false;

                    WindowHelper.RemoveWindowStyleEx(HWNDUnderMouse, new IntPtr(WS_EX.WS_EX_NOACTIVATE));
                    WindowHelper.RemoveWindowStyleEx(LastHWNDUnderMouse, new IntPtr(WS_EX.WS_EX_NOACTIVATE));
                }
            }
            else
            {
                MouseInput.supressNext = false;

                WindowHelper.RemoveWindowStyleEx(HWNDUnderMouse, new IntPtr(WS_EX.WS_EX_NOACTIVATE));
                WindowHelper.RemoveWindowStyleEx(LastHWNDUnderMouse, new IntPtr(WS_EX.WS_EX_NOACTIVATE));
            }

            string name = WindowHelper.GetTitleOfWindow(e.HWND);

            CurrentLog.Add(LogEntryType.WindowsEvent, "Mouse is now over: " + name + " (" + e.HWND.ToString() + ") at " + e.MousePoint.ToString());
        }
コード例 #2
0
ファイル: EventManager.cs プロジェクト: AskDrax/FocusMaster
        protected virtual void OnWindowSizeEnd(object sender, MouseWindowEventArgs e)
        {
            string name = WindowHelper.GetTitleOfWindow(e.HWND);

            CurrentLog.Add(LogEntryType.WindowsEvent, "Window Size Ended: " + name + " (" + e.HWND.ToString() + ") at " + e.MousePoint.ToString());
        }