Esta documentación está archivada y no tiene mantenimiento.

HwndSource.System.Windows.Interop.IKeyboardInputSink.TranslateChar (Método)

Processes WM_CHAR, WM_SYSCHAR, WM_DEADCHAR, and WM_SYSDEADCHAR input messages before System.Windows.Interop.IKeyboardInputSink.OnMnemonic is called.

Espacio de nombres: System.Windows.Interop
Ensamblado: PresentationCore (en presentationcore.dll)

bool IKeyboardInputSink.TranslateChar (
	ref MSG msg,
	ModifierKeys modifiers
No se pueden utilizar métodos en XAML.



The message and its associated data. Do not modify this structure. It is passed by reference only for performance reasons.


The modifier keys.

Valor devuelto

true if the message was handled by this method, and therefore System.Windows.Interop.IKeyboardInputSink.OnMnemonic is not called; otherwise, false.

Notas para los herederos: The HwndSource implementation processes the messages, but does not handle them at this level. However, it defers to any child sinks. If one of the child sinks is implemented by HwndHost, then HwndHost or a derived class thereof might handle the message and return true from its TranslateChar method. A private method of HwndSource that preprocesses keyboard input calls System.Windows.Interop.IKeyboardInputSink.TranslateChar first, and then calls System.Windows.Interop.IKeyboardInputSink.OnMnemonic only if System.Windows.Interop.IKeyboardInputSink.TranslateChar returns false. Therefore, if you reimplement System.Windows.Interop.IKeyboardInputSink.TranslateChar to return true in a HwndSource derived class, your System.Windows.Interop.IKeyboardInputSink.OnMnemonic will not be called. HwndSource implements this member as an explicit interface definition to provide basic support for IKeyboardInputSink members. These IKeyboardInputSink members support keyboard operations for interoperation, and include functionality such as raising WPF routed events in response to Win32 messages, and forwarding tab requests. If you are creating instances of the HwndSource class, you do not need to call this member. However, if you are deriving from HwndSource, and you have advanced scenario requirements for keyboard input interoperation, you might need to re-implement System.Windows.Interop.IKeyboardInputSink.TranslateChar. This requires that you specifically implement IKeyboardInputSink again on your class, and define a new explicit TranslateChar that overrides the HwndSource version.

Microsoft .NET Framework 3.0 es compatible con Windows Vista, Microsoft Windows XP SP2 y Windows Server 2003 SP1.

.NET Framework

Compatible con: 3.0