-/* $Id: notevil.c,v 1.2 1999/10/03 22:10:15 ekohl Exp $
+/* $Id$
*
* notevil.c
- *
+ *
* --------------------------------------------------------------------
*
* This software is free software; you can redistribute it and/or
* You should have received a copy of the GNU Library General Public
* License along with this software; see the file COPYING.LIB. If
* not, write to the Free Software Foundation, Inc., 675 Mass Ave,
- * Cambridge, MA 02139, USA.
+ * Cambridge, MA 02139, USA.
*
* --------------------------------------------------------------------
* ReactOS Coders Console Parade
HANDLE myself;
HANDLE ScreenBuffer;
CONSOLE_SCREEN_BUFFER_INFO ScreenBufferInfo;
+HANDLE WaitableTimer;
void
WriteStringAt(
if (0 == wLen)
return;
- WriteConsoleOutputCharacter(
- ScreenBuffer,
- lpString,
- wLen,
- xy,
- & cWritten
- );
+ // don't bother writing text when erasing
+ if( wColor )
+ WriteConsoleOutputCharacter( ScreenBuffer,
+ lpString,
+ wLen,
+ xy,
+ & cWritten
+ );
FillConsoleOutputAttribute(
ScreenBuffer,
wColor,
xy,
wColor
);
- Sleep(100);
+ WaitForSingleObject( WaitableTimer, INFINITE );
WriteStringAt(
NameString,
xy,
char *argv []
)
{
+ LARGE_INTEGER lint;
+ DWORD Written;
+ COORD Coord = { 0, 0 };
+
myself = GetModuleHandle(NULL);
-#if 1
GetConsoleScreenBufferInfo (GetStdHandle(STD_OUTPUT_HANDLE),
&ScreenBufferInfo);
-#else
- ScreenBufferInfo.dwSize.X = 80;
- ScreenBufferInfo.dwSize.Y = 25;
-#endif
-
+ ScreenBufferInfo.dwSize.X = ScreenBufferInfo.srWindow.Right - ScreenBufferInfo.srWindow.Left + 1;
+ ScreenBufferInfo.dwSize.Y = ScreenBufferInfo.srWindow.Bottom - ScreenBufferInfo.srWindow.Top + 1;
ScreenBuffer = CreateConsoleScreenBuffer(
GENERIC_WRITE,
0,
);
return EXIT_FAILURE;
}
+ // Fill buffer with black background
+ FillConsoleOutputAttribute( ScreenBuffer,
+ 0,
+ ScreenBufferInfo.dwSize.X * ScreenBufferInfo.dwSize.Y,
+ Coord,
+ &Written );
+ WaitableTimer = CreateWaitableTimer( NULL, FALSE, NULL );
+ if( WaitableTimer == INVALID_HANDLE_VALUE )
+ {
+ printf( "CreateWaitabletimer() failed\n" );
+ return 1;
+ }
+ lint.QuadPart = -2000000;
+ if( SetWaitableTimer( WaitableTimer, &lint, 200, NULL, NULL, FALSE ) == FALSE )
+ {
+ printf( "SetWaitableTimer() failed: 0x%lx\n", GetLastError() );
+ return 2;
+ }
SetConsoleActiveScreenBuffer(ScreenBuffer);
MainLoop();
CloseHandle(ScreenBuffer);