窗体中生成了一个TOOLBAR和一个TREEVIEW改变大小位置代码如下:case WM_SIZE:
HDWP hdwp;
RECT rect;
RECT toolbar;
RECT tree; hdwp = BeginDeferWindowPos(2);
GetClientRect(hwnd, &rect);
GetClientRect(hToolBar, &toolbar);
GetClientRect(hTree, &tree);
DeferWindowPos(hdwp, hToolBar, NULL, 0, 0,
rect.right, toolbar.bottom, SWP_NOZORDER);
DeferWindowPos(hdwp, hTree, NULL, 0, toolbar.bottom,
toolbar.bottom, rect.bottom, SWP_NOZORDER); EndDeferWindowPos(hdwp);
break;
但是在窗体Size改变时TOOLBAR和TREEVIEW并没有变化,跟踪了下,
toolbar和rect都有正确值。大家帮忙看下是什么原因?
谢谢!
HDWP hdwp;
RECT rect;
RECT toolbar;
RECT tree; hdwp = BeginDeferWindowPos(2);
GetClientRect(hwnd, &rect);
GetClientRect(hToolBar, &toolbar);
GetClientRect(hTree, &tree);
DeferWindowPos(hdwp, hToolBar, NULL, 0, 0,
rect.right, toolbar.bottom, SWP_NOZORDER);
DeferWindowPos(hdwp, hTree, NULL, 0, toolbar.bottom,
toolbar.bottom, rect.bottom, SWP_NOZORDER); EndDeferWindowPos(hdwp);
break;
但是在窗体Size改变时TOOLBAR和TREEVIEW并没有变化,跟踪了下,
toolbar和rect都有正确值。大家帮忙看下是什么原因?
谢谢!
解决方案 »
- vc++6.0技术内幕和精通MFC程序设计哪本要好点,或者还有更好的学vc的书么?
- 系统托盘的菜单和tip的问题, 急求解答, 拜谢.
- 如何用CRichEditCtrl设置超连接呢?
- 问问各位:把一个类里的数据给另外一个类,而且另外一个类是这样的,应该如何实现?郁闷之中。。。。
- 怎样在Dialog类中得到文件指针????????
- 怎么使用微软的g.723语音压缩,对我要用的都给分
- 请大侠帮手:如何获取所有窗口的句柄?
- 100分求助,请问怎么读取_variant_t 中的内容
- MFC 当鼠标滚轮滚动结束发送一个消息,怎么判断鼠标滚轮滚动结束
- 这个问题贴在这不知合适不合适
- PCSTR 和char s[8]的关系vc++
- 有人用过封装的ADO类吗?请教一个问题
我查了下,跟踪到Size改变时,GetClientRect获取的是当前尺寸啊。
hToolBar ->getwindowrect((&rect2)//目标控件 getwindowrect
onsize(int cx,int cy)
{
..........
screentoclent(&rect2)
movewindow(....);
..............
}