Windows消息的结构体:
MSG
//The MSG structure contains message information from a thread's message queue
typedef struct tagMSG {
// msg
HWND hwnd; //窗口句柄, 窗口对象的标识
UINT message; //消息类型 每一个值对应不同的消息类型(点击、 键入)
WPARAM wParam; //消息参数
LPARAM lParam; //消息参数
DWORD time; //时间戳
POINT pt; //坐标
} MSG;
窗口函数
//LRESULT :The simple data types supported by the Win32 API are used to define function return values, function and message parameters, and structure members. They define the size and meaning of these elements
//CALLBACK __stdcall
//wParam 、lParam 先查消息类型 在看这俩个参数的意义
LRESULT CALLBACK WindowProc( //窗口处理函数
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // first message parameter 不同的消息类型 这个参数值也不同
LPARAM lParam // second message parameter 不同的消息类型 这个参数值也不同
)
// 第一个窗口.cpp : 定义应用程序的入口点。
//
#include "stdafx.h"
#include "stdio.h"
#include "第一个窗口.h"
LRESULT CALLBACK WindowProc( //窗口处理函数
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
){
//WM_CREATE;
TCHAR szOutBufferMessage[0x80];