home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / SCRNMS.ZIP / TEST.C < prev    next >
C/C++ Source or Header  |  1990-02-18  |  1KB  |  61 lines

  1. #include <stdio.h>
  2. #include <editor.h>
  3. #include <kb.h>
  4. #include <stdlib.h>
  5. #include <window.h>
  6. #include <screen.h>
  7.  
  8.  
  9.  
  10. int main(void)
  11.     {
  12.     int count;
  13.     int start;
  14.     int stop;
  15.     int temp;
  16.     struct window *screen;
  17.     struct window *wndw[350];
  18.  
  19.     scr_init();
  20.     if (!(screen = open_window(0x0,0x184f,NORMAL,4)))
  21.         {
  22.         fprintf(stderr,"ERROR!\n\n");
  23.         exit(1);
  24.         }
  25.     _vcw(' ',ON_BLUE,0x0,80);
  26.     prntcenter(0x0,80,YELLOW | ON_BLUE,"Opening and closing 350 windows at a time");
  27.     _vcw(' ',ON_RED,0x1800,80);
  28.     prntcenter(0x1800,80,LT_CYAN | ON_RED | BLINK,"Press any key to end this stupid display!");
  29.     do
  30.         {
  31.         for (count = 0; count < 350; count++)
  32.             {
  33.             start =  ((((count + 12) * 9 % 14) + 1) << 8) | ((count * 4) << 2) % 50;
  34.             stop = (start & 0xff00) + 0x900;
  35.             temp = start & 0xff;
  36.             stop |= temp + (temp >= 45 ? 20 : temp >= 20 ? 30 : 40);
  37.             if ((wndw[count] = open_window(start,stop,count * 29 % 128,3)) == NULL)
  38.                 {
  39.                 fprintf(stderr,"ERROR!\n\n");
  40.                 exit(1);
  41.                 }
  42.             if (_scan_keyboard())
  43.                 {
  44.                 beep();
  45.                 break;
  46.                 }
  47.             }
  48.         --count;
  49.         for ( ; count >= 0; count--)
  50.             close_window(wndw[count]);
  51.         }
  52.     while (!_scan_keyboard());
  53.     close_window(screen);
  54.  
  55.     while (_scan_keyboard())
  56.         _read_keyboard();            /* purge our keystrokes */
  57.  
  58.     return 0;
  59.     }
  60.  
  61.