This method is called by the application's message loop to pre-process input messages before they are dispatched. Possible values for the msg.message field are WM_KEYDOWN, WM_SYSKEYDOWN, WM_CHAR, and WM_SYSCHAR. If this method processes the message it must return true, in which case the message loop will not dispatch the message. For WM_KEYDOWN and WM_SYSKEYDOWN messages, preProcessMessage() first calls processCmdKey() to check for command keys such as accelerators and menu shortcuts. If processCmdKey() doesn't process the message, then isInputKey() is called to check whether the key message represents an input key for the control. Finally, if isInputKey() indicates that the control isn't interested in the key message, then processDialogKey() is called to check for dialog keys such as TAB, arrow keys, and mnemonics. For WM_CHAR messages, preProcessMessage() first calls isInputChar() to check whether the character message represents an input character for the control. If isInputChar() indicates that the control isn't interested in the character message, then processDialogChar() is called to check for dialog characters such as mnemonics. For WM_SYSCHAR messages, preProcessMessage() calls processDialogChar() to check for dialog characters such as mnemonics. When overriding preProcessMessage(), a control should return true to indicate that it has processed the message. For messages that aren't processed by the control, the result of "base.preProcessMessage()" should be returned. Controls will typically override one of the more specialized methods (isInputChar(), isInputKey(), processCmdKey(), processDialogChar(), or processDialogKey()) instead of overriding preProcessMessage().
[Visual Basic] Overridable Public Function PreProcessMessage( _ ByVal msg As MSG _ ) As Boolean [C#] public virtual bool PreProcessMessage( MSG msg ); [C++] public: virtual bool PreProcessMessage( MSG msg ); [JScript] public function PreProcessMessage( msg : MSG ) : Boolean;
true to consume the message, false to allow the message to be dispatched.