MSG msg;
int guess_width, guess_height;
+ putty_inst = inst;
+
winsock_ver = MAKEWORD(1, 1);
if (WSAStartup(winsock_ver, &wsadata)) {
MessageBox(NULL, "Unable to initialise WinSock", "WinSock Error",
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, \
FIXED_PITCH | FF_DONTCARE, cfg.font)
if (cfg.vtmode != VT_OEMONLY) {
- f(FONT_NORMAL, ANSI_CHARSET, fw_dontcare, FALSE);
- f(FONT_UNDERLINE, ANSI_CHARSET, fw_dontcare, TRUE);
+ f(FONT_NORMAL, cfg.fontcharset, fw_dontcare, FALSE);
+ f(FONT_UNDERLINE, cfg.fontcharset, fw_dontcare, TRUE);
}
if (cfg.vtmode == VT_OEMANSI || cfg.vtmode == VT_OEMONLY) {
f(FONT_OEM, OEM_CHARSET, fw_dontcare, FALSE);
}
if (bold_mode == BOLD_FONT) {
if (cfg.vtmode != VT_OEMONLY) {
- f(FONT_BOLD, ANSI_CHARSET, fw_bold, FALSE);
- f(FONT_BOLDUND, ANSI_CHARSET, fw_bold, TRUE);
+ f(FONT_BOLD, cfg.fontcharset, fw_bold, FALSE);
+ f(FONT_BOLDUND, cfg.fontcharset, fw_bold, TRUE);
}
if (cfg.vtmode == VT_OEMANSI || cfg.vtmode == VT_OEMONLY) {
f(FONT_OEMBOLD, OEM_CHARSET, fw_bold, FALSE);
switch (message) {
case WM_CREATE:
break;
+ case WM_CLOSE:
+ if (!cfg.warn_on_close ||
+ MessageBox(hwnd, "Are you sure you want to close this session?",
+ "PuTTY Exit Confirmation",
+ MB_ICONWARNING | MB_OKCANCEL) == IDOK)
+ DestroyWindow(hwnd);
+ return 0;
case WM_DESTROY:
PostQuitMessage (0);
return 0;
case WM_IGNORE_SIZE:
ignore_size = TRUE; /* don't panic on next WM_SIZE msg */
break;
+ case WM_ENTERSIZEMOVE:
+ EnableSizeTip(1);
+ break;
+ case WM_EXITSIZEMOVE:
+ EnableSizeTip(0);
+ break;
case WM_SIZING:
{
int width, height, w, h, ew, eh;
height = r->bottom - r->top - extra_height;
w = (width + font_width/2) / font_width; if (w < 1) w = 1;
h = (height + font_height/2) / font_height; if (h < 1) h = 1;
+ UpdateSizeTip(hwnd, w, h);
ew = width - w * font_width;
eh = height - h * font_height;
if (ew != 0) {
* we're ready to cope.
*/
{
- char c = wParam;
+ char c = xlat_kbd2tty((unsigned char)wParam);
back->send (&c, 1);
}
return 0;
return 0;
}
if ((lParam & 0x20000000) && wParam == VK_F4) {
- SendMessage (hwnd, WM_DESTROY, 0, 0);
+ SendMessage (hwnd, WM_CLOSE, 0, 0);
return 0;
}
*/
if (ret) {
WORD chr;
- int r = ToAscii (wParam, (lParam >> 16) & 0xFF,
- keystate, &chr, 0);
+ int r;
+ BOOL capsOn=keystate[VK_CAPITAL] !=0;
+
+ /* helg: clear CAPS LOCK state if caps lock switches to cyrillic */
+ if(cfg.xlat_capslockcyr)
+ keystate[VK_CAPITAL] = 0;
+
+ r = ToAscii (wParam, (lParam >> 16) & 0xFF,
+ keystate, &chr, 0);
+
+ if(capsOn)
+ chr = xlat_latkbd2win((unsigned char)(chr & 0xFF));
if (r == 1) {
- *p++ = chr & 0xFF;
+ *p++ = xlat_kbd2tty((unsigned char)(chr & 0xFF));
return p - output;
}
}