Skip to content

How to get all resolutions? #4

Answered by lingme
MaxtrHasan asked this question in Q&A
Discussion options

You must be logged in to vote

`
class Program
{
[DllImport("user32.dll")]
public static extern bool EnumDisplaySettings(
string deviceName, int modeNum, ref DEVMODE devMode);
const int ENUM_CURRENT_SETTINGS = -1;

    const int ENUM_REGISTRY_SETTINGS = -2;

    [StructLayout(LayoutKind.Sequential)]
    public struct DEVMODE
    {

        private const int CCHDEVICENAME = 0x20;
        private const int CCHFORMNAME = 0x20;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x20)]
        public string dmDeviceName;
        public short dmSpecVersion;
        public short dmDriverVersion;
        public short dmSize;
        public short dmDriverExtra;
        public int dmFields;
        public int dmPositionX;
  …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MaxtrHasan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants