Export (0) Print
Expand All

NativeWindow.DefWndProc Method

Invokes the default window procedure associated with this window.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

'Declaration
Public Sub DefWndProc ( _
	ByRef m As Message _
)

Parameters

m
Type: System.Windows.Forms.Message

The message that is currently being processed.

Typically, you only call the DefWndProc method when you are intercepting window messages and would like the default window procedure to handle the message. DefWndProc should not be called to send a window message to the window; call the Win32 SendMessage function instead.

It is an error to call DefWndProc when the Handle property is 0.

Notes to Inheritors

Override this method in a derived class to implement generalized custom message handling for a specific native window or .NET Windows Forms Control. Custom processing can be performed before, after, or instead of a call to the base class implementation of this method, which performs standard message processing.

In contrast, adding customized message handling for an application can be accomplished through the AddMessageFilter method of the Application class.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft