bring MFC view to front
i''m working on a feature for my editor (in MFC). i have a modeless popup window that displays information about the objects in a "level".
when i double click on an object, the view "highlights" that object. the problem is, i would like to see the view and the selected object. it can be buried under other levels and this popup window itself.
here is a little code:
m_pView->BringWindowToTop( );
m_pView->SetWindowPos( &wndTopMost, 0, 0, 0, 0, SWP_NOSIZE /*/ SWP_NOMOVE*/ / SWP_SHOWWINDOW );
m_pView->ShowWindow( SW_SHOW );
m_pView->UpdateWindow( );
m_pView->RedrawWindow( );
none of this seems to work. i commented out the SWP_NOMOVE in hopes that the window would at least move, but it doesn''t.
the object DOES get selected ok, if i arrange any open windows to where i can see the correct view, the object is drawn "selected" and the view''s offset repositioned to center object in window. but as i said, it could be buried.
thanks so much,
crazy166
some people think i'm crazy, some people know it
You shouldn''t need half of that stuff. Your SetWindowPos''s 2nd parameter should be HWND_TOP, you might be flipping it back to the bottom with that zero which I believe maps to HWND_BOTTOM. Also be sure to use SetActiveWindow. Make sure your window handle is the right handle, btw.
-fel
-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
yeah, i have all that stuff right. i''m using a resizing dialog class from codeguru and i think somehow it''s setting the TOPMOST style. when this window is up, and i activate one of the views, it stays on top (inactive). i was wondering if that had anything to do with it.
i also tried making it a child of the MainFrame, but that didn''t work. the window goes up and is redrawn if i min/max the MainFrame, but it''s not REALLY there. all toolbar buttons and tooltips, etc. appear through it and there''s no way to use it.
anybody know of an MFC only Q&A place? not that i can''t get good help here, but since few use MFC for games, a business app Q&A site may be more suited.
crazy166
some people think i'm crazy, some people know it
i also tried making it a child of the MainFrame, but that didn''t work. the window goes up and is redrawn if i min/max the MainFrame, but it''s not REALLY there. all toolbar buttons and tooltips, etc. appear through it and there''s no way to use it.
anybody know of an MFC only Q&A place? not that i can''t get good help here, but since few use MFC for games, a business app Q&A site may be more suited.
crazy166
some people think i'm crazy, some people know it
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement