title: Getting all supported screen resolutions
body: <p>I'm looking for a way to get all supported resolutions.</p>
  
  <p>After searching here for some solutions I got this code working:</p>
  
  <pre><code>#include "Windows.h"
  #include &lt;Windows.h&gt;
  #include &lt;iostream&gt;
  
  
  using namespace std;
  
  int main()
  {
      DEVMODE dm = { 0 };
      dm.dmSize = sizeof(dm);
      for( int iModeNum = 0; EnumDisplaySettings( NULL, iModeNum, &amp;dm ) != 0; iModeNum++      ) 
      {
         cout &lt;&lt; "Mode #" &lt;&lt; iModeNum &lt;&lt; " = " &lt;&lt; dm.dmPelsWidth &lt;&lt; "x" &lt;&lt; dm.dmPelsHeight &lt;&lt; endl;
       }
   int age;
   cin&gt;&gt;age;
  </code></pre>
  
  <p>}</p>
  
  <p>I have 2 problems with this code:</p>
  
  <ol>
  <li><p>When running it, I get the same resolution over and over again. 
  For example : Mode0, Mode1, Mode2..... Mode17 are all : 320x200</p></li>
  <li><p>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..</p></li>
  </ol>
  
  <p>Can anyone help and advise please?
  Thanks!</p>