Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 967
  • Last Modified:

How can i call WindowProc from my c# app?

How do i call the Win API WindowProc from my C# app?
1 Solution
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 :)

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now