简体   繁体   中英

How to detect when an audio device has been unplugged (windows vista) in C#

我想知道如何检测设备插入和拔出插头的时间,然后将笔记本电脑内部扬声器静音/取消静音

In unmanaged code you would listen for WM_DEVICECHANGE in your top level windowproc.

That appears to be the only way to do it in managed code as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM