getstdhandle (kernel32)
Last changed: -67.183.23.82

.
Summary

C# Signature:

[DllImport("kernel32.dll", SetLastError = true)]
static extern IntPtr GetStdHandle(int nStdHandle);

VB Signature:

Declare Function GetStdHandle Lib "kernel32.dll" (ByVal nStdHandle As Integer) As IntPtr

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

//C#: Get stdout handle

const int STD_OUTPUT_HANDLE = -11;

IntPtr iStdOut = GetStdHandle( STD_OUTPUT_HANDLE );

Other constants:

const int STD_INPUT_HANDLE = -10;

const int STD_ERROR_HANDLE = -12;

INVALID_HANDLE_VALUE (return value if invalid handle is specified)

Alternative Managed API:

Do you know one? Please contribute it!

Documentation