Reputation: 1004
I've been working on using P/Invoke (post to follow) for multi-monitor support with Silverlight 5. Whilst playing, I noticed that window size and position would determine which of my two monitors an additional Window was maximised onto. I continued playing (as you do) and determined that:
It looks like there should be a pattern (constant = screen width - 10 for primary on the left, constant = -10 for primary on the right) but it's not exact. I don't have other monitors available at the moment, to check. Anyone know what it should be, or if this is just an artefact of my particular set up?
(Note: there are limits to these - they don't work for all value of Left or Width)
Upvotes: 2
Views: 129
Reputation: 23886
This behavior seems to be consistent with the behavior of MonitorFromWindow. From the documentation:
The MonitorFromWindow function retrieves a handle to the display monitor that has the largest area of intersection with the bounding rectangle of a specified window.
Check to see if this is consistent with your calculations. It should be.
Upvotes: 2