#346 RxMessageBox implement all MessageBox styles

Jon Wolfers

Could RxMessageBox appear at the front?

I'm not quite sure that I exactly understand what is going on here. It appears to me that if you use ole to control excel and then, after excel has issued a messagebox you use the RXMessageBox function, you rxMessageBox dialog appears behind the excel application window.

Rather confusingly - if you issue an RxMessageBox BEFORE excel issues it's message box, then both that message box and subsequent ones will be at the top as expected.

You can see this behaviour by uncommenting the first RxMessageBox in the accompanying script




  • Jon Wolfers

    Jon Wolfers - 2009-03-27

    test script

  • Mark Miesfeld

    Mark Miesfeld - 2009-03-27


    I'll take a look at this, but it is most likely that nothing can be done about it.

    When Windows first came out, any program could put itself to the front at any time. This turns out to be very annoying to the user under many circumstances. By XP, this has been almost reversed. In XP and Vista there are very few cases where a window can force itself to the top. This is most likely one of those cases.

    Mark Miesfeld

  • Mark Miesfeld

    Mark Miesfeld - 2009-04-11

    Change title to reflect the fix.

  • Mark Miesfeld

    Mark Miesfeld - 2009-04-11

    Committed revision 4356.


    RxMessageBox() already set the MessageBox() flag to bring the MessageBox() to the foreground. This failed for the reasons I originally stated, namely there are restrictions in when a window can be brought to the foreground programmatically.

    However, it turns out that there are a number of MessageBox style flags that were not implemented. Both the MB_TOPMOST and the MB_SYSTEMMODAL flags fix your problem. But, the current implementation did not let the user specifiy those flags.

    What I did was enhance RxMessageBxo() so that the user can specify any of the MessageBox() style flags.

    There a couple of new button layouts, those were added to the third 'button' argument. For all the other missing styles, a fifth, optional, arg was added allowing the user to specify the styles.

    This is implemented in trunk, not in the 4.0.0 release. I'm leaving the status here as open for now until all the 4.0.0 'pending' items get cleared out.

  • Mark Miesfeld

    Mark Miesfeld - 2009-09-02

    This is implemented in trunk

  • Mark Miesfeld

    Mark Miesfeld - 2010-09-16

    This request for a feature enhancement has been included in a prior release so the tracker item is being closed.



Cancel  Add attachments

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks