Home > Software engineering >  MFC dialog based engineering how to add a dockable floating window? CDockablePane
MFC dialog based engineering how to add a dockable floating window? CDockablePane

Time:10-30

RT, online said dock engineering are based on the document to add floating window,
Based on the dialog box construction zha? Try the along while didn't succeed

CodePudding user response:

First add CFrameWndEx

CodePudding user response:

The reference example
//mdi in dialog
Void CMdiInDlgDlg: : OnButton1 ()
{
//Only one MdiView allowed!
If (m_pMyMdi)
{
If (IsWindow (m_pMyMdi - & gt; M_hWnd))
{
M_pMdiView - & gt; DestroyWindow ();
M_pMyMdi - & gt; DestroyWindow ();
M_pMyMdi=0;
M_pMdiView=0;
}
}
M_pMyMdi=new CMyMdi;
M_pMdiView=new CMdiView;
//use the create!
DWORD dwStyle=WS_CHILD | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;//;
//
CRect rc;
GetClientRect (& amp; Rc);
Rc. Bottom -=50;//keep 'OK' visible
If (m_pMyMdi - & gt; Create (0, 0, dwStyle, rc, this))
{//subcalss the MDIClient Windows with CMdiView for drawing
M_pMyMdi - & gt; ShowWindow (SW_SHOW);
M_pMdiView - & gt; SubclassWindow (m_pMyMdi - & gt; M_hWndMDIClient);
}
}

CodePudding user response:

refer to the second floor schlafenhamster response:
reference example
//mdi in dialog
Void CMdiInDlgDlg: : OnButton1 ()
{
//Only one MdiView allowed!
If (m_pMyMdi)
{
If (IsWindow (m_pMyMdi - & gt; M_hWnd))
{
M_pMdiView - & gt; DestroyWindow ();
M_pMyMdi - & gt; DestroyWindow ();
M_pMyMdi=0;
M_pMdiView=0;
}
}
M_pMyMdi=new CMyMdi;
M_pMdiView=new CMdiView;
//use the create!
DWORD dwStyle=WS_CHILD | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;//;
//
CRect rc;
GetClientRect (& amp; Rc);
Rc. Bottom -=50;//keep 'OK' visible
If (m_pMyMdi - & gt; Create (0, 0, dwStyle, rc, this))
{//subcalss the MDIClient Windows with CMdiView for drawing
M_pMyMdi - & gt; ShowWindow (SW_SHOW);
M_pMdiView - & gt; SubclassWindow (m_pMyMdi - & gt; M_hWndMDIClient);
}
}


I want to ask based on the dialog box procedure, not based on single document or multiple document

CodePudding user response:

CMdiInDlg Dlg is dialog
CDockablePane CFrameWndEx of content

CodePudding user response:

The
reference 4 floor schlafenhamster reply:
CMdiInDlg Dlg is dialog
In a CFrameWndEx CDockablePane


Could you tell me how to add CFrameWndEx project based on the dialog box?
Then the code I don't understand, don't know what to write

CodePudding user response:

You can embed framewnd in dialog, as the child window,
  • Related