title: How to get mouse position related to desktop in WPF?
body: <h2>Problem</h2>
  <p>When you search for such question using google you get a lot of hits but all solutions assume you have at least one window.</p>
  <p>But my question is just like I phrased it -- not assumptions at all. I can have a window, but I could have zero windows (because I didn't even show one or I just closed the last one). So in short the solution cannot rely on any widget or window -- the only thing is known, is there is a desktop (and app running, but it does not have any windows).</p>
  <p>So the question is -- <strong>how to get the mouse position?</strong></p>
  <h2>Background</h2>
  <p>I would like to show windows centered to mouse position. There is no such mode in WPF (there are only center to owner, or center to screen) so I have to do it manually. The missing piece is mouse position.</p>
  <h3>Edits</h3>
  <p>Thank you all, so now I have the first part of the solution -- raw position. Now there is a problem how to convert the data for WPF. I found such topic:
  <a href="https://stackoverflow.com/questions/1189384/wpf-pixels-to-desktop-pixels">WPF Pixels to desktop pixels</a>
  but again, it assumes having some window.</p>
  <p>Then I googled more and I found solution:
  <a href="http://jerryclin.wordpress.com/2007/11/13/creating-non-rectangular-windows-with-interop/" rel="nofollow noreferrer">http://jerryclin.wordpress.com/2007/11/13/creating-non-rectangular-windows-with-interop/</a></p>
  <p>the code includes class for scaling up/down coordinates relying only on info about desktop. So joining those two pieces, I finally get the solution :-). Thanks again.</p>