コード例 #1
0
ファイル: EventManager.cs プロジェクト: AskDrax/FocusMaster
        protected virtual void OnMouseWindowDragSizeDrop(object sender, MouseWindowDragEventArgs e)
        {
            string draggingWindowTitle = WindowHelper.GetTitleOfWindow(e.DraggingHWND);
            string targetWindowTitle   = WindowHelper.GetTitleOfWindow(e.ToHWND);

            CurrentLog.Add(LogEntryType.WindowsEvent, "Mouse Drag-Size-Dropped Window: " + draggingWindowTitle + " onto Window: " + targetWindowTitle + " at " + e.MousePoint.ToString());
        }
コード例 #2
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());
        }
コード例 #3
0
ファイル: EventManager.cs プロジェクト: AskDrax/FocusMaster
        protected virtual void OnWindowCreated(object sender, OpenCloseEventArgs e)
        {
            AWindow awin = WindowHelper.GetAWINDOW(e.HWND);

            WindowHelper.windowList.Add(awin);

            CurrentLog.Add(LogEntryType.WindowsEvent, "Window Created: " + e.Title + ", (" + e.HWND.ToString() + ")");
        }
コード例 #4
0
ファイル: EventManager.cs プロジェクト: AskDrax/FocusMaster
        protected virtual void OnWindowNameChanged(object sender, NameChangeEventArgs e)
        {
            AWindow awin = WindowHelper.windowList.FirstOrDefault(awindow => awindow.Hwnd == e.HWND);

            if (awin != null)
            {
                awin.Title = e.newName;
                CurrentLog.Add(LogEntryType.WindowsEvent, "Window Name Changed: " + e.oldName + " to " + e.newName + " (" + e.HWND.ToString() + ")");
            }
        }
コード例 #5
0
ファイル: EventManager.cs プロジェクト: AskDrax/FocusMaster
        protected virtual void OnWindowDestroyed(object sender, OpenCloseEventArgs e)
        {
            AWindow awin = WindowHelper.windowList.FirstOrDefault(awindow => awindow.Hwnd == e.HWND);

            if (awin != null)
            {
                WindowHelper.windowList.Remove(awin);
                CurrentLog.Add(LogEntryType.WindowsEvent, "Window Destroyed: " + e.Title + ", (" + e.HWND.ToString() + ")");
            }
        }
コード例 #6
0
ファイル: EventManager.cs プロジェクト: AskDrax/FocusMaster
        protected virtual void OnMoveSizeStart(object sender, WinEventProcEventArgs e)
        {
            MouseInput.GetMousePoint();

            WindowDraggingHWND = e._hwnd;
            IsStartDragging    = true;
            WindowHelper.GetWindowRect(e._hwnd, ref currentWindowRECT);
            lastWindowRECT = currentWindowRECT;

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

            CurrentLog.Add(LogEntryType.WindowsEvent, "Window MoveSize Started: " + name + " (" + e._hwnd.ToString() + ") at " + MouseInput.mousePoint.ToString());
        }
コード例 #7
0
ファイル: EventManager.cs プロジェクト: AskDrax/FocusMaster
        protected virtual void OnObjectCreated(object sender, WinEventProcEventArgs e)
        {
            if (WindowHelper.IsWindow(e._hwnd))
            {
                string title = WindowHelper.GetTitleOfWindow(e._hwnd);
                OnWindowCreated(sender, new OpenCloseEventArgs()
                {
                    HWND = e._hwnd, Title = title
                });
                return;
            }

            CurrentLog.Add(LogEntryType.WindowsEvent, "Object Created: (" + e._hwnd.ToString() + ")");
        }
コード例 #8
0
ファイル: EventManager.cs プロジェクト: AskDrax/FocusMaster
        protected virtual void OnForegroundChanged(object sender, WinEventProcEventArgs e)
        {
            MouseInput.GetMousePoint();

            lastForegroundHWND    = currentForegroundHWND;
            currentForegroundHWND = e._hwnd;

            lastForegroundName    = currentForegroundName;
            currentForegroundName = WindowHelper.GetTitleOfWindow(e._hwnd);

            if (lastForegroundHWND != currentForegroundHWND)
            {
                CurrentLog.Add(LogEntryType.WindowsEvent, "Foreground Window Changed: from " + lastForegroundName + " (" + lastForegroundHWND.ToString() + ") to " + currentForegroundName + " (" + currentForegroundHWND.ToString() + ") at " + MouseInput.mousePoint.ToString());
            }
        }
コード例 #9
0
ファイル: EventManager.cs プロジェクト: AskDrax/FocusMaster
        protected virtual void OnObjectDestroyed(object sender, WinEventProcEventArgs e)
        {
            AWindow awin = WindowHelper.windowList.FirstOrDefault(awindow => awindow.Hwnd == e._hwnd);

            if (awin != null)
            {
                OnWindowDestroyed(sender, new OpenCloseEventArgs()
                {
                    HWND = e._hwnd, Title = awin.Title
                });
                return;
            }

            CurrentLog.Add(LogEntryType.WindowsEvent, "Object Destroyed: (" + e._hwnd.ToString() + ")");
        }
コード例 #10
0
ファイル: EventManager.cs プロジェクト: AskDrax/FocusMaster
        protected virtual void OnObjectNameChanged(object sender, WinEventProcEventArgs e)
        {
            string  newName = WindowHelper.GetTitleOfWindow(e._hwnd);
            AWindow awin    = WindowHelper.windowList.FirstOrDefault(awindow => awindow.Hwnd == e._hwnd);

            if (awin != null)
            {
                string oldName = awin.Title;
                OnWindowNameChanged(sender, new NameChangeEventArgs()
                {
                    HWND = e._hwnd, oldName = oldName, newName = newName
                });
                return;
            }

            CurrentLog.Add(LogEntryType.WindowsEvent, "Object Name Changed: " + newName + "(" + e._hwnd.ToString() + ")");
        }
コード例 #11
0
ファイル: EventManager.cs プロジェクト: AskDrax/FocusMaster
        protected virtual void OnWindowStateChanged(object sender, WindowStateChangedEventArgs e)
        {
            string FromString;
            string ToString;

            uint oldShowState = e.oldPlacement.showCmd;
            uint newShowState = e.newPlacement.showCmd;

            FromString = WindowHelper.ShowCmdToString(oldShowState);
            ToString   = WindowHelper.ShowCmdToString(newShowState);

            if (oldShowState == newShowState)
            {
                CurrentLog.FilterView.Refresh();
                MainWindow.LogPage.ScrollToCurrent();
            }
            else
            {
                CurrentLog.Add(LogEntryType.WindowsEvent, "Window State Changed: " + WindowHelper.GetTitleOfWindow(e.HWND).ToString() + " from " + FromString + " (" + oldShowState.ToString() + ") to " + ToString + " (" + newShowState.ToString() + ")");
            }
        }
コード例 #12
0
ファイル: EventManager.cs プロジェクト: AskDrax/FocusMaster
        protected virtual void OnLeftMouseDown(MouseInput.MSLLHOOKSTRUCT mouseStruct)
        {
            CurrentLog.Add(LogEntryType.None, "Mouse Left-Clicked at: X=" + mouseStruct.pt.x.ToString() + ",Y=" + mouseStruct.pt.y.ToString());

            //OnStateChanged(null, new WinEventProcEventArgs() { _hwnd = currentForegroundHWND});
        }
コード例 #13
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());
        }