1 2 #pragma once 3 4 /* Cache codepage for text streams */ 5 extern UINT InputCodePage; 6 extern UINT OutputCodePage; 7 8 /* Global console Screen and Pager */ 9 extern CON_SCREEN StdOutScreen; 10 extern CON_PAGER StdOutPager; 11 12 // /* Global variables */ 13 // extern BOOL bCtrlBreak; 14 // extern BOOL bIgnoreEcho; 15 // extern BOOL bExit; 16 17 VOID ConInDummy (VOID); 18 VOID ConInDisable (VOID); 19 VOID ConInEnable (VOID); 20 VOID ConInFlush (VOID); 21 VOID ConInKey (PINPUT_RECORD); 22 VOID ConInString (LPTSTR, DWORD); 23 24 25 VOID ConOutChar(TCHAR); 26 VOID ConErrChar(TCHAR); 27 28 VOID __cdecl ConFormatMessage(PCON_STREAM Stream, DWORD MessageId, ...); 29 30 #define ConOutPuts(szStr) \ 31 ConPuts(StdOut, (szStr)) 32 33 #define ConErrPuts(szStr) \ 34 ConPuts(StdErr, (szStr)) 35 36 #define ConOutResPuts(uID) \ 37 ConResPuts(StdOut, (uID)) 38 39 #define ConErrResPuts(uID) \ 40 ConResPuts(StdErr, (uID)) 41 42 #define ConOutPrintf(szStr, ...) \ 43 ConPrintf(StdOut, (szStr), ##__VA_ARGS__) 44 45 #define ConErrPrintf(szStr, ...) \ 46 ConPrintf(StdErr, (szStr), ##__VA_ARGS__) 47 48 #define ConOutResPrintf(uID, ...) \ 49 ConResPrintf(StdOut, (uID), ##__VA_ARGS__) 50 51 #define ConErrResPrintf(uID, ...) \ 52 ConResPrintf(StdErr, (uID), ##__VA_ARGS__) 53 54 #define ConOutFormatMessage(MessageId, ...) \ 55 ConFormatMessage(StdOut, (MessageId), ##__VA_ARGS__) 56 57 #define ConErrFormatMessage(MessageId, ...) \ 58 ConFormatMessage(StdErr, (MessageId), ##__VA_ARGS__) 59 60 61 BOOL ConPrintfVPaging(PCON_PAGER Pager, BOOL StartPaging, LPTSTR szFormat, va_list arg_ptr); 62 BOOL __cdecl ConOutPrintfPaging(BOOL StartPaging, LPTSTR szFormat, ...); 63 VOID ConOutResPaging(BOOL StartPaging, UINT resID); 64 65 SHORT GetCursorX (VOID); 66 SHORT GetCursorY (VOID); 67 VOID GetCursorXY (PSHORT, PSHORT); 68 VOID SetCursorXY (SHORT, SHORT); 69 70 VOID GetScreenSize (PSHORT, PSHORT); 71 VOID SetCursorType (BOOL, BOOL); 72 73 74 #ifdef INCLUDE_CMD_COLOR 75 BOOL ConGetDefaultAttributes(PWORD pwDefAttr); 76 #endif 77 78 79 BOOL ConSetTitle(IN LPCTSTR lpConsoleTitle); 80 81 #ifdef INCLUDE_CMD_BEEP 82 VOID ConRingBell(HANDLE hOutput); 83 #endif 84 85 #ifdef INCLUDE_CMD_COLOR 86 BOOL ConSetScreenColor(HANDLE hOutput, WORD wColor, BOOL bFill); 87 #endif 88 89 // TCHAR cgetchar (VOID); 90 // BOOL CheckCtrlBreak (INT); 91 92 // #define PROMPT_NO 0 93 // #define PROMPT_YES 1 94 // #define PROMPT_ALL 2 95 // #define PROMPT_BREAK 3 96 97 // INT FilePromptYN (UINT); 98 // INT FilePromptYNA (UINT); 99 100 SIZE_T ConGetTextWidthA(PCSTR pszText); 101 SIZE_T ConGetTextWidthW(PCWSTR pszText); 102 103 #ifdef UNICODE 104 #define ConGetTextWidth ConGetTextWidthW 105 #else 106 #define ConGetTextWidth ConGetTextWidthA 107 #endif 108