WM_MOUSEFIRST,WM_MOUSELAST的Peekmessage问题 [英] Peekmessage issue for WM_MOUSEFIRST, WM_MOUSELAST

查看:647
本文介绍了WM_MOUSEFIRST,WM_MOUSELAST的Peekmessage问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

while(:: PeekMessage(& msg,m_hWnd,WM_MOUSEFIRST,WM_MOUSELAST,PM_REMOVE))



这个循环没有结束有些时候你可以让我知道可能是什么问题。





我为跟踪细胞的拉伸而写的这个功能。



我尝试了什么:



while ( ::PeekMessage(&msg, m_hWnd, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE) )

this loop is not ending some times could you please let me know what might be the problem.


this functionality i wrote for Track the strecthing of a cell.

What I have tried:

while ( true )
{
		MSG msg;
		while ( ::PeekMessage(&msg, m_hWnd, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE) )
		{
			if ( msg.message != WM_MOUSEMOVE )
			{
				dc.DrawDragRect(&cRectLast, CSize(2, 2), NULL, CSize(2, 2));
				DispatchMessage(&msg);
				return;
			}
			else
			{
				CPoint cPoint(GET_X_LPARAM(msg.lParam),    GET_Y_LPARAM(msg.lParam));
            }

推荐答案

PeekMessage文档表示,如果没有可用的消息,它只会返回false。另请参阅本文中的示例代码。



输入传入的消息以更好地理解传入的消息。



你的代码片段:外部循环只会在返回的情况下退出,否则你会按照标题重新输入。
The documentation of PeekMessage says that it only returns false, if no message is available. Take also a look at the example code in this articel.

Make an output of the incoming messages to better understand the incoming messages.

Your code snippet: the outer loop will only get exited with the return, else you get an re-entry per the heading while.


这篇关于WM_MOUSEFIRST,WM_MOUSELAST的Peekmessage问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆