The next code gets Mouse Position relative to screen no matter where Mouse is:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
Label label = new Label();
label.Width = 100;
label.Height = 30;
this.Content = label;
this.Loaded += delegate
{
System.Timers.Timer timer = new System.Timers.Timer();
timer.Elapsed += delegate
{
this.Dispatcher.Invoke(new Action(delegate
{
Mouse.Capture(this);
Point pointToWindow = Mouse.GetPosition(this);
Point pointToScreen = PointToScreen(pointToWindow);
label.Content = pointToScreen.ToString();
Mouse.Capture(null);
}));
};
timer.Interval = 1;
timer.Start();
};
}
}