| 805 |
} |
} |
| 806 |
} |
} |
| 807 |
|
|
| 808 |
// C-n/C-p/C-a/C-e をサポート (2007.9.5 maya) |
// C-p/C-n/C-b/C-f/C-a/C-e をサポート (2007.9.5 maya) |
| 809 |
// ドロップダウンの中のエディットコントロールを |
// ドロップダウンの中のエディットコントロールを |
| 810 |
// サブクラス化するためのウインドウプロシージャ |
// サブクラス化するためのウインドウプロシージャ |
| 811 |
static WNDPROC OrigHostnameEditProc; // Original window procedure |
static WNDPROC OrigHostnameEditProc; // Original window procedure |
| 813 |
WPARAM wParam, LPARAM lParam) |
WPARAM wParam, LPARAM lParam) |
| 814 |
{ |
{ |
| 815 |
HWND parent; |
HWND parent; |
| 816 |
int max_item, select_item; |
int max, select; |
| 817 |
|
|
| 818 |
switch (msg) { |
switch (msg) { |
| 819 |
// キーが押されたのを検知する |
// キーが押されたのを検知する |
| 820 |
case WM_KEYDOWN: |
case WM_KEYDOWN: |
| 821 |
if (GetKeyState(VK_CONTROL) < 0) { |
if (GetKeyState(VK_CONTROL) < 0) { |
| 822 |
switch (wParam) { |
switch (wParam) { |
| 823 |
case 0x4e: // Ctrl+n ... down |
case 0x50: // Ctrl+p ... up |
| 824 |
parent = GetParent(dlg); |
parent = GetParent(dlg); |
| 825 |
max_item = SendMessage(parent, CB_GETCOUNT, 0, 0); |
select = SendMessage(parent, CB_GETCURSEL, 0, 0); |
| 826 |
select_item = SendMessage(parent, CB_GETCURSEL, 0, 0); |
if (select > 0) { |
| 827 |
if (select_item < max_item - 1) { |
PostMessage(parent, CB_SETCURSEL, select - 1, 0); |
|
PostMessage(parent, CB_SETCURSEL, select_item + 1, 0); |
|
| 828 |
} |
} |
| 829 |
return 0; |
return 0; |
| 830 |
case 0x50: // Ctrl+p ... up |
case 0x4e: // Ctrl+n ... down |
| 831 |
parent = GetParent(dlg); |
parent = GetParent(dlg); |
| 832 |
select_item = SendMessage(parent, CB_GETCURSEL, 0, 0); |
max = SendMessage(parent, CB_GETCOUNT, 0, 0); |
| 833 |
if (select_item > 0) { |
select = SendMessage(parent, CB_GETCURSEL, 0, 0); |
| 834 |
PostMessage(parent, CB_SETCURSEL, select_item - 1, 0); |
if (select < max - 1) { |
| 835 |
|
PostMessage(parent, CB_SETCURSEL, select + 1, 0); |
| 836 |
} |
} |
| 837 |
return 0; |
return 0; |
| 838 |
case 0x41: // Ctrl+a ... left |
case 0x42: // Ctrl+b ... left |
| 839 |
|
SendMessage(dlg, EM_GETSEL, 0, (LPARAM)&select); |
| 840 |
|
PostMessage(dlg, EM_SETSEL, select-1, select-1); |
| 841 |
|
return 0; |
| 842 |
|
case 0x46: // Ctrl+f ... right |
| 843 |
|
SendMessage(dlg, EM_GETSEL, 0, (LPARAM)&select); |
| 844 |
|
max = GetWindowTextLength(dlg) ; |
| 845 |
|
PostMessage(dlg, EM_SETSEL, select+1, select+1); |
| 846 |
|
return 0; |
| 847 |
|
case 0x41: // Ctrl+a ... home |
| 848 |
PostMessage(dlg, EM_SETSEL, 0, 0); |
PostMessage(dlg, EM_SETSEL, 0, 0); |
| 849 |
return 0; |
return 0; |
| 850 |
case 0x45: // Ctrl+e ... right |
case 0x45: // Ctrl+e ... end |
| 851 |
max_item = GetWindowTextLength(dlg) ; |
max = GetWindowTextLength(dlg) ; |
| 852 |
PostMessage(dlg, EM_SETSEL, max_item, max_item); |
PostMessage(dlg, EM_SETSEL, max, max); |
| 853 |
return 0; |
return 0; |
| 854 |
} |
} |
| 855 |
} |
} |
| 856 |
break; |
break; |
| 857 |
|
|
| 858 |
// C-n/C-p/C-a/C-e の結果送られる文字で音が鳴るので捨てる |
// 上のキーを押した結果送られる文字で音が鳴るので捨てる |
| 859 |
case WM_CHAR: |
case WM_CHAR: |
| 860 |
switch (wParam) { |
switch (wParam) { |
| 861 |
case 0x01: |
case 0x01: |
| 862 |
|
case 0x02: |
| 863 |
case 0x05: |
case 0x05: |
| 864 |
|
case 0x06: |
| 865 |
case 0x0e: |
case 0x0e: |
| 866 |
case 0x10: |
case 0x10: |
| 867 |
return 0; |
return 0; |
| 886 |
LOGFONT logfont; |
LOGFONT logfont; |
| 887 |
HFONT font; |
HFONT font; |
| 888 |
char uimsg[MAX_UIMSG]; |
char uimsg[MAX_UIMSG]; |
| 889 |
HWND hwndHostname; // HOSTNAME dropdown |
HWND hwndHostname = NULL; // HOSTNAME dropdown |
| 890 |
HWND hwndHostnameEdit; // Edit control on HOSTNAME dropdown |
HWND hwndHostnameEdit = NULL; // Edit control on HOSTNAME dropdown |
| 891 |
|
|
| 892 |
GET_VAR(); |
GET_VAR(); |
| 893 |
|
|