home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dmsgbox.zip / readme.txt < prev   
Text File  |  1996-05-06  |  3KB  |  86 lines

  1. Welcome to DanMessageBox!  Since you have the 
  2. utility and are reading this file, I will assume
  3. you are an OS/2 developer and already know the
  4. purpose of DanMessageBox.  If not, please refer
  5. to my web page at http://cjb.ico.net/~dan
  6. Don't have web access?  Get it.  <g>
  7.  
  8. First a little disclaimer.  I disclaim all responsibility for
  9. anything good, bad, or otherwise that might happen to your
  10. computer before, while, or after using this software. Also,
  11. you are free to use and distribute the dmsgbox.dll included
  12. with this utility, so long as: 1) my name is mentioned somewhere
  13. in the product's credits, 2) you notify me via e-mail before
  14. distributing the product, and 3) you agree that I am not liable
  15. for anything which may occur as a result of your distribution.
  16. Use of this software constitutes agreement to the above 
  17. conditions.
  18.  
  19. Whew!  Glad that is out of the way.
  20.  
  21. By now you have probably checked out the preview
  22. utility (boxtest.exe) and are wondering how to
  23. add this thing to your program.
  24.  
  25. Simple.  First, use the Preview utility to get the 
  26. message box setup just the way you want it.  Then 
  27. include 'dmsgbox.h' in your C or C++ source file.
  28. and make a function call similar to the following:
  29.  
  30. DanMessageBox(hwnd, Title, Message, &settings, flags);
  31. where:
  32.    hwnd is the owner window
  33.    Title is a character string
  34.    Message is a character string
  35.    settings is a structure defined in dmsgbox.h
  36.    flags are values defined in dmsgbox.h OR'ed together
  37.  
  38. (got the hint yet?  refer to dmsgbox.h for syntax
  39. of the settings structure and the flags.)
  40.  
  41. *note:
  42. settings and flags are optional and the equivalent 
  43. option is shown in the preview utility.  (I like to 
  44. keep things simple if possible!). 
  45.  
  46. Now, simply compile the code and link with dmsgbox.lib
  47. If all worked correctly, you should have a new message box!
  48.  
  49. Here is some sample code (only critical portions included):
  50.  
  51. //include the file
  52. #include "dmsgbox.h"
  53.  
  54. case WM_CREATE:
  55. //display a welcome message box for the user. (how sweet)
  56. //it will scroll "Welcome" across the window and the
  57. //text will be red and shadowed.  Background of the
  58. //window and of the text will be white.  There will
  59. //be an initial border, and it will be blue.  Border
  60. //animation will be the graffiti type.  There will
  61. //be a titlebar displaying "My Application".
  62. {
  63.    DMBSETTINGS settings = {0};               // | optional
  64.    strcpy (settings.FontName, "Courier");    // |
  65.    settings.TextColor = CLR_RED;             // |
  66.    settings.BackColor = CLR_WHITE;           // |
  67.    settings.TextBackColor = CLR_WHITE;       // |
  68.    settings.BorderColor = CLR_BLUE;          // |
  69.  
  70.    DanMessageBox(hwnd, "My Application", "Welcome!", 
  71.                  &settings, DMB_SCROLL | DMB_SHADOW | 
  72.                             DMB_USEBORDER |DMB_GRAF | DMB_FRAME);
  73.  
  74.  
  75.    break;
  76. }
  77.  
  78.  
  79. Hopefully that is enough to get you started.  
  80. If you have any questions, comments, etc, you 
  81. should be able to reach me via e-mail at 
  82. dandaman@aloha.com.
  83.  
  84. Enjoy!!
  85. Dan Libby, 1996
  86.