title: How to disable Alt + Shift + Tab using c#?
body: <p>How to disable <kbd>Alt</kbd>+<kbd>⇧Shift</kbd>+<kbd>↹Tab</kbd> using c# ? I have disabled the <kbd>Alt</kbd>+<kbd>↹Tab</kbd> using a function which gets only two parameters. But to disable three key strokes ??</p>
  
  <p>I anyone need my code to disable the two key strokes combination, i cam post it. But it is quite big.</p>
  
  <p>To disable <kbd>Alt</kbd>+<kbd>↹Tab</kbd> I do this,</p>
  
  <pre><code>RegisterGlobalHotKey(Keys.Tab, USE_ALT); 
  </code></pre>
  
  <p>How to pass three parameters [Alt, Shift, Tab] ??</p>
  
  <pre><code>   public sealed class KeyboardHook : IDisposable
  {
      // Registers a hot key with Windows.
      [DllImport("user32.dll")]
      private static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vk);
      // Unregisters the hot key with Windows.
      [DllImport("user32.dll")]
      private static extern bool UnregisterHotKey(IntPtr hWnd, int id);
  
      /// &lt;summary&gt;
      /// Represents the window that is used internally to get the messages.
      /// &lt;/summary&gt;
      private class Window : NativeWindow, IDisposable
      {
          private static int WM_HOTKEY = 0x0312;
  
          public Window()
          {
              // create the handle for the window.
              try
              {
                  this.CreateHandle(new CreateParams());
              }
              catch (Exception ex)
              {
                  ExceptionHandler.writeToLogFile(System.Environment.NewLine + "Target  :  " + ex.TargetSite.ToString() + System.Environment.NewLine + "Message :  " + ex.Message.ToString() + System.Environment.NewLine + "Stack   :  " + ex.StackTrace.ToString());
              }
          }
  
          /// &lt;summary&gt;
          /// Overridden to get the notifications.
          /// &lt;/summary&gt;
          /// &lt;param name="m"&gt;&lt;/param&gt;
          protected override void WndProc(ref Message m)
          {
              try
              {
                  base.WndProc(ref m);
  
                  // check if we got a hot key pressed.
                  if (m.Msg == WM_HOTKEY)
                  {
                      // get the keys.
                      Keys key = (Keys)(((int)m.LParam &gt;&gt; 16) &amp; 0xFFFF);
                      ModifierKeys modifier = (ModifierKeys)((int)m.LParam &amp; 0xFFFF);
  
                      // invoke the event to notify the parent.
                      if (KeyPressed != null)
                          KeyPressed(this, new KeyPressedEventArgs(modifier, key));
                  }
              }
              catch (Exception ex)
              {
                  ExceptionHandler.writeToLogFile(System.Environment.NewLine + "Target  :  " + ex.TargetSite.ToString() + System.Environment.NewLine + "Message :  " + ex.Message.ToString() + System.Environment.NewLine + "Stack   :  " + ex.StackTrace.ToString());
              }
          }
  
          public event EventHandler&lt;KeyPressedEventArgs&gt; KeyPressed;
  
          #region IDisposable Members
  
          public void Dispose()
          {
              this.DestroyHandle();
          }
  
          #endregion
      }
  
      private Window _window = new Window();
      private int _currentId;
  
      public KeyboardHook()
      {
          try
          {
              // register the event of the inner native window.
              _window.KeyPressed += delegate(object sender, KeyPressedEventArgs args)
              {
                  if (KeyPressed != null)
                      KeyPressed(this, args);
              };
          }
          catch (Exception ex)
          {
              ExceptionHandler.writeToLogFile(System.Environment.NewLine + "Target  :  " + ex.TargetSite.ToString() + System.Environment.NewLine + "Message :  " + ex.Message.ToString() + System.Environment.NewLine + "Stack   :  " + ex.StackTrace.ToString());
          }
      }
  
      /// &lt;summary&gt;
      /// Registers a hot key in the system.
      /// &lt;/summary&gt;
      /// &lt;param name="modifier"&gt;The modifiers that are associated with the hot key.&lt;/param&gt;
      /// &lt;param name="key"&gt;The key itself that is associated with the hot key.&lt;/param&gt;
      public void RegisterHotKey(ModifierKeys modifier, Keys key)
      {
          try
          {
              // increment the counter.
              _currentId = _currentId + 1;
  
              // register the hot key.
              if (!RegisterHotKey(_window.Handle, _currentId, (uint)modifier, (uint)key))
                  throw new InvalidOperationException("Couldn’t register the hot key.");
          }
          catch (Exception ex)
          {
              ExceptionHandler.writeToLogFile(System.Environment.NewLine + "Target  :  " + ex.TargetSite.ToString() + System.Environment.NewLine + "Message :  " + ex.Message.ToString() + System.Environment.NewLine + "Stack   :  " + ex.StackTrace.ToString());
          }
      } 
  
      /// &lt;summary&gt;
      /// A hot key has been pressed.
      /// &lt;/summary&gt;
      public event EventHandler&lt;KeyPressedEventArgs&gt; KeyPressed;
  
      #region IDisposable Members
  
      public void Dispose()
      {
          // unregister all the registered hot keys.
          for (int i = _currentId; i &gt; 0; i--)
          {
              UnregisterHotKey(_window.Handle, i);
          }
  
          // dispose the inner native window.
          _window.Dispose();
      }
  
      #endregion
  }
  
  /// &lt;summary&gt;
  /// Event Args for the event that is fired after the hot key has been pressed.
  /// &lt;/summary&gt;
  public class KeyPressedEventArgs : EventArgs
  {
      private ModifierKeys _modifier;
      private Keys _key;
  
      internal KeyPressedEventArgs(ModifierKeys modifier, Keys key)
      {
          _modifier = modifier;
          _key = key;
      }
  
      public ModifierKeys Modifier
      {
              get { return _modifier; }
          }
  
          public Keys Key
          {
              get { return _key; }
          }
      }
  
      /// &lt;summary&gt;
      /// The enumeration of possible modifiers.
      /// &lt;/summary&gt;
      [Flags]
      public enum ModifierKeys : uint
      {
          Alt = 1,
          Control = 2,
          Shift = 4,
          Win = 8
      }
  </code></pre>