Sign in to follow this  
makaveli23

How to display MessageBox after the effect is done?

Recommended Posts

I think it may currently not be possible, even under VS, when using IndirectUI. A much-desired feature (at least by BoltBait and me) is to be able to tell when the effect is finished, and processing the final render pass. This seems quite similar. Also, if something interferes with the normal effect close-down process by putting up a message box, I think PDN might show one of those progress-bar windows that makes it look like the effect has hung. I looked at the various overridable Effect methods, and didn't see anything that seems useful. I could easily be wrong, though, since the whole subject is rather arcane.

 

Though perhaps somewhat inelegant, you could add a button to the UI that when pressed displays the info in a MessageBox.

Share this post


Link to post
Share on other sites

The really dirty way might be to set a condition like this in the main loop....

 

if (x=width && y=height) then MessageBox.Show("A message")

 

I use this sort of thing in development all the time. It's a filthy habit I've picked up....

Share this post


Link to post
Share on other sites

If anyone asks -- especially anyone named Rick -- you didn't hear it from me:

        protected override void OnDispose(bool disposing)
        {
            if (showMessage && !IsCancelRequested)
            {
                Thread t = new Thread(() => MessageBox.Show("Modeless Message Box!"));
                t.Start();
            }
            showMessage = false;
            base.OnDispose(disposing);
        }

        bool showMessage = false;
        protected override void OnSetRenderInfo(PropertyBasedEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs winArgs)
        {
            showMessage = true;
                .
                .
                .

Despite a rigorous ten minutes of testing (okay, some of that time was writing it), I'm sure there are a million problems with it, not the least of which being it wouldn't be allowed.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this