Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Balloon Help as a non-modal replacement for MessageBox()

, 7 Aug 2002
Although sometimes useful, message boxes used to display information are often just annoying. This article describes a non-modal replacement.
balloonhelpr2_demo.zip
BalloonTest.exe
res
BalloonTest.ico
BalloonTest.manifest
BalloonTest.dsw
BalloonTest.dsp
balloonhelpr2_src.zip
balloonhelpr3_demo.zip
BalloonTest.ico
BalloonTest.manifest
BalloonTest.dsw
BalloonTest.dsp
BalloonTest.exe
balloonhelpr3_src.zip
balloonhelp_demo.zip
BalloonTest.exe
BalloonTest.ico
BalloonTest.manifest
BalloonTest.dsw
BalloonTest.dsp
balloonhelp_src.zip
bh-atl.zip
BalloonTest.dsp
BalloonTest.dsw
BalloonTestps.mk
BalloonTestps.def
BalloonTest.rgs
BalloonTest.ico
BalloonTest.manifest
BalloonTest.suo
wtl_balloonhelp_demo.zip
BalloonTest
BalloonTest.dsp
Release
BalloonTest.exe
res
BalloonTest.exe.manifest
BalloonTest.ico
bob.bmp
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE 
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE 
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END

3 TEXTINCLUDE 
BEGIN
    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
    "#define _AFX_NO_OLE_RESOURCES\r\n"
    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
    "\r\n"
    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
    "LANGUAGE 9, 1\r\n"
    "#pragma code_page(1252)\r\n"
    "#include ""res\\BalloonTest.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
    "#include ""afxres.rc""         // Standard components\r\n"
    "#endif\r\n"
    "\r\n"
    "1 TYPELIB ""BalloonTest.tlb""\0"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME           ICON                    "res\\BalloonTest.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_BALLOONTEST_DIALOG DIALOGEX 0, 0, 328, 134
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | 
    WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP | WS_EX_APPWINDOW
CAPTION "Balloon Test"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
    LTEXT           "Use the context help button on the caption (above) to view help on any control...",
                    IDC_STATIC,7,7,314,13
    LTEXT           "   Below, enter two numbers.  The first number will be divided by the second, and the result shown.  To make things interesting, try making the second number zero!",
                    IDC_STATIC,7,33,314,20
    EDITTEXT        IDC_EDIT1,25,65,40,14,ES_AUTOHSCROLL | ES_NUMBER
    CTEXT           "/",IDC_STATIC,73,65,19,14,SS_CENTERIMAGE
    EDITTEXT        IDC_EDIT2,100,65,40,14,ES_AUTOHSCROLL | ES_NUMBER
    CTEXT           "=",IDC_STATIC,148,65,19,14,SS_CENTERIMAGE
    CTEXT           "...",IDC_LBL_RESULT,175,65,41,14,SS_NOTIFY | 
                    SS_CENTERIMAGE,WS_EX_STATICEDGE
    PUSHBUTTON      "&Calculate",IDC_BTN_CALCULATE,224,65,50,14
    CTEXT           "Press left button here...",IDC_LBL_LCLICK,7,100,83,11,
                    SS_NOTIFY | SS_CENTERIMAGE,WS_EX_STATICEDGE
    CTEXT           "Press right button here...",IDC_LBL_RCLICK,97,100,89,11,
                    SS_NOTIFY | SS_CENTERIMAGE,WS_EX_STATICEDGE
    DEFPUSHBUTTON   "E&xit",IDOK,271,111,50,16
    CTEXT           "Double-Click here...",IDC_LBL_CLICK,193,100,68,11,
                    SS_NOTIFY | SS_CENTERIMAGE,WS_EX_STATICEDGE
END


/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,0,1
 PRODUCTVERSION 1,0,0,1
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904e4"
        BEGIN
            VALUE "CompanyName", "TODO: <Company name>"
            VALUE "FileDescription", "TODO: <File description>"
            VALUE "FileVersion", "1.0.0.1"
            VALUE "InternalName", "BalloonTest.exe"
            VALUE "LegalCopyright", "TODO: (c) <Company name>.  All rights reserved."
            VALUE "OriginalFilename", "BalloonTest.exe"
            VALUE "ProductName", "TODO: <Product name>"
            VALUE "ProductVersion", "1.0.0.1"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1252
    END
END


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO 
BEGIN
    IDD_BALLOONTEST_DIALOG, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 321
        TOPMARGIN, 7
        BOTTOMMARGIN, 127
    END
END
#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// RT_MANIFEST
//

IDR_MANIFEST            RT_MANIFEST             "res\\BalloonTest.manifest"
#endif    // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////
// English (Australia) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENA)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS
#pragma code_page(1252)
#endif //_WIN32

/////////////////////////////////////////////////////////////////////////////
//
// REGISTRY
//

IDR_BALLOONTEST         REGISTRY                "BalloonTest.rgs"
#endif    // English (Australia) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 9, 1
#pragma code_page(1252)
#include "res\BalloonTest.rc2"  // non-Microsoft Visual C++ edited resources
#include "afxres.rc"         // Standard components
#endif

1 TYPELIB "BalloonTest.tlb"
/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Shog9
Software Developer
United States United States
Poke...

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 8 Aug 2002
Article Copyright 2001 by Shog9
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid