Показать сообщение отдельно
  #3  
Старый 08.11.2005, 14:21
Аватар для Admin
Admin Admin вне форума
Администратор
 
Регистрация: 03.10.2005
Адрес: Россия, Москва
Сообщения: 1,551
Версия Delphi: Delphi 7
Репутация: выкл
По умолчанию

Цитата:
Сообщение от Aristarh Dark
А приложение твое или чужое?

Приложение чужое...
Есть код на С - из МСДН: "Reading and Writing Blocks of Characters and Attributes"

Код:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include <windows.h>
  
VOID main(void)
{
    HANDLE hStdout, hNewScreenBuffer;
    SMALL_RECT srctReadRect;
    SMALL_RECT srctWriteRect;
    CHAR_INFO chiBuffer[160]; // [2][80];
    COORD coordBufSize;
    COORD coordBufCoord;
    BOOL fSuccess;
  
    // Get a handle to the STDOUT screen buffer to copy from and
    // create a new screen buffer to copy to.
  
    hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
    hNewScreenBuffer = CreateConsoleScreenBuffer(
       GENERIC_READ |           // read-write access
       GENERIC_WRITE,
       0,                       // not shared
       NULL,                    // no security attributes
       CONSOLE_TEXTMODE_BUFFER, // must be TEXTMODE
       NULL);                   // reserved; must be NULL
    if (hStdout == INVALID_HANDLE_VALUE ||
            hNewScreenBuffer == INVALID_HANDLE_VALUE)
    {
        MyErrorExit("CreateConsoleScreenBuffer");
    }
  
    // Make the new screen buffer the active screen buffer.
  
    if (! SetConsoleActiveScreenBuffer(hNewScreenBuffer) )
        MyErrorExit("SetConsoleActiveScreenBuffer");
  
    // Set the source rectangle.
  
    srctReadRect.Top = 0;    // top left: row 0, col 0
    srctReadRect.Left = 0;
    srctReadRect.Bottom = 1; // bot. right: row 1, col 79
    srctReadRect.Right = 79;
  
    // The temporary buffer size is 2 rows x 80 columns.
  
    coordBufSize.Y = 2;
    coordBufSize.X = 80;
  
    // The top left destination cell of the temporary buffer is
    // row 0, col 0.
  
    coordBufCoord.X = 0;
    coordBufCoord.Y = 0;
  
    // Copy the block from the screen buffer to the temp. buffer.
  
    fSuccess = ReadConsoleOutput(
       hStdout,        // screen buffer to read from
       chiBuffer,      // buffer to copy into
       coordBufSize,   // col-row size of chiBuffer
       coordBufCoord,  // top left dest. cell in chiBuffer
       &srctReadRect); // screen buffer source rectangle
    if (! fSuccess)
        MyErrorExit("ReadConsoleOutput");
  
    // Set the destination rectangle.
  
    srctWriteRect.Top = 10;    // top lt: row 10, col 0
    srctWriteRect.Left = 0;
    srctWriteRect.Bottom = 11; // bot. rt: row 11, col 79
    srctWriteRect.Right = 79;
  
    // Copy from the temporary buffer to the new screen buffer.
  
    fSuccess = WriteConsoleOutput(
        hNewScreenBuffer, // screen buffer to write to
        chiBuffer,        // buffer to copy from
        coordBufSize,     // col-row size of chiBuffer
        coordBufCoord,    // top left src cell in chiBuffer
        &srctWriteRect);  // dest. screen buffer rectangle
    if (! fSuccess)
        MyErrorExit("WriteConsoleOutput");
    Sleep(10000);
  
    // Restore the original active screen buffer.
  
    if (! SetConsoleActiveScreenBuffer(hStdout))
        MyErrorExit("SetConsoleActiveScreenBuffer");
  
}

Вот если быего на паскаль, и то не уверен, что он делает то что нужно.
Ответить с цитированием