Inheritance: MonoBehaviour
Example #1
0
        public void TaskBarAcquire()
        {
            Taskbar tb = new Taskbar();

            Assert.IsNotNull(tb.Location);
            Console.WriteLine("x:{0} , y:{1}", tb.Location.X, tb.Location.Y);
        }
        private void Shutdown()
        {
            try
            {
                foreach (var task in Tasks)
                {
                    task.process.Kill();
                }
            }
            catch { }

            Taskbar.Show();

            //if (Process.GetProcessesByName("explorer").Length == 0)
            //{
            //    var cmd = new Process();
            //    cmd.StartInfo.CreateNoWindow = true;
            //    cmd.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            //    cmd.StartInfo.FileName = Path.Combine(Environment.GetEnvironmentVariable("windir"), "explorer.exe");
            //    cmd.Start();
            //}


            Process.GetCurrentProcess().Kill();
        }
Example #3
0
 public void SecurityBoard()
 {
     Taskbar.Hide(); // |--> Taskbar Hide for Security
     HideDesktop();  // |--> Desktop Hide for Security
     KillProcess();  // |--> Process Kill Timer Enabled for Hard Security
     MinimizeAll();
 }
        protected override void OpenWindow(AppBarScreen screen)
        {
            Taskbar newTaskbar = new Taskbar(_cairoApplication, _shellManager, _windowManager, _desktopManager, _appGrabber, screen, Settings.Instance.TaskbarPosition == 1 ? AppBarEdge.Top : AppBarEdge.Bottom);

            Windows.Add(newTaskbar);
            newTaskbar.Show();
        }
Example #5
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            Taskbar.Show();
            this.Icon   = Properties.Resources.Projemu;
            cemuWindows = new IntPtr[Process.GetProcessesByName("cemu").Length + 1];

            for (int i = 0; i < screens.Length; i++)
            {
                cbxScreenNum.Items.Add(i + 1);
            }

            cbxScreenNum.SelectedIndex = Properties.Settings.Default.screenNum;

            if (Properties.Settings.Default.appRunBefore == false)
            {
                CreateShortcut("Projemu", Environment.GetFolderPath(Environment.SpecialFolder.Desktop), Application.StartupPath + "\\Projemu.exe", "", Application.StartupPath, Application.StartupPath + "\\Projemu.ico", "Cemu on your projector! Woah!");
                Properties.Settings.Default.appRunBefore = true;
                Properties.Settings.Default.Save();
            }

            Process.Start(Application.StartupPath + "\\Cemu");
            Process.GetProcessesByName("cemu")[0].WaitForInputIdle();
            for (int i = 0; i < Process.GetProcessesByName("cemu").Length; i++)
            {
                cemuWindows[i] = Process.GetProcessesByName("cemu")[i].MainWindowHandle;
            }

            for (int i = 0; i < cemuWindows.Length; i++)
            {
                SetWindowLong(cemuWindows[i], gwlStyle, wsSysMenu);
                SetWindowPos(cemuWindows[i], 0, screens[projectorScreen].Bounds.X, screens[projectorScreen].Bounds.Y, screens[projectorScreen].Bounds.Width, screens[projectorScreen].Bounds.Height, 0x0040);
                DrawMenuBar(cemuWindows[i]);
            }
        }
Example #6
0
        private void SetGeometry()
        {
            var taskbar = new Taskbar();

            Rect desktopWorkingArea = System.Windows.SystemParameters.WorkArea;

            this.Left = desktopWorkingArea.Right - Constants.TrayControlsWidth - 5;
            this.Top  = desktopWorkingArea.Bottom - Constants.TrayControlsHeight - 5;

            if (taskbar.Position == TaskbarPosition.Top)
            {
                this.Left = desktopWorkingArea.Right - Constants.TrayControlsWidth - 5;
                this.Top  = desktopWorkingArea.Top + 5;
            }
            else if (taskbar.Position == TaskbarPosition.Left)
            {
                this.Left = desktopWorkingArea.Left + 5;
                this.Top  = desktopWorkingArea.Bottom - Constants.TrayControlsHeight - 5;
            }
            else if (taskbar.Position == TaskbarPosition.Right)
            {
                this.Left = desktopWorkingArea.Right - Constants.TrayControlsWidth - 5;
                this.Top  = desktopWorkingArea.Bottom - Constants.TrayControlsHeight - 5;
            }
            else
            {
                this.Left = desktopWorkingArea.Right - Constants.TrayControlsWidth - 5;
                this.Top  = desktopWorkingArea.Bottom - Constants.TrayControlsHeight - 5;
            }

            LogClient.Info("Tray controls position: Taskbar position = {0}, Left = {1}px, Top = {2}px", taskbar.Position.ToString(), this.Left.ToString(), this.Top.ToString());
        }
Example #7
0
        public void GetTaskbarInfo()
        {
            WinForms.NotifyIcon icon = new WinForms.NotifyIcon();

            Taskbar bar   = new Taskbar();
            Point   point = bar.GetTangentPosition(icon);
        }
Example #8
0
        /// <summary>
        /// Load a picture from a prepared bitmap
        /// </summary>
        /// <param name="pic"></param>
        /// <param name="imageName"></param>
        internal static void Pic(BitmapSource bitmap, string imageName)
        {
            /// Old method, might need updates?

            Unload();

            if (IsScrollEnabled)
            {
                LoadWindows.GetMainWindow.Scroller.ScrollToTop();
            }

            LoadWindows.GetMainWindow.MainImage.Source = bitmap;

            FitImage(bitmap.PixelWidth, bitmap.PixelHeight);
            CloseToolTipMessage();

            SetTitleString(bitmap.PixelWidth, bitmap.PixelHeight, imageName);

            Taskbar.NoProgress();

            CanNavigate = false;
            FolderIndex = 0;

            if (LoadWindows.GetImageInfoWindow != null)
            {
                if (LoadWindows.GetImageInfoWindow.IsVisible)
                {
                    LoadWindows.GetImageInfoWindow.UpdateValues();
                }
            }
        }
Example #9
0
        /// <summary>
        /// Load a picture from a base64
        /// </summary>
        /// <param name="pic"></param>
        /// <param name="imageName"></param>
        internal static async void Pic64(string base64string)
        {
            var pic = await Base64.Base64StringToBitmap(base64string).ConfigureAwait(false);

            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)(() =>
            {
                Unload();

                if (IsScrollEnabled)
                {
                    ConfigureWindows.GetMainWindow.Scroller.ScrollToTop();
                }

                ConfigureWindows.GetMainWindow.MainImage.Source = pic;

                FitImage(pic.PixelWidth, pic.PixelHeight);
                CloseToolTipMessage();

                SetTitleString(pic.PixelWidth, pic.PixelHeight, Application.Current.Resources["Base64Image"] as string);

                if (ConfigureWindows.GetImageInfoWindow != null)
                {
                    if (ConfigureWindows.GetImageInfoWindow.IsVisible)
                    {
                        ConfigureWindows.GetImageInfoWindow.UpdateValues();
                    }
                }
            }));

            Taskbar.NoProgress();

            CanNavigate = false;
        }
Example #10
0
 /// <summary>
 /// Sets the progress state of the specified window's
 /// taskbar button.
 /// </summary>
 /// <param name="hwnd">The window handle.</param>
 /// <param name="state">The progress state.</param>
 public static void SetProgressState(IntPtr hwnd, ProgressState state)
 {
     if (Windows7OrGreater)
     {
         Taskbar.SetProgressState(hwnd, state);
     }
 }
Example #11
0
        /// <summary>
        /// Load a picture from a base64
        /// </summary>
        /// <param name="pic"></param>
        /// <param name="imageName"></param>
        internal static async void Pic64(string base64string)
        {
            var pic = await Base64.Base64StringToBitmap(base64string).ConfigureAwait(true);

            Unload();

            if (IsScrollEnabled)
            {
                LoadWindows.GetMainWindow.Scroller.ScrollToTop();
            }

            LoadWindows.GetMainWindow.MainImage.Source = pic;

            FitImage(pic.PixelWidth, pic.PixelHeight);
            CloseToolTipMessage();

            SetTitleString(pic.PixelWidth, pic.PixelHeight, Application.Current.Resources["Base64Image"] as string);

            Taskbar.NoProgress();

            CanNavigate = false;

            if (LoadWindows.GetImageInfoWindow != null)
            {
                if (LoadWindows.GetImageInfoWindow.IsVisible)
                {
                    LoadWindows.GetImageInfoWindow.UpdateValues();
                }
            }
        }
        private static Rectangle GetWorkAreaWithTabTipClosed(DependencyObject element)
        {
            Rectangle currentScreenBounds = GetCurrentScreenBounds(element);
            Taskbar   taskbar             = new Taskbar();
            Rectangle taskbarBounds       = taskbar.Bounds.ToRectangleInLogicalUnits(element);

            switch (taskbar.Position)
            {
            case TaskbarPosition.Bottom:
                return(Rectangle.FromLTRB(
                           left: currentScreenBounds.Left,
                           top: currentScreenBounds.Top,
                           right: currentScreenBounds.Right,
                           bottom: taskbarBounds.Top));

            case TaskbarPosition.Top:
                return(Rectangle.FromLTRB(
                           left: currentScreenBounds.Left,
                           top: taskbarBounds.Bottom,
                           right: currentScreenBounds.Right,
                           bottom: currentScreenBounds.Bottom));

            default:
                return(currentScreenBounds);
            }
        }
Example #13
0
 static public void HideTaskbar()
 {
     SetTaskbarState(AppBarStates.AutoHide);
     Taskbar.Hide();
     System.Threading.Thread.Sleep(100);
     Taskbar.Hide();
 }
 private void frmGame_Load(object sender, EventArgs e)
 {
     Taskbar.Hide();
     loadBullets();
     gameInSession = true;
     song.PlayLooping();
 }
        public TeacherController(Timer timer, InputFilter inputFilter, InputBox inputBox, OutputBox outputBox1, OutputBox outputBox2, Taskbar taskbar,
                                 Input input, TeacherView teacherView, TaskbarController taskbarController, OutputBoxController outputBoxController1,
                                 OutputBoxController outputBoxController2, InputBoxController inputBoxController, BorderController borderController, User user, QueryCreator queryCreator, TeacherDBController teacherDBController)
        {
            this.timer        = timer;
            this.inputFilter  = inputFilter;
            this.queryCreator = queryCreator;

            this.inputBox   = inputBox;
            this.outputBox1 = outputBox1;
            this.outputBox2 = outputBox2;
            this.taskbar    = taskbar;
            this.input      = input;

            this.taskbarController    = taskbarController;
            this.outputBoxController1 = outputBoxController1;
            this.outputBoxController2 = outputBoxController2;
            this.inputBoxController   = inputBoxController;
            this.borderController     = borderController;
            this.teacherDBController  = teacherDBController;

            this.teacherView = teacherView;
            this.teacher     = new Teacher(user.Password, user.Username, user.LetterID,
                                           user.FirstName, user.LastName, user.FieldID, user.Subject);

            timer.Tick += KeyActive;
            timer.Tick += this.borderController.BordarChange;
        }
Example #16
0
        public static IntPtr GetAppIcon(Window wnd, int index)
        {
            IntPtr hwnd       = wnd.Handle;
            IntPtr iconHandle = IntPtr.Zero;

            if (index == 0)
            {
                iconHandle = User32.SendMessage(hwnd, User32.WM_GETICON, User32.ICON_SMALL2, 0);
            }
            if (index == 1)
            {
                iconHandle = User32.SendMessage(hwnd, User32.WM_GETICON, User32.ICON_SMALL, 0);
            }
            if (index == 2)
            {
                iconHandle = User32.SendMessage(hwnd, User32.WM_GETICON, User32.ICON_BIG, 0);
            }
            if (index == 3)
            {
                iconHandle = Taskbar.GetClassLongPtr(hwnd, User32.GCL_HICONSM);
            }
            if (index == 4)
            {
                iconHandle = Taskbar.GetClassLongPtr(hwnd, User32.GCL_HICON);
            }
            return(iconHandle);
        }
Example #17
0
        private void BreakTimer_Tick(object sender, EventArgs e)
        {
            if (minutesLeft <= 0 && secondsLeft <= 0)
            {
                BreakTimer.Stop();

                PreFocusPage preFocus = new PreFocusPage();
                preFocus.Show();
                preFocus.SetDesktopLocation(this.Bounds.X, this.Bounds.Y);
                preFocus.Activate();

                if (hideTaskbar)
                {
                    Taskbar.Hide();
                }
                this.Hide();
            }

            if (minutesLeft != 0 && secondsLeft == 0)
            {
                minutesLeft--;
                secondsLeft = 59;
            }
            else
            {
                secondsLeft--;
            }

            BreakTimerLabel.Text = minutesLeft + ":" + secondsLeft.ToString().PadLeft(2, '0');
        }
Example #18
0
        private void BreakPage_Load(object sender, EventArgs e)
        {
            Taskbar.Show();

            BreakTimerLabel.Text = minutesLeft + ":" + secondsLeft.ToString().PadLeft(2, '0');
            BreakTimer.Start();
        }
Example #19
0
        private void processAddedScreens(List <string> addedScreens, bool firstRun)
        {
            foreach (var screen in ScreenState)
            {
                // if firstRun, that means this is initial startup and primary display windows have already opened, so skip them. addedScreens will
                if ((firstRun && !screen.Primary) || addedScreens.Contains(screen.DeviceName))
                {
                    CairoLogger.Instance.DebugIf(Settings.Instance.EnableMenuBarMultiMon || Settings.Instance.EnableTaskbarMultiMon, "WindowManager: Opening windows on screen " + screen.DeviceName);

                    if (Settings.Instance.EnableMenuBarMultiMon)
                    {
                        CairoLogger.Instance.DebugIf(screen.Primary, "WindowManager: Opening menu bar on new primary display");

                        // menu bars
                        MenuBar newMenuBar = new MenuBar(screen);
                        newMenuBar.Show();
                        MenuBarWindows.Add(newMenuBar);
                    }

                    if (Settings.Instance.EnableTaskbarMultiMon && Settings.Instance.EnableTaskbar)
                    {
                        CairoLogger.Instance.DebugIf(screen.Primary, "WindowManager: Opening taskbar on new primary display");

                        // taskbars
                        Taskbar newTaskbar = new Taskbar(screen);
                        newTaskbar.Show();
                        TaskbarWindows.Add(newTaskbar);
                    }
                }
            }
        }
Example #20
0
        void Place_EndOfTaskbar(Rectangle taskbarRect)
        {
            // TODO: Implement Secondary Taskbar
            if (!Taskbar.IsPrimary)
            {
                Place_RightOfTaskButtons(taskbarRect);
                return;
            }

            IntPtr btnsHwnd = TaskbarUtils.GetPrimaryTaskButtonsHwnd(Taskbar.Handle);
            IntPtr trayHwnd = TaskbarUtils.GetPrimaryTaskTrayNotifyHwnd(Taskbar.Handle);

            int w = TargetSize.Width;

            // shrink the task bar buttons area
            if (NativeImports.GetWindowRect(btnsHwnd, out NativeImports.RECT btnsRect))
            {
                NativeImports.SetWindowPos(btnsHwnd, IntPtr.Zero, 0, 0, (btnsRect.Right - btnsRect.Left) - w, btnsRect.Bottom - btnsRect.Top, NativeImports.SetWindowPosFlags.SWP_NOMOVE | NativeImports.SetWindowPosFlags.SWP_NOREPOSITION);
            }

            // enlarge and move the tray area to the left
            if (NativeImports.GetWindowRect(trayHwnd, out NativeImports.RECT trayRect))
            {
                Rectangle clientRect = new Rectangle(trayRect.Left - taskbarRect.X, trayRect.Top - taskbarRect.Top, trayRect.Right - trayRect.Left, trayRect.Bottom - trayRect.Top);
                NativeImports.SetWindowPos(trayHwnd, IntPtr.Zero, clientRect.Left - w, clientRect.Top, clientRect.Width + w, clientRect.Height, NativeImports.SetWindowPosFlags.SWP_NOREPOSITION);

                ActualSize = new Size(TargetSize.Width, taskbarRect.Height);
                NativeImports.SetWindowLong(Handle, NativeImports.GWL_STYLE, NativeImports.GetWindowLong(Handle, NativeImports.GWL_STYLE) | NativeImports.WS_CHILD);
                NativeImports.SetParent(Handle, trayHwnd);
                NativeImports.SetWindowPos(Handle, IntPtr.Zero, clientRect.Width, 0, ActualSize.Width, ActualSize.Height, NativeImports.SetWindowPosFlags.SWP_NOREPOSITION);
            }

            // Listen for changes of the tray area
            Taskbar.RegisterObservableChild(trayHwnd);
        }
Example #21
0
        private void ProcessRemovedScreens(List <string> removedScreens)
        {
            foreach (string name in removedScreens)
            {
                CairoLogger.Instance.DebugIf(Settings.Instance.EnableMenuBarMultiMon || Settings.Instance.EnableTaskbarMultiMon, "WindowManager: Removing windows associated with screen " + name);

                if (Settings.Instance.EnableTaskbarMultiMon && Settings.Instance.EnableTaskbar)
                {
                    // close TaskBars
                    Taskbar taskbarToClose = null;
                    foreach (Taskbar bar in TaskbarWindows)
                    {
                        if (bar.Screen != null && bar.Screen.DeviceName == name)
                        {
                            CairoLogger.Instance.DebugIf(bar.Screen.Primary, "WindowManager: Closing TaskBar on primary display");

                            taskbarToClose = bar;
                            break;
                        }
                    }

                    if (taskbarToClose != null)
                    {
                        if (!taskbarToClose.IsClosing)
                        {
                            taskbarToClose.Close();
                        }

                        TaskbarWindows.Remove(taskbarToClose);
                    }
                }

                if (Settings.Instance.EnableMenuBarMultiMon)
                {
                    // close menu bars
                    MenuBar barToClose = null;
                    foreach (MenuBar bar in MenuBarWindows)
                    {
                        if (bar.Screen != null && bar.Screen.DeviceName == name)
                        {
                            CairoLogger.Instance.DebugIf(bar.Screen.Primary, "WindowManager: Closing menu bar on primary display");

                            barToClose = bar;
                            break;
                        }
                    }

                    if (barToClose != null)
                    {
                        if (!barToClose.IsClosing)
                        {
                            barToClose.Close();
                        }

                        MenuBarWindows.Remove(barToClose);
                    }
                }
            }
        }
Example #22
0
    static void Main(string[] args)
    {
        Taskbar taskbar = new Taskbar();

        Console.WriteLine("Position: {0}, AlwaysOnTop: {1}; AutoHide: {2}; Bounds: {3}", taskbar.Position, taskbar.AlwaysOnTop, taskbar.AutoHide, taskbar.Bounds);

        Console.ReadLine();
    }
Example #23
0
        }                                                                                                                                                                                                                                                                                         // Login Successfully --> Disabled Basic Security

        public void LoginSuccess()
        {
            Taskbar.Show(); // |--> Taskbar Show --> Disabled Basic Security
            ShowDesktop();  // |--> Desktop Show --> Disabled Basic Security
            this.Hide();
            btn_lock.Enabled = true;
            NotifyMessage("Giriş Başarılı", "İyi Dersler", 1000);
        }
 public void onExitApp(object sender, EventArgs e)
 {
     App.Current.Dispatcher.Invoke((Action)(() =>
     {
         Taskbar.HideTask(false);
         System.Environment.Exit(0);
     }));
 }
Example #25
0
        private async Task SetupTaskbar()
        {
            taskbar = TaskBarFactory.GetTaskbar();
            process = await taskbar.AddToTaskbar();

            Size      = new Size(452, 30);
            var(X, Y) = ConfigUtils.StringToPosition(Config.Get(ConfigKeys.BarPosition));
            process.SetPosition(X, Y);
        }
 public TeacherView(Timer timer, Taskbar taskbar, InputBox inputBox,
                    OutputBox outputBox1, OutputBox outputBox2)
     : base(timer)
 {
     Taskbar    = taskbar;
     InputBox   = inputBox;
     OutputBox1 = outputBox1;
     OutputBox2 = outputBox2;
 }
Example #27
0
 private void Window_Closing(object sender, CancelEventArgs e)
 {
     foreach (var taskBarElement in Elements)
     {
         taskBarElement.Close();
     }
     Taskbar.Show();
     Environment.Exit(0);
 }
Example #28
0
 public void UnlockScreen()
 {
     if (TopMost)
     {
         TopMost = false;
         SendKeys.SendWait("%{Tab}");
         Taskbar.AdjustSizeAgainstTaskBar(this);
     }
 }
Example #29
0
        private void openTaskbar(AppBarScreen screen)
        {
            ShellLogger.Debug($"WindowManager: Opening taskbar on screen {screen.DeviceName}");
            Taskbar taskbar = new Taskbar(this, _shellManager, _startMenuMonitor, _updater, screen, (AppBarEdge)Settings.Instance.Edge);

            taskbar.Show();

            _taskbars.Add(taskbar);
        }
Example #30
0
        protected override void OnActivated(EventArgs e)
        {
            if (!isInitialized)
            {
                controlContainer.Theme        = Theme;
                controlContainer.Style        = Style;
                controlContainer.StyleManager = StyleManager;

                MaximizeBox = false;
                MinimizeBox = false;
                Movable     = false;

                TopMost         = true;
                FormBorderStyle = FormBorderStyle.FixedDialog;

                Size = new Size(400, 200);

                Taskbar myTaskbar = new Taskbar();
                switch (myTaskbar.Position)
                {
                case TaskbarPosition.Left:
                    Location = new Point(myTaskbar.Bounds.Width + 5, myTaskbar.Bounds.Height - Height - 5);
                    break;

                case TaskbarPosition.Top:
                    Location = new Point(myTaskbar.Bounds.Width - Width - 5, myTaskbar.Bounds.Height + 5);
                    break;

                case TaskbarPosition.Right:
                    Location = new Point(myTaskbar.Bounds.X - Width - 5, myTaskbar.Bounds.Height - Height - 5);
                    break;

                case TaskbarPosition.Bottom:
                    Location = new Point(myTaskbar.Bounds.Width - Width - 5, myTaskbar.Bounds.Y - Height - 5);
                    break;

                case TaskbarPosition.Unknown:
                default:
                    Location = new Point(Screen.PrimaryScreen.Bounds.Width - Width - 5, Screen.PrimaryScreen.Bounds.Height - Height - 5);
                    break;
                }

                controlContainer.Location = new Point(0, 60);
                controlContainer.Size     = new Size(Width - 40, Height - 80);
                controlContainer.Anchor   = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left;

                StyleManager.UpdateOwnerForm();

                isInitialized = true;

                MoveAnimation myMoveAnim = new MoveAnimation();
                myMoveAnim.Start(controlContainer, new Point(20, 60), TransitionType.EaseInOutCubic, 15);
            }

            base.OnActivated(e);
        }
Example #31
0
 public void Start()
 {
     if (this.taskbarText == null) {
         this.taskbarText = this.GetComponentInChildren<Text>();
         if (this.taskbarText == null) {
             Debug.LogError("Cannot find Text UI component.");
         }
     }
     Taskbar.Instance = this;
     this.ShowTaskbar(false);
 }
Example #32
0
            /// <summary>
            /// Gets the width of the window.
            /// </summary>
            /// <returns></returns>
            public static double GetWindowWidth()
            {
                var with = SystemParameters.PrimaryScreenWidth;

                var bar = new Taskbar();
                if (bar.Position == TaskbarPosition.Left || bar.Position == TaskbarPosition.Right)
                    return with - bar.Size[0];

                return with;
            }
Example #33
0
            /// <summary>
            /// Gets the window top postition.
            /// </summary>
            /// <returns></returns>
            public static double GetWindowTopPostition()
            {
                double pos = 0;

                var bar = new Taskbar();
                if (bar.Position == TaskbarPosition.Top)
                    pos += bar.Size[1];

                return pos;
            }
Example #34
0
            /// <summary>
            /// Gets the window left postition.
            /// </summary>
            /// <returns></returns>
            public static double GetWindowLeftPostition()
            {
                double pos = 0;

                var bar = new Taskbar();
                if (bar.Position == TaskbarPosition.Left)
                    pos += bar.Size[0];

                return pos;
            }
Example #35
0
            /// <summary>
            /// Gets the height of the window.
            /// </summary>
            /// <returns></returns>
            public static double GetWindowHeight()
            {
                var height = SystemParameters.PrimaryScreenHeight;

                var bar = new Taskbar();
                if (bar.Position == TaskbarPosition.Top || bar.Position == TaskbarPosition.Bottom)
                    return height - bar.Size[1];

                return height;
            }