views:

15

answers:

2

MessageBox.Show (.NET framework) or MessageBox (e.g. VBA) opens a modal message box from the window of the current application.

My questions are:

  1. If I do not specify the caption (i.e. what appears in the top-left hand corner) of the message box in the arguments, does the default vary according to the application being run?

  2. For example, if a message box pops up in Internet Explorer, would the default caption always say "Microsoft Internet Explorer"? Is this also true for other Microsoft applications such as Excel, Word, etc.?

  3. Where does the default caption come from? Where does the system get the name "Microsoft Internet Explorer" from? Does the name come from the caption of the application window, or does it come from the register in task manager? I cannot find any documentation in the Microsoft website.

+1  A: 

If you don't specify a caption nothing appears. There is no default.

By default, the message box displays an OK button. The message box does not contain a caption in the title.

Source

If an application is showing a title then it must be calling the overload that requires the caption as well as the message.

ChrisF
A: 

Thank you. I have just done a simple experiment using VBA on Excel. A statement like the following was added to the macro:

MsgBox("Test")

As you can see, the title was not specified (it is the 3rd variable). The title came up as "Microsoft Excel".

So the conclusion seems to be that there is a default, and it is the name of the application which invokes the message box.

Andy