User Define Message

来源:互联网 发布:淘宝扣分清零时间 编辑:程序博客网 时间:2024/05/21 22:45

You need total 3 steps to define your message

 

[DllImport("user32.dll")]public static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wPar, IntPtr lPar);


 

public const int UserMsg = 0x0600;SendMessage(this.Parent.Handle, UserMsg, (IntPtr)1, (IntPtr)1);


 

protected override void WndProc(ref Message m){            switch (m.Msg)            {                case 0x0600:                                                            break;                default:                    base.WndProc(ref m);                    break;            }}


 

0 0
原创粉丝点击