How to get Monitor serial number?

╄→尐↘猪︶ㄣ 提交于 2019-12-10 15:55:46

问题


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


回答1:


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.




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/7269216/how-to-get-monitor-serial-number

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!