Zhwang.SuperNotifyIcon.Taskbar.GetTaskbarState C# (CSharp) Method

GetTaskbarState() public static method

Gets the current state of the taskbar.
public static GetTaskbarState ( ) : TaskbarState
return TaskbarState
        public static TaskbarState GetTaskbarState()
        {
            var appBar = CreateAppBarData();
            return (TaskbarState)NativeMethods.SHAppBarMessage(NativeMethods.ABMsg.ABM_GETSTATE, ref appBar);
        }

Usage Example

Ejemplo n.º 1
0
        private void MouseHook_MouseMove(object sender, MouseEventArgs e)
        {
            if (mouseLeftDown && !OwnApplicationActive())
            {
                // Of course we have to be visible!
                if (Visible)
                {
                    // Don't get the form on top until we're close to it
                    if (Math.Sqrt(Math.Pow(Location.X + Size.Width / 2 - Cursor.Position.X, 2)
                                  + Math.Pow(Location.Y + Size.Height / 2 - Cursor.Position.Y, 2)) <= 48)
                    {
                        TopMost = true;
                    }
                    else
                    {
                        TopMost = false;
                    }
                }

                // Autohide stuff
                if (Taskbar.GetTaskbarState() == Taskbar.TaskbarState.AutoHide)
                {
                    bool mouseInTaskbar = MouseInTaskbar();
                    if (mouseDownAndWasInTaskbar != mouseInTaskbar)
                    {
                        mouseDownAndWasInTaskbar = mouseInTaskbar;
                        ShowDrop();
                    }
                }
            }
            else
            {
                mouseDownAndWasInTaskbar = false;
            }
        }
All Usage Examples Of Zhwang.SuperNotifyIcon.Taskbar::GetTaskbarState