Data types used by Windows |
Corresponding Basic Data Type |
Description |
Bool |
Bool |
Boolean Value |
BSTR |
Unsigned short * |
32-bit character pointer |
Byte |
Unsigned char |
8-bit unsigned integer |
Colorref |
Unsigned long |
Used as a 32-bit color value |
DWORD |
Unsigned long |
32-bit unsigned integer, segment address and related offset |
Long |
Long |
32-bit signed integer |
Lparam |
Long |
The 32-bit value passed as a parameter to the window process or callback function. |
Lpcstr |
Const char * |
32-bit pointer to a String constant |
Lpstr |
Char * |
32-bit pointer to a string |
Lpvoid |
Void * |
Point to a 32-bit pointer of undefined type |
Lresult |
Long |
32-bit return values from window procedures or callback Functions |
Uint |
Unsigned int |
32-bit unsigned integer |
Word |
Unsigned short |
16-bit unsigned integer |
Wparam |
Unsigned int |
The 32-bit value passed to the window process or callback function as a parameter. |
Note:
1. These data types are represented by uppercase letters, which are different from the general C ++ basic data types.
2. If the data type prefix is P or lp, it indicates that the data type is a pointer or long pointer. If the prefix is u, the data type is unsigned, and so on.
3. Windows also provides some macros to process the above basic data types. For example, lobyte and hibyte are used to obtain the low-byte and high-byte values in 16-bit values, and loword and hiword are respectively used to obtain the low-byte and high-byte values in 32-bit values; makeword combines two 16 unsigned values into a 32-bit unsigned value.