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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:10:27+00:00 2026-05-21T10:10:27+00:00

EDIT: I found an article that lists exactly what I needed: http://msdn.microsoft.com/en-us/library/ms646309(v=vs.85).aspx Thanks for

  • 0

EDIT: I found an article that lists exactly what I needed: http://msdn.microsoft.com/en-us/library/ms646309(v=vs.85).aspx

Thanks for your help!

Original:

I’m wondering what keyboard keys are represented by the &H hex codes?

For example, I’ve found that &H1 is the ALT key, &H2 is the CONTROL key, and &H3 is both the ALT and CONTROL keys together. &H10 is the Shift key, it appears. I’m asking because I need to find out for a program I’m designing that needs to register a hotkey. The user has the option to hide it, and I want to make sure that they can show it again by pressing a hotkey, but I need to figure out what the hex keys are to use the code that I found.

Here’s part of the code I found:

Public Const MOD_ALT As Integer = &H1 'Alt key
Public Const WM_HOTKEY As Integer = &H312

<DllImport("User32.dll")> _
Public Shared Function RegisterHotKey(ByVal hwnd As IntPtr, _
                    ByVal id As Integer, ByVal fsModifiers As Integer, _
                    ByVal vk As Integer) As Integer
End Function

<DllImport("User32.dll")> _
Public Shared Function UnregisterHotKey(ByVal hwnd As IntPtr, _
                    ByVal id As Integer) As Integer
End Function

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
    If m.Msg = WM_HOTKEY Then
        Dim id As IntPtr = m.WParam
        Select Case (id.ToString)
            Case "100"
                MessageBox.Show("You pressed ALT+D key combination")
            Case "200"
                MessageBox.Show("You pressed ALT+C key combination")
        End Select
    End If
    MyBase.WndProc(m)
End Sub

And this registers the hotkeys when the form loads:

RegisterHotKey(Me.Handle, 100, &H3, Keys.D)
RegisterHotKey(Me.Handle, 200, Keys.Alt, Keys.C)

This is the thread I was looking at on the MSDN forums — I copied the code from the featured answer.

I’ve done a thorough Google search and I’ve searched here on StackOverflow, and I can’t find anything.

Is there maybe a list of the hex codes somewhere, or instructions or something?

Thanks!

  • 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-21T10:10:28+00:00Added an answer on May 21, 2026 at 10:10 am

    In that MSDN thread you’ve linked there is a link to Virtual Key Codes.
    In addition, check the System.Windows.Forms.Keys enumeration.

    Notice that the RegisterHotKey method takes the following arguments: hWnd, id, fsModifiers and vk. VK is where you place the VirtualKey code. Regarding fsModifiers:

    The keys that must be pressed in
    combination with the key specified by
    the uVirtKey parameter in order to
    generate the WM_HOTKEY message. The
    fsModifiers parameter can be a
    combination of the following values:
    MOD_ALT (0x0001), MOD_CONTROL
    (0x0002), MOD_NOREPEAT (0x4000),
    MOD_SHIFT (0x0004), MOD_WIN (0x0008).

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

Sidebar

Related Questions

EDIT: I found out that I can get it to compile if I cast
I've found that on some occasions I can edit the source while debugging. Are
Edit: This code is fine. I found a logic bug somewhere that doesn't exist
I have found a few libraries to edit MP3 tags (UltraID3Lib is great) but
Edit: From another question I provided an answer that has links to a lot
EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters Our business
Edit: This question was written in 2008, which was like 3 internet ages ago.
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE
EDIT: This question is more about language engineering than C++ itself. I used C++
EDIT What small things which are too easy to overlook do I need to

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.