1、Windows SDK和API
Windows SDK | 每出现一套新的Windows系统,就会推出一个SDK(软件开发工具包Software Development Kit)。 SDK可以理解成Windows系统提供的软件开发工具的集合,除了大量的Windows函数、定义还包括相关的说明文档、辅助工具、实例等。 |
Windows API | Windows API是Windows为应用程序提供的接口,应用程序可以借助API调用系统提供的函数等,而这些被调用的函数包括API函数本身都是SDK的一部分。可以说API就是SDK为程序员提供可以直接访问、使用的函数。 |
2、Windows API 用到的都是Windows数据类型
本质上Windows数据类型和C++本身提供的数据类型没有本质的区别,只是Windows系统针对C++的数据类型提供了自己的命名方式(用typedef重命名)。
Windows常见的数据类型如下表所示
类型名称(大写,但好像Windows数据类型不区分大小) | 类型说明 |
WORD | 16位无符号整型 |
DWORD | 32位无符号整型 |
DWORD64 | 64位无符号整型 |
INT | 32位有符号整型(在32位机) |
INT32 | 32位符号整型 |
INT64 | 64位符号整型 |
UINT | 无符号INT,在32位机上与DWORD一样 |
LONG | 32位有符号整型,在32位机上与INT一样 |
LONGLONG | 64位有符号整型 |
ULONG | 无符号LONG |
INT_PTR | 指向INT数据类型的指针类型 |
LPSTR | 字符指针,也就是字符串变量 |
LPCSTR | 字符串常量 |
LPDWORD | 指向DWORD类型数据的指针 |
WCHAR | 16位Unicode字符,可以对应汉字 |
HWND | 窗口句柄 |
HANDLE | 对象句柄 |