title: Windows form with a transparent background that can be clicked through
body: <h2>INTRODUCTION</h2>
  
  <p>Using C# or VB.NET. I'm trying to make a form's background transparent; this form will be overlaped to other window, it will be a top-most window, so the transparent form (and its controls) must have the ability that they must not receive focus and they must can be clicked trough, this means if for example I perform a left-click on the transparent background, then the window on background of that (in the Z-order window) is the window that must receive the click instead.</p>
  
  <p>Notes:</p>
  
  <p>For avoiding the focus I'm overriding the <code>CreateParams</code> property as explained <a href="https://stackoverflow.com/a/2428108/1248295">here</a>.</p>
  
  <p>For making my form transparent, I'm calling Win32 <code>DwmExtendFrameIntoClientArea</code> function and also using <a href="http://sharpdx.org/" rel="noreferrer">SharpDX</a> library as explained <a href="https://stackoverflow.com/a/38257582/1248295">here</a>. But I think this really doesn't matter with the question itself.</p>
  
  <h2>PROBLEM</h2>
  
  <p>I'll show a demostration of what I mean using images. Here below is a image of a form (with no transparency, just to simplify understanding) overlapped to a window of a text editor program; note that my form doesn't receive focus. Well, the problem is when I do click on the form's background (or one of its controls) the window on background (the text editor window) still have focus but it can't receive the click.</p>
  
  <p><a href="https://i.stack.imgur.com/bNFqQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bNFqQ.png" alt="enter image description here"></a></p>
  
  <p>Here is the same image of above but with a transparent form:</p>
  
  <p><a href="https://i.stack.imgur.com/6J2Vt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6J2Vt.png" alt="enter image description here"></a></p>
  
  <h2>RESEARCH</h2>
  
  <p>I'm not really sure about what to investigate, so I'm going blind trying to find something useful in a trial-and-error stage by overriding the Window procedure (<strong>WndProc</strong>) of the transparent form to test related windows messages, like <code>WM_NCHITEST</code> or <code>WM_MOUSEACTIVATE</code> message as said here:</p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/1436059/windows-form-with-a-transparent-background-that-cannot-be-clicked-through">Windows form with a transparent background that cannot be clicked through</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/2423234/make-a-form-not-focusable-in-c-sharp">Make a form not focusable in C#</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/4037250/how-do-i-create-an-unfocusable-form-in-c">How do I create an &quot;unfocusable&quot; form in C#?</a></p></li>
  </ul>