const int MONITOR_DEFAULTTONULL = 0;
const int MONITOR_DEFAULTTOPRIMARY = 1;
const int MONITOR_DEFAULTTONEAREST = 2;
[DllImport("user32.dll")]
static extern IntPtr MonitorFromWindow(IntPtr hwnd, uint dwFlags);
None.
None.
Please add some!
[DllImport("user32.dll", SetLastError = false)]
static extern IntPtr GetDesktopWindow();
IntPtr handle = MonitorFromWindow(GetDesktopWindow(), MONITOR_DEFAULTTONEAREST);
The System.Windows.Forms.Screen class contains all you might need to know about multiple monitors. The SystemInformation class also gives some information about available monitors.