How to get Monitor serial number?

2019-06-23 19:51发布

Does anyone know how to get the connected monitors serial number in C or C++? I found some code, but they are written in vbs which i don't understand. I need some example code written in C or C++. I know that the serial numbers are read from EDID but unfortunately i don't know how :( Could someone help me?

Thanks

Update: I also need the monitors type too, but this can be read from EDID too somehow

标签: c++ c windows edid
3条回答
可以哭但决不认输i
2楼-- · 2019-06-23 20:21

It isn't exactly what you are looking for, but a good starting point should be GetMonitorInfo

I think digging some more in the msdn pages should give you everything you need. MSDN is actually a great place to look for C/C++ Windows API functions.

查看更多
霸刀☆藐视天下
3楼-- · 2019-06-23 20:28

This DisplayDetails.GetMonitorDetails() code worked great for me. I found in my testing that Dell monitors reliably returned S/N information, however all non-Dell displays I tried (3 other brands) did not.

查看更多
疯言疯语
4楼-- · 2019-06-23 20:30

Here is a link to hopefully more readable VB code. What he's basically doing is looking in the registry where windows stored the EDID data of the monitor. It is located at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY\...\Device Parameters

In the wikipedia article you can find information about the EDID format

查看更多
登录 后发表回答