Window Proc

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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,

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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top