title: Mouse capture is failing?
body: <p>I want to be able to access the coordinates of the mouse whether or not the cursor is over the window of my application.</p>
  
  <p>When I use Mouse.Capture(IInputElement) or UIElement.CaptureMouse(), both fail to capture the mouse and return false.</p>
  
  <p>What might be my problem?</p>
  
  <p>The cs file for my window is as follows:</p>
  
  <pre><code>using System.Windows;
  using System.Windows.Input;
  
  namespace ScreenLooker
  {
      /// &lt;summary&gt;
      /// Interaction logic for Window1.xaml
      /// &lt;/summary&gt;
      public partial class Window1 : Window
      {
          public Window1()
          {
              InitializeComponent();
  
              bool bSuccess = Mouse.Capture(this);
              bSuccess = this.CaptureMouse();
          }
  
          protected override void OnMouseMove(MouseEventArgs e)
          {
              tbCoordX.Text = e.GetPosition(this).X.ToString();
              tbCoordY.Text = e.GetPosition(this).Y.ToString();
              //System.Drawing.Point oPoint = System.Windows.Forms.Cursor.Position;
              //tbCoordX.Text = oPoint.X.ToString();
              //tbCoordY.Text = oPoint.Y.ToString();
  
              base.OnMouseMove(e);
          }
      }
  }
  </code></pre>