EventHandler在Windows应用程序中获得HDMI连接
我正在寻找事件处理程序,以获取HDMI使用C#/WPF连接的HDMI,例如MyNetworkavailabilityChangeHangeHandler的使用方式,用于检测何时互联网断开或连接。
I am looking for event handler to get the information when HDMI is connected or disconnected using c#/WPF like how myNetworkAvailabilityChangeHandler is used to detect when internet gots disconnected or connected.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有直接的答案,但是您可以使用 SystemEvents 来实现这一目标。
C#中的代码:
您可以使用模型类继续更新HDMI状态。
因此,每次您的HDMI都会连接或断开 SystemEvents_displaysettingsChanged 都会触发,然后检查HDMI连接。
There is no direct answer to this but you can use the SystemEvents to achieve this.
Code in C# :
You can use the model class to keep on updating the HDMI status.
So every time your HDMI will connect or disconnect SystemEvents_DisplaySettingsChanged will trigger and then it will check the HDMI connection.