title: Create a WPF Window that captures AND passes through Mouse Events
body: <p>I'm working on a screen capture utility that captures active windows. I'm using transparent overlays to capture the full screen and then overlay the active windows based on mouse move events passed through to the underlying desktop/windows. </p>
  
  <p>Both of the overlay windows currently use the <code>WS_EX_TRANSPARENT</code> style to allow mouse events to pass through to the underlying windows so I can detect where the mouse cursor is located. I grab the window handle and rect size to outline the window and then use Global Mouse and Keyboard Hooks to accept or reject a capture. </p>
  
  <p>It's pretty ugly and spread out code (which is why I'm not posting here for now) but it all works very well and I can highlight the windows in mousemove and capture clicks with the global mouse and key handlers.</p>
  
  <p>It all works <strong>except for this problem</strong>:</p>
  
  <blockquote>
    <p>The Global Windows Hooks do not fire over an Admin Window so when I want to capture a Powershell, Command or Visual Studio (in Admin mode) Window no hook events are forwarded.</p>
  </blockquote>
  
  <p>Apparently there's no way to work around this security issues using Windows hooks (or <code>GetAsyncKeystate()</code> for that matter).</p>
  
  <p>I've tried a couple of different approaches to work around this issue:</p>
  
  <ul>
  <li><p>Instead of using Hooks I tried using the highlight window to capture mouse/key events<br>
  This sort of works, but it's clumsy - fails if no window is selected at all (no way to get out) and doesn't allow for selecting contained windows once the parent is selected (ie. no drill down)</p></li>
  <li><p>I also tried Win32 <code>GetAsyncKeystate()</code> which captures the last mouse or keyboard input and that would work, but it too fails to send mouse or key interactions from Admin windows.</p></li>
  </ul>
  
  <p>So I have two choices imperfect solutions at the moment:  using Hooks or <code>GetAsyncKeyState</code> to get the proper Window browsing selection behavior for all but admin windows, or I can capture all windows but lose the ability to drill into child windows after a parent window is selected.</p>
  
  <p>I'm at the end of my rope and the real question is this:</p>
  
  <p>Is there some way to create a semi-transparent or transparent window that can intercept mouseclicks <strong>and</strong> pass them on to the window area below?</p>