protected override void OnSourceInitialized(EventArgs e) { base.OnSourceInitialized(e); if (!HasLoaded) { return; } var hwnd = new WindowInteropHelper(this).Handle; var widgetSrc = HwndSource.FromHwnd(hwnd); widgetSrc?.AddHook(WndProc); ThisApp = new Win32App(hwnd); if (Settings.Unclickable) { ThisApp.SetWindowExTransparent(); } UpdateUi(false); ViewModel.OnUiLoad(); HasSourceLoaded = true; }
public static bool DoesMonitorHaveFullscreenApp(Rect bounds, Win32App ignoreApp) => DoesMonitorHaveFullscreenApp(ScreenHelper.GetScreen(bounds), ignoreApp);
private static bool DoesMonitorHaveFullscreenApp(Screen screen, Win32App ignoreApp) { var foregroundApp = Win32Helper.GetForegroundApp(); return(foregroundApp.Hwnd != ignoreApp?.Hwnd && foregroundApp.IsFullScreen(screen)); }