问题描述
我遇到了一个特殊的问题,即正常点击被检测为拖动。
void MyClass::OnLButtonDown(UINT nFlags,CPoint point)
{
ParentClass::OnLButtonDown(nFlags,point);
if (!HandleDrag(point))
HandleClick(point);
}
bool MyClass::HandleDrag(const CPoint& pos)
{
//debug code - start
//retrieves correct value here,which was set
int cxDrag = GetSystemMetrics(SM_CXDRAG);
int cyDrag = GetSystemMetrics(SM_CYDRAG);
// debug code - end
if (DragDetect(pos) && !IsDragging())
{
StartDragging();
return true;
}
return false;
}
Cx和Cy拖动的默认值为4。 即使我在Class构造函数中使用以下调用为Drag Rect设置了较大的值,
SystemParametersInfo(SPI_SETDRAGWIDTH,10,NULL,SPIF_SENDCHANGE);
SystemParametersInfo(SPI_SETDRAGHEIGHT,SPIF_SENDCHANGE);
即使对于像素拖动,Windows仍对DragDetect()返回True。 有人知道我在做什么错吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)