C#中WndProc(ref Message m)是Control类中的方法,用来处理Windows消息。
Control.WndProc 方法 说明如下:
处理 Windows 消息。
命名空间: System.Windows.Forms
程序集: System.Windows.Forms(在 System.Windows.Forms.dll 中)
语法
C#
[SecurityPermissionAttribute(SecurityAction.InheritanceDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
protected virtual void WndProc(
ref Message m
)
参数
m
类型:System.Windows.Forms.Message%
要处理的 WindowsMessage。
备注
在通过 PreProcessMessage 方法筛选之后,所有消息都发送到 WndProc 方法。
WndProc 方法与 Windows WindowProc 函数完全对应。有关处理 Windows 消息的更多信息,请参见 MSDN Library(位于 http://msdn2.microsoft.com/zh-cn/library/default.aspx. Windows Platform SDK 参考中的 WindowProc 函数文档。
对继承者的说明:
进行继承的控件应调用基类的 WndProc 方法以处理它们不处理的任何消息。
private void MS.Win32.WndProc(ref Message m)
不用窗体 你要处理什么消息呢....
这个函数应该最顶层是Control类实现的 Form作为继承并且重写了这个方法