mirror of
https://github.com/janbodnar/Windows-API-examples.git
synced 2024-11-14 15:55:30 +00:00
Create tmain_ex.c
This commit is contained in:
parent
937a293c4a
commit
25ab401d45
20
main/tmain_ex.c
Normal file
20
main/tmain_ex.c
Normal file
@ -0,0 +1,20 @@
|
||||
#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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user