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