Kernel32GetStdHandle Method
Retrieves a handle to the specified standard device (standard input, standard output, or standard error).
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", SetLastError = true)]
public static IntPtr GetStdHandle(
StandardDevice std
)
<DllImportAttribute("Kernel32.dll", SetLastError := true>]
Public Shared Function GetStdHandle (
std As StandardDevice
) As IntPtr
Dim std As StandardDevice
Dim returnValue As IntPtr
returnValue = Kernel32.GetStdHandle(std)
public:
[DllImportAttribute(L"Kernel32.dll", SetLastError = true)]
static IntPtr GetStdHandle(
StandardDevice std
)
[<DllImportAttribute("Kernel32.dll", SetLastError = true)>]
static member GetStdHandle :
std : StandardDevice -> IntPtr
No code example is currently available or this language may not be supported.
- std StandardDevice
-
A handle to the standard device.
IntPtr
If the function succeeds, the return value is a handle to the specified device,
or a redirected handle set by a previous call to SetStdHandle.
The handle has
GENERIC_READ and
GENERIC_WRITE access rights,
unless the application has used SetStdHandle to set a standard handle with lesser access.
If the function fails, the return value is
INVALID_HANDLE_VALUE (
New IntPtr(-1) ).
To get extended error information, call
GetLastWin32Error.
If an application does not have associated standard handles,
such as a service running on an interactive desktop, and has not redirected them,
the return value is
Zero.