while(GetMessage(&Msg,NULL,0,0)) // 消息循环从消息队列中读取消息,并将消息放在MSG结构体中。 { TranslateMessage(&Msg); // 将消息的虚拟键转换为字符信息 DispatchMessage(&Msg); // 将消息传送到指定窗口函数 }
// The structure of GetMessage() GetMessage { lpMsg, // 指向MSG结构的指针 hwnd, // 窗口句柄 nMsgFilterMin, // 用于消息过滤的最小消息号值 nMsgFilterMax, // 用于消息过滤的最大消息号值 }