Reputation: 3392
I'm looking for a way to get all supported resolutions.
After searching here for some solutions I got this code working:
#include "Windows.h"
#include <Windows.h>
#include <iostream>
using namespace std;
int main()
{
DEVMODE dm = { 0 };
dm.dmSize = sizeof(dm);
for( int iModeNum = 0; EnumDisplaySettings( NULL, iModeNum, &dm ) != 0; iModeNum++ )
{
cout << "Mode #" << iModeNum << " = " << dm.dmPelsWidth << "x" << dm.dmPelsHeight << endl;
}
int age;
cin>>age;
}
I have 2 problems with this code:
When running it, I get the same resolution over and over again. For example : Mode0, Mode1, Mode2..... Mode17 are all : 320x200
When using the Gui and looking at the available resolutions, I don't have 320x200 as an option . I see that my computer supports 600x800 and upper, but when running this small exe I also see 400x300, 320x240 etc..
Can anyone help and advise please? Thanks!
Upvotes: 3
Views: 2845
Reputation: 3851
Your code is working perfectly. Regarding your 2 problems:
EDIT: By "frequency" we mean "refresh rate"
Upvotes: 3