@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: This function allows to set the font dimensions on consoles. !!!!C# Signature: [DllImport("kernel32.dll", SetLastError = true)] static extern bool SetCurrentConsoleFontEx( IntPtr ConsoleOutput, bool MaximumWindow, CONSOLE_FONT_INFO_EX ConsoleCurrentFontEx ); !!!!VB Signature: <DllImport("kernel32.dll")> Public Shared Function SetCurrentConsoleFontEx(ConsoleOutput As IntPtr, MaximumWindow As Boolean, ConsoleCurrentFontEx As CONSOLE_FONT_INFO_EX) As Boolean End Function !!!!User-Defined Types: [StructLayout(LayoutKind.Sequential)] public struct COORD { public short X; public short Y; public COORD(short X, short Y) { this.X = X; this.Y = Y; } }; [StructLayout(LayoutKind.Sequential)] public struct CONSOLE_FONT_INFO_EX { public uint cbSize; public uint nFont; public COORD dwFontSize; public ushort FontFamily; public ushort FontWeight; fixed char FaceName[32]; // this will require the assembly to be unsafe } Or alternatively if you can't afford unsafe assemblies [StructLayout(LayoutKind.Sequential)] public struct CONSOLE_FONT_INFO_EX { public uint cbSize; public uint nFont; public COORD dwFontSize; public ushort FontFamily; public ushort FontWeight; UInt64 face0, face1, face2, face3, face4, face5, face6, face7; } <StructLayout(LayoutKind.Sequential)> Public Structure COORD Public X As Short Public Y As Short Public Sub New(X As Short, Y As Short) Me.X = X Me.Y = Y End Sub End Structure <StructLayout(LayoutKind.Sequential)> Public Structure CONSOLE_FONT_INFO_EX Public cbSize As UInteger Public nFont As UInteger Public dwFontSize As COORD Public FontFamily As UShort Public FontWeight As UShort Public face0, face1, face2, face3, face4, face5, face6, face7 As UInt64 End Structure !!!!Alternative Managed API: Do you know one? Please contribute it! !!!!Notes: // Untested, added during 1-pass copy & paste of windows console fuctions When on Windows XP, kernel32 does NOT support SetCurrentConsoleFontEx and cannot be used. It will throw an error saying entry point not found because of this. Minimum supported client: Windows Vista !!!!Tips & Tricks: Please add some! !!!!Sample Code: Please add some! Documentation: SetCurrentConsoleFontEx@msdn on MSDN
Edit kernel32.SetCurre...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.