コード例 #1
0
 private void NotifyIconOnMouseDoubleClick(object s, MouseEventArgs e)
 {
     UserSettings.AutoModeType = AutoModeType.None;
     Fun.ChangeAutoHide();
     HideBar();
     Hooker.ReleaseHook();
 }
コード例 #2
0
 private void AutoModeOnClick(object s, EventArgs e)
 {
     if (_autoMode.Checked)
     {
         UserSettings.AutoModeType = AutoModeType.None;
         HideBar();
         Hooker.ReleaseHook();
     }
     else
     {
         UserSettings.AutoModeType = AutoModeType.Auto;
     }
 }
コード例 #3
0
 private void ExitOnClick(object s, EventArgs e)
 {
     if (UserSettings.ShowTaskbarWhenExit)
     {
         Fun.CancelAutoHide();
     }
     else
     {
         HideBar();
     }
     _container.Dispose();
     Hooker.ReleaseHook();
     Application.Exit();
 }
コード例 #4
0
        private static void Timer_Tick(object sender, EventArgs e)
        {
            if (UserSettings.AutoModeType != AutoModeType.Auto)
            {
                return;
            }

            // get taskbar every 1.25 second.
            if (_timerCount % 5 == 0)
            {
                // Make sure the taskbar has been automatically hidden, otherwise it will not work
                Fun.SetAutoHide();

                _taskbar = TaskbarHelper.InitTaskbar();

                // Some users will kill the explorer.exe under certain situation.
                // In this case, the taskbar cannot be found, just return and wait for the user to reopen the file explorer.
                if (_taskbar.Handle == IntPtr.Zero)
                {
                    Hooker.ReleaseHook();
                    return;
                }

                Hooker.SetHook(_taskbar.Handle);
            }

            switch (_taskbar.CheckIfMouseOver(NonMouseOverShowHandleSet))
            {
            case TaskbarBehavior.DoNothing:
                break;

            case TaskbarBehavior.Pending:
                if (UserSettings.ReduceTaskbarDisplay)
                {
                    CheckCurrentWindowReduceShowBar();
                }
                else
                {
                    CheckCurrentWindow();
                }

                break;

            case TaskbarBehavior.Show:
                    #if DEBUG
                Debug.WriteLine("Show the tasbkar because of Mouse Over.");
                    #endif

                _taskbar.ShowTaskar();
                break;
            }

            ++_timerCount;

            // clear cache and reset stable every 15 min.
            if (_timerCount <= 7200)
            {
                return;
            }

            _timerCount = 0;

            DesktopHandleSet.Clear();
            NonMouseOverShowHandleSet.Clear();
            NonDesktopShowHandleSet.Clear();
            NonForegroundShowHandleSet.Clear();
            Hooker.ResetHook();
        }