Class WinProcHandler
This can be used to handle WinProc messages, for instance when there is no running winproc
Inheritance
System.Object
WinProcHandler
Namespace: Dapplo.Windows.Messages
Assembly: Dapplo.Windows.Messages.dll
Syntax
public class WinProcHandler : object
Properties
| Improve this Doc View SourceHandle
The actual handle for the HwndSource
Declaration
public IntPtr Handle { get; }
Property Value
Type | Description |
---|---|
IntPtr |
Instance
Singleton instance of the WinProcHandler
Declaration
public static WinProcHandler Instance { get; }
Property Value
Type | Description |
---|---|
WinProcHandler |
Methods
| Improve this Doc View SourceCreateMessageWindow(IntPtr, String)
Creates a HwndSource to catch windows message
Declaration
public static HwndSource CreateMessageWindow(IntPtr parent = null, string title = "Dapplo.MessageHandlerWindow")
Parameters
Type | Name | Description |
---|---|---|
IntPtr | parent | IntPtr for the parent, this should usually not be set |
System.String | title | Title of the window, a default is already set |
Returns
Type | Description |
---|---|
HwndSource | HwndSource |
Subscribe(HwndSourceHook)
Subscribe a hook to handle messages
Declaration
public IDisposable Subscribe(HwndSourceHook hook)
Parameters
Type | Name | Description |
---|---|---|
HwndSourceHook | hook | HwndSourceHook |
Returns
Type | Description |
---|---|
IDisposable | IDisposable which unsubscribes the hook when Dispose is called |
UnsubscribeAllHooks()
Unsubscribe all current hooks
Declaration
public void UnsubscribeAllHooks()