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

GetTaskbarRectangle() public static method

Gets the rectangle of the taskbar.
public static GetTaskbarRectangle ( ) : Rectangle
return System.Drawing.Rectangle
        public static Rectangle GetTaskbarRectangle()
        {
            var appBar = GetTaskBarData();
            return appBar.rc;
        }

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        /// Determines whether the specified System.Drawing.Rectangle is contained within the Windows 7 notification area fly-out.
        /// Note that this function will return false if the fly-out is closed, or if run on older versions of Windows.
        /// </summary>
        /// <param name="point">System.Drawing.Rectangle to test.</param>
        /// <returns>True if the notify icon is in the fly-out, false if not.</returns>
        public static bool IsRectangleInFlyOut(Rectangle rectangle)
        {
            if (!SysInfo.IsWindows7OrLater)
            {
                return(false);
            }

            Rectangle taskbarRect = Taskbar.GetTaskbarRectangle();

            // Don't use Rectangle.IntersectsWith since we want to check if it's ENTIRELY inside
            return(rectangle.Left > taskbarRect.Right || rectangle.Right < taskbarRect.Left ||
                   rectangle.Bottom < taskbarRect.Top || rectangle.Top > taskbarRect.Bottom);
        }
All Usage Examples Of Zhwang.SuperNotifyIcon.Taskbar::GetTaskbarRectangle