MessageBox Visual Studio Add-In | CodeGuru

MessageBox Visual Studio Add-In

Environment: Visual Studio 6 How many times have you had to go through the same gyrations to create a message box? Is it the first argument or the second that’s the title as opposed to the text. What are the exact constants again for an OK button and a Cancel button? What are the valid […]

Written By
CodeGuru Staff
CodeGuru Staff
Sep 20, 2000
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Environment: Visual Studio 6

How many times have you had to go through the same gyrations to create a message box? Is it the first argument or the
second that’s the title as opposed to the text. What are the exact constants again for an OK button and a Cancel button?
What are the valid return values? Well no more! This very useful add-in saves you from having to remember that from
now on!

Using this add-in, you can visually set any of the following:

  • Icon type
  • Buttons
  • Caption (notice the built-in values provided for you!)
  • Text message
  • Modality
  • Default button
  • You can even specify the conditional expression!

When you’re finished selecting your settings, simply click the “Copy to Clipboard and Close” button. You’ll be
returned to your previous source window. Just paste the code from the clipboard and you’re done!

Example

Using the settings shown in the figure above, the add-in produced the following!

if(MessageBox(_T("This is an Error Message !!!\nReturn ?"),
              _T("Error"),
               MB_ICONHAND|MB_YESNO|MB_DEFBUTTON1)
               == IDNO)
{
}

Installing the Add-In

To install the add-in, follow these steps:

  1. Download the DLL (remember to unzip the file) or download the source and build the DLL
  2. Copy the DLL to the Visual Studio AddIn folder (the default location is the
  3. c:\program files\microsoft visual studio\Common\MSDev98\AddIns’ folder).

  4. Click the Tools->Customize menu option
  5. Click the Add-ins and Macro Files tab
  6. Check the “MsgBox Developer Studio Add-In” add-in
  7. Now you can assign it to a key or place it on a toolbar as you like

Downloads

Download MsgBox Add-In – 17 Kb

Download source – 47 Kb

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.