本文整理汇总了C++中FillConsoleOutputCharacter函数的典型用法代码示例。如果您正苦于以下问题:C++ FillConsoleOutputCharacter函数的具体用法?C++ FillConsoleOutputCharacter怎么用?C++ FillConsoleOutputCharacter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FillConsoleOutputCharacter函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: erase_to_eol
int erase_to_eol( FILE* confp )
{
CONSOLE_SCREEN_BUFFER_INFO csbi;
HANDLE hStdErr;
DWORD dwCellsWritten;
COORD ptConsole;
int cons_fd;
if ( !confp )
{
errno = EINVAL;
return -1;
}
if ( ! _isatty( cons_fd = fileno( confp ) ) )
{
errno = EBADF;
return -1;
}
hStdErr = (HANDLE) _get_osfhandle( cons_fd );
ASSERT( hStdErr && INVALID_HANDLE_VALUE != hStdErr );
VERIFY( GetConsoleScreenBufferInfo( hStdErr, &csbi ) );
ptConsole = csbi.dwCursorPosition;
VERIFY( FillConsoleOutputAttribute( hStdErr, csbi.wAttributes, csbi.dwSize.X - ptConsole.X, ptConsole, &dwCellsWritten ) );
VERIFY( FillConsoleOutputCharacter( hStdErr, ' ', csbi.dwSize.X - ptConsole.X, ptConsole, &dwCellsWritten ) );
return 0;
}
开发者ID:mstram,项目名称:spinhawk,代码行数:30,代码来源:hconsole.c
示例2: co_debug
void
console_widget_NT_t::draw()
{
if (console == NULL) {
COORD c = {0, 0};
DWORD z;
if (!FillConsoleOutputCharacter
(buffer, blank.Char.AsciiChar, size.X * size.Y, c, &z))
co_debug("FillConsoleOutputCharacter() error 0x%lx",
GetLastError());
if (!FillConsoleOutputAttribute
(buffer, blank.Attributes, size.X * size.Y, c, &z))
co_debug("FillConsoleOutputAttribute() error 0x%lx",
GetLastError());
return;
}
co_console_cell_t *cell = console->screen;
CHAR_INFO *ci = screen;
int count = size.X * size.Y;
do {
ci->Attributes = cell->attr;
(ci++)->Char.AsciiChar = (cell++)->ch;
} while (--count);
SMALL_RECT r = region;
COORD c = {0, 0};
if (!WriteConsoleOutput(buffer, screen, size, c, &r))
co_debug("WriteConsoleOutput() error 0x%lx", GetLastError());
}
开发者ID:matt81093,项目名称:Original-Colinux,代码行数:32,代码来源:widget.cpp
示例3: clear_console
void clear_console(void)
{
#if !defined WINCE
HANDLE Hand;
CONSOLE_SCREEN_BUFFER_INFO Info;
unsigned long Written;
static COORD Home = { 0, 0 };
Hand = GetStdHandle(STD_OUTPUT_HANDLE);
if (Hand == INVALID_HANDLE_VALUE)
return;
if(!GetConsoleScreenBufferInfo(Hand, &Info))
return;
if(!FillConsoleOutputCharacter(Hand, ' ',
Info.dwSize.X * Info.dwSize.Y, Home,
&Written))
return;
if(!FillConsoleOutputAttribute(Hand, Info.wAttributes,
Info.dwSize.X * Info.dwSize.Y, Home,
&Written))
return;
SetConsoleCursorPosition(Hand, Home);
#endif
}
开发者ID:TKr,项目名称:Wive-ng-rt8186,代码行数:29,代码来源:misc.c
示例4: insline
void insline()
{
int y=wherey() ;
HANDLE hScreen = GetStdHandle(STD_OUTPUT_HANDLE) ;
CONSOLE_SCREEN_BUFFER_INFO Info ;
GetConsoleScreenBufferInfo(hScreen, &Info) ;
{
COORD dwBufferSize={Info.dwSize.X, Info.dwSize.Y - y} ;
COORD dwBufferCoord={0,0} ;
COORD coord={0, y-1} ; // pour FillConsoleOutputCharacter
CHAR_INFO Buffer[dwBufferSize.Y][dwBufferSize.X] ;
DWORD dwWritten;
SMALL_RECT ReadRegion[2] ;
ReadRegion[0].Left = 0 ;
ReadRegion[0].Right = Info.dwSize.X-1 ;
ReadRegion[0].Top = y-1 ;
ReadRegion[0].Bottom = Info.dwSize.Y-2 ;
ReadConsoleOutput(hScreen, (CHAR_INFO*)Buffer, dwBufferSize, dwBufferCoord, ReadRegion) ;
ReadRegion[0].Top = y ;
ReadRegion[0].Bottom = Info.dwSize.Y-1 ;
WriteConsoleOutput(hScreen, (CHAR_INFO*)Buffer, dwBufferSize, dwBufferCoord, ReadRegion) ;
FillConsoleOutputCharacter (hScreen, ' ', Info.dwSize.X, coord, &dwWritten); // Effacer ligne
FillConsoleOutputAttribute (hScreen, Info.wAttributes, Info.dwSize.X, coord, &dwWritten);
}
}
开发者ID:mikadev,项目名称:minesweeper,代码行数:26,代码来源:myconio.cpp
示例5: GetStdHandle
// Initializes windows console.
bool CSimWindow::InitWindow()
{
// Set up console window
WORD wAttributes;
COORD pos;
SMALL_RECT consoleWindowDim;
CONSOLE_SCREEN_BUFFER_INFO bufferInfo;
unsigned long int temp;
// Get console handles
hSimOutput = GetStdHandle(STD_OUTPUT_HANDLE);
hSimInput = GetStdHandle(STD_INPUT_HANDLE);
if(hSimOutput == INVALID_HANDLE_VALUE || hSimInput == INVALID_HANDLE_VALUE) {
printf("ERROR: Couldn't get console I/O handles.\n");
return false;
}
// Save current console info
GetConsoleScreenBufferInfo(hSimOutput, &bufferInfo);
oldBufferSize = bufferInfo.dwSize;
oldWindowSize = bufferInfo.srWindow;
oldAttributes = bufferInfo.wAttributes;
// Set console title
SetConsoleTitle("Emu86 Simulator");
// Set console to small size for buffer change:
consoleWindowDim.Bottom = 0;
consoleWindowDim.Top = 0;
consoleWindowDim.Left = 0;
consoleWindowDim.Right = 0;
SetConsoleWindowInfo(hSimOutput, TRUE, &consoleWindowDim);
// Set buffer size
pos.X = SIM_CONSOLE_BUFFER_WIDTH;
pos.Y = SIM_CONSOLE_BUFFER_HEIGHT;
SetConsoleScreenBufferSize(hSimOutput, pos);
// Set console size
consoleWindowDim.Bottom = SIM_CONSOLE_HEIGHT - 1;
consoleWindowDim.Top = 0;
consoleWindowDim.Left = 0;
consoleWindowDim.Right = SIM_CONSOLE_WIDTH - 1;
SetConsoleWindowInfo(hSimOutput, TRUE, &consoleWindowDim);
// Clear console, set to black, white text
pos.X = 0;
pos.Y = 0;
wAttributes = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
FillConsoleOutputAttribute(hSimOutput, wAttributes, SIM_CONSOLE_BUFFER_WIDTH * SIM_CONSOLE_BUFFER_HEIGHT, pos, &temp);
FillConsoleOutputCharacter(hSimOutput, ' ', SIM_CONSOLE_BUFFER_WIDTH * SIM_CONSOLE_BUFFER_HEIGHT, pos, &temp);
// Move curor to top left
SetConsoleCursorPosition(hSimOutput, pos);
return true;
}
开发者ID:brandw,项目名称:8086-toolchain,代码行数:60,代码来源:SimWindow.cpp
示例6: RefreshScreen
void RefreshScreen(void)
{
DWORD dummy;
COORD Home = {0, 0};
FillConsoleOutputCharacter(hConsoleOut, ' ',
csbiInfo.dwSize.X * csbiInfo.dwSize.Y,
Home, &dummy);
}
开发者ID:zpzjzj,项目名称:MipsBox,代码行数:8,代码来源:display.cpp
示例7: mp_hal_erase_line_from_cursor
void mp_hal_erase_line_from_cursor(uint n_chars_to_erase) {
assure_conout_handle();
CONSOLE_SCREEN_BUFFER_INFO info;
GetConsoleScreenBufferInfo(con_out, &info);
DWORD written;
FillConsoleOutputCharacter(con_out, ' ', n_chars_to_erase, info.dwCursorPosition, &written);
FillConsoleOutputAttribute(con_out, info.wAttributes, n_chars_to_erase, info.dwCursorPosition, &written);
}
开发者ID:cav71,项目名称:micropython,代码行数:8,代码来源:windows_mphal.c
示例8: pointerToHandle
JNIEXPORT void JNICALL Java_com_yifanlu_Josh_Josh_FILLCONSOLEOUTPUTCHARACTER
(JNIEnv *env, jclass jcls, jlong pointer, jchar character, jint length, jint x, jint y)
{
HANDLE hConsole = pointerToHandle(pointer);
COORD location = { x , y };
FillConsoleOutputCharacter(hConsole, character, length, location, NULL);
}
开发者ID:yifanlu,项目名称:Josh,代码行数:8,代码来源:2000.cpp
示例9: main
int main(int argc, char *argv[])
{
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO bInfo;
GetConsoleScreenBufferInfo(hOut, &bInfo);
COORD pos = {0, 0};
FillConsoleOutputCharacter(hOut, '@', bInfo.dwSize.X / 2 * bInfo.dwSize.Y, pos, NULL);
CloseHandle(hOut);
}
开发者ID:jollywing,项目名称:jolly-code-snippets,代码行数:9,代码来源:fill_screen.c
示例10: mp_hal_erase_line_from_cursor
void mp_hal_erase_line_from_cursor() {
assure_conout_handle();
CONSOLE_SCREEN_BUFFER_INFO info;
GetConsoleScreenBufferInfo(con_out, &info);
const short len = info.dwSize.X - info.dwCursorPosition.X;
DWORD written;
FillConsoleOutputCharacter(con_out, ' ', len, info.dwCursorPosition, &written);
FillConsoleOutputAttribute(con_out, info.wAttributes, len, info.dwCursorPosition, &written);
}
开发者ID:englotk,项目名称:micropython,代码行数:9,代码来源:windows_mphal.c
示例11: GetConsoleScreenBufferInfo
void Graphics::clearScreen()
{
DWORD d;
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(_console, &csbi);
auto size = csbi.dwSize.X * csbi.dwSize.Y;
FillConsoleOutputAttribute(_console, csbi.wAttributes, size, { 0, 0 }, &d);
FillConsoleOutputCharacter(_console, L' ', size, { 0, 0 }, &d);
}
开发者ID:GolanSabo,项目名称:Widget,代码行数:9,代码来源:Graphics.cpp
示例12: info
void Console::Clear(void) const
{
ScreenBufferInfo info(*this); // Screen buffer information
DWORD result; // Result from fill operation
// Fill the console with space characters using the current attibutes; move cursor to 0,0 afterwards
if(!FillConsoleOutputCharacter(m_stdout, _T(' '), info.dwSize.X * info.dwSize.Y, { 0, 0 }, &result)) throw Win32Exception();
if(!FillConsoleOutputAttribute(m_stdout, info.wAttributes, info.dwSize.X * info.dwSize.Y, { 0, 0 }, &result)) throw Win32Exception();
if(!SetConsoleCursorPosition(m_stdout, { 0, 0 })) throw Win32Exception();
}
开发者ID:zukisoft,项目名称:vm,代码行数:10,代码来源:Console.cpp
示例13: eraseEol
static void eraseEol(struct current *current)
{
COORD pos;
DWORD n;
pos.X = (SHORT) current->x;
pos.Y = (SHORT) current->y;
FillConsoleOutputCharacter(current->outh, ' ', current->cols - current->x, pos, &n);
}
开发者ID:evanhunter,项目名称:jimtcl,代码行数:10,代码来源:linenoise.c
示例14: FillConsoleOutputAttribute
void clib::cls()
{
_COORD st;
unsigned long bw;
st.X = 0;
st.Y = 0;
FillConsoleOutputAttribute(screen_,fgc_|bgc_,80*50,st,&bw);
FillConsoleOutputCharacter(screen_,32,80*50,st,&bw);
SetConsoleCursorPosition(screen_,st);
}
开发者ID:RichardMarks,项目名称:SAWD,代码行数:10,代码来源:clib.cpp
示例15: ClearLine
void ClearLine(void) {
CONSOLE_SCREEN_BUFFER_INFO s;
HANDLE out = GetTermInfo(&s);
COORD pos = { 0, s.dwCursorPosition.Y };
DWORD n;
FillConsoleOutputCharacter(out, ' ', s.dwSize.X, pos, (LPDWORD)(&n));
SetConsoleCursorPosition(out, pos);
}
开发者ID:wheelcomplex,项目名称:lift,代码行数:10,代码来源:client_windows.c
示例16: ClsXYXCount
/* Cleans the screen with the given start point and len. */
VOID ClsXYXCount(INT x,INT y,INT Width,INT Count){
INT i;
DWORD cCharsWritten;
// Start point of cleaning the screen.
COORD coordScreen = {x,y};
// Filling the given position with blanks.
for(i=0;i < Count;i++){
FillConsoleOutputCharacter( hConsole, (WCHAR) ' ',(Width), coordScreen, &cCharsWritten );
++coordScreen.Y;
}
}
开发者ID:ahmad-siavashi,项目名称:Ana-Process-Explorer,代码行数:12,代码来源:DrawTools.c
示例17: clearScreen
static void clearScreen(struct current *current) {
COORD topleft = {0, 0};
DWORD n;
FillConsoleOutputCharacter(current->outh, ' ',
current->cols * current->rows, topleft, &n);
FillConsoleOutputAttribute(current->outh,
FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN,
current->cols * current->rows, topleft, &n);
SetConsoleCursorPosition(current->outh, topleft);
}
开发者ID:hscarter,项目名称:revbayes,代码行数:11,代码来源:linenoise.c
示例18: AppException
void Screen::fillChar (int x, int y, int c, int count)
{
DWORD charsWritten;
if (count <= 0)
throw AppException (WHERE, ERR_INTERNAL);
COORD coord;
coord.X = (SHORT) x;
coord.Y = (SHORT) y;
if (FillConsoleOutputCharacter (mScreenBuf, c, count, coord, &charsWritten) != TRUE)
throw AppException (WHERE, ERR_WINDOWS_FMT, "FillConsoleOutputCharacter", GetLastError ());
}
开发者ID:ancientlore,项目名称:hermit,代码行数:11,代码来源:screen.cpp
示例19: clrscr
void clrscr() {
HANDLE hConsole = GetStdHandle( STD_OUTPUT_HANDLE );
COORD coordScreen = { 0, 0 };
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo( hConsole, &csbi );
DWORD dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
DWORD cCharsWritten;
FillConsoleOutputCharacter( hConsole, (TCHAR) ' ', dwConSize, coordScreen, &cCharsWritten );
GetConsoleScreenBufferInfo( hConsole, &csbi );
FillConsoleOutputAttribute( hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten );
SetConsoleCursorPosition( hConsole, coordScreen );
}
开发者ID:zsimpson,项目名称:zbslib,代码行数:12,代码来源:zvidcap.cpp
示例20: ClearScreen
void
ClearScreen (void)
{
COORD coordOrg = {0, 0};
DWORD dwWritten = 0;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
if (INVALID_HANDLE_VALUE != hConsole)
FillConsoleOutputCharacter(hConsole, ' ', 80 * 50, coordOrg, &dwWritten);
MoveCursor(0, 0);
return;
}
开发者ID:otoauler,项目名称:sdkpub,代码行数:12,代码来源:ULFI01.C
注:本文中的FillConsoleOutputCharacter函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论