GetTaskbarRectangle() 공개 정적인 메소드

Gets the rectangle of the taskbar.
public static GetTaskbarRectangle ( ) : Rectangle
리턴 System.Drawing.Rectangle
예제 #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);
        }
예제 #2
0
 private static bool MouseInTaskbar()
 {
     return(Taskbar.GetTaskbarRectangle().Contains(Cursor.Position));
 }