title: Capturing the windows key in c# (wpf)
body: <p>I have written a small program displaying sounds and images on the screen when pushing any button.  I always start it when one of my little kids crawls onto my lap and start hitting the keys, of course, randomly.</p>
  
  <p>It works fine except for 2 keys, one of them being the ON/OFF switch, the other being the Windows-key. (the CTRL-ESC equivalent I believe)  I can intercept it as it is pressed, but only after the startmenu is showing.  </p>
  
  <p>The event I use is the UIElement.KeyDown and all I could came up with so far is :  (the e being KeyEventArgs)</p>
  
  <pre><code>            if (e.Key == Key.LWin) e.Handled = true;
  </code></pre>
  
  <p>but than the start window is already showing I'm afraid.</p>
  
  <p>I have already 1 answer but would very much like to know if there's any wpf-support?</p>
  
  <p>I suspect programming the main on/off switch might not be possible?  Otherwise, any help there would be welcome too..</p>