UNPKG

1.16 kBtext/x-cView Raw
1/*
2 * Demonstrates some wrapping behaviors of the new Windows 10 console.
3 */
4
5#include <windows.h>
6#include <stdio.h>
7#include <stdlib.h>
8
9#include "TestUtil.cc"
10
11int main(int argc, char *argv[]) {
12 if (argc == 1) {
13 startChildProcess(L"CHILD");
14 return 0;
15 }
16
17 setWindowPos(0, 0, 1, 1);
18 setBufferSize(40, 20);
19 setWindowPos(0, 0, 40, 20);
20
21 system("cls");
22
23 repeatChar(39, 'A'); repeatChar(1, ' ');
24 repeatChar(39, 'B'); repeatChar(1, ' ');
25 printf("\n");
26
27 repeatChar(39, 'C'); repeatChar(1, ' ');
28 repeatChar(39, 'D'); repeatChar(1, ' ');
29 printf("\n");
30
31 repeatChar(40, 'E');
32 repeatChar(40, 'F');
33 printf("\n");
34
35 repeatChar(39, 'G'); repeatChar(1, ' ');
36 repeatChar(39, 'H'); repeatChar(1, ' ');
37 printf("\n");
38
39 Sleep(2000);
40
41 setChar(39, 0, '*', 0x24);
42 setChar(39, 1, '*', 0x24);
43
44 setChar(39, 3, ' ', 0x24);
45 setChar(39, 4, ' ', 0x24);
46
47 setChar(38, 6, ' ', 0x24);
48 setChar(38, 7, ' ', 0x24);
49
50 Sleep(2000);
51 setWindowPos(0, 0, 35, 20);
52 setBufferSize(35, 20);
53 trace("DONE");
54
55 printf("Sleeping forever...\n");
56 while(true) { Sleep(1000); }
57}