关于MoveWindow()??? 高分相送!!望赐教!!

soviajia 2003-05-15 11:56:10
背景:
在切分窗口种关联视图。为了显示property sheet,我先在切分窗口中嵌入formview,在formview上有个picture,然后通过两个全局函数把sheet迁入picture,这样就完成了把sheet关联到切分窗口。
问题:

当拖拉主窗口使其改变大小时sheet上的property page 怎样才能跟着改变大小跟着窗口变动呢????
望赐教,感激不尽!!!
...全文
42 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
soviajia 2003-05-16
  • 打赏
  • 举报
回复
是要处理响应“用鼠标改变框架的大小“的消息,怎么会要用到wm_mousemove 呢?不明白
poney 2003-05-15
  • 打赏
  • 举报
回复
你的formview在改变大小的时候会触发WM_SIZE事件,添加一个相应函数,在相应函数里面改变你的property page大小就可以了。
laolaoliu2002 2003-05-15
  • 打赏
  • 举报
回复
#define ID_FIRSTCHILD 100
#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;
}
3jaja 2003-05-15
  • 打赏
  • 举报
回复
case WM_MOUSEMOVE:
POINTS gp_focus = MAKEPOINTS(lParam);
int x=LOWORD(lParam);
int y=HIWORD(lParam));
MoveWindow();
soviajia 2003-05-15
  • 打赏
  • 举报
回复
老刘兄的做法我还得仔细看看


我也是向相应wm_size,可是page是放在foremview上的picture proprty 里,是不是计算改变
picture?老实说计算坐标真得很头疼!
loopyifly 2003-05-15
  • 打赏
  • 举报
回复
...
HKer_007 2003-05-15
  • 打赏
  • 举报
回复
同意,响应WM_SIZE,计算坐标,Move

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧