Link to home
Start Free TrialLog in
Avatar of david333
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("Hierarchy Window"),this,162,TRUE,0,WS_VISIBLE|WS_CAPTION |WS_BORDER|WS_MINIMIZEBOX | WS_MAXIMIZEBOX |CBRS_ALIGN_LEFT|CBRS_GRIPPER))
     {
        TRACE0("Failed to create instant bar\n");
         return -1;          // fail to create
     }
     m_wndInstantBar.SetSCBStyle(m_wndInstantBar.GetSCBStyle() |
          SCBS_SIZECHILD);
     m_HierWin.Create(/*WS_BORDER |*/ TVS_HASBUTTONS | TVS_LINESATROOT | TVS_HASLINES | TVS_SHOWSELALWAYS,
      CRect(HIERWIN_START_X, HIERWIN_START_Y,HIERWIN_WIDTH,rect.bottom - HIERWIN_BOTTOM), &m_wndInstantBar, 1001);
      m_HierWin.ModifyStyleEx(0, WS_EX_CLIENTEDGE);
     
     // bring the tooltips to front

     m_HierWin.ShowWindow(TRUE);
     m_wndInstantBar.SetBarStyle(m_wndInstantBar.GetBarStyle() |
          CBRS_TOOLTIPS | CBRS_FLYBY |CBRS_ALIGN_LEFT| CBRS_SIZE_DYNAMIC);
     m_wndInstantBar.EnableDocking(CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT);
          EnableDocking(CBRS_ALIGN_ANY);
     #ifdef _SCB_REPLACE_MINIFRAME
          m_pFloatingFrameClass = RUNTIME_CLASS(CSCBMiniDockFrameWnd);
     #endif //_SCB_REPLACE_MINIFRAME
     DockControlBar(&m_wndInstantBar, 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.
Avatar of williamcampbell
williamcampbell
Flag of United States of America image



 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->UpdateWindow ();








ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial