Browse Subversion Repository
Diff of /branches/ssh_chacha20poly1305/ttssh2/ttxssh/ttxssh.c
Parent Directory
| Revision Log
| Patch
| 817 |
{ |
{ |
| 818 |
HWND parent; |
HWND parent; |
| 819 |
int max, select, len; |
int max, select, len; |
| 820 |
char *str; |
char *str, *orgstr; |
| 821 |
|
|
| 822 |
switch (msg) { |
switch (msg) { |
| 823 |
// キーが押されたのを検知する |
// キーが押されたのを検知する |
| 858 |
|
|
| 859 |
case 0x44: // Ctrl+d |
case 0x44: // Ctrl+d |
| 860 |
case 0x4b: // Ctrl+k |
case 0x4b: // Ctrl+k |
| 861 |
|
case 0x55: // Ctrl+u |
| 862 |
SendMessage(dlg, EM_GETSEL, 0, (LPARAM)&select); |
SendMessage(dlg, EM_GETSEL, 0, (LPARAM)&select); |
| 863 |
max = GetWindowTextLength(dlg); |
max = GetWindowTextLength(dlg); |
| 864 |
max++; // '\0' |
max++; // '\0' |
| 865 |
str = malloc(max); |
orgstr = str = malloc(max); |
| 866 |
if (str != NULL) { |
if (str != NULL) { |
| 867 |
len = GetWindowText(dlg, str, max); |
len = GetWindowText(dlg, str, max); |
| 868 |
if (select >= 0 && select < len) { |
if (select >= 0 && select < len) { |
| 872 |
|
|
| 873 |
} else if (wParam == 0x4b) { // カーソルから行末まで削除する |
} else if (wParam == 0x4b) { // カーソルから行末まで削除する |
| 874 |
str[select] = '\0'; |
str[select] = '\0'; |
| 875 |
|
|
| 876 |
} |
} |
| 877 |
|
} |
| 878 |
|
|
| 879 |
SetWindowText(dlg, str); |
if (wParam == 0x55) { // カーソルより左側をすべて消す |
| 880 |
SendMessage(dlg, EM_SETSEL, select, select); |
if (select >= len) { |
| 881 |
|
str[0] = '\0'; |
| 882 |
|
} else { |
| 883 |
|
str = &str[select]; |
| 884 |
|
} |
| 885 |
|
select = 0; |
| 886 |
} |
} |
| 887 |
free(str); |
|
| 888 |
|
SetWindowText(dlg, str); |
| 889 |
|
SendMessage(dlg, EM_SETSEL, select, select); |
| 890 |
|
free(orgstr); |
| 891 |
return 0; |
return 0; |
| 892 |
} |
} |
| 893 |
break; |
break; |
| 906 |
case 0x0b: |
case 0x0b: |
| 907 |
case 0x0e: |
case 0x0e: |
| 908 |
case 0x10: |
case 0x10: |
| 909 |
|
case 0x15: |
| 910 |
return 0; |
return 0; |
| 911 |
} |
} |
| 912 |
} |
} |
|
|
Legend:
| Removed from v.3045 |
|
| changed lines |
| |
Added in v.3048 |
|
|
| |