/// <summary> /// Проверка активного окна процесса /// </summary> /// <param name="ProcessName">Имя процесса</param> /// <returns></returns> public static BOOLEAN IsProcessActiveWindow(string ProcessName) => (GetProcess(ProcessName)?.MainWindowHandle ?? IntPtr.Zero) == UserAPI.GetForegroundWindow() ? true : false;
/// <summary> /// Проверка активного окна /// </summary> /// <param name="ProcessName">Имя процесса</param> /// <returns></returns> public static bool IsActiveWindow(string ProcessName) => Process.GetProcessesByName(ProcessName)[0].MainWindowHandle == UserAPI.GetForegroundWindow() ? true : false;
/// <summary> /// Проверка активного окна процесса /// </summary> /// <param name="ProcessName">Имя процесса</param> /// <returns></returns> public BOOLEAN IsProcessActiveWindow() => ProcessWindowHandle == UserAPI.GetForegroundWindow() ? true : false;