home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
dmsgbox.zip
/
readme.txt
< prev
Wrap
Text File
|
1996-05-06
|
3KB
|
86 lines
Welcome to DanMessageBox! Since you have the
utility and are reading this file, I will assume
you are an OS/2 developer and already know the
purpose of DanMessageBox. If not, please refer
to my web page at http://cjb.ico.net/~dan
Don't have web access? Get it. <g>
First a little disclaimer. I disclaim all responsibility for
anything good, bad, or otherwise that might happen to your
computer before, while, or after using this software. Also,
you are free to use and distribute the dmsgbox.dll included
with this utility, so long as: 1) my name is mentioned somewhere
in the product's credits, 2) you notify me via e-mail before
distributing the product, and 3) you agree that I am not liable
for anything which may occur as a result of your distribution.
Use of this software constitutes agreement to the above
conditions.
Whew! Glad that is out of the way.
By now you have probably checked out the preview
utility (boxtest.exe) and are wondering how to
add this thing to your program.
Simple. First, use the Preview utility to get the
message box setup just the way you want it. Then
include 'dmsgbox.h' in your C or C++ source file.
and make a function call similar to the following:
DanMessageBox(hwnd, Title, Message, &settings, flags);
where:
hwnd is the owner window
Title is a character string
Message is a character string
settings is a structure defined in dmsgbox.h
flags are values defined in dmsgbox.h OR'ed together
(got the hint yet? refer to dmsgbox.h for syntax
of the settings structure and the flags.)
*note:
settings and flags are optional and the equivalent
option is shown in the preview utility. (I like to
keep things simple if possible!).
Now, simply compile the code and link with dmsgbox.lib
If all worked correctly, you should have a new message box!
Here is some sample code (only critical portions included):
//include the file
#include "dmsgbox.h"
case WM_CREATE:
//display a welcome message box for the user. (how sweet)
//it will scroll "Welcome" across the window and the
//text will be red and shadowed. Background of the
//window and of the text will be white. There will
//be an initial border, and it will be blue. Border
//animation will be the graffiti type. There will
//be a titlebar displaying "My Application".
{
DMBSETTINGS settings = {0}; // | optional
strcpy (settings.FontName, "Courier"); // |
settings.TextColor = CLR_RED; // |
settings.BackColor = CLR_WHITE; // |
settings.TextBackColor = CLR_WHITE; // |
settings.BorderColor = CLR_BLUE; // |
DanMessageBox(hwnd, "My Application", "Welcome!",
&settings, DMB_SCROLL | DMB_SHADOW |
DMB_USEBORDER |DMB_GRAF | DMB_FRAME);
break;
}
Hopefully that is enough to get you started.
If you have any questions, comments, etc, you
should be able to reach me via e-mail at
dandaman@aloha.com.
Enjoy!!
Dan Libby, 1996