protected void AttachWindowEventCallback(IntPtr hWinEventHook, WinEventHook.SWEH_Events eventType, IntPtr hWnd, WinEventHook.SWEH_ObjectId idObject, long idChild, uint dwEventThread, uint dwmsEventTime) { if (hWnd == _gameMemory.Process.WindowHandle && eventType == WinEventHook.SWEH_Events.EVENT_OBJECT_LOCATIONCHANGE && idObject == WinEventHook.SWEH_ObjectId.OBJID_WINDOW) { UpdateAttachWindowPosition(); } }
protected void MoveGameWindowEventCallback(IntPtr hWinEventHook, WinEventHook.SWEH_Events eventType, IntPtr hWnd, WinEventHook.SWEH_ObjectId idObject, long idChild, uint dwEventThread, uint dwmsEventTime) { if (hWnd == _gameMemory.Process.WindowHandle && eventType == WinEventHook.SWEH_Events.EVENT_OBJECT_LOCATIONCHANGE && idObject == WinEventHook.SWEH_ObjectId.OBJID_WINDOW) { _window?.FitTo(_gameMemory.Process.WindowHandle, true); } }
public static extern IntPtr SetWinEventHook(WinEventHook.SWEH_Events eventMin, WinEventHook.SWEH_Events eventMax, IntPtr hmodWinEventProc, WinEventHook.WinEventDelegate lpfnWinEventProc, uint idProcess, uint idThread, WinEventHook.SWEH_dwFlags dwFlags);