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()); }
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()); }
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() + ")"); }
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() + ")"); } }
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() + ")"); } }
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()); }
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() + ")"); }
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()); } }
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() + ")"); }
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() + ")"); }
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() + ")"); } }
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}); }
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()); }