Show MessageBox in front of active Window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Prats

    Show MessageBox in front of active Window

    MessageBox::Sho w(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.

  • Pavel A.

    #2
    Re: Show MessageBox in front of active Window

    Prats wrote:
    MessageBox::Sho w(Window, String)
    How do I pass the value for the Window parameter, rather how do I get
    the value for the active window
    GetLastActivePo pup() ?
    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.
    >

    Comment

    • Ben Voigt [C++ MVP]

      #3
      Re: Show MessageBox in front of active Window

      Prats wrote:
      MessageBox::Sho w(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.
      >
      >
      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.

      Comment

      Working...