Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 public static bool DoesMonitorHaveFullscreenApp(Rect bounds, Win32App ignoreApp)
 => DoesMonitorHaveFullscreenApp(ScreenHelper.GetScreen(bounds), ignoreApp);
Ejemplo n.º 3
0
        private static bool DoesMonitorHaveFullscreenApp(Screen screen, Win32App ignoreApp)
        {
            var foregroundApp = Win32Helper.GetForegroundApp();

            return(foregroundApp.Hwnd != ignoreApp?.Hwnd && foregroundApp.IsFullScreen(screen));
        }