How do I find out the size of the entire desktop? Not the \"working area\" and not the \"screen resolution\", both of which refer to only o
Get the Size of a virtual display without any dependencies
public enum SystemMetric
{
VirtualScreenWidth = 78, // CXVIRTUALSCREEN 0x0000004E
VirtualScreenHeight = 79, // CYVIRTUALSCREEN 0x0000004F
}
[DllImport("user32.dll")]
public static extern int GetSystemMetrics(SystemMetric metric);
public static Size GetVirtualDisplaySize()
{
var width = GetSystemMetrics(SystemMetric.VirtualScreenWidth);
var height = GetSystemMetrics(SystemMetric.VirtualScreenHeight);
return new Size(width, height);
}