File Index Symbol Index

// begin_consoleapi_h
/******************************************************************************** * * * consoleapi.h -- ApiSet Contract for api-ms-win-core-console-l1 * * * * Copyright (c) Microsoft Corporation. All rights reserved. * * * ********************************************************************************/
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER
#ifndef _APISETCONSOLE_
#define _APISETCONSOLE_
#include <apiset.h>
#include <apisetcconv.h>
#include <minwindef.h>
#include <minwinbase.h>
#include <wincontypes.h>
#ifdef __cplusplus
extern
"C"
{
#endif
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
BOOL
AllocConsole
( );
BOOL
FreeConsole
( );
#if (_WIN32_WINNT >= 0x0500)
BOOL
AttachConsole
( );
#define ATTACH_PARENT_PROCESS ((DWORD)-1)
#endif /* _WIN32_WINNT >= 0x0500 */
UINT
GetConsoleCP
( );
UINT
GetConsoleOutputCP
( );
//
// Input Mode flags:
//
#define ENABLE_PROCESSED_INPUT 0x0001
#define ENABLE_LINE_INPUT 0x0002
#define ENABLE_ECHO_INPUT 0x0004
#define ENABLE_WINDOW_INPUT 0x0008
#define ENABLE_MOUSE_INPUT 0x0010
#define ENABLE_INSERT_MODE 0x0020
#define ENABLE_QUICK_EDIT_MODE 0x0040
#define ENABLE_EXTENDED_FLAGS 0x0080
#define ENABLE_AUTO_POSITION 0x0100
#define ENABLE_VIRTUAL_TERMINAL_INPUT 0x0200
//
// Output Mode flags:
//
#define ENABLE_PROCESSED_OUTPUT 0x0001
#define ENABLE_WRAP_AT_EOL_OUTPUT 0x0002
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#define DISABLE_NEWLINE_AUTO_RETURN 0x0008
#define ENABLE_LVB_GRID_WORLDWIDE 0x0010
BOOL
GetConsoleMode
( );
BOOL
SetConsoleMode
( );
BOOL
GetNumberOfConsoleInputEvents
( );
_Success_(return != FALSE)
BOOL
ReadConsoleInputA
( );
_Success_(return != FALSE)
BOOL
ReadConsoleInputW
( );
#ifdef UNICODE
#define ReadConsoleInput ReadConsoleInputW
#else
#define ReadConsoleInput ReadConsoleInputA #endif // !UNICODE
// end_consoleapi_h
#ifndef UNICODE
#define PeekConsoleInput PeekConsoleInputA
#endif
// begin_consoleapi_h
BOOL
PeekConsoleInputA
( );
BOOL
PeekConsoleInputW
( );
#ifdef UNICODE
#define PeekConsoleInput PeekConsoleInputW
#else
#define PeekConsoleInput PeekConsoleInputA #endif // !UNICODE
typedef
struct
_CONSOLE_READCONSOLE_CONTROL
{
ULONG
nLength
;
ULONG
nInitialChars
;
ULONG
dwCtrlWakeupMask
;
ULONG
dwControlKeyState
; }
CONSOLE_READCONSOLE_CONTROL
, *
PCONSOLE_READCONSOLE_CONTROL
;
_Success_(return != FALSE)
BOOL
ReadConsoleA
( );
_Success_(return != FALSE)
BOOL
ReadConsoleW
( );
#ifdef UNICODE
#define ReadConsole ReadConsoleW
#else
#define ReadConsole ReadConsoleA #endif // !UNICODE
BOOL
WriteConsoleA
( );
BOOL
WriteConsoleW
( );
#ifdef UNICODE
#define WriteConsole WriteConsoleW
#else
#define WriteConsole WriteConsoleA #endif // !UNICODE
//
// Ctrl Event flags
//
#define CTRL_C_EVENT 0
#define CTRL_BREAK_EVENT 1
#define CTRL_CLOSE_EVENT 2
// 3 is reserved!
// 4 is reserved!
#define CTRL_LOGOFF_EVENT 5
#define CTRL_SHUTDOWN_EVENT 6
//
// typedef for ctrl-c handler routines
//
typedef
BOOL
);
BOOL
SetConsoleCtrlHandler
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#if (NTDDI_VERSION >= NTDDI_WIN10_RS5)
// CreatePseudoConsole Flags
#define PSEUDOCONSOLE_INHERIT_CURSOR (0x1)
HRESULT
CreatePseudoConsole
( );
HRESULT
ResizePseudoConsole
( );
ClosePseudoConsole
( );
#endif
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#ifdef __cplusplus
}
#endif
#endif // _APISETCONSOLE_
// end_consoleapi_h