2 * Copyright (C) the Wine project
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_WINCON_H
20 #define __WINE_WINCON_H
30 #include <consoleapi.h>
32 /* AttachConsole special pid value */
33 #define ATTACH_PARENT_PROCESS ((DWORD) -1)
35 /* GetConsoleDisplayMode flags */
36 #define CONSOLE_FULLSCREEN 1
37 #define CONSOLE_FULLSCREEN_HARDWARE 2
39 /* SetConsoleDisplayMode flags */
40 #define CONSOLE_FULLSCREEN_MODE 1
41 #define CONSOLE_WINDOWED_MODE 2
43 /* CONSOLE_SELECTION_INFO.dwFlags */
44 #define CONSOLE_NO_SELECTION 0x00
45 #define CONSOLE_SELECTION_IN_PROGRESS 0x01
46 #define CONSOLE_SELECTION_NOT_EMPTY 0x02
47 #define CONSOLE_MOUSE_SELECTION 0x04
48 #define CONSOLE_MOUSE_DOWN 0x08
51 /* Attributes flags: */
53 #define FOREGROUND_BLUE 0x0001
54 #define FOREGROUND_GREEN 0x0002
55 #define FOREGROUND_RED 0x0004
56 #define FOREGROUND_INTENSITY 0x0008
57 #define BACKGROUND_BLUE 0x0010
58 #define BACKGROUND_GREEN 0x0020
59 #define BACKGROUND_RED 0x0040
60 #define BACKGROUND_INTENSITY 0x0080
61 #define COMMON_LVB_LEADING_BYTE 0x0100
62 #define COMMON_LVB_TRAILING_BYTE 0x0200
63 #define COMMON_LVB_GRID_HORIZONTAL 0x0400
64 #define COMMON_LVB_GRID_LVERTICAL 0x0800
65 #define COMMON_LVB_GRID_RVERTICAL 0x1000
66 #define COMMON_LVB_REVERSE_VIDEO 0x4000
67 #define COMMON_LVB_UNDERSCORE 0x8000
69 /* CONSOLE_HISTORY_INFO.dwFlags */
70 #define HISTORY_NO_DUP_FLAG 0x01
72 typedef struct _CONSOLE_CURSOR_INFO
{
73 DWORD dwSize
; /* Between 1 & 100 for percentage of cell filled */
74 BOOL bVisible
; /* Visibility of cursor */
75 } CONSOLE_CURSOR_INFO
, *LPCONSOLE_CURSOR_INFO
;
78 typedef struct _CONSOLE_FONT_INFOEX
85 WCHAR FaceName
[LF_FACESIZE
];
86 } CONSOLE_FONT_INFOEX
,*LPCONSOLE_FONT_INFOEX
;
88 WINBASEAPI BOOL WINAPI
GetCurrentConsoleFontEx(HANDLE
,BOOL
,LPCONSOLE_FONT_INFOEX
);
89 WINBASEAPI BOOL WINAPI
SetCurrentConsoleFontEx(HANDLE
,BOOL
,LPCONSOLE_FONT_INFOEX
);
92 typedef struct tagCONSOLE_HISTORY_INFO
95 UINT HistoryBufferSize
;
96 UINT NumberOfHistoryBuffers
;
98 } CONSOLE_HISTORY_INFO
,*LPCONSOLE_HISTORY_INFO
;
100 typedef struct tagCONSOLE_SCREEN_BUFFER_INFO
103 COORD dwCursorPosition
;
106 COORD dwMaximumWindowSize
;
107 } CONSOLE_SCREEN_BUFFER_INFO
,*LPCONSOLE_SCREEN_BUFFER_INFO
;
109 typedef struct _CONSOLE_SCREEN_BUFFER_INFOEX
113 COORD dwCursorPosition
;
116 COORD dwMaximumWindowSize
;
117 WORD wPopupAttributes
;
118 BOOL bFullscreenSupported
;
119 COLORREF ColorTable
[16];
120 } CONSOLE_SCREEN_BUFFER_INFOEX
,*LPCONSOLE_SCREEN_BUFFER_INFOEX
;
122 typedef struct _CONSOLE_SELECTION_INFO
125 COORD dwSelectionAnchor
;
126 SMALL_RECT srSelection
;
127 } CONSOLE_SELECTION_INFO
,*LPCONSOLE_SELECTION_INFO
;
130 #define CONSOLE_TEXTMODE_BUFFER 1
132 #if defined(__i386__) && !defined(__MINGW32__) && !defined(_MSC_VER)
133 /* Note: this should return a COORD, but calling convention for returning
134 * structures is different between Windows and gcc on i386. */
136 WINBASEAPI DWORD WINAPI
GetConsoleFontSize(HANDLE
, DWORD
);
137 WINBASEAPI DWORD WINAPI
GetLargestConsoleWindowSize(HANDLE
);
139 static inline COORD
__wine_GetConsoleFontSize_wrapper(HANDLE h
, DWORD d
)
145 u
.dw
= GetConsoleFontSize(h
, d
);
148 #define GetConsoleFontSize(h, d) __wine_GetConsoleFontSize_wrapper(h, d)
150 static inline COORD
__wine_GetLargestConsoleWindowSize_wrapper(HANDLE h
)
156 u
.dw
= GetLargestConsoleWindowSize(h
);
159 #define GetLargestConsoleWindowSize(h) __wine_GetLargestConsoleWindowSize_wrapper(h)
162 WINBASEAPI COORD WINAPI
GetConsoleFontSize(HANDLE
, DWORD
);
163 WINBASEAPI COORD WINAPI
GetLargestConsoleWindowSize(HANDLE
);
164 #endif /* __i386__ */
166 WINBASEAPI BOOL WINAPI
AddConsoleAliasA(LPSTR
,LPSTR
,LPSTR
);
167 WINBASEAPI BOOL WINAPI
AddConsoleAliasW(LPWSTR
,LPWSTR
,LPWSTR
);
168 #define AddConsoleAlias WINELIB_NAME_AW(AddConsoleAlias)
169 WINBASEAPI BOOL WINAPI
CloseConsoleHandle(HANDLE
);
170 WINBASEAPI HANDLE WINAPI
CreateConsoleScreenBuffer(DWORD
,DWORD
,LPSECURITY_ATTRIBUTES
,DWORD
,LPVOID
);
171 WINBASEAPI HANDLE WINAPI
DuplicateConsoleHandle(HANDLE
,DWORD
,BOOL
,DWORD
);
172 WINBASEAPI BOOL WINAPI
FillConsoleOutputAttribute( HANDLE
,WORD
,DWORD
,COORD
,LPDWORD
);
173 WINBASEAPI BOOL WINAPI
FillConsoleOutputCharacterA(HANDLE
,CHAR
,DWORD
,COORD
,LPDWORD
);
174 WINBASEAPI BOOL WINAPI
FillConsoleOutputCharacterW(HANDLE
,WCHAR
,DWORD
,COORD
,LPDWORD
);
175 #define FillConsoleOutputCharacter WINELIB_NAME_AW(FillConsoleOutputCharacter)
176 WINBASEAPI BOOL WINAPI
FlushConsoleInputBuffer( HANDLE
);
177 WINBASEAPI BOOL WINAPI
GenerateConsoleCtrlEvent( DWORD
,DWORD
);
178 WINBASEAPI DWORD WINAPI
GetConsoleAliasA(LPSTR
,LPSTR
,DWORD
,LPSTR
);
179 WINBASEAPI DWORD WINAPI
GetConsoleAliasW(LPWSTR
,LPWSTR
,DWORD
,LPWSTR
);
180 #define GetConsoleAlias WINELIB_NAME_AW(GetConsoleAlias)
181 WINBASEAPI DWORD WINAPI
GetConsoleAliasesA(LPSTR
,DWORD
,LPSTR
);
182 WINBASEAPI DWORD WINAPI
GetConsoleAliasesW(LPWSTR
,DWORD
,LPWSTR
);
183 #define GetConsoleAliases WINELIB_NAME_AW(GetConsoleAliases)
184 WINBASEAPI DWORD WINAPI
GetConsoleAliasesLengthA(LPSTR
);
185 WINBASEAPI DWORD WINAPI
GetConsoleAliasesLengthW(LPWSTR
);
186 #define GetConsoleAliasesLength WINELIB_NAME_AW(GetConsoleAliasesLength)
187 WINBASEAPI DWORD WINAPI
GetConsoleAliasExesA(LPSTR
,DWORD
);
188 WINBASEAPI DWORD WINAPI
GetConsoleAliasExesW(LPWSTR
,DWORD
);
189 #define GetConsoleAliasExes WINELIB_NAME_AW(GetConsoleAliasExes)
190 WINBASEAPI DWORD WINAPI
GetConsoleAliasExesLengthA(VOID
);
191 WINBASEAPI DWORD WINAPI
GetConsoleAliasExesLengthW(VOID
);
192 #define GetConsoleAliasExesLength WINELIB_NAME_AW(GetConsoleAliasExesLength)
193 WINBASEAPI BOOL WINAPI
GetConsoleCursorInfo( HANDLE
,LPCONSOLE_CURSOR_INFO
);
194 WINBASEAPI BOOL WINAPI
GetConsoleDisplayMode(LPDWORD
);
195 WINBASEAPI BOOL WINAPI
GetConsoleHistoryInfo(LPCONSOLE_HISTORY_INFO
);
196 WINBASEAPI BOOL WINAPI
GetConsoleInputExeNameA(DWORD
,LPSTR
);
197 WINBASEAPI BOOL WINAPI
GetConsoleInputExeNameW(DWORD
,LPWSTR
);
198 #define GetConsoleInputExeName WINELIB_NAME_AW(GetConsoleInputExeName)
199 WINBASEAPI HANDLE WINAPI
GetConsoleInputWaitHandle(void);
200 WINBASEAPI DWORD WINAPI
GetConsoleOriginalTitleA(LPSTR
,DWORD
);
201 WINBASEAPI DWORD WINAPI
GetConsoleOriginalTitleW(LPWSTR
,DWORD
);
202 #define GetConsoleOriginalTitle WINELIB_NAME_AW(GetConsoleOriginalTitle)
203 WINBASEAPI DWORD WINAPI
GetConsoleProcessList(LPDWORD
,DWORD
);
204 WINBASEAPI BOOL WINAPI
GetConsoleScreenBufferInfo(HANDLE
,LPCONSOLE_SCREEN_BUFFER_INFO
);
205 WINBASEAPI BOOL WINAPI
GetConsoleScreenBufferInfoEx(HANDLE
,LPCONSOLE_SCREEN_BUFFER_INFOEX
);
206 WINBASEAPI DWORD WINAPI
GetConsoleTitleA(LPSTR
,DWORD
);
207 WINBASEAPI DWORD WINAPI
GetConsoleTitleW(LPWSTR
,DWORD
);
208 #define GetConsoleTitle WINELIB_NAME_AW(GetConsoleTitle)
209 WINBASEAPI HWND WINAPI
GetConsoleWindow(void);
210 WINBASEAPI BOOL WINAPI
GetCurrentConsoleFont(HANDLE
,BOOL
,LPCONSOLE_FONT_INFO
);
211 WINBASEAPI BOOL WINAPI
GetNumberOfConsoleMouseButtons(LPDWORD
);
212 WINBASEAPI HANDLE WINAPI
OpenConsoleA(LPCSTR
,DWORD
,BOOL
,DWORD
);
213 WINBASEAPI HANDLE WINAPI
OpenConsoleW(LPCWSTR
,DWORD
,BOOL
,DWORD
);
214 #define OpenConsole WINELIB_NAME_AW(OpenConsole)
215 WINBASEAPI BOOL WINAPI
ReadConsoleOutputA( HANDLE
,LPCHAR_INFO
,COORD
,COORD
,LPSMALL_RECT
);
216 WINBASEAPI BOOL WINAPI
ReadConsoleOutputW( HANDLE
,LPCHAR_INFO
,COORD
,COORD
,LPSMALL_RECT
);
217 #define ReadConsoleOutput WINELIB_NAME_AW(ReadConsoleOutput)
218 WINBASEAPI BOOL WINAPI
ReadConsoleOutputAttribute( HANDLE
,LPWORD
,DWORD
,COORD
,LPDWORD
);
219 WINBASEAPI BOOL WINAPI
ReadConsoleOutputCharacterA(HANDLE
,LPSTR
,DWORD
,COORD
,LPDWORD
);
220 WINBASEAPI BOOL WINAPI
ReadConsoleOutputCharacterW(HANDLE
,LPWSTR
,DWORD
,COORD
,LPDWORD
);
221 #define ReadConsoleOutputCharacter WINELIB_NAME_AW(ReadConsoleOutputCharacter)
222 WINBASEAPI BOOL WINAPI
ScrollConsoleScreenBufferA( HANDLE
,const SMALL_RECT
*,const SMALL_RECT
*,COORD
,const CHAR_INFO
*);
223 WINBASEAPI BOOL WINAPI
ScrollConsoleScreenBufferW( HANDLE
,const SMALL_RECT
*,const SMALL_RECT
*com
,COORD
,const CHAR_INFO
*);
224 #define ScrollConsoleScreenBuffer WINELIB_NAME_AW(ScrollConsoleScreenBuffer)
225 WINBASEAPI BOOL WINAPI
SetConsoleActiveScreenBuffer( HANDLE
);
226 WINBASEAPI BOOL WINAPI
SetConsoleCP(UINT
);
227 WINBASEAPI BOOL WINAPI
SetConsoleCursorInfo( HANDLE
,LPCONSOLE_CURSOR_INFO
);
228 WINBASEAPI BOOL WINAPI
SetConsoleCursorPosition(HANDLE
,COORD
);
229 WINBASEAPI BOOL WINAPI
SetConsoleDisplayMode(HANDLE
,DWORD
,LPCOORD
);
230 WINBASEAPI BOOL WINAPI
SetConsoleHistoryInfo(LPCONSOLE_HISTORY_INFO
);
231 WINBASEAPI BOOL WINAPI
SetConsoleOutputCP(UINT
);
232 WINBASEAPI BOOL WINAPI
SetConsoleScreenBufferInfoEx(HANDLE
,LPCONSOLE_SCREEN_BUFFER_INFOEX
);
233 WINBASEAPI BOOL WINAPI
SetConsoleScreenBufferSize(HANDLE
,COORD
);
234 WINBASEAPI BOOL WINAPI
SetConsoleTextAttribute( HANDLE
,WORD
);
235 WINBASEAPI BOOL WINAPI
SetConsoleTitleA(LPCSTR
);
236 WINBASEAPI BOOL WINAPI
SetConsoleTitleW(LPCWSTR
);
237 #define SetConsoleTitle WINELIB_NAME_AW(SetConsoleTitle)
238 WINBASEAPI BOOL WINAPI
SetConsoleWindowInfo( HANDLE
,BOOL
,LPSMALL_RECT
);
239 WINBASEAPI BOOL WINAPI
VerifyConsoleIoHandle(HANDLE
);
240 WINBASEAPI BOOL WINAPI
WriteConsoleInputA(HANDLE
,const INPUT_RECORD
*,DWORD
,LPDWORD
);
241 WINBASEAPI BOOL WINAPI
WriteConsoleInputW(HANDLE
,const INPUT_RECORD
*,DWORD
,LPDWORD
);
242 #define WriteConsoleInput WINELIB_NAME_AW(WriteConsoleInput)
243 WINBASEAPI BOOL WINAPI
WriteConsoleOutputA(HANDLE
,const CHAR_INFO
*,COORD
,COORD
,LPSMALL_RECT
);
244 WINBASEAPI BOOL WINAPI
WriteConsoleOutputW(HANDLE
,const CHAR_INFO
*,COORD
,COORD
,LPSMALL_RECT
);
245 #define WriteConsoleOutput WINELIB_NAME_AW(WriteConsoleOutput)
246 WINBASEAPI BOOL WINAPI
WriteConsoleOutputAttribute(HANDLE
,const WORD
*,DWORD
,COORD
,LPDWORD
);
247 WINBASEAPI BOOL WINAPI
WriteConsoleOutputCharacterA(HANDLE
,LPCSTR
,DWORD
,COORD
,LPDWORD
);
248 WINBASEAPI BOOL WINAPI
WriteConsoleOutputCharacterW(HANDLE
,LPCWSTR
,DWORD
,COORD
,LPDWORD
);
249 #define WriteConsoleOutputCharacter WINELIB_NAME_AW(WriteConsoleOutputCharacter)
255 #endif /* __WINE_WINCON_H */