带有shell的开箱即用的WinCE(5.0和6.0)图像似乎具有每次击键时播放的按键声音。 如何在关闭音频系统的同时关闭此声音? (我仍然需要从我的应用程序中听到音频。)它似乎不是我可以设置的系统声音(如窗口最小化或最大化)。我没有在SystemParameters API中看到任何内容。任何帮助将不胜感激。
提前致谢!
答案 0 :(得分:3)
我找到了答案的结合:( http://msdn.microsoft.com/en-us/library/aa913008.aspx),以及一些挖掘未发布的'AudioUpdateFromRegistry'API的源代码。
所以这段代码可以解决问题:
using Microsoft.Win32;
namespace CEAudio
{
public enum KeyClickVolume
{
Off,
Soft,
Loud
};
public class Utility
{
[DllImport("coredll.dll")]
public static extern void AudioUpdateFromRegistry();
static readonly string KeyVolRegKey = @"HKEY_CURRENT_USER\ControlPanel\Volume";
public static KeyClickVolume KeyClickVolume
{
set
{
uint[] vals = new uint[] { 0, 1, 0x10002 };
Registry.SetValue(KeyVolRegKey, "Key", vals[(int)value], RegistryValueKind.DWord);
AudioUpdateFromRegistry();
}
get
{
switch((uint)Registry.GetValue(KeyVolRegKey, "Key", (uint)0x10002))
{
case 0: return KeyClickVolume.Off;
case 1: return KeyClickVolume.Soft;
case 0x10002:
default: return KeyClickVolume.Loud;
}
}
}
}
}
答案 1 :(得分:2)
答案 2 :(得分:1)
我实际上使用了这个注册表值,类似于上面的Adam: [HKEY_LOCAL_MACHINE \ ControlPanel控制] “InputConfig”= DWORD:3
值“3”启用声音控制面板上的“屏幕点击”选项,然后您可以关闭它。
答案 3 :(得分:0)
; This registry setting controls the checkboxes dsiplayed in the Sounds CPL
; under "enable clicks & taps". Set bit0 if you have a keyboard, set bit1 if
; you have a touch screen. Set bit2 if you have HW buttons (NOTE: for now
; HW buttons are mutually exclusive with the keyboard)
[HKEY_LOCAL_MACHINE\ControlPanel]
"InputConfig"=dword:2
我认为这删除了我的水龙头(使用硬件按钮),我在某个时间点在一个随机的论坛中找到它......