mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-01 19:26:16 +00:00
Patch by H�seyin Uslu <[email protected]>
Check color passed on command line, make sure foreground and background are not the same. svn path=/trunk/; revision=8263
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $Id: color.c,v 1.3 2003/08/07 09:27:42 hbirr Exp $
|
||||
/* $Id: color.c,v 1.4 2004/02/19 17:04:11 gvg Exp $
|
||||
*
|
||||
* COLOR.C - color internal command.
|
||||
*
|
||||
@@ -68,19 +68,26 @@ VOID SetScreenColor (WORD wColor, BOOL bFill)
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
COORD coPos;
|
||||
|
||||
if (bFill == TRUE)
|
||||
if ((wColor & 0xF) == (wColor &0xF0) >> 4)
|
||||
{
|
||||
GetConsoleScreenBufferInfo (hConsole, &csbi);
|
||||
ConErrPuts (_T("Same colors error! (Background and foreground can't be the same color)"));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bFill == TRUE)
|
||||
{
|
||||
GetConsoleScreenBufferInfo (hConsole, &csbi);
|
||||
|
||||
coPos.X = 0;
|
||||
coPos.Y = 0;
|
||||
FillConsoleOutputAttribute (hConsole,
|
||||
coPos.X = 0;
|
||||
coPos.Y = 0;
|
||||
FillConsoleOutputAttribute (hConsole,
|
||||
(WORD)(wColor & 0x00FF),
|
||||
(csbi.dwSize.X)*(csbi.dwSize.Y),
|
||||
coPos,
|
||||
&dwWritten);
|
||||
}
|
||||
SetConsoleTextAttribute (hConsole, (WORD)(wColor & 0x00FF));
|
||||
}
|
||||
SetConsoleTextAttribute (hConsole, (WORD)(wColor & 0x00FF));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user