C# Class Catel.Windows.WindowExtensions

Extensions for System.Windows.Window.
ファイルを表示 Open project: Catel/Catel

Public Methods

Method Description
ApplyIconFromApplication ( this window ) : void

Applies the icon from the entry assembly (the application) to the window.

BringWindowToTop ( this window ) : void

Brings to specified window to top.

GetWindowHandle ( this window ) : IntPtr

Gets the window handle of the specified window.

RemoveIcon ( this window ) : void

Removes the icon from the window.

SetOwnerWindow ( this window, IntPtr owner, bool forceNewOwner = false ) : void

Sets the owner window of a specific window via the window handle.

SetOwnerWindow ( this window, Window owner, bool forceNewOwner = false ) : void

Sets the owner window of a specific window via the Window class.

SetOwnerWindow ( this window, bool forceNewOwner = false, bool focusFirstControl = false ) : void

Sets the owner window to the main window of the current process.

SetOwnerWindowAndFocus ( this window, IntPtr owner, bool forceNewOwner = false ) : void

Sets the owner window of a specific window via the window handle, but also sets the focus on the first control.

SetOwnerWindowAndFocus ( this window, Window owner, bool forceNewOwner = false ) : void

Sets the owner window of a specific window via the Window class, but also sets the focus on the first control.

SetOwnerWindowAndFocus ( this window, bool forceNewOwner = false ) : void

Sets the owner window to the main window of the current process, but also sets the focus on the first control.

Private Methods

Method Description
BringWindowToTop ( IntPtr hWnd ) : bool
GetProcessMainWindowHandle ( ) : IntPtr

Returns the main window handle of the current process.

GetWindowLong ( IntPtr hWnd, int nIndex ) : int
GetWindowRect ( IntPtr hWnd, RECT &lpRect ) : bool
HasOwner ( Window window ) : bool

Returns whether the window currently has an owner.

SendMessage ( IntPtr hwnd, uint msg, IntPtr wParam, IntPtr lParam ) : IntPtr
SetOwnerWindow ( Window window, Window ownerWindow, IntPtr ownerHandle, bool forceNewOwner, bool focusFirstControl ) : void

Sets the owner window of a specific window. It will first try to set the owner via the ownerWindow. If the ownerWindow is not available, this method will use the ownerHandle to set the parent.

SetOwnerWindowByHandle ( Window window, IntPtr owner, bool forceNewOwner = false, bool focusFirstControl = true ) : void

Sets the owner window of a specific window via the window handle.

SetOwnerWindowByWindow ( Window window, Window owner, bool forceNewOwner = false, bool focusFirstControl = true ) : void

Sets the owner window of a specific window.

SetWindowLong ( IntPtr hWnd, int nIndex, int dwNewLong ) : int
SetWindowPos ( IntPtr hwnd, IntPtr hwndInsertAfter, int x, int y, int width, int height, uint flags ) : bool

Method Details

ApplyIconFromApplication() public static method

Applies the icon from the entry assembly (the application) to the window.
public static ApplyIconFromApplication ( this window ) : void
window this The window.
return void

BringWindowToTop() public static method

Brings to specified window to top.
The is null.
public static BringWindowToTop ( this window ) : void
window this The window to bring to top.
return void

GetWindowHandle() public static method

Gets the window handle of the specified window.
public static GetWindowHandle ( this window ) : IntPtr
window this The window.
return System.IntPtr

RemoveIcon() public static method

Removes the icon from the window.
public static RemoveIcon ( this window ) : void
window this The window.
return void

SetOwnerWindow() public static method

Sets the owner window of a specific window via the window handle.
public static SetOwnerWindow ( this window, IntPtr owner, bool forceNewOwner = false ) : void
window this Reference to the current window.
owner System.IntPtr New owner window.
forceNewOwner bool If true, the new owner will be forced. Otherwise, if the /// window currently has an owner, that owner will be respected (and thus not changed).
return void

SetOwnerWindow() public static method

Sets the owner window of a specific window via the Window class.
public static SetOwnerWindow ( this window, Window owner, bool forceNewOwner = false ) : void
window this Reference to the current window.
owner System.Windows.Window New owner window.
forceNewOwner bool If true, the new owner will be forced. Otherwise, if the /// window currently has an owner, that owner will be respected (and thus not changed).
return void

SetOwnerWindow() public static method

Sets the owner window to the main window of the current process.
public static SetOwnerWindow ( this window, bool forceNewOwner = false, bool focusFirstControl = false ) : void
window this Reference to the current window.
forceNewOwner bool If true, the new owner will be forced. Otherwise, if the /// window currently has an owner, that owner will be respected (and thus not changed).
focusFirstControl bool If true, the first control will automatically be focused.
return void

SetOwnerWindowAndFocus() public static method

Sets the owner window of a specific window via the window handle, but also sets the focus on the first control.
public static SetOwnerWindowAndFocus ( this window, IntPtr owner, bool forceNewOwner = false ) : void
window this Reference to the current window.
owner System.IntPtr New owner window.
forceNewOwner bool If true, the new owner will be forced. Otherwise, if the /// window currently has an owner, that owner will be respected (and thus not changed).
return void

SetOwnerWindowAndFocus() public static method

Sets the owner window of a specific window via the Window class, but also sets the focus on the first control.
public static SetOwnerWindowAndFocus ( this window, Window owner, bool forceNewOwner = false ) : void
window this Reference to the current window.
owner System.Windows.Window New owner window.
forceNewOwner bool If true, the new owner will be forced. Otherwise, if the /// window currently has an owner, that owner will be respected (and thus not changed).
return void

SetOwnerWindowAndFocus() public static method

Sets the owner window to the main window of the current process, but also sets the focus on the first control.
public static SetOwnerWindowAndFocus ( this window, bool forceNewOwner = false ) : void
window this Reference to the current window.
forceNewOwner bool If true, the new owner will be forced. Otherwise, if the /// window currently has an owner, that owner will be respected (and thus not changed).
return void