Leaked source code of windows server 2003
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.

899 lines
20 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. #ifndef _WINCONP_ ;internal_NT
  15. #define _WINCONP_ ;internal_NT
  16. ;internal_NT
  17. ;begin_both
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. ;end_both
  22. typedef struct _COORD {
  23. SHORT X;
  24. SHORT Y;
  25. } COORD, *PCOORD;
  26. typedef struct _SMALL_RECT {
  27. SHORT Left;
  28. SHORT Top;
  29. SHORT Right;
  30. SHORT Bottom;
  31. } SMALL_RECT, *PSMALL_RECT;
  32. typedef struct _KEY_EVENT_RECORD {
  33. BOOL bKeyDown;
  34. WORD wRepeatCount;
  35. WORD wVirtualKeyCode;
  36. WORD wVirtualScanCode;
  37. union {
  38. WCHAR UnicodeChar;
  39. CHAR AsciiChar;
  40. } uChar;
  41. DWORD dwControlKeyState;
  42. } KEY_EVENT_RECORD, *PKEY_EVENT_RECORD;
  43. //
  44. // ControlKeyState flags
  45. //
  46. #define RIGHT_ALT_PRESSED 0x0001 // the right alt key is pressed.
  47. #define LEFT_ALT_PRESSED 0x0002 // the left alt key is pressed.
  48. #define RIGHT_CTRL_PRESSED 0x0004 // the right ctrl key is pressed.
  49. #define LEFT_CTRL_PRESSED 0x0008 // the left ctrl key is pressed.
  50. #define SHIFT_PRESSED 0x0010 // the shift key is pressed.
  51. #define NUMLOCK_ON 0x0020 // the numlock light is on.
  52. #define SCROLLLOCK_ON 0x0040 // the scrolllock light is on.
  53. #define CAPSLOCK_ON 0x0080 // the capslock light is on.
  54. #define ENHANCED_KEY 0x0100 // the key is enhanced.
  55. #define NLS_DBCSCHAR 0x00010000 // DBCS for JPN: SBCS/DBCS mode.
  56. #define NLS_ALPHANUMERIC 0x00000000 // DBCS for JPN: Alphanumeric mode.
  57. #define NLS_KATAKANA 0x00020000 // DBCS for JPN: Katakana mode.
  58. #define NLS_HIRAGANA 0x00040000 // DBCS for JPN: Hiragana mode.
  59. #define NLS_ROMAN 0x00400000 // DBCS for JPN: Roman/Noroman mode.
  60. #define NLS_IME_CONVERSION 0x00800000 // DBCS for JPN: IME conversion.
  61. #define ALTNUMPAD_BIT 0x04000000 // AltNumpad OEM char (copied from ntuser\inc\kbd.h) ;internal_NT
  62. #define NLS_IME_DISABLE 0x20000000 // DBCS for JPN: IME enable/disable.
  63. typedef struct _MOUSE_EVENT_RECORD {
  64. COORD dwMousePosition;
  65. DWORD dwButtonState;
  66. DWORD dwControlKeyState;
  67. DWORD dwEventFlags;
  68. } MOUSE_EVENT_RECORD, *PMOUSE_EVENT_RECORD;
  69. //
  70. // ButtonState flags
  71. //
  72. #define FROM_LEFT_1ST_BUTTON_PRESSED 0x0001
  73. #define RIGHTMOST_BUTTON_PRESSED 0x0002
  74. #define FROM_LEFT_2ND_BUTTON_PRESSED 0x0004
  75. #define FROM_LEFT_3RD_BUTTON_PRESSED 0x0008
  76. #define FROM_LEFT_4TH_BUTTON_PRESSED 0x0010
  77. //
  78. // EventFlags
  79. //
  80. #define MOUSE_MOVED 0x0001
  81. #define DOUBLE_CLICK 0x0002
  82. #define MOUSE_WHEELED 0x0004
  83. typedef struct _WINDOW_BUFFER_SIZE_RECORD {
  84. COORD dwSize;
  85. } WINDOW_BUFFER_SIZE_RECORD, *PWINDOW_BUFFER_SIZE_RECORD;
  86. typedef struct _MENU_EVENT_RECORD {
  87. UINT dwCommandId;
  88. } MENU_EVENT_RECORD, *PMENU_EVENT_RECORD;
  89. typedef struct _FOCUS_EVENT_RECORD {
  90. BOOL bSetFocus;
  91. } FOCUS_EVENT_RECORD, *PFOCUS_EVENT_RECORD;
  92. typedef struct _INPUT_RECORD {
  93. WORD EventType;
  94. union {
  95. KEY_EVENT_RECORD KeyEvent;
  96. MOUSE_EVENT_RECORD MouseEvent;
  97. WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
  98. MENU_EVENT_RECORD MenuEvent;
  99. FOCUS_EVENT_RECORD FocusEvent;
  100. } Event;
  101. } INPUT_RECORD, *PINPUT_RECORD;
  102. //
  103. // EventType flags:
  104. //
  105. #define KEY_EVENT 0x0001 // Event contains key event record
  106. #define MOUSE_EVENT 0x0002 // Event contains mouse event record
  107. #define WINDOW_BUFFER_SIZE_EVENT 0x0004 // Event contains window change event record
  108. #define MENU_EVENT 0x0008 // Event contains menu event record
  109. #define FOCUS_EVENT 0x0010 // event contains focus change
  110. typedef struct _CHAR_INFO {
  111. union {
  112. WCHAR UnicodeChar;
  113. CHAR AsciiChar;
  114. } Char;
  115. WORD Attributes;
  116. } CHAR_INFO, *PCHAR_INFO;
  117. //
  118. // Attributes flags:
  119. //
  120. #define FOREGROUND_BLUE 0x0001 // text color contains blue.
  121. #define FOREGROUND_GREEN 0x0002 // text color contains green.
  122. #define FOREGROUND_RED 0x0004 // text color contains red.
  123. #define FOREGROUND_INTENSITY 0x0008 // text color is intensified.
  124. #define BACKGROUND_BLUE 0x0010 // background color contains blue.
  125. #define BACKGROUND_GREEN 0x0020 // background color contains green.
  126. #define BACKGROUND_RED 0x0040 // background color contains red.
  127. #define BACKGROUND_INTENSITY 0x0080 // background color is intensified.
  128. #define COMMON_LVB_LEADING_BYTE 0x0100 // Leading Byte of DBCS
  129. #define COMMON_LVB_TRAILING_BYTE 0x0200 // Trailing Byte of DBCS
  130. #define COMMON_LVB_GRID_HORIZONTAL 0x0400 // DBCS: Grid attribute: top horizontal.
  131. #define COMMON_LVB_GRID_LVERTICAL 0x0800 // DBCS: Grid attribute: left vertical.
  132. #define COMMON_LVB_GRID_RVERTICAL 0x1000 // DBCS: Grid attribute: right vertical.
  133. #define COMMON_LVB_REVERSE_VIDEO 0x4000 // DBCS: Reverse fore/back ground attribute.
  134. #define COMMON_LVB_UNDERSCORE 0x8000 // DBCS: Underscore.
  135. #define COMMON_LVB_SBCSDBCS 0x0300 // SBCS or DBCS flag.
  136. typedef struct _CONSOLE_SCREEN_BUFFER_INFO {
  137. COORD dwSize;
  138. COORD dwCursorPosition;
  139. WORD wAttributes;
  140. SMALL_RECT srWindow;
  141. COORD dwMaximumWindowSize;
  142. } CONSOLE_SCREEN_BUFFER_INFO, *PCONSOLE_SCREEN_BUFFER_INFO;
  143. typedef struct _CONSOLE_CURSOR_INFO {
  144. DWORD dwSize;
  145. BOOL bVisible;
  146. } CONSOLE_CURSOR_INFO, *PCONSOLE_CURSOR_INFO;
  147. typedef struct _CONSOLE_FONT_INFO {
  148. DWORD nFont;
  149. COORD dwFontSize;
  150. } CONSOLE_FONT_INFO, *PCONSOLE_FONT_INFO;
  151. ;begin_if_(_WIN32_WINNT)_500
  152. typedef struct _CONSOLE_SELECTION_INFO {
  153. DWORD dwFlags;
  154. COORD dwSelectionAnchor;
  155. SMALL_RECT srSelection;
  156. } CONSOLE_SELECTION_INFO, *PCONSOLE_SELECTION_INFO;
  157. //
  158. // Selection flags
  159. //
  160. #define CONSOLE_NO_SELECTION 0x0000
  161. #define CONSOLE_SELECTION_IN_PROGRESS 0x0001 // selection has begun
  162. #define CONSOLE_SELECTION_NOT_EMPTY 0x0002 // non-null select rectangle
  163. #define CONSOLE_MOUSE_SELECTION 0x0004 // selecting with mouse
  164. #define CONSOLE_MOUSE_DOWN 0x0008 // mouse is down
  165. ;begin_internal_NT
  166. #define CONSOLE_SELECTION_INVERTED 0x0010 // selection is inverted (turned off)
  167. #define CONSOLE_SELECTION_VALID (CONSOLE_SELECTION_IN_PROGRESS | \
  168. CONSOLE_SELECTION_NOT_EMPTY | \
  169. CONSOLE_MOUSE_SELECTION | \
  170. CONSOLE_MOUSE_DOWN)
  171. ;end_internal_NT
  172. ;end_if_(_WIN32_WINNT)_500
  173. //
  174. // typedef for ctrl-c handler routines
  175. //
  176. typedef
  177. BOOL
  178. (WINAPI *PHANDLER_ROUTINE)(
  179. DWORD CtrlType
  180. );
  181. #define CTRL_C_EVENT 0
  182. #define CTRL_BREAK_EVENT 1
  183. #define CTRL_CLOSE_EVENT 2
  184. // 3 is reserved!
  185. // 4 is reserved!
  186. #define CTRL_LOGOFF_EVENT 5
  187. #define CTRL_SHUTDOWN_EVENT 6
  188. //
  189. // Input Mode flags:
  190. //
  191. #define ENABLE_PROCESSED_INPUT 0x0001
  192. #define ENABLE_LINE_INPUT 0x0002
  193. #define ENABLE_ECHO_INPUT 0x0004
  194. #define ENABLE_WINDOW_INPUT 0x0008
  195. #define ENABLE_MOUSE_INPUT 0x0010
  196. ;begin_internal_NT
  197. #define ENABLE_INSERT_MODE 0x0020
  198. #define ENABLE_QUICK_EDIT_MODE 0x0040
  199. #define ENABLE_PRIVATE_FLAGS 0x0080
  200. ;end_internal_NT
  201. //
  202. // Output Mode flags:
  203. //
  204. #define ENABLE_PROCESSED_OUTPUT 0x0001
  205. #define ENABLE_WRAP_AT_EOL_OUTPUT 0x0002
  206. //
  207. // direct API definitions.
  208. //
  209. WINBASEAPI
  210. BOOL
  211. WINAPI
  212. PeekConsoleInput%(
  213. IN HANDLE hConsoleInput,
  214. OUT PINPUT_RECORD lpBuffer,
  215. IN DWORD nLength,
  216. OUT LPDWORD lpNumberOfEventsRead
  217. );
  218. WINBASEAPI
  219. BOOL
  220. WINAPI
  221. ReadConsoleInput%(
  222. IN HANDLE hConsoleInput,
  223. OUT PINPUT_RECORD lpBuffer,
  224. IN DWORD nLength,
  225. OUT LPDWORD lpNumberOfEventsRead
  226. );
  227. WINBASEAPI
  228. BOOL
  229. WINAPI
  230. WriteConsoleInput%(
  231. IN HANDLE hConsoleInput,
  232. IN CONST INPUT_RECORD *lpBuffer,
  233. IN DWORD nLength,
  234. OUT LPDWORD lpNumberOfEventsWritten
  235. );
  236. WINBASEAPI
  237. BOOL
  238. WINAPI
  239. ReadConsoleOutput%(
  240. IN HANDLE hConsoleOutput,
  241. OUT PCHAR_INFO lpBuffer,
  242. IN COORD dwBufferSize,
  243. IN COORD dwBufferCoord,
  244. IN OUT PSMALL_RECT lpReadRegion
  245. );
  246. WINBASEAPI
  247. BOOL
  248. WINAPI
  249. WriteConsoleOutput%(
  250. IN HANDLE hConsoleOutput,
  251. IN CONST CHAR_INFO *lpBuffer,
  252. IN COORD dwBufferSize,
  253. IN COORD dwBufferCoord,
  254. IN OUT PSMALL_RECT lpWriteRegion
  255. );
  256. WINBASEAPI
  257. BOOL
  258. WINAPI
  259. ReadConsoleOutputCharacter%(
  260. IN HANDLE hConsoleOutput,
  261. OUT LPTSTR% lpCharacter,
  262. IN DWORD nLength,
  263. IN COORD dwReadCoord,
  264. OUT LPDWORD lpNumberOfCharsRead
  265. );
  266. WINBASEAPI
  267. BOOL
  268. WINAPI
  269. ReadConsoleOutputAttribute(
  270. IN HANDLE hConsoleOutput,
  271. OUT LPWORD lpAttribute,
  272. IN DWORD nLength,
  273. IN COORD dwReadCoord,
  274. OUT LPDWORD lpNumberOfAttrsRead
  275. );
  276. WINBASEAPI
  277. BOOL
  278. WINAPI
  279. WriteConsoleOutputCharacter%(
  280. IN HANDLE hConsoleOutput,
  281. IN LPCTSTR% lpCharacter,
  282. IN DWORD nLength,
  283. IN COORD dwWriteCoord,
  284. OUT LPDWORD lpNumberOfCharsWritten
  285. );
  286. WINBASEAPI
  287. BOOL
  288. WINAPI
  289. WriteConsoleOutputAttribute(
  290. IN HANDLE hConsoleOutput,
  291. IN CONST WORD *lpAttribute,
  292. IN DWORD nLength,
  293. IN COORD dwWriteCoord,
  294. OUT LPDWORD lpNumberOfAttrsWritten
  295. );
  296. WINBASEAPI
  297. BOOL
  298. WINAPI
  299. FillConsoleOutputCharacter%(
  300. IN HANDLE hConsoleOutput,
  301. IN TCHAR% cCharacter,
  302. IN DWORD nLength,
  303. IN COORD dwWriteCoord,
  304. OUT LPDWORD lpNumberOfCharsWritten
  305. );
  306. WINBASEAPI
  307. BOOL
  308. WINAPI
  309. FillConsoleOutputAttribute(
  310. IN HANDLE hConsoleOutput,
  311. IN WORD wAttribute,
  312. IN DWORD nLength,
  313. IN COORD dwWriteCoord,
  314. OUT LPDWORD lpNumberOfAttrsWritten
  315. );
  316. WINBASEAPI
  317. BOOL
  318. WINAPI
  319. GetConsoleMode(
  320. IN HANDLE hConsoleHandle,
  321. OUT LPDWORD lpMode
  322. );
  323. WINBASEAPI
  324. BOOL
  325. WINAPI
  326. GetNumberOfConsoleInputEvents(
  327. IN HANDLE hConsoleInput,
  328. OUT LPDWORD lpNumberOfEvents
  329. );
  330. WINBASEAPI
  331. BOOL
  332. WINAPI
  333. GetConsoleScreenBufferInfo(
  334. IN HANDLE hConsoleOutput,
  335. OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo
  336. );
  337. WINBASEAPI
  338. COORD
  339. WINAPI
  340. GetLargestConsoleWindowSize(
  341. IN HANDLE hConsoleOutput
  342. );
  343. WINBASEAPI
  344. BOOL
  345. WINAPI
  346. GetConsoleCursorInfo(
  347. IN HANDLE hConsoleOutput,
  348. OUT PCONSOLE_CURSOR_INFO lpConsoleCursorInfo
  349. );
  350. ;begin_if_(_WIN32_WINNT)_500
  351. WINBASEAPI
  352. BOOL
  353. WINAPI
  354. GetCurrentConsoleFont(
  355. IN HANDLE hConsoleOutput,
  356. IN BOOL bMaximumWindow,
  357. OUT PCONSOLE_FONT_INFO lpConsoleCurrentFont
  358. );
  359. WINBASEAPI
  360. COORD
  361. WINAPI
  362. GetConsoleFontSize(
  363. IN HANDLE hConsoleOutput,
  364. IN DWORD nFont
  365. );
  366. WINBASEAPI
  367. BOOL
  368. WINAPI
  369. GetConsoleSelectionInfo(
  370. OUT PCONSOLE_SELECTION_INFO lpConsoleSelectionInfo
  371. );
  372. ;end_if_(_WIN32_WINNT)_500
  373. WINBASEAPI
  374. BOOL
  375. WINAPI
  376. GetNumberOfConsoleMouseButtons(
  377. OUT LPDWORD lpNumberOfMouseButtons
  378. );
  379. WINBASEAPI
  380. BOOL
  381. WINAPI
  382. SetConsoleMode(
  383. IN HANDLE hConsoleHandle,
  384. IN DWORD dwMode
  385. );
  386. WINBASEAPI
  387. BOOL
  388. WINAPI
  389. SetConsoleActiveScreenBuffer(
  390. IN HANDLE hConsoleOutput
  391. );
  392. WINBASEAPI
  393. BOOL
  394. WINAPI
  395. FlushConsoleInputBuffer(
  396. IN HANDLE hConsoleInput
  397. );
  398. WINBASEAPI
  399. BOOL
  400. WINAPI
  401. SetConsoleScreenBufferSize(
  402. IN HANDLE hConsoleOutput,
  403. IN COORD dwSize
  404. );
  405. WINBASEAPI
  406. BOOL
  407. WINAPI
  408. SetConsoleCursorPosition(
  409. IN HANDLE hConsoleOutput,
  410. IN COORD dwCursorPosition
  411. );
  412. WINBASEAPI
  413. BOOL
  414. WINAPI
  415. SetConsoleCursorInfo(
  416. IN HANDLE hConsoleOutput,
  417. IN CONST CONSOLE_CURSOR_INFO *lpConsoleCursorInfo
  418. );
  419. WINBASEAPI
  420. BOOL
  421. WINAPI
  422. ScrollConsoleScreenBuffer%(
  423. IN HANDLE hConsoleOutput,
  424. IN CONST SMALL_RECT *lpScrollRectangle,
  425. IN CONST SMALL_RECT *lpClipRectangle,
  426. IN COORD dwDestinationOrigin,
  427. IN CONST CHAR_INFO *lpFill
  428. );
  429. WINBASEAPI
  430. BOOL
  431. WINAPI
  432. SetConsoleWindowInfo(
  433. IN HANDLE hConsoleOutput,
  434. IN BOOL bAbsolute,
  435. IN CONST SMALL_RECT *lpConsoleWindow
  436. );
  437. WINBASEAPI
  438. BOOL
  439. WINAPI
  440. SetConsoleTextAttribute(
  441. IN HANDLE hConsoleOutput,
  442. IN WORD wAttributes
  443. );
  444. WINBASEAPI
  445. BOOL
  446. WINAPI
  447. SetConsoleCtrlHandler(
  448. IN PHANDLER_ROUTINE HandlerRoutine,
  449. IN BOOL Add
  450. );
  451. WINBASEAPI
  452. BOOL
  453. WINAPI
  454. GenerateConsoleCtrlEvent(
  455. IN DWORD dwCtrlEvent,
  456. IN DWORD dwProcessGroupId
  457. );
  458. WINBASEAPI
  459. BOOL
  460. WINAPI
  461. AllocConsole( VOID );
  462. WINBASEAPI
  463. BOOL
  464. WINAPI
  465. FreeConsole( VOID );
  466. ;begin_if_(_WIN32_WINNT)_500
  467. WINBASEAPI
  468. BOOL
  469. WINAPI
  470. AttachConsole(
  471. IN DWORD dwProcessId
  472. );
  473. #define ATTACH_PARENT_PROCESS ((DWORD)-1)
  474. ;end_if_(_WIN32_WINNT)_500
  475. WINBASEAPI
  476. DWORD
  477. WINAPI
  478. GetConsoleTitle%(
  479. OUT LPTSTR% lpConsoleTitle,
  480. IN DWORD nSize
  481. );
  482. WINBASEAPI
  483. BOOL
  484. WINAPI
  485. SetConsoleTitle%(
  486. IN LPCTSTR% lpConsoleTitle
  487. );
  488. WINBASEAPI
  489. BOOL
  490. WINAPI
  491. ReadConsole%(
  492. IN HANDLE hConsoleInput,
  493. OUT LPVOID lpBuffer,
  494. IN DWORD nNumberOfCharsToRead,
  495. OUT LPDWORD lpNumberOfCharsRead,
  496. IN LPVOID lpReserved
  497. );
  498. WINBASEAPI
  499. BOOL
  500. WINAPI
  501. WriteConsole%(
  502. IN HANDLE hConsoleOutput,
  503. IN CONST VOID *lpBuffer,
  504. IN DWORD nNumberOfCharsToWrite,
  505. OUT LPDWORD lpNumberOfCharsWritten,
  506. IN LPVOID lpReserved
  507. );
  508. #define CONSOLE_TEXTMODE_BUFFER 1
  509. WINBASEAPI
  510. HANDLE
  511. WINAPI
  512. CreateConsoleScreenBuffer(
  513. IN DWORD dwDesiredAccess,
  514. IN DWORD dwShareMode,
  515. IN CONST SECURITY_ATTRIBUTES *lpSecurityAttributes,
  516. IN DWORD dwFlags,
  517. IN LPVOID lpScreenBufferData
  518. );
  519. WINBASEAPI
  520. UINT
  521. WINAPI
  522. GetConsoleCP( VOID );
  523. WINBASEAPI
  524. BOOL
  525. WINAPI
  526. SetConsoleCP(
  527. IN UINT wCodePageID
  528. );
  529. WINBASEAPI
  530. UINT
  531. WINAPI
  532. GetConsoleOutputCP( VOID );
  533. WINBASEAPI
  534. BOOL
  535. WINAPI
  536. SetConsoleOutputCP(
  537. IN UINT wCodePageID
  538. );
  539. ;begin_if_(_WIN32_WINNT)_500
  540. #define CONSOLE_FULLSCREEN 1 // fullscreen console
  541. #define CONSOLE_FULLSCREEN_HARDWARE 2 // console owns the hardware
  542. WINBASEAPI
  543. BOOL
  544. APIENTRY
  545. GetConsoleDisplayMode(
  546. OUT LPDWORD lpModeFlags
  547. );
  548. WINBASEAPI
  549. HWND
  550. APIENTRY
  551. GetConsoleWindow(
  552. VOID
  553. );
  554. ;end_if_(_WIN32_WINNT)_500
  555. ;begin_if_(_WIN32_WINNT)_501
  556. WINBASEAPI
  557. DWORD
  558. APIENTRY
  559. GetConsoleProcessList(
  560. OUT LPDWORD lpdwProcessList,
  561. IN DWORD dwProcessCount);
  562. //
  563. // Aliasing apis.
  564. //
  565. WINBASEAPI
  566. BOOL
  567. APIENTRY
  568. AddConsoleAlias%(
  569. IN LPTSTR% Source,
  570. IN LPTSTR% Target,
  571. IN LPTSTR% ExeName);
  572. WINBASEAPI
  573. DWORD
  574. APIENTRY
  575. GetConsoleAlias%(
  576. IN LPTSTR% Source,
  577. OUT LPTSTR% TargetBuffer,
  578. IN DWORD TargetBufferLength,
  579. IN LPTSTR% ExeName);
  580. WINBASEAPI
  581. DWORD
  582. APIENTRY
  583. GetConsoleAliasesLength%(
  584. IN LPTSTR% ExeName);
  585. WINBASEAPI
  586. DWORD
  587. APIENTRY
  588. GetConsoleAliasExesLength%(
  589. VOID);
  590. WINBASEAPI
  591. DWORD
  592. APIENTRY
  593. GetConsoleAliases%(
  594. OUT LPTSTR% AliasBuffer,
  595. IN DWORD AliasBufferLength,
  596. IN LPTSTR% ExeName);
  597. WINBASEAPI
  598. DWORD
  599. APIENTRY
  600. GetConsoleAliasExes%(
  601. OUT LPTSTR% ExeNameBuffer,
  602. IN DWORD ExeNameBufferLength);
  603. ;end_if_(_WIN32_WINNT)_501
  604. ;begin_internal_NT
  605. WINBASEAPI
  606. BOOL
  607. WINAPI
  608. GetConsoleKeyboardLayoutName%( OUT LPTSTR% );
  609. //
  610. // Registry strings
  611. //
  612. #define CONSOLE_REGISTRY_STRING (L"Console")
  613. #define CONSOLE_REGISTRY_FONTSIZE (L"FontSize")
  614. #define CONSOLE_REGISTRY_FONTFAMILY (L"FontFamily")
  615. #define CONSOLE_REGISTRY_BUFFERSIZE (L"ScreenBufferSize")
  616. #define CONSOLE_REGISTRY_CURSORSIZE (L"CursorSize")
  617. #define CONSOLE_REGISTRY_WINDOWSIZE (L"WindowSize")
  618. #define CONSOLE_REGISTRY_WINDOWPOS (L"WindowPosition")
  619. #define CONSOLE_REGISTRY_FILLATTR (L"ScreenColors")
  620. #define CONSOLE_REGISTRY_POPUPATTR (L"PopupColors")
  621. #define CONSOLE_REGISTRY_FULLSCR (L"FullScreen")
  622. #define CONSOLE_REGISTRY_QUICKEDIT (L"QuickEdit")
  623. #define CONSOLE_REGISTRY_FACENAME (L"FaceName")
  624. #define CONSOLE_REGISTRY_FONTWEIGHT (L"FontWeight")
  625. #define CONSOLE_REGISTRY_INSERTMODE (L"InsertMode")
  626. #define CONSOLE_REGISTRY_HISTORYSIZE (L"HistoryBufferSize")
  627. #define CONSOLE_REGISTRY_HISTORYBUFS (L"NumberOfHistoryBuffers")
  628. #define CONSOLE_REGISTRY_HISTORYNODUP (L"HistoryNoDup")
  629. #define CONSOLE_REGISTRY_COLORTABLE (L"ColorTable%02u")
  630. #define CONSOLE_REGISTRY_EXTENDEDEDITKEY L"ExtendedEditKey"
  631. #define CONSOLE_REGISTRY_EXTENDEDEDITKEY_CUSTOM L"ExtendedEditkeyCustom"
  632. #define CONSOLE_REGISTRY_WORD_DELIM L"WordDelimiters"
  633. #define CONSOLE_REGISTRY_TRIMZEROHEADINGS L"TrimLeadingZeros"
  634. #define CONSOLE_REGISTRY_LOAD_CONIME L"LoadConIme"
  635. #define CONSOLE_REGISTRY_ENABLE_COLOR_SELECTION L"EnableColorSelection"
  636. #if defined(FE_SB) // scotthsu
  637. /*
  638. * Starting code page
  639. */
  640. #define CONSOLE_REGISTRY_CODEPAGE (L"CodePage")
  641. #endif
  642. #if defined(FE_SB)
  643. //
  644. // registry strings on HKEY_LOCAL_MACHINE
  645. //
  646. #define MACHINE_REGISTRY_CONSOLE (L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Console")
  647. #define MACHINE_REGISTRY_CONSOLEIME (L"ConsoleIME")
  648. #define MACHINE_REGISTRY_CONSOLE_TTFONT (L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Console\\TrueTypeFont")
  649. #define MACHINE_REGISTRY_CONSOLE_NLS (L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Console\\Nls")
  650. #define MACHINE_REGISTRY_CONSOLE_FULLSCREEN (L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Console\\FullScreen")
  651. #define MACHINE_REGISTRY_INITIAL_PALETTE (L"InitialPalette")
  652. #define MACHINE_REGISTRY_COLOR_BUFFER (L"ColorBuffer")
  653. #define MACHINE_REGISTRY_COLOR_BUFFER_NO_TRANSLATE (L"ColorBufferNoTranslate")
  654. #define MACHINE_REGISTRY_MODE_FONT_PAIRS (L"ModeFontPairs")
  655. #define MACHINE_REGISTRY_FS_CODEPAGE (L"CodePage")
  656. #define MACHINE_REGISTRY_EUDC (L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls\\CodePage\\EUDCCodeRange")
  657. //
  658. // TrueType font list
  659. //
  660. // doesn't available bold when add BOLD_MARK on first of face name.
  661. #define BOLD_MARK (L'*')
  662. typedef struct _TT_FONT_LIST {
  663. SINGLE_LIST_ENTRY List;
  664. UINT CodePage;
  665. BOOL fDisableBold;
  666. TCHAR FaceName1[LF_FACESIZE];
  667. TCHAR FaceName2[LF_FACESIZE];
  668. } TTFONTLIST, *LPTTFONTLIST;
  669. #endif // FE_SB
  670. //
  671. // State information structure
  672. //
  673. typedef struct _CONSOLE_STATE_INFO {
  674. UINT Length;
  675. COORD ScreenBufferSize;
  676. COORD WindowSize;
  677. INT WindowPosX;
  678. INT WindowPosY;
  679. COORD FontSize;
  680. UINT FontFamily;
  681. UINT FontWeight;
  682. WCHAR FaceName[LF_FACESIZE];
  683. UINT CursorSize;
  684. BOOL FullScreen;
  685. BOOL QuickEdit;
  686. BOOL AutoPosition;
  687. BOOL InsertMode;
  688. WORD ScreenAttributes;
  689. WORD PopupAttributes;
  690. BOOL HistoryNoDup;
  691. UINT HistoryBufferSize;
  692. UINT NumberOfHistoryBuffers;
  693. COLORREF ColorTable[ 16 ];
  694. #if defined(FE_SB)
  695. /*
  696. * Startting code page
  697. */
  698. UINT CodePage;
  699. #endif // FE_SB
  700. HWND hWnd;
  701. WCHAR ConsoleTitle[1];
  702. } CONSOLE_STATE_INFO, *PCONSOLE_STATE_INFO;
  703. //
  704. // Messages sent from properties applet to console server
  705. //
  706. #define CM_PROPERTIES_START (WM_USER+200)
  707. #define CM_PROPERTIES_UPDATE (WM_USER+201)
  708. #define CM_PROPERTIES_END (WM_USER+202)
  709. //
  710. // Extended Line Edit
  711. //
  712. #define EK_INVALID ' '
  713. //
  714. // Special key for previous word erase
  715. //
  716. #define EXTKEY_ERASE_PREV_WORD (0x7f)
  717. //
  718. // Ensure the alignment is WORD boundary
  719. //
  720. #include <pshpack2.h>
  721. typedef struct {
  722. WORD wMod;
  723. WORD wVirKey;
  724. WCHAR wUnicodeChar;
  725. } ExtKeySubst;
  726. typedef struct {
  727. ExtKeySubst keys[3]; // 0: Ctrl
  728. // 1: Alt
  729. // 2: Ctrl+Alt
  730. } ExtKeyDef;
  731. typedef ExtKeyDef ExtKeyDefTable['Z' - 'A' + 1];
  732. typedef struct {
  733. DWORD dwVersion;
  734. DWORD dwCheckSum;
  735. ExtKeyDefTable table;
  736. } ExtKeyDefBuf;
  737. //
  738. // Restore the previous alignment
  739. //
  740. #include <poppack.h>
  741. ;end_internal_NT
  742. ;begin_both
  743. #ifdef __cplusplus
  744. }
  745. #endif
  746. ;end_both
  747. #endif // _WINCONP_ ;internal_NT
  748. #endif // _WINCON_