C#如何禁用屏幕上的键盘声在Windows XP / 7 [英] C# how to disable on-screen keyboard sound in windows xp/7
本文介绍了C#如何禁用屏幕上的键盘声在Windows XP / 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Windows上运行的C#应用程序XP / 7,我正在使用屏幕键盘
当声音使能,是导致问题的延迟。
我想关闭声音。
我如何能够通过我的C#应用程序代码关闭声音。
任何想法?
解决方案
您可以从注册表中搜索</ p>
<$ P $禁用p> [HKEY_CURRENT_USER\Software\Microsoft\Osk]
ClickSound= DWORD:00000001 //相关注册表项
您可以使用此代码来改变它
的RegistryKey键= Registry.CurrentUser; //键得到值=HKEY_CURRENT_USER
的RegistryKey oskKey = key.CreateSubKey(@Software\Microsoft\Osk); //此行会打开HKEY_CURRENT_USER\Software\Microsoft\Osk
oskKey.SetValue(ClickSound,0); (启用)默认//设置ClickSound的值为0(禁止),这是1。
我没有测试它尚未但是你可能在这之后重新启动osk.exe。
I have a C# application running on windows xp/7 where I'm using onscreen keyboard.
When the sound is enabled there is a delay which causes problems. I would like to disable the sound.
How can I disable the sound through my C# application code. Any ideas ?
解决方案
You can disable it from registry
[HKEY_CURRENT_USER\Software\Microsoft\Osk]
"ClickSound"=dword:00000001 // Related Registry Key
You can use this code to change it
RegistryKey key = Registry.CurrentUser; //key gets the value = "HKEY_CURRENT_USER"
RegistryKey oskKey = key.CreateSubKey(@"Software\Microsoft\Osk");// This line opens the "HKEY_CURRENT_USER\Software\Microsoft\Osk"
oskKey.SetValue("ClickSound", 0); // Set the value of ClickSound to 0(disable) which is 1(enabled) by default.
I haven't tested it yet but you may have to restart osk.exe after this.
这篇关于C#如何禁用屏幕上的键盘声在Windows XP / 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文