Predefined Constants

Windows also uses an extensive list of predefined constants that are used as messages, flag values, and other operational parameters. These constant values are always full uppercase and most include a two- or three-letter prefix set off by an underscore. Here are some examples:

CS_HREDRAW CS_VREDRAW CW_USERDEFAULT
DT_CENTER DT_SINGLELINE DT_VCENTER
IDC_ARROW IDI_APPLICATION WM_DESTROY
WM_PAINT WS_OVERLAPPEDWINDOW

In the case of constant identifiers, the prefixes indicate the general category of the constant. Table 2.2 shows the meanings of the prefixes in the examples shown here.

Table 2.2: A Few Constant Prefixes

PrefixCategory

CS Class style
CW Create window
DT Draw text
IDC Cursor ID
IDI Icon ID
WM Window message
WS Window style

© 1998 SYBEX Inc. All rights reserved.