Data Type Ranges
Type name Bytes Other Names Range of Values
int * signed,signed int System dependent
unsigned int * unsigned System dependent
__int8 1 char,signed char -128 to 127
__int16 2 short,short int,signed short int -32,768 to 32,767
__int32 4 signed,signed int -2,147,483,648 to 2,147,483,647
__int64 8 none –9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
bool 1 none false or true
char 1 signed char -128 to 127
unsigned char 1 none 0 to 255
short 2 short int,signed short int -32,768 to 32,767
unsigned short 2 unsigned short int 0 to 65,535
long 4 long int,signed long int –2,147,483,648 to 2,147,483,647
long long 8 none (but equivalent to __int64) –9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
unsigned long 4 unsigned long int 0 to 4,294,967,295
enum * none Same as int
float 4 none 3.4E +/- 38 (7 digits)
double 8 none 1.7E +/- 308 (15 digits)
long double same as double none same as double
wchar_t 2 __wchar_t 0 to 65,535
一个__wchar_t变量指定一个宽字符或多字节字符类型,通过默认wchar_t为unsigned short 的声明,使用L作为一个字符或字符串常量的前缀来指定宽字符类型的常量。
当编译使用/ Zc:wchar_t的或/ ZA,编译器可以区分的unsigned short和wchar_t的函数重载的目的。
ATOM typedef WORD ATOM; //Atom. For more information, see Atoms.
BOOL typedef int BOOL;//Boolean variable (should be TRUE or FALSE).
BOOLEAN typedef BYTE BOOLEAN;//Boolean variable (should be TRUE or FALSE).
BYTE typedef unsigned char BYTE;//Byte (8 bits).
CALLBACK #define CALLBACK __stdcall //Calling convention for callback functions.
CHAR typedef char CHAR;//8-bit Windows (ANSI) character. For more information, see Character Sets Used By Fonts.
COLORREF typedef DWORD COLRREF;//Red, green, blue (RGB) color value (32 bits). See COLORREF for information on this type.
CONST #define CONST const; //Variable whose value is to remain constant during execution.
DWORD typedef unsigned long DWORD; //32-bit unsigned integer.
DWORDLONG typedef ULONGLONG DWORDLONG; //64-bit unsigned integer.
DWORD_PTR typedef ULONG_PTR DWORD_PTR; //Unsigned long type for pointer precision. Use when casting a pointer to a long type to perform pointer arithmetic. (Also commonly used for general 32-bit parameters that have been extended to 64 bits in 64-bit Windows. )
DWORD32 typedef unsigned int DWORD32; //32-bit unsigned integer.
DWORD64 typedef unsigned __int64 DWORD64; //64-bit unsigned integer.
FLOAT typedef float FLOAT; //Floating-point variable.
HACCEL typedef HANDLE HACCEL;//Handle to an accelerator table.
HALF_PTR #ifdef _WIN64 //Half the size of a pointer. Use within a structure that contains a pointer and two small fields.
typedef int HALF_PTR;
#else
typedef short HALF_PTR;
#endif
HANDLE typedef PVOID HANDLE; //Handle to an object.
HBITMAP typedef HANDLE HBITMAP; //Handle to a bitmap.
HBRUSH typedef HANDLE HBRUSH; //Handle to a brush.
HCOLORSPACE #if(WINVER >= 0x0400) //Handle to a color space.
typedef HANDLE HCOLORSPACE;
#endif
HCONV typedef HANDLE HCONV; //Handle to a dynamic data exchange (DDE) conversation.
HCONVLIST typedef HANDLE HCONVLIST;//Handle to a DDE conversation list.
HCURSOR typedef HICON HCURSOR; //Handle to a cursor.
HDC typedef HANDLE HDC; //Handle to a device context (DC).
HDDEDATA typedef HANDLE HDDEDATA; //Handle to DDE data.
HDESK typedef HANDLE HDESK; //Handle to a desktop.
HDROP typedef HANDLE HDROP; //Handle to an internal drop structure.
HDWP typedef HANDLE HDWP;//Handle to a deferred window position structure.
HENHMETAFILE typedef HANDLE HDWP;//Handle to an enhanced metafile.
HFILE typedef int HFILE;//Handle to a file opened by OpenFile, not CreateFile.
HFONT typedef HANDLE HFONT;//Handle to a font.
HGDIOBJ typedef HANDLE HGDIOBJ;//Handle to a GDI object.
HGLOBAL typedef HANDLE HGLOBAL;//Handle to a global memory block.
HHOOK typedef HANDLE HHOOK;//Handle to a hook.
HICON typedef HANDLE HICON;//Handle to an icon.
HINSTANCE typedef HANDLE HINSTANCE;//Handle to an instance.
HKEY typedef HANDLE HKEY;//Handle to a registry key.
HKL typedef HANDLE HKL;//Input locale identifier.
HLOCAL typedef HANDLE HLOCAL;//Handle to a local memory block.
HMENU typedef HANDLE HMENU;//Handle to a menu.
HMETAFILE typedef HANDLE HMETAFILE;//Handle to a metafile.
HMODULE typedef HINSTANCE HMODULE;//Handle to a module. The value is the base address of the module.
HMONITOR if(WINVER >= 0x0500) typedef HANDLE HMONITOR;//Handle to a display monitor.
HPALETTE typedef HANDLE HPALETTE;//Handle to a palette.
HPEN typedef HANDLE HPEN;//Handle to a pen.
HRESULT typedef LONG HRESULT;//Return code used by interfaces. It is zero upon success and nonzero to represent an error code or status information.
HRGN typedef HANDLE HRGN;//Handle to a region.
HRSRC typedef HANDLE HRSRC;//Handle to a resource.
HSZ typedef HANDLE HSZ;//Handle to a DDE string.
HWINSTA typedef HANDLE WINSTA;//Handle to a window station.
HWND typedef HANDLE HWND;//Handle to a window.
INT typedef int INT;//32-bit signed integer.
INT_PTR #if defined(_WIN64) //Signed integer type for pointer precision. Use when casting a pointer to an integer to perform pointer arithmetic.
typedef __int64 INT_PTR;
#else
typedef int INT_PTR;
#endif
INT32 typedef signed int INT32;//32-bit signed integer.
INT64 typedef signed __int64 INT64;//64-bit signed integer.
LANGID typedef WORD LANGID;//Language identifier. For more information, see Locales.
LCID typedef DWORD LCID;//Locale identifier. For more information, see Locales.
LCTYPE typedef DWORD LCTYPE;//Locale information type. For a list, see Locale and Language Information.
LGRPID typedef DWORD LGRPID;//Language group identifier. For a list, see EnumLanguageGroupLocales.
LONG typedef long LONG;//32-bit signed integer.
LONGLONG #if !defined(_M_IX86)//64-bit signed integer.
typedef __int64 LONGLONG;
#else
typedef double LONGLONG;
#endif
LONG_PTR #if defined(_WIN64)//Signed long type for pointer precision. Use when casting a pointer to a long to perform pointer arithmetic.
typedef __int64 LONG_PTR;
#else
typedef long LONG_PTR;
#endif
LONG32 typedef signed int LONG32;//32-bit signed integer.
LONG64 typedef __int64 LONG64;//64-bit signed integer.