G Guest Jun 2, 2005 #1 Kindly i want to know how to use window proc from within C# Application is there any tutorial or somebody can help me in doing this
Kindly i want to know how to use window proc from within C# Application is there any tutorial or somebody can help me in doing this
N Nassos Jun 2, 2005 #2 Hi man, in each form: protected override void WndProc(ref Message m) { //Exit Message Code int WM_QUERYENDSESSION = 0x11; //Cancel Message Code int WM_CANCELMODE = 0x1F; // if the message is to shut down/reset window if (m.Msg == WM_QUERYENDSESSION) { base.WndProc(ref m); //You can also cancel the exit window message by using //the following lines //Message MyMessage = new Message(); //MyMessage.Msg = Convert.ToInt32(WM_CANCELMODE); //base.WndProc(ref MyMessage); } else { //carry on with the message base.WndProc(ref m); } } hope that helps. "Just close your eyes and see"
Hi man, in each form: protected override void WndProc(ref Message m) { //Exit Message Code int WM_QUERYENDSESSION = 0x11; //Cancel Message Code int WM_CANCELMODE = 0x1F; // if the message is to shut down/reset window if (m.Msg == WM_QUERYENDSESSION) { base.WndProc(ref m); //You can also cancel the exit window message by using //the following lines //Message MyMessage = new Message(); //MyMessage.Msg = Convert.ToInt32(WM_CANCELMODE); //base.WndProc(ref MyMessage); } else { //carry on with the message base.WndProc(ref m); } } hope that helps. "Just close your eyes and see"
I Ignacio Machin \( .NET/ C# MVP \) Jun 2, 2005 #3 Hi, Use it only if you know what you are doing, otherwise use the event handling provided by the framework. All you have to do is overwrite WndProc ,Take a look at Control.WndProc in MSDN Cheers, -- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation "Just close your eyes and see"
Hi, Use it only if you know what you are doing, otherwise use the event handling provided by the framework. All you have to do is overwrite WndProc ,Take a look at Control.WndProc in MSDN Cheers, -- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation "Just close your eyes and see"