
CMessageBoxX v1.05 An
MFC class to encapsulate the MessageBox API
- Subclasses the message box window to allow additional customisation.
- Sub classed using a standard CWnd derived class, so you can use standard
MFC message maps in the class itself and any classes you derive from it.
- Implements standard support for automatic addition of icons just like in
MFC.
- Allows custom icons to be easily added to the message box.
- Implements timed out message box support with specific timeout button. The
timeout can also be reset based on mouse or keyboard activity.
- Implements disabled button support. Helpful where you want to implement
Nag screens when you want to remind an end user to register your product.
- Implements support for including checkboxes on the message box. For
example you can implement "Don't remind me again" type message boxes.
- Includes support for right aligned buttons instead of the default for
the MessageBox API which is to have the buttons cantered.
- Integrates with MFC support for message box help context.
- Fully Unicode compliant.
- Optionally supports HTML in your message box via the QHTM HTML control
provided at
http://www.gipsysoft.com/qhtm/.
- Supports selectable text in your message boxes.
- Includes support for user defined animated text and captions
The
enclosed
zip file contains the
CMessageBoxX source code and a simple test program to exercise the class
provided.
Copyright
- You are allowed to include the source code in
any product (commercial, shareware, freeware or otherwise) when your product
is released in binary form.
- You are allowed to modify the source code in
any way you want except you cannot modify the copyright details at the top
of each module.
- If you want to distribute source code with
your application, then you are only allowed to distribute versions released
by the author. This is to maintain a single distribution point for the
source code.
Updates
V1.0 (19 April 2003)
V1.01 (24 April 2006)
- Updated copyright details.
- Updated documentation to use the same style as the web site.
- UpdateCaptionDueToTimer method has been renamed to UpdateUIDueToTimer
- Now includes support for including a check box on the MessageBox. To
achieve this simply call SetCheckBox with the text to show on the check box
and its initial checked state prior to calling DoModal to show the message
box. Then when DoModal returns simple call GetCheckBoxState to determine
whether the check box was ticked or not.
- Now includes support for right aligning buttons instead of the default
for the MessageBox API which is to have the buttons centered. The support
for checkboxes and right aligned buttons is inspired by the GSMessageBox
article at
http://www.gipsysoft.com/messagebox/.
- Both SetTimeout and SetDisabledButton methods now include a
"bModifyCaptionDuringCountdown" which determines if they should cause the
MessageBox caption to be modified during their timer countdowns
- Updated the sample app to allow most of the functionality of the code to
be optionally tested.
- SetTimeout method now includes a bResetTimeoutOnUserActivity parameter.
- Addition of GetCurrentTimerCaption() and GetCurrentDisabledCaption()
virtual methods which allow the timeout and disabled captions to be easily
customized at runtime.
- Fixed a number of compiler warnings when the code is compiled using
/Wp64
V1.02 (3 July 2006)
- Code now uses newer C++ style casts instead of C style casts.
- Class now allows you to put HTML text into the message box. This is
provided by the QHTM HTML control provided at
http://www.gipsysoft.com/qhtm/.
You may need to purchase a license (depending on the type of application you
are developing) as well as follow their instructions on deploying
it if you want this functionality with CMessageBoxX. This functionality by
default is not included in CMessageBoxX and is only available when you
define the preprocessor macro "CMESSAGEBOXX_HTML_SUPPORT".
- Implemented support for selectable text. This means that end-users can
select the text in the message box and paste it into the clipboard. Very
helpful if you want end-users to record the details of error messages etc in
your apps.
- Button captions can now be modified via SetModifiedButtonCaption.
- Added user defined animated text support.
- Added user defined animated caption support.
- Updated code to clean compile on VC 2005.
V1.03 (5 November 2006)
- Minor update to stdafx.h of sample app to avoid compiler warnings in VC
2005.
- Code now uses QHTM const for the class name
V1.04 (11 August 2007)
- Updated copyright details.
- Check box text control is now clipped to the width of the main text
control if its calculated width will exceed the message box client area.
This was done following a report from Kyle Alons that this text can get
clipped on Vista when you pick a longish piece of text as the check box
text. You should ensure you pick a shortish piece of text to avoid this
problem as well as test all your message boxes on all the operating systems
you will be supporting your application on.
- Addition of a CMESSAGEBOXX_EXT_CLASS to allow the code to be more easily
added to an extension dll.
V1.05 (11 July 2008)
- Updated copyright details.
- Updated sample app to clean compile on VC 2008
- Removed VC 6 style classwizard comments from the code.
- The code has now been updated to support VC 2005 or later only.
- Code now compiles cleanly using Code Analysis (/analyze)
- Code now uses newer C++ style casts instead of C style casts.
- Updated sample app to demonstrate support for user icons
- Class now correctly handles the manifest contexts which the MessageBox
API's can have when you are using Common Control v6 or later