home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_12 / 2n12038a < prev    next >
Text File  |  1991-08-20  |  2KB  |  58 lines

  1. /**********************************************************
  2.            File Name: NBX_DEMO.C
  3.        Expanded Name: Notify Box Demo
  4.          Description: Demo program for NotifyBox function.
  5.                       This program demonstrates the windows
  6.                       MessageBox function and a similar
  7.                       NotifyBox function.  Both are
  8.                       demonstrated with a very simple
  9.                       program that does not even register a
  10.                       main window!
  11.         Program List: NBX_TEST.C NTFY_BOX.C
  12. Global Function List: WinMain
  13. Static Function List: 
  14.     Local Macro List: 
  15.          Global Data: 
  16.          Static Data: 
  17.          Portability: MS Windows, Any memory model,
  18.                       Any windows compatable C Compiler
  19. **********************************************************/
  20.  
  21. /* MS Windows */
  22. #include <windows.h>
  23.  
  24. /* Types and prototypes */
  25. #include <ntfy_box.h>
  26.  
  27. int PASCAL WinMain( HANDLE hInstance, HANDLE hPrevInstance,
  28.         LPSTR lpszCmdLine, int nCmdShow )
  29.     {
  30.  
  31.     LONG i;
  32.  
  33.     /* Prompt user to start */
  34.     MessageBox( NULL, "Demonstration of NotifyBox "
  35.             "function.\nHit Enter to begin a long "
  36.             "process", "MessageBox", MB_OK );
  37.  
  38.     /* Create Notify Box */
  39.     NotifyBox( NULL, "Doing a long process - looping "
  40.             "10,000,000 (ten million) times!\n\n"
  41.             "Please Wait...", "NotifyBox",
  42.             hInstance );
  43.  
  44.     /* Do a long process */
  45.     for ( i = 0; i < 10000000; i++ );
  46.  
  47.     /* Destroy Notify Box */
  48.     NotifyBox( NULL, NULL, NULL, NULL );
  49.  
  50.     /* Prompt user to exit program */
  51.     MessageBox( NULL, "Long process is over - NotifyBox "
  52.             "has been destroyed.\nHit Enter to exit",
  53.             "MessageBox", MB_OK );
  54.  
  55.     return ( 0 );
  56.  
  57.     }   /* WinMain */
  58.