Revision: 7326 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7326 Author: zmatsuo Date: 2018-12-15 00:41:11 +0900 (Sat, 15 Dec 2018) Log Message: ----------- 小修正 - TCHAR向けdropdown追加 - IsWindowVisible() など Modified Paths: -------------- branches/cmake/teraterm/common/dlglib.c branches/cmake/teraterm/common/dlglib.h branches/cmake/teraterm/common/dlglib_cpp.cpp branches/cmake/teraterm/teraterm/teraprn.cpp branches/cmake/teraterm/teraterm/vtwin.cpp -------------- next part -------------- Modified: branches/cmake/teraterm/common/dlglib.c =================================================================== --- branches/cmake/teraterm/common/dlglib.c 2018-12-14 15:37:35 UTC (rev 7325) +++ branches/cmake/teraterm/common/dlglib.c 2018-12-14 15:41:11 UTC (rev 7326) @@ -186,12 +186,25 @@ i = 0; while (List[i] != NULL) { SendDlgItemMessageA(HDlg, Id_Item, CB_ADDSTRING, - 0, (LPARAM)List[i]); + 0, (LPARAM)List[i]); i++; } SendDlgItemMessage(HDlg, Id_Item, CB_SETCURSEL,nsel-1,0); } +void SetDropDownListW(HWND HDlg, int Id_Item, const wchar_t *List[], int nsel) +{ + int i; + + i = 0; + while (List[i] != NULL) { + SendDlgItemMessageW(HDlg, Id_Item, CB_ADDSTRING, + 0, (LPARAM)List[i]); + i++; + } + SendDlgItemMessage(HDlg, Id_Item, CB_SETCURSEL,nsel-1,0); +} + LONG GetCurSel(HWND HDlg, int Id_Item) { LRESULT n; Modified: branches/cmake/teraterm/common/dlglib.h =================================================================== --- branches/cmake/teraterm/common/dlglib.h 2018-12-14 15:37:35 UTC (rev 7325) +++ branches/cmake/teraterm/common/dlglib.h 2018-12-14 15:41:11 UTC (rev 7326) @@ -45,6 +45,7 @@ void SetDlgPercent(HWND HDlg, int id_Item, int id_Progress, LONG a, LONG b, int *prog); void SetDlgTime(HWND HDlg, int id_Item, DWORD elapsed, int bytes); void SetDropDownList(HWND HDlg, int Id_Item, const char *List[], int nsel); +void SetDropDownListW(HWND HDlg, int Id_Item, const wchar_t *List[], int nsel); LONG GetCurSel(HWND HDlg, int Id_Item); void InitDlgProgress(HWND HDlg, int id_Progress, int *CurProgStat); void SetEditboxSubclass(HWND hDlg, int nID, BOOL ComboBox); @@ -55,6 +56,12 @@ void SetDlgTexts(HWND hDlgWnd, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile); void SetDlgMenuTexts(HMENU hMenu, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile); +#if defined(_UNICODE) +#define SetDropDownListT(p1, p2, p3, p4) SetDropDownListW(p1, p2, p3, p4) +#else +#define SetDropDownListT(p1, p2, p3, p4) SetDropDownList(p1, p2, p3, p4) +#endif + //////////////////////////////////////// void TTSetDlgFont(const char *face, int height, int charset); //void TTSetDlgFont(const wchar_t *face, int height, int charset); Modified: branches/cmake/teraterm/common/dlglib_cpp.cpp =================================================================== --- branches/cmake/teraterm/common/dlglib_cpp.cpp 2018-12-14 15:37:35 UTC (rev 7325) +++ branches/cmake/teraterm/common/dlglib_cpp.cpp 2018-12-14 15:41:11 UTC (rev 7326) @@ -112,7 +112,7 @@ { TTDialogData *data = (TTDialogData *)GetWindowLongPtr(hDlgWnd, DWLP_USER); if (msg == WM_INITDIALOG) { - TTDialogData *data = (TTDialogData *)lParam; + data = (TTDialogData *)lParam; SetWindowLongPtr(hDlgWnd, DWLP_USER, (LONG_PTR)lParam); lParam = data->ParamInit; } Modified: branches/cmake/teraterm/teraterm/teraprn.cpp =================================================================== --- branches/cmake/teraterm/teraterm/teraprn.cpp 2018-12-14 15:37:35 UTC (rev 7325) +++ branches/cmake/teraterm/teraterm/teraprn.cpp 2018-12-14 15:41:11 UTC (rev 7326) @@ -28,7 +28,6 @@ */ /* TERATERM.EXE, Printing routines */ -//#include "stdafx.h" #include "teraterm.h" #include "tttypes.h" #include <commdlg.h> Modified: branches/cmake/teraterm/teraterm/vtwin.cpp =================================================================== --- branches/cmake/teraterm/teraterm/vtwin.cpp 2018-12-14 15:37:35 UTC (rev 7325) +++ branches/cmake/teraterm/teraterm/vtwin.cpp 2018-12-14 15:41:11 UTC (rev 7326) @@ -2510,7 +2510,7 @@ int Xs, Ys, Xe, Ye; // \x95\\x8E\xA6\x82\xB3\x82\xEA\x82Ă\xA2\x82Ȃ\xAD\x82Ă\xE0WM_PAINT\x82\xAA\x94\xAD\x90\xB6\x82\xB7\x82\xE9\x83P\x81[\x83X\x91\xF4 - if (IsWindowVisible() == 0) { + if (::IsWindowVisible(m_hWnd) == 0) { return; }