Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

834 lines
17 KiB

  1. /*++ BUILD Version: 0002 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. wincon.h
  5. Abstract:
  6. This module contains the public data structures, data types,
  7. and procedures exported by the NT console subsystem.
  8. Created:
  9. 26-Oct-1990
  10. Revision History:
  11. --*/
  12. #ifndef _WINCON_
  13. #define _WINCON_
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. typedef struct _COORD {
  18. SHORT X;
  19. SHORT Y;
  20. } COORD, *PCOORD;
  21. typedef struct _SMALL_RECT {
  22. SHORT Left;
  23. SHORT Top;
  24. SHORT Right;
  25. SHORT Bottom;
  26. } SMALL_RECT, *PSMALL_RECT;
  27. typedef struct _KEY_EVENT_RECORD {
  28. BOOL bKeyDown;
  29. WORD wRepeatCount;
  30. WORD wVirtualKeyCode;
  31. WORD wVirtualScanCode;
  32. union {
  33. WCHAR UnicodeChar;
  34. CHAR AsciiChar;
  35. } uChar;
  36. DWORD dwControlKeyState;
  37. } KEY_EVENT_RECORD, *PKEY_EVENT_RECORD;
  38. //
  39. // ControlKeyState flags
  40. //
  41. #define RIGHT_ALT_PRESSED 0x0001 // the right alt key is pressed.
  42. #define LEFT_ALT_PRESSED 0x0002 // the left alt key is pressed.
  43. #define RIGHT_CTRL_PRESSED 0x0004 // the right ctrl key is pressed.
  44. #define LEFT_CTRL_PRESSED 0x0008 // the left ctrl key is pressed.
  45. #define SHIFT_PRESSED 0x0010 // the shift key is pressed.
  46. #define NUMLOCK_ON 0x0020 // the numlock light is on.
  47. #define SCROLLLOCK_ON 0x0040 // the scrolllock light is on.
  48. #define CAPSLOCK_ON 0x0080 // the capslock light is on.
  49. #define ENHANCED_KEY 0x0100 // the key is enhanced.
  50. #define NLS_DBCSCHAR 0x00010000 // DBCS for JPN: SBCS/DBCS mode.
  51. #define NLS_ALPHANUMERIC 0x00000000 // DBCS for JPN: Alphanumeric mode.
  52. #define NLS_KATAKANA 0x00020000 // DBCS for JPN: Katakana mode.
  53. #define NLS_HIRAGANA 0x00040000 // DBCS for JPN: Hiragana mode.
  54. #define NLS_ROMAN 0x00400000 // DBCS for JPN: Roman/Noroman mode.
  55. #define NLS_IME_CONVERSION 0x00800000 // DBCS for JPN: IME conversion.
  56. #define NLS_IME_DISABLE 0x20000000 // DBCS for JPN: IME enable/disable.
  57. typedef struct _MOUSE_EVENT_RECORD {
  58. COORD dwMousePosition;
  59. DWORD dwButtonState;
  60. DWORD dwControlKeyState;
  61. DWORD dwEventFlags;
  62. } MOUSE_EVENT_RECORD, *PMOUSE_EVENT_RECORD;
  63. //
  64. // ButtonState flags
  65. //
  66. #define FROM_LEFT_1ST_BUTTON_PRESSED 0x0001
  67. #define RIGHTMOST_BUTTON_PRESSED 0x0002
  68. #define FROM_LEFT_2ND_BUTTON_PRESSED 0x0004
  69. #define FROM_LEFT_3RD_BUTTON_PRESSED 0x0008
  70. #define FROM_LEFT_4TH_BUTTON_PRESSED 0x0010
  71. //
  72. // EventFlags
  73. //
  74. #define MOUSE_MOVED 0x0001
  75. #define DOUBLE_CLICK 0x0002
  76. #define MOUSE_WHEELED 0x0004
  77. typedef struct _WINDOW_BUFFER_SIZE_RECORD {
  78. COORD dwSize;
  79. } WINDOW_BUFFER_SIZE_RECORD, *PWINDOW_BUFFER_SIZE_RECORD;
  80. typedef struct _MENU_EVENT_RECORD {
  81. UINT dwCommandId;
  82. } MENU_EVENT_RECORD, *PMENU_EVENT_RECORD;
  83. typedef struct _FOCUS_EVENT_RECORD {
  84. BOOL bSetFocus;
  85. } FOCUS_EVENT_RECORD, *PFOCUS_EVENT_RECORD;
  86. typedef struct _INPUT_RECORD {
  87. WORD EventType;
  88. union {
  89. KEY_EVENT_RECORD KeyEvent;
  90. MOUSE_EVENT_RECORD MouseEvent;
  91. WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
  92. MENU_EVENT_RECORD MenuEvent;
  93. FOCUS_EVENT_RECORD FocusEvent;
  94. } Event;
  95. } INPUT_RECORD, *PINPUT_RECORD;
  96. //
  97. // EventType flags:
  98. //
  99. #define KEY_EVENT 0x0001 // Event contains key event record
  100. #define MOUSE_EVENT 0x0002 // Event contains mouse event record
  101. #define WINDOW_BUFFER_SIZE_EVENT 0x0004 // Event contains window change event record
  102. #define MENU_EVENT 0x0008 // Event contains menu event record
  103. #define FOCUS_EVENT 0x0010 // event contains focus change
  104. typedef struct _CHAR_INFO {
  105. union {
  106. WCHAR UnicodeChar;
  107. CHAR AsciiChar;
  108. } Char;
  109. WORD Attributes;
  110. } CHAR_INFO, *PCHAR_INFO;
  111. //
  112. // Attributes flags:
  113. //
  114. #define FOREGROUND_BLUE 0x0001 // text color contains blue.
  115. #define FOREGROUND_GREEN 0x0002 // text color contains green.
  116. #define FOREGROUND_RED 0x0004 // text color contains red.
  117. #define FOREGROUND_INTENSITY 0x0008 // text color is intensified.
  118. #define BACKGROUND_BLUE 0x0010 // background color contains blue.
  119. #define BACKGROUND_GREEN 0x0020 // background color contains green.
  120. #define BACKGROUND_RED 0x0040 // background color contains red.
  121. #define BACKGROUND_INTENSITY 0x0080 // background color is intensified.
  122. #define COMMON_LVB_LEADING_BYTE 0x0100 // Leading Byte of DBCS
  123. #define COMMON_LVB_TRAILING_BYTE 0x0200 // Trailing Byte of DBCS
  124. #define COMMON_LVB_GRID_HORIZONTAL 0x0400 // DBCS: Grid attribute: top horizontal.
  125. #define COMMON_LVB_GRID_LVERTICAL 0x0800 // DBCS: Grid attribute: left vertical.
  126. #define COMMON_LVB_GRID_RVERTICAL 0x1000 // DBCS: Grid attribute: right vertical.
  127. #define COMMON_LVB_REVERSE_VIDEO 0x4000 // DBCS: Reverse fore/back ground attribute.
  128. #define COMMON_LVB_UNDERSCORE 0x8000 // DBCS: Underscore.
  129. #define COMMON_LVB_SBCSDBCS 0x0300 // SBCS or DBCS flag.
  130. typedef struct _CONSOLE_SCREEN_BUFFER_INFO {
  131. COORD dwSize;
  132. COORD dwCursorPosition;
  133. WORD wAttributes;
  134. SMALL_RECT srWindow;
  135. COORD dwMaximumWindowSize;
  136. } CONSOLE_SCREEN_BUFFER_INFO, *PCONSOLE_SCREEN_BUFFER_INFO;
  137. typedef struct _CONSOLE_CURSOR_INFO {
  138. DWORD dwSize;
  139. BOOL bVisible;
  140. } CONSOLE_CURSOR_INFO, *PCONSOLE_CURSOR_INFO;
  141. typedef struct _CONSOLE_FONT_INFO {
  142. DWORD nFont;
  143. COORD dwFontSize;
  144. } CONSOLE_FONT_INFO, *PCONSOLE_FONT_INFO;
  145. #if(_WIN32_WINNT >= 0x0500)
  146. typedef struct _CONSOLE_SELECTION_INFO {
  147. DWORD dwFlags;
  148. COORD dwSelectionAnchor;
  149. SMALL_RECT srSelection;
  150. } CONSOLE_SELECTION_INFO, *PCONSOLE_SELECTION_INFO;
  151. //
  152. // Selection flags
  153. //
  154. #define CONSOLE_NO_SELECTION 0x0000
  155. #define CONSOLE_SELECTION_IN_PROGRESS 0x0001 // selection has begun
  156. #define CONSOLE_SELECTION_NOT_EMPTY 0x0002 // non-null select rectangle
  157. #define CONSOLE_MOUSE_SELECTION 0x0004 // selecting with mouse
  158. #define CONSOLE_MOUSE_DOWN 0x0008 // mouse is down
  159. #endif /* _WIN32_WINNT >= 0x0500 */
  160. //
  161. // typedef for ctrl-c handler routines
  162. //
  163. typedef
  164. BOOL
  165. (WINAPI *PHANDLER_ROUTINE)(
  166. DWORD CtrlType
  167. );
  168. #define CTRL_C_EVENT 0
  169. #define CTRL_BREAK_EVENT 1
  170. #define CTRL_CLOSE_EVENT 2
  171. // 3 is reserved!
  172. // 4 is reserved!
  173. #define CTRL_LOGOFF_EVENT 5
  174. #define CTRL_SHUTDOWN_EVENT 6
  175. //
  176. // Input Mode flags:
  177. //
  178. #define ENABLE_PROCESSED_INPUT 0x0001
  179. #define ENABLE_LINE_INPUT 0x0002
  180. #define ENABLE_ECHO_INPUT 0x0004
  181. #define ENABLE_WINDOW_INPUT 0x0008
  182. #define ENABLE_MOUSE_INPUT 0x0010
  183. //
  184. // Output Mode flags:
  185. //
  186. #define ENABLE_PROCESSED_OUTPUT 0x0001
  187. #define ENABLE_WRAP_AT_EOL_OUTPUT 0x0002
  188. //
  189. // direct API definitions.
  190. //
  191. WINBASEAPI
  192. BOOL
  193. WINAPI
  194. PeekConsoleInputA(
  195. IN HANDLE hConsoleInput,
  196. OUT PINPUT_RECORD lpBuffer,
  197. IN DWORD nLength,
  198. OUT LPDWORD lpNumberOfEventsRead
  199. );
  200. WINBASEAPI
  201. BOOL
  202. WINAPI
  203. PeekConsoleInputW(
  204. IN HANDLE hConsoleInput,
  205. OUT PINPUT_RECORD lpBuffer,
  206. IN DWORD nLength,
  207. OUT LPDWORD lpNumberOfEventsRead
  208. );
  209. #ifdef UNICODE
  210. #define PeekConsoleInput PeekConsoleInputW
  211. #else
  212. #define PeekConsoleInput PeekConsoleInputA
  213. #endif // !UNICODE
  214. WINBASEAPI
  215. BOOL
  216. WINAPI
  217. ReadConsoleInputA(
  218. IN HANDLE hConsoleInput,
  219. OUT PINPUT_RECORD lpBuffer,
  220. IN DWORD nLength,
  221. OUT LPDWORD lpNumberOfEventsRead
  222. );
  223. WINBASEAPI
  224. BOOL
  225. WINAPI
  226. ReadConsoleInputW(
  227. IN HANDLE hConsoleInput,
  228. OUT PINPUT_RECORD lpBuffer,
  229. IN DWORD nLength,
  230. OUT LPDWORD lpNumberOfEventsRead
  231. );
  232. #ifdef UNICODE
  233. #define ReadConsoleInput ReadConsoleInputW
  234. #else
  235. #define ReadConsoleInput ReadConsoleInputA
  236. #endif // !UNICODE
  237. WINBASEAPI
  238. BOOL
  239. WINAPI
  240. WriteConsoleInputA(
  241. IN HANDLE hConsoleInput,
  242. IN CONST INPUT_RECORD *lpBuffer,
  243. IN DWORD nLength,
  244. OUT LPDWORD lpNumberOfEventsWritten
  245. );
  246. WINBASEAPI
  247. BOOL
  248. WINAPI
  249. WriteConsoleInputW(
  250. IN HANDLE hConsoleInput,
  251. IN CONST INPUT_RECORD *lpBuffer,
  252. IN DWORD nLength,
  253. OUT LPDWORD lpNumberOfEventsWritten
  254. );
  255. #ifdef UNICODE
  256. #define WriteConsoleInput WriteConsoleInputW
  257. #else
  258. #define WriteConsoleInput WriteConsoleInputA
  259. #endif // !UNICODE
  260. WINBASEAPI
  261. BOOL
  262. WINAPI
  263. ReadConsoleOutputA(
  264. IN HANDLE hConsoleOutput,
  265. OUT PCHAR_INFO lpBuffer,
  266. IN COORD dwBufferSize,
  267. IN COORD dwBufferCoord,
  268. IN OUT PSMALL_RECT lpReadRegion
  269. );
  270. WINBASEAPI
  271. BOOL
  272. WINAPI
  273. ReadConsoleOutputW(
  274. IN HANDLE hConsoleOutput,
  275. OUT PCHAR_INFO lpBuffer,
  276. IN COORD dwBufferSize,
  277. IN COORD dwBufferCoord,
  278. IN OUT PSMALL_RECT lpReadRegion
  279. );
  280. #ifdef UNICODE
  281. #define ReadConsoleOutput ReadConsoleOutputW
  282. #else
  283. #define ReadConsoleOutput ReadConsoleOutputA
  284. #endif // !UNICODE
  285. WINBASEAPI
  286. BOOL
  287. WINAPI
  288. WriteConsoleOutputA(
  289. IN HANDLE hConsoleOutput,
  290. IN CONST CHAR_INFO *lpBuffer,
  291. IN COORD dwBufferSize,
  292. IN COORD dwBufferCoord,
  293. IN OUT PSMALL_RECT lpWriteRegion
  294. );
  295. WINBASEAPI
  296. BOOL
  297. WINAPI
  298. WriteConsoleOutputW(
  299. IN HANDLE hConsoleOutput,
  300. IN CONST CHAR_INFO *lpBuffer,
  301. IN COORD dwBufferSize,
  302. IN COORD dwBufferCoord,
  303. IN OUT PSMALL_RECT lpWriteRegion
  304. );
  305. #ifdef UNICODE
  306. #define WriteConsoleOutput WriteConsoleOutputW
  307. #else
  308. #define WriteConsoleOutput WriteConsoleOutputA
  309. #endif // !UNICODE
  310. WINBASEAPI
  311. BOOL
  312. WINAPI
  313. ReadConsoleOutputCharacterA(
  314. IN HANDLE hConsoleOutput,
  315. OUT LPSTR lpCharacter,
  316. IN DWORD nLength,
  317. IN COORD dwReadCoord,
  318. OUT LPDWORD lpNumberOfCharsRead
  319. );
  320. WINBASEAPI
  321. BOOL
  322. WINAPI
  323. ReadConsoleOutputCharacterW(
  324. IN HANDLE hConsoleOutput,
  325. OUT LPWSTR lpCharacter,
  326. IN DWORD nLength,
  327. IN COORD dwReadCoord,
  328. OUT LPDWORD lpNumberOfCharsRead
  329. );
  330. #ifdef UNICODE
  331. #define ReadConsoleOutputCharacter ReadConsoleOutputCharacterW
  332. #else
  333. #define ReadConsoleOutputCharacter ReadConsoleOutputCharacterA
  334. #endif // !UNICODE
  335. WINBASEAPI
  336. BOOL
  337. WINAPI
  338. ReadConsoleOutputAttribute(
  339. IN HANDLE hConsoleOutput,
  340. OUT LPWORD lpAttribute,
  341. IN DWORD nLength,
  342. IN COORD dwReadCoord,
  343. OUT LPDWORD lpNumberOfAttrsRead
  344. );
  345. WINBASEAPI
  346. BOOL
  347. WINAPI
  348. WriteConsoleOutputCharacterA(
  349. IN HANDLE hConsoleOutput,
  350. IN LPCSTR lpCharacter,
  351. IN DWORD nLength,
  352. IN COORD dwWriteCoord,
  353. OUT LPDWORD lpNumberOfCharsWritten
  354. );
  355. WINBASEAPI
  356. BOOL
  357. WINAPI
  358. WriteConsoleOutputCharacterW(
  359. IN HANDLE hConsoleOutput,
  360. IN LPCWSTR lpCharacter,
  361. IN DWORD nLength,
  362. IN COORD dwWriteCoord,
  363. OUT LPDWORD lpNumberOfCharsWritten
  364. );
  365. #ifdef UNICODE
  366. #define WriteConsoleOutputCharacter WriteConsoleOutputCharacterW
  367. #else
  368. #define WriteConsoleOutputCharacter WriteConsoleOutputCharacterA
  369. #endif // !UNICODE
  370. WINBASEAPI
  371. BOOL
  372. WINAPI
  373. WriteConsoleOutputAttribute(
  374. IN HANDLE hConsoleOutput,
  375. IN CONST WORD *lpAttribute,
  376. IN DWORD nLength,
  377. IN COORD dwWriteCoord,
  378. OUT LPDWORD lpNumberOfAttrsWritten
  379. );
  380. WINBASEAPI
  381. BOOL
  382. WINAPI
  383. FillConsoleOutputCharacterA(
  384. IN HANDLE hConsoleOutput,
  385. IN CHAR cCharacter,
  386. IN DWORD nLength,
  387. IN COORD dwWriteCoord,
  388. OUT LPDWORD lpNumberOfCharsWritten
  389. );
  390. WINBASEAPI
  391. BOOL
  392. WINAPI
  393. FillConsoleOutputCharacterW(
  394. IN HANDLE hConsoleOutput,
  395. IN WCHAR cCharacter,
  396. IN DWORD nLength,
  397. IN COORD dwWriteCoord,
  398. OUT LPDWORD lpNumberOfCharsWritten
  399. );
  400. #ifdef UNICODE
  401. #define FillConsoleOutputCharacter FillConsoleOutputCharacterW
  402. #else
  403. #define FillConsoleOutputCharacter FillConsoleOutputCharacterA
  404. #endif // !UNICODE
  405. WINBASEAPI
  406. BOOL
  407. WINAPI
  408. FillConsoleOutputAttribute(
  409. IN HANDLE hConsoleOutput,
  410. IN WORD wAttribute,
  411. IN DWORD nLength,
  412. IN COORD dwWriteCoord,
  413. OUT LPDWORD lpNumberOfAttrsWritten
  414. );
  415. WINBASEAPI
  416. BOOL
  417. WINAPI
  418. GetConsoleMode(
  419. IN HANDLE hConsoleHandle,
  420. OUT LPDWORD lpMode
  421. );
  422. WINBASEAPI
  423. BOOL
  424. WINAPI
  425. GetNumberOfConsoleInputEvents(
  426. IN HANDLE hConsoleInput,
  427. OUT LPDWORD lpNumberOfEvents
  428. );
  429. WINBASEAPI
  430. BOOL
  431. WINAPI
  432. GetConsoleScreenBufferInfo(
  433. IN HANDLE hConsoleOutput,
  434. OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo
  435. );
  436. WINBASEAPI
  437. COORD
  438. WINAPI
  439. GetLargestConsoleWindowSize(
  440. IN HANDLE hConsoleOutput
  441. );
  442. WINBASEAPI
  443. BOOL
  444. WINAPI
  445. GetConsoleCursorInfo(
  446. IN HANDLE hConsoleOutput,
  447. OUT PCONSOLE_CURSOR_INFO lpConsoleCursorInfo
  448. );
  449. #if(_WIN32_WINNT >= 0x0500)
  450. WINBASEAPI
  451. BOOL
  452. WINAPI
  453. GetCurrentConsoleFont(
  454. IN HANDLE hConsoleOutput,
  455. IN BOOL bMaximumWindow,
  456. OUT PCONSOLE_FONT_INFO lpConsoleCurrentFont
  457. );
  458. WINBASEAPI
  459. COORD
  460. WINAPI
  461. GetConsoleFontSize(
  462. IN HANDLE hConsoleOutput,
  463. IN DWORD nFont
  464. );
  465. WINBASEAPI
  466. BOOL
  467. WINAPI
  468. GetConsoleSelectionInfo(
  469. OUT PCONSOLE_SELECTION_INFO lpConsoleSelectionInfo
  470. );
  471. #endif /* _WIN32_WINNT >= 0x0500 */
  472. WINBASEAPI
  473. BOOL
  474. WINAPI
  475. GetNumberOfConsoleMouseButtons(
  476. OUT LPDWORD lpNumberOfMouseButtons
  477. );
  478. WINBASEAPI
  479. BOOL
  480. WINAPI
  481. SetConsoleMode(
  482. IN HANDLE hConsoleHandle,
  483. IN DWORD dwMode
  484. );
  485. WINBASEAPI
  486. BOOL
  487. WINAPI
  488. SetConsoleActiveScreenBuffer(
  489. IN HANDLE hConsoleOutput
  490. );
  491. WINBASEAPI
  492. BOOL
  493. WINAPI
  494. FlushConsoleInputBuffer(
  495. IN HANDLE hConsoleInput
  496. );
  497. WINBASEAPI
  498. BOOL
  499. WINAPI
  500. SetConsoleScreenBufferSize(
  501. IN HANDLE hConsoleOutput,
  502. IN COORD dwSize
  503. );
  504. WINBASEAPI
  505. BOOL
  506. WINAPI
  507. SetConsoleCursorPosition(
  508. IN HANDLE hConsoleOutput,
  509. IN COORD dwCursorPosition
  510. );
  511. WINBASEAPI
  512. BOOL
  513. WINAPI
  514. SetConsoleCursorInfo(
  515. IN HANDLE hConsoleOutput,
  516. IN CONST CONSOLE_CURSOR_INFO *lpConsoleCursorInfo
  517. );
  518. WINBASEAPI
  519. BOOL
  520. WINAPI
  521. ScrollConsoleScreenBufferA(
  522. IN HANDLE hConsoleOutput,
  523. IN CONST SMALL_RECT *lpScrollRectangle,
  524. IN CONST SMALL_RECT *lpClipRectangle,
  525. IN COORD dwDestinationOrigin,
  526. IN CONST CHAR_INFO *lpFill
  527. );
  528. WINBASEAPI
  529. BOOL
  530. WINAPI
  531. ScrollConsoleScreenBufferW(
  532. IN HANDLE hConsoleOutput,
  533. IN CONST SMALL_RECT *lpScrollRectangle,
  534. IN CONST SMALL_RECT *lpClipRectangle,
  535. IN COORD dwDestinationOrigin,
  536. IN CONST CHAR_INFO *lpFill
  537. );
  538. #ifdef UNICODE
  539. #define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferW
  540. #else
  541. #define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferA
  542. #endif // !UNICODE
  543. WINBASEAPI
  544. BOOL
  545. WINAPI
  546. SetConsoleWindowInfo(
  547. IN HANDLE hConsoleOutput,
  548. IN BOOL bAbsolute,
  549. IN CONST SMALL_RECT *lpConsoleWindow
  550. );
  551. WINBASEAPI
  552. BOOL
  553. WINAPI
  554. SetConsoleTextAttribute(
  555. IN HANDLE hConsoleOutput,
  556. IN WORD wAttributes
  557. );
  558. WINBASEAPI
  559. BOOL
  560. WINAPI
  561. SetConsoleCtrlHandler(
  562. IN PHANDLER_ROUTINE HandlerRoutine,
  563. IN BOOL Add
  564. );
  565. WINBASEAPI
  566. BOOL
  567. WINAPI
  568. GenerateConsoleCtrlEvent(
  569. IN DWORD dwCtrlEvent,
  570. IN DWORD dwProcessGroupId
  571. );
  572. WINBASEAPI
  573. BOOL
  574. WINAPI
  575. AllocConsole( VOID );
  576. WINBASEAPI
  577. BOOL
  578. WINAPI
  579. FreeConsole( VOID );
  580. #if(_WIN32_WINNT >= 0x0500)
  581. WINBASEAPI
  582. BOOL
  583. WINAPI
  584. AttachConsole(
  585. IN DWORD dwProcessId
  586. );
  587. #endif /* _WIN32_WINNT >= 0x0500 */
  588. WINBASEAPI
  589. DWORD
  590. WINAPI
  591. GetConsoleTitleA(
  592. OUT LPSTR lpConsoleTitle,
  593. IN DWORD nSize
  594. );
  595. WINBASEAPI
  596. DWORD
  597. WINAPI
  598. GetConsoleTitleW(
  599. OUT LPWSTR lpConsoleTitle,
  600. IN DWORD nSize
  601. );
  602. #ifdef UNICODE
  603. #define GetConsoleTitle GetConsoleTitleW
  604. #else
  605. #define GetConsoleTitle GetConsoleTitleA
  606. #endif // !UNICODE
  607. WINBASEAPI
  608. BOOL
  609. WINAPI
  610. SetConsoleTitleA(
  611. IN LPCSTR lpConsoleTitle
  612. );
  613. WINBASEAPI
  614. BOOL
  615. WINAPI
  616. SetConsoleTitleW(
  617. IN LPCWSTR lpConsoleTitle
  618. );
  619. #ifdef UNICODE
  620. #define SetConsoleTitle SetConsoleTitleW
  621. #else
  622. #define SetConsoleTitle SetConsoleTitleA
  623. #endif // !UNICODE
  624. WINBASEAPI
  625. BOOL
  626. WINAPI
  627. ReadConsoleA(
  628. IN HANDLE hConsoleInput,
  629. OUT LPVOID lpBuffer,
  630. IN DWORD nNumberOfCharsToRead,
  631. OUT LPDWORD lpNumberOfCharsRead,
  632. IN LPVOID lpReserved
  633. );
  634. WINBASEAPI
  635. BOOL
  636. WINAPI
  637. ReadConsoleW(
  638. IN HANDLE hConsoleInput,
  639. OUT LPVOID lpBuffer,
  640. IN DWORD nNumberOfCharsToRead,
  641. OUT LPDWORD lpNumberOfCharsRead,
  642. IN LPVOID lpReserved
  643. );
  644. #ifdef UNICODE
  645. #define ReadConsole ReadConsoleW
  646. #else
  647. #define ReadConsole ReadConsoleA
  648. #endif // !UNICODE
  649. WINBASEAPI
  650. BOOL
  651. WINAPI
  652. WriteConsoleA(
  653. IN HANDLE hConsoleOutput,
  654. IN CONST VOID *lpBuffer,
  655. IN DWORD nNumberOfCharsToWrite,
  656. OUT LPDWORD lpNumberOfCharsWritten,
  657. IN LPVOID lpReserved
  658. );
  659. WINBASEAPI
  660. BOOL
  661. WINAPI
  662. WriteConsoleW(
  663. IN HANDLE hConsoleOutput,
  664. IN CONST VOID *lpBuffer,
  665. IN DWORD nNumberOfCharsToWrite,
  666. OUT LPDWORD lpNumberOfCharsWritten,
  667. IN LPVOID lpReserved
  668. );
  669. #ifdef UNICODE
  670. #define WriteConsole WriteConsoleW
  671. #else
  672. #define WriteConsole WriteConsoleA
  673. #endif // !UNICODE
  674. #define CONSOLE_TEXTMODE_BUFFER 1
  675. WINBASEAPI
  676. HANDLE
  677. WINAPI
  678. CreateConsoleScreenBuffer(
  679. IN DWORD dwDesiredAccess,
  680. IN DWORD dwShareMode,
  681. IN CONST SECURITY_ATTRIBUTES *lpSecurityAttributes,
  682. IN DWORD dwFlags,
  683. IN LPVOID lpScreenBufferData
  684. );
  685. WINBASEAPI
  686. UINT
  687. WINAPI
  688. GetConsoleCP( VOID );
  689. WINBASEAPI
  690. BOOL
  691. WINAPI
  692. SetConsoleCP(
  693. IN UINT wCodePageID
  694. );
  695. WINBASEAPI
  696. UINT
  697. WINAPI
  698. GetConsoleOutputCP( VOID );
  699. WINBASEAPI
  700. BOOL
  701. WINAPI
  702. SetConsoleOutputCP(
  703. IN UINT wCodePageID
  704. );
  705. #if(_WIN32_WINNT >= 0x0500)
  706. #define CONSOLE_FULLSCREEN 1 // fullscreen console
  707. #define CONSOLE_FULLSCREEN_HARDWARE 2 // console owns the hardware
  708. WINBASEAPI
  709. BOOL
  710. APIENTRY
  711. GetConsoleDisplayMode(
  712. OUT LPDWORD lpModeFlags
  713. );
  714. WINBASEAPI
  715. HWND
  716. APIENTRY
  717. GetConsoleWindow(
  718. VOID
  719. );
  720. #endif /* _WIN32_WINNT >= 0x0500 */
  721. #if(_WIN32_WINNT >= 0x0501)
  722. WINBASEAPI
  723. DWORD
  724. APIENTRY
  725. GetConsoleProcessList(
  726. OUT LPDWORD lpdwProcessList,
  727. IN DWORD dwProcessCount);
  728. #endif /* _WIN32_WINNT >= 0x0501 */
  729. #ifdef __cplusplus
  730. }
  731. #endif
  732. #endif // _WINCON_