The data types supported by Windows are used to define function return values, function and message parameters, and structure members. They define the size and meaning of these elements. For more information about the underlying C/C++ data types, see Data Type Ranges.
The following table contains the following types: character, integer, Boolean, pointer, and handle. The character, integer, and Boolean types are common to most C compilers. Most of the pointer-type names begin with a prefix of P or LP. Handles refer to a resource that has been loaded into memory.
For more information about handling 64-bit integers, see Large Integers.
Type | Description |
---|---|
APIENTRY | Calling convention for system functions. This type is declared in WinDef.h as follows: |
ATOM | Atom. For more information, see Atoms. This type is declared in WinDef.h as follows: |
BOOL | Boolean variable (should be TRUE or FALSE). This type is declared in WinDef.h as follows: |
BOOLEAN | Boolean variable (should be TRUE or FALSE). This type is declared in WinNT.h as follows: |
BYTE | Byte (8 bits). This type is declared in WinDef.h as follows: |
CALLBACK | Calling convention for callback functions. This type is declared in WinDef.h as follows: CALLBACK, WINAPI, and APIENTRY are all used to define functions with the __stdcall calling convention. Most functions in the Windows API are declared using WINAPI. You may wish to use CALLBACK for the callback functions that you implement to help identify the function as a callback function. |
CHAR | 8-bit Windows (ANSI) character. For more information, see Character Sets Used By Fonts. This type is declared in WinNT.h as follows: |
COLORREF | Red, green, blue (RGB) color value (32 bits). See COLORREF for information on this type. This type is declared in WinDef.h as follows: |
CONST | Variable whose value is to remain constant during execution. This type is declared in WinDef.h as follows: |
DWORD | 32-bit unsigned integer. The range is 0 through 4294967295 decimal. This type is declared in WinDef.h as follows: |
DWORDLONG | 64-bit unsigned integer. The range is 0 through 18446744073709551615 decimal. This type is declared in WinNT.h as follows: |
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.) This type is declared in BaseTsd.h as follows: |
DWORD32 | 32-bit unsigned integer. This type is declared in BaseTsd.h as follows: |
DWORD64 | 64-bit unsigned integer. This type is declared in BaseTsd.h as follows: |
FLOAT | Floating-point variable. This type is declared in WinDef.h as follows: |
HACCEL | Handle to an accelerator table. This type is declared in WinDef.h as follows: |
HALF_PTR | Half the size of a pointer. Use within a structure that contains a pointer and two small fields. This type is declared in Basetsd.h as follows: |
HANDLE | Handle to an object. This type is declared in WinNT.h as follows: |
HBITMAP | Handle to a bitmap. This type is declared in WinDef.h as follows: |
HBRUSH | Handle to a brush. This type is declared in WinDef.h as follows: |
HCOLORSPACE | Handle to a color space. This type is declared in WinDef.h as follows: |
HCONV | Handle to a dynamic data exchange (DDE) conversation. This type is declared in Ddeml.h as follows: |
HCONVLIST | Handle to a DDE conversation list. This type is declared in Ddeml.h as follows: |
HCURSOR | Handle to a cursor. This type is declared in WinDef.h as follows: |
HDC | Handle to a device context (DC). This type is declared in WinDef.h as follows: |
HDDEDATA | Handle to DDE data. This type is declared in Ddeml.h as follows: |
HDESK | Handle to a desktop. This type is declared in WinDef.h as follows: |
HDROP | Handle to an internal drop structure. This type is declared in ShellApi.h as follows: |
HDWP | Handle to a deferred window position structure. This type is declared in WinUser.h as follows: |
HENHMETAFILE | Handle to an enhanced metafile. This type is declared in WinDef.h as follows: |
HFILE | Handle to a file opened by OpenFile, not CreateFile. This type is declared in WinDef.h as follows: |
HFONT | Handle to a font. This type is declared in WinDef.h as follows: |
HGDIOBJ | Handle to a GDI object. This type is declared in WinDef.h as follows: |
HGLOBAL | Handle to a global memory block. This type is declared in WinDef.h as follows: |
HHOOK | Handle to a hook. This type is declared in WinDef.h as follows: |
HICON | Handle to an icon. This type is declared in WinDef.h as follows: |
HINSTANCE | Handle to an instance. This is the base address of the module in memory. HMODULE and HINSTANCE are the same today, but represented different things in 16-bit Windows. This type is declared in WinDef.h as follows: |
HKEY | Handle to a registry key. This type is declared in WinDef.h as follows: |
HKL | Input locale identifier. This type is declared in WinDef.h as follows: |
HLOCAL | Handle to a local memory block. This type is declared in WinDef.h as follows: |
HMENU | Handle to a menu. This type is declared in WinDef.h as follows: |
HMETAFILE | Handle to a metafile. This type is declared in WinDef.h as follows: |
HMODULE | Handle to a module. The is the base address of the module in memory. HMODULE and HINSTANCE are the same today, but represented different things in 16-bit Windows. This type is declared in WinDef.h as follows: |
HMONITOR | Handle to a display monitor. This type is declared in WinDef.h as follows: |
HPALETTE | Handle to a palette. This type is declared in WinDef.h as follows: |
HPEN | Handle to a pen. This type is declared in WinDef.h as follows: |
HRESULT | Return code used by COM interfaces. For more information, see Structure of the COM Error Codes. To test an HRESULT value, use the FAILED and SUCCEEDED macros. This type is declared in WinNT.h as follows: |
HRGN | Handle to a region. This type is declared in WinDef.h as follows: |
HRSRC | Handle to a resource. This type is declared in WinDef.h as follows: |
HSZ | Handle to a DDE string. This type is declared in Ddeml.h as follows: |
HWINSTA | Handle to a window station. This type is declared in WinDef.h as follows: |
HWND | Handle to a window. This type is declared in WinDef.h as follows: |
INT | 32-bit signed integer. The range is -2147483648 through 2147483647 decimal. This type is declared in WinDef.h as follows: |
INT_PTR | Signed integer type for pointer precision. Use when casting a pointer to an integer to perform pointer arithmetic. This type is declared in BaseTsd.h as follows: |
INT32 | 32-bit signed integer. The range is -2147483648 through 2147483647 decimal. This type is declared in BaseTsd.h as follows: |
INT64 | 64-bit signed integer. The range is –9223372036854775808 through 9223372036854775807 decimal. This type is declared in BaseTsd.h as follows: |
LANGID | Language identifier. For more information, see Locales. This type is declared in WinNT.h as follows: |
LCID | Locale identifier. For more information, see Locales. This type is declared in WinNT.h as follows: |
LCTYPE | Locale information type. For a list, see Locale Information Constants. This type is declared in WinNls.h as follows: |
LGRPID | Language group identifier. For a list, see EnumLanguageGroupLocales. This type is declared in WinNls.h as follows: |
LONG | 32-bit signed integer. The range is –2147483648 through 2147483647 decimal. This type is declared in WinNT.h as follows: |
LONGLONG | 64-bit signed integer. The range is –9223372036854775808 through 9223372036854775807 decimal. This type is declared in WinNT.h as follows: |
LONG_PTR | Signed long type for pointer precision. Use when casting a pointer to a long to perform pointer arithmetic. This type is declared in BaseTsd.h as follows: |
LONG32 | 32-bit signed integer. The range is –2147483648 through 2147483647 decimal. This type is declared in BaseTsd.h as follows: |
LONG64 | 64-bit signed integer. The range is –9223372036854775808 through 9223372036854775807 decimal. This type is declared in BaseTsd.h as follows: |
LPARAM | Message parameter. This type is declared in WinDef.h as follows: |
LPBOOL | Pointer to a BOOL. This type is declared in WinDef.h as follows: |
LPBYTE | Pointer to a BYTE. This type is declared in WinDef.h as follows: |
LPCOLORREF | Pointer to a COLORREF value. This type is declared in WinDef.h as follows: |
LPCSTR | Pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts. This type is declared in WinNT.h as follows: |
LPCTSTR | An LPCWSTR if UNICODE is defined, an LPCSTR otherwise. This type is declared in WinNT.h as follows: |
LPCVOID | Pointer to a constant of any type. This type is declared in WinDef.h as follows: |
LPCWSTR | Pointer to a constant null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts. This type is declared in WinNT.h as follows: |
LPDWORD | Pointer to a DWORD. This type is declared in WinDef.h as follows: |
LPHANDLE | Pointer to a HANDLE. This type is declared in WinDef.h as follows: |
LPINT | Pointer to an INT. This type is declared in WinDef.h as follows: |
LPLONG | Pointer to a LONG. This type is declared in WinDef.h as follows: |
LPSTR | Pointer to a null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts. This type is declared in WinNT.h as follows: |
LPTSTR | An LPWSTR if UNICODE is defined, an LPSTR otherwise. This type is declared in WinNT.h as follows: |
LPVOID | Pointer to any type. This type is declared in WinDef.h as follows: |
LPWORD | Pointer to a WORD. This type is declared in WinDef.h as follows: |
LPWSTR | Pointer to a null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts. This type is declared in WinNT.h as follows: |
LRESULT | Signed result of message processing. This type is declared in WinDef.h as follows: |
PBOOL | Pointer to a BOOL. This type is declared in WinDef.h as follows: |
PBOOLEAN | Pointer to a BOOL. This type is declared in WinNT.h as follows: |
PBYTE | Pointer to a BYTE. This type is declared in WinDef.h as follows: |
PCHAR | Pointer to a CHAR. This type is declared in WinNT.h as follows: |
PCSTR | Pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts. This type is declared in WinNT.h as follows: |
PCTSTR | A PCWSTR if UNICODE is defined, a PCSTR otherwise. This type is declared in WinNT.h as follows: |
PCWSTR | Pointer to a constant null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts. This type is declared in WinNT.h as follows: |
PDWORD | Pointer to a DWORD. This type is declared in WinDef.h as follows: |
PDWORDLONG | Pointer to a DWORDLONG. This type is declared in WinNT.h as follows: |
PDWORD_PTR | Pointer to a DWORD_PTR. This type is declared in BaseTsd.h as follows: |
PDWORD32 | Pointer to a DWORD32. This type is declared in BaseTsd.h as follows: |
PDWORD64 | Pointer to a DWORD64. This type is declared in BaseTsd.h as follows: |
PFLOAT | Pointer to a FLOAT. This type is declared in WinDef.h as follows: |
PHALF_PTR | Pointer to a HALF_PTR. This type is declared in Basetsd.h as follows: |
PHANDLE | Pointer to a HANDLE. This type is declared in WinNT.h as follows: |
PHKEY | Pointer to an HKEY. This type is declared in WinDef.h as follows: |
PINT | Pointer to an INT. This type is declared in WinDef.h as follows: |
PINT_PTR | Pointer to an INT_PTR. This type is declared in BaseTsd.h as follows: |
PINT32 | Pointer to an INT32. This type is declared in BaseTsd.h as follows: |
PINT64 | Pointer to an INT64. This type is declared in BaseTsd.h as follows: |
PLCID | Pointer to an LCID. This type is declared in WinNT.h as follows: |
PLONG | Pointer to a LONG. This type is declared in WinNT.h as follows: |
PLONGLONG | Pointer to a LONGLONG. This type is declared in WinNT.h as follows: |
PLONG_PTR | Pointer to a LONG_PTR. This type is declared in BaseTsd.h as follows: |
PLONG32 | Pointer to a LONG32. This type is declared in BaseTsd.h as follows: |
PLONG64 | Pointer to a LONG64. This type is declared in BaseTsd.h as follows: |
POINTER_32 | 32-bit pointer. On a 32-bit system, this is a native pointer. On a 64-bit system, this is a truncated 64-bit pointer. This type is declared in BaseTsd.h as follows: |
POINTER_64 | 64-bit pointer. On a 64-bit system, this is a native pointer. On a 32-bit system, this is a sign-extended 32-bit pointer. Note that it is not safe to assume the state of the high pointer bit. This type is declared in BaseTsd.h as follows: |
POINTER_SIGNED | A signed pointer. This type is declared in BaseTsd.h as follows: |
POINTER_UNSIGNED | An unsigned pointer. This type is declared in BaseTsd.h as follows: |
PSHORT | Pointer to a SHORT. This type is declared in WinNT.h as follows: |
PSIZE_T | Pointer to a SIZE_T. This type is declared in BaseTsd.h as follows: |
PSSIZE_T | Pointer to a SSIZE_T. This type is declared in BaseTsd.h as follows: |
PSTR | Pointer to a null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts. This type is declared in WinNT.h as follows: |
PTBYTE | Pointer to a TBYTE. This type is declared in WinNT.h as follows: |
PTCHAR | Pointer to a TCHAR. This type is declared in WinNT.h as follows: |
PTSTR | A PWSTR if UNICODE is defined, a PSTR otherwise. This type is declared in WinNT.h as follows: |
PUCHAR | Pointer to a UCHAR. This type is declared in WinDef.h as follows: |
PUHALF_PTR | Pointer to a UHALF_PTR. This type is declared in Basetsd.h as follows: |
PUINT | Pointer to a UINT. This type is declared in WinDef.h as follows: |
PUINT_PTR | Pointer to a UINT_PTR. This type is declared in BaseTsd.h as follows: |
PUINT32 | Pointer to a UINT32. This type is declared in BaseTsd.h as follows: |
PUINT64 | Pointer to a UINT64. This type is declared in BaseTsd.h as follows: |
PULONG | Pointer to a ULONG. This type is declared in WinDef.h as follows: |
PULONGLONG | Pointer to a ULONGLONG. This type is declared in WinDef.h as follows: |
PULONG_PTR | Pointer to a ULONG_PTR. This type is declared in BaseTsd.h as follows: |
PULONG32 | Pointer to a ULONG32. This type is declared in BaseTsd.h as follows: |
PULONG64 | Pointer to a ULONG64. This type is declared in BaseTsd.h as follows: |
PUSHORT | Pointer to a USHORT. This type is declared in WinDef.h as follows: |
PVOID | Pointer to any type. This type is declared in WinNT.h as follows: |
PWCHAR | Pointer to a WCHAR. This type is declared in WinNT.h as follows: |
PWORD | Pointer to a WORD. This type is declared in WinDef.h as follows: |
PWSTR | Pointer to a null- terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts. This type is declared in WinNT.h as follows: |
SC_HANDLE | Handle to a service control manager database. For more information, see SCM Handles. This type is declared in WinSvc.h as follows: |
SC_LOCK | Lock to a service control manager database. For more information, see SCM Handles. This type is declared in WinSvc.h as follows: |
SERVICE_STATUS_HANDLE | Handle to a service status value. For more information, see SCM Handles. This type is declared in WinSvc.h as follows: |
SHORT | A 16-bit integer. The range is –32768 through 32767 decimal. This type is declared in WinNT.h as follows: |
SIZE_T | The maximum number of bytes to which a pointer can point. Use for a count that must span the full range of a pointer. This type is declared in BaseTsd.h as follows: |
SSIZE_T | Signed SIZE_T. This type is declared in BaseTsd.h as follows: |
TBYTE | A WCHAR if UNICODE is defined, a CHAR otherwise. This type is declared in WinNT.h as follows: |
TCHAR | A WCHAR if UNICODE is defined, a CHAR otherwise. This type is declared in WinNT.h as follows: |
UCHAR | Unsigned CHAR. This type is declared in WinDef.h as follows: |
UHALF_PTR | Unsigned HALF_PTR. Use within a structure that contains a pointer and two small fields. This type is declared in Basetsd.h as follows: |
UINT | Unsigned INT. The range is 0 through 4294967295 decimal. This type is declared in WinDef.h as follows: |
UINT_PTR | Unsigned INT_PTR. This type is declared in BaseTsd.h as follows: |
UINT32 | Unsigned INT32. The range is 0 through 4294967295 decimal. This type is declared in BaseTsd.h as follows: |
UINT64 | Unsigned INT64. The range is 0 through 18446744073709551615 decimal. This type is declared in BaseTsd.h as follows: |
ULONG | Unsigned LONG. The range is 0 through 4294967295 decimal. This type is declared in WinDef.h as follows: |
ULONGLONG | 64-bit unsigned integer. The range is 0 through 18446744073709551615 decimal. This type is declared in WinNT.h as follows: |
ULONG_PTR | Unsigned LONG_PTR. This type is declared in BaseTsd.h as follows: |
ULONG32 | Unsigned LONG32. The range is 0 through 4294967295 decimal. This type is declared in BaseTsd.h as follows: |
ULONG64 | Unsigned LONG64. The range is 0 through 18446744073709551615 decimal. This type is declared in BaseTsd.h as follows: |
UNICODE_STRING | A Unicode string. This type is declared in Winternl.h as follows: |
USHORT | Unsigned SHORT. The range is 0 through 65535 decimal. This type is declared in WinDef.h as follows: |
USN | Update sequence number (USN). This type is declared in WinNT.h as follows: |
VOID | Any type. This type is declared in WinNT.h as follows: |
WCHAR | 16-bit Unicode character. For more information, see Character Sets Used By Fonts. This type is declared in WinNT.h as follows: |
WINAPI | Calling convention for system functions. This type is declared in WinDef.h as follows: CALLBACK, WINAPI, and APIENTRY are all used to define functions with the __stdcall calling convention. Most functions in the Windows API are declared using WINAPI. You may wish to use CALLBACK for the callback functions that you implement to help identify the function as a callback function. |
WORD | 16-bit unsigned integer. The range is 0 through 65535 decimal. This type is declared in WinDef.h as follows: |
WPARAM | Message parameter. This type is declared in WinDef.h as follows: |
Build date: 3/26/2010
Is it in above is typing error?LONGLONG
64-bit signed integer. The range is –9223372036854775808 through 9223372036854775807 decimal.
This type is declared in WinNT.h as follows:
#if !defined(_M_IX86)
typedef __int64 LONGLONG;
#else
typedef double LONGLONG;
#endif
The datatype "double" is defined:
Type double is a floating type that is larger than or equal to type float, but shorter than or equal to the size of type longdouble.1
http://msdn.microsoft.com/en-us/library/cc953fe1.aspx
![](http://i.msdn.microsoft.com/Hash/030c41d9079671d09a62d8e2c1db6973.gif)
though HWND is a "pointer to void *"
or (in the VBasic example) an IntPtr (pointer to an int)
you can't actually read the value it points to, or write to that location. It's just a pointer into some deep dark windows data structure, and the fact that it points into that exact location is all it gives you. You'll get a memory read exception if you try to read from that location.
![](http://i.msdn.microsoft.com/Hash/030c41d9079671d09a62d8e2c1db6973.gif)
- 3/1/2010
- rogerdpack
MSDN Type Visual Basic 9 Type
ATOM UShort
BOOL Integer
BOOLEAN Byte
BYTE Byte
CALLBACK Delegate
CHAR SByte
COLORREF UInteger
CONST Const
DWORD UInteger
DWORDLONG ULong
DWORD_PTR UInteger (ULong)
DWORD32 UInteger
DWORD64 Long
FLOAT Single
HACCEL IntPtr
HALF_PTR Short (Integer)
HANDLE IntPtr
HBITMAP IntPtr
HBRUSH IntPtr
HCONV IntPtr
HCONVLIST IntPtr
HCURSOR IntPtr
HDC IntPtr
HDDEDATA IntPtr
HDESK IntPtr
HDROP IntPtr
HDWP IntPtr
HENHMETAFILE IntPtr
HFILE Integer
HFONT IntPtr
HGIDOBJ IntPtr
HGLOBAL IntPtr
HHOOK IntPtr
HICON IntPtr
HINSTANCE IntPtr
HKEY IntPtr
HKL IntPtr
HLOCAL IntPtr
HMENU IntPtr
HMETAFILE IntPtr
HMODULE IntPtr
HMONITOR IntPtr
HPALETTE IntPtr
HPEN IntPtr
HRESULT Integer
HRGN IntPtr
HRSRC IntPtr
HSZ IntPtr
HWINSTA IntPtr
HWND IntPtr
INT_PTR Integer (Long)
INT32 Integer
INT64 Long
LANGID UShort
LCID UInteger
LGRPID UInteger
LONG Integer
LONGLONG Long
LONG_PTR Integer (Long)
LONG32 Integer
LONG64 Long
LPARAM Integer (Long)
LPBOOL ByRef Integer
LPBYTE ByRef Byte
LPCOLORREF UInteger
LPCSTR ByRef SByte
LPCTSTR ByRef Char
LPCWSTR ByRef Char
LPDWORD UInteger
LPHANDLE ByRef IntPtr
LPINT Integer (Long)
LPLONG Integer
LPSTR ByRef SByte
LPTSTR ByRef Char
LPVOID IntPtr
LPWORD UShort
LPWSTR ByRef Char
LRESULT Integer (Long)
PBOOL Integer (Long)
PBOOLEAN ByRef Byte
PBYTE ByRef Byte
PCHAR ByRef SByte
PCSTR ByRef SByte
PCTSTR ByRef Char
PCWSTR ByRef Char
PDWORD UInteger
PDWORDLONG ByRef ULong
PDWORD_PTR ByRef UInteger (ULong)
PDWORD32 ByRef UInteger
PDWORD64 ByRef Long
PFLOAT ByRef Single
PHALF_PTR ByRef Short (Integer)
PHANDLE ByRef IntPtr
PHKEY ByRef IntPtr
PINT Integer (Long)
PINT_PTR ByRef Integer (Long)
PINT32 ByRef Integer
PINT64 ByRef Long
PLCID UInteger
PLONG Integer
PLONGLONG ByRef Long
PLONG_PTR ByRef Integer (Long)
PLONG32 ByRef Integer
PLONG64 ByRef Long
POINTER_32 (IntPtr)
POINTER_64 IntPtr
POINTER_SIGNED IntPtr
POINTER_UNSIGNED UIntPtr
PSHORT Short
PSIZE_T ByRef UInteger (ULong)
PSSIZE_T ByRef Integer (Long)
PSTR ByRef SByte
PTBYTE ByRef Char
PTCHAR ByRef Char
PTSTR ByRef Char
PUCHAR ByRef Byte
PUHALF_PTR ByRef UShort (UInteger)
PUINT ByRef UInteger
PUINT_PTR ByRef UInteger (ULong)
PUINT32 ByRef UInteger
PUINT64 ByRef ULong
PULONG UInteger
PULONGLONG ByRef ULong
PULONG_PTR ByRef UInteger (ULong)
PULONG32 ByRef UInteger
PULONG64 ByRef ULong
PUSHORT UShort
PVOID IntPtr
PWCHAR ByRef Char
PWORD UShort
PWSTR ByRef Char
SC_HANDLE IntPtr
SC_LOCK IntPtr
SERVICE_STATUS_HANDLE IntPtr
SHORT Short
SIZE_T UInteger (ULong)
SSIZE_T Integer (Long)
TBYTE Char
TCHAR Char
UCHAR Byte
UHALF_PTR UShort (UInteger)
UINT UInteger
UINT_PTR UInteger (ULong)
UINT32 UInteger
UINT64 ULong
ULONG UInteger
ULONGLONG ULong
ULONG_PTR UInteger (ULong)
ULONG32 UInteger
ULONG64 ULong
UNICODE_STRING Structure UNICODE_STRING : Dim Lenght As UShort, MaximumLenght As UShort, ByRef Buffer As Char : End Structure
USHORT UShort
USN Long
VOID Object
WCHAR Char
WIANPI Delegate
WORD UShort
WPARAM UInteger (ULong)
2 types means 32bit plaform (64bit platform)
Assumes #Unicode directive
Assumest highest Windows version possible
See full table http://spreadsheets.google.com/ccc?key=pK5CEcdG9GYGeO7K2dmEcBg