3.12 Utility Macros and Functions

Utility macros and functions return contents of words and bytes, create un-signed long integers and data structures, and perform specialized arithmetic. The following list briefly describes each utility macro or function:

Function Description  
HIBYTE Returns the high-order byte of an integer.  
HIWORD Returns the high-order word of a long integer.  
LOBYTE Returns the low-order byte of an integer.  
LOWORD Returns the low-order word of a long integer.  
MAKEINTATOM Casts an integer for use as a function argument.  
Function Description  
MAKEINTRESOURCE Converts an integer value into a long pointer to a string, with the high-order word of the long pointer set to zero.  
MAKELONG Creates an unsigned long integer.  
MAKEPOINT Converts a long value that contains the x- and y-coordinates of a point into a POINT data structure.  
MulDiv Multiplies two word-length values and then divides the result by a third word-length value, returning the result rounded to the nearest integer.  
PALETTEINDEX Converts an integer into a palette-index COLORREF value.  
PALETTERGB Converts three values for red, green, and blue into a palette-relative RGB COLORREF value.  
RGB Converts three values for red, green, and blue into an explicit RGB COLORREF value.