[DllImport("kernel32.dll")]
static extern bool WriteConsole(IntPtr hConsoleOutput, string lpBuffer,
uint nNumberOfCharsToWrite, out uint lpNumberOfCharsWritten,
IntPtr lpReserved);
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;
}
Do you know one? Please contribute it!