如何找到笔记本电脑是否插入扩展坞

编程入门 行业动态 更新时间:2024-10-28 00:22:38
本文介绍了如何找到笔记本电脑是否插入扩展坞的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好! 这就是我在C#中制作Windows服务,监控笔记本电脑是否连接到扩展坞,但是我对这部分有一些问题。我已经查看了如果有一个注册表项,我刚刚找到了DockingState,但是值永远不会改变,还有其他方法吗?也许使用ManagementObjectSearcher? Thx! M

Hello everyone! Here is the thing, I''m making a windows service in C# that monitors if the laptop is connected to the docking station, but I´m having some problems with this part. I had already look in the if there is a registry entry, I just found DockingState, but the value never change, is there other way? Maybe with the ManagementObjectSearcher? Thx! M

推荐答案

嗯,有趣。 AFAIK,对接/取消对接是驱动程序而不是操作系统的功能。可能有办法获得状态,检查这是否有帮助 CM_Is_Dock_Station_Present [ ^ ] CM_Is_Dock_Station_Present_Ex [ ^ ] Hmm, interesting. AFAIK, docking / undocking is the function of a driver not the OS. May be there is a way to get the state, check if this helps CM_Is_Dock_Station_Present[^] CM_Is_Dock_Station_Present_Ex [^]

查看笔记本电脑后面。如果它被插入扩展坞,它就会非常明显。 说真的,你可以用WMI做到这一点。没有保证,谷歌是你的朋友。 编辑=============== 哦加油!从什么时候开始,我们不能为我们的答案添加一点幽默?我跟进为这个人提供了一个线索。 Look behind the laptop. If it''s plugged into the docking station, it''ll be pretty obvious. Seriously though, you might be able to do it with WMI. No guarantees, and google is your friend. EDIT =============== Oh come on! Since when can''t we add a little humor to our answers? I followed up by providing a lead for the guy.

DockingState是一个枚举值,如果值为0则永远不会改变。如果值为3,则可能需要笔记本电脑制造商提供的驱动程序。 正如Yusef所说,它是驱动程序的功能,而不是操作系统。 DockingState is an enumerated value, if the value is 0 it will never change. If the value is 3 you prbably need the driver from the manufacturer of the laptop. As Yusef has already stated, it is a function of the driver, not the OS. typedef enum { DockStateUnsupported = 0, DockStateUnDocked = 1, DockStateDocked = 2, DockStateUnknown = 3 } DOCKING_STATE;

更多推荐

如何找到笔记本电脑是否插入扩展坞

本文发布于:2023-11-05 15:37:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1561226.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:笔记本电脑

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!