На главную

On-line справка по Win32 API

Написать письмо
БЕСПЛАТНАЯ ежедневная online лотерея! Выигрывай каждый день БЕСПЛАТНО!
Список всех статей A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z | Скачать Вниз

ReadConsoleOutputAttribute



The ReadConsoleOutputAttribute function copies a specified number of foreground and background color attributes from consecutive cells of a console screen buffer, beginning at a specified location.

BOOL ReadConsoleOutputAttribute(

HANDLE hConsoleOutput, // handle of a console screen buffer
LPWORD lpAttribute, // address of buffer to receive attributes
DWORD nLength, // number of character cells to read from
COORD dwReadCoord, // coordinates of first cell to read from
LPDWORD lpNumberOfAttrsRead // address of number of cells read from
);


Parameters

hConsoleOutput

Identifies a console screen buffer. The handle must have GENERIC_READ access.

lpAttribute

Points to a buffer that receives the attributes read from the screen buffer.

nLength

Specifies the number of screen buffer character cells from which to read. The size of the buffer pointed to by the lpAttribute parameter should be nLength * sizeof(WORD).

dwReadCoord

Specifies the coordinates of the first cell in the screen buffer from which to read. The X member of the COORD structure is the column, and the Y member is the row.

lpNumberOfAttrsRead

Points to a 32-bit variable that receives the number of attributes actually read.



Return Values

If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

If the number of attributes to be read from extends beyond the end of the specified screen buffer row, attributes are read from the next row. If the number of attributes to be read from extends beyond the end of the screen buffer, attributes up to the end of the screen buffer are read.
Each attribute specifies the foreground (text) and background colors in which that character cell is drawn. The attribute values are some combination of the following values: FOREGROUND_BLUE, FOREGROUND_GREEN, FOREGROUND_RED, FOREGROUND_INTENSITY, BACKGROUND_BLUE, BACKGROUND_GREEN, BACKGROUND_RED, and BACKGROUND_INTENSITY. For example, the following combination of values produces red text on a white background:

FOREGROUND_RED | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE


See Also

COORD, ReadConsoleOutput, ReadConsoleOutputCharacter, WriteConsoleOutput, WriteConsoleOutputAttribute, WriteConsoleOutputCharacter


Пригласи друзей и счет твоего мобильника всегда будет положительным!
Предыдущая статья
 
Сайт Народ.Ру Интернет
Следующая статья
Пригласи друзей и счет твоего мобильника всегда будет положительным!

ReadConsoleOutputAttribute



Функция ReadConsoleOutputAttribute копирует определенный номер переднего плана и цвет фона приписывается из последовательных ячеек консольного экранного буфера, начинающегося в определенной позиции.

BOOL ReadConsoleOutputAttribute(

РУЧКА hConsoleOutput, // ручка консоли отгораживают буфер LPWORD lpAttribute, // адрес буфера, чтобы получать атрибуты DWORD nLength, // количество символьных ячеек, чтобы читаться из COORD dwReadCoord, // координат первой ячейки, чтобы читаться из адреса LPDWORD lpNumberOfAttrsRead // количества ячеек прочитанных из
);


Параметры

hConsoleOutput

Идентифицирует консольный экранный буфер. Ручка должна иметь доступ GENERIC_READ.

lpAttribute

Точки на буфер, которые получают атрибуты прочитанные из экранного буфера.

nLength

Определяет количество экранных буферных символьных ячеек из которых, чтобы читаться. Размер буфера указанного, чтобы параметром lpAttribute должен быть nLength * sizeof(СЛОВО).

dwReadCoord

Определяет координаты первой ячейки в экранном буфере из которой, чтобы читаться. Член X структуры COORD является колонной, и член Y является колонкой.

lpNumberOfAttrsRead

Точки на 32- битовую переменную, которые получают количество действительно прочитанных атрибутов.



Обратные Величины

Если функция добивается успеха, обратная величина ненулевая.
Если функция терпит неудачу, обратная величина нулевая. Для того, чтобы расширять информацию ошибки, назовите GetLastError.

Замечания

Если количество атрибутов, которые нужно быть прочитаны из расширяется за концом определенной экранной буферной колонки, атрибуты прочитаны из следующей колонки. Если количество атрибутов, которые нужно быть прочитаны из расширяется за концом экранного буфера, атрибуты вплоть до конца экранного буфера прочитаны.
Каждый атрибут определяет передний план (текст) и цвета фона в которых, что символьная ячейка сделана. Вспомогательные величины являются некоторой комбинацией следующего величин: FOREGROUND_BLUE, FOREGROUND_GREEN, FOREGROUND_RED, FOREGROUND_INTENSITY, BACKGROUND_BLUE, BACKGROUND_GREEN, BACKGROUND_RED, и BACKGROUND_INTENSITY. Например, следующая комбинация величин производит красный текст на белом фоне:

FOREGROUND_RED | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE


Смотри Также

COORD, ReadConsoleOutput, ReadConsoleOutputCharacter, WriteConsoleOutput, WriteConsoleOutputAttribute, WriteConsoleOutputCharacter


Вверх Version 1.3, Oct 26 2010 © 2007, 2010, mrhx Вверх
 mrhx software  Русский перевод OpenGL  Русский перевод Win32 API
 
Используются технологии uCoz