What is the method of using GetStdHandle function in C language?
Today, I will talk to you about how to use the GetStdHandle function in C language. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
The interface of the function HANDLE WINAPI GetStdHandle (_ In_ DWORD nStdHandle); / / WINAPI is not the type of return value, but HANDLE is, and WINAPI is the system call convention.
This function is used to get a handle to the specified standard device (standard input, standard output, or standard error).
Parameters.
NStdHandle
Standard handle. This parameter can be one of the following values.
Value meaning
STD_INPUT_HANDLE
Handle to standard input
STD_OUTPUT_HANDLE
Handle to standard output
STD_ERROR_HANDLE
Handle to standard error
Header file Windows.h
Return value
If the function succeeds, the return value is the handle to the specified device or the redirect handle set by the previous call
If the function fails, the return value is an invalid handle value. To get the extension error message, call the GetLastError function
After reading the above, do you have any further understanding of the use of GetStdHandle functions in C language? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.