예제 #1
0
        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);
        }
예제 #2
0
        public void EnumerateDisplaySettings_FirstDevice()
        {
            var device   = GdiMethods.EnumerateDisplayDevices(null).First();
            var settings = GdiMethods.EnumerateDisplaySettings(device.DeviceName);

            settings.Should().NotBeEmpty();
        }
예제 #3
0
        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));
        }
예제 #4
0
        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);
        }