mirror of
https://github.com/janbodnar/Windows-API-examples.git
synced 2026-07-14 10:12:48 -04:00
Update win_console.c
This commit is contained in:
parent
17a4da48d8
commit
937a293c4a
@ -1 +1,17 @@
|
||||
#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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user