title: Winforms Control Stealing WndProc WM_NCHITEST
body: <p>I am building a form in C# that uses the <code>WM_NCHITEST</code> event in the <code>WndProc</code> function. It works perfectly with no controls on the page, but when I added a panel to the page my <code>WndProc</code> function stopped receiving <code>WM_NCHITEST</code> events. Any idea what I can do to stop this?</p>
  
  <p><strong>UPDATE</strong>: My window in normally borderless, but when I do run it in bordered mode the <code>WM_NCHITTEST</code> event is called when the cursor mouses over the window frame, leaving me to think that the form size control I have (Chromium Embedded Web Browser) is intercepting the messages. Any way to wrest WndProc control back from a unrully window?</p>
  
  <pre><code>protected override void WndProc(ref Message m)
  {
      if (m.Msg == 0x0083) //WM_NCAlSIZE
      {
          if (borderless)
          {
              return; //Works even with a control on the page.
          }
      }
      if (m.Msg == 0x0084) //WM_NCHITEST
      {
          Debug.Print("If there is a control on the page I won't print :(");
      }
      base.WndProc(ref m);
  }
  </code></pre>