JiiPee
2016-01-02 01:46:12 UTC
I want to have child frame windowses inside my SDI applications view
just like in MDI child frame windowses have boundaries inside the main
frame. How can I do this? I created my own frame windowses like this:
void CChildFrame::CreateAndShow(CView* pParentView)
{
CCreateContext ccc;
ccc.m_pNewViewClass = RUNTIME_CLASS(CChildFrameView);
ccc.m_pCurrentDoc = NULL;
ccc.m_pNewDocTemplate = NULL;
ccc.m_pLastView = NULL;
ccc.m_pCurrentFrame = this;
Create( NULL,m_parameters.title,WS_OVERLAPPEDWINDOW | WS_BORDER |
WS_CHILD
| WS_CLIPSIBLINGS | WS_VISIBLE | WS_CAPTION | WS_MAXIMIZEBOX |
WS_MINIMIZEBOX ,
m_parameters.rectWindow, pParentView, NULL, 0, &ccc);
ShowWindow(1);
SetWindowPos(&CWnd::wndBottom, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE);
}
where: pParentView is the view in the mainframe and is:
class CChildFrame : public CFrameWnd
It almost works: the frame CChildFrame window is inside the view and
they move. But:
- they seem to be inactive (some messages they do not receive plus the
titles of all of them seem to be inactive... greyed)
- they do not get focus immediately... sometimes needs to click couple
of times them to get the focus and come on top
I guess my create parameters are not correct? Can a Frame window be a
child window anyway?
just like in MDI child frame windowses have boundaries inside the main
frame. How can I do this? I created my own frame windowses like this:
void CChildFrame::CreateAndShow(CView* pParentView)
{
CCreateContext ccc;
ccc.m_pNewViewClass = RUNTIME_CLASS(CChildFrameView);
ccc.m_pCurrentDoc = NULL;
ccc.m_pNewDocTemplate = NULL;
ccc.m_pLastView = NULL;
ccc.m_pCurrentFrame = this;
Create( NULL,m_parameters.title,WS_OVERLAPPEDWINDOW | WS_BORDER |
WS_CHILD
| WS_CLIPSIBLINGS | WS_VISIBLE | WS_CAPTION | WS_MAXIMIZEBOX |
WS_MINIMIZEBOX ,
m_parameters.rectWindow, pParentView, NULL, 0, &ccc);
ShowWindow(1);
SetWindowPos(&CWnd::wndBottom, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE);
}
where: pParentView is the view in the mainframe and is:
class CChildFrame : public CFrameWnd
It almost works: the frame CChildFrame window is inside the view and
they move. But:
- they seem to be inactive (some messages they do not receive plus the
titles of all of them seem to be inactive... greyed)
- they do not get focus immediately... sometimes needs to click couple
of times them to get the focus and come on top
I guess my create parameters are not correct? Can a Frame window be a
child window anyway?