}
}
+ /* Check for invalid Port number (i.e. zero) */
+ if (cfg.port == 0) {
+ MessageBox(NULL, "Invalid Port Number",
+ "PuTTY Internal Error", MB_OK |MB_ICONEXCLAMATION);
+ WSACleanup();
+ return 1;
+ }
+
real_ldisc = (cfg.ldisc_term ? &ldisc_term : &ldisc_simple);
/* To start with, we use the simple line discipline, so we can
* type passwords etc without fear of them being echoed... */
caretbm = CreateBitmap(font_width, font_height, 1, 1, bits);
sfree(bits);
}
+ CreateCaret(hwnd, caretbm, font_width, font_height);
/*
* Initialise the scroll bar.
case IDM_RECONF:
{
int prev_alwaysontop = cfg.alwaysontop;
+ int need_setwpos = FALSE;
+ cfg.width = cols;
+ cfg.height = rows;
if (!do_reconfig(hwnd))
break;
just_reconfigged = TRUE;
SetWindowLong(hwnd, GWL_EXSTYLE, nexflag);
SendMessage (hwnd, WM_IGNORE_SIZE, 0, 0);
+
SetWindowPos(hwnd, NULL, 0,0,0,0,
SWP_NOACTIVATE|SWP_NOCOPYBITS|
SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|
}
}
+ if (cfg.height != rows ||
+ cfg.width != cols ||
+ cfg.savelines != savelines)
+ need_setwpos = TRUE;
term_size(cfg.height, cfg.width, cfg.savelines);
InvalidateRect(hwnd, NULL, TRUE);
- SetWindowPos (hwnd, NULL, 0, 0,
- extra_width + font_width * cfg.width,
- extra_height + font_height * cfg.height,
- SWP_NOACTIVATE | SWP_NOCOPYBITS |
- SWP_NOMOVE | SWP_NOZORDER);
+ if (need_setwpos) {
+ force_normal(hwnd);
+ SetWindowPos (hwnd, NULL, 0, 0,
+ extra_width + font_width * cfg.width,
+ extra_height + font_height * cfg.height,
+ SWP_NOACTIVATE | SWP_NOCOPYBITS |
+ SWP_NOMOVE | SWP_NOZORDER);
+ }
if (IsIconic(hwnd)) {
SetWindowText (hwnd,
cfg.win_name_always ? window_name : icon_name);
return 0;
case WM_SETFOCUS:
has_focus = TRUE;
- CreateCaret(hwnd, caretbm, 0, 0);
+ CreateCaret(hwnd, caretbm, font_width, font_height);
ShowCaret(hwnd);
compose_state = 0;
term_out();