title: how to list available monitors in c++ windows 7?
body: <p>I am trying to get the attached monitors in windows 7 using c++, the code I am using is as follows  </p>
  
  <pre><code>void ListDisplayDevices()
  {
      int index=0;
      DISPLAY_DEVICE dd;
      dd.cb = sizeof(DISPLAY_DEVICE);
  
      while (EnumDisplayDevices(NULL, index++, &amp;dd, 0))
      {
          if (dd.StateFlags &amp; DISPLAY_DEVICE_PRIMARY_DEVICE) printf("* ");
          printf("%s, %s\n", dd.DeviceName, dd.DeviceString);
      }
  }
  </code></pre>
  
  <p>but the output of this function is simply  </p>
  
  <pre><code>* \, A
  \, A
  \, A
  \, R
  \, R
  \, R
  \, V
  </code></pre>
  
  <p>What may be wrong here?</p>