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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this