HiWord, LoWord, HiByte, LoByte, MakeInt and MakeLong

Category:
Dates and Math
Type:
Modules
Difficulty:
Intermediate
Author:
Merrion Computing

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
When dealing with the windows API you often find that variables are packed into a LONG (32 bits) and that you are required to decode these LONGs. The following utility functions will do all this for you.

Thanks to Kevin Williams for improving the HiByte function so it works with negative numbers.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: