I have a dialog-based app that can launch a modeless dialog and several other modal dialogs (although only one of the modal dialogs at a time). If another application is brought up, the modal dialog boxes are automatically moved to the background. However, the modeless dialog stays on top of any other applications. I'm looking for a way to detect when my app is not active so that I can hide the modeless dialog.
Using Spy++ I can see the messages WM_ACTIVATE and WM_ACTIVATEAPP being passed around, but they cannot be handled through ClassWizard (not presented as an option), and I tried trapping the message using the PreTranslateMessage function in the main dialog, but neither of these messages appear to be sent through the architecture to this dialog class.
Any suggestions for how to do this?
Using Spy++ I can see the messages WM_ACTIVATE and WM_ACTIVATEAPP being passed around, but they cannot be handled through ClassWizard (not presented as an option), and I tried trapping the message using the PreTranslateMessage function in the main dialog, but neither of these messages appear to be sent through the architecture to this dialog class.
Any suggestions for how to do this?