Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

crazy166

bring MFC view to front

This topic is 6765 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!