Calls to GetCursorPos always fail with ERROR_NOACCESS when passed an LPPOINT at a memory address higher than 2 GB. This is a common occurrence when running a 32-bit process that is Large Address Aware.Windows Presentation Foundation uses GetCursorPos when handling window activation events and will throw a Win32Exception if GetCursorPos fails (returns 0.) This exception prevents WPF applications from receiving mouse focus! The WPF window will remain in an inactive state.Attached is a repro case that demonstrates WPF becoming unresponsive due to GetCursorPos failing in a large-address-aware client.The application allocates 2 GB of memory on the native heap and then loads a WPF DLL and displays a user interface. Every time the user clicks on the large button in the interface, thousands of items will be added to the list box. After a dozen clicks or so, when you resize the window WPF will pass a large address to GetCursorPos while handling an activation event. This call fails and WPF will throw an exception. The app will remain unreponsive to mouse input after that.
Version