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:
- AtlMessageBoxEx shows message box centered by parent window
- AtlTimedMessageBoxEx shows message box with countdown timer to close
- AtlOptionalMessageBoxEx shows message box with checkbox to suppress the box in future (the setting is stored into registry)
AtlTimedMessageBoxEx:
AtlOptionalMessageBoxEx:
Visual C++.NET 2003 source code can be downloaded here, compiled binary – here.
UPDATE 2021-Feb-13: The code is re-published as a github repository: roman380/AdvancedMessageBoxes01: How to add features to standard message boxes in ATL and WTL (github.com)