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.

414 lines
7.4 KiB

  1. #ifndef NOGDI
  2. typedef struct _CONSOLE_GRAPHICS_BUFFER_INFO {
  3. DWORD dwBitMapInfoLength;
  4. LPBITMAPINFO lpBitMapInfo;
  5. DWORD dwUsage;
  6. HANDLE hMutex;
  7. PVOID lpBitMap;
  8. } CONSOLE_GRAPHICS_BUFFER_INFO, *PCONSOLE_GRAPHICS_BUFFER_INFO;
  9. #endif // NOGDI
  10. #define CONSOLE_GRAPHICS_BUFFER 2
  11. BOOL
  12. WINAPI
  13. InvalidateConsoleDIBits(
  14. IN HANDLE hConsoleOutput,
  15. IN PSMALL_RECT lpRect
  16. );
  17. #define SYSTEM_ROOT_CONSOLE_EVENT 3
  18. VOID
  19. WINAPI
  20. SetLastConsoleEventActive( VOID );
  21. #define VDM_HIDE_WINDOW 1
  22. #define VDM_IS_ICONIC 2
  23. #define VDM_CLIENT_RECT 3
  24. #define VDM_CLIENT_TO_SCREEN 4
  25. #define VDM_SCREEN_TO_CLIENT 5
  26. #define VDM_IS_HIDDEN 6
  27. #define VDM_FULLSCREEN_NOPAINT 7
  28. #if defined(FE_SB)
  29. #define VDM_SET_VIDEO_MODE 8
  30. #if defined(i386)
  31. #define VDM_SAVE_RESTORE_HW_STATE 9
  32. #define VDM_VIDEO_IOCTL 10
  33. typedef struct _VDM_IOCTL_PARAM {
  34. DWORD dwIoControlCode;
  35. LPVOID lpvInBuffer;
  36. DWORD cbInBuffer;
  37. LPVOID lpvOutBuffer;
  38. DWORD cbOutBuffer;
  39. } VDM_IOCTL_PARAM, *LPVDM_IOCTL_PARAM;
  40. #endif /* i386 */
  41. #endif /* FE_SB */
  42. BOOL
  43. WINAPI
  44. VDMConsoleOperation(
  45. IN DWORD iFunction,
  46. IN OUT LPVOID lpData
  47. );
  48. BOOL
  49. WINAPI
  50. SetConsoleIcon(
  51. IN HICON hIcon
  52. );
  53. //
  54. // These console font APIs don't appear to be used anywhere. Maybe they
  55. // should be removed.
  56. //
  57. BOOL
  58. WINAPI
  59. SetConsoleFont(
  60. IN HANDLE hConsoleOutput,
  61. IN DWORD nFont
  62. );
  63. DWORD
  64. WINAPI
  65. GetConsoleFontInfo(
  66. IN HANDLE hConsoleOutput,
  67. IN BOOL bMaximumWindow,
  68. IN DWORD nLength,
  69. OUT PCONSOLE_FONT_INFO lpConsoleFontInfo
  70. );
  71. DWORD
  72. WINAPI
  73. GetNumberOfConsoleFonts(
  74. VOID
  75. );
  76. BOOL
  77. WINAPI
  78. SetConsoleCursor(
  79. IN HANDLE hConsoleOutput,
  80. IN HCURSOR hCursor
  81. );
  82. int
  83. WINAPI
  84. ShowConsoleCursor(
  85. IN HANDLE hConsoleOutput,
  86. IN BOOL bShow
  87. );
  88. HMENU
  89. APIENTRY
  90. ConsoleMenuControl(
  91. IN HANDLE hConsoleOutput,
  92. IN UINT dwCommandIdLow,
  93. IN UINT dwCommandIdHigh
  94. );
  95. BOOL
  96. SetConsolePalette(
  97. IN HANDLE hConsoleOutput,
  98. IN HPALETTE hPalette,
  99. IN UINT dwUsage
  100. );
  101. #define CONSOLE_FULLSCREEN_MODE 1
  102. #define CONSOLE_WINDOWED_MODE 2
  103. BOOL
  104. APIENTRY
  105. SetConsoleDisplayMode(
  106. IN HANDLE hConsoleOutput,
  107. IN DWORD dwFlags,
  108. OUT PCOORD lpNewScreenBufferDimensions
  109. );
  110. #define CONSOLE_UNREGISTER_VDM 0
  111. #define CONSOLE_REGISTER_VDM 1
  112. #define CONSOLE_REGISTER_WOW 2
  113. BOOL
  114. APIENTRY
  115. RegisterConsoleVDM(
  116. IN DWORD dwRegisterFlags,
  117. IN HANDLE hStartHardwareEvent,
  118. IN HANDLE hEndHardwareEvent,
  119. IN HANDLE hErrorhardwareEvent,
  120. IN DWORD Reserved,
  121. OUT LPDWORD lpStateLength,
  122. OUT PVOID *lpState,
  123. IN LPWSTR lpVDMBufferSectionName,
  124. IN DWORD dwVDMBufferSectionNameLength,
  125. IN COORD VDMBufferSize OPTIONAL,
  126. OUT PVOID *lpVDMBuffer
  127. );
  128. BOOL
  129. APIENTRY
  130. GetConsoleHardwareState(
  131. IN HANDLE hConsoleOutput,
  132. OUT PCOORD lpResolution,
  133. OUT PCOORD lpFontSize
  134. );
  135. BOOL
  136. APIENTRY
  137. SetConsoleHardwareState(
  138. IN HANDLE hConsoleOutput,
  139. IN COORD dwResolution,
  140. IN COORD dwFontSize
  141. );
  142. //
  143. // aliasing apis
  144. //
  145. BOOL
  146. AddConsoleAlias%(
  147. IN LPTSTR% Source,
  148. IN LPTSTR% Target,
  149. IN LPTSTR% ExeName
  150. );
  151. DWORD
  152. GetConsoleAlias%(
  153. IN LPTSTR% Source,
  154. OUT LPTSTR% TargetBuffer,
  155. IN DWORD TargetBufferLength,
  156. IN LPTSTR% ExeName
  157. );
  158. DWORD
  159. GetConsoleAliasesLength%(
  160. IN LPTSTR% ExeName
  161. );
  162. DWORD
  163. GetConsoleAliasExesLength%( VOID );
  164. DWORD
  165. GetConsoleAliases%(
  166. OUT LPTSTR% AliasBuffer,
  167. IN DWORD AliasBufferLength,
  168. IN LPTSTR% ExeName
  169. );
  170. DWORD
  171. GetConsoleAliasExes%(
  172. OUT LPTSTR% ExeNameBuffer,
  173. IN DWORD ExeNameBufferLength
  174. );
  175. VOID
  176. ExpungeConsoleCommandHistory%(
  177. IN LPTSTR% ExeName
  178. );
  179. BOOL
  180. SetConsoleNumberOfCommands%(
  181. IN DWORD Number,
  182. IN LPTSTR% ExeName
  183. );
  184. DWORD
  185. GetConsoleCommandHistoryLength%(
  186. IN LPTSTR% ExeName
  187. );
  188. DWORD
  189. GetConsoleCommandHistory%(
  190. OUT LPTSTR% Commands,
  191. IN DWORD CommandBufferLength,
  192. IN LPTSTR% ExeName
  193. );
  194. #define CONSOLE_OVERSTRIKE 1
  195. BOOL
  196. APIENTRY
  197. SetConsoleCommandHistoryMode(
  198. IN DWORD Flags
  199. );
  200. #define CONSOLE_NOSHORTCUTKEY 0 /* no shortcut key */
  201. #define CONSOLE_ALTTAB 1 /* Alt + Tab */
  202. #define CONSOLE_ALTESC (1 << 1) /* Alt + Escape */
  203. #define CONSOLE_ALTSPACE (1 << 2) /* Alt + Space */
  204. #define CONSOLE_ALTENTER (1 << 3) /* Alt + Enter */
  205. #define CONSOLE_ALTPRTSC (1 << 4) /* Alt Print screen */
  206. #define CONSOLE_PRTSC (1 << 5) /* Print screen */
  207. #define CONSOLE_CTRLESC (1 << 6) /* Ctrl + Escape */
  208. typedef struct _APPKEY {
  209. WORD Modifier;
  210. WORD ScanCode;
  211. } APPKEY, *LPAPPKEY;
  212. #define CONSOLE_MODIFIER_SHIFT 0x0003 // Left shift key
  213. #define CONSOLE_MODIFIER_CONTROL 0x0004 // Either Control shift key
  214. #define CONSOLE_MODIFIER_ALT 0x0008 // Either Alt shift key
  215. BOOL
  216. APIENTRY
  217. SetConsoleKeyShortcuts(
  218. IN BOOL bSet,
  219. IN BYTE bReserveKeys,
  220. IN LPAPPKEY lpAppKeys,
  221. IN DWORD dwNumAppKeys
  222. );
  223. BOOL
  224. APIENTRY
  225. SetConsoleMenuClose(
  226. IN BOOL bEnable
  227. );
  228. DWORD
  229. GetConsoleInputExeName%(
  230. IN DWORD nBufferLength,
  231. OUT LPTSTR% lpBuffer
  232. );
  233. BOOL
  234. SetConsoleInputExeName%(
  235. IN LPTSTR% lpExeName
  236. );
  237. typedef struct _CONSOLE_READCONSOLE_CONTROL {
  238. IN ULONG nLength; // sizeof( CONSOLE_READCONSOLE_CONTROL )
  239. IN ULONG nInitialChars;
  240. IN ULONG dwCtrlWakeupMask;
  241. OUT ULONG dwControlKeyState;
  242. } CONSOLE_READCONSOLE_CONTROL, *PCONSOLE_READCONSOLE_CONTROL;
  243. #define CONSOLE_ADD_SUBST 1
  244. #define CONSOLE_REMOVE_SUBST 2
  245. #define CONSOLE_QUERY_SUBST 3
  246. BOOL
  247. ConsoleSubst(
  248. IN DWORD dwDriveNumber,
  249. IN DWORD dwFlag,
  250. IN OUT LPWSTR lpPhysicalDriveBuffer,
  251. IN DWORD dwPhysicalDriveBufferLength
  252. );
  253. #define CONSOLE_READ_NOREMOVE 0x0001
  254. #define CONSOLE_READ_NOWAIT 0x0002
  255. #define CONSOLE_READ_VALID (CONSOLE_READ_NOREMOVE | CONSOLE_READ_NOWAIT)
  256. BOOL
  257. WINAPI
  258. ReadConsoleInputEx%(
  259. HANDLE hConsoleInput,
  260. PINPUT_RECORD lpBuffer,
  261. DWORD nLength,
  262. LPDWORD lpNumberOfEventsRead,
  263. USHORT wFlags
  264. );
  265. BOOL
  266. WINAPI
  267. WriteConsoleInputVDM%(
  268. HANDLE hConsoleInput,
  269. PINPUT_RECORD lpBuffer,
  270. DWORD nLength,
  271. LPDWORD lpNumberOfEventsWritten
  272. );
  273. #if defined(FE_SB)
  274. BOOL
  275. APIENTRY
  276. GetConsoleNlsMode(
  277. IN HANDLE hConsole,
  278. OUT PDWORD lpdwNlsMode
  279. );
  280. BOOL
  281. APIENTRY
  282. SetConsoleNlsMode(
  283. IN HANDLE hConsole,
  284. IN DWORD fdwNlsMode
  285. );
  286. BOOL
  287. APIENTRY
  288. GetConsoleCharType(
  289. IN HANDLE hConsole,
  290. IN COORD coordCheck,
  291. OUT PDWORD pdwType
  292. );
  293. #define CHAR_TYPE_SBCS 0 // Displayed SBCS character
  294. #define CHAR_TYPE_LEADING 2 // Displayed leading byte of DBCS
  295. #define CHAR_TYPE_TRAILING 3 // Displayed trailing byte of DBCS
  296. BOOL
  297. APIENTRY
  298. SetConsoleLocalEUDC(
  299. IN HANDLE hConsoleHandle,
  300. IN WORD wCodePoint,
  301. IN COORD cFontSize,
  302. IN PCHAR lpSB
  303. );
  304. BOOL
  305. APIENTRY
  306. SetConsoleCursorMode(
  307. IN HANDLE hConsoleHandle,
  308. IN BOOL Blink,
  309. IN BOOL DBEnable
  310. );
  311. BOOL
  312. APIENTRY
  313. GetConsoleCursorMode(
  314. IN HANDLE hConsoleHandle,
  315. OUT PBOOL pbBlink,
  316. OUT PBOOL pbDBEnable
  317. );
  318. BOOL
  319. APIENTRY
  320. RegisterConsoleOS2(
  321. IN BOOL fOs2Register
  322. );
  323. BOOL
  324. APIENTRY
  325. SetConsoleOS2OemFormat(
  326. IN BOOL fOs2OemFormat
  327. );
  328. BOOL
  329. IsConsoleFullWidth(
  330. IN HDC hDC,
  331. IN DWORD CodePage,
  332. IN WCHAR wch
  333. );
  334. #if defined(FE_IME)
  335. BOOL
  336. APIENTRY
  337. RegisterConsoleIME(
  338. IN HWND hWndConsoleIME,
  339. OUT DWORD *dwConsoleThreadId
  340. );
  341. BOOL
  342. APIENTRY
  343. UnregisterConsoleIME(
  344. );
  345. #endif // FE_IME
  346. #endif // FE_SB