0

I have an application, which has a search button and a spreadsheet where the searched item is placed. Now the search button causes a "Search" dialog box to pop up which is modeless, hence meaning that one can still work on the spreadsheet. If one right clicks on the item already placed on the spreadsheet, with the "Search" dialog still open by the side, another dialog "B" pops up which is modal and causes the application to freeze until we kill the dialog "B" somehow. But the "Search" dialog is however operable and is not desired. Can anyone please suggest any way using which i can make the "Search" dialog also inactive as the rest of the application when dialog "B" launches?

  • Perhaps just `ShowWindow(hModelessWnd, SW_HIDE)` before you display the modal dialog, then `SW_SHOW` afterwards. – Roger Rowland Dec 02 '13 at 14:43
  • 1
    Are you sure that both dialogs are created with the main window as parent window. Make sure that each constrcutor gets AfxGetMainWnd as a pointer. – xMRi Dec 02 '13 at 15:03
  • Thanks for a quick reply. I tried ShowWindow method but with no luck. And as for the xMRi approach, I forgot to add that the dialog "B" is out of my scope to modify. However, I was thinking if i can detect when "Search" dialog's parent is deactivated, I can disable "Search" dialog as well. Is that possible? I might be asking a total dummy question here, Sorry. –  Dec 04 '13 at 12:57
  • Issue was solved by setting the WS_DISABLE flag in the property of that window. Thanks for the discussion. –  Jan 18 '14 at 19:28

0 Answers0