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.

848 lines
19 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. ;end_if_(_WIN32_WINNT)_500
  474. WINBASEAPI
  475. DWORD
  476. WINAPI
  477. GetConsoleTitle%(
  478. OUT LPTSTR% lpConsoleTitle,
  479. IN DWORD nSize
  480. );
  481. WINBASEAPI
  482. BOOL
  483. WINAPI
  484. SetConsoleTitle%(
  485. IN LPCTSTR% lpConsoleTitle
  486. );
  487. WINBASEAPI
  488. BOOL
  489. WINAPI
  490. ReadConsole%(
  491. IN HANDLE hConsoleInput,
  492. OUT LPVOID lpBuffer,
  493. IN DWORD nNumberOfCharsToRead,
  494. OUT LPDWORD lpNumberOfCharsRead,
  495. IN LPVOID lpReserved
  496. );
  497. WINBASEAPI
  498. BOOL
  499. WINAPI
  500. WriteConsole%(
  501. IN HANDLE hConsoleOutput,
  502. IN CONST VOID *lpBuffer,
  503. IN DWORD nNumberOfCharsToWrite,
  504. OUT LPDWORD lpNumberOfCharsWritten,
  505. IN LPVOID lpReserved
  506. );
  507. #define CONSOLE_TEXTMODE_BUFFER 1
  508. WINBASEAPI
  509. HANDLE
  510. WINAPI
  511. CreateConsoleScreenBuffer(
  512. IN DWORD dwDesiredAccess,
  513. IN DWORD dwShareMode,
  514. IN CONST SECURITY_ATTRIBUTES *lpSecurityAttributes,
  515. IN DWORD dwFlags,
  516. IN LPVOID lpScreenBufferData
  517. );
  518. WINBASEAPI
  519. UINT
  520. WINAPI
  521. GetConsoleCP( VOID );
  522. WINBASEAPI
  523. BOOL
  524. WINAPI
  525. SetConsoleCP(
  526. IN UINT wCodePageID
  527. );
  528. WINBASEAPI
  529. UINT
  530. WINAPI
  531. GetConsoleOutputCP( VOID );
  532. WINBASEAPI
  533. BOOL
  534. WINAPI
  535. SetConsoleOutputCP(
  536. IN UINT wCodePageID
  537. );
  538. ;begin_if_(_WIN32_WINNT)_500
  539. #define CONSOLE_FULLSCREEN 1 // fullscreen console
  540. #define CONSOLE_FULLSCREEN_HARDWARE 2 // console owns the hardware
  541. WINBASEAPI
  542. BOOL
  543. APIENTRY
  544. GetConsoleDisplayMode(
  545. OUT LPDWORD lpModeFlags
  546. );
  547. WINBASEAPI
  548. HWND
  549. APIENTRY
  550. GetConsoleWindow(
  551. VOID
  552. );
  553. ;end_if_(_WIN32_WINNT)_500
  554. ;begin_if_(_WIN32_WINNT)_501
  555. WINBASEAPI
  556. DWORD
  557. APIENTRY
  558. GetConsoleProcessList(
  559. OUT LPDWORD lpdwProcessList,
  560. IN DWORD dwProcessCount);
  561. ;end_if_(_WIN32_WINNT)_501
  562. ;begin_internal_NT
  563. WINBASEAPI
  564. BOOL
  565. WINAPI
  566. GetConsoleKeyboardLayoutName%( OUT LPTSTR% );
  567. //
  568. // Registry strings
  569. //
  570. #define CONSOLE_REGISTRY_STRING (L"Console")
  571. #define CONSOLE_REGISTRY_FONTSIZE (L"FontSize")
  572. #define CONSOLE_REGISTRY_FONTFAMILY (L"FontFamily")
  573. #define CONSOLE_REGISTRY_BUFFERSIZE (L"ScreenBufferSize")
  574. #define CONSOLE_REGISTRY_CURSORSIZE (L"CursorSize")
  575. #define CONSOLE_REGISTRY_WINDOWSIZE (L"WindowSize")
  576. #define CONSOLE_REGISTRY_WINDOWPOS (L"WindowPosition")
  577. #define CONSOLE_REGISTRY_FILLATTR (L"ScreenColors")
  578. #define CONSOLE_REGISTRY_POPUPATTR (L"PopupColors")
  579. #define CONSOLE_REGISTRY_FULLSCR (L"FullScreen")
  580. #define CONSOLE_REGISTRY_QUICKEDIT (L"QuickEdit")
  581. #define CONSOLE_REGISTRY_FACENAME (L"FaceName")
  582. #define CONSOLE_REGISTRY_FONTWEIGHT (L"FontWeight")
  583. #define CONSOLE_REGISTRY_INSERTMODE (L"InsertMode")
  584. #define CONSOLE_REGISTRY_HISTORYSIZE (L"HistoryBufferSize")
  585. #define CONSOLE_REGISTRY_HISTORYBUFS (L"NumberOfHistoryBuffers")
  586. #define CONSOLE_REGISTRY_HISTORYNODUP (L"HistoryNoDup")
  587. #define CONSOLE_REGISTRY_COLORTABLE (L"ColorTable%02u")
  588. #define CONSOLE_REGISTRY_EXTENDEDEDITKEY L"ExtendedEditKey"
  589. #define CONSOLE_REGISTRY_EXTENDEDEDITKEY_CUSTOM L"ExtendedEditkeyCustom"
  590. #define CONSOLE_REGISTRY_WORD_DELIM L"WordDelimiters"
  591. #define CONSOLE_REGISTRY_TRIMZEROHEADINGS L"TrimLeadingZeros"
  592. #define CONSOLE_REGISTRY_LOAD_CONIME L"LoadConIme"
  593. #define CONSOLE_REGISTRY_ENABLE_COLOR_SELECTION L"EnableColorSelection"
  594. #if defined(FE_SB) // scotthsu
  595. /*
  596. * Starting code page
  597. */
  598. #define CONSOLE_REGISTRY_CODEPAGE (L"CodePage")
  599. #endif
  600. #if defined(FE_SB)
  601. //
  602. // registry strings on HKEY_LOCAL_MACHINE
  603. //
  604. #define MACHINE_REGISTRY_CONSOLE (L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Console")
  605. #define MACHINE_REGISTRY_CONSOLEIME (L"ConsoleIME")
  606. #define MACHINE_REGISTRY_CONSOLE_TTFONT (L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Console\\TrueTypeFont")
  607. #define MACHINE_REGISTRY_CONSOLE_NLS (L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Console\\Nls")
  608. #define MACHINE_REGISTRY_CONSOLE_FULLSCREEN (L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Console\\FullScreen")
  609. #define MACHINE_REGISTRY_INITIAL_PALETTE (L"InitialPalette")
  610. #define MACHINE_REGISTRY_COLOR_BUFFER (L"ColorBuffer")
  611. #define MACHINE_REGISTRY_COLOR_BUFFER_NO_TRANSLATE (L"ColorBufferNoTranslate")
  612. #define MACHINE_REGISTRY_MODE_FONT_PAIRS (L"ModeFontPairs")
  613. #define MACHINE_REGISTRY_FS_CODEPAGE (L"CodePage")
  614. #define MACHINE_REGISTRY_EUDC (L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls\\CodePage\\EUDCCodeRange")
  615. //
  616. // TrueType font list
  617. //
  618. // doesn't available bold when add BOLD_MARK on first of face name.
  619. #define BOLD_MARK (L'*')
  620. typedef struct _TT_FONT_LIST {
  621. SINGLE_LIST_ENTRY List;
  622. UINT CodePage;
  623. BOOL fDisableBold;
  624. TCHAR FaceName1[LF_FACESIZE];
  625. TCHAR FaceName2[LF_FACESIZE];
  626. } TTFONTLIST, *LPTTFONTLIST;
  627. #endif // FE_SB
  628. //
  629. // State information structure
  630. //
  631. typedef struct _CONSOLE_STATE_INFO {
  632. UINT Length;
  633. COORD ScreenBufferSize;
  634. COORD WindowSize;
  635. INT WindowPosX;
  636. INT WindowPosY;
  637. COORD FontSize;
  638. UINT FontFamily;
  639. UINT FontWeight;
  640. WCHAR FaceName[LF_FACESIZE];
  641. UINT CursorSize;
  642. BOOL FullScreen;
  643. BOOL QuickEdit;
  644. BOOL AutoPosition;
  645. BOOL InsertMode;
  646. WORD ScreenAttributes;
  647. WORD PopupAttributes;
  648. BOOL HistoryNoDup;
  649. UINT HistoryBufferSize;
  650. UINT NumberOfHistoryBuffers;
  651. COLORREF ColorTable[ 16 ];
  652. #if defined(FE_SB)
  653. /*
  654. * Startting code page
  655. */
  656. UINT CodePage;
  657. #endif // FE_SB
  658. HWND hWnd;
  659. WCHAR ConsoleTitle[1];
  660. } CONSOLE_STATE_INFO, *PCONSOLE_STATE_INFO;
  661. //
  662. // Messages sent from properties applet to console server
  663. //
  664. #define CM_PROPERTIES_START (WM_USER+200)
  665. #define CM_PROPERTIES_UPDATE (WM_USER+201)
  666. #define CM_PROPERTIES_END (WM_USER+202)
  667. //
  668. // Extended Line Edit
  669. //
  670. #define EK_INVALID ' '
  671. //
  672. // Special key for previous word erase
  673. //
  674. #define EXTKEY_ERASE_PREV_WORD (0x7f)
  675. //
  676. // Ensure the alignment is WORD boundary
  677. //
  678. #include <pshpack2.h>
  679. typedef struct {
  680. WORD wMod;
  681. WORD wVirKey;
  682. WCHAR wUnicodeChar;
  683. } ExtKeySubst;
  684. typedef struct {
  685. ExtKeySubst keys[3]; // 0: Ctrl
  686. // 1: Alt
  687. // 2: Ctrl+Alt
  688. } ExtKeyDef;
  689. typedef ExtKeyDef ExtKeyDefTable['Z' - 'A' + 1];
  690. typedef struct {
  691. DWORD dwVersion;
  692. DWORD dwCheckSum;
  693. ExtKeyDefTable table;
  694. } ExtKeyDefBuf;
  695. //
  696. // Restore the previous alignment
  697. //
  698. #include <poppack.h>
  699. ;end_internal_NT
  700. ;begin_both
  701. #ifdef __cplusplus
  702. }
  703. #endif
  704. ;end_both
  705. #endif // _WINCONP_ ;internal_NT
  706. #endif // _WINCON_