如何通过Windows API访问系统规格? [英] How do I get access to system specs via the Windows API?

查看:38
本文介绍了如何通过Windows API访问系统规格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从Windows API访问有关计算机规格的信息?我是否需要在注册表中查找(如果有的话)?我希望我的程序可以访问的一些关键信息包括图形卡型号和规格,受支持的OpenGL和DirectX版本,受支持的屏幕分辨率,CPU信息,总/可用磁盘空间以及RAM信息等.在Win32中,我可以使用哪些类型的有效方法来访问此信息?

How do I access information about the computer's specifications from the Windows API? Do I need to look in the registry, if so where? Some key information I would like my programs to have access to are the graphics card model and specs, supported versions of OpenGL and DirectX, supported screen resolutions, CPU information, total/available disk space, and RAM information, among others. What types of efficient methods can I use to access this information in Win32?

非常感谢您的建议!

推荐答案

所有这些信息以及更多信息都通过WMI(Windows Management Instrumentation)在Windows中公开.外观此处查看代码示例.标准Win32 WMI类的集合是在此处记录.

All of this info, and much more, is exposed in Windows through WMI (Windows Management Instrumentation). A good starting point to discover queries and try them out on your machine is the WMI Code Creator tool. It generates code too but not C++ code. That's fairly ugly but boilerplate, look here for code samples. The set of standard Win32 WMI classes is documented here.

这篇关于如何通过Windows API访问系统规格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆