C# Class Zhwang.SuperNotifyIcon.Finder.WindowPositioning

Helper class for positioning the main window.
Datei anzeigen Open project: rzhw/SuperNotifyIcon

Public Methods

Method Description
GetCursorPosition ( ) : Point

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

GetWindowClientAreaSize ( IntPtr hWnd ) : Rectangle

Returns a Rectangle 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, bool pinned ) : Point

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

GetWindowSize ( IntPtr hWnd ) : Rectangle

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

GetWorkingArea ( Rectangle rectangle ) : Rectangle

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.

Method Details

GetCursorPosition() public static method

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

GetWindowClientAreaSize() public static method

Returns a Rectangle containing the bounds of the specified window's client area (i.e. area excluding border).
public static GetWindowClientAreaSize ( IntPtr hWnd ) : Rectangle
hWnd System.IntPtr Handle of the window.
return System.Drawing.Rectangle

GetWindowPosition() public static method

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, bool pinned ) : 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.).
pinned bool Whether the window is pinned open or not. Affects positioning in Windows 7 only.
return Point

GetWindowSize() public static method

Returns a Rectangle containing the bounds of the specified window's area (i.e. area excluding border).
public static GetWindowSize ( IntPtr hWnd ) : Rectangle
hWnd System.IntPtr Handle of the window.
return System.Drawing.Rectangle

GetWorkingArea() public static method

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 ( Rectangle rectangle ) : Rectangle
rectangle System.Drawing.Rectangle The rectangle that is located on the monitor whose working area should be returned.
return System.Drawing.Rectangle

IsCursorOverNotifyIcon() public static method

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.
return bool