Message Box question

Started by Gary Stout, February 09, 2015, 08:23:23 PM

Previous topic - Next topic

Gary Stout

Is it possible to change the caption of a Messagebox with code while the messagebox is open? I could create a small form in place of the messagebox, but I thought it might be cleaner if I could just change the messagebox caption after a process has completed. I would also like to disable the messagebox OK button until the process finishes, if possible.
As far as the caption...I would have something like "Stand-by..." and have the OK button disabled then when the process finishes, change the caption to "Process Complete" and enable the OK button.
If need be, I can do the same thing with a small form and just have the form close when the process finishes.

Thanks,
Gary

Klaas Holland

Perhaps

First MessageBox

MsgBox " In Progress !!! ", %MB_OKCANCEL Or %MB_ICONEXCLAMATION Or %MB_DEFBUTTON2, " STAND BY  "

Second MessageBox

MsgBox " You can read all about it in the API Help under MessageBox !!! ", %MB_OKCANCEL Or %MB_ICONEXCLAMATION Or %MB_DEFBUTTON1, " PROCESS COMPLETE  "

Klaas

David Kenny

I think it would be easier to create a small form, as you suggested, and easily do the things you want the form to do.  The msgbox wasn't written to do those things and I think it's likely you would put more effort into trying to force it.  I'm not convinced you would be successful if you put in that extra effort. 

Michael Mattias posted some source code for a msgbox replacement back in 2002.  Sadly it's not written in the SDK style and would likely have to be extensively rewritten and/or modified to work in FF.  Running it as-is might provide some ideas, in addition to the ones you have, about making a better msgbox.



Gary Stout

Klaas and David,

Thanks for the replies! I appreciate your suggestions. I think I will go with a small form and have more control over how things work. That is the way I had done it in the program I am converting and it worked fine. I have never tried manipulating a mesage box and it sounds like it may be more trouble than the benefits. I just thought if I could change the caption and disable the OK button, there would be less code and a little cleaner.

Thanks again,
Gary