diff --git a/main/tmain_ex.c b/main/tmain_ex.c new file mode 100644 index 0000000..84e8313 --- /dev/null +++ b/main/tmain_ex.c @@ -0,0 +1,20 @@ +#define _UNICODE +#define UNICODE + +#include +#include + +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; +}