Search code examples
c#windowspinvokeaccessibilityshortcut

Disabling Accessibility Shortcuts in .NET Application?


This msdn article -- http://msdn.microsoft.com/en-us/library/bb219746(VS.85).aspx#Disabling_Accessibility_Shortcut_Keys -- provides information for C++ programmers on how to temporarily disable the windows shortcuts for accessibility (such as holding Shift for 8 seconds, or pressing Shift more than 5 times in quick succession).

Surely there's some easy way to do this in C#, but I can't find any resources on this. I'm using DirectInput in a non-fullscreen application.

All I want to do is not have the annoying popups come up; I'd prefer something that doesn't have to muck with the windows settings, though, just in case the application shuts down in a non-graceful manner (I'd prefer not to have the user's settings be permanently altered in those situations).

Any thoughts?


Solution

  • You will have to do the same thing that is done in the link you reference. The SystemParametersInfo API function can be called through the P/Invoke layer and you can find the definition here:

    http://www.pinvoke.net/default.aspx/user32/SystemParametersInfo.html