public void EnumerateDisplaySettings_FirstDevice_CurrentMode() { var device = GdiMethods.EnumerateDisplayDevices(null).First(); var settings = GdiMethods.EnumerateDisplaySettings(device.DeviceName, GdiDefines.ENUM_CURRENT_SETTINGS).ToArray(); settings.Length.Should().Be(1); }
public void EnumerateDisplaySettings_FirstDevice() { var device = GdiMethods.EnumerateDisplayDevices(null).First(); var settings = GdiMethods.EnumerateDisplaySettings(device.DeviceName); settings.Should().NotBeEmpty(); }
public void EnumerateDisplayDevices() { var devices = GdiMethods.EnumerateDisplayDevices(null).ToArray(); devices.Should().Contain(d => (d.StateFlags & (DeviceState.DISPLAY_DEVICE_ACTIVE | DeviceState.DISPLAY_DEVICE_PRIMARY_DEVICE)) == (DeviceState.DISPLAY_DEVICE_ACTIVE | DeviceState.DISPLAY_DEVICE_PRIMARY_DEVICE)); }
public void EnumerateDisplayDevices_Monitors() { var device = GdiMethods.EnumerateDisplayDevices(null).First(); var monitor = GdiMethods.EnumerateDisplayDevices(device.DeviceName).First(); // Something like \\.\DISPLAY1 and \\.\DISPLAY1\Monitor0 monitor.DeviceName.Should().StartWith(device.DeviceName); }