SetStdHandle

  BOOL SetStdHandle( IDStdHandle, hHandle)    
  DWORD IDStdHandle; /* specifies input, output, or error device */
  HANDLE hHandle; /* handle to be a standard handle */

The SetStdHandle function is used to set the handle for the standard input, standard output, or standard error device. This cause the specified handle to be used for input or output when an application uses the redirected standard device.

Parameters

IDStdHandle

Specifies the handle to be set. This parameter can have one of the following values:

Value Handle

STD_INPUT_HANDLE  
  The standard input handle.
STD_OUTPUT_HANDLE  
  The standard output handle.
STD_ERROR_HANDLE  
  The standard error handle.

hHandle

Supplies the handle to store as standard input standard output or standard error.

Return Value

The return value is TRUE if the function was successful, or FALSE if an error occurred. To obtain extended error information, use the GetLastError function.

See Also

GetStdHandle