2010年9月14日星期二

Overview of Windows API

7 functional categories of Win API
int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR cp, int show) {....}

#define WINAPI __stdcall
typedef HANDLE HINSTANCE;
typedef PVOID HANDLE;
typedef void* PVOID;
typedef CHAR* LPSTR;
typedef char CHAR;

All window procedures share the same signature except for their name. There are four parameters. The header for any window procedure takes the form


BOOL CALLBACK nameWinProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 typedef  int           BOOL;
#define CALLBACK __stdcall
typedef HANDLE HWND;
typedef unsigned int UINT;
typedef UINT_PTR WPARAM;
typedef unsigned int UINT_PTR;
typedef LONG_PTR LPARAM;
typedef long LONG_PTR;

more details refer GAM666 introduction page
typedef can refer wikipidea/typedef