From 25ab401d45e8f72a12ba9de062a01924a7341f82 Mon Sep 17 00:00:00 2001 From: janbodnar Date: Sun, 31 Jan 2016 13:50:47 +0100 Subject: [PATCH] Create tmain_ex.c --- main/tmain_ex.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 main/tmain_ex.c 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; +}