exit(1);
}
+/*
+ * Stubs for linking with other modules.
+ */
+void write_clip (void *data, int len) { }
+void term_deselect(void) { }
+
HANDLE outhandle;
DWORD orig_console_mode;
static void gui_update_stats(char *name, unsigned long size, int percentage, time_t elapsed);
/*
- * These functions are needed to link with ssh.c, but never get called.
+ * These functions are needed to link with other modules, but
+ * (should) never get called.
*/
-void term_out(void)
-{
- abort();
-}
-void begin_session(void) {
-}
+void term_out(void) { abort(); }
+void begin_session(void) { }
+void write_clip (void *data, int len) { }
+void term_deselect(void) { }
/* GUI Adaptation - Sept 2000 */
void send_msg(HWND h, UINT message, WPARAM wParam)
#define IDD_LICENCEBOX 113
#define IDN_LIST 1001
+#define IDN_COPY 1002
#define IDA_ICON 1001
#define IDA_TEXT1 1002
END
-/* Accelerators used: c */
+/* Accelerators used: co */
IDD_LOGBOX DIALOG DISCARDABLE 100, 20, 160, 119
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "PuTTY Event Log"
FONT 8, "MS Sans Serif"
BEGIN
- DEFPUSHBUTTON "&Close", IDOK, 58, 102, 44, 14
- LISTBOX IDN_LIST, 3, 3, 154, 95, LBS_HASSTRINGS | LBS_USETABSTOPS | WS_VSCROLL
+ DEFPUSHBUTTON "&Close", IDOK, 85, 102, 44, 14
+ PUSHBUTTON "C&opy", IDN_COPY, 31, 102, 44, 14
+ LISTBOX IDN_LIST, 3, 3, 154, 95, LBS_HASSTRINGS | LBS_USETABSTOPS | WS_VSCROLL | LBS_EXTENDEDSEL
END
/* No accelerators used */
logbox = NULL;
DestroyWindow (hwnd);
return 0;
+ case IDN_COPY:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED) {
+ int selcount;
+ int *selitems;
+ selcount = SendDlgItemMessage(hwnd, IDN_LIST,
+ LB_GETSELCOUNT, 0, 0);
+ selitems = malloc(selcount * sizeof(int));
+ if (selitems) {
+ int count = SendDlgItemMessage(hwnd, IDN_LIST,
+ LB_GETSELITEMS,
+ selcount, (LPARAM)selitems);
+ int i;
+ int size;
+ char *clipdata;
+ static unsigned char sel_nl[] = SEL_NL;
+
+ size = 0;
+ for (i = 0; i < count; i++)
+ size += strlen(events[selitems[i]]) + sizeof(sel_nl);
+
+ clipdata = malloc(size);
+ if (clipdata) {
+ char *p = clipdata;
+ for (i = 0; i < count; i++) {
+ char *q = events[selitems[i]];
+ int qlen = strlen(q);
+ memcpy(p, q, qlen);
+ p += qlen;
+ memcpy(p, sel_nl, sizeof(sel_nl));
+ p += sizeof(sel_nl);
+ }
+ write_clip(clipdata, size);
+ term_deselect();
+ free(clipdata);
+ }
+ free(selitems);
+ }
+ }
+ return 0;
}
return 0;
case WM_CLOSE:
SendDlgItemMessage (logbox, IDN_LIST, LB_ADDSTRING,
0, (LPARAM)string);
count = SendDlgItemMessage (logbox, IDN_LIST, LB_GETCOUNT, 0, 0);
- SendDlgItemMessage (logbox, IDN_LIST, LB_SETCURSEL, count-1, 0);
+ SendDlgItemMessage (logbox, IDN_LIST, LB_SETTOPINDEX, count-1, 0);
}
}