Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 819549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:19:39+00:00 2026-05-15T02:19:39+00:00

I have done the global hotkeys for two key combination using the below code.

  • 0

I have done the global hotkeys for two key combination using the below code. How can i do the same operation for three key combinations like (ctrl + shift + esc) (ctrl + shift + tab) ??

Code for two key combination :

   var TabShift = Keys.Tab | Keys.Shift;
   RegisterGlobalHotKey(TabShift, USE_ALT);


    DllImport("user32.dll")]


     private static extern int RegisterHotKey(IntPtr hwnd, int id, int fsModifiers, int vk);

    [DllImport("user32.dll")]
    private static extern int UnregisterHotKey(IntPtr hwnd, int id);


    private void RegisterGlobalHotKey(Keys hotkey, int modifiers)
    {
        try
        {
            // increment the hot key value - we are just identifying
            // them with a sequential number since we have multiples
            mHotKeyId++;

            if (mHotKeyId > 0)
            {
                // register the hot key combination
                if (RegisterHotKey(this.Handle, mHotKeyId, modifiers, Convert.ToInt16(hotkey)) == 0)
                {
                    // tell the user which combination failed to register -
                    // this is useful to you, not an end user; the end user
                    // should never see this application run
                    MessageBox.Show("Error: " + mHotKeyId.ToString() + " - " +
                        Marshal.GetLastWin32Error().ToString(),
                        "Hot Key Registration");
                }
            }
        }
        catch
        {
            // clean up if hotkey registration failed -
            // nothing works if it fails
            UnregisterGlobalHotKey();
        }
    }

    private void UnregisterGlobalHotKey()
    {
        // loop through each hotkey id and
        // disable it
        for (int i = 0; i < mHotKeyId; i++)
        {
            UnregisterHotKey(this.Handle, i);
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T02:19:40+00:00Added an answer on May 15, 2026 at 2:19 am

    You can simply “or” the values together:

    // Alt + Shift + Tab
    RegisterGlobalHotKey(Keys.Tab, MOD_ALT | MOD_SHIFT);
    

    Note that MOD_ALT and friends are defined in WinUser.h as:

    #define MOD_ALT         0x0001
    #define MOD_CONTROL     0x0002
    #define MOD_SHIFT       0x0004
    #define MOD_WIN         0x0008
    

    So you have to make sure you’re passing the correct values in for the modifiers there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have done one program that allow user can listen to the music via
I have done small project in c++, the IDE I am using is Visual
I have done a global mouse event in my windows application. When i click
I have referred to similar questions like this and have done exactly the same
I have two xml files, one of them is dev.xml which has this code
I have following Java code: import java.io.*; class Global{ public static int a =
I'm trying to make thumbnails-grid based on XML. So far I have done code
Have done quite a bit of searching for a guide (of any substance) for
Have done some research and found some stuff that may be helpful. I would
I have done an email approval script following James Ferreira's youtube tutorial here .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.