在lbuttondown响应函数中
CRect rect;
GetDlgItem(IDD_CONTROL)->GetClientRect(&rect);
if(point.x>rect.left&&point.x<rect.right&&point.y<rect.bottom&&point.y>rect.top)
{
AfxMessageBox(test);
}
这样好像不行,为什么?
CRect rect;
GetDlgItem(IDD_CONTROL)->GetClientRect(&rect);
if(point.x>rect.left&&point.x<rect.right&&point.y<rect.bottom&&point.y>rect.top)
{
AfxMessageBox(test);
}
这样好像不行,为什么?
解决方案 »
- 20个通宵没明白的爱立信的面试题(几十行代码):下面函数OnQueryUeData中的pucResult 的值的来龙去脉
- WinInet发送HTTP请求时查询字符串带汉字可能异常
- skinmagic 与 显示gif动画问题
- 将文本文件中的内容以空格为分隔符存到数据库???急急急
- ActiveSkin 的问题,谢谢!
- 关于用esmtp发邮件的问题
- 有关进程间数据共享,急,急
- udp丢包。具体情况,内详。谢谢大大!
- 端口号都是16位,那些号称百万连接是怎么来的
- 求高手分析下关于变体变量转化的程序
- LINK : warning LNK4089: all references to "ADVAPI32.dll" discarded by /OPT:REF
- 请问什么是累积直方图?
RECT r;
GetDlgItem(IDC_FR_REFLECTCOLOR)->GetWindowPlacement(&wp);
r=wp.rcNormalPosition;
if(point.x>r.left&&point.x<r.right
point.y>r.top&&point.y<r.bottom)
{.............}
BOOL PtInRect( POINT point ) const;Return ValueNonzero if the point lies within CRect; otherwise 0.ParameterspointContains a POINT structure or CPoint object.ResDetermines whether the specified point lies within CRect. A point is within CRect if it lies on the left or top side or is within all four sides. A point on the right or bottom side is outside CRect.Note The rectangle must be normalized or this function may fail. You can call NormalizeRect to normalize the rectangle before calling this function.
是针对
CRECT类或者其派生类的吧,我的是控件,例如picture控件
还有一种方法是CRect rect;
GetwindowRect(&rect);
ScreenToClient(&rect);
if(point.x>rect.left&&point.x<rect.right&&point.y<rect.bottom&&point.y>rect.top)
{
AfxMessageBox(test);
}
谢谢大家的热心帮助