C# Класс BrightnessTray.WindowPositioning

Helper class for positioning the main window.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
GetCursorPosition ( ) : Point

Returns the cursor's current position as a System.Windows.Point.

GetNotifyAreaButtonRectangle ( ) : Rect?

Retrieves the rectangle of the 'Show Hidden Icons' button, or null if it can't be found.

GetNotifyIconRectLegacy ( System.Windows.Forms.NotifyIcon notifyicon ) : Rect?

Returns a rectangle representing the location of the specified NotifyIcon. (Windows Vista and earlier.)

GetNotifyIconRectWindows7 ( System.Windows.Forms.NotifyIcon notifyicon ) : Rect?

Returns a rectangle representing the location of the specified NotifyIcon. (Windows 7+.)

GetNotifyIconRectangle ( System.Windows.Forms.NotifyIcon notifyicon ) : Rect?

Returns a Rect containing the location of the specified notify icon.

GetTaskBarInfo ( ) : TaskBarInfo

Retrieves taskbar position and alignment.

GetWindowClientAreaSize ( IntPtr hWnd ) : Rect

Returns a Rect containing the bounds of the specified window's client area (i.e. area excluding border).

GetWindowPosition ( System.Windows.Forms.NotifyIcon notifyicon, double windowwidth, double windowheight, double dpi ) : Point

Returns the optimum window position in relation to the specified notify icon.

GetWindowSize ( IntPtr hWnd ) : Rect

Returns a Rect containing the bounds of the specified window's area (i.e. area excluding border).

GetWorkingArea ( Rect rectangle ) : Rect

Returns the working area of the monitor that intersects most with the specified rectangle. If no monitor can be found, the closest monitor to the rectangle is returned.

IsCursorOverNotifyIcon ( System.Windows.Forms.NotifyIcon notifyicon ) : bool

Returns true if the cursor is currently over the specified notify icon.

IsNotifyIconInFlyOut ( System.Windows.Forms.NotifyIcon notifyicon, TaskBarInfo taskbarinfo ) : bool

Determines whether the specified System.Windows.Forms.NotifyIcon is contained within the Windows 7 notification area fly-out. Note that this function will return false if the fly-out is closed.

IsNotifyIconInFlyOut ( Rect notifyiconrect, Rect taskbarrect ) : bool

Determines whether the specified System.Windows.Forms.NotifyIcon is contained within the Windows 7 notification area fly-out. Note that this function will return false if the fly-out is closed.

IsPointInNotifyIcon ( Point point, System.Windows.Forms.NotifyIcon notifyicon ) : bool

Checks whether a point is within the bounds of the specified notify icon.

Описание методов

GetCursorPosition() публичный статический Метод

Returns the cursor's current position as a System.Windows.Point.
public static GetCursorPosition ( ) : Point
Результат Point

GetNotifyAreaButtonRectangle() публичный статический Метод

Retrieves the rectangle of the 'Show Hidden Icons' button, or null if it can't be found.
public static GetNotifyAreaButtonRectangle ( ) : Rect?
Результат Rect?

GetNotifyIconRectLegacy() публичный статический Метод

Returns a rectangle representing the location of the specified NotifyIcon. (Windows Vista and earlier.)
public static GetNotifyIconRectLegacy ( System.Windows.Forms.NotifyIcon notifyicon ) : Rect?
notifyicon System.Windows.Forms.NotifyIcon The NotifyIcon whose location should be returned.
Результат Rect?

GetNotifyIconRectWindows7() публичный статический Метод

Returns a rectangle representing the location of the specified NotifyIcon. (Windows 7+.)
public static GetNotifyIconRectWindows7 ( System.Windows.Forms.NotifyIcon notifyicon ) : Rect?
notifyicon System.Windows.Forms.NotifyIcon The NotifyIcon whose location should be returned.
Результат Rect?

GetNotifyIconRectangle() публичный статический Метод

Returns a Rect containing the location of the specified notify icon.
public static GetNotifyIconRectangle ( System.Windows.Forms.NotifyIcon notifyicon ) : Rect?
notifyicon System.Windows.Forms.NotifyIcon The NotifyIcon whose location should be retrieved.
Результат Rect?

GetTaskBarInfo() публичный статический Метод

Retrieves taskbar position and alignment.
public static GetTaskBarInfo ( ) : TaskBarInfo
Результат TaskBarInfo

GetWindowClientAreaSize() публичный статический Метод

Returns a Rect containing the bounds of the specified window's client area (i.e. area excluding border).
public static GetWindowClientAreaSize ( IntPtr hWnd ) : Rect
hWnd System.IntPtr Handle of the window.
Результат System.Windows.Rect

GetWindowPosition() публичный статический Метод

Returns the optimum window position in relation to the specified notify icon.
public static GetWindowPosition ( System.Windows.Forms.NotifyIcon notifyicon, double windowwidth, double windowheight, double dpi ) : Point
notifyicon System.Windows.Forms.NotifyIcon The notify icon that the window should be aligned to.
windowwidth double The width of the window.
windowheight double The height of the window.
dpi double The system's DPI (in relative units: 1.0 = 96 DPI, 1.25 = 120 DPI, etc.).
Результат Point

GetWindowSize() публичный статический Метод

Returns a Rect containing the bounds of the specified window's area (i.e. area excluding border).
public static GetWindowSize ( IntPtr hWnd ) : Rect
hWnd System.IntPtr Handle of the window.
Результат System.Windows.Rect

GetWorkingArea() публичный статический Метод

Returns the working area of the monitor that intersects most with the specified rectangle. If no monitor can be found, the closest monitor to the rectangle is returned.
public static GetWorkingArea ( Rect rectangle ) : Rect
rectangle System.Windows.Rect The rectangle that is located on the monitor whose working area should be returned.
Результат System.Windows.Rect

IsCursorOverNotifyIcon() публичный статический Метод

Returns true if the cursor is currently over the specified notify icon.
public static IsCursorOverNotifyIcon ( System.Windows.Forms.NotifyIcon notifyicon ) : bool
notifyicon System.Windows.Forms.NotifyIcon The notify icon to test.
Результат bool

IsNotifyIconInFlyOut() публичный статический Метод

Determines whether the specified System.Windows.Forms.NotifyIcon is contained within the Windows 7 notification area fly-out. Note that this function will return false if the fly-out is closed.
public static IsNotifyIconInFlyOut ( System.Windows.Forms.NotifyIcon notifyicon, TaskBarInfo taskbarinfo ) : bool
notifyicon System.Windows.Forms.NotifyIcon Notify icon to test.
taskbarinfo TaskBarInfo Taskbar information structure containing taskbar alignment (bottom/top/left/right).
Результат bool

IsNotifyIconInFlyOut() публичный статический Метод

Determines whether the specified System.Windows.Forms.NotifyIcon is contained within the Windows 7 notification area fly-out. Note that this function will return false if the fly-out is closed.
public static IsNotifyIconInFlyOut ( Rect notifyiconrect, Rect taskbarrect ) : bool
notifyiconrect System.Windows.Rect Rectangle of notify icon bounds.
taskbarrect System.Windows.Rect Rectangle of taskbar bounds.
Результат bool

IsPointInNotifyIcon() публичный статический Метод

Checks whether a point is within the bounds of the specified notify icon.
public static IsPointInNotifyIcon ( Point point, System.Windows.Forms.NotifyIcon notifyicon ) : bool
point Point Point to check.
notifyicon System.Windows.Forms.NotifyIcon Notify icon to check.
Результат bool