消息机制是Windows应用程序运行的核心工作机制。消息往往用一个如下的结构体MSG来表示,其定义如下:
typedef struct tagMSG
{
HWND hwnd;
UINT message;
WPARAM wParam;
LPARAM lParam;
DWORD time;
POINT pt;
}MSG;