How to add features to standard message boxes in ATL and WTL

MessageBox function is easy to use but it sometimes lacks features. They can be added through a hook, however. This sample demonstrates three features for message boxes:

  1. AtlMessageBoxEx shows message box centered by parent window
  2. AtlTimedMessageBoxEx shows message box with countdown timer to close
  3. AtlOptionalMessageBoxEx shows message box with checkbox to suppress the box in future (the setting is stored into registry)





Visual C++.NET 2003 source code can be downloaded here, compiled binary – here.

Leave a Reply