It is worth noting that Win32 development is a C language programming, therefore, it is very important to understand the data type. Windows API re-defines some data types with typedef or define macros for historical reasons or for convenience in Windows.h.
- UINT represents an unsigned integer unsigned int in the C language
- PSTR = string pointer char *
- WPARAM represents unsigned short int in a 16-bit period of windows and is now a uint
- LPARAM means long
- The return type of the WndProc function lresult is actually a long
- The ingress function WinMain the specified WINAPI and WndProc are indicated by the _stdcall, which represents the way in which the parameters of a function call occur between Windows and the user application.
In addition, handles are a large number of types used in Windows APIs, such as HInstance, HWND, HDC, Hicon, Hcuror, Hbrush. They are actually a 32-bit integer that represents a particular object. As far as I know, this thing seems to be a legacy of windows in a single-tasking period, marking different instances of the same program so that memory inheritance can precede them.
Windows variables conform to Hungarian notation, with the first lowercase letters representing the type attributes of the variable, such as:
- SZ in szCmdLine represents a string ending with "\"
- The letter H at the beginning of HInstance and hprevinstance represents the handle handle
- The starting letter I of the icmdshow indicates the integer type
And for structural variables, such as MSG structure, it is directly expressed with MSG; WNDCLASS structure wndclass; Paintstructure structure PS, and so on.
Now look at what Windows really deserves to learn, be able to build a system kernel and application layer in C, and then encapsulate Windows APIs in other languages, building com, ATL, MFC, and so on. NET and so on to a higher level of development layer. Now the visual Studio2015 actually embeds the Java SE Development, a platform that can write desktop, Mobile Phone, Android, iOS programs. It's too expensive to hear that Windows is the most cherished programmer's platform, but now visual Studio 2015 has free licensed Community Edition lisence available.
Data structures in the Windows API