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