1c2c66affSColin Finck #ifndef _WINCON_H 2c2c66affSColin Finck #define _WINCON_H 3c2c66affSColin Finck 4c2c66affSColin Finck #ifdef __cplusplus 5c2c66affSColin Finck extern "C" { 6c2c66affSColin Finck #endif 7c2c66affSColin Finck 8b4e40f21SHermès Bélusca-Maïto #if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) && !defined(NOGDI) 9c2c66affSColin Finck # include "wingdi.h" 10c2c66affSColin Finck #endif 11c2c66affSColin Finck 12c2c66affSColin Finck #ifdef _MSC_VER 13c2c66affSColin Finck #pragma warning(push) 14c2c66affSColin Finck #pragma warning(disable:4820) 15c2c66affSColin Finck #endif 16c2c66affSColin Finck 17c2c66affSColin Finck /* 18c2c66affSColin Finck * Special PID for parent process for AttachConsole API 19c2c66affSColin Finck */ 20b4e40f21SHermès Bélusca-Maïto #if (_WIN32_WINNT >= _WIN32_WINNT_WINXP) 21c2c66affSColin Finck #define ATTACH_PARENT_PROCESS ((DWORD)-1) 22c2c66affSColin Finck #endif 23c2c66affSColin Finck 24c2c66affSColin Finck /* 25c2c66affSColin Finck * Console display modes 26c2c66affSColin Finck */ 27c2c66affSColin Finck // These codes are answered by GetConsoleDisplayMode 28c2c66affSColin Finck #define CONSOLE_WINDOWED 0 29c2c66affSColin Finck #define CONSOLE_FULLSCREEN 1 30c2c66affSColin Finck #define CONSOLE_FULLSCREEN_HARDWARE 2 31c2c66affSColin Finck 32c2c66affSColin Finck // These codes should be given to SetConsoleDisplayMode 33c2c66affSColin Finck #define CONSOLE_FULLSCREEN_MODE 1 34c2c66affSColin Finck #define CONSOLE_WINDOWED_MODE 2 35c2c66affSColin Finck 36c2c66affSColin Finck /* 37c2c66affSColin Finck * Color attributes for text and screen background 38c2c66affSColin Finck */ 39c2c66affSColin Finck #define FOREGROUND_BLUE 0x0001 40c2c66affSColin Finck #define FOREGROUND_GREEN 0x0002 41c2c66affSColin Finck #define FOREGROUND_RED 0x0004 42c2c66affSColin Finck #define FOREGROUND_INTENSITY 0x0008 43c2c66affSColin Finck #define BACKGROUND_BLUE 0x0010 44c2c66affSColin Finck #define BACKGROUND_GREEN 0x0020 45c2c66affSColin Finck #define BACKGROUND_RED 0x0040 46c2c66affSColin Finck #define BACKGROUND_INTENSITY 0x0080 47c2c66affSColin Finck 48b4e40f21SHermès Bélusca-Maïto #define COMMON_LVB_LEADING_BYTE 0x0100 /* DBCS Leading Byte */ 49b4e40f21SHermès Bélusca-Maïto #define COMMON_LVB_TRAILING_BYTE 0x0200 /* DBCS Trailing Byte */ 50b4e40f21SHermès Bélusca-Maïto #define COMMON_LVB_GRID_HORIZONTAL 0x0400 /* Grid attribute: Top Horizontal */ 51b4e40f21SHermès Bélusca-Maïto #define COMMON_LVB_GRID_LVERTICAL 0x0800 /* Grid attribute: Left Vertical */ 52b4e40f21SHermès Bélusca-Maïto #define COMMON_LVB_GRID_RVERTICAL 0x1000 /* Grid attribute: Right Vertical */ 53b4e40f21SHermès Bélusca-Maïto #define COMMON_LVB_REVERSE_VIDEO 0x4000 /* Reverse fore/back ground attribute */ 54b4e40f21SHermès Bélusca-Maïto #define COMMON_LVB_UNDERSCORE 0x8000 /* Underscore */ 55b4e40f21SHermès Bélusca-Maïto 56b4e40f21SHermès Bélusca-Maïto #define COMMON_LVB_SBCSDBCS \ 57b4e40f21SHermès Bélusca-Maïto (COMMON_LVB_LEADING_BYTE | COMMON_LVB_TRAILING_BYTE) /* == 0x0300 */ 58c2c66affSColin Finck 59c2c66affSColin Finck /* 60c2c66affSColin Finck * Screen buffer types 61c2c66affSColin Finck */ 62c2c66affSColin Finck #define CONSOLE_TEXTMODE_BUFFER 1 63c2c66affSColin Finck #define CONSOLE_GRAPHICS_BUFFER 2 /* Undocumented, see http://blog.airesoft.co.uk/2012/10/things-ms-can-do-that-they-dont-tell-you-about-console-graphics/ */ 64c2c66affSColin Finck 65c2c66affSColin Finck /* 66c2c66affSColin Finck * Control handler codes 67c2c66affSColin Finck */ 68c2c66affSColin Finck #define CTRL_C_EVENT 0 69c2c66affSColin Finck #define CTRL_BREAK_EVENT 1 70c2c66affSColin Finck #define CTRL_CLOSE_EVENT 2 71c2c66affSColin Finck #define CTRL_LAST_CLOSE_EVENT 3 /* Undocumented */ 72c2c66affSColin Finck #define CTRL_LOGOFF_EVENT 5 73c2c66affSColin Finck #define CTRL_SHUTDOWN_EVENT 6 74c2c66affSColin Finck 75c2c66affSColin Finck /* 76c2c66affSColin Finck * Input mode flags 77c2c66affSColin Finck */ 78c2c66affSColin Finck #define ENABLE_PROCESSED_INPUT 0x0001 79c2c66affSColin Finck #define ENABLE_LINE_INPUT 0x0002 80c2c66affSColin Finck #define ENABLE_ECHO_INPUT 0x0004 81c2c66affSColin Finck #define ENABLE_WINDOW_INPUT 0x0008 82c2c66affSColin Finck #define ENABLE_MOUSE_INPUT 0x0010 83c2c66affSColin Finck #define ENABLE_INSERT_MODE 0x0020 84c2c66affSColin Finck #define ENABLE_QUICK_EDIT_MODE 0x0040 85c2c66affSColin Finck #define ENABLE_EXTENDED_FLAGS 0x0080 86b4e40f21SHermès Bélusca-Maïto #if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) 87c2c66affSColin Finck #define ENABLE_AUTO_POSITION 0x0100 88c2c66affSColin Finck #endif 89b4e40f21SHermès Bélusca-Maïto #if (_WIN32_WINNT >= _WIN32_WINNT_WIN10) 90b4e40f21SHermès Bélusca-Maïto #define ENABLE_VIRTUAL_TERMINAL_INPUT 0x0200 91b4e40f21SHermès Bélusca-Maïto #endif 92c2c66affSColin Finck 93c2c66affSColin Finck /* 94c2c66affSColin Finck * Output mode flags 95c2c66affSColin Finck */ 96c2c66affSColin Finck #define ENABLE_PROCESSED_OUTPUT 0x0001 97c2c66affSColin Finck #define ENABLE_WRAP_AT_EOL_OUTPUT 0x0002 98c2c66affSColin Finck 99c2c66affSColin Finck /* 100c2c66affSColin Finck * Console selection flags 101c2c66affSColin Finck */ 102c2c66affSColin Finck #define CONSOLE_NO_SELECTION 0x0000 103c2c66affSColin Finck #define CONSOLE_SELECTION_IN_PROGRESS 0x0001 104c2c66affSColin Finck #define CONSOLE_SELECTION_NOT_EMPTY 0x0002 105c2c66affSColin Finck #define CONSOLE_MOUSE_SELECTION 0x0004 106c2c66affSColin Finck #define CONSOLE_MOUSE_DOWN 0x0008 107c2c66affSColin Finck 108c2c66affSColin Finck /* 109c2c66affSColin Finck * History information and mode flags 110c2c66affSColin Finck */ 111b4e40f21SHermès Bélusca-Maïto #if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) 112c2c66affSColin Finck // For Get/SetConsoleHistoryInfo 113c2c66affSColin Finck #define HISTORY_NO_DUP_FLAG 0x0001 114c2c66affSColin Finck // For SetConsoleCommandHistoryMode 115c2c66affSColin Finck #define CONSOLE_OVERSTRIKE 0x0001 116c2c66affSColin Finck #endif 117c2c66affSColin Finck 118c2c66affSColin Finck 119c2c66affSColin Finck /* 120c2c66affSColin Finck * Read input flags 121c2c66affSColin Finck */ 122*3a49e26fSHermès Bélusca-Maïto #define CONSOLE_READ_NOREMOVE 0x0001 123*3a49e26fSHermès Bélusca-Maïto #define CONSOLE_READ_NOWAIT 0x0002 124c2c66affSColin Finck 125c2c66affSColin Finck /* 126c2c66affSColin Finck * Event types 127c2c66affSColin Finck */ 128c2c66affSColin Finck #define KEY_EVENT 0x0001 129c2c66affSColin Finck #define MOUSE_EVENT 0x0002 130c2c66affSColin Finck #define WINDOW_BUFFER_SIZE_EVENT 0x0004 131c2c66affSColin Finck #define MENU_EVENT 0x0008 132c2c66affSColin Finck #define FOCUS_EVENT 0x0010 133c2c66affSColin Finck 134c2c66affSColin Finck /* 135c2c66affSColin Finck * ControlKeyState flags 136c2c66affSColin Finck */ 137c2c66affSColin Finck #define RIGHT_ALT_PRESSED 0x0001 138c2c66affSColin Finck #define LEFT_ALT_PRESSED 0x0002 139c2c66affSColin Finck #define RIGHT_CTRL_PRESSED 0x0004 140c2c66affSColin Finck #define LEFT_CTRL_PRESSED 0x0008 141c2c66affSColin Finck #define SHIFT_PRESSED 0x0010 142c2c66affSColin Finck #define NUMLOCK_ON 0x0020 143c2c66affSColin Finck #define SCROLLLOCK_ON 0x0040 144c2c66affSColin Finck #define CAPSLOCK_ON 0x0080 145c2c66affSColin Finck #define ENHANCED_KEY 0x0100 146c2c66affSColin Finck 147b4e40f21SHermès Bélusca-Maïto // NLS Japanese flags 148b4e40f21SHermès Bélusca-Maïto #define NLS_DBCSCHAR 0x00010000 /* SBCS/DBCS mode */ 149b4e40f21SHermès Bélusca-Maïto #define NLS_ALPHANUMERIC 0x00000000 /* Alphanumeric mode */ 150b4e40f21SHermès Bélusca-Maïto #define NLS_KATAKANA 0x00020000 /* Katakana mode */ 151b4e40f21SHermès Bélusca-Maïto #define NLS_HIRAGANA 0x00040000 /* Hiragana mode */ 152b4e40f21SHermès Bélusca-Maïto #define NLS_ROMAN 0x00400000 /* Roman/Noroman mode */ 153b4e40f21SHermès Bélusca-Maïto #define NLS_IME_CONVERSION 0x00800000 /* IME conversion */ 154b4e40f21SHermès Bélusca-Maïto #define NLS_IME_DISABLE 0x20000000 /* IME enable/disable */ 155b4e40f21SHermès Bélusca-Maïto 156c2c66affSColin Finck /* 157c2c66affSColin Finck * ButtonState flags 158c2c66affSColin Finck */ 159c2c66affSColin Finck #define FROM_LEFT_1ST_BUTTON_PRESSED 0x0001 160c2c66affSColin Finck #define RIGHTMOST_BUTTON_PRESSED 0x0002 161c2c66affSColin Finck #define FROM_LEFT_2ND_BUTTON_PRESSED 0x0004 162c2c66affSColin Finck #define FROM_LEFT_3RD_BUTTON_PRESSED 0x0008 163c2c66affSColin Finck #define FROM_LEFT_4TH_BUTTON_PRESSED 0x0010 164c2c66affSColin Finck 165c2c66affSColin Finck /* 166c2c66affSColin Finck * Mouse event flags 167c2c66affSColin Finck */ 168c2c66affSColin Finck #define MOUSE_MOVED 0x0001 169c2c66affSColin Finck #define DOUBLE_CLICK 0x0002 170c2c66affSColin Finck #define MOUSE_WHEELED 0x0004 171b4e40f21SHermès Bélusca-Maïto #if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) 172c2c66affSColin Finck #define MOUSE_HWHEELED 0x0008 173c2c66affSColin Finck #endif 174c2c66affSColin Finck 175c2c66affSColin Finck typedef struct _CONSOLE_READCONSOLE_CONTROL { 176c2c66affSColin Finck ULONG nLength; 177c2c66affSColin Finck ULONG nInitialChars; 178c2c66affSColin Finck ULONG dwCtrlWakeupMask; 179c2c66affSColin Finck ULONG dwControlKeyState; 180c2c66affSColin Finck } CONSOLE_READCONSOLE_CONTROL, *PCONSOLE_READCONSOLE_CONTROL; 181c2c66affSColin Finck 182c2c66affSColin Finck typedef struct _CHAR_INFO { 183c2c66affSColin Finck union { 184c2c66affSColin Finck WCHAR UnicodeChar; 185c2c66affSColin Finck CHAR AsciiChar; 186c2c66affSColin Finck } Char; 187c2c66affSColin Finck WORD Attributes; 188c2c66affSColin Finck } CHAR_INFO,*PCHAR_INFO; 189c2c66affSColin Finck 190c2c66affSColin Finck typedef struct _SMALL_RECT { 191c2c66affSColin Finck SHORT Left; 192c2c66affSColin Finck SHORT Top; 193c2c66affSColin Finck SHORT Right; 194c2c66affSColin Finck SHORT Bottom; 195c2c66affSColin Finck } SMALL_RECT,*PSMALL_RECT; 196c2c66affSColin Finck 197c2c66affSColin Finck typedef struct _CONSOLE_CURSOR_INFO { 198c2c66affSColin Finck DWORD dwSize; 199c2c66affSColin Finck BOOL bVisible; 200c2c66affSColin Finck } CONSOLE_CURSOR_INFO,*PCONSOLE_CURSOR_INFO; 201c2c66affSColin Finck 202c2c66affSColin Finck typedef struct _COORD { 203c2c66affSColin Finck SHORT X; 204c2c66affSColin Finck SHORT Y; 205c2c66affSColin Finck } COORD, *PCOORD; 206c2c66affSColin Finck 207c2c66affSColin Finck typedef struct _CONSOLE_SELECTION_INFO { 208c2c66affSColin Finck DWORD dwFlags; 209c2c66affSColin Finck COORD dwSelectionAnchor; 210c2c66affSColin Finck SMALL_RECT srSelection; 211c2c66affSColin Finck } CONSOLE_SELECTION_INFO, *PCONSOLE_SELECTION_INFO; 212c2c66affSColin Finck 213c2c66affSColin Finck typedef struct _CONSOLE_FONT_INFO { 214c2c66affSColin Finck DWORD nFont; 215c2c66affSColin Finck COORD dwFontSize; 216c2c66affSColin Finck } CONSOLE_FONT_INFO, *PCONSOLE_FONT_INFO; 217c2c66affSColin Finck 218c2c66affSColin Finck typedef struct _CONSOLE_SCREEN_BUFFER_INFO { 219c2c66affSColin Finck COORD dwSize; 220c2c66affSColin Finck COORD dwCursorPosition; 221c2c66affSColin Finck WORD wAttributes; 222c2c66affSColin Finck SMALL_RECT srWindow; 223c2c66affSColin Finck COORD dwMaximumWindowSize; 224c2c66affSColin Finck } CONSOLE_SCREEN_BUFFER_INFO,*PCONSOLE_SCREEN_BUFFER_INFO; 225c2c66affSColin Finck 226c2c66affSColin Finck /* Undocumented, see http://blog.airesoft.co.uk/2012/10/things-ms-can-do-that-they-dont-tell-you-about-console-graphics/ */ 227c2c66affSColin Finck #if defined(_WINGDI_) && !defined(NOGDI) 228c2c66affSColin Finck typedef struct _CONSOLE_GRAPHICS_BUFFER_INFO { 229c2c66affSColin Finck DWORD dwBitMapInfoLength; 230c2c66affSColin Finck LPBITMAPINFO lpBitMapInfo; 231c2c66affSColin Finck DWORD dwUsage; // DIB_PAL_COLORS or DIB_RGB_COLORS 232c2c66affSColin Finck HANDLE hMutex; 233c2c66affSColin Finck PVOID lpBitMap; 234c2c66affSColin Finck } CONSOLE_GRAPHICS_BUFFER_INFO, *PCONSOLE_GRAPHICS_BUFFER_INFO; 235c2c66affSColin Finck #endif 236c2c66affSColin Finck 237c2c66affSColin Finck typedef BOOL(CALLBACK *PHANDLER_ROUTINE)(_In_ DWORD); 238c2c66affSColin Finck 239c2c66affSColin Finck typedef struct _KEY_EVENT_RECORD { 240c2c66affSColin Finck BOOL bKeyDown; 241c2c66affSColin Finck WORD wRepeatCount; 242c2c66affSColin Finck WORD wVirtualKeyCode; 243c2c66affSColin Finck WORD wVirtualScanCode; 244c2c66affSColin Finck union { 245c2c66affSColin Finck WCHAR UnicodeChar; 246c2c66affSColin Finck CHAR AsciiChar; 247c2c66affSColin Finck } uChar; 248c2c66affSColin Finck DWORD dwControlKeyState; 249db089c51SHermès Bélusca-Maïto } KEY_EVENT_RECORD, *PKEY_EVENT_RECORD; 250db089c51SHermès Bélusca-Maïto 251db089c51SHermès Bélusca-Maïto C_ASSERT(FIELD_OFFSET(KEY_EVENT_RECORD, uChar) == 0xA); 252c2c66affSColin Finck 253c2c66affSColin Finck typedef struct _MOUSE_EVENT_RECORD { 254c2c66affSColin Finck COORD dwMousePosition; 255c2c66affSColin Finck DWORD dwButtonState; 256c2c66affSColin Finck DWORD dwControlKeyState; 257c2c66affSColin Finck DWORD dwEventFlags; 258c2c66affSColin Finck } MOUSE_EVENT_RECORD, *PMOUSE_EVENT_RECORD; 259c2c66affSColin Finck 260c2c66affSColin Finck typedef struct _WINDOW_BUFFER_SIZE_RECORD { 261c2c66affSColin Finck COORD dwSize; 262c2c66affSColin Finck } WINDOW_BUFFER_SIZE_RECORD, *PWINDOW_BUFFER_SIZE_RECORD; 263c2c66affSColin Finck 264c2c66affSColin Finck typedef struct _MENU_EVENT_RECORD { 265c2c66affSColin Finck UINT dwCommandId; 266c2c66affSColin Finck } MENU_EVENT_RECORD, *PMENU_EVENT_RECORD; 267c2c66affSColin Finck 268c2c66affSColin Finck typedef struct _FOCUS_EVENT_RECORD { 269c2c66affSColin Finck BOOL bSetFocus; 270c2c66affSColin Finck } FOCUS_EVENT_RECORD, *PFOCUS_EVENT_RECORD; 271c2c66affSColin Finck 272c2c66affSColin Finck typedef struct _INPUT_RECORD { 273c2c66affSColin Finck WORD EventType; 274c2c66affSColin Finck union { 275c2c66affSColin Finck KEY_EVENT_RECORD KeyEvent; 276c2c66affSColin Finck MOUSE_EVENT_RECORD MouseEvent; 277c2c66affSColin Finck WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent; 278c2c66affSColin Finck MENU_EVENT_RECORD MenuEvent; 279c2c66affSColin Finck FOCUS_EVENT_RECORD FocusEvent; 280c2c66affSColin Finck } Event; 281c2c66affSColin Finck } INPUT_RECORD, *PINPUT_RECORD; 282c2c66affSColin Finck 283b4e40f21SHermès Bélusca-Maïto #if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) 284c2c66affSColin Finck typedef struct _CONSOLE_HISTORY_INFO { 285c2c66affSColin Finck UINT cbSize; 286c2c66affSColin Finck UINT HistoryBufferSize; 287c2c66affSColin Finck UINT NumberOfHistoryBuffers; 288c2c66affSColin Finck DWORD dwFlags; 289c2c66affSColin Finck } CONSOLE_HISTORY_INFO, *PCONSOLE_HISTORY_INFO; 290c2c66affSColin Finck 291c2c66affSColin Finck typedef struct _CONSOLE_SCREEN_BUFFER_INFOEX { 292c2c66affSColin Finck ULONG cbSize; 293c2c66affSColin Finck COORD dwSize; 294c2c66affSColin Finck COORD dwCursorPosition; 295c2c66affSColin Finck WORD wAttributes; 296c2c66affSColin Finck SMALL_RECT srWindow; 297c2c66affSColin Finck COORD dwMaximumWindowSize; 298c2c66affSColin Finck WORD wPopupAttributes; 299c2c66affSColin Finck BOOL bFullscreenSupported; 300c2c66affSColin Finck COLORREF ColorTable[16]; 301c2c66affSColin Finck } CONSOLE_SCREEN_BUFFER_INFOEX, *PCONSOLE_SCREEN_BUFFER_INFOEX; 302c2c66affSColin Finck 303c2c66affSColin Finck #ifndef NOGDI 304c2c66affSColin Finck typedef struct _CONSOLE_FONT_INFOEX { 305c2c66affSColin Finck ULONG cbSize; 306c2c66affSColin Finck DWORD nFont; 307c2c66affSColin Finck COORD dwFontSize; 308c2c66affSColin Finck UINT FontFamily; 309c2c66affSColin Finck UINT FontWeight; 310c2c66affSColin Finck WCHAR FaceName[LF_FACESIZE]; 311c2c66affSColin Finck } CONSOLE_FONT_INFOEX, *PCONSOLE_FONT_INFOEX; 312c2c66affSColin Finck #endif 313c2c66affSColin Finck #endif 314c2c66affSColin Finck 315c2c66affSColin Finck BOOL WINAPI AllocConsole(VOID); 316c2c66affSColin Finck 317b4e40f21SHermès Bélusca-Maïto #if (_WIN32_WINNT >= _WIN32_WINNT_WINXP) 318c2c66affSColin Finck BOOL WINAPI AttachConsole(_In_ DWORD); 319c2c66affSColin Finck 320c2c66affSColin Finck BOOL WINAPI AddConsoleAliasA(_In_ LPCSTR, _In_ LPCSTR, _In_ LPCSTR); 321c2c66affSColin Finck BOOL WINAPI AddConsoleAliasW(_In_ LPCWSTR, _In_ LPCWSTR, _In_ LPCWSTR); 322c2c66affSColin Finck 323c2c66affSColin Finck DWORD 324c2c66affSColin Finck WINAPI 325c2c66affSColin Finck GetConsoleAliasA( 326c2c66affSColin Finck _In_ LPSTR Source, 327c2c66affSColin Finck _Out_writes_(TargetBufferLength) LPSTR TargetBuffer, 328c2c66affSColin Finck _In_ DWORD TargetBufferLength, 329c2c66affSColin Finck _In_ LPSTR ExeName); 330c2c66affSColin Finck 331c2c66affSColin Finck DWORD 332c2c66affSColin Finck WINAPI 333c2c66affSColin Finck GetConsoleAliasW( 334c2c66affSColin Finck _In_ LPWSTR Source, 335c2c66affSColin Finck _Out_writes_(TargetBufferLength) LPWSTR TargetBuffer, 336c2c66affSColin Finck _In_ DWORD TargetBufferLength, 337c2c66affSColin Finck _In_ LPWSTR ExeName); 338c2c66affSColin Finck 339c2c66affSColin Finck DWORD 340c2c66affSColin Finck WINAPI 341c2c66affSColin Finck GetConsoleAliasesA( 342c2c66affSColin Finck _Out_writes_(AliasBufferLength) LPSTR AliasBuffer, 343c2c66affSColin Finck _In_ DWORD AliasBufferLength, 344c2c66affSColin Finck _In_ LPSTR ExeName); 345c2c66affSColin Finck 346c2c66affSColin Finck DWORD 347c2c66affSColin Finck WINAPI 348c2c66affSColin Finck GetConsoleAliasesW( 349c2c66affSColin Finck _Out_writes_(AliasBufferLength) LPWSTR AliasBuffer, 350c2c66affSColin Finck _In_ DWORD AliasBufferLength, 351c2c66affSColin Finck _In_ LPWSTR ExeName); 352c2c66affSColin Finck 353c2c66affSColin Finck DWORD WINAPI GetConsoleAliasesLengthA(_In_ LPSTR ExeName); 354c2c66affSColin Finck DWORD WINAPI GetConsoleAliasesLengthW(_In_ LPWSTR ExeName); 355c2c66affSColin Finck 356c2c66affSColin Finck DWORD 357c2c66affSColin Finck WINAPI 358c2c66affSColin Finck GetConsoleAliasExesA( 359c2c66affSColin Finck _Out_writes_(ExeNameBufferLength) LPSTR ExeNameBuffer, 360c2c66affSColin Finck _In_ DWORD ExeNameBufferLength); 361c2c66affSColin Finck 362c2c66affSColin Finck DWORD 363c2c66affSColin Finck WINAPI 364c2c66affSColin Finck GetConsoleAliasExesW( 365c2c66affSColin Finck _Out_writes_(ExeNameBufferLength) LPWSTR ExeNameBuffer, 366c2c66affSColin Finck _In_ DWORD ExeNameBufferLength); 367c2c66affSColin Finck 368c2c66affSColin Finck DWORD WINAPI GetConsoleAliasExesLengthA(VOID); 369c2c66affSColin Finck DWORD WINAPI GetConsoleAliasExesLengthW(VOID); 370c2c66affSColin Finck #endif 371c2c66affSColin Finck 372c2c66affSColin Finck HANDLE 373c2c66affSColin Finck WINAPI 374c2c66affSColin Finck CreateConsoleScreenBuffer( 375c2c66affSColin Finck _In_ DWORD, 376c2c66affSColin Finck _In_ DWORD, 377c2c66affSColin Finck _In_opt_ CONST SECURITY_ATTRIBUTES*, 378c2c66affSColin Finck _In_ DWORD, 379c2c66affSColin Finck _Reserved_ LPVOID); 380c2c66affSColin Finck 381c2c66affSColin Finck BOOL 382c2c66affSColin Finck WINAPI 383c2c66affSColin Finck FillConsoleOutputAttribute( 384c2c66affSColin Finck _In_ HANDLE, 385c2c66affSColin Finck _In_ WORD, 386c2c66affSColin Finck _In_ DWORD, 387c2c66affSColin Finck _In_ COORD, 388c2c66affSColin Finck _Out_ PDWORD); 389c2c66affSColin Finck 390c2c66affSColin Finck BOOL 391c2c66affSColin Finck WINAPI 392c2c66affSColin Finck FillConsoleOutputCharacterA( 393c2c66affSColin Finck _In_ HANDLE, 394c2c66affSColin Finck _In_ CHAR, 395c2c66affSColin Finck _In_ DWORD, 396c2c66affSColin Finck _In_ COORD, 397c2c66affSColin Finck _Out_ PDWORD); 398c2c66affSColin Finck 399c2c66affSColin Finck BOOL 400c2c66affSColin Finck WINAPI 401c2c66affSColin Finck FillConsoleOutputCharacterW( 402c2c66affSColin Finck _In_ HANDLE, 403c2c66affSColin Finck _In_ WCHAR, 404c2c66affSColin Finck _In_ DWORD, 405c2c66affSColin Finck _In_ COORD, 406c2c66affSColin Finck _Out_ PDWORD); 407c2c66affSColin Finck 408c2c66affSColin Finck BOOL WINAPI FlushConsoleInputBuffer(_In_ HANDLE); 409c2c66affSColin Finck BOOL WINAPI FreeConsole(VOID); 410c2c66affSColin Finck BOOL WINAPI GenerateConsoleCtrlEvent(_In_ DWORD, _In_ DWORD); 411c2c66affSColin Finck UINT WINAPI GetConsoleCP(VOID); 412c2c66affSColin Finck BOOL WINAPI GetConsoleCursorInfo(_In_ HANDLE, _Out_ PCONSOLE_CURSOR_INFO); 413c2c66affSColin Finck BOOL WINAPI GetConsoleMode(_In_ HANDLE, _Out_ PDWORD); 414c2c66affSColin Finck UINT WINAPI GetConsoleOutputCP(VOID); 415c2c66affSColin Finck 416c2c66affSColin Finck BOOL 417c2c66affSColin Finck WINAPI 418c2c66affSColin Finck GetConsoleScreenBufferInfo( 419c2c66affSColin Finck _In_ HANDLE, 420c2c66affSColin Finck _Out_ PCONSOLE_SCREEN_BUFFER_INFO); 421c2c66affSColin Finck 422c2c66affSColin Finck /* Undocumented, see http://blog.airesoft.co.uk/2012/10/things-ms-can-do-that-they-dont-tell-you-about-console-graphics/ */ 423c2c66affSColin Finck BOOL WINAPI InvalidateConsoleDIBits(_In_ HANDLE, _In_ PSMALL_RECT); 424c2c66affSColin Finck 425c2c66affSColin Finck DWORD 426c2c66affSColin Finck WINAPI 427c2c66affSColin Finck GetConsoleTitleA( 428c2c66affSColin Finck _Out_writes_(nSize) LPSTR lpConsoleTitle, 429c2c66affSColin Finck _In_ DWORD nSize); 430c2c66affSColin Finck 431c2c66affSColin Finck DWORD 432c2c66affSColin Finck WINAPI 433c2c66affSColin Finck GetConsoleTitleW( 434c2c66affSColin Finck _Out_writes_(nSize) LPWSTR lpConsoleTitle, 435c2c66affSColin Finck _In_ DWORD nSize); 436c2c66affSColin Finck 437c2c66affSColin Finck COORD 438c2c66affSColin Finck WINAPI 439c2c66affSColin Finck GetConsoleFontSize( 440c2c66affSColin Finck _In_ HANDLE hConsoleOutput, 441c2c66affSColin Finck _In_ DWORD nFont); 442c2c66affSColin Finck 443c2c66affSColin Finck BOOL 444c2c66affSColin Finck WINAPI 445c2c66affSColin Finck GetCurrentConsoleFont( 446c2c66affSColin Finck _In_ HANDLE hConsoleOutput, 447c2c66affSColin Finck _In_ BOOL bMaximumWindow, 448c2c66affSColin Finck _Out_ PCONSOLE_FONT_INFO lpConsoleCurrentFont); 449c2c66affSColin Finck 450b4e40f21SHermès Bélusca-Maïto #if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K) 451c2c66affSColin Finck 452c2c66affSColin Finck HWND WINAPI GetConsoleWindow(VOID); 453c2c66affSColin Finck BOOL WINAPI GetConsoleDisplayMode(_Out_ LPDWORD lpModeFlags); 454c2c66affSColin Finck 455c2c66affSColin Finck BOOL 456c2c66affSColin Finck WINAPI 457c2c66affSColin Finck SetConsoleDisplayMode( 458c2c66affSColin Finck _In_ HANDLE hConsoleOutput, 459c2c66affSColin Finck _In_ DWORD dwFlags, 460c2c66affSColin Finck _Out_opt_ PCOORD lpNewScreenBufferDimensions); 461c2c66affSColin Finck 462c2c66affSColin Finck #endif 463c2c66affSColin Finck 464c2c66affSColin Finck COORD WINAPI GetLargestConsoleWindowSize(_In_ HANDLE); 465c2c66affSColin Finck BOOL WINAPI GetNumberOfConsoleInputEvents(_In_ HANDLE, _Out_ PDWORD); 466c2c66affSColin Finck BOOL WINAPI GetNumberOfConsoleMouseButtons(_Out_ PDWORD); 467c2c66affSColin Finck 468c2c66affSColin Finck _Success_(return != 0) 469c2c66affSColin Finck BOOL 470c2c66affSColin Finck WINAPI PeekConsoleInputA( 471c2c66affSColin Finck _In_ HANDLE hConsoleInput, 472c2c66affSColin Finck _Out_writes_(nLength) PINPUT_RECORD lpBuffer, 473c2c66affSColin Finck _In_ DWORD nLength, 474c2c66affSColin Finck _Out_ LPDWORD lpNumberOfEventsRead); 475c2c66affSColin Finck 476c2c66affSColin Finck _Success_(return != 0) 477c2c66affSColin Finck BOOL 478c2c66affSColin Finck WINAPI 479c2c66affSColin Finck PeekConsoleInputW( 480c2c66affSColin Finck _In_ HANDLE hConsoleInput, 481c2c66affSColin Finck _Out_writes_(nLength) PINPUT_RECORD lpBuffer, 482c2c66affSColin Finck _In_ DWORD nLength, 483c2c66affSColin Finck _Out_ LPDWORD lpNumberOfEventsRead); 484c2c66affSColin Finck 485c2c66affSColin Finck _Success_(return != 0) 486c2c66affSColin Finck BOOL 487c2c66affSColin Finck WINAPI 488c2c66affSColin Finck ReadConsoleA( 489c2c66affSColin Finck _In_ HANDLE hConsoleInput, 490c2c66affSColin Finck _Out_writes_bytes_to_(nNumberOfCharsToRead * sizeof(CHAR), *lpNumberOfCharsRead * sizeof(CHAR)) LPVOID lpBuffer, 491c2c66affSColin Finck _In_ DWORD nNumberOfCharsToRead, 492c2c66affSColin Finck _Out_ _Deref_out_range_(<= , nNumberOfCharsToRead) LPDWORD lpNumberOfCharsRead, 493c2c66affSColin Finck _In_opt_ PCONSOLE_READCONSOLE_CONTROL pInputControl); 494c2c66affSColin Finck 495c2c66affSColin Finck _Success_(return != 0) 496c2c66affSColin Finck BOOL 497c2c66affSColin Finck WINAPI 498c2c66affSColin Finck ReadConsoleW( 499c2c66affSColin Finck _In_ HANDLE hConsoleInput, 500c2c66affSColin Finck _Out_writes_bytes_to_(nNumberOfCharsToRead * sizeof(WCHAR), *lpNumberOfCharsRead * sizeof(WCHAR)) LPVOID lpBuffer, 501c2c66affSColin Finck _In_ DWORD nNumberOfCharsToRead, 502c2c66affSColin Finck _Out_ _Deref_out_range_(<= , nNumberOfCharsToRead) LPDWORD lpNumberOfCharsRead, 503c2c66affSColin Finck _In_opt_ PCONSOLE_READCONSOLE_CONTROL pInputControl); 504c2c66affSColin Finck 505c2c66affSColin Finck _Success_(return != 0) 506c2c66affSColin Finck BOOL 507c2c66affSColin Finck WINAPI 508c2c66affSColin Finck ReadConsoleInputA( 509c2c66affSColin Finck _In_ HANDLE hConsoleInput, 510c2c66affSColin Finck _Out_writes_to_(nLength, *lpNumberOfEventsRead) PINPUT_RECORD lpBuffer, 511c2c66affSColin Finck _In_ DWORD nLength, 512c2c66affSColin Finck _Out_ _Deref_out_range_(<= , nLength) LPDWORD lpNumberOfEventsRead); 513c2c66affSColin Finck 514c2c66affSColin Finck _Success_(return != 0) 515c2c66affSColin Finck BOOL 516c2c66affSColin Finck WINAPI 517c2c66affSColin Finck ReadConsoleInputW( 518c2c66affSColin Finck _In_ HANDLE hConsoleInput, 519c2c66affSColin Finck _Out_writes_to_(nLength, *lpNumberOfEventsRead) PINPUT_RECORD lpBuffer, 520c2c66affSColin Finck _In_ DWORD nLength, 521c2c66affSColin Finck _Out_ _Deref_out_range_(<= , nLength) LPDWORD lpNumberOfEventsRead); 522c2c66affSColin Finck 523c2c66affSColin Finck _Success_(return != 0) 524c2c66affSColin Finck BOOL 525c2c66affSColin Finck WINAPI 526c2c66affSColin Finck ReadConsoleInputExA( 527c2c66affSColin Finck _In_ HANDLE hConsoleInput, 528c2c66affSColin Finck _Out_writes_to_(nLength, *lpNumberOfEventsRead) PINPUT_RECORD lpBuffer, 529c2c66affSColin Finck _In_ DWORD nLength, 530c2c66affSColin Finck _Out_ _Deref_out_range_(<= , nLength) LPDWORD lpNumberOfEventsRead, 531c2c66affSColin Finck _In_ WORD wFlags); 532c2c66affSColin Finck 533c2c66affSColin Finck _Success_(return != 0) 534c2c66affSColin Finck BOOL 535c2c66affSColin Finck WINAPI 536c2c66affSColin Finck ReadConsoleInputExW( 537c2c66affSColin Finck _In_ HANDLE hConsoleInput, 538c2c66affSColin Finck _Out_writes_to_(nLength, *lpNumberOfEventsRead) PINPUT_RECORD lpBuffer, 539c2c66affSColin Finck _In_ DWORD nLength, 540c2c66affSColin Finck _Out_ _Deref_out_range_(<= , nLength) LPDWORD lpNumberOfEventsRead, 541c2c66affSColin Finck _In_ WORD wFlags); 542c2c66affSColin Finck 543c2c66affSColin Finck BOOL 544c2c66affSColin Finck WINAPI 545c2c66affSColin Finck ReadConsoleOutputAttribute( 546c2c66affSColin Finck _In_ HANDLE hConsoleOutput, 547c2c66affSColin Finck _Out_writes_(nLength) LPWORD lpAttribute, 548c2c66affSColin Finck _In_ DWORD nLength, 549c2c66affSColin Finck _In_ COORD dwReadCoord, 550c2c66affSColin Finck _Out_ LPDWORD lpNumberOfAttrsRead); 551c2c66affSColin Finck 552c2c66affSColin Finck BOOL 553c2c66affSColin Finck WINAPI 554c2c66affSColin Finck ReadConsoleOutputCharacterA( 555c2c66affSColin Finck _In_ HANDLE hConsoleOutput, 556c2c66affSColin Finck _Out_writes_(nLength) LPSTR lpCharacter, 557c2c66affSColin Finck _In_ DWORD nLength, 558c2c66affSColin Finck _In_ COORD dwReadCoord, 559c2c66affSColin Finck _Out_ LPDWORD lpNumberOfCharsRead); 560c2c66affSColin Finck 561c2c66affSColin Finck BOOL 562c2c66affSColin Finck WINAPI 563c2c66affSColin Finck ReadConsoleOutputCharacterW( 564c2c66affSColin Finck _In_ HANDLE hConsoleOutput, 565c2c66affSColin Finck _Out_writes_(nLength) LPWSTR lpCharacter, 566c2c66affSColin Finck _In_ DWORD nLength, 567c2c66affSColin Finck _In_ COORD dwReadCoord, 568c2c66affSColin Finck _Out_ LPDWORD lpNumberOfCharsRead); 569c2c66affSColin Finck 570c2c66affSColin Finck BOOL 571c2c66affSColin Finck WINAPI 572c2c66affSColin Finck ReadConsoleOutputA( 573c2c66affSColin Finck _In_ HANDLE hConsoleOutput, 574c2c66affSColin Finck _Out_writes_(dwBufferSize.X * dwBufferSize.Y) PCHAR_INFO lpBuffer, 575c2c66affSColin Finck _In_ COORD dwBufferSize, 576c2c66affSColin Finck _In_ COORD dwBufferCoord, 577c2c66affSColin Finck _Inout_ PSMALL_RECT lpReadRegion); 578c2c66affSColin Finck 579c2c66affSColin Finck BOOL 580c2c66affSColin Finck WINAPI 581c2c66affSColin Finck ReadConsoleOutputW( 582c2c66affSColin Finck _In_ HANDLE hConsoleOutput, 583c2c66affSColin Finck _Out_writes_(dwBufferSize.X * dwBufferSize.Y) PCHAR_INFO lpBuffer, 584c2c66affSColin Finck _In_ COORD dwBufferSize, 585c2c66affSColin Finck _In_ COORD dwBufferCoord, 586c2c66affSColin Finck _Inout_ PSMALL_RECT lpReadRegion); 587c2c66affSColin Finck 588c2c66affSColin Finck BOOL 589c2c66affSColin Finck WINAPI 590c2c66affSColin Finck ScrollConsoleScreenBufferA( 591c2c66affSColin Finck _In_ HANDLE, 592c2c66affSColin Finck _In_ const SMALL_RECT*, 593c2c66affSColin Finck _In_opt_ const SMALL_RECT*, 594c2c66affSColin Finck _In_ COORD, 595c2c66affSColin Finck _In_ const CHAR_INFO*); 596c2c66affSColin Finck 597c2c66affSColin Finck BOOL 598c2c66affSColin Finck WINAPI 599c2c66affSColin Finck ScrollConsoleScreenBufferW( 600c2c66affSColin Finck _In_ HANDLE, 601c2c66affSColin Finck _In_ const SMALL_RECT*, 602c2c66affSColin Finck _In_opt_ const SMALL_RECT*, 603c2c66affSColin Finck _In_ COORD, 604c2c66affSColin Finck _In_ const CHAR_INFO*); 605c2c66affSColin Finck 606c2c66affSColin Finck BOOL WINAPI SetConsoleActiveScreenBuffer(_In_ HANDLE); 607c2c66affSColin Finck BOOL WINAPI SetConsoleCP(_In_ UINT); 608c2c66affSColin Finck BOOL WINAPI SetConsoleCtrlHandler(_In_opt_ PHANDLER_ROUTINE, _In_ BOOL); 609c2c66affSColin Finck BOOL WINAPI SetConsoleCursorInfo(_In_ HANDLE, _In_ const CONSOLE_CURSOR_INFO*); 610c2c66affSColin Finck BOOL WINAPI SetConsoleCursorPosition(_In_ HANDLE, _In_ COORD); 611c2c66affSColin Finck BOOL WINAPI SetConsoleMode(_In_ HANDLE, _In_ DWORD); 612c2c66affSColin Finck BOOL WINAPI SetConsoleOutputCP(_In_ UINT); 613c2c66affSColin Finck BOOL WINAPI SetConsoleScreenBufferSize(_In_ HANDLE, _In_ COORD); 614c2c66affSColin Finck BOOL WINAPI SetConsoleTextAttribute(_In_ HANDLE, _In_ WORD); 615c2c66affSColin Finck BOOL WINAPI SetConsoleTitleA(_In_ LPCSTR); 616c2c66affSColin Finck BOOL WINAPI SetConsoleTitleW(_In_ LPCWSTR); 617c2c66affSColin Finck 618c2c66affSColin Finck BOOL 619c2c66affSColin Finck WINAPI 620c2c66affSColin Finck SetConsoleWindowInfo( 621c2c66affSColin Finck _In_ HANDLE, 622c2c66affSColin Finck _In_ BOOL, 623c2c66affSColin Finck _In_ const SMALL_RECT*); 624c2c66affSColin Finck 625c2c66affSColin Finck /* Undocumented, see http://undoc.airesoft.co.uk/kernel32.dll/ConsoleMenuControl.php */ 626c2c66affSColin Finck HMENU WINAPI ConsoleMenuControl(_In_ HANDLE, _In_ DWORD, _In_ DWORD); 627c2c66affSColin Finck /* Undocumented */ 628c2c66affSColin Finck BOOL WINAPI SetConsoleMenuClose(_In_ BOOL); 629c2c66affSColin Finck /* Undocumented, see http://undoc.airesoft.co.uk/kernel32.dll/SetConsoleCursor.php */ 630c2c66affSColin Finck BOOL WINAPI SetConsoleCursor(_In_ HANDLE, _In_ HCURSOR); 631c2c66affSColin Finck /* Undocumented, see http://undoc.airesoft.co.uk/kernel32.dll/ShowConsoleCursor.php */ 632c2c66affSColin Finck INT WINAPI ShowConsoleCursor(_In_ HANDLE, _In_ BOOL); 633c2c66affSColin Finck /* Undocumented */ 634c2c66affSColin Finck BOOL WINAPI SetConsoleIcon(_In_ HICON); 635c2c66affSColin Finck /* Undocumented, see http://comments.gmane.org/gmane.comp.lang.harbour.devel/27844 */ 636c2c66affSColin Finck BOOL WINAPI SetConsolePalette(_In_ HANDLE, _In_ HPALETTE, _In_ UINT); 637c2c66affSColin Finck /* Undocumented */ 638c2c66affSColin Finck BOOL WINAPI CloseConsoleHandle(_In_ HANDLE); 639c2c66affSColin Finck /* Undocumented */ 640c2c66affSColin Finck HANDLE WINAPI GetConsoleInputWaitHandle(VOID); 641c2c66affSColin Finck /* Undocumented */ 642c2c66affSColin Finck BOOL WINAPI VerifyConsoleIoHandle(_In_ HANDLE); 643c2c66affSColin Finck /* Undocumented */ 644c2c66affSColin Finck BOOL 645c2c66affSColin Finck WINAPI 646c2c66affSColin Finck RegisterConsoleVDM(_In_ DWORD, _In_ HANDLE, _In_ HANDLE, _In_ HANDLE, _In_ DWORD, 647c2c66affSColin Finck _Out_ LPDWORD, _Out_ PVOID*, _In_ PVOID, _In_ DWORD, _In_ COORD, 648c2c66affSColin Finck _Out_ PVOID*); 649c2c66affSColin Finck 650c2c66affSColin Finck BOOL 651c2c66affSColin Finck WINAPI 652c2c66affSColin Finck WriteConsoleA( 653c2c66affSColin Finck _In_ HANDLE hConsoleOutput, 654c2c66affSColin Finck _In_reads_(nNumberOfCharsToWrite) CONST VOID *lpBuffer, 655c2c66affSColin Finck _In_ DWORD nNumberOfCharsToWrite, 656c2c66affSColin Finck _Out_opt_ LPDWORD lpNumberOfCharsWritten, 657c2c66affSColin Finck _Reserved_ LPVOID lpReserved); 658c2c66affSColin Finck 659c2c66affSColin Finck BOOL 660c2c66affSColin Finck WINAPI 661c2c66affSColin Finck WriteConsoleW( 662c2c66affSColin Finck _In_ HANDLE hConsoleOutput, 663c2c66affSColin Finck _In_reads_(nNumberOfCharsToWrite) CONST VOID *lpBuffer, 664c2c66affSColin Finck _In_ DWORD nNumberOfCharsToWrite, 665c2c66affSColin Finck _Out_opt_ LPDWORD lpNumberOfCharsWritten, 666c2c66affSColin Finck _Reserved_ LPVOID lpReserved); 667c2c66affSColin Finck 668c2c66affSColin Finck BOOL 669c2c66affSColin Finck WINAPI 670c2c66affSColin Finck WriteConsoleInputA( 671c2c66affSColin Finck _In_ HANDLE hConsoleInput, 672c2c66affSColin Finck _In_reads_(nLength) CONST INPUT_RECORD *lpBuffer, 673c2c66affSColin Finck _In_ DWORD nLength, 674c2c66affSColin Finck _Out_ LPDWORD lpNumberOfEventsWritten); 675c2c66affSColin Finck 676c2c66affSColin Finck BOOL 677c2c66affSColin Finck WINAPI 678c2c66affSColin Finck WriteConsoleInputW( 679c2c66affSColin Finck _In_ HANDLE hConsoleInput, 680c2c66affSColin Finck _In_reads_(nLength) CONST INPUT_RECORD *lpBuffer, 681c2c66affSColin Finck _In_ DWORD nLength, 682c2c66affSColin Finck _Out_ LPDWORD lpNumberOfEventsWritten); 683c2c66affSColin Finck 684c2c66affSColin Finck BOOL 685c2c66affSColin Finck WINAPI 686c2c66affSColin Finck WriteConsoleInputVDMA( 687c2c66affSColin Finck _In_ HANDLE hConsoleInput, 688c2c66affSColin Finck _In_reads_(nLength) CONST INPUT_RECORD *lpBuffer, 689c2c66affSColin Finck _In_ DWORD nLength, 690c2c66affSColin Finck _Out_ LPDWORD lpNumberOfEventsWritten); 691c2c66affSColin Finck 692c2c66affSColin Finck BOOL 693c2c66affSColin Finck WINAPI 694c2c66affSColin Finck WriteConsoleInputVDMW( 695c2c66affSColin Finck _In_ HANDLE hConsoleInput, 696c2c66affSColin Finck _In_reads_(nLength) CONST INPUT_RECORD *lpBuffer, 697c2c66affSColin Finck _In_ DWORD nLength, 698c2c66affSColin Finck _Out_ LPDWORD lpNumberOfEventsWritten); 699c2c66affSColin Finck 700c2c66affSColin Finck BOOL 701c2c66affSColin Finck WINAPI 702c2c66affSColin Finck WriteConsoleOutputA( 703c2c66affSColin Finck _In_ HANDLE hConsoleOutput, 704c2c66affSColin Finck _In_reads_(dwBufferSize.X * dwBufferSize.Y) CONST CHAR_INFO *lpBuffer, 705c2c66affSColin Finck _In_ COORD dwBufferSize, 706c2c66affSColin Finck _In_ COORD dwBufferCoord, 707c2c66affSColin Finck _Inout_ PSMALL_RECT lpWriteRegion); 708c2c66affSColin Finck 709c2c66affSColin Finck BOOL 710c2c66affSColin Finck WINAPI 711c2c66affSColin Finck WriteConsoleOutputW( 712c2c66affSColin Finck _In_ HANDLE hConsoleOutput, 713c2c66affSColin Finck _In_reads_(dwBufferSize.X * dwBufferSize.Y) CONST CHAR_INFO *lpBuffer, 714c2c66affSColin Finck _In_ COORD dwBufferSize, 715c2c66affSColin Finck _In_ COORD dwBufferCoord, 716c2c66affSColin Finck _Inout_ PSMALL_RECT lpWriteRegion); 717c2c66affSColin Finck 718c2c66affSColin Finck BOOL 719c2c66affSColin Finck WINAPI 720c2c66affSColin Finck WriteConsoleOutputAttribute( 721c2c66affSColin Finck _In_ HANDLE hConsoleOutput, 722c2c66affSColin Finck _In_reads_(nLength) CONST WORD *lpAttribute, 723c2c66affSColin Finck _In_ DWORD nLength, 724c2c66affSColin Finck _In_ COORD dwWriteCoord, 725c2c66affSColin Finck _Out_ LPDWORD lpNumberOfAttrsWritten); 726c2c66affSColin Finck 727c2c66affSColin Finck BOOL 728c2c66affSColin Finck WINAPI 729c2c66affSColin Finck WriteConsoleOutputCharacterA( 730c2c66affSColin Finck _In_ HANDLE hConsoleOutput, 731c2c66affSColin Finck _In_reads_(nLength) LPCSTR lpCharacter, 732c2c66affSColin Finck _In_ DWORD nLength, 733c2c66affSColin Finck _In_ COORD dwWriteCoord, 734c2c66affSColin Finck _Out_ LPDWORD lpNumberOfCharsWritten); 735c2c66affSColin Finck 736c2c66affSColin Finck BOOL 737c2c66affSColin Finck WINAPI 738c2c66affSColin Finck WriteConsoleOutputCharacterW( 739c2c66affSColin Finck _In_ HANDLE hConsoleOutput, 740c2c66affSColin Finck _In_reads_(nLength) LPCWSTR lpCharacter, 741c2c66affSColin Finck _In_ DWORD nLength, 742c2c66affSColin Finck _In_ COORD dwWriteCoord, 743c2c66affSColin Finck _Out_ LPDWORD lpNumberOfCharsWritten); 744c2c66affSColin Finck 745c2c66affSColin Finck 746c2c66affSColin Finck #ifdef UNICODE 747c2c66affSColin Finck #define AddConsoleAlias AddConsoleAliasW 748c2c66affSColin Finck #define GetConsoleAlias GetConsoleAliasW 749c2c66affSColin Finck #define GetConsoleAliases GetConsoleAliasesW 750c2c66affSColin Finck #define GetConsoleAliasesLength GetConsoleAliasesLengthW 751c2c66affSColin Finck #define GetConsoleAliasExes GetConsoleAliasExesW 752c2c66affSColin Finck #define GetConsoleAliasExesLength GetConsoleAliasExesLengthW 753c2c66affSColin Finck #define GetConsoleTitle GetConsoleTitleW 754c2c66affSColin Finck #define PeekConsoleInput PeekConsoleInputW 755c2c66affSColin Finck #define ReadConsole ReadConsoleW 756c2c66affSColin Finck #define ReadConsoleInput ReadConsoleInputW 757c2c66affSColin Finck #define ReadConsoleInputEx ReadConsoleInputExW 758c2c66affSColin Finck #define ReadConsoleOutput ReadConsoleOutputW 759c2c66affSColin Finck #define ReadConsoleOutputCharacter ReadConsoleOutputCharacterW 760c2c66affSColin Finck #define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferW 761c2c66affSColin Finck #define SetConsoleTitle SetConsoleTitleW 762c2c66affSColin Finck #define WriteConsole WriteConsoleW 763c2c66affSColin Finck #define WriteConsoleInput WriteConsoleInputW 764c2c66affSColin Finck #define WriteConsoleInputVDM WriteConsoleInputVDMW 765c2c66affSColin Finck #define WriteConsoleOutput WriteConsoleOutputW 766c2c66affSColin Finck #define FillConsoleOutputCharacter FillConsoleOutputCharacterW 767c2c66affSColin Finck #define WriteConsoleOutputCharacter WriteConsoleOutputCharacterW 768c2c66affSColin Finck #else 769c2c66affSColin Finck #define AddConsoleAlias AddConsoleAliasA 770c2c66affSColin Finck #define GetConsoleAlias GetConsoleAliasA 771c2c66affSColin Finck #define GetConsoleAliases GetConsoleAliasesA 772c2c66affSColin Finck #define GetConsoleAliasesLength GetConsoleAliasesLengthA 773c2c66affSColin Finck #define GetConsoleAliasExes GetConsoleAliasExesA 774c2c66affSColin Finck #define GetConsoleAliasExesLength GetConsoleAliasExesLengthA 775c2c66affSColin Finck #define GetConsoleTitle GetConsoleTitleA 776c2c66affSColin Finck #define PeekConsoleInput PeekConsoleInputA 777c2c66affSColin Finck #define ReadConsole ReadConsoleA 778c2c66affSColin Finck #define ReadConsoleInput ReadConsoleInputA 779c2c66affSColin Finck #define ReadConsoleInputEx ReadConsoleInputExA 780c2c66affSColin Finck #define ReadConsoleOutput ReadConsoleOutputA 781c2c66affSColin Finck #define ReadConsoleOutputCharacter ReadConsoleOutputCharacterA 782c2c66affSColin Finck #define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferA 783c2c66affSColin Finck #define SetConsoleTitle SetConsoleTitleA 784c2c66affSColin Finck #define WriteConsole WriteConsoleA 785c2c66affSColin Finck #define WriteConsoleInput WriteConsoleInputA 786c2c66affSColin Finck #define WriteConsoleInputVDM WriteConsoleInputVDMA 787c2c66affSColin Finck #define WriteConsoleOutput WriteConsoleOutputA 788c2c66affSColin Finck #define FillConsoleOutputCharacter FillConsoleOutputCharacterA 789c2c66affSColin Finck #define WriteConsoleOutputCharacter WriteConsoleOutputCharacterA 790c2c66affSColin Finck #endif 791c2c66affSColin Finck 792c2c66affSColin Finck #ifdef _MSC_VER 793c2c66affSColin Finck #pragma warning(pop) 794c2c66affSColin Finck #endif 795c2c66affSColin Finck 796c2c66affSColin Finck #ifdef __cplusplus 797c2c66affSColin Finck } 798c2c66affSColin Finck #endif 799c2c66affSColin Finck 800c2c66affSColin Finck #endif /* _WINCON_H */ 801