title: How can you get the display adapter used for a particular monitor in Windows?
body: <p>On a Mac, I can use the following to print out the adapter used for a particular monitor:</p>
  
  <pre><code>io_registry_entry_t dspPort = CGDisplayIOServicePort(displays[i]);
  CFDataRef model_;
  model_ = (CFDataRef)IORegistryEntrySearchCFProperty(dspPort,kIOServicePlane,CFSTR("model"),
                                                      kCFAllocatorDefault,
                                                      kIORegistryIterateRecursively | kIORegistryIterateParents);
  
  if (model_) {
    newLine();
    String model((const char*)CFDataGetBytePtr(model_), CFDataGetLength(model_));
    log.printf("Adapter: %s", model.buf);
    CFRelease(model_);
  }
  </code></pre>
  
  <p><strong>Example output- &nbsp;&nbsp; Adapter: AMD Radeon HD 6750M</strong></p>
  
  <p>Where <code>displays[i]</code> is populated using <code>CGGetActiveDisplayList(nDisplays, displays, &amp;nDisplays);</code></p>
  
  <p>Is there any way to do the equivalent operation on Windows? I'm cycling through all displays using <code>EnumDisplayMonitors</code>.</p>
  
  <p>I can get a list of adapters using <code>EnumDisplayDevices</code>, but how do I see which monitor is attached to which adapter?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Using:</p>
  
  <pre><code>for (int i=0; EnumDisplayDevicesA(monitorInfo.szDevice, i, &amp;dev, 0); i++) {
      newLine();
      log.printf("Display Device: %s",(char*)dev.DeviceString);
    }
  </code></pre>
  
  <p>I can get the device names of the monitors themselves, but not the adapters they are connected to!</p>