A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
According to some documentation, capturing only works if the left mouse button is pressed. Try creating a new window, then handle two events:
private void menuItemChooseBackground_PreviewMouseDown( object sender, MouseButtonEventArgs e )
{
Cursor = Cursors.Cross;
Mouse.Capture( this );
}
private void Window_MouseUp( object sender, MouseButtonEventArgs e )
{
Mouse.Capture( null );
Cursor = Cursors.Arrow;
var position = e.MouseDevice.GetPosition( this );
position = PointToScreen( position );
// a test: showing position
Title = position.ToString( );
}
Therefore, in this approach, the mouse must be pressed and dragged.
Or maybe you can create semi-transparent top-level windows that occupies the whole screens, without capturing. After clicking the mouse, hide the windows and get the colour.