小修正
- TCHAR向けdropdown追加
- IsWindowVisible() など
@@ -186,12 +186,25 @@ | ||
186 | 186 | i = 0; |
187 | 187 | while (List[i] != NULL) { |
188 | 188 | SendDlgItemMessageA(HDlg, Id_Item, CB_ADDSTRING, |
189 | - 0, (LPARAM)List[i]); | |
189 | + 0, (LPARAM)List[i]); | |
190 | 190 | i++; |
191 | 191 | } |
192 | 192 | SendDlgItemMessage(HDlg, Id_Item, CB_SETCURSEL,nsel-1,0); |
193 | 193 | } |
194 | 194 | |
195 | +void SetDropDownListW(HWND HDlg, int Id_Item, const wchar_t *List[], int nsel) | |
196 | +{ | |
197 | + int i; | |
198 | + | |
199 | + i = 0; | |
200 | + while (List[i] != NULL) { | |
201 | + SendDlgItemMessageW(HDlg, Id_Item, CB_ADDSTRING, | |
202 | + 0, (LPARAM)List[i]); | |
203 | + i++; | |
204 | + } | |
205 | + SendDlgItemMessage(HDlg, Id_Item, CB_SETCURSEL,nsel-1,0); | |
206 | +} | |
207 | + | |
195 | 208 | LONG GetCurSel(HWND HDlg, int Id_Item) |
196 | 209 | { |
197 | 210 | LRESULT n; |
@@ -45,6 +45,7 @@ | ||
45 | 45 | void SetDlgPercent(HWND HDlg, int id_Item, int id_Progress, LONG a, LONG b, int *prog); |
46 | 46 | void SetDlgTime(HWND HDlg, int id_Item, DWORD elapsed, int bytes); |
47 | 47 | void SetDropDownList(HWND HDlg, int Id_Item, const char *List[], int nsel); |
48 | +void SetDropDownListW(HWND HDlg, int Id_Item, const wchar_t *List[], int nsel); | |
48 | 49 | LONG GetCurSel(HWND HDlg, int Id_Item); |
49 | 50 | void InitDlgProgress(HWND HDlg, int id_Progress, int *CurProgStat); |
50 | 51 | void SetEditboxSubclass(HWND hDlg, int nID, BOOL ComboBox); |
@@ -55,6 +56,12 @@ | ||
55 | 56 | void SetDlgTexts(HWND hDlgWnd, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile); |
56 | 57 | void SetDlgMenuTexts(HMENU hMenu, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile); |
57 | 58 | |
59 | +#if defined(_UNICODE) | |
60 | +#define SetDropDownListT(p1, p2, p3, p4) SetDropDownListW(p1, p2, p3, p4) | |
61 | +#else | |
62 | +#define SetDropDownListT(p1, p2, p3, p4) SetDropDownList(p1, p2, p3, p4) | |
63 | +#endif | |
64 | + | |
58 | 65 | //////////////////////////////////////// |
59 | 66 | void TTSetDlgFont(const char *face, int height, int charset); |
60 | 67 | //void TTSetDlgFont(const wchar_t *face, int height, int charset); |
@@ -112,7 +112,7 @@ | ||
112 | 112 | { |
113 | 113 | TTDialogData *data = (TTDialogData *)GetWindowLongPtr(hDlgWnd, DWLP_USER); |
114 | 114 | if (msg == WM_INITDIALOG) { |
115 | - TTDialogData *data = (TTDialogData *)lParam; | |
115 | + data = (TTDialogData *)lParam; | |
116 | 116 | SetWindowLongPtr(hDlgWnd, DWLP_USER, (LONG_PTR)lParam); |
117 | 117 | lParam = data->ParamInit; |
118 | 118 | } |
@@ -28,7 +28,6 @@ | ||
28 | 28 | */ |
29 | 29 | |
30 | 30 | /* TERATERM.EXE, Printing routines */ |
31 | -//#include "stdafx.h" | |
32 | 31 | #include "teraterm.h" |
33 | 32 | #include "tttypes.h" |
34 | 33 | #include <commdlg.h> |
@@ -2510,7 +2510,7 @@ | ||
2510 | 2510 | int Xs, Ys, Xe, Ye; |
2511 | 2511 | |
2512 | 2512 | // 表示されていなくてもWM_PAINTが発生するケース対策 |
2513 | - if (IsWindowVisible() == 0) { | |
2513 | + if (::IsWindowVisible(m_hWnd) == 0) { | |
2514 | 2514 | return; |
2515 | 2515 | } |
2516 | 2516 |