locked
Non-modal dialog acting as modal in certain situation RRS feed

  • Question

  • Hi,

    I have a peculiar problem that has to be implemented in my app. I have an SDI app built using VC++2005 MFC. Here I have a non-modal dialog (say, dialog A) that will show another non-modal dialog (say, dialog B) in certain situation. I want that as long as dialog B is visible, user wont be able to set focus on the dialog A, but will be able to access SDI main window's menu or toolbar buttons.

     

    Is it possible to implement a feature like this?

    Saturday, May 12, 2007 12:17 PM

Answers

  • Hi efarook.

    I think there are many ways.

     

    - During Dialog B is activated, Hide Dialog A.

    - On condition that Dialog B is activated, when Dialog A is on focused, kill Dialog A's focus or return focus to Dialog B.

    - When Dialog A is activated or focused, set Dialog B's z-order position to HWND_TOP(using SetWindowPos function).

    ...etc...

     

    Good luck~

    Saturday, May 12, 2007 2:00 PM