背景:
在切分窗口种关联视图。为了显示property sheet,我先在切分窗口中嵌入formview,在formview上有个picture,然后通过两个全局函数把sheet迁入picture,这样就完成了把sheet关联到切分窗口。
问题: 当拖拉主窗口使其改变大小时sheet上的property page 怎样才能跟着改变大小跟着窗口变动呢????
望赐教,感激不尽!!!
在切分窗口种关联视图。为了显示property sheet,我先在切分窗口中嵌入formview,在formview上有个picture,然后通过两个全局函数把sheet迁入picture,这样就完成了把sheet关联到切分窗口。
问题: 当拖拉主窗口使其改变大小时sheet上的property page 怎样才能跟着改变大小跟着窗口变动呢????
望赐教,感激不尽!!!
解决方案 »
- VC++五子棋游戏开发中级别设置的代码是什么
- CListBox的onselchange不响应
- 请教高手FD_CLOSE问题
- 用枚举的方法来查找表单的时候,怎么保证不反复枚举之前已经被枚举过的表单
- COM中如何把接口从客户端传到服务端
- 我在.Net 2003中编写Pro*C程序,扩展名为.pc,这样的话.Net 2003似乎就不把该文件当作cpp文件处理了,连函数的智能参数显示功能都不能使
- 有个比较弱的问题,在线等待...
- 怎样动态的改变对话框的caption属性值?
- VC菜鸟的问题
- 在线等啊!关于定时器OnTimer内部上加do..while(1);的执行问题
- 简单问题,怎样让控件的大小随着对话框改变,什么函数啊
- help me!为什么我不能为控件定义变量??
#define ID_SECONDCHILD 101
#define ID_THIRDCHILD 102
LONG APIENTRY MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
RECT rcClient;
int i;
switch(uMsg)
{
case WM_CREATE: // creating main window
// Create three invisible child windows. for (i = 0; i < 3; i++)
{
CreateWindowEx(0,
"ChildWClass",
(LPCTSTR) NULL,
WS_CHILD | WS_BORDER,
0,0,0,0,
hwnd,
(HMENU) (int) (ID_FIRSTCHILD + i),
hinst,
NULL);
}
return 0;
case WM_SIZE: // main window changed size
// Get the dimensions of the main window's client
// area, and enumerate the child windows. Pass the
// dimensions to the child windows during enumeration.
GetClientRect(hwnd, &rcClient);
EnumChildWindows(hwnd, EnumChildProc, (LPARAM) &rcClient);
return 0; // Process other messages.
}
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
BOOL CALLBACK EnumChildProc(HWND hwndChild, LPARAM lParam)
{
LPRECT rcParent;
int i, idChild;
// Retrieve the child-window identifier. Use it to set the
// position of the child window.
idChild = GetWindowLong(hwndChild, GWL_ID);
if (idChild == ID_FIRSTCHILD)
i = 0;
else if (idChild == ID_SECONDCHILD)
i = 1;
else
i = 2;
// Size and position the child window.
rcParent = (LPRECT) lParam;
MoveWindow(hwndChild,
(rcParent->right / 3) * i,
0,
rcParent->right / 3,
rcParent->bottom,
TRUE);
// Make sure the child window is visible.
ShowWindow(hwndChild, SW_SHOW);
return TRUE;
}
我也是向相应wm_size,可是page是放在foremview上的picture proprty 里,是不是计算改变
picture?老实说计算坐标真得很头疼!
POINTS gp_focus = MAKEPOINTS(lParam);
int x=LOWORD(lParam);
int y=HIWORD(lParam));
MoveWindow();