public static int GetSystemMetrics(SystemMetrics metric) { var ret = NativeMethods.GetSystemMetrics(metric); if (ret != 0) return ret; throw new Win32Exception("The call of GetSystemMetrics failed. Unfortunately, GetLastError code doesn't provide more information."); }