Go to the source code of this file.
◆ ResizeTextConsole()
Definition at line 11 of file SetConsoleWindowInfo.c.
16{
19
21 {
22 SHORT oldWidth, oldHeight;
23
24 oldWidth = pcsbi->srWindow.
Right - pcsbi->srWindow.Left + 1;
25 oldHeight = pcsbi->srWindow.Bottom - pcsbi->srWindow.Top + 1;
26
27
28
29
30
32 {
38 }
39
40
43
44
45
46
47
50 }
51
53 {
54
59 }
60 else
61 {
62
66 }
67
70
71
74}
BOOL WINAPI GetConsoleScreenBufferInfo(IN HANDLE hConsoleOutput, OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo)
BOOL WINAPI SetConsoleWindowInfo(HANDLE hConsoleOutput, BOOL bAbsolute, CONST SMALL_RECT *lpConsoleWindow)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleScreenBufferSize(HANDLE hConsoleOutput, COORD dwSize)
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN _In_opt_ ULONG WindowSize
DWORD WINAPI GetLastError(void)
Referenced by START_TEST().
◆ START_TEST()
Definition at line 76 of file SetConsoleWindowInfo.c.
77{
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
112
113
117 return;
118
119
120
121
122
127 csbi = org_csbi;
128
129
130
131
132
136
137
138 ConRect.
Left = ConRect.
Top = 0;
144 ok(
Success,
"Setting console wnd info\n");
146
147
148
149
150
151
152 ConRect.
Left = ConRect.
Top = -5;
155
156
160 ok(
Success,
"Setting console wnd info should have succeeded!\n");
162
163
167 {
172
181 }
182
183
184
185
186 ConRect.
Left = ConRect.
Top = -5;
192 ok(!
Success,
"Setting console wnd info should have failed!\n");
195
196
200 {
201
204 ok(csbi2.
srWindow.
Top == 0,
"srWindow.Top = %d, expected %d\n",
210 }
211
212
213
214
215
216 ConRect.
Left = ConRect.
Top = 2;
222 ok(!
Success,
"Setting console wnd info should have failed!\n");
225
226
230 {
233 ok(csbi2.
srWindow.
Top == 0,
"srWindow.Top = %d, expected %d\n",
235
236
241 }
242
243
244
252 ok(!
Success,
"Setting console wnd info should have failed!\n");
255
256
257
263 ok(
Success,
"Setting console wnd info should have succeeded!\n");
265
266
270 {
279 }
280
281
282
283
284
285
286
287
291
292
294 "dwMaximumWindowSize = {%d, %d} was expected to be smaller than Resolution = {%d, %d}\n",
296
297
298 ConRect.
Left = ConRect.
Top = 0;
304 ok(
Success,
"Setting console wnd info should have succeeded!\n");
306
307
311 {
320 }
321
322
323
324 ConRect.
Left = ConRect.
Top = 0;
330 ok(!
Success,
"Setting console wnd info should have failed!\n");
333
334
338 {
341 ok(csbi2.
srWindow.
Top == 0,
"srWindow.Top = %d, expected %d\n",
347 }
348
349
350
352
355}
static VOID ResizeTextConsole(IN HANDLE hConOut, IN OUT PCONSOLE_SCREEN_BUFFER_INFO pcsbi, IN COORD Resolution, IN PSMALL_RECT WindowSize OPTIONAL)
#define ERROR_INVALID_PARAMETER
#define INVALID_HANDLE_VALUE
static const WCHAR Cleanup[]
COORD dwMaximumWindowSize