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