1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
[DllImport("kernel32.dll", EntryPoint = "GetStdHandle", SetLastError = true, CharSet = CharSet.Unicode)]
extern static IntPtr GetStdHandle(Handles handle);
[DllImport("kernel32.dll", EntryPoint = "SetConsoleScreenBufferSize", SetLastError = true, CharSet = CharSet.Unicode)]
extern static bool SetConsoleScreenBufferSize(IntPtr handle, Coord newSize);
[DllImport("kernel32.dll", EntryPoint = "SetConsoleWindowInfo", SetLastError = true, CharSet = CharSet.Unicode)]
extern static bool SetConsoleWindowInfo(IntPtr handle, bool absolute, ref SmallRect rect);
private static void EcranConsole()
{
Console.Clear();
Console.Title = "ConsoleTest : db4oClassLibrarySample";
Coord coord = new Coord(0,0);
SetConsoleScreenBufferSize(GetStdHandle(Handles.STD_OUTPUT), coord);
SmallRect rect = new SmallRect(0, 0, Console.LargestWindowWidth - 1, Console.LargestWindowHeight - 1);
SetConsoleWindowInfo(GetStdHandle(Handles.STD_OUTPUT), true, ref rect);
Console.SetWindowPosition(0, 0);
Console.SetWindowSize(Console.LargestWindowWidth, Console.LargestWindowHeight);
}
|
Partager