Esempio n. 1
0
 protected override void OnActivated(EventArgs e)
 {
     if (!activatedOnce)
     {
         activatedOnce = true;
         UIHelpers.TopmostFix(this);
     }
 }
Esempio n. 2
0
        protected override void OnActivated(EventArgs e)
        {
            if (!activatedOnce)
            {
                activatedOnce = true;
                UIHelpers.TopmostFix(this);

                this.KeyUp += OverlayWindow_KeyUp;
            }
        }
Esempio n. 3
0
 private void SystemEvents_DisplaySettingsChanged(object sender, EventArgs e)
 {
     Dispatcher.BeginInvoke(new Action(delegate()
     {
         this.Width           = Util.ScreenBounds.Width;
         this.Height          = Util.ScreenBounds.Height;
         this.baseGrid.Width  = Util.ScreenBounds.Width;
         this.baseGrid.Height = Util.ScreenBounds.Height;
         UIHelpers.TopmostFix(this);
     }));
 }
Esempio n. 4
0
        private void updateWindowToScreen(System.Windows.Forms.Screen screen)
        {
            Console.WriteLine("Setting overlay window position to " + screen.Bounds);
            //this.Left = screen.Bounds.X;
            //this.Top = screen.Bounds.Y;
            PresentationSource source          = PresentationSource.FromVisual(this);
            Matrix             transformMatrix = source.CompositionTarget.TransformToDevice;

            this.Width  = screen.Bounds.Width * transformMatrix.M22;
            this.Height = screen.Bounds.Height * transformMatrix.M11;
            this.scrollViewer.MaxHeight = this.Height - 200;
            UIHelpers.SetWindowPos((new WindowInteropHelper(this)).Handle, IntPtr.Zero, screen.Bounds.X, screen.Bounds.Y, screen.Bounds.Width, screen.Bounds.Height, UIHelpers.SetWindowPosFlags.SWP_NOACTIVATE | UIHelpers.SetWindowPosFlags.SWP_NOZORDER);
            this.baseGrid.Width    = this.Width;
            this.baseGrid.Height   = this.Height;
            this.baseCanvas.Width  = this.Width;
            this.baseCanvas.Height = this.Height;
            UIHelpers.TopmostFix(this);
        }