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().
Followup:
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?"
// From .NET Reflector....
public static Point get_MousePosition()
{
NativeMethods.POINT pt = new NativeMethods.POINT();
UnsafeNativeMethods.GetCursorPos(pt);
return new Point(pt.x, pt.y);
}
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.
What else should I be looking for?
Thanks, Dave