Modal Dlg opens in background... which it shoudl't.

Discussion in 'MFC' started by TobiDoo, Jun 28, 2011.

  1. TobiDoo

    TobiDoo New Member

    Joined:
    Jun 22, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Greetings to the forum!

    Recently I got into programming with mfc. For a while now I have been working on a dialog-based application.

    Now, whenever I want to open another modal dialog-box, (at the moment there are 2, with wnd.DoModal() ) it opens, but behind the main window. Then, when I press alt-key, it comes to the forground... However, when I draw something in the DC of the initial dialog, the other windows open correctly. Now I have implemented a bitmap to be displayed, and its still the same as before - the other dialog-boxes still wont open in the forground.

    Why does this happen and how can I correct it?

    I hope, you get a picture of whats going on and you have any ideas. I will certainly post any code you need to see, but alltogether its just too much to post, and I dont know which parts are the important ones for this problem.
    I have compared all (which I think) is relevant to a new application, and its so far all identical.

    Thanks a lot in advance for your help,
    so long,
    tobi
     
  2. rsquareshelke

    rsquareshelke New Member

    Joined:
    Dec 30, 2010
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    0
    use SetforegroundWindow or BringToDesktop
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice