使用 C# 更新 WISP(Windows Ink Service Platform)的注册表更改 [英] Update registry changes of WISP (Windows Ink Service Platform) with C#
问题描述
我正在尝试在 Windows 7 或 8 上为我的 WPF 绘图应用程序启用/禁用触摸功能.
I am trying to enable/disable touch capability on Windows 7 or 8 for my WPF drawing application.
据我搜索,链接 如何在应用程序、窗口或控制级别关闭所有触摸输入? 为触摸功能状态提供了注册表的正确位置.
As far as I searched, the link How to turn off all touch input at application, window or control level? gives a right location of the registry for touch capability status.
但是,它并没有即时受到影响,因为 Windows 系统可能无法确认更改.
However, it did not be affected on-the-fly because windows system may not be acknowledged the changes.
在我的假设中,需要使用 SystemParametersInfo 刷新 User32.dll 才能在不重新启动的情况下进行更改.但很难弄清楚如何做到这一点,因为我不知道哪个 SPI_something 与 WISP 相关.
In my assumption, User32.dll refresh with SystemParametersInfo is required to make changes without reboot. But hard to figure out how to do that because I don't know which SPI_something is related to WISP.
有没有其他方法或者你能帮我实现它吗?
Is there another method or could you help me to make it happen?
示例代码如下(与上面的 StackOverflow 引用链接非常相似)
The sample code is as below (pretty similar to above StackOverflow referenced link)
RegistryKey regKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Wisp\Touch", true);
if (regKey != null)
{
regKey.SetValue("TouchGate", 0x00000000); // Turn off touch.
regKey.Close();
// NOTIFY REGISTRY CHANGES TO WINDOWS
}
推荐答案
问题的当前答案如何在应用程序、窗口或控件级别关闭所有触摸输入?使 Windows 重新读取注册表.请参阅:答案内部静态 void Notify_SettingChange()
方法.
The current answer to the question How to turn off all touch input at application, window or control level? also gives a way to make Windows to re-read registry. See: the answer's
internal static void Notify_SettingChange()
method.
SystemParametersInfo 中没有记录用于禁用触摸的 SPI_* 常量.此外,所有 SPI_ 常量都与辅助功能相关 - 而不是像触摸这样的通用功能.
There is no documented SPI_* constant for touch disabling in SystemParametersInfo. Moreover all the SPI_ constants there are related to accessibility features - not general features like touch.
这篇关于使用 C# 更新 WISP(Windows Ink Service Platform)的注册表更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!