3

How can I make a modal dialog modal only to its immediate parent?

In other words, if I have 3 windows: main, a modeless one created from main, and a modal created from the modeless one, the modal dialog prevents user interaction with its parent - the modeless one, but how can I enable user interaction with the main window?

Rado
  • 8,634
  • 7
  • 31
  • 44
  • 3
    A modal dialog disables it's owner. If you create your modeless dialog without an owner you have the desired behavior: Popping up a modal dialog disables the modeless dialog; all other windows remain enabled. – IInspectable Jan 09 '15 at 22:52
  • @IInspectable, yes, it disables the parent, but it's not true that all other windows are enabled. The above MFC code was tested with VS2008, VS2010, and VS2013 and in all, the main window is disabled! – Rado Jan 09 '15 at 22:56
  • 5
    You are not creating an **unowned** modeless dialog. Consequently, your main window gets disabled. – IInspectable Jan 09 '15 at 23:14
  • @IInspectable, brilliant! post an answer so I can mark it as accepted. A bit of a cryptic answer but googling unowned window game me the solution! Cheers! – Rado Jan 09 '15 at 23:52

0 Answers0