GetStdHandle
GetStdHandle is a Windows API function that retrieves a handle to one of the process’s standard devices: input, output, or error. It is declared in Windows.h and implemented in kernel32.dll. The function is commonly used in low-level Windows I/O scenarios to obtain a handle that can be used with native I/O functions or console APIs.
The parameter nStdHandle selects which device to return. It accepts STD_INPUT_HANDLE (-10), STD_OUTPUT_HANDLE (-11), or STD_ERROR_HANDLE
Usage considerations include checking the return value before using the handle and recognizing that pseudo handles