In a C# application, how can I find out if a WPF window is in the primary monitor or another monitor?
Other replies available so far don't address the WPF part of the question. Here's my take.
WPF doesn't seem to expose detailed screen info as found in Windows Forms' Screen class mentioned in other replies.
However, you can use the WinForms Screen class in your WPF program:
Add references to System.Windows.Forms and System.Drawing
var screen = System.Windows.Forms.Screen.FromRectangle(
new System.Drawing.Rectangle(
(int)myWindow.Left, (int)myWindow.Top,
(int)myWindow.Width, (int)myWindow.Height));
Note that if you are a nitpicker, you may have noted that this code could have right and bottom coordinates off by one pixel in some case of double to int conversions. But since you are a nitpicker, you will be more than happy to fix my code ;-)