使用c ++通过API更改windows7默认声音? [英] change windows7 default sounds via an API using c++?

查看:67
本文介绍了使用c ++通过API更改windows7默认声音?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



操作系统 - Win7 pro x64,使用VS2010 c ++。



我' ll寻找一种从我的c ++应用程序中以编程方式更改默认窗口声音的方法。在有人说之前......我知道,我知道......通常你不会这样做,因为它会扰乱机器的其他用户等,但是这个应用程序是用于非常特定的用途而且pc不会以常规的多用户方式使用。只有一个用户,他们必须使用我正在开发的单个应用程序。



好​​的,我在哪里......我更喜欢尽可能使用Windows API,但我看不到我应该开始的地方,或者即使有API函数也可以这样做?



任何帮助朝着正确的方向会很棒。



谢谢

Dave

Hi all,

OS - Win7 pro x64, using VS2010 c++.

I'll looking for a way to pro grammatically change the default window sounds from my c++ application. Before anyone says it... I know, I know... Normally you wouldn't want to do this as it would upset the other users of the machine etc, however this application is for a very specific use and the pc will not be used in a regular 'multi-user' way. There will only ever be one user and they have to use the single application that I'm developing.

Ok, where was I... I'd prefer to use the Windows API if possible, but I can't see where I'm supposed to begin, or even if there are API functions to do this?

Any help in the right direction would be great.

Thanks
Dave

推荐答案

简短的回答是更改注册表。



这是一篇关于这个主题的文章。



播放系统控制面板中定义的Windows声音事件 [ ^ ]





来自文章:



Short answer is to change the registry.

Here's an article on the subject.

Play Windows sound events defined in system Control Panel[^]


From the article:

Every sound event is based on :

    .default Wave file defined by the vendor of the application.
    .current Wave file currently used for this sound event.
    HKEY_CURRENT_USER\AppEvents\EventLabels\<EVENTNAME> Description used to display sound event.

With this knowledge, we can rebuild the control panel view of the system sounds. We're also able to add our own sound events to registry. All we have to do is create some registry keys at the right position.


非常感谢,



我会调查这个方法。



Dave
Many thanks,

I'll look into the approach.

Dave


这篇关于使用c ++通过API更改windows7默认声音?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆