Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
0 out of 7 rated this helpful - Rate this topic

Control.PreProcessMessage Method

Preprocesses keyboard or input messages within the message loop before they are dispatched.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public virtual bool PreProcessMessage (
	ref Message msg
)
public boolean PreProcessMessage (
	/** @ref */ Message msg
)
JScript does not support passing value-type arguments by reference.

Parameters

msg

A Message, passed by reference, that represents the message to process. The possible values are WM_KEYDOWN, WM_SYSKEYDOWN, WM_CHAR, and WM_SYSCHAR.

Return Value

true if the message was processed by the control; otherwise, false.

PreProcessMessage is called by the application's message loop to preprocess input messages before they are dispatched. Possible values for the msg parameter 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.

  • UIPermission  for all windows for inheriting classes to call this method. Associated enumeration: AllWindows value of UIPermissionWindow.
  • UIPermission  for all windows for the immediate caller to call this method. Associated enumeration: AllWindows value of UIPermissionWindow.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0, 1.1, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.