MFC Windows 程序设计->捕获鼠标
来源:互联网 发布:java工程师需要学什么 编辑:程序博客网 时间:2024/05/01 22:49
In between, CMainWindow receives WM_MOUSEMOVE messages that report the cursor position even if the cursor leaves it. Client-area mouse messages continue to report cursor positions in client coordinates, but coordinates can now go negative and can also exceed the dimensions of the window's client area.
A related function, CWnd::GetCapture, returns a CWnd pointer to the window that owns the capture. In the Win32 environment, GetCapture returns NULL if the mouse is not captured or if it's captured by a window belonging to another thread. The most common use of GetCapture is for determining whether your own window has captured the mouse. The statement
if (GetCapture () == this)
is true if and only if the window identified by this currently has the mouse captured.
How does capturing the mouse solve the problem with the rubber-banded line? By capturing the mouse in response to a WM_LBUTTONDOWN message and releasing it when a WM_LBUTTONUP message arrives, you're guaranteed to get the WM_LBUTTONUP message when the mouse button is released. The sample program in the next section illustrates the practical effect of this technique.
- MFC Windows 程序设计->捕获鼠标
- windows程序设计之捕获鼠标
- MFC Windows 程序设计 第三章 鼠标与键盘
- MFC Windows程序设计学习笔记--鼠标和键盘
- Windows程序设计 -鼠标
- 《Windows程序设计》之鼠标
- Windows程序设计--鼠标
- Windows程序设计-鼠标
- win32 MFC中捕获鼠标信息
- 《MFC Windows 程序设计》
- mfc windows 程序设计
- MFC Windows 程序设计(1)
- MFC Windows 程序设计(2)
- MFC Windows 程序设计(3)
- MFC Windows 程序设计(4)
- MFC Windows 程序设计(5)
- MFC Windows 程序设计(6)
- MFC Windows 程序设计(7)
- 汇编语言的艺术环境配置
- Const,Const函数,Const变量,函数后面的Const (zz)
- awk使用手册
- 如何修改linux中console下ls显示各种文件的颜色和vim中颜色
- callback函数
- MFC Windows 程序设计->捕获鼠标
- 程序只启动一个实例的几种方法(转自http://blog.csdn.net/starlee)
- 自定义AuthenticationProvider的简单例子
- 大端和小端(网络字节序和主机字节序)
- 【转】throw 和 throw ex 的区别
- TCP三次握手及四次挥手详细图解
- 缓存
- SuperMap 控件的操作状态常量
- 算法学习笔记(3)——分治法,Fibonacci数列,Strassen算法