Exemplo n.º 1
0
        /// <summary>
        ///     Gets all possible display devices.
        /// </summary>
        /// <returns></returns>
        private static IEnumerable<DisplayDevice> GetDisplayDevices()
        {
            var i = 0;
            var valid = true;

            while (valid)
            {
                var displayDevice = new DisplayDevice {cb = Marshal.SizeOf(typeof (DisplayDevice))};

                valid = XPWrapper.EnumDisplayDevices(null, i, ref displayDevice, 0);
                if (valid)
                    yield return displayDevice;

                ++i;
            }
        }
Exemplo n.º 2
0
 public static extern bool EnumDisplayDevices(string lpDevice, int iDevNum, ref DisplayDevice lpDisplayDevice, int dwFlags);