C# Class BrightnessTray.WindowPositioning

Helper class for positioning the main window.
Afficher le fichier Open project: navhaxs/BrightnessTray Class Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

GetCursorPosition() public static méthode

Returns the cursor's current position as a System.Windows.Point.
public static GetCursorPosition ( ) : Point
Résultat Point

GetNotifyAreaButtonRectangle() public static méthode

Retrieves the rectangle of the 'Show Hidden Icons' button, or null if it can't be found.
public static GetNotifyAreaButtonRectangle ( ) : Rect?
Résultat Rect?

GetNotifyIconRectLegacy() public static méthode

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.
Résultat Rect?

GetNotifyIconRectWindows7() public static méthode

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.
Résultat Rect?

GetNotifyIconRectangle() public static méthode

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.
Résultat Rect?

GetTaskBarInfo() public static méthode

Retrieves taskbar position and alignment.
public static GetTaskBarInfo ( ) : TaskBarInfo
Résultat TaskBarInfo

GetWindowClientAreaSize() public static méthode

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.
Résultat System.Windows.Rect

GetWindowPosition() public static méthode

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.).
Résultat Point

GetWindowSize() public static méthode

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.
Résultat System.Windows.Rect

GetWorkingArea() public static méthode

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.
Résultat System.Windows.Rect

IsCursorOverNotifyIcon() public static méthode

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.
Résultat bool

IsNotifyIconInFlyOut() public static méthode

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).
Résultat bool

IsNotifyIconInFlyOut() public static méthode

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.
Résultat bool

IsPointInNotifyIcon() public static méthode

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.
Résultat bool