#define FALSE 0 afx.h
#define TRUE 1 afx.h
#define NULL 0 afx.h
typedef void VOID winnt.h
//短整型typedef unsigned short
typedef unsigned short USHORT; windef.h
typedef unsigned short WORD; windef.h
typedef unsigned short wchar_t
typedef short SHORT; winnt.h
//整型typedef int
typedef int BOOL; //取值为TRUE or FALSE windef.h
typedef int INT; windef.h
typedef unsigned int UINT; //定义一个新的Win32数据类型,它会把一个参数强制转换成Windows3.x应用中的16位值 或Win32应用中的32位值windef.h
//长整型typedef long
typedef unsigned long ULONG; windef.h
typedef unsigned long DWORD; windef.h
typedef DWORD COLORREF; windef.h
typedef long LONG; winnt.h
typedef __int64 LONGLONG; winnt.h
typedef unsigned __int64 ULONGLONG; winnt.h
typedef ULONGLONG DWORDLONG; winnt.h
//浮点型
typedef float FLOAT; windef.h
typedef double DOUBLE; wtypes.h
//字符类型typedef char
typedef char CHAR/CCHAR; winnt.h
typedef unsigned char UCHAR; windef.h
typedef unsigned char BYTE; windef.h
typedef wchar_t WCHAR; //声明一个16位的UNICODE字符,用来表示世界上所有已知的书写语言的符号winnt.h
//指向字符串的指针类型LP*
/*以下为winnt.h的部分内容*/
// UNICODE (Wide Character) types
typedef wchar_t WCHAR; // wc, 16-bit UNICODE character
typedef __nullterminated WCHAR *NWPSTR, *LPWSTR, *PWSTR;
typedef __nullterminated CONST WCHAR *LPCWSTR, *PCWSTR;
// ANSI (Multi-byte Character) types
typedef CHAR *PCHAR, *LPCH, *PCH;
typedef __nullterminated CHAR *NPSTR, *LPSTR, *PSTR;
//指向Windows字符串(以空字符结束)的32位指针char*
typedef __nullterminated CONST CHAR *LPCSTR, *PCSTR;
//指向Windows常字符串(以空字符结束)的32位指针const char*
// Neutral ANSI/UNICODE types and macros
// tchar.h
#ifdef _UNICODE
typedef wchar_t _TCHAR;
typedef wchar_t TCHAR;
#else /* ndef _UNICODE */
typedef char _TCHAR;
typedef char TCHAR;
#endif
typedef LPWSTR PTSTR, LPTSTR;
//指向Windows字符串(以空字符结束)的32位指针,用于移植到双字节字符集
LPTSTR For Unicode platforms,it is LPWSTR,For ANSI and DBCS platforms,it is LPSTR
typedef LPCWSTR PCTSTR, LPCTSTR;
//指向Windows常字符串(以空字符结束)的32位指针const char* ,用于移植到双字节字符集
LPCTSTR For Unicode platforms,it is LPCWSTR,For ANSI and DBCS platforms,it is LPCSTR
typedef LPWSTR LP;
/*以上为winnt.h的部分内容*/
#define __T(x) x tchar.h // ndef _UNICODE
#define _T(x) __T(x) tchar.h
#define _TEXT(x) __T(x) tchar.h
#define __TEXT(quote) L##quote winnt.h // r_winnt
//以上的_T、__T、_TEXT、__TEXT、L宏使字符串会自动根据工程的版本(ANSI还是UNICODE)进行转化. 使代码不需修改自动适应ASNI和UNICODE版本
typedef WCHAR OLECHAR; wtypes.h
typedef /* [wire_marshal] */ OLECHAR *BSTR; unsigned short* wtypes.h
//函数参数、返回值类型
typedef UINT_PTR WPARAM; //窗口函数或callback函数的一个参数,在Win16中是16-bit,在Win32中是32-bit windef.h
typedef LONG_PTR LPARAM; //32位窗口函数或callback函数的一个参数windef.h
typedef LONG_PTR LRESULT; //32位作为窗口函数或callback函数的返回值windef.h
//指向函数的指针类型
typedef int (WINAPI *PROC)();PROC //指向回调函数的指针
typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
//Windows函数调用类型__stdcall
#define CALLBACK __stdcall windef.h
#define WINAPI __stdcall windef.h
#define WINAPIV __cdecl windef.h
#define APIENTRY WINAPI windef.h
#define APIPRIVATE __stdcall windef.h
#define PASCAL __stdcall windef.h
// 关于调用宏参考http://blog.163.com/xiang_163_ok/blog/static/6171684520082161551829/
typedef void far *LPVOID; 指向任意类型的指针windef.h
-----------------请右键->Go to definition of XXX-----------------------
评论