void FloodScreen(WORD Props)
{
bool Done = false;
int DBHEX = 219;
CHAR_INFO Flood;
Flood.Char.AsciiChar = DBHEX;
Flood.Attributes = Props;
COORD BufferSize = {80,25};
COORD CPos = {0,0};
SMALL_RECT WArea = {0,0,0,0};
while (!Done)
{
WriteConsoleOutput(wHnd, &Flood, BufferSize, CPos, &WArea);
if (CPos.X >= -80)
{
CPos.Y += 1;
CPos.X = 0;
}
CPos.X -= 1;
if (CPos.Y >= 26)
{
Done = true;
}
}
}
"WriteConsoleOutput" Flood Screen?
I want to flood the console screen with solid colors, but I have a problem: it's not flooding correctly, actually, not at all. My code looks correct, but it's not printing how I want it to. I think that it's going off of the console window. Any help? Here's my code:
(To call this function, I use FloodScreen(FOREGROUND_RED); Also, you must include windows.h, stdio.h, and stdlib.h.)
WArea is incorrect.
Quote:WriteConsoleOutput()
The rectangle pointed to by the lpWriteRegion parameter specifies the size and location of the block to be written to in the console screen buffer.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement