请问怎样才能用一个Button控件被按下时,些时按住MOUSE左键在屏幕上移动,可以取得
RGB值.也就是MOUSE移出了本程序窗口,程序还能得到MOUSE的消息.
RGB值.也就是MOUSE移出了本程序窗口,程序还能得到MOUSE的消息.
解决方案 »
- GuiToolkit Ver1.1.8 Bug Fixes and Add Unicode Support
- animatewindow怎么使用在自绘子窗口上,高手指点
- 怎么将一系列的位图用GIF的方式多帧显示
- 怎样在注册表中 创建一个项?
- 有使用sockscap32的吗?它是什么工作原理?
- 我粗劣的实现了屏幕录象,谁感兴趣,可以交流一下,代码实在是见不得人,还有一大堆问题呢。
- 列表框(ListCtrl)不能显示图标,请各位帮忙!
- 动态生成的控件怎么响应事件?
- ADO的get_recordcount函数(急!)
- 求问:如何在richedit中实现分页??
- oracle数据库记录更新~~~Help
- 关于代码移植的问题!
CString str;
COLORREF clr;
DWORD dw;while(1)
{
HDC hDC = ::GetDC(0);
GetCursorPos(&point);
dw = MAKELONG(point.x,point.y);
str.Format("X=%d Y=%d DWORD=%d",point.x,point.y,dw);
pDlg->GetDlgItem(IDC_STATIC1)->SetWindowText(str); //在窗口中显示当前坐标 CString ClrText="",text="";
clr = ::GetPixel(hDC,point.x,point.y); ClrText.Format("R=%d G=%d B=%d",GetRValue(clr),GetGValue(clr),GetBValue(clr));
pDlg->GetDlgItem(IDC_STATIC2)->SetWindowText(ClrText); //在窗口中显示RGB值
}
CWnd* SetCapture( );Return ValueA pointer to the window object that previously received all mouse input. It is NULL if there is no such window. The returned pointer may be temporary and should not be stored for later use.ResCauses all subsequent mouse input to be sent to the current CWnd object regardless of the position of the cursor.
ReleaseCapture
The ReleaseCapture function releases the mouse capture from a window in the current thread and restores normal mouse input processing. A window that has captured the mouse receives all mouse input, regardless of the position of the cursor, except when a mouse button is clicked while the cursor hot spot is in the window of another thread. BOOL ReleaseCapture(VOID);
Parameters
This function has no parameters. Return Values
If the function succeeds, the return value is nonzero.