title: What could make GetCursorPos return incorrect coordinates of {0,0}?
body: <p>We are seeing bad behavior in an application when it runs on Server 2008 (not R2).  This is a WinForms application, and Control.MousePosition is returning {0,0} no matter where the mouse is on the screen...  Control.MousePosition just makes a P/Invoke call to Win32 api GetCursorPos().  </p>
  
  <p>Followup:</p>
  
  <p>I am using Control.MousePosition from WinForms, which calls GetCursorPos, and I can see that it definitely ignores the return value.  Asking my question another way, "What can cause GetCursorPos() to suddenly start returning FALSE, when it worked only milliseconds before in the same process?"</p>
  
  <pre><code>// From .NET Reflector....
  public static Point get_MousePosition()
  {
      NativeMethods.POINT pt = new NativeMethods.POINT();
      UnsafeNativeMethods.GetCursorPos(pt);
      return new Point(pt.x, pt.y);
  }
  </code></pre>
  
  <p>There is a control in our library that calls SetWindowsHookEx to hook WH_CALLWNDPROCRET for our entire process.  I'm suspicious of this code, but tracing statements show that we're getting in + out of that hook cleanly.</p>
  
  <p>What else should I be looking for?</p>
  
  <p>Thanks,
  Dave</p>