gpt4 book ai didi

C# 如何在 windows xp/7 中禁用屏幕键盘声音

转载 作者:太空狗 更新时间:2023-10-29 23:24:27 25 4
gpt4 key购买 nike

我有一个在 Windows xp/7 上运行的 C# 应用程序,我正在使用屏幕键盘。

enter image description here

启用声音时会出现延迟,从而导致问题。我想禁用声音。

enter image description here

如何通过我的 C# 应用程序代码禁用声音。有任何想法吗 ?

最佳答案

您可以从注册表中禁用它

[HKEY_CURRENT_USER\Software\Microsoft\Osk] 
"ClickSound"=dword:00000001 // Related Registry Key

你可以用这段代码来改变它

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.

我还没有测试过,但你可能需要在这之后重新启动 osk.exe。

关于C# 如何在 windows xp/7 中禁用屏幕键盘声音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14139349/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com