public static void WinEventProc(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime) { string activeWindowTitle = GetActiveWindowTitle(); WindowActivatedEventArgs windowActivatedEventArgs = new WindowActivatedEventArgs(activeWindowTitle, hwnd); windowActivatedHandler.Invoke(null, windowActivatedEventArgs); }
static void HookManager_WindowActivated(object sender, WindowActivatedEventArgs e) { StepDiagram.AddTaskActive(e.WindowName, e.Handle); }