C# Class AdvancedLauncher.Tools.Interop.HwndHostEx

This class works around issues with the HwndHost in current WPF versions.
Inheritance: System.Windows.Interop.HwndHost, IKeyboardInputSink
Datei anzeigen Open project: GoldRenard/DMOAdvancedLauncher

Public Properties

Property Type Description
AsyncUpdateWindowPosProperty System.Windows.DependencyProperty
CopyBitsBehaviorProperty System.Windows.DependencyProperty
RaiseMouseActivateCommandProperty System.Windows.DependencyProperty

Protected Methods

Method Description
BuildWindowCore ( HandleRef hwndParent ) : HandleRef
BuildWindowOverride ( HWND hwndParent ) : HWND

Default implementation of BuildWindowOverride, which just creates a simple "STATIC" HWND. This is almost certainly not the desired window, but at least something shows up on the screen. Override this method in your derived class and build the window you want.

DestroyWindowCore ( HandleRef hwnd ) : void
DestroyWindowOverride ( HWND hwnd ) : void

Default implementation of DestroyWindowCore, which just destroys the hosted window. If this is undesirable, override this method and provide alternative logic.

OnWindowPositionChanged ( Rect rcBoundingBox ) : void

WndProc ( IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, bool &handled ) : IntPtr
WndProcOverride ( HWND hwnd, WM msg, IntPtr wParam, IntPtr lParam ) : IntPtr

Method Details

BuildWindowCore() protected final method

protected final BuildWindowCore ( HandleRef hwndParent ) : HandleRef
hwndParent System.Runtime.InteropServices.HandleRef
return System.Runtime.InteropServices.HandleRef

BuildWindowOverride() protected method

Default implementation of BuildWindowOverride, which just creates a simple "STATIC" HWND. This is almost certainly not the desired window, but at least something shows up on the screen. Override this method in your derived class and build the window you want.
protected BuildWindowOverride ( HWND hwndParent ) : HWND
hwndParent AdvancedLauncher.Tools.Win32.User32.HWND
return AdvancedLauncher.Tools.Win32.User32.HWND

DestroyWindowCore() protected final method

protected final DestroyWindowCore ( HandleRef hwnd ) : void
hwnd System.Runtime.InteropServices.HandleRef
return void

DestroyWindowOverride() protected method

Default implementation of DestroyWindowCore, which just destroys the hosted window. If this is undesirable, override this method and provide alternative logic.
protected DestroyWindowOverride ( HWND hwnd ) : void
hwnd AdvancedLauncher.Tools.Win32.User32.HWND
return void

OnWindowPositionChanged() protected method

protected OnWindowPositionChanged ( Rect rcBoundingBox ) : void
rcBoundingBox System.Windows.Rect
return void

WndProc() protected final method

protected final WndProc ( IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, bool &handled ) : IntPtr
hwnd System.IntPtr
msg int
wParam System.IntPtr
lParam System.IntPtr
handled bool
return System.IntPtr

WndProcOverride() protected method

protected WndProcOverride ( HWND hwnd, WM msg, IntPtr wParam, IntPtr lParam ) : IntPtr
hwnd AdvancedLauncher.Tools.Win32.User32.HWND
msg WM
wParam System.IntPtr
lParam System.IntPtr
return System.IntPtr

Property Details

AsyncUpdateWindowPosProperty public_oe static_oe property

Specifies whether or not to set the window position of the hosted window asynchronously.
HwndHost depends on the LayoutUpdated event to synchronize the position of the HWND with the layout slot. However, when WPF gets into a recursive/nested layout loop, the LayoutUpdated event is not raised. Since we resize the hosted HWND in response to this event, if the hosted HWND contains an HwndSource, that HwndSource will run an immediate layout pass, but the LayoutUpdated event will not be raised. TODO: fix in 4.5?
public static DependencyProperty,System.Windows AsyncUpdateWindowPosProperty
return System.Windows.DependencyProperty

CopyBitsBehaviorProperty public_oe static_oe property

The behavior for handling of the SWP_NOCOPYBITS flag during moving or sizing operations.
Real implementation is HwndHostExtensions.CopyBitsBehaviorProperty
public static DependencyProperty,System.Windows CopyBitsBehaviorProperty
return System.Windows.DependencyProperty

RaiseMouseActivateCommandProperty public_oe static_oe property

Specifies whether or not a HwndHostCommands.MouseActivate command is raised in response to WM_MOUSEACTIVATE.
Real implementation is HwndHostExtensions.RaiseMouseActivateCommandProperty
public static DependencyProperty,System.Windows RaiseMouseActivateCommandProperty
return System.Windows.DependencyProperty