示例#1
0
        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);
        }
示例#2
0
        public void EnumerateDisplaySettings_FirstDevice()
        {
            var device   = Gdi.EnumerateDisplayDevices(null).First();
            var settings = Gdi.EnumerateDisplaySettings(device.DeviceName.Buffer.CreateString());

            settings.Should().NotBeEmpty();
        }
示例#3
0
        public void EnumerateDisplayDevices()
        {
            var devices = Gdi.EnumerateDisplayDevices(null).ToArray();

            devices.Should().Contain(d => (d.StateFlags & (DeviceState.Active | DeviceState.PrimaryDevice)) ==
                                     (DeviceState.Active | DeviceState.PrimaryDevice));
        }
示例#4
0
        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());
        }