You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Windows-API-examples/main/tmain_ex.c

20 lines
436 B

#define _UNICODE
#define UNICODE
#include <windows.h>
#include <tchar.h>
int _tmain(int argc, TCHAR *argv[]) {
PDWORD cChars = NULL;
HANDLE std = GetStdHandle(STD_OUTPUT_HANDLE);
if (std == INVALID_HANDLE_VALUE) {
_tprintf(L"Cannot retrieve standard output handle\n (%d)",
GetLastError());
}
WriteConsole(std, argv[1], _tcslen(argv[1]), cChars, NULL);
return EXIT_SUCCESS;
}