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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:02:04+00:00 2026-05-25T17:02:04+00:00

I’m making a Windows application that captures keyboard input globally. When a user uses

  • 0

I’m making a Windows application that captures keyboard input globally. When a user uses the CTRL + ALT + G shortcut combo the application uses

SendKey.Send(Guid.NewGuid().ToString());

to type a generaged GUID into whatever text field is in focus. And it should do this regardless of the application taking the input.

It works exactly as I intended the first time you type CTRL + ALT + G but subsequent attempts result in nothing, or just very infrequent successes.

I mean, it all should be very simple and consistent. I have a working global keyboard hook which works all the time, I’ve tested it, but the SendKey.Send() method doesn’t work every time.

I’ve looked all over Google at anything related to my issue but nothing has worked so far.

Anyone have any insight?

EDIT 1:
I’ve tried using SendKey.SendWait() as well, does the same thing. I really want a more responsive way to generate new GUID using this keyboard shortcut approach.

EDIT 2:

Below is the essential parts of the code:

/* Initialization Code Here */
// register the event that is fired after the key press.
hook.KeyPressed += new EventHandler<KeyPressedEventArgs>(hook_KeyPressed);
// register the control + alt + F12 combination as hot key.
hook.RegisterHotKey((uint)(HotkeyModifiers.Control | HotkeyModifiers.Alt), Keys.G);

The event code is quite simple:

void hook_KeyPressed(object sender, KeyPressedEventArgs e)
{
    SendKeys.SendWait(Guid.NewGuid().ToString());
}

Everything else in my project is just fluff.

Update 1:

I do have more questions about this subject, but I am out of time to continue working on this for today. I have implemented Jon Raynor’s suggestion of using the app.config approach to some degree of success. Once I isolate my new problems I’ll post an edit and possibly close this question if I get my application functioning as intended.

  • 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-25T17:02:05+00:00Added an answer on May 25, 2026 at 5:02 pm

    You may be running into timing issues. According to the MSDN documentation:

    The SendKeys class has been updated for the .NET Framework 3.0 to
    enable its use in applications that run on Windows Vista. The enhanced
    security of Windows Vista (known as User Account Control or UAC)
    prevents the previous implementation from working as expected.

    The SendKeys class is susceptible to timing issues, which some
    developers have had to work around. The updated implementation is
    still susceptible to timing issues, but is slightly faster and may
    require changes to the workarounds. The SendKeys class tries to use
    the previous implementation first, and if that fails, uses the new
    implementation. As a result, the SendKeys class may behave differently
    on different operating systems. Additionally, when the SendKeys class
    uses the new implementation, the SendWait method will not wait for
    messages to be processed when they are sent to another process.

    If your application relies on consistent behavior regardless of the
    operating system, you can force the SendKeys class to use the new
    implementation by adding the following application setting to your
    app.config file.

    <appSettings> 
    
    <add key="SendKeys" value="SendInput"/> 
    
    </appSettings> 
    

    To force the SendKeys class to use the previous implementation, use
    the value “JournalHook” instead.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post
I'm making a simple page using Google Maps API 3. My first. One marker
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

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.