Show MessageBox in front of active Window

  • Thread starter Thread starter Prats
  • Start date Start date
P

Prats

MessageBox::Show(Window, String)
How do I pass the value for the Window parameter, rather how do I get the
value for the active window


Also,there are two forms open at the same time, one overlapping the other.
Now if I click the form at behind how do I bring to to front. I tried giving
BringToFront() didn't work.
 
Prats said:
MessageBox::Show(Window, String)
How do I pass the value for the Window parameter, rather how do I get
the value for the active window

GetLastActivePopup() ?
 
Prats said:
MessageBox::Show(Window, String)
How do I pass the value for the Window parameter, rather how do I get
the value for the active window

You don't use the active window, you use the window from which the user
requested the modal task that generated the message. If the message box is
created from an asynchronous task on a worker thread you create it unowned
(standalone). Never create children of arbitrary windows, it might be an
ephemeral window (i.e. printing... page X/N) which automatically dismisses
itself when the task completes and your message box goes away with it
without giving the user any chance to read it.
 
Back
Top