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
;
50 WORD wLen
= lstrlen(lpString
);
54 // don't bother writing text when erasing
56 WriteConsoleOutputCharacter( ScreenBuffer
,
62 FillConsoleOutputAttribute(
81 _TEXT("x=%02d y=%02d"),
88 (BACKGROUND_RED
| BACKGROUND_GREEN
| BACKGROUND_BLUE
)
91 #endif /* def DISPLAY_COORD */
101 if (RES_LAST_INDEX
== *Index
)
103 *Index
= RES_FIRST_INDEX
;
122 LPTSTR szTitle
= _TEXT("ReactOS Coders Console Parade");
125 xy
.X
= (ScreenBufferInfo
.dwSize
.X
- lstrlen(szTitle
)) / 2;
126 xy
.Y
= ScreenBufferInfo
.dwSize
.Y
/ 2;
131 (FOREGROUND_GREEN
| FOREGROUND_INTENSITY
)
136 #define RES_DELAY_CHANGE 12
137 #define RES_BUFFER_SIZE 1024
141 TCHAR NameString
[RES_BUFFER_SIZE
];
145 INT n
= RES_DELAY_CHANGE
;
150 xy
.X
= ScreenBufferInfo
.dwSize
.X
/ 2;
151 xy
.Y
= ScreenBufferInfo
.dwSize
.Y
/ 2;
155 if (n
== RES_DELAY_CHANGE
)
162 NameLength
= lstrlen(NameString
);
164 if ((wColor
& 0x000F) == 0)
172 else if (xy
.X
>= ScreenBufferInfo
.dwSize
.X
- NameLength
- 1)
184 else if (xy
.Y
>= ScreenBufferInfo
.dwSize
.Y
- 1)
192 #endif /* def DISPLAY_COORD */
199 WaitForSingleObject( WaitableTimer
, INFINITE
);
217 COORD Coord
= { 0, 0 };
219 myself
= GetModuleHandle(NULL
);
221 GetConsoleScreenBufferInfo (GetStdHandle(STD_OUTPUT_HANDLE
),
223 ScreenBufferInfo
.dwSize
.X
= ScreenBufferInfo
.srWindow
.Right
- ScreenBufferInfo
.srWindow
.Left
+ 1;
224 ScreenBufferInfo
.dwSize
.Y
= ScreenBufferInfo
.srWindow
.Bottom
- ScreenBufferInfo
.srWindow
.Top
+ 1;
225 ScreenBuffer
= CreateConsoleScreenBuffer(
229 CONSOLE_TEXTMODE_BUFFER
,
232 if (INVALID_HANDLE_VALUE
== ScreenBuffer
)
236 _TEXT("%s: could not create a new screen buffer\n"),
241 // Fill buffer with black background
242 FillConsoleOutputAttribute( ScreenBuffer
,
244 ScreenBufferInfo
.dwSize
.X
* ScreenBufferInfo
.dwSize
.Y
,
248 WaitableTimer
= CreateWaitableTimer( NULL
, FALSE
, NULL
);
249 if( WaitableTimer
== INVALID_HANDLE_VALUE
)
251 printf( "CreateWaitabletimer() failed\n" );
254 lint
.QuadPart
= -2000000;
255 if( SetWaitableTimer( WaitableTimer
, &lint
, 200, NULL
, NULL
, FALSE
) == FALSE
)
257 printf( "SetWaitableTimer() failed: 0x%lx\n", GetLastError() );
260 SetConsoleActiveScreenBuffer(ScreenBuffer
);
262 CloseHandle(ScreenBuffer
);