[DllImport("kernel32.dll")]
static extern bool WriteConsole(IntPtr hConsoleOutput, string lpBuffer,
uint nNumberOfCharsToWrite, out uint lpNumberOfCharsWritten,
IntPtr lpReserved);
None.
Public Declare Function WriteConsole Lib "kernel32" Alias "WriteConsoleA" (ByVal hConsoleOutput As Long, ByVal lpBuffer As String, ByVal nNumberOfCharsToWrite As Long, ByVal lpNumberOfCharsWritten As Long, ByVal lpReserved As IntPtr) As Long
None.
None.
Please add some!
public static IntPtr GetStdOut ()
{
const int STD_OUTPUT_HANDLE = -11;
IntPtr iStdOut = GetStdHandle( STD_OUTPUT_HANDLE );
return iStdOut;
}
public static short WriteConsoleLine ( string sLine )
{
short cchWritten;
if ( ! WriteConsole( GetStdOut(),
sLine,
(short) sLine.Length,
out cchWritten,
(IntPtr) 0 ) )
return -1;
return cchWritten;
}
Console.WriteLine()