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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:42:42+00:00 2026-06-09T18:42:42+00:00

I have defined a HotKey Ctrl + Space to activate my Windows Form. When

  • 0

I have defined a HotKey Ctrl + Space to activate my Windows Form. When the form handles this HotKey, this event is not seen by the system. Is there subsequently any way to unhandle these keystrokes? (That is, unregister the HotKey.)

Here is what I have tried:

private int tuyen_HotKey_Active = 1208132019;

private void Reg_HotKey(bool mode)
{
    if (mode)
    {
        RegisterHotKey(this.Handle, tuyen_HotKey_Active, 2, 32); // Ctrl + Space
    }
    else
    {
        UnregisterHotKey(this.Handle, tuyen_HotKey_Active);
    }
}

protected override void WndProc(ref Message m)
{            
    if (m.Msg == 0x0312) if(m.WParam.ToInt32() == tuyen_HotKey_Active)
    {
        // Do something here. I want Ctrl + Space keystroke to be
        // unhandled here so that it can be seen by the system.
    }
    base.WndProc(ref m);
}
  • 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-09T18:42:44+00:00Added an answer on June 9, 2026 at 6:42 pm

    Create a global bool variable. Set its value to false.

    In Windows KeyDown event check if that bool variable is true return from method.

    When you want to unhandle these keystrokes set its value to true and when you want to handle these keystrokes set its value to false.

    public bool flag = false;
    
    public void Window_KeyDown(object sender, KeyEventArgs e)
    {
        if (flag)
            return;
    
        //.. Code Here something
    }
    

    Now you just have to set this flag value to handle or unhandle your keystrokes.

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

Sidebar

Related Questions

I have defined this Entity class, but it does not seem to save the
I have defined a table type PL/SQL variable and added some data there. create
I have defined a rectangle drawable like this: <shape xmlns:android=http://schemas.android.com/apk/res/android android:shape=rectangle> <corners android:radius=4dip/> <solid
I have defined an AIDL file with my interface. Something like this: interface IResPlugin
I have defined new member in my class protected COMObject.Call call_ = null; This
I have defined this class: class Trade(Base): __tablename__ = 'TRADE' __table_args__ = {'quote':False} id
I have defined two classes in javascript as follows. function ParentClass(){ this.one = function(){
I have defined a few constants like this: define(TITLE_2,Yahoo); define(TITLE_3,Google); Next, I want to
I have defined the global nls_date_format on Oracle 10.2 XE as follows: alter system
I have defined a set of radio buttons in HTML in a form as

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.