How can i call WindowProc from my c# app?

How do i call the Win API WindowProc from my C# app?
Who is Participating?
Bob LearnedCommented:
What are you trying to do?

Here is an example of overriding the default WndProc, and blocking a left click in the non-client area of a window:

    protected override void WndProc(ref System.Windows.Forms.Message m)
      const int WM_NCLBUTTONDBLCLK = 0xA3;
      if (m.Msg != WM_NCLBUTTONDBLCLK)
        base.WndProc(ref m);

saltedAuthor Commented:
Ah, no problem, I'm trying to send the message, not capture an incoming one. Sorry, got them the wrong way round :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.