Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Maximize & Minimize window and get focus

Posted on 2003-03-11
4
Medium Priority
?
297 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:david333
2 Comments
 
LVL 12

Expert Comment

by:williamcampbell
ID: 8112891


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








0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 11812482
PAQed - no points refunded (of 35)

modulo
Community Support Moderator
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question