NativeWindow.DefWndProc(Message) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Invokes the default window procedure associated with this window.
public:
void DefWndProc(System::Windows::Forms::Message % m);
public void DefWndProc(ref System.Windows.Forms.Message m);
member this.DefWndProc : Message -> unit
Public Sub DefWndProc (ByRef m As Message)
- m
- 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.
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(IMessageFilter) method of the Application class.
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: