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 9000723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:20:46+00:00 2026-06-16T00:20:46+00:00

How can I simulate Ctrl+Alt+H using keybd_event() ? The following code , doesn’t work

  • 0

How can I simulate Ctrl+Alt+H using keybd_event() ? The following code , doesn’t work :

    keybd_event((byte)Convert.ToInt32(Keys.Control), (byte)MapVirtualKey(Convert.ToInt32(Keys.Control), 0), 0, 0);
        keybd_event((byte)Convert.ToInt32(Keys.Alt), (byte)MapVirtualKey(Convert.ToInt32(Keys.Alt), 0), 0, 0);
        keybd_event((byte)Keys.H, (byte)MapVirtualKey(Convert.ToInt32(Keys.H), 0), 0, 0);
        keybd_event((byte)Keys.H, (byte)MapVirtualKey(Convert.ToInt32(Keys.H), 0), KEYEVENTF_KEYUP, 0);
        keybd_event((byte)Convert.ToInt32(Keys.Alt), (byte)MapVirtualKey(Convert.ToInt32(Keys.Alt), 0), KEYEVENTF_KEYUP, 0);
        keybd_event((byte)Convert.ToInt32(Keys.Control), (byte)MapVirtualKey(Convert.ToInt32(Keys.Control), 0), KEYEVENTF_KEYUP, 0);   
  • 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-06-16T00:20:46+00:00Added an answer on June 16, 2026 at 12:20 am

    You can use SendKeys to do this:

    SendKeys.Send("^%H");
    

    http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx

    EDIT
    (See comments below…)

    You want to launch a windows shortcut on your desktop that you have setup with a specific set of hot keys. In this case CTRL+ALT+H. You want to write an app that will execute that shortcut key combination.

    In order for this to work your desktop will have to have “focus”. This means that no other windows should be up. So, start your application, minimize all other windows, and then press the button on your application. Here is the code you should have behind your button:

        private void button1_Click(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Minimized;
            SendKeys.SendWait("^%h");
        }
    

    This will minimize the current window thus giving focus to your desktop. It will then send the CTRL and ALT and H keys to the desktop which will launch your shortcut.

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

Sidebar

Related Questions

Can I simulate in C#/C++ code Control + Alt + Delete sequence in Vista?
How can I simulate a key (ctrl) being hold down while some other code
Using myObject.performClick() I can simulate click event from the code. Does something like this
all is said in the title, how can I simulate the combination Ctrl +
So far, I know that in Rails I can simulate a PUT request using
I was wondering if you can simulate two sheets of paper using Jquery but
I have been using some P/Invoke code to simulate a key press, but I
How I can simulate Derived Table with linq? Consider this Code: SELECT * FROM
I've searched and discovered that I can simulate a keypress event using jQuery, but
ASP.Net: In code-behind I can simulate <%# Eval(Property)%> with a call to DataBinder.Eval(myObject,Property); How

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.