title: Why does EnumDisplayDevices return so many results?
body: <p>I have a Windows computer with an Nvidia card and an Intel card. Each GPU has one screen connected to it.</p>
  <p>Then I use the following code to list all the display devices:</p>
  <pre class="lang-c prettyprint-override"><code>DISPLAY_DEVICE lDevice;
  lDevice.cb = sizeof(DISPLAY_DEVICE);
  int i = 0;
  while (EnumDisplayDevices(NULL, i, &amp;lDevice, EDD_GET_DEVICE_INTERFACE_NAME) != 0) {
      printf(
          &quot;i: %d\n&quot;
          &quot;cb: %d\n&quot;
          &quot;DeviceName: %s\n&quot;
          &quot;DeviceString: %s\n&quot;
          &quot;StateFlags: %d\n&quot;
          &quot;DeviceID: %s\n&quot;
          &quot;DeviceKey: %s\n&quot;,
          i,
          lDevice.cb,
          lDevice.DeviceName,
          lDevice.DeviceString,
          lDevice.StateFlags,
          lDevice.DeviceID,
          lDevice.DeviceKey
      );
      i++;
  }
  </code></pre>
  <p>This is the output:</p>
  <pre><code>i: 0
  cb: 424
  DeviceName: \\.\DISPLAY1
  DeviceString: Intel(R) HD Graphics 4600
  StateFlags: 134217729
  DeviceID: 
  DeviceKey: \Registry\Machine\System\CurrentControlSet\Control\Video\{3C36D58A-5C95-11EB-ACEC-B083FE9A7909}\0000
  i: 1
  cb: 424
  DeviceName: \\.\DISPLAY2
  DeviceString: Intel(R) HD Graphics 4600
  StateFlags: 0
  DeviceID: 
  DeviceKey: \Registry\Machine\System\CurrentControlSet\Control\Video\{3C36D58A-5C95-11EB-ACEC-B083FE9A7909}\0001
  i: 2
  cb: 424
  DeviceName: \\.\DISPLAY3
  DeviceString: NVIDIA GeForce GTX 1060 3GB
  StateFlags: 5
  DeviceID: 
  DeviceKey: \Registry\Machine\System\CurrentControlSet\Control\Video\{46FC15D3-C98C-11E9-ACCA-D1E7BCEC4649}\0000
  i: 3
  cb: 424
  DeviceName: \\.\DISPLAY4
  DeviceString: NVIDIA GeForce GTX 1060 3GB
  StateFlags: 0
  DeviceID: 
  DeviceKey: \Registry\Machine\System\CurrentControlSet\Control\Video\{46FC15D3-C98C-11E9-ACCA-D1E7BCEC4649}\0001
  i: 4
  cb: 424
  DeviceName: \\.\DISPLAY5
  DeviceString: NVIDIA GeForce GTX 1060 3GB
  StateFlags: 0
  DeviceID: 
  DeviceKey: \Registry\Machine\System\CurrentControlSet\Control\Video\{46FC15D3-C98C-11E9-ACCA-D1E7BCEC4649}\0002
  i: 5
  cb: 424
  DeviceName: \\.\DISPLAY6
  DeviceString: NVIDIA GeForce GTX 1060 3GB
  StateFlags: 0
  DeviceID: 
  DeviceKey: \Registry\Machine\System\CurrentControlSet\Control\Video\{46FC15D3-C98C-11E9-ACCA-D1E7BCEC4649}\0003
  </code></pre>
  <p>I don't understand why there are 6 display devices, 2 for the Intel card and 4 for the Nvidia card. I think I'm probably missunderstanding the concept of display devices.</p>
  <p>Here's the full code: <a href="https://gist.github.com/tuket/0cc2f9b77a4a6a82a72655941547e292" rel="nofollow noreferrer">https://gist.github.com/tuket/0cc2f9b77a4a6a82a72655941547e292</a></p>