ComponentDispatcher Class

ComponentDispatcher Class

 

Enables shared control of the message pump between Win32 and WPF in interoperation scenarios.

Namespace:   System.Windows.Interop
Assembly:  WindowsBase (in WindowsBase.dll)

System.Object
  System.Windows.Interop.ComponentDispatcher

public static class ComponentDispatcher

NameDescription
System_CAPS_pubpropertySystem_CAPS_staticCurrentKeyboardMessage

Gets the last message that was raised.

System_CAPS_pubpropertySystem_CAPS_staticIsThreadModal

Gets a value that indicates whether the thread is modal.

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticPopModal()

Called to indicate that a modal thread is no longer modal.

System_CAPS_pubmethodSystem_CAPS_staticPushModal()

Called to indicate that the thread is modal.

System_CAPS_pubmethodSystem_CAPS_staticRaiseIdle()

Called to indicate that a thread is idle.

System_CAPS_pubmethodSystem_CAPS_staticRaiseThreadMessage(MSG)

Indicates that a new message is available for possible handling.

NameDescription
System_CAPS_pubeventSystem_CAPS_staticEnterThreadModal

Occurs when a thread becomes modal.

System_CAPS_pubeventSystem_CAPS_staticLeaveThreadModal

Occurs when a modal thread becomes nonmodal.

System_CAPS_pubeventSystem_CAPS_staticThreadFilterMessage

Occurs when the message pump receives a keyboard message.

System_CAPS_pubeventSystem_CAPS_staticThreadIdle

Occurs when the thread is idle.

System_CAPS_pubeventSystem_CAPS_staticThreadPreprocessMessage

Occurs when the message pump receives a keyboard message.

Although the class itself is static, all members of ComponentDispatcher are specific to a particular thread. For example, if you examine the value of IsThreadModal on two different threads, you might get different values.

The methods are static but they are backed by per-thread data structures.  The static methods allow singleton access but the ComponentDispatcher is sorting out the appropriate per-thread operations.

The owner of the message pump is defined by the code that calls the Win32 function GetMessage. The owner calls RaiseThreadMessage for every keyboard message. This method raises the ThreadFilterMessage event with the messages contained in the event data. If that event is not handled, the owner raises the ThreadPreprocessMessage event with the messages contained in the event argument.

System_CAPS_noteNote

Only keyboard messages are supported.

UIPermission

to access any member of this class. Associated enumeration: Unrestricted

.NET Framework
Available since 3.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft