X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/27be44524b0e41e95ce86831b885e1e1ed16886f..9d01fc9265bb4ddfc5e5b4236cb976de909d70cf:/windlg.c?ds=sidebyside diff --git a/windlg.c b/windlg.c index 14a60e81..faa71994 100644 --- a/windlg.c +++ b/windlg.c @@ -354,6 +354,11 @@ static int CALLBACK LogProc (HWND hwnd, UINT msg, char *clipdata; static unsigned char sel_nl[] = SEL_NL; + if (count == 0) { /* can't copy zero stuff */ + MessageBeep(0); + break; + } + size = 0; for (i = 0; i < count; i++) size += strlen(events[selitems[i]]) + sizeof(sel_nl); @@ -369,11 +374,14 @@ static int CALLBACK LogProc (HWND hwnd, UINT msg, memcpy(p, sel_nl, sizeof(sel_nl)); p += sizeof(sel_nl); } - write_clip(clipdata, size); - term_deselect(); + write_clip(clipdata, size, TRUE); free(clipdata); } free(selitems); + + for (i = 0; i < nevents; i++) + SendDlgItemMessage(hwnd, IDN_LIST, LB_SETSEL, + FALSE, i); } } return 0; @@ -1083,15 +1091,22 @@ static int CALLBACK ConnectionProc (HWND hwnd, UINT msg, multiedit(&cp, "Host &Name", IDC_HOSTSTATIC, IDC_HOST, 75, "&Port", IDC_PORTSTATIC, IDC_PORT, 25, NULL); - radioline(&cp, "Protocol:", IDC_PROTSTATIC, 3, - "&Raw", IDC_PROTRAW, - "&Telnet", IDC_PROTTELNET, + if (backends[2].backend == NULL) { + /* this is PuTTYtel, so only two protocols available */ + radioline(&cp, "Protocol:", IDC_PROTSTATIC, 3, + "&Raw", IDC_PROTRAW, + "&Telnet", IDC_PROTTELNET, NULL); + } else { + radioline(&cp, "Protocol:", IDC_PROTSTATIC, 3, + "&Raw", IDC_PROTRAW, + "&Telnet", IDC_PROTTELNET, #ifdef FWHACK - "SS&H/hack", + "SS&H/hack", #else - "SS&H", + "SS&H", #endif - IDC_PROTSSH, NULL); + IDC_PROTSSH, NULL); + } sesssaver(&cp, "Stor&ed Sessions", IDC_SESSSTATIC, IDC_SESSEDIT, IDC_SESSLIST, "&Load", IDC_SESSLOAD,