david333
asked on
Maximize & Minimize window and get focus
Hi,
I need to make a Maximize & minimize option for my hierarchy window inside instant bar
the code now is:
if (!m_wndInstantBar.Create(_ T("Hierarc hy Window"),this,162,TRUE,0,W S_VISIBLE| WS_CAPTION |WS_BORDER|WS_MINIMIZEBOX | WS_MAXIMIZEBOX |CBRS_ALIGN_LEFT|CBRS_GRIP PER))
{
TRACE0("Failed to create instant bar\n");
return -1; // fail to create
}
m_wndInstantBar.SetSCBStyl e(m_wndIns tantBar.Ge tSCBStyle( ) |
SCBS_SIZECHILD);
m_HierWin.Create(/*WS_BORD ER |*/ TVS_HASBUTTONS | TVS_LINESATROOT | TVS_HASLINES | TVS_SHOWSELALWAYS,
CRect(HIERWIN_START_X, HIERWIN_START_Y,HIERWIN_WI DTH,rect.b ottom - HIERWIN_BOTTOM), &m_wndInstantBar, 1001);
m_HierWin.ModifyStyleEx(0, WS_EX_CLIENTEDGE);
// bring the tooltips to front
m_HierWin.ShowWindow(TRUE) ;
m_wndInstantBar.SetBarStyl e(m_wndIns tantBar.Ge tBarStyle( ) |
CBRS_TOOLTIPS | CBRS_FLYBY |CBRS_ALIGN_LEFT| CBRS_SIZE_DYNAMIC);
m_wndInstantBar.EnableDock ing(CBRS_A LIGN_LEFT| CBRS_ALIGN _RIGHT);
EnableDocking(CBRS_ALIGN_A NY);
#ifdef _SCB_REPLACE_MINIFRAME
m_pFloatingFrameClass = RUNTIME_CLASS(CSCBMiniDock FrameWnd);
#endif //_SCB_REPLACE_MINIFRAME
DockControlBar(&m_wndInsta ntBar, AFX_IDW_DOCKBAR_LEFT);
I tried to use WS_MAXIMIZE & WS_MINIMIZE but it didn't work.
I also have a problem,at the beggining the hierarchy window was in mainframe and when i pushed the
sels in that windows an action was made in the opengl window at the right side.
but now because it is now been craeted as a child of m_wndInstantBar,after pressing the sels
i need to press the left button of the mouse on the opengl window so the action will be activate
and it doesn't goes immediatlly.
Thanks.
I need to make a Maximize & minimize option for my hierarchy window inside instant bar
the code now is:
if (!m_wndInstantBar.Create(_
{
TRACE0("Failed to create instant bar\n");
return -1; // fail to create
}
m_wndInstantBar.SetSCBStyl
SCBS_SIZECHILD);
m_HierWin.Create(/*WS_BORD
CRect(HIERWIN_START_X, HIERWIN_START_Y,HIERWIN_WI
m_HierWin.ModifyStyleEx(0,
// bring the tooltips to front
m_HierWin.ShowWindow(TRUE)
m_wndInstantBar.SetBarStyl
CBRS_TOOLTIPS | CBRS_FLYBY |CBRS_ALIGN_LEFT| CBRS_SIZE_DYNAMIC);
m_wndInstantBar.EnableDock
EnableDocking(CBRS_ALIGN_A
#ifdef _SCB_REPLACE_MINIFRAME
m_pFloatingFrameClass = RUNTIME_CLASS(CSCBMiniDock
#endif //_SCB_REPLACE_MINIFRAME
DockControlBar(&m_wndInsta
I tried to use WS_MAXIMIZE & WS_MINIMIZE but it didn't work.
I also have a problem,at the beggining the hierarchy window was in mainframe and when i pushed the
sels in that windows an action was made in the opengl window at the right side.
but now because it is now been craeted as a child of m_wndInstantBar,after pressing the sels
i need to press the left button of the mouse on the opengl window so the action will be activate
and it doesn't goes immediatlly.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You may need to rethink the Min Max options and go with a Show / Hide option instead.
Include a Menu item / toolbar item to Show Hide your hierarchy window.
When you hide the window destroy the splitter and maximize your opengl window. When you show create the splitter again.
After you press the 'sels' try
pOpenGlWindow->SetFocus ();
pOpenGlWindow->UpdateWindo