public static extern int ReadConsoleOutputCharacter(HANDLE hConsoleOutput, string lpCharacter, int nLength, COORD dwReadCoord, ref int lpNumberOfCharsRead);
public void SetCharByte(int x, int y, byte ch) { var ar = new byte[] { (byte)ch }; var coord = new COORD() { X = (short)x, Y = (short)y }; UInt32 dw; Api.Win32Check(Api.WriteConsoleOutputCharacterA(Handle, ar, 1, coord, out dw)); }
public static extern int ReadConsoleOutputAttribute(HANDLE hConsoleOutput, ref int lpAttribute, int nLength, COORD dwReadCoord, ref int lpNumberOfAttrsRead);
public static extern bool SetConsoleCursorPosition(SafeHandle h, COORD coord);
public void SetChar(int x, int y, char ch) { var ar = new char[] { ch }; var coord = new COORD() { X = (short)x, Y = (short)y }; UInt32 dw; Api.Win32Check(Api.WriteConsoleOutputCharacter(Handle, ar, 1, coord, out dw)); }
public static extern int SetConsoleScreenBufferSize(HANDLE hConsoleOutput, COORD dwSize);
public static extern int WriteConsoleOutputAttribute(HANDLE hConsoleOutput, short lpAttribute, int nLength, COORD dwWriteCoord, ref int lpNumberOfAttrsWritten);
public static extern bool WriteConsoleOutputAttribute(SafeHandle h, UInt16[] buf, UInt32 nLength, COORD coord, out DWORD dwRead);
public UInt16 GetAttr(int x, int y) { var ar = new UInt16[1]; var coord = new COORD() { X = (short)x, Y = (short)y }; UInt32 dw; Api.Win32Check(Api.ReadConsoleOutputAttribute(Handle, ar, 1, coord, out dw)); return ar[0]; }
public static extern bool ReadConsoleOutputCharacterA(SafeHandle h, byte[] buf, UInt32 nLength, COORD coord, out DWORD dwRead);
public static extern bool WriteConsoleOutputCharacter(SafeHandle h, char[] buf, UInt32 nLength, COORD coord, out DWORD dwRead);
public static extern bool SetConsoleCursorPosition(SafeHandle h, COORD coord);
public static extern bool WriteConsoleOutputCharacterA(SafeHandle h, byte[] buf, UInt32 nLength, COORD coord, out DWORD dwRead);
public static extern bool WriteConsoleOutputAttribute(SafeHandle h, UInt16[] buf, UInt32 nLength, COORD coord, out DWORD dwRead);
public static extern int ScrollConsoleScreenBuffer(HANDLE hConsoleOutput, ref SMALL_RECT lpScrollRectangle, ref SMALL_RECT lpClipRectangle, COORD dwDestinationOrigin, ref CHAR_INFO lpFill);
public byte GetCharByte(int x, int y) { var ar = new byte[1]; var coord = new COORD() { X = (short)x, Y = (short)y }; UInt32 dw; Api.Win32Check(Api.ReadConsoleOutputCharacterA(Handle, ar, 1, coord, out dw)); return ar[0]; }
public static extern int SetConsoleCursorPosition(HANDLE hConsoleOutput, COORD dwCursorPosition);
public void Scroll(Rectangle rect, Rectangle? clip, Point origin, CHAR_INFO fill) { var r = new SMALL_RECT() { Left = (short)rect.Left, Top = (short)rect.Top, Right = (short)rect.Right, Bottom = (short)rect.Bottom }; var d = new COORD() { X = (short)origin.X, Y = (short)(origin.Y) //!!! }; Api.Win32Check(Api.ScrollConsoleScreenBuffer(Handle, ref r , IntPtr.Zero, d.ToInt32(), ref fill)); }
public static extern int WriteConsoleOutput(HANDLE hConsoleOutput, ref CHAR_INFO lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, ref SMALL_RECT lpWriteRegion);
public void SetAttr(int x, int y, UInt16 attr) { var ar = new UInt16[] { attr }; var coord = new COORD() { X = (short)x, Y = (short)y }; UInt32 dw; Api.Win32Check(Api.WriteConsoleOutputAttribute(Handle, ar, 1, coord, out dw)); }
public static extern int WriteConsoleOutputCharacter(HANDLE hConsoleOutput, string lpCharacter, int nLength, COORD dwWriteCoord, ref int lpNumberOfCharsWritten);
public static extern bool ReadConsoleOutputCharacter(SafeHandle h, char[] buf, UInt32 nLength, COORD coord, out DWORD dwRead);