12.1 Types

In addition to the standard C-language data types (such as char, int, long, and void), the graphics functions and escapes use the following data types.

Type Description

BOOL Specifies a 16-bit Boolean value. Its value can be either TRUE or FALSE.
BYTE Specifies an unsigned, 8-bit integer.
CHAR Specifies an signed, 8-bit integer.
COLORREF Specifies a 32-bit RGB color value or a logical color index. For RGB color values, the high-order byte is zero, and bytes 0, 1, and 2 represent the intensity levels of blue, green, and red, respectively. For logical color indexes, the high-order byte is 0xFF, and the low-order, 16 bits represents the index.
DWORD Specifies a unsigned, 32-bit integer.
FARPROC Specifies a far pointer to a function that uses the Pascal calling convention.
FIXED Specifies a fixed, real number in 32 bits. The high-order 16 bits specifies the integer portion, and the low-order 16 bits specifies the fraction expressed as an integer value. To calculate the actual fraction value, divide the low-order 16 bits by 65536.
HANDLE Specifies a 16-bit handle representing objects such as pens, brushes, bitmaps, and global memory.
HWND Specifies a 16-bit window handle.
INT Specifies a signed, 16-bit integer.
LONG Specifies a signed, 32-bit integer.
LPPDEVICE Specifies a far pointer to a PDEVICE structure.
LPSTR Specifies a far pointer to an array of bytes.
LPVOID Specifies a far pointer to an undetermined type. Function parameters having this type must be cast to a specific far pointer type before being used.
PBRUSH Specifies a integer, an array, or a structure containing device-specific information about a physical brush that a driver can use to fill figures and draw scan lines. The exact size and content of a PBRUSH type depends entirely on the driver.
PCOLOR Specifies a 32-bit integer representing physical-color values. A physical color specifies a given color on the device. The range and meaning of physical color values depends entirely on the driver.
PPEN Specifies an integer, array, or structure containing device-specific information that a driver can use to draw lines and borders. The exact size and content of a physical pen depend entirely on the driver.
SHORT Specifies a signed, 16-bit integer.
VOID Specifies an empty type. This type is typically used with functions that return no value.
WORD Specifies an unsigned, 16-bit integer.

When LP prefix is applied to a data type, the resulting type specifies a far pointer to a variable having the specified data type.