We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback
Platform : WPF
Category : Message Loops Between

How can I HwndSource Treats ComponentDispatcher Events ?

If the HwndSource is a top-level window (no parent HWND), it will register with ComponentDispatcher. If ThreadPreprocessMessage is raised and if the message is intended for the HwndSource or child windows, HwndSource calls its IkeyboardInputSink, TranslateAccelerator, TranslateChar, OnMnemonic keyboard sink sequence. If the HwndSource is not a top-level window (has a parent HWND), there will be no handling. Only the top-level window is expected to do the handling and there is expected to be a top-level window with keyboard sink support as part of any interoperation scenario.

If WndProc on an HwndSource is called without an appropriate keyboard sink method being called first, your application will receive the higher level keyboard events such as "KeyDown". However, no keyboard sink methods will be called which circumvents desirable keyboard input model features such as access key support. This might happen because the message loop did not properly notify the relevant thread on the ComponentDispatcher or because the parent HWND did not invoke the proper keyboard sink responses.

A message that goes to the keyboard sink might not be sent to the HWND if you add hooks for that message by using the "AddHook()" method. The message might have been handled at the message pump level directly and not submitted to the DispatchMessage function.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon