mirror of
https://github.com/janbodnar/Windows-API-examples.git
synced 2024-11-24 11:25:30 +00:00
26 lines
486 B
C
26 lines
486 B
C
#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());
|
|
}
|
|
|
|
if (argv[1]) {
|
|
|
|
WriteConsole(std, argv[1], _tcslen(argv[1]), cChars, NULL);
|
|
}
|
|
|
|
CloseHandle(std);
|
|
|
|
return 0;
|
|
}
|