home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a120 / 1.ddi / API / HELLO.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-23  |  3.0 KB  |  81 lines

  1. /*------------------------------------------------------------------*/
  2. /* HELLO.C                                                          */
  3. /*------------------------------------------------------------------*/
  4. /* API ▒`  ªí : hello()                                             */
  5. /* API ¿τ╝╞└] : hello.plb                                           */
  6. /* ⌐IÑsñΦªí   : SET LIBRARY TO HELLO                                */
  7. /*              =HELLO()                                            */
  8. /*------------------------------------------------------------------*/
  9. #include <stdio.h>
  10. #include <pro_ext.h>
  11.  
  12. void FAR hello( ParamBlk FAR *parm )
  13.   {
  14.     WHANDLE wh;
  15.     Point pt;
  16.     char FAR *hello , *space;
  17.     int keystroke , i;
  18.     int  width , height;     /* ªs⌐±╡°╡íñº╝e½╫╗P░¬½╫ñº┼▄╝╞           */
  19.     int cur_h , cur_v;       /* ªs⌐±╡°╡íñºÑ¬ñW¿ñ│╗┬I«y╝╨ñº┼▄╝╞       */
  20.     int title_v , title_h;   /* ªs⌐±┐ΘÑX⌐≤╡°╡íñññºñσªrªΩ¬║«y╝╨ñº┼▄╝╞ */
  21.     hello = "╢┘! ▒zªn╢▄";
  22.     space = "          ";
  23.  
  24.     /* ½╪Ñ▀ñ@¡╙╡°╡í */
  25.     wh = _WOpen( 11, 20, 15, 50,      /* ╡°╡íñº«y╝╨ª∞╕m */
  26.                 ZOOM + ADJ + CLOSE + MOVE + SHADOW + WMINIMIZE, /*╡°╡íñº─▌⌐╩*/
  27.                 DIALOG_SCHEME,        /* ª╣╡°╡í¿╧Ñ╬ñº╜╒ªΓ╜L */
  28.                 0,
  29.                 WO_SYSTEMBORDER );
  30.     if( wh != NULL ) {
  31.         _WSetTitle( wh, "HELLO" );                 /* │]⌐wª╣╡°╡íñº╝╨├D */
  32.         _WSetFooter( wh, "Written in WATCOM C" );  /* │]⌐wª╣╡°╡íñº╡∙╕} */
  33.         _WShow( wh );                              /* ▒╥░╩ª╣╡°╡í       */
  34.         pt.h = title_h = 11;
  35.         pt.v = title_v =  1;
  36.         _WPosCursor( wh , pt );
  37.         _WPutStr( wh , hello );
  38.     }
  39.     keystroke = _InKey(0 , HIDECURSOR + MOUSEACTIVE ); /* ╡Ñ¡╘¿╧Ñ╬¬╠½÷ñUÑ⌠ñ@ */
  40.                                                        /* ┴Σ¿├▒N┤σ╝╨┴⌠┬├░_¿╙ */
  41.     if ( keystroke != 27 )  /* ░╗┤·¿╧Ñ╬¬╠¼Oº_½÷ñU ESC ┴Σ */
  42.        {
  43.          width  = _WWidth( wh );
  44.          height = _WHeight( wh );
  45.          pt.h = cur_h = 20;
  46.          pt.v = cur_v = 10;
  47.          for (i=0;i<10;i++)
  48.          {
  49.           pt.h = cur_h = cur_h -2;
  50.           pt.v = cur_v = cur_v -1;
  51.           _WMove( wh , pt );             /* ▓╛░╩╡°╡í       */
  52.           pt.h = width  = width + 5;
  53.           pt.v = height = height + 2;
  54.           _WSize( wh , pt );             /* º∩┼▄╡°╡íñºñjñp */
  55.           pt.h = title_h = (_WWidth( wh ) - _StrLen( hello )) / 2 ;
  56.           pt.v = title_v = _WHeight( wh ) / 2;
  57.           _WPosCursor( wh , pt );
  58.           _WPutStr( wh, hello );
  59.           _InKey( 1 , HIDECURSOR );
  60.           if (i < 9)
  61.              {
  62.               _WPosCursor( wh , pt );
  63.               _WPutStr( wh, space );
  64.              }
  65.          }
  66.           _InKey(0 , HIDECURSOR + MOUSEACTIVE );
  67.        }
  68.     _WClose( wh );       /* ├÷│¼╡°╡í¿├▒N¿Σ▒q░O╛╨┼Θññ▓M░ú */
  69.     _RetInt( 0L, 1 );
  70.   }
  71.  
  72. FoxInfo myFoxInfo[] = {
  73.     { "HELLO", hello, 0, "?" }
  74. };
  75.  
  76. FoxTable _FoxTable = {
  77.     (FoxTable FAR *) 0,
  78.     sizeof( myFoxInfo) / sizeof( FoxInfo ),
  79.     myFoxInfo
  80. };
  81.