Understanding Hexadecimal Values: A Technical Exploration

By Augusta P. Fothergill | Created on 2025-08-28 23:19:16

Written with a analytical tone 🧠 | Model: keyless-gpt-o3-mini

0:00 / 0:00

The hexadecimal system is a number system that uses 16 distinct symbols: 0-9 and then A-F. In the context of programming, especially in languages like Visual Basic (Classic), hexadecimal values are used to represent keyboard keys.

What are &H1, &H8000, etc.? | Tek-Tips

The first question posed in this thread is about understanding what &H1 and &H8000 mean. The answer lies in the way hexadecimal numbers work. In hexadecimal, each digit can be one of 16 values: 0-9 or A-F.

&H means the number is hexadecimal

When you see &H followed by a number, it means that number is represented in hexadecimal form. For example, &H1 is equivalent to decimal 1, and &H8000 is equivalent to decimal 32768.

A Closer Look at GetKeyState Function

The GetKeyState function returns a SHORT value, which is essentially a 16-bit integer. When you use the bitwise AND operator (&) with &H8000 on the result of GetKeyState for a virtual key (like VK_SHIFT), it's checking if that key is toggled or not.

Bitwise Operations

Bitwise operations are used here to check the state of keys. If a key is down, its high-order bit is set to 1. By performing a bitwise AND with &H8000 (which has all bits set except for the low-order one), you can determine if a key is toggled or not.

Practical Example

The thread goes on to discuss how to check for the ALT key press by using &H12 and assigning it &H8000. It then explains how to write a function that copies text from an input box to the clipboard when the user selects ALT and X.

Conclusion

This thread demonstrates how hexadecimal values are used in programming, especially with keyboard keys. Understanding bitwise operations and how they're applied can be crucial for writing efficient code. The example provided shows how to use these concepts in a real-world scenario, making the explanation more practical and less theoretical.



Sources:
- [What are &H1, &H8000, etc.? | Tek-Tips] (https://www.tek-tips.com/threads/what-are-h1-h8000-etc.1080522/)
- [Why does font-size not inherit ? | Tek-Tips] (https://www.tek-tips.com/threads/why-does-font-size-not-inherit.1050326/)
- [Error: Only content controls are allowed directly in a ... - Tek-Tips] (https://www.tek-tips.com/threads/error-only-content-controls-are-allowed-directly-in-a-content-page.1504551/)
- [Moving Aplications to a new screen in C# | Tek-Tips] (https://www.tek-tips.com/threads/moving-aplications-to-a-new-screen-in-c.1416749/)
- [Coverage Paths | Tek-Tips] (https://www.tek-tips.com/threads/coverage-paths.1632312/)
- [Launch .VBS file from button on HTML page | Tek-Tips] (https://www.tek-tips.com/threads/launch-vbs-file-from-button-on-html-page.931380/)
- [Microsoft VBScript runtime error '800a01b6' | Tek-Tips] (https://www.tek-tips.com/threads/microsoft-vbscript-runtime-error-800a01b6.419805/)
- [Send 8-bit data over serial port; values over 3F are being set to 3F] (https://www.tek-tips.com/threads/send-8-bit-data-over-serial-port-values-over-3f-are-being-set-to-3f.1672795/)
- [how do i keep sections from moving when i minimize window?] (https://www.tek-tips.com/threads/how-do-i-keep-sections-from-moving-when-i-minimize-window.1611893/)
- [Forwarding one internal extension to External number | Tek-Tips] (https://www.tek-tips.com/threads/forwarding-one-internal-extension-to-external-number.1574548/)
- [HTML h1 to h6 tag - W3Schools] (https://www.w3schools.com/tags/tag_hn.asp)
- [Creating a Healthier Future | H1] (https://h1.co/)
- [H1 Unlimited – Home of the World's Fastest Boats] (http://www.h1unlimited.com/)
- [

–

: The HTML Section Heading elements - MDN Web Docs] (https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/Heading_Elements)
- [H1 Inc. - Wikipedia] (https://en.wikipedia.org/wiki/H1_Inc.)
- [H-1B Specialty Occupations - USCIS] (https://www.uscis.gov/working-in-the-united-states/h-1b-specialty-occupations)
- [Amazon EC2 H1 Instances] (https://aws.amazon.com/ec2/instance-types/h1/)
- [Universal humanoid robot H1_Bipedal Robot_Humanoid ... - unitree] (https://www.unitree.com/h1)
- [Our Trapped Ion Quantum Computers | System Model H1] (https://www.quantinuum.com/products-solutions/quantinuum-systems/system-model-h1)
- [H1 - LinkedIn] (https://www.linkedin.com/company/h1co)