关于PEEKMESSAGE的一个问题

zldrobit 2008-03-26 08:31:14
while (GetMessage(&msg, NULL, 0, 0))
{
//if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}

}

请问高手为什么在我把上边的注释去掉以后程序运行得有点卡,甚至会有很长一段时间没有响应
PEEKMESSAGE的使用应该不会有问题的吧?
我用的是VS2005+WINXP
...全文
86 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
knowledge_Is_Life 2008-05-01
  • 打赏
  • 举报
回复
接分先!
真相重于对错 2008-03-27
  • 打赏
  • 举报
回复
You can use the PeekMessage function to examine a message queue during a lengthy operation. PeekMessage is similar to the GetMessage function; both check a message queue for a message that matches the filter criteria and then copy the message to an MSG structure. The main difference between the two functions is that GetMessage does not return until a message matching the filter criteria is placed in the queue, whereas PeekMessage returns immediately regardless of whether a message is in the queue.

7,540

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 VC.NET
社区管理员
  • VC.NET社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧