how can I disable windows key in c#? -


How can I disable or lock windows buttons?

  /// & lt; Summary & gt; /// Security routines related to the Windows key on a standard personal computer keyboard are /// & lt; / Summary & gt; Public Static Class WindowsKey {/// & lt; Summary & gt; /// disables Windows key /// & lt; / Summary & gt; /// & LT; Comment & gt; The current user may need to turn off or restart the system & lt; / Comment & gt; Disable Public Static Zero () {Registry key = zero; (Try "system \\ CurrentControlSet \\ control \\ keyboard layout" true) {key = Registry.LocalMachine.OpenSubKey; Byte [] Binary = new byte [] {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5B, 0xE0, 0x00, 0x00, 0x5C, 0xE0, 0x00, 0x00, 0x00, 0x00}; Key.SetValue ("Scancode Map", Binary, Registry Value. Binary); } Hold (System.Exception pre) {Debug.Assert (wrong, ex.ToString ()); } Finally {key.Close (); }} /// & lt; Summary & gt; /// Windows key enables /// & lt; / Summary & gt; /// & LT; Comment & gt; The current user may need to turn off or restart the system & lt; / Comment & gt; Enable Public Static Zero () {Registry key = zero; Try {key = Registry.LocalMachine.OpenSubKey ("System \\ CurrentControlSet \\ Control \\ Keyboard Layout", True); Key.DeleteValue ("Scancode Map" is true); } Hold (System.Exception pre) {Debug.Assert (wrong, ex.ToString ()); } Finally {key.Close (); }}}  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -