@@ -294,6 +294,52 @@ LayoutProc(
294
294
{
295
295
switch (LOWORD (wParam ))
296
296
{
297
+ case IDC_EDIT_SCREEN_BUFFER_WIDTH :
298
+ case IDC_EDIT_SCREEN_BUFFER_HEIGHT :
299
+ case IDC_EDIT_WINDOW_SIZE_WIDTH :
300
+ case IDC_UPDOWN_WINDOW_SIZE_HEIGHT :
301
+ case IDC_EDIT_WINDOW_POS_LEFT :
302
+ case IDC_EDIT_WINDOW_POS_TOP :
303
+ {
304
+ if (HIWORD (wParam ) == EN_KILLFOCUS )
305
+ {
306
+ DWORD wheight , wwidth ;
307
+ DWORD sheight , swidth ;
308
+ DWORD left , top ;
309
+
310
+ wwidth = GetDlgItemInt (hwndDlg , IDC_EDIT_WINDOW_SIZE_WIDTH , NULL , FALSE);
311
+ wheight = GetDlgItemInt (hwndDlg , IDC_EDIT_WINDOW_SIZE_HEIGHT , NULL , FALSE);
312
+ swidth = GetDlgItemInt (hwndDlg , IDC_EDIT_SCREEN_BUFFER_WIDTH , NULL , FALSE);
313
+ sheight = GetDlgItemInt (hwndDlg , IDC_EDIT_SCREEN_BUFFER_HEIGHT , NULL , FALSE);
314
+ left = GetDlgItemInt (hwndDlg , IDC_EDIT_WINDOW_POS_LEFT , NULL , FALSE);
315
+ top = GetDlgItemInt (hwndDlg , IDC_EDIT_WINDOW_POS_TOP , NULL , FALSE);
316
+
317
+ swidth = max (swidth , 1 );
318
+ sheight = max (sheight , 1 );
319
+
320
+ /* automatically adjust window size when screen buffer decreases */
321
+ if (wwidth > swidth )
322
+ {
323
+ SetDlgItemInt (hwndDlg , IDC_EDIT_WINDOW_SIZE_WIDTH , swidth , TRUE);
324
+ wwidth = swidth ;
325
+ }
326
+
327
+ if (wheight > sheight )
328
+ {
329
+ SetDlgItemInt (hwndDlg , IDC_EDIT_WINDOW_SIZE_HEIGHT , sheight , TRUE);
330
+ wheight = sheight ;
331
+ }
332
+
333
+
334
+ pConInfo -> ScreenBuffer = MAKELONG (swidth , sheight );
335
+ pConInfo -> WindowSize = MAKELONG (wwidth , wheight );
336
+ pConInfo -> WindowPosition = MAKELONG (left , top );
337
+
338
+ PropSheet_Changed (GetParent (hwndDlg ), hwndDlg );
339
+ }
340
+ break ;
341
+ }
342
+
297
343
case IDC_CHECK_SYSTEM_POS_WINDOW :
298
344
{
299
345
LONG res = SendMessage ((HWND )lParam , BM_GETCHECK , 0 , 0 );
0 commit comments