This documentation is archived and is not being maintained.

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)

public static class ComponentDispatcher
You cannot directly create an instance of this class in XAML.

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.


Only keyboard messages are supported.


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

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0