public static void Check() { if (_cp == null) { _cp = Process.GetCurrentProcess(); } new OtherProgramChecker(_cp.Id).CheckMaximized(out List <Screen> fullscreenWindow); if (maximizedScreens.Count == fullscreenWindow.Count) { return; } maximizedScreens = fullscreenWindow; AppMaximized?.Invoke(null, new AppMaximizedEvent() { MaximizedScreens = maximizedScreens }); }
public static void Check() { if (_cp == null) { _cp = Process.GetCurrentProcess(); } bool isMaximized = new DZY.WinAPI.Helpers.OtherProgramChecker(_cp.Id).CheckMaximized(out IntPtr fullscreenWindow); if (_maximized == isMaximized) { return; } _maximized = isMaximized; Screen maximizedScreen = Screen.FromHandle(fullscreenWindow); AppMaximized?.Invoke(null, new AppMaximizedEvent() { Maximized = _maximized, MaximizedScreen = maximizedScreen }); }