如何在VC中获取设备显示名称?

发布于 2024-12-23 09:45:55 字数 252 浏览 4 评论 0原文

我可以使用 GetRawInputDeviceList 成功查询我的系统以获取原始设备列表,并使用 GetRawInputDeviceInfo 获取有关各个设备的详细信息。

但是,当查询名称时,GetRawInputDeviceInfo 返回“设备路径”。我想要得到的是

设备管理器中显示的“显示名称”->鼠标和其他指点设备 -> (鼠标设备)->属性->详情->显示名称

这怎么可能?

TIA

I can successfully query my system with GetRawInputDeviceList to get a list of raw devices and GetRawInputDeviceInfo to get detailed info on individual devices.

However GetRawInputDeviceInfo returns the "device path" when the name is queried. What I would like to get is the "display name" as show in the

Device Manager -> Mice and Other Pointing devices -> (mouse device) -> Properties -> Details -> Display Name

How is this possible?

TIA

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

掀纱窥君容 2024-12-30 09:45:55

看起来“RIDI_DEVICENAME”是注册表中的路径。因此,我可以使用它来进行注册表查找并从“DeviceDesc”键中获取最后一个分隔元素。

谢谢 - 我希望对其他人有帮助。

Looks like the "RIDI_DEVICENAME" is a path in the registry. So I can use this to do a Registry look up and grab the last delimted element form the 'DeviceDesc' key.

Thanks - I hope helps someone else.

独行侠 2024-12-30 09:45:55
UINT WINAPI GetRawInputDeviceInfo(
  __in_opt     HANDLE hDevice,
  __in         UINT uiCommand,
  __inout_opt  LPVOID pData,
  __inout      PUINT pcbSize
);

您尝试过吗,uiCommand = RIDI_DEVICENAME

GetRawInputDeviceInfo 参考:http://msdn.microsoft.com/en-us/library/windows/desktop/ms645597(v=VS.85).aspx

UINT WINAPI GetRawInputDeviceInfo(
  __in_opt     HANDLE hDevice,
  __in         UINT uiCommand,
  __inout_opt  LPVOID pData,
  __inout      PUINT pcbSize
);

Did you try, uiCommand = RIDI_DEVICENAME ?

GetRawInputDeviceInfo Reference: http://msdn.microsoft.com/en-us/library/windows/desktop/ms645597(v=VS.85).aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文