#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER
#ifndef _APISETCONSOLEL2_
#define _APISETCONSOLEL2_
#include <apiset.h>
#include <apisetcconv.h>
#include <minwindef.h>
#include <minwinbase.h>
#include <wincontypes.h>
#include <windef.h>
#ifdef __cplusplus
extern
"C"
{
#endif
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#define FOREGROUND_BLUE 0x0001 // text color contains blue.
#define FOREGROUND_GREEN 0x0002 // text color contains green.
#define FOREGROUND_RED 0x0004 // text color contains red.
#define FOREGROUND_INTENSITY 0x0008 // text color is intensified.
#define BACKGROUND_BLUE 0x0010 // background color contains blue.
#define BACKGROUND_GREEN 0x0020 // background color contains green.
#define BACKGROUND_RED 0x0040 // background color contains red.
#define BACKGROUND_INTENSITY 0x0080 // background color is intensified.
#define COMMON_LVB_LEADING_BYTE 0x0100 // Leading Byte of DBCS
#define COMMON_LVB_TRAILING_BYTE 0x0200 // Trailing Byte of DBCS
#define COMMON_LVB_GRID_HORIZONTAL 0x0400 // DBCS: Grid attribute: top horizontal.
#define COMMON_LVB_GRID_LVERTICAL 0x0800 // DBCS: Grid attribute: left vertical.
#define COMMON_LVB_GRID_RVERTICAL 0x1000 // DBCS: Grid attribute: right vertical.
#define COMMON_LVB_REVERSE_VIDEO 0x4000 // DBCS: Reverse fore/back ground attribute.
#define COMMON_LVB_UNDERSCORE 0x8000 // DBCS: Underscore.
#define COMMON_LVB_SBCSDBCS 0x0300 // SBCS or DBCS flag.
FillConsoleOutputCharacterA
(
_In_ HANDLE hConsoleOutput,
_Out_ LPDWORD lpNumberOfCharsWritten
);
FillConsoleOutputCharacterW
(
_In_ HANDLE hConsoleOutput,
_Out_ LPDWORD lpNumberOfCharsWritten
);
#ifdef UNICODE
#define FillConsoleOutputCharacter FillConsoleOutputCharacterW
#else
#define FillConsoleOutputCharacter FillConsoleOutputCharacterA
#endif // !UNICODE
FillConsoleOutputAttribute
(
_In_ HANDLE hConsoleOutput,
_Out_ LPDWORD lpNumberOfAttrsWritten
);
(
_In_ DWORD dwProcessGroupId
);
CreateConsoleScreenBuffer
(
_In_ DWORD dwDesiredAccess,
_In_opt_ CONST SECURITY_ATTRIBUTES* lpSecurityAttributes,
_Reserved_ LPVOID lpScreenBufferData
);
SetConsoleActiveScreenBuffer
(
_In_ HANDLE hConsoleOutput
);
(
_In_ HANDLE hConsoleInput
);
(
);
(
);
typedef
struct
{
;
;
}
, *
;
(
_In_ HANDLE hConsoleOutput,
_Out_ PCONSOLE_CURSOR_INFO lpConsoleCursorInfo
);
(
_In_ HANDLE hConsoleOutput,
_In_ CONST CONSOLE_CURSOR_INFO* lpConsoleCursorInfo
);
typedef
struct
_CONSOLE_SCREEN_BUFFER_INFO
{
;
;
;
;
;
}
CONSOLE_SCREEN_BUFFER_INFO
, *
PCONSOLE_SCREEN_BUFFER_INFO
;
GetConsoleScreenBufferInfo
(
_In_ HANDLE hConsoleOutput,
_Out_ PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo
PCONSOLE_SCREEN_BUFFER_INFO
lpConsoleScreenBufferInfo
);
typedef
struct
_CONSOLE_SCREEN_BUFFER_INFOEX
{
;
;
;
;
;
;
;
;
[
16
];
}
CONSOLE_SCREEN_BUFFER_INFOEX
, *
PCONSOLE_SCREEN_BUFFER_INFOEX
;
GetConsoleScreenBufferInfoEx
(
_In_ HANDLE hConsoleOutput,
_Inout_ PCONSOLE_SCREEN_BUFFER_INFOEX lpConsoleScreenBufferInfoEx
PCONSOLE_SCREEN_BUFFER_INFOEX
lpConsoleScreenBufferInfoEx
);
SetConsoleScreenBufferInfoEx
(
_In_ HANDLE hConsoleOutput,
_In_ PCONSOLE_SCREEN_BUFFER_INFOEX lpConsoleScreenBufferInfoEx
PCONSOLE_SCREEN_BUFFER_INFOEX
lpConsoleScreenBufferInfoEx
);
SetConsoleScreenBufferSize
(
_In_ HANDLE hConsoleOutput,
);
(
_In_ HANDLE hConsoleOutput,
_In_ COORD dwCursorPosition
);
GetLargestConsoleWindowSize
(
_In_ HANDLE hConsoleOutput
);
(
_In_ HANDLE hConsoleOutput,
);
(
_In_ HANDLE hConsoleOutput,
_In_ CONST SMALL_RECT* lpConsoleWindow
);
WriteConsoleOutputCharacterA
(
_In_ HANDLE hConsoleOutput,
_In_reads_(nLength) LPCSTR lpCharacter,
_Out_ LPDWORD lpNumberOfCharsWritten
);
WriteConsoleOutputCharacterW
(
_In_ HANDLE hConsoleOutput,
_In_reads_(nLength) LPCWSTR lpCharacter,
_Out_ LPDWORD lpNumberOfCharsWritten
);
#ifdef UNICODE
#define WriteConsoleOutputCharacter WriteConsoleOutputCharacterW
#else
#define WriteConsoleOutputCharacter WriteConsoleOutputCharacterA
#endif // !UNICODE
WriteConsoleOutputAttribute
(
_In_ HANDLE hConsoleOutput,
_In_reads_(nLength) CONST WORD* lpAttribute,
_Out_ LPDWORD lpNumberOfAttrsWritten
);
ReadConsoleOutputCharacterA
(
_In_ HANDLE hConsoleOutput,
_Out_writes_(nLength) LPSTR lpCharacter,
_Out_ LPDWORD lpNumberOfCharsRead
);
ReadConsoleOutputCharacterW
(
_In_ HANDLE hConsoleOutput,
_Out_writes_(nLength) LPWSTR lpCharacter,
_Out_ LPDWORD lpNumberOfCharsRead
);
#ifdef UNICODE
#define ReadConsoleOutputCharacter ReadConsoleOutputCharacterW
#else
#define ReadConsoleOutputCharacter ReadConsoleOutputCharacterA
#endif // !UNICODE
ReadConsoleOutputAttribute
(
_In_ HANDLE hConsoleOutput,
_Out_writes_(nLength) LPWORD lpAttribute,
_Out_ LPDWORD lpNumberOfAttrsRead
);
(
_In_ HANDLE hConsoleInput,
_In_reads_(nLength) CONST INPUT_RECORD* lpBuffer,
_Out_ LPDWORD lpNumberOfEventsWritten
);
(
_In_ HANDLE hConsoleInput,
_In_reads_(nLength) CONST INPUT_RECORD* lpBuffer,
_Out_ LPDWORD lpNumberOfEventsWritten
);
#ifdef UNICODE
#define WriteConsoleInput WriteConsoleInputW
#else
#define WriteConsoleInput WriteConsoleInputA
#endif // !UNICODE
(
_In_ HANDLE hConsoleOutput,
_In_ CONST SMALL_RECT* lpScrollRectangle,
_In_opt_ CONST SMALL_RECT* lpClipRectangle,
_In_ COORD dwDestinationOrigin,
_In_ CONST CHAR_INFO* lpFill
);
(
_In_ HANDLE hConsoleOutput,
_In_ CONST SMALL_RECT* lpScrollRectangle,
_In_opt_ CONST SMALL_RECT* lpClipRectangle,
_In_ COORD dwDestinationOrigin,
_In_ CONST CHAR_INFO* lpFill
);
#ifdef UNICODE
#define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferW
#else
#define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferA
#endif // !UNICODE
(
_In_ HANDLE hConsoleOutput,
_In_reads_(dwBufferSize.X * dwBufferSize.Y) CONST CHAR_INFO* lpBuffer,
_In_ COORD dwBufferCoord,
_Inout_ PSMALL_RECT lpWriteRegion
);
(
_In_ HANDLE hConsoleOutput,
_In_reads_(dwBufferSize.X * dwBufferSize.Y) CONST CHAR_INFO* lpBuffer,
_In_ COORD dwBufferCoord,
_Inout_ PSMALL_RECT lpWriteRegion
);
#ifdef UNICODE
#define WriteConsoleOutput WriteConsoleOutputW
#else
#define WriteConsoleOutput WriteConsoleOutputA
#endif // !UNICODE
(
_In_ HANDLE hConsoleOutput,
_Out_writes_(dwBufferSize.X * dwBufferSize.Y) PCHAR_INFO lpBuffer,
_In_ COORD dwBufferCoord,
_Inout_ PSMALL_RECT lpReadRegion
);
(
_In_ HANDLE hConsoleOutput,
_Out_writes_(dwBufferSize.X * dwBufferSize.Y) PCHAR_INFO lpBuffer,
_In_ COORD dwBufferCoord,
_Inout_ PSMALL_RECT lpReadRegion
);
#ifdef UNICODE
#define ReadConsoleOutput ReadConsoleOutputW
#else
#define ReadConsoleOutput ReadConsoleOutputA
#endif // !UNICODE
(
_Out_writes_(nSize) LPSTR lpConsoleTitle,
);
(
_Out_writes_(nSize) LPWSTR lpConsoleTitle,
);
#ifdef UNICODE
#define GetConsoleTitle GetConsoleTitleW
#else
#define GetConsoleTitle GetConsoleTitleA
#endif // !UNICODE
#if (_WIN32_WINNT >= 0x0600)
(
_Out_writes_(nSize) LPSTR lpConsoleTitle,
);
(
_Out_writes_(nSize) LPWSTR lpConsoleTitle,
);
#ifdef UNICODE
#define GetConsoleOriginalTitle GetConsoleOriginalTitleW
#else
#define GetConsoleOriginalTitle GetConsoleOriginalTitleA
#endif // !UNICODE
#endif /* _WIN32_WINNT >= 0x0600 */
(
_In_ LPCSTR lpConsoleTitle
);
(
_In_ LPCWSTR lpConsoleTitle
);
#ifdef UNICODE
#define SetConsoleTitle SetConsoleTitleW
#else
#define SetConsoleTitle SetConsoleTitleA
#endif // !UNICODE
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#ifdef __cplusplus
}
#endif
#endif // _APISETCONSOLEL2_