Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "WinAPI";
Текущий архив: 2003.04.10;
Скачать: [xml.tar.bz2];

Вниз

Консольные приложения   Найти похожие ветки 

 
Tuzemec   (2003-02-04 00:08) [0]

Доброго все времени суток.
Народ, ктонить знает что можно использовать в консольных приложениях? Как сделать то, что я делал в паскале, тоесть Readkey, Window,... измень цвет символов, экрана итд


 
SeF   (2003-02-04 01:46) [1]

CONSOLE_SCREEN_BUFFER_INFO


 
ZZ   (2003-02-04 03:48) [2]

The following functions are used to access a console. (c)MSDN

AllocConsole Allocates a new console for the calling process.
CreateConsoleScreenBuffer Creates a console screen buffer.
FillConsoleOutputAttribute Sets the text and background color attributes for a specified number of character cells.
FillConsoleOutputCharacter Writes a character to the screen buffer a specified number of times.
FlushConsoleInputBuffer Flushes the console input buffer.
FreeConsole Detaches the calling process from its console.
GenerateConsoleCtrlEvent Sends a specified signal to a console process group that shares the console associated with the calling process.
GetConsoleCP Retrieves the input code page used by the console associated with the calling process.
GetConsoleCursorInfo Retrieves information about the size and visibility of the cursor for the specified console screen buffer.
GetConsoleMode Retrieves the current input mode of a console"s input buffer or the current output mode of a console screen buffer.
GetConsoleOutputCP Retrieves the output code page used by the console associated with the calling process.
GetConsoleScreenBufferInfo Retrieves information about the specified console screen buffer.
GetConsoleTitle Retrieves the title bar string for the current console window.
GetConsoleWindow Retrieves the window handle used by the console associated with the calling process.
GetLargestConsoleWindowSize Retrieves the size of the largest possible console window.
GetNumberOfConsoleInputEvents Retrieves the number of unread input records in the console"s input buffer.
GetNumberOfConsoleMouseButtons Retrieves the number of buttons on the mouse used by the current console.
GetStdHandle Retrieves a handle for the standard input, standard output, or standard error device.
HandlerRoutine An application-defined function used with the SetConsoleCtrlHandler function.
PeekConsoleInput Reads data from the specified console input buffer without removing it from the buffer.
ReadConsole Reads character input from the console input buffer and removes it from the buffer.
ReadConsoleInput Reads data from a console input buffer and removes it from the buffer.
ReadConsoleOutput Reads character and color attribute data from a rectangular block of character cells in a console screen buffer.
ReadConsoleOutputAttribute Copies a specified number of foreground and background color attributes from consecutive cells of a console screen buffer.
ReadConsoleOutputCharacter Copies a number of characters from consecutive cells of a console screen buffer.
ScrollConsoleScreenBuffer Moves a block of data in a screen buffer.
SetConsoleActiveScreenBuffer Sets the specified screen buffer to be the currently displayed console screen buffer.
SetConsoleCP Sets the input code page used by the console associated with the calling process.
SetConsoleCtrlHandler Adds or removes an application-defined HandlerRoutine from the list of handler functions for the calling process.
SetConsoleCursorInfo Sets the size and visibility of the cursor for the specified console screen buffer.
SetConsoleCursorPosition Sets the cursor position in the specified console screen buffer.
SetConsoleMode Sets the input mode of a console"s input buffer or the output mode of a console screen buffer.
SetConsoleOutputCP Sets the output code page used by the console associated with the calling process.
SetConsoleScreenBufferSize Changes the size of the specified console screen buffer.
SetConsoleTextAttribute Sets the foreground (text) and background color attributes of characters written to the screen buffer.
SetConsoleTitle Sets the title bar string for the current console window.
SetConsoleWindowInfo Sets the current size and position of a console screen buffer"s window.
SetStdHandle Sets the handle for the standard input, standard output, or standard error device.
WriteConsole Writes a character string to a console screen buffer beginning at the current cursor location.
WriteConsoleInput Writes data directly to the console input buffer.
WriteConsoleOutput Writes character and color attribute data to a specified rectangular block of character cells in a console screen buffer.
WriteConsoleOutputAttribute Copies a number of foreground and background color attributes to consecutive cells of a console screen buffer.
WriteConsoleOutputCharacter Copies a number of characters to consecutive cells of a console screen buffer.


 
asmith   (2003-02-04 13:15) [3]

Маленький примерчик:
{$APPTYPE CONSOLE}
program ConsoleOutput;

uses
Windows;

var
hOutput: THandle;
sbiAttributes: TConsoleScreenBufferInfo;
wDefColors: WORD;
coorCurrent, coorTopLeft: TCoord;

const
FOREGROUND_BRCYAN = FOREGROUND_GREEN or FOREGROUND_BLUE or
FOREGROUND_INTENSITY;
begin
hOutput := GetStdHandle(STD_OUTPUT_HANDLE);
coorTopLeft.X := 1;
coorTopLeft.Y := 1;

{* Read the default colors first. *}
GetConsoleScreenBufferInfo(hOutput, sbiAttributes);
wDefColors := sbiAttributes.wAttributes;
coorCurrent := sbiAttributes.dwCursorPosition;

{* Change the output color to bright cyan and move the *}
{* cursor to the top of the screen *}
SetConsoleTextAttribute(hOutput, FOREGROUND_BRCYAN);
SetConsoleCursorPosition(hOutput, coorTopLeft);

{* Write Some Stuff *}
WriteLn("This test is in cyan.");
WriteLn("As is this text.");

{* Restore the default colors *}
SetConsoleTextAttribute(hOutput, wDefColors);
SetConsoleCursorPosition(hOutput, coorCurrent);
end.


 
DarkGreen   (2003-02-04 14:04) [4]

Здесь в кладовке есть TurboVision портированный (правда криво) под Delphi. Возьми его, поправь и не мучайся


 
Tuzemec   (2003-02-11 15:30) [5]

Привет народ!
Спасибо за ответ. Как сам не догадался посмотреть в мсдн не понимаю. но в общем немножко пдолбался и написал себе модуль для консольных приложений. Кому будеть нужно - вышлю!
А теперь пока, инет нынчен не дешёвый.



Страницы: 1 вся ветка

Форум: "WinAPI";
Текущий архив: 2003.04.10;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.47 MB
Время: 0.008 c
14-30546
Oleg_Gashev
2003-03-23 23:08
2003.04.10
Frequently Unanswered Questions


3-30288
gonta
2003-03-20 15:35
2003.04.10
Мастера помогите с Fast Reportom


4-30662
Songoku
2003-02-05 15:58
2003.04.10
МАСТЕРА помогите!!! Как в EDIT поставить фон в виде рисунка!!!


1-30359
dim-
2003-03-31 01:41
2003.04.10
можно ли создать Мемо без формы?


1-30394
bIzET
2003-03-30 13:19
2003.04.10
menu





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский