For any developer building on Windows, you know there are two ways to build a dialog – roll your own using a dialog template or use MessageBox().
Ugh.
We’re just begging developers to go the easy route and use MessageBox to cram a paragraph of text into an error dialog!
Don’t get me wrong, MessageBox is great for very simple dialogs, but for the most part it’s pretty limited. One of the issues I have with it is that it only gives you a limited set of responses to use for buttons. This can be a problem when you have poorly written text and end up having an ambiguous dialog such as this one:

Sad right? We’ve all gotten our laugh out of poorly written dialogs, but we can do better than that!
I’d like to introduce you to a feature I was very excited to work on in Vista, Task Dialog. Task Dialog is essentially a MessageBox replacement that gives developers more flexibility when creating dialogs. One of the great features of Task Dialog is that it does all the styling & formatting for you! Just add your strings to the task dialog and we take care of how it looks!
To give you a quick overview, Task Dialog is composed of multiple “areas” that you can switch on and off using the APIs, such as:
- Main Instruction Area
- Content Area
- Progress Area
- Radio Button Area
- Command Link Area
- Command Area
- Footer Area
- Expanded Information Area
There are two APIs you can use – TaskDialog() which is essentially a simple API you can use in place of MessageBox(), and TaskDialogIndirect() which gives you more flexibility to customize your dialog.
Using Task Dialog, you can take that wimpy dialog I showed you earlier and make it more readable:

Task Dialog is part of ComCtl32 v6 on Windows Vista, so you cannot use it down-level. If you’re keeping your dialogs simple and you’re writing an application on both Vista & down-level, you can use ShellMessageBox(), which is just a wrapper for Task Dialog on Vista, and MessageBox down-level.
For those of you that want to author some new Task Dialogs but want to save on development time, check out a new tool I posted in the downloads section called “TDPad.” It’s essentially an XML based editor that will generate Win32 based source code you can use in your application. Check it out!
Jeff Miller has a post coming where he will show you how to build your first Task Dialog. Until then, check out these other links:
Vinny Pasceri
Aero Program Manager