#endif
#endif
+#ifndef NO_MULTIMON
#if WINVER < 0x0500
#define COMPILE_MULTIMON_STUBS
#include <multimon.h>
#endif
+#endif
#include <stdio.h>
#include <stdlib.h>
static int compose_state = 0;
+static int wsa_started = 0;
+
static OSVERSIONINFO osVersion;
static UINT wm_mousewheel = WM_MOUSEWHEEL;
WSACleanup();
return 1;
}
+ wsa_started = 1;
/* WISHLIST: maybe allow config tweaking even if winsock not present? */
sk_init();
}
}
+ cleanup_exit(msg.wParam);
+}
+
+/*
+ * Clean up and exit.
+ */
+void cleanup_exit(int code)
+{
/*
* Clean up.
*/
sfree(logpal);
if (pal)
DeleteObject(pal);
- WSACleanup();
+ sk_cleanup();
+ if (wsa_started)
+ WSACleanup();
if (cfg.protocol == PROT_SSH) {
random_save_seed();
#endif
}
- return msg.wParam;
+ exit(code);
}
/*
cfgtopalette();
init_palette();
+ /* Give terminal a heads-up on miscellaneous stuff */
+ term_reconfig();
+
/* Screen size changed ? */
if (cfg.height != prev_cfg.height ||
cfg.width != prev_cfg.width ||
return TRUE;
}
default:
- if (message == wm_mousewheel) {
+ if (message == wm_mousewheel || message == WM_MOUSEWHEEL) {
int shift_pressed=0, control_pressed=0, alt_pressed=0;
if (message == WM_MOUSEWHEEL) {
vsprintf(stuff, fmt, ap);
va_end(ap);
MessageBox(hwnd, stuff, "PuTTY Fatal Error", MB_ICONERROR | MB_OK);
- exit(1);
+ cleanup_exit(1);
}
/*
*/
void move_window(int x, int y)
{
+ if (cfg.resize_action == RESIZE_DISABLED ||
+ cfg.resize_action == RESIZE_FONT ||
+ IsZoomed(hwnd))
+ return;
+
SetWindowPos(hwnd, NULL, x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
}