Edit

Share via


SetStdHandleEx function (processenv.h)

Sets the handle for the input, output, or error streams.

Syntax

BOOL SetStdHandleEx(
  DWORD   nStdHandle,
  HANDLE  hHandle,
  PHANDLE phPrevValue
);

Parameters

nStdHandle

A DWORD indicating the stream for which the handle is being set.

hHandle

The handle.

phPrevValue

Optional. Receives the previous handle.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Header processenv.h
Library kernel32.Lib