SetForegroundWindow() to a Message-Window prevents a later popped parentless-modal-dialog from showing
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
I have a Message-Window that goes with the System-Tray. Upon a click on the tray-icon a menu is popped. According to MSDN, I should call:
SetForegroundWindow(); TrackPopupMenu(); PostMessage(WM_NULL);
so that the menu doesn't stay there until a selection is made on it. In response to a certain menu-selection I show a dialog. This dialog is Modal and has no parent. When I callSetForegroundWindow()
the dialog will not show, if I don't callSetForegroundWindow()
the dialog will show. My window (the one receiving the message from the tray and performing the abovementioned logic) is a pure message-window (child of HWND_MESSAGE). Can someone explain the situation ?