1 /* $Id: notevil.c,v 1.2 1999/10/03 22:10:15 ekohl Exp $
5 * --------------------------------------------------------------------
7 * This software is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public License as
9 * published by the Free Software Foundation; either version 2 of the
10 * License, or (at your option) any later version.
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this software; see the file COPYING.LIB. If
19 * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
20 * Cambridge, MA 02139, USA.
22 * --------------------------------------------------------------------
23 * ReactOS Coders Console Parade
35 LPCTSTR app_name
= _TEXT("notevil");
39 CONSOLE_SCREEN_BUFFER_INFO ScreenBufferInfo
;
49 WORD wLen
= lstrlen(lpString
);
53 WriteConsoleOutputCharacter(
60 FillConsoleOutputAttribute(
79 _TEXT("x=%02d y=%02d"),
86 (BACKGROUND_RED
| BACKGROUND_GREEN
| BACKGROUND_BLUE
)
89 #endif /* def DISPLAY_COORD */
99 if (RES_LAST_INDEX
== *Index
)
101 *Index
= RES_FIRST_INDEX
;
120 LPTSTR szTitle
= _TEXT("ReactOS Coders Console Parade");
123 xy
.X
= (ScreenBufferInfo
.dwSize
.X
- lstrlen(szTitle
)) / 2;
124 xy
.Y
= ScreenBufferInfo
.dwSize
.Y
/ 2;
129 (FOREGROUND_GREEN
| FOREGROUND_INTENSITY
)
134 #define RES_DELAY_CHANGE 12
135 #define RES_BUFFER_SIZE 1024
139 TCHAR NameString
[RES_BUFFER_SIZE
];
143 INT n
= RES_DELAY_CHANGE
;
148 xy
.X
= ScreenBufferInfo
.dwSize
.X
/ 2;
149 xy
.Y
= ScreenBufferInfo
.dwSize
.Y
/ 2;
153 if (n
== RES_DELAY_CHANGE
)
160 NameLength
= lstrlen(NameString
);
162 if ((wColor
& 0x000F) == 0)
170 else if (xy
.X
>= ScreenBufferInfo
.dwSize
.X
- NameLength
- 1)
182 else if (xy
.Y
>= ScreenBufferInfo
.dwSize
.Y
- 1)
190 #endif /* def DISPLAY_COORD */
213 myself
= GetModuleHandle(NULL
);
216 GetConsoleScreenBufferInfo (GetStdHandle(STD_OUTPUT_HANDLE
),
219 ScreenBufferInfo
.dwSize
.X
= 80;
220 ScreenBufferInfo
.dwSize
.Y
= 25;
223 ScreenBuffer
= CreateConsoleScreenBuffer(
227 CONSOLE_TEXTMODE_BUFFER
,
230 if (INVALID_HANDLE_VALUE
== ScreenBuffer
)
234 _TEXT("%s: could not create a new screen buffer\n"),
240 SetConsoleActiveScreenBuffer(ScreenBuffer
);
242 CloseHandle(ScreenBuffer
);