Windows-API-examples/main/win_console.c
2016-01-31 13:49:30 +01:00

18 lines
400 B
C

#include <windows.h>
#include <wchar.h>
int wmain(int argc, wchar_t **argv) {
PDWORD cChars = NULL;
HANDLE std = GetStdHandle(STD_OUTPUT_HANDLE);
if (std == INVALID_HANDLE_VALUE) {
wprintf(L"Cannot retrieve standard output handle\n (%d)",
GetLastError());
}
WriteConsoleW(std, argv[1], wcslen(argv[1]), cChars, NULL);
return EXIT_SUCCESS;
}