title: How to get mouse position on screen in WPF?
body: <p>It works within a specific control, but it doesn't work out the specific control.</p>
  
  <p>How to get mouse position and use mouse events independently of any control just directly from screen (without Platform Invoke)?</p>
  
  <p><strong>2 needed points:</strong></p>
  
  <ol>
  <li>Mouse events when mouse is not within a control, but on a screen.</li>
  <li>Mouse position when mouse is not within a control, but on a screen.</li>
  </ol>
  
  <p>It should be solved without using Platform Invoke.</p>
  
  <p>Next two don't work:</p>
  
  <pre><code>System.Windows.Input.Mouse.GetPosition(this)
  </code></pre>
  
  <p>Doesn't get mouse position out a specific control.</p>
  
  <pre><code>System.Windows.Forms.Cursor.Position.X
  </code></pre>
  
  <p><code>System.Windows.Forms.Cursor.Position</code> doesn't work because it has no types in a WPF app, but it works in a Windows Forms app.</p>
  
  <p>IntelliSense gets System.Windows.Forms.Cursor.Position, but it doesn't get any type of Position, hence I can't get:</p>
  
  <pre><code>Position.X    
  Position.Y
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Point pointToWindow = Mouse.GetPosition(this);
  
  Point pointToScreen = PointToScreen(pointToWindow);
  </code></pre>
  
  <p>Doesn't get mouse position out a specific control.</p>