home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
SCRNMS.ZIP
/
TEST.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-02-18
|
1KB
|
61 lines
#include <stdio.h>
#include <editor.h>
#include <kb.h>
#include <stdlib.h>
#include <window.h>
#include <screen.h>
int main(void)
{
int count;
int start;
int stop;
int temp;
struct window *screen;
struct window *wndw[350];
scr_init();
if (!(screen = open_window(0x0,0x184f,NORMAL,4)))
{
fprintf(stderr,"ERROR!\n\n");
exit(1);
}
_vcw(' ',ON_BLUE,0x0,80);
prntcenter(0x0,80,YELLOW | ON_BLUE,"Opening and closing 350 windows at a time");
_vcw(' ',ON_RED,0x1800,80);
prntcenter(0x1800,80,LT_CYAN | ON_RED | BLINK,"Press any key to end this stupid display!");
do
{
for (count = 0; count < 350; count++)
{
start = ((((count + 12) * 9 % 14) + 1) << 8) | ((count * 4) << 2) % 50;
stop = (start & 0xff00) + 0x900;
temp = start & 0xff;
stop |= temp + (temp >= 45 ? 20 : temp >= 20 ? 30 : 40);
if ((wndw[count] = open_window(start,stop,count * 29 % 128,3)) == NULL)
{
fprintf(stderr,"ERROR!\n\n");
exit(1);
}
if (_scan_keyboard())
{
beep();
break;
}
}
--count;
for ( ; count >= 0; count--)
close_window(wndw[count]);
}
while (!_scan_keyboard());
close_window(screen);
while (_scan_keyboard())
_read_keyboard(); /* purge our keystrokes */
return 0;
}