Control.PreProcessMessage Method
Preprocesses input messages within the message loop before they are dispatched.
[Visual Basic] Public Overridable Function PreProcessMessage( _ ByRef msg As Message _ ) As Boolean [C#] public virtual bool PreProcessMessage( ref Message msg ); [C++] public: virtual bool PreProcessMessage( Message* msg ); [JScript] public function PreProcessMessage( msg : Message ) : Boolean;
Parameters
- msg
- A Message, passed by reference, that represents the message to process.
Return Value
true if the message was processed by the control; otherwise, false.
Remarks
PreProcessMessage is called by the application's message loop to preprocess input messages before they are dispatched. Possible values for the msg.message field are WM_KEYDOWN, WM_SYSKEYDOWN, WM_CHAR, and WM_SYSCHAR.
When overriding preProcessMessage(), a control should return true to indicate that it has processed the message. For messages that are not processed by the control, the result of base.preProcessMessage() should be returned. Controls will typically override one of the more specialized methods such as isInputChar(), isInputKey(), processCmdKey(), processDialogChar(), or processDialogKey() instead of overriding preProcessMessage().
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
.NET Framework Security:
- UIPermission for all windows for inheriting classes to call this method. Associated enumeration: UIPermissionWindow.AllWindows
- UIPermission for all windows for the immediate caller to call this method. Associated enumeration: UIPermissionWindow.AllWindows
See Also
Control Class | Control Members | System.Windows.Forms Namespace