本文介绍了卷更改,而不创建IAudioEndpointVolume的通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个C ++应用程序,作为Windows服务运行,以限制Windows 7计算机的音量。用户可以为不同的日期和时间指定不同的规则,服务将平滑地更改卷。要实现这一点,我使用IAudioEndpointVolume接口。一般来说,它的工作原理是... ...



但是,存在一个奇怪的行为,我不能解释。当切换用户时,音量突然下降,但它不会像预期的那样生成通知。什么也很奇怪,SndVol.exe中的滑块显示正确的卷值。
由于缺少通知,我的程序无法对此更改做出反应,因此无法再执行其意图。
我发现,如果我移动音量滑块一点,音量会再次切换回到正确的音量。当然,这会生成一个将由我的服务处理的通知。我的服务将强制正确的音量。



我不明白为什么音量在SndVol.exe中没有显示,而且没有创建通知。切换回第一个用户帐户并不能解决问题。即使注销后卷仍然在错误的水平。



据我所见,关于IAudioEndpointVolume接口的文档没有提到任何关于不同的用户会话。 / p>

有什么想法可能会导致这个问题,或者我可以尝试解决什么问题?

解决方案

好吧,经过一段时间后,我现在相信,音量的变化是由我们使用的第三方驱动程序引起的。这个驱动程序有自己的音量控制机制。我只是在启动驱动程序的控制GUI后不再体验到更改了。即使在重新启动后,问题似乎是固定的。然而,一段时间后,它又被打破了一个原因,我不能弄清楚。但这只是发生,因为一些安全设置阻止驱动程序的控制GUI启动时作为非管理员登录。我现在修复了这个问题,希望一切正常工作。



此外,所有用户会话共享相同的音量控制。这意味着如果我在一个用户会话中使用SndVol更改卷,则在其他用户会话中发生相同的更改。我的服务会收到所有这些更改的通知。因此,看起来我在用户之间切换时没有收到通知,因为更改是由以管理员身份登录时启动的驱动程序控制GUI引起的。但是这种改变发生在驱动程序中,是一个较低层,所以Windows不知道更改。



我们使用的驱动程序是。


I'm have written a C++ application that is running as a Windows service to limit the volume of a Windows 7 computer. The user can specify different rules for different days and times and the service will smoothly change the volume. To implement this I use the IAudioEndpointVolume interface. In general it works like intended...

However, there exists a strange behavior I cannot explain yet. When switching users the volume suddenly drops but it does not generate a notification as one would expect. What is also strange is that the sliders in the SndVol.exe show the correct value for the volume.Because of the missing notification my program cannot react to this change and as a result it cannot perform its intend anymore.I have discovered that the volume will switch back to its correct volume again if I move the volume slider a bit. Of course this generates a notification that will be handled by my service. My service will then force the correct volume.

I don't understand why the volume changes without being visible in SndVol.exe and without creating a notification. Switching back to the first user account does not solve the problem. Even after logging out the volume is still at the wrong level.

As far as I have seen the documentation about the IAudioEndpointVolume interface does not mention anything about different user session.

Any ideas on what might cause this problem or what I could try to fix it?

解决方案

Well, after some time I am now quite confident that the volume change is caused by the 3rd party driver we are using. This driver has it's own volume control mechanism. I do not experience the change anymore after just starting the drivers' control GUI. Even after a restart the problem seems to be fixed. However, after some time it gets broken again for a reason I cannot figure out. But this only happened because some security settings prevented the drivers' control GUI to start when logged in as non admin. I fixed this now and expect everything to work now.

Furthermore it looks like that all user sessions share the same volume control. That means if I change the volume with SndVol in one user session the same change happens in the other user session. My service receives notifications for all these changes. So it looks like that I did not receive a notification when switching between users because the change was caused by the driver's control GUI starting when logging in as administrator. But this change happened in the driver, a lower layer, so that Windows is not aware of the change.

The driver we are using is the kX Audio Driver.

这篇关于卷更改,而不创建IAudioEndpointVolume的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 11:20