# Function Reference

# _WinAPI_GetStdHandle

Retrieves a handle for the standard input, standard output, or standard error device

#include <WinAPIHObj.au3>
_WinAPI_GetStdHandle ( $iStdHandle )

## Parameters

$iStdHandle | Standard device for which a handle is to be returned. This can be one of the following values: 0 - Handle to the standard input device 1 - Handle to the standard output device 2 - Handle to the standard error device

## Return Value

Success: | Handle to the specified device
Failure: | (-1), call _WinAPI_GetLastError() to get extended error information

## Remarks

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 an application does not have associated standard handles, the return value is 0.

## See Also

Search GetStdHandle in MSDN Library.