I found this page and was unable to get any useful information out of it (it searches the registry for something but never finds it and goes into an infinite loop).
Based on Ofek Shilon's blog post, and tweaked to get all the device IDs (manufacturer ID + product ID strings):
DISPLAY_DEVICE dd;
dd.cb = sizeof(dd);
DWORD dev = 0; // device index
int id = 1; // monitor number, as used by Display Properties > Settings
Str DeviceID;
while (EnumDisplayDevices(0, dev, &dd, 0))
{
DISPLAY_DEVICE ddMon;
ZeroMemory(&ddMon, sizeof(ddMon));
ddMon.cb = sizeof(ddMon);
DWORD devMon = 0;
while (EnumDisplayDevices(dd.DeviceName, devMon, &ddMon, 0))
{
DeviceID.Sprintf("%s", ddMon.DeviceID);
DeviceID = DeviceID.Slice(8);
if (DeviceID.Index("\\") > 0)
DeviceID = DeviceID.Slice(0, DeviceID.Index("\\"));
printf ("DEVICEID = %s --------\n", DeviceID.utf8());
}
devMon++;
ZeroMemory(&ddMon, sizeof(ddMon));
ddMon.cb = sizeof(ddMon);
}
ZeroMemory(&dd, sizeof(dd));
dd.cb = sizeof(dd);
dev++;
}
N.B. Str here is a custom string class but should be easy to refactor to use anything.