scmno****@osdn*****
scmno****@osdn*****
2018年 9月 20日 (木) 08:18:40 JST
Revision: 7248 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7248 Author: zmatsuo Date: 2018-09-20 08:18:40 +0900 (Thu, 20 Sep 2018) Log Message: ----------- *透過具合をActive/Inactiveで各々調整できるようにした *タイトルバー上でホイール操作をすると透過調整できるようにした teraterm/common/compat_win.cpp,h WIN32 API 関連 teraterm/common/ttlib.c ウィンドウ上の位置取得関数追加 teraterm/teraterm/addsetting.cpp,h i18n系をテーブルに変更 表示タブ 透過値の設定追加,サンプルテキストを実装,マウスカーソルをドロップダウンに変更 teraterm/teraterm/vtdisp.c ローカルな変数と関数をstaticに,dprintf()をOutputDebugPrintf()に置換 teraterm/teraterm/vtwin.cpp ホイール処理追加,コンパイル時に警告が出るところを修正 Modified Paths: -------------- branches/transparent-window/installer/release/lang/Japanese.lng branches/transparent-window/teraterm/common/tt_res.h branches/transparent-window/teraterm/common/ttlib.c branches/transparent-window/teraterm/common/ttlib.h branches/transparent-window/teraterm/common/tttypes.h branches/transparent-window/teraterm/teraterm/addsetting.cpp branches/transparent-window/teraterm/teraterm/addsetting.h branches/transparent-window/teraterm/teraterm/teraterm.cpp branches/transparent-window/teraterm/teraterm/ttermpro.rc branches/transparent-window/teraterm/teraterm/ttermpro.v15.vcxproj branches/transparent-window/teraterm/teraterm/ttermpro.v15.vcxproj.filters branches/transparent-window/teraterm/teraterm/ttermpro.vcproj branches/transparent-window/teraterm/teraterm/vtdisp.c branches/transparent-window/teraterm/teraterm/vtwin.cpp branches/transparent-window/teraterm/teraterm/vtwin.h branches/transparent-window/teraterm/ttpdlg/ttpdlg.rc branches/transparent-window/teraterm/ttpset/ttset.c Added Paths: ----------- branches/transparent-window/teraterm/common/compat_win.cpp branches/transparent-window/teraterm/common/compat_win.h -------------- next part -------------- Modified: branches/transparent-window/installer/release/lang/Japanese.lng =================================================================== --- branches/transparent-window/installer/release/lang/Japanese.lng 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/installer/release/lang/Japanese.lng 2018-09-19 23:18:40 UTC (rev 7248) @@ -224,7 +224,9 @@ DLG_TAB_COPYPASTE_PASTEDELAY=\x93\\x82\xE8\x95t\x82\xAF\x82̍s\x8AԒx\x89\x84(&A) DLG_TAB_COPYPASTE_PASTEDELAY2=\x83~\x83\x8A\x95b -DLG_TAB_VISUAL_ALPHA=\x94\xBC\x93\xA7\x96\xBE\x93x(&A) +DLG_TAB_VISUAL_ALPHA=\x93\xA7\x89߃E\x83B\x83\x93\x83h\x83E +DLG_TAB_VISUAL_ALPHA_ACTIVE_LABEL=\x83A\x83N\x83e\x83B\x83u(&A) +DLG_TAB_VISUAL_ALPHA_INACTIVE_LABEL=\x94\xF1\x83A\x83N\x83e\x83B\x83u(&C) DLG_TAB_VISUAL_ETERM=&Eterm\x95\x97\x82ɂ\xB7\x82\xE9(*) DLG_TAB_VISUAL_BGIMG=\x94w\x8Ci\x89摜(&I) DLG_TAB_VISUAL_BGIMG_BRIGHTNESS=\x89摜\x82̖\xBE\x82邳(&T) Added: branches/transparent-window/teraterm/common/compat_win.cpp =================================================================== --- branches/transparent-window/teraterm/common/compat_win.cpp (rev 0) +++ branches/transparent-window/teraterm/common/compat_win.cpp 2018-09-19 23:18:40 UTC (rev 7248) @@ -0,0 +1,95 @@ +/* + * (C) 2018 TeraTerm Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* compat_win */ + +#include "compat_win.h" + +HINSTANCE hDll_msimg32; +HMODULE hDll_user32; + +BOOL (WINAPI *pAlphaBlend)(HDC,int,int,int,int,HDC,int,int,int,int,BLENDFUNCTION); +BOOL (WINAPI *pEnumDisplayMonitors)(HDC,LPCRECT,MONITORENUMPROC,LPARAM); +DPI_AWARENESS_CONTEXT (WINAPI *pSetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT dpiContext); +UINT (WINAPI *pGetDpiForWindow)(HWND hwnd); +BOOL (WINAPI *pSetLayeredWindowAttributes)(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags); + +typedef struct { + const char *ApiName; + void **func; +} APIInfo; + +typedef struct { + const char *DllName; + HINSTANCE *hDll; + const APIInfo *APIInfoPtr; + size_t APIInfoCount; +} DllInfo; + +static const APIInfo Lists_user32[] = { + { "SetLayeredWindowAttributes", (void **)&pSetLayeredWindowAttributes }, + { "SetThreadDpiAwarenessContext", (void **)&pSetThreadDpiAwarenessContext }, + { "GetDpiForWindow", (void **)&pGetDpiForWindow } +}; + +static const APIInfo Lists_msimg32[] = { + { "AlphaBlend", (void **)&pAlphaBlend }, +}; + +static const DllInfo DllInfos[] = { + { "user32.dll", &hDll_user32, Lists_user32, _countof(Lists_user32) }, + { "msimg32.dll", &hDll_msimg32, Lists_msimg32, _countof(Lists_msimg32) }, +}; + +void WinCompatInit() +{ + static BOOL done = FALSE; + if (done) return; + done = TRUE; + + for (size_t i = 0; i < _countof(DllInfos); i++) { + const DllInfo *pDllInfo = &DllInfos[i]; + + char dllName[MAX_PATH]; + GetSystemDirectory(dllName, sizeof(dllName)); + strcat_s(dllName, sizeof(dllName), "/"); + strcat_s(dllName, sizeof(dllName), pDllInfo->DllName); + + HINSTANCE hDll = LoadLibrary(dllName); + *pDllInfo->hDll = hDll; + + if (hDll != NULL) { + const APIInfo *pApiInfo = pDllInfo->APIInfoPtr; + for (size_t j = 0; j < pDllInfo->APIInfoCount; j++) { + void **func = pApiInfo->func; + *func = (void *)GetProcAddress(hDll, pApiInfo->ApiName); + pApiInfo++; + } + } + } +} Added: branches/transparent-window/teraterm/common/compat_win.h =================================================================== --- branches/transparent-window/teraterm/common/compat_win.h (rev 0) +++ branches/transparent-window/teraterm/common/compat_win.h 2018-09-19 23:18:40 UTC (rev 7248) @@ -0,0 +1,70 @@ +/* + * (C) 2018 TeraTerm Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* compat_win */ + +#pragma once + +#include <windows.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(DPI_AWARENESS_CONTEXT_SYSTEM_AWARE) +#define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((DPI_AWARENESS_CONTEXT)-2) +#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((DPI_AWARENESS_CONTEXT)-3) +#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT)-4) +DECLARE_HANDLE(DPI_AWARENESS_CONTEXT); +#endif + +#if !defined(WM_DPICHANGED) +#define WM_DPICHANGED 0x02E0 +#endif + +#if 0 +// BLENDFUNCTIONと同一 +typedef struct _BGBLENDFUNCTION +{ + BYTE BlendOp; + BYTE BlendFlags; + BYTE SourceConstantAlpha; + BYTE AlphaFormat; +}BGBLENDFUNCTION; +#endif +extern BOOL (WINAPI *pAlphaBlend)(HDC,int,int,int,int,HDC,int,int,int,int,BLENDFUNCTION); +extern BOOL (WINAPI *pEnumDisplayMonitors)(HDC,LPCRECT,MONITORENUMPROC,LPARAM); +extern DPI_AWARENESS_CONTEXT (WINAPI *pSetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT dpiContext); +extern UINT (WINAPI *pGetDpiForWindow)(HWND hwnd); +extern BOOL (WINAPI *pSetLayeredWindowAttributes)(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags); + +void WinCompatInit(); + +#ifdef __cplusplus +} +#endif Modified: branches/transparent-window/teraterm/common/tt_res.h =================================================================== --- branches/transparent-window/teraterm/common/tt_res.h 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/teraterm/common/tt_res.h 2018-09-19 23:18:40 UTC (rev 7248) @@ -31,7 +31,10 @@ #define IDC_FULLPATH_LABEL 1002 #define IDC_LINECOPY 1003 #define IDC_MOUSE_CURSOR 1004 -#define IDC_ALPHA_BLEND 1008 +#define IDC_ALPHA_BLEND_ACTIVE 1005 +#define IDC_ALPHA_BLEND_INACTIVE 1006 +#define IDC_ALPHA_BLEND_ACTIVE_LABEL 1007 +#define IDC_ALPHA_BLEND_INACTIVE_LABEL 1008 #define IDC_CYGWIN_PATH 1009 #define IDC_SELECT_FILE 1010 #define IDC_DELIM_LIST 1011 Modified: branches/transparent-window/teraterm/common/ttlib.c =================================================================== --- branches/transparent-window/teraterm/common/ttlib.c 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/teraterm/common/ttlib.c 2018-09-19 23:18:40 UTC (rev 7248) @@ -1716,3 +1716,68 @@ *body = p1; } + +/** + * \x83E\x83B\x83\x93\x83h\x83E\x8F\xE3\x82̈ʒu\x82\xF0\x8E擾\x82\xB7\x82\xE9 + * @Param[in] hWnd + * @Param[in] point \x88ʒu(x,y) + * @Param[in,out] InWindow \x83E\x83B\x83\x93\x83h\x83E\x8F\xE3 + * @Param[in,out] InClient \x83N\x83\x89\x83C\x83A\x83\x93\x83g\x97̈\xE6\x8F\xE3 + * @Param[in,out] InTitleBar \x83^\x83C\x83g\x83\x8B\x83o\x81[\x8F\xE3 + * @retval FALSE \x96\xB3\x8C\xF8\x82\xC8hWnd + */ +BOOL GetPositionOnWindow( + HWND hWnd, const POINT *point, + BOOL *InWindow, BOOL *InClient, BOOL *InTitleBar) +{ + const int x = point->x; + const int y = point->y; + RECT winRect; + RECT clientRect; + + if (InWindow != NULL) *InWindow = FALSE; + if (InClient != NULL) *InClient = FALSE; + if (InTitleBar != NULL) *InTitleBar = FALSE; + + if (!GetWindowRect(hWnd, &winRect)) { + return FALSE; + } + + if ((x < winRect.left) || (winRect.right < x) || + (y < winRect.top) || (winRect.bottom < y)) + { + return TRUE; + } + if (InWindow != NULL) *InWindow = TRUE; + + { + POINT pos; + GetClientRect(hWnd, &clientRect); + pos.x = clientRect.left; + pos.y = clientRect.top; + ClientToScreen(hWnd, &pos); + clientRect.left = pos.x; + clientRect.top = pos.y; + + pos.x = clientRect.right; + pos.y = clientRect.bottom; + ClientToScreen(hWnd, &pos); + clientRect.right = pos.x; + clientRect.bottom = pos.y; + } + + if ((clientRect.left <= x) && (x < clientRect.right) && + (clientRect.top <= y) && (y < clientRect.bottom)) + { + if (InClient != NULL) *InClient = TRUE; + if (InTitleBar != NULL) *InTitleBar = FALSE; + return TRUE; + } + if (InClient != NULL) *InClient = FALSE; + + if (InTitleBar != NULL) { + *InTitleBar = (y < clientRect.top) ? TRUE : FALSE; + } + + return TRUE; +} Modified: branches/transparent-window/teraterm/common/ttlib.h =================================================================== --- branches/transparent-window/teraterm/common/ttlib.h 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/teraterm/common/ttlib.h 2018-09-19 23:18:40 UTC (rev 7248) @@ -99,6 +99,9 @@ void PASCAL DeleteComment(PCHAR dest, int dest_size, PCHAR src); void split_buffer(char *buffer, int delimiter, char **head, char **body); +BOOL GetPositionOnWindow( + HWND hWnd, const POINT *point, + BOOL *InWindow, BOOL *InClient, BOOL *InTitleBar); #define CheckFlag(var, flag) (((var) & (flag)) != 0) Modified: branches/transparent-window/teraterm/common/tttypes.h =================================================================== --- branches/transparent-window/teraterm/common/tttypes.h 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/teraterm/common/tttypes.h 2018-09-19 23:18:40 UTC (rev 7248) @@ -549,8 +549,9 @@ COLORREF ANSIColor[16]; /* protocol used in connect() */ int ProtocolFamily; - char MouseCursorName[16]; - int AlphaBlend; + char MouseCursorName[16]; + int AlphaBlendActive; + int AlphaBlendInactive; char CygwinDirectory[MAX_PATH]; #define DEFAULT_LOCALE "japanese" char Locale[80]; Modified: branches/transparent-window/teraterm/teraterm/addsetting.cpp =================================================================== --- branches/transparent-window/teraterm/teraterm/addsetting.cpp 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/teraterm/teraterm/addsetting.cpp 2018-09-19 23:18:40 UTC (rev 7248) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2017 TeraTerm Project + * Copyright (C) 2008-2018 TeraTerm Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,9 @@ #include "ttwinman.h" #include "ttcommon.h" #include "ttftypes.h" +#include "dlglib.h" -mouse_cursor_t MouseCursor[] = { +const mouse_cursor_t MouseCursor[] = { {"ARROW", IDC_ARROW}, {"IBEAM", IDC_IBEAM}, {"CROSS", IDC_CROSS}, @@ -51,10 +52,6 @@ }; #define MOUSE_CURSOR_MAX (sizeof(MouseCursor)/sizeof(MouseCursor[0]) - 1) -// \x96{\x91̂\xCD vtwin.cpp -extern void SetWindowStyle(TTTSet *ts); - - static void SetupRGBbox(HWND hDlgWnd, int index) { HWND hWnd; @@ -102,9 +99,25 @@ BOOL CGeneralPropPageDlg::OnInitDialog() { - char uimsg[MAX_UIMSG]; char buf[64]; CButton *btn; + static const DlgTextInfo TextInfos[] = { + { IDC_CLICKABLE_URL, "DLG_TAB_GENERAL_CLICKURL" }, + { IDC_DISABLE_SENDBREAK, "DLG_TAB_GENERAL_DISABLESENDBREAK" }, + { IDC_ACCEPT_BROADCAST, "DLG_TAB_GENERAL_ACCEPTBROADCAST" }, + { IDC_MOUSEWHEEL_SCROLL_LINE, "DLG_TAB_GENERAL_MOUSEWHEEL_SCROLL_LINE" }, + { IDC_AUTOSCROLL_ONLY_IN_BOTTOM_LINE, "DLG_TAB_GENERAL_AUTOSCROLL_ONLY_IN_BOTTOM_LINE" }, + { IDC_CLEAR_ON_RESIZE, "DLG_TAB_GENERAL_CLEAR_ON_RESIZE" }, + { IDC_CURSOR_CHANGE_IME, "DLG_TAB_GENERAL_CURSOR_CHANGE_IME" }, + { IDC_LIST_HIDDEN_FONTS, "DLG_TAB_GENERAL_LIST_HIDDEN_FONTS" }, + { IDC_TITLEFMT_GROUP, "DLG_TAB_GENERAL_TITLEFMT_GROUP" }, + { IDC_TITLEFMT_DISPHOSTNAME, "DLG_TAB_GENERAL_TITLEFMT_DISPHOSTNAME" }, + { IDC_TITLEFMT_DISPSESSION, "DLG_TAB_GENERAL_TITLEFMT_DISPSESSION" }, + { IDC_TITLEFMT_DISPVTTEK, "DLG_TAB_GENERAL_TITLEFMT_DISPVTTEK" }, + { IDC_TITLEFMT_SWAPHOSTTITLE, "DLG_TAB_GENERAL_TITLEFMT_SWAPHOSTTITLE" }, + { IDC_TITLEFMT_DISPTCPPORT, "DLG_TAB_GENERAL_TITLEFMT_DISPTCPPORT" }, + { IDC_TITLEFMT_DISPSERIALSPEED, "DLG_TAB_GENERAL_TITLEFMT_DISPSERIALSPEED" } + }; CPropertyPage::OnInitDialog(); @@ -132,53 +145,8 @@ DlgGeneralFont = NULL; } - GetDlgItemText(IDC_CLICKABLE_URL, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_GENERAL_CLICKURL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_CLICKABLE_URL, ts.UIMsg); - GetDlgItemText(IDC_DISABLE_SENDBREAK, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_GENERAL_DISABLESENDBREAK", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_DISABLE_SENDBREAK, ts.UIMsg); - GetDlgItemText(IDC_ACCEPT_BROADCAST, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_GENERAL_ACCEPTBROADCAST", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_ACCEPT_BROADCAST, ts.UIMsg); - GetDlgItemText(IDC_MOUSEWHEEL_SCROLL_LINE, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_GENERAL_MOUSEWHEEL_SCROLL_LINE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_MOUSEWHEEL_SCROLL_LINE, ts.UIMsg); - GetDlgItemText(IDC_AUTOSCROLL_ONLY_IN_BOTTOM_LINE, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_GENERAL_AUTOSCROLL_ONLY_IN_BOTTOM_LINE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_AUTOSCROLL_ONLY_IN_BOTTOM_LINE, ts.UIMsg); - GetDlgItemText(IDC_CLEAR_ON_RESIZE, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_GENERAL_CLEAR_ON_RESIZE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_CLEAR_ON_RESIZE, ts.UIMsg); - GetDlgItemText(IDC_CURSOR_CHANGE_IME, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_GENERAL_CURSOR_CHANGE_IME", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_CURSOR_CHANGE_IME, ts.UIMsg); - GetDlgItemText(IDC_LIST_HIDDEN_FONTS, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_GENERAL_LIST_HIDDEN_FONTS", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_LIST_HIDDEN_FONTS, ts.UIMsg); + SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), ts.UILanguageFile); - GetDlgItemText(IDC_TITLEFMT_GROUP, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_GENERAL_TITLEFMT_GROUP", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_TITLEFMT_GROUP, ts.UIMsg); - GetDlgItemText(IDC_TITLEFMT_DISPHOSTNAME, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_GENERAL_TITLEFMT_DISPHOSTNAME", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_TITLEFMT_DISPHOSTNAME, ts.UIMsg); - GetDlgItemText(IDC_TITLEFMT_DISPSESSION, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_GENERAL_TITLEFMT_DISPSESSION", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_TITLEFMT_DISPSESSION, ts.UIMsg); - GetDlgItemText(IDC_TITLEFMT_DISPVTTEK, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_GENERAL_TITLEFMT_DISPVTTEK", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_TITLEFMT_DISPVTTEK, ts.UIMsg); - GetDlgItemText(IDC_TITLEFMT_SWAPHOSTTITLE, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_GENERAL_TITLEFMT_SWAPHOSTTITLE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_TITLEFMT_SWAPHOSTTITLE, ts.UIMsg); - GetDlgItemText(IDC_TITLEFMT_DISPTCPPORT, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_GENERAL_TITLEFMT_DISPTCPPORT", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_TITLEFMT_DISPTCPPORT, ts.UIMsg); - GetDlgItemText(IDC_TITLEFMT_DISPSERIALSPEED, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_GENERAL_TITLEFMT_DISPSERIALSPEED", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_TITLEFMT_DISPSERIALSPEED, ts.UIMsg); - // (1)DisableAcceleratorSendBreak btn = (CButton *)GetDlgItem(IDC_DISABLE_SENDBREAK); btn->SetCheck(ts.DisableAcceleratorSendBreak); @@ -320,10 +288,23 @@ BOOL CSequencePropPageDlg::OnInitDialog() { - char uimsg[MAX_UIMSG]; CButton *btn, *btn2; CComboBox *cmb; + static const DlgTextInfo TextInfos[] = { + { IDC_ACCEPT_MOUSE_EVENT_TRACKING, "DLG_TAB_SEQUENCE_ACCEPT_MOUSE_EVENT_TRACKING" }, + { IDC_DISABLE_MOUSE_TRACKING_CTRL, "DLG_TAB_SEQUENCE_DISABLE_MOUSE_TRACKING_CTRL" }, + { IDC_ACCEPT_TITLE_CHANGING_LABEL, "DLG_TAB_SEQUENCE_ACCEPT_TITLE_CHANGING" }, + { IDC_CURSOR_CTRL_SEQ, "DLG_TAB_SEQUENCE_CURSOR_CTRL" }, + { IDC_WINDOW_CTRL, "DLG_TAB_SEQUENCE_WINDOW_CTRL" }, + { IDC_WINDOW_REPORT, "DLG_TAB_SEQUENCE_WINDOW_REPORT" }, + { IDC_TITLE_REPORT_LABEL, "DLG_TAB_SEQUENCE_TITLE_REPORT" }, + + { IDC_CLIPBOARD_ACCESS_LABEL, "DLG_TAB_SEQUENCE_CLIPBOARD_ACCESS" }, + + { IDC_CLIPBOARD_NOTIFY, "DLG_TAB_SEQUENCE_CLIPBOARD_NOTIFY" }, + }; + CPropertyPage::OnInitDialog(); font = (HFONT)SendMessage(WM_GETFONT, 0, 0); @@ -346,15 +327,7 @@ DlgSequenceFont = NULL; } - GetDlgItemText(IDC_ACCEPT_MOUSE_EVENT_TRACKING, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_SEQUENCE_ACCEPT_MOUSE_EVENT_TRACKING", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_ACCEPT_MOUSE_EVENT_TRACKING, ts.UIMsg); - GetDlgItemText(IDC_DISABLE_MOUSE_TRACKING_CTRL, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_SEQUENCE_DISABLE_MOUSE_TRACKING_CTRL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_DISABLE_MOUSE_TRACKING_CTRL, ts.UIMsg); - GetDlgItemText(IDC_ACCEPT_TITLE_CHANGING_LABEL, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_SEQUENCE_ACCEPT_TITLE_CHANGING", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_ACCEPT_TITLE_CHANGING_LABEL, ts.UIMsg); + SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), ts.UILanguageFile); get_lang_msg("DLG_TAB_SEQUENCE_ACCEPT_TITLE_CHANGING_OFF", ts.UIMsg, sizeof(ts.UIMsg), "off", ts.UILanguageFile); SendDlgItemMessage(IDC_ACCEPT_TITLE_CHANGING, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg); @@ -365,19 +338,6 @@ get_lang_msg("DLG_TAB_SEQUENCE_ACCEPT_TITLE_CHANGING_LAST", ts.UIMsg, sizeof(ts.UIMsg), "last", ts.UILanguageFile); SendDlgItemMessage(IDC_ACCEPT_TITLE_CHANGING, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg); - GetDlgItemText(IDC_CURSOR_CTRL_SEQ, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_SEQUENCE_CURSOR_CTRL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_CURSOR_CTRL_SEQ, ts.UIMsg); - GetDlgItemText(IDC_WINDOW_CTRL, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_SEQUENCE_WINDOW_CTRL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_WINDOW_CTRL, ts.UIMsg); - GetDlgItemText(IDC_WINDOW_REPORT, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_SEQUENCE_WINDOW_REPORT", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_WINDOW_REPORT, ts.UIMsg); - GetDlgItemText(IDC_TITLE_REPORT_LABEL, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_SEQUENCE_TITLE_REPORT", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_TITLE_REPORT_LABEL, ts.UIMsg); - get_lang_msg("DLG_TAB_SEQUENCE_TITLE_REPORT_IGNORE", ts.UIMsg, sizeof(ts.UIMsg), "ignore", ts.UILanguageFile); SendDlgItemMessage(IDC_TITLE_REPORT, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg); get_lang_msg("DLG_TAB_SEQUENCE_TITLE_REPORT_ACCEPT", ts.UIMsg, sizeof(ts.UIMsg), "accept", ts.UILanguageFile); @@ -385,10 +345,6 @@ get_lang_msg("DLG_TAB_SEQUENCE_TITLE_REPORT_EMPTY", ts.UIMsg, sizeof(ts.UIMsg), "empty", ts.UILanguageFile); SendDlgItemMessage(IDC_TITLE_REPORT, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg); - GetDlgItemText(IDC_CLIPBOARD_ACCESS_LABEL, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_SEQUENCE_CLIPBOARD_ACCESS", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_CLIPBOARD_ACCESS_LABEL, ts.UIMsg); - get_lang_msg("DLG_TAB_SEQUENCE_CLIPBOARD_ACCESS_OFF", ts.UIMsg, sizeof(ts.UIMsg), "off", ts.UILanguageFile); SendDlgItemMessage(IDC_CLIPBOARD_ACCESS, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg); get_lang_msg("DLG_TAB_SEQUENCE_CLIPBOARD_ACCESS_WRITE", ts.UIMsg, sizeof(ts.UIMsg), "write only", ts.UILanguageFile); @@ -398,10 +354,6 @@ get_lang_msg("DLG_TAB_SEQUENCE_CLIPBOARD_ACCESS_ON", ts.UIMsg, sizeof(ts.UIMsg), "read/write", ts.UILanguageFile); SendDlgItemMessage(IDC_CLIPBOARD_ACCESS, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg); - GetDlgItemText(IDC_CLIPBOARD_NOTIFY, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_SEQUENCE_CLIPBOARD_NOTIFY", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_CLIPBOARD_NOTIFY, ts.UIMsg); - // (1)IDC_ACCEPT_MOUSE_EVENT_TRACKING btn = (CButton *)GetDlgItem(IDC_ACCEPT_MOUSE_EVENT_TRACKING); btn2 = (CButton *)GetDlgItem(IDC_DISABLE_MOUSE_TRACKING_CTRL); @@ -603,10 +555,23 @@ BOOL CCopypastePropPageDlg::OnInitDialog() { - char uimsg[MAX_UIMSG]; CButton *btn, *btn2; CEdit *edit; char buf[64]; + static const DlgTextInfo TextInfos[] = { + { IDC_LINECOPY, "DLG_TAB_COPYPASTE_CONTINUE" }, + { IDC_DISABLE_PASTE_RBUTTON, "DLG_TAB_COPYPASTE_MOUSEPASTE" }, + { IDC_CONFIRM_PASTE_RBUTTON, "DLG_TAB_COPYPASTE_CONFIRMPASTE" }, + { IDC_DISABLE_PASTE_MBUTTON, "DLG_TAB_COPYPASTE_MOUSEPASTEM" }, + { IDC_SELECT_LBUTTON, "DLG_TAB_COPYPASTE_SELECTLBUTTON" }, + { IDC_TRIMNLCHAR, "DLG_TAB_COPYPASTE_TRIM_TRAILING_NL" }, + { IDC_NORMALIZE_LINEBREAK, "DLG_TAB_COPYPASTE_NORMALIZE_LINEBREAK" }, + { IDC_CONFIRM_CHANGE_PASTE, "DLG_TAB_COPYPASTE_CONFIRM_CHANGE_PASTE" }, + { IDC_CONFIRM_STRING_FILE_LABEL, "DLG_TAB_COPYPASTE_STRINGFILE" }, + { IDC_DELIMITER, "DLG_TAB_COPYPASTE_DELIMITER" }, + { IDC_PASTEDELAY_LABEL, "DLG_TAB_COPYPASTE_PASTEDELAY" }, + { IDC_PASTEDELAY_LABEL2, "DLG_TAB_COPYPASTE_PASTEDELAY2" } + }; CPropertyPage::OnInitDialog(); @@ -634,42 +599,7 @@ DlgCopypasteFont = NULL; } - GetDlgItemText(IDC_LINECOPY, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_COPYPASTE_CONTINUE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_LINECOPY, ts.UIMsg); - GetDlgItemText(IDC_DISABLE_PASTE_RBUTTON, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_COPYPASTE_MOUSEPASTE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_DISABLE_PASTE_RBUTTON, ts.UIMsg); - GetDlgItemText(IDC_CONFIRM_PASTE_RBUTTON, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_COPYPASTE_CONFIRMPASTE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_CONFIRM_PASTE_RBUTTON, ts.UIMsg); - GetDlgItemText(IDC_DISABLE_PASTE_MBUTTON, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_COPYPASTE_MOUSEPASTEM", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_DISABLE_PASTE_MBUTTON, ts.UIMsg); - GetDlgItemText(IDC_SELECT_LBUTTON, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_COPYPASTE_SELECTLBUTTON", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_SELECT_LBUTTON, ts.UIMsg); - GetDlgItemText(IDC_TRIMNLCHAR, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_COPYPASTE_TRIM_TRAILING_NL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_TRIMNLCHAR, ts.UIMsg); - GetDlgItemText(IDC_NORMALIZE_LINEBREAK, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_COPYPASTE_NORMALIZE_LINEBREAK", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_NORMALIZE_LINEBREAK, ts.UIMsg); - GetDlgItemText(IDC_CONFIRM_CHANGE_PASTE, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_COPYPASTE_CONFIRM_CHANGE_PASTE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_CONFIRM_CHANGE_PASTE, ts.UIMsg); - GetDlgItemText(IDC_CONFIRM_STRING_FILE_LABEL, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_COPYPASTE_STRINGFILE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_CONFIRM_STRING_FILE_LABEL, ts.UIMsg); - GetDlgItemText(IDC_DELIMITER, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_COPYPASTE_DELIMITER", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_DELIMITER, ts.UIMsg); - GetDlgItemText(IDC_PASTEDELAY_LABEL, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_COPYPASTE_PASTEDELAY", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_PASTEDELAY_LABEL, ts.UIMsg); - GetDlgItemText(IDC_PASTEDELAY_LABEL2, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_COPYPASTE_PASTEDELAY2", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_PASTEDELAY_LABEL2, ts.UIMsg); + SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), ts.UILanguageFile); // (1)Enable continued-line copy btn = (CButton *)GetDlgItem(IDC_LINECOPY); @@ -888,6 +818,7 @@ } BEGIN_MESSAGE_MAP(CVisualPropPageDlg, CPropertyPage) + ON_WM_CTLCOLOR() END_MESSAGE_MAP() // CVisualPropPageDlg \x83\x81\x83b\x83Z\x81[\x83W \x83n\x83\x93\x83h\x83\x89 @@ -895,11 +826,31 @@ BOOL CVisualPropPageDlg::OnInitDialog() { char buf[MAXPATHLEN]; - char uimsg[MAX_UIMSG]; CListBox *listbox; CButton *btn; CComboBox *cmb; int i; + static const DlgTextInfo TextInfos[] = { + { IDC_ALPHABLEND, "DLG_TAB_VISUAL_ALPHA" }, + { IDC_ALPHA_BLEND_ACTIVE_LABEL, "DLG_TAB_VISUAL_ALPHA_ACTIVE_LABEL" }, + { IDC_ALPHA_BLEND_INACTIVE_LABEL, "DLG_TAB_VISUAL_ALPHA_INACTIVE_LABEL" }, + { IDC_ETERM_LOOKFEEL, "DLG_TAB_VISUAL_ETERM" }, + { IDC_BGIMG_CHECK, "DLG_TAB_VISUAL_BGIMG" }, + { IDC_BGIMG_BRIGHTNESS, "DLG_TAB_VISUAL_BGIMG_BRIGHTNESS" }, + { IDC_MOUSE, "DLG_TAB_VISUAL_MOUSE" }, + { IDC_FONT_QUALITY_LABEL, "DLG_TAB_VISUAL_FONT_QUALITY" }, + { IDC_ANSICOLOR, "DLG_TAB_VISUAL_ANSICOLOR" }, + { IDC_RED, "DLG_TAB_VISUAL_RED" }, + { IDC_GREEN, "DLG_TAB_VISUAL_GREEN" }, + { IDC_BLUE, "DLG_TAB_VISUAL_BLUE" }, + { IDC_ENABLE_ATTR_COLOR_BOLD, "DLG_TAB_VISUAL_BOLD" }, + { IDC_ENABLE_ATTR_COLOR_BLINK, "DLG_TAB_VISUAL_BLINK" }, + { IDC_ENABLE_ATTR_COLOR_REVERSE, "DLG_TAB_VISUAL_REVERSE" }, + { IDC_ENABLE_URL_COLOR, "DLG_TAB_VISUAL_URL" }, + { IDC_ENABLE_ANSI_COLOR, "DLG_TAB_VISUAL_ANSI" }, + { IDC_URL_UNDERLINE, "DLG_TAB_VISUAL_URLUL" }, + { IDC_RESTART, "DLG_TAB_VISUAL_RESTART" }, + }; CPropertyPage::OnInitDialog(); @@ -907,7 +858,10 @@ GetObject(font, sizeof(LOGFONT), &logfont); if (get_lang_font("DLG_TAHOMA_FONT", GetSafeHwnd(), &logfont, &DlgVisualFont, ts.UILanguageFile)) { SendDlgItemMessage(IDC_ALPHABLEND, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0)); - SendDlgItemMessage(IDC_ALPHA_BLEND, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0)); + SendDlgItemMessage(IDC_ALPHA_BLEND_ACTIVE, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0)); + SendDlgItemMessage(IDC_ALPHA_BLEND_INACTIVE, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0)); + SendDlgItemMessage(IDC_ALPHA_BLEND_ACTIVE_LABEL, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0)); + SendDlgItemMessage(IDC_ALPHA_BLEND_INACTIVE_LABEL, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0)); SendDlgItemMessage(IDC_ETERM_LOOKFEEL, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0)); SendDlgItemMessage(IDC_MOUSE, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0)); SendDlgItemMessage(IDC_MOUSE_CURSOR, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0)); @@ -939,57 +893,7 @@ DlgVisualFont = NULL; } - GetDlgItemText(IDC_ALPHABLEND, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_ALPHA", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_ALPHABLEND, ts.UIMsg); - GetDlgItemText(IDC_ETERM_LOOKFEEL, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_ETERM", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_ETERM_LOOKFEEL, ts.UIMsg); - GetDlgItemText(IDC_BGIMG_CHECK, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_BGIMG", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_BGIMG_CHECK, ts.UIMsg); - GetDlgItemText(IDC_BGIMG_BRIGHTNESS, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_BGIMG_BRIGHTNESS", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_BGIMG_BRIGHTNESS, ts.UIMsg); - GetDlgItemText(IDC_MOUSE, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_MOUSE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_MOUSE, ts.UIMsg); - GetDlgItemText(IDC_FONT_QUALITY_LABEL, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_FONT_QUALITY", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_FONT_QUALITY_LABEL, ts.UIMsg); - GetDlgItemText(IDC_ANSICOLOR, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_ANSICOLOR", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_ANSICOLOR, ts.UIMsg); - GetDlgItemText(IDC_RED, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_RED", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_RED, ts.UIMsg); - GetDlgItemText(IDC_GREEN, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_GREEN", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_GREEN, ts.UIMsg); - GetDlgItemText(IDC_BLUE, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_BLUE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_BLUE, ts.UIMsg); - GetDlgItemText(IDC_ENABLE_ATTR_COLOR_BOLD, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_BOLD", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_ENABLE_ATTR_COLOR_BOLD, ts.UIMsg); - GetDlgItemText(IDC_ENABLE_ATTR_COLOR_BLINK, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_BLINK", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_ENABLE_ATTR_COLOR_BLINK, ts.UIMsg); - GetDlgItemText(IDC_ENABLE_ATTR_COLOR_REVERSE, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_REVERSE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_ENABLE_ATTR_COLOR_REVERSE, ts.UIMsg); - GetDlgItemText(IDC_ENABLE_URL_COLOR, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_URL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_ENABLE_URL_COLOR, ts.UIMsg); - GetDlgItemText(IDC_ENABLE_ANSI_COLOR, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_ANSI", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_ENABLE_ANSI_COLOR, ts.UIMsg); - GetDlgItemText(IDC_URL_UNDERLINE, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_URLUL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_URL_UNDERLINE, ts.UIMsg); - GetDlgItemText(IDC_RESTART, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_VISUAL_RESTART", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_RESTART, ts.UIMsg); + SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), ts.UILanguageFile); get_lang_msg("DLG_TAB_VISUAL_FONT_QUALITY_DEFAULT", ts.UIMsg, sizeof(ts.UIMsg), "Default", ts.UILanguageFile); SendDlgItemMessage(IDC_FONT_QUALITY, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg); @@ -1001,8 +905,10 @@ SendDlgItemMessage(IDC_FONT_QUALITY, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg); // (1)AlphaBlend - _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%d", ts.AlphaBlend); - SetDlgItemText(IDC_ALPHA_BLEND, buf); + _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%d", ts.AlphaBlendActive); + SetDlgItemText(IDC_ALPHA_BLEND_ACTIVE, buf); + _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%d", ts.AlphaBlendInactive); + SetDlgItemText(IDC_ALPHA_BLEND_INACTIVE, buf); // (2)[BG] BGEnable btn = (CButton *)GetDlgItem(IDC_ETERM_LOOKFEEL); @@ -1043,11 +949,16 @@ } // (3)Mouse cursor type - listbox = (CListBox *)GetDlgItem(IDC_MOUSE_CURSOR); + int sel = 0; for (i = 0 ; MouseCursor[i].name ; i++) { - listbox->InsertString(i, MouseCursor[i].name); + const TCHAR *name = MouseCursor[i].name; + SendDlgItemMessage(IDC_MOUSE_CURSOR, CB_ADDSTRING, 0, (LPARAM)name); + if (_tcscmp(name, ts.MouseCursorName) == 0) { + sel = i; + } } - listbox->SelectString(0, ts.MouseCursorName); + cmb = (CComboBox *)GetDlgItem(IDC_MOUSE_CURSOR); + cmb->SetCurSel(sel); // (4)Font quality cmb = (CComboBox *)GetDlgItem(IDC_FONT_QUALITY); @@ -1104,7 +1015,7 @@ btn->SetCheck((ts.FontFlag&FF_URLUNDERLINE) != 0); // \x83_\x83C\x83A\x83\x8D\x83O\x82Ƀt\x83H\x81[\x83J\x83X\x82Ă\xE9 - ::SetFocus(::GetDlgItem(GetSafeHwnd(), IDC_ALPHA_BLEND)); + ::SetFocus(::GetDlgItem(GetSafeHwnd(), IDC_ALPHA_BLEND_ACTIVE)); return FALSE; } @@ -1194,11 +1105,7 @@ sel = listbox->GetCurSel(); if (sel != -1) { SetupRGBbox(GetSafeHwnd(), sel); -#if 0 - SendMessage(WM_CTLCOLORSTATIC, - (WPARAM)label_hdc, - (LPARAM)GetDlgItem(IDC_SAMPLE_COLOR)); -#endif + GetDlgItem(IDC_SAMPLE_COLOR)->Invalidate(TRUE); } return TRUE; @@ -1227,76 +1134,61 @@ // 255\x82\xA6\x82\xBDRGB\x92l\x82͕\x82\xB3\x82\xEA\x82\xE9\x82̂ŁA\x82\xBB\x82\xEA\x82\xF0Edit\x82ɕ\\x8E\xA6\x82\xB7\x82\xE9 (2007.2.18 maya) SetupRGBbox(GetSafeHwnd(), sel); -#if 0 - SendMessage(WM_CTLCOLORSTATIC, - (WPARAM)label_hdc, - (LPARAM)GetDlgItem(IDC_SAMPLE_COLOR)); -#endif + + GetDlgItem(IDC_SAMPLE_COLOR)->Invalidate(TRUE); } return TRUE; -#if 0 - case WM_CTLCOLORSTATIC: - { - HDC hDC = (HDC)wp; - HWND hWnd = (HWND)lp; + } - //if (label_hdc == NULL) { - hDC = GetWindowDC(GetDlgItem(hDlgWnd, IDC_SAMPLE_COLOR)); - // label_hdc = hDC; - //} + return CPropertyPage::OnCommand(wParam, lParam); +} - if ( hWnd == GetDlgItem(hDlgWnd, IDC_SAMPLE_COLOR) ) { - BYTE r, g, b; +HBRUSH CVisualPropPageDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) +{ + if(pWnd->m_hWnd==GetDlgItem(IDC_SAMPLE_COLOR)->m_hWnd){ + BYTE r, g, b; + char buf[8]; - hWnd = GetDlgItem(hDlgWnd, IDC_COLOR_RED); - SendMessage(hWnd, WM_GETTEXT , sizeof(buf), (LPARAM)buf); - r = atoi(buf); + GetDlgItemText(IDC_COLOR_RED, buf, sizeof(buf)); + r = atoi(buf); - hWnd = GetDlgItem(hDlgWnd, IDC_COLOR_GREEN); - SendMessage(hWnd, WM_GETTEXT , sizeof(buf), (LPARAM)buf); - g = atoi(buf); + GetDlgItemText(IDC_COLOR_GREEN, buf, sizeof(buf)); + g = atoi(buf); - hWnd = GetDlgItem(hDlgWnd, IDC_COLOR_BLUE); - SendMessage(hWnd, WM_GETTEXT , sizeof(buf), (LPARAM)buf); - b = atoi(buf); + GetDlgItemText(IDC_COLOR_BLUE, buf, sizeof(buf)); + b = atoi(buf); - OutputDebugPrintf("%06x\n", RGB(r, g, b)); + pDC->SetBkMode(TRANSPARENT); + pDC->SetTextColor(RGB(r, g, b)); - SetBkMode(hDC, TRANSPARENT); - SetTextColor(hDC, RGB(r, g, b) ); - ReleaseDC(hDlgWnd, hDC); - - return (BOOL)(HBRUSH)GetStockObject(NULL_BRUSH); - } - return FALSE; - } - break ; -#endif + return (HBRUSH)GetStockObject(NULL_BRUSH); } - - return CPropertyPage::OnCommand(wParam, lParam); + return CPropertyPage::OnCtlColor(pDC, pWnd, nCtlColor); } void CVisualPropPageDlg::OnOK() { - CListBox *listbox; CButton *btn; CComboBox *cmb; int sel; - int beforeAlphaBlend; char buf[MAXPATHLEN]; COLORREF TmpColor; int flag_changed = 0; // (1) - beforeAlphaBlend = ts.AlphaBlend; - GetDlgItemText(IDC_ALPHA_BLEND, buf, sizeof(buf)); + GetDlgItemText(IDC_ALPHA_BLEND_ACTIVE, buf, sizeof(buf)); if (isdigit(buf[0])) { - ts.AlphaBlend = atoi(buf); - ts.AlphaBlend = max(0, ts.AlphaBlend); - ts.AlphaBlend = min(255, ts.AlphaBlend); + ts.AlphaBlendActive = atoi(buf); + ts.AlphaBlendActive = max(0, ts.AlphaBlendActive); + ts.AlphaBlendActive = min(255, ts.AlphaBlendActive); } + GetDlgItemText(IDC_ALPHA_BLEND_INACTIVE, buf, sizeof(buf)); + if (isdigit(buf[0])) { + ts.AlphaBlendInactive = atoi(buf); + ts.AlphaBlendInactive = max(0, ts.AlphaBlendInactive); + ts.AlphaBlendInactive = min(255, ts.AlphaBlendInactive); + } // (2) // \x83O\x83\x8D\x81[\x83o\x83\x8B\x95ϐ\x94 BGEnable \x82ڏ\x91\x82\xAB\x8A\xB7\x82\xA6\x82\xE9\x82ƁA\x83v\x83\x8D\x83O\x83\x89\x83\x80\x82\xAA\x97\x8E\x82\xBF\x82邱\x82Ƃ\xAA @@ -1321,8 +1213,8 @@ } // (3) - listbox = (CListBox *)GetDlgItem(IDC_MOUSE_CURSOR); - sel = listbox->GetCurSel(); + cmb = (CComboBox *)GetDlgItem(IDC_MOUSE_CURSOR); + sel = cmb->GetCurSel(); if (sel >= 0 && sel < MOUSE_CURSOR_MAX) { strncpy_s(ts.MouseCursorName, sizeof(ts.MouseCursorName), MouseCursor[sel].name, _TRUNCATE); } @@ -1402,17 +1294,6 @@ ts.FontFlag ^= FF_URLUNDERLINE; } - // 2006/03/11 by 337 : Alpha\x92l\x82\xE0\x91\xA6\x8E\x9E\x95ύX - // Layered\x91\x8B\x82ɂȂ\xC1\x82Ă\xA2\x82Ȃ\xA2\x8Fꍇ\x82͌\xF8\x89ʂ\xAA\x96\xB3\x82\xA2 - if (ts.EtermLookfeel.BGUseAlphaBlendAPI) { - // \x8BN\x93\xAE\x8E\x9E\x82ɔ\xBC\x93\xA7\x96\xBE\x83\x8C\x83C\x83\x84\x82ɂ\xB5\x82Ă\xA2\x82Ȃ\xA2\x8Fꍇ\x82ł\xE0\x81A\x91\xA6\x8D\xC0\x82ɔ\xBC\x93\xA7\x96\xBE\x82ƂȂ\xE9\x82悤\x82ɂ\xB7\x82\xE9\x81B(2006.4.1 yutaka) - //MySetLayeredWindowAttributes(HVTWin, 0, (ts.AlphaBlend > 255) ? 255: ts.AlphaBlend, LWA_ALPHA); - // \x92l\x82\xAA\x95ύX\x82\xB3\x82ꂽ\x82Ƃ\xAB\x82̂ݐݒ\xE8\x82f\x82\xB7\x82\xE9\x81B(2007.10.19 maya) - if (ts.AlphaBlend != beforeAlphaBlend) { - SetWindowStyle(&ts); - } - } - if (flag_changed) { // re-launch // RestartTeraTerm(GetSafeHwnd(), &ts); @@ -1458,10 +1339,28 @@ BOOL CLogPropPageDlg::OnInitDialog() { - char uimsg[MAX_UIMSG]; CButton *btn; CComboBox *combo; int i, TmpLogRotateSize; + static const DlgTextInfo TextInfos[] = { + { IDC_VIEWLOG_LABEL, "DLG_TAB_LOG_EDITOR" }, + { IDC_DEFAULTNAME_LABEL, "DLG_TAB_LOG_FILENAME" }, + { IDC_DEFAULTPATH_LABEL, "DLG_TAB_LOG_FILEPATH" }, + { IDC_AUTOSTART, "DLG_TAB_LOG_AUTOSTART" }, + // Log rotate + { IDC_LOG_ROTATE, "DLG_TAB_LOG_ROTATE" }, + { IDC_ROTATE_SIZE_TEXT, "DLG_TAB_LOG_ROTATE_SIZE_TEXT" }, + { IDC_ROTATE_STEP_TEXT, "DLG_TAB_LOG_ROTATESTEP" }, + // Log options + // FIXME: \x83\x81\x83b\x83Z\x81[\x83W\x83J\x83^\x83\x8D\x83O\x82͊\xF9\x91\xB6\x82̃\x8D\x83O\x83I\x83v\x83V\x83\x87\x83\x93\x82̂\xE0\x82̂𗬗p\x82\xB5\x82\xBD\x82\xAA\x81A\x83A\x83N\x83Z\x83\x89\x83\x8C\x81[\x83^\x83L\x81[\x82\xAA\x8Fd\x95\xA1\x82\xB7\x82邩\x82\xE0\x82\xB5\x82\xEA\x82Ȃ\xA2\x81B + { IDC_LOG_OPTION_GROUP, "DLG_FOPT" }, + { IDC_OPT_BINARY, "DLG_FOPT_BINARY" }, + { IDC_OPT_APPEND, "DLG_FOPT_APPEND" }, + { IDC_OPT_PLAINTEXT, "DLG_FOPT_PLAIN" }, + { IDC_OPT_HIDEDLG, "DLG_FOPT_HIDEDIALOG" }, + { IDC_OPT_INCBUF, "DLG_FOPT_ALLBUFFINFIRST" }, + { IDC_OPT_TIMESTAMP, "DLG_FOPT_TIMESTAMP" }, + }; CPropertyPage::OnInitDialog(); @@ -1499,51 +1398,7 @@ DlgLogFont = NULL; } - GetDlgItemText(IDC_VIEWLOG_LABEL, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_LOG_EDITOR", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_VIEWLOG_LABEL, ts.UIMsg); - GetDlgItemText(IDC_DEFAULTNAME_LABEL, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_LOG_FILENAME", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_DEFAULTNAME_LABEL, ts.UIMsg); - GetDlgItemText(IDC_DEFAULTPATH_LABEL, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_LOG_FILEPATH", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_DEFAULTPATH_LABEL, ts.UIMsg); - GetDlgItemText(IDC_AUTOSTART, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_LOG_AUTOSTART", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_AUTOSTART, ts.UIMsg); - // Log rotate - GetDlgItemText(IDC_LOG_ROTATE, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_LOG_ROTATE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_LOG_ROTATE, ts.UIMsg); - GetDlgItemText(IDC_ROTATE_SIZE_TEXT, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_LOG_ROTATE_SIZE_TEXT", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_ROTATE_SIZE_TEXT, ts.UIMsg); - GetDlgItemText(IDC_ROTATE_STEP_TEXT, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_LOG_ROTATESTEP", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_ROTATE_STEP_TEXT, ts.UIMsg); - // Log options - // FIXME: \x83\x81\x83b\x83Z\x81[\x83W\x83J\x83^\x83\x8D\x83O\x82͊\xF9\x91\xB6\x82̃\x8D\x83O\x83I\x83v\x83V\x83\x87\x83\x93\x82̂\xE0\x82̂𗬗p\x82\xB5\x82\xBD\x82\xAA\x81A\x83A\x83N\x83Z\x83\x89\x83\x8C\x81[\x83^\x83L\x81[\x82\xAA\x8Fd\x95\xA1\x82\xB7\x82邩\x82\xE0\x82\xB5\x82\xEA\x82Ȃ\xA2\x81B - GetDlgItemText(IDC_LOG_OPTION_GROUP, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_FOPT", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_LOG_OPTION_GROUP, ts.UIMsg); - GetDlgItemText(IDC_OPT_BINARY, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_FOPT_BINARY", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_OPT_BINARY, ts.UIMsg); - GetDlgItemText(IDC_OPT_APPEND, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_FOPT_APPEND", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_OPT_APPEND, ts.UIMsg); - GetDlgItemText(IDC_OPT_PLAINTEXT, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_FOPT_PLAIN", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_OPT_PLAINTEXT, ts.UIMsg); - GetDlgItemText(IDC_OPT_HIDEDLG, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_FOPT_HIDEDIALOG", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_OPT_HIDEDLG, ts.UIMsg); - GetDlgItemText(IDC_OPT_INCBUF, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_FOPT_ALLBUFFINFIRST", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_OPT_INCBUF, ts.UIMsg); - GetDlgItemText(IDC_OPT_TIMESTAMP, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_FOPT_TIMESTAMP", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_OPT_TIMESTAMP, ts.UIMsg); + SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), ts.UILanguageFile); get_lang_msg("DLG_FOPT_TIMESTAMP_LOCAL", ts.UIMsg, sizeof(ts.UIMsg), "Local Time", ts.UILanguageFile); SendDlgItemMessage(IDC_OPT_TIMESTAMP_TYPE, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg); @@ -1897,8 +1752,10 @@ BOOL CCygwinPropPageDlg::OnInitDialog() { - char uimsg[MAX_UIMSG]; CButton *btn; + static const DlgTextInfo TextInfos[] = { + { IDC_CYGWIN_PATH_LABEL, "DLG_TAB_CYGWIN_PATH" } + }; CPropertyPage::OnInitDialog(); @@ -1931,9 +1788,7 @@ DlgCygwinFont = NULL; } - GetDlgItemText(IDC_CYGWIN_PATH_LABEL, uimsg, sizeof(uimsg)); - get_lang_msg("DLG_TAB_CYGWIN_PATH", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile); - SetDlgItemText(IDC_CYGWIN_PATH_LABEL, ts.UIMsg); + SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), ts.UILanguageFile); memcpy(&settings, &ts.CygtermSettings, sizeof(cygterm_t)); Modified: branches/transparent-window/teraterm/teraterm/addsetting.h =================================================================== --- branches/transparent-window/teraterm/teraterm/addsetting.h 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/teraterm/teraterm/addsetting.h 2018-09-19 23:18:40 UTC (rev 7248) @@ -1,5 +1,5 @@ /* - * (C) 2008-2017 TeraTerm Project + * (C) 2008-2018 TeraTerm Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,12 +33,12 @@ typedef struct { - char *name; + const char *name; LPCTSTR id; } mouse_cursor_t; +extern const mouse_cursor_t MouseCursor[]; - // General Page class CGeneralPropPageDlg : public CPropertyPage { @@ -133,6 +133,7 @@ protected: DECLARE_MESSAGE_MAP() + virtual HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); }; Modified: branches/transparent-window/teraterm/teraterm/teraterm.cpp =================================================================== --- branches/transparent-window/teraterm/teraterm/teraterm.cpp 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/teraterm/teraterm/teraterm.cpp 2018-09-19 23:18:40 UTC (rev 7248) @@ -45,6 +45,7 @@ #include "tekwin.h" #include "ttdde.h" #include "keyboard.h" +#include "compat_win.h" #include "teraapp.h" @@ -94,6 +95,7 @@ BOOL CTeraApp::InitInstance() { hInst = m_hInstance; + WinCompatInit(); m_pMainWnd = new CVTWindow(); pVTWin = m_pMainWnd; return TRUE; Modified: branches/transparent-window/teraterm/teraterm/ttermpro.rc =================================================================== --- branches/transparent-window/teraterm/teraterm/ttermpro.rc 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/teraterm/teraterm/ttermpro.rc 2018-09-19 23:18:40 UTC (rev 7248) @@ -149,8 +149,11 @@ STYLE DS_SETFONT | DS_CONTROL | WS_CHILD | WS_SYSMENU FONT 8, "Tahoma", 0, 0, 0x0 BEGIN - LTEXT "&Alpha blend",IDC_ALPHABLEND,10,10,43,8 - EDITTEXT IDC_ALPHA_BLEND,58,8,28,12,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Transparent Window",IDC_ALPHABLEND,5,5,78,8 + LTEXT "&Active",IDC_ALPHA_BLEND_ACTIVE_LABEL,14,19,50,8 + EDITTEXT IDC_ALPHA_BLEND_ACTIVE,69,18,19,12,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Ina&ctive",IDC_ALPHA_BLEND_INACTIVE_LABEL,14,33,49,8 + EDITTEXT IDC_ALPHA_BLEND_INACTIVE,69,32,19,12,ES_AUTOHSCROLL | ES_NUMBER GROUPBOX "",IDC_STATIC,97,2,155,54 CONTROL "&Eterm lookfeel(*)",IDC_ETERM_LOOKFEEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,99,8,66,12 LTEXT "Image Brightness",IDC_BGIMG_BRIGHTNESS,166,19,56,8 @@ -158,18 +161,18 @@ CONTROL "Background &Image",IDC_BGIMG_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,104,27,73,10 EDITTEXT IDC_BGIMG_EDIT,103,38,108,14,ES_AUTOHSCROLL PUSHBUTTON "...",IDC_BGIMG_BUTTON,217,38,14,14 - LTEXT "&Mouse cursor",IDC_MOUSE,10,22,70,8 - LISTBOX IDC_MOUSE_CURSOR,10,32,48,35,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - RTEXT "&Font Quality",IDC_FONT_QUALITY_LABEL,93,59,70,8 + LTEXT "&Mouse cursor",IDC_MOUSE,5,46,70,8 + COMBOBOX IDC_MOUSE_CURSOR,15,57,80,66,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + RTEXT "&Font Quality",IDC_FONT_QUALITY_LABEL,102,59,61,8 COMBOBOX IDC_FONT_QUALITY,167,58,80,52,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "ANSI color",IDC_ANSICOLOR,10,74,43,8 - LISTBOX IDC_ANSI_COLOR,10,84,28,51,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LTEXT "AN&SI color",IDC_ANSICOLOR,5,73,43,8 + LISTBOX IDC_ANSI_COLOR,15,84,28,51,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP LTEXT "&Red",IDC_RED,45,87,22,8 - EDITTEXT IDC_COLOR_RED,69,85,15,14,ES_AUTOHSCROLL | ES_NUMBER + EDITTEXT IDC_COLOR_RED,69,85,19,14,ES_AUTOHSCROLL | ES_NUMBER LTEXT "&Green",IDC_GREEN,45,104,22,8 - EDITTEXT IDC_COLOR_GREEN,69,102,15,14,ES_AUTOHSCROLL | ES_NUMBER + EDITTEXT IDC_COLOR_GREEN,69,102,19,14,ES_AUTOHSCROLL | ES_NUMBER LTEXT "&Blue",IDC_BLUE,45,121,22,8 - EDITTEXT IDC_COLOR_BLUE,69,119,15,14,ES_AUTOHSCROLL | ES_NUMBER + EDITTEXT IDC_COLOR_BLUE,69,119,19,14,ES_AUTOHSCROLL | ES_NUMBER LTEXT "SAMPLE",IDC_SAMPLE_COLOR,90,104,25,8 CONTROL "Enable B&old attribute color",IDC_ENABLE_ATTR_COLOR_BOLD, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,74,105,12 @@ -181,7 +184,7 @@ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,110,105,12 CONTROL "Enable A&NSI color",IDC_ENABLE_ANSI_COLOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,122,105,12 CONTROL "Un&derline URL string",IDC_URL_UNDERLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,134,105,12 - LTEXT "(*)Need to Save setup and restart Tera Term",IDC_RESTART,5,147,247,8 + LTEXT "(*)Need to Save setup and restart Tera Term",IDC_RESTART,15,152,237,8 END IDD_TABSHEET_LOG DIALOGEX 0, 0, 258, 188 Modified: branches/transparent-window/teraterm/teraterm/ttermpro.v15.vcxproj =================================================================== --- branches/transparent-window/teraterm/teraterm/ttermpro.v15.vcxproj 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/teraterm/teraterm/ttermpro.v15.vcxproj 2018-09-19 23:18:40 UTC (rev 7248) @@ -137,6 +137,7 @@ </Manifest> </ItemDefinitionGroup> <ItemGroup> + <ClCompile Include="..\common\compat_win.cpp" /> <ClCompile Include="..\common\dlglib.c" /> <ClCompile Include="..\common\stdafx.cpp" /> <ClCompile Include="..\common\ttlib.c" /> @@ -186,6 +187,7 @@ </ItemGroup> <ItemGroup> <ClInclude Include="..\common\compat_w95.h" /> + <ClInclude Include="..\common\compat_win.h" /> <ClInclude Include="..\common\dlglib.h" /> <ClInclude Include="..\common\tektypes.h" /> <ClInclude Include="..\common\teraterm.h" /> @@ -259,4 +261,4 @@ <UserProperties RESOURCE_FILE="ttermpro.rc" /> </VisualStudio> </ProjectExtensions> -</Project> +</Project> \ No newline at end of file Modified: branches/transparent-window/teraterm/teraterm/ttermpro.v15.vcxproj.filters =================================================================== --- branches/transparent-window/teraterm/teraterm/ttermpro.v15.vcxproj.filters 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/teraterm/teraterm/ttermpro.v15.vcxproj.filters 2018-09-19 23:18:40 UTC (rev 7248) @@ -117,6 +117,9 @@ <ClCompile Include="..\common\dlglib.c"> <Filter>dialog</Filter> </ClCompile> + <ClCompile Include="..\common\compat_win.cpp"> + <Filter>Source Files</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <Image Include="..\..\cygterm\cygterm.ico"> @@ -270,5 +273,8 @@ <ClInclude Include="addsetting.h"> <Filter>dialog</Filter> </ClInclude> + <ClInclude Include="..\common\compat_win.h"> + <Filter>Header Files</Filter> + </ClInclude> </ItemGroup> -</Project> +</Project> \ No newline at end of file Modified: branches/transparent-window/teraterm/teraterm/ttermpro.vcproj =================================================================== --- branches/transparent-window/teraterm/teraterm/ttermpro.vcproj 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/teraterm/teraterm/ttermpro.vcproj 2018-09-19 23:18:40 UTC (rev 7248) @@ -213,7 +213,7 @@ > </File> <File - RelativePath="dnddlg.cpp" + RelativePath="..\common\compat_win.cpp" > </File> <File @@ -221,6 +221,10 @@ > </File> <File + RelativePath="dnddlg.cpp" + > + </File> + <File RelativePath="filesys.cpp" > </File> Modified: branches/transparent-window/teraterm/teraterm/vtdisp.c =================================================================== --- branches/transparent-window/teraterm/teraterm/vtdisp.c 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/teraterm/teraterm/vtdisp.c 2018-09-19 23:18:40 UTC (rev 7248) @@ -36,6 +36,7 @@ #include "ttime.h" #include "ttdialog.h" #include "ttcommon.h" +#include "compat_win.h" #include "vtdisp.h" @@ -154,17 +155,17 @@ char fileTmp[MAX_PATH]; }BGSrc; -BGSrc BGDest; -BGSrc BGSrc1; -BGSrc BGSrc2; +static BGSrc BGDest; +static BGSrc BGSrc1; +static BGSrc BGSrc2; int BGEnable; -int BGReverseTextAlpha; -int BGUseAlphaBlendAPI; +static int BGReverseTextAlpha; +static int BGUseAlphaBlendAPI; BOOL BGNoFrame; -BOOL BGFastSizeMove; +static BOOL BGFastSizeMove; -char BGSPIPath[MAX_PATH]; +static char BGSPIPath[MAX_PATH]; COLORREF BGVTColor[2]; COLORREF BGVTBoldColor[2]; @@ -181,9 +182,9 @@ BOOL BGInSizeMove; HBRUSH BGBrushInSizeMove; -HDC hdcBGWork; -HDC hdcBGBuffer; -HDC hdcBG; +static HDC hdcBGWork; +static HDC hdcBGBuffer; +static HDC hdcBG; typedef struct tagWallpaperInfo { @@ -191,17 +192,7 @@ int pattern; }WallpaperInfo; -typedef struct _BGBLENDFUNCTION -{ - BYTE BlendOp; - BYTE BlendFlags; - BYTE SourceConstantAlpha; - BYTE AlphaFormat; -}BGBLENDFUNCTION; - -BOOL (WINAPI *BGAlphaBlend)(HDC,int,int,int,int,HDC,int,int,int,int,BGBLENDFUNCTION); -BOOL (WINAPI *BGEnumDisplayMonitors)(HDC,LPCRECT,MONITORENUMPROC,LPARAM); - +static BOOL (WINAPI *BGAlphaBlend)(HDC,int,int,int,int,HDC,int,int,int,int,BLENDFUNCTION); static HBITMAP GetBitmapHandle(char *File); @@ -217,20 +208,6 @@ return !IsWindowsVistaOrLater(); } - -void dprintf(char *format, ...) -{ - va_list args; - char buffer[1024]; - - va_start(args,format); - - _vsnprintf_s(buffer,sizeof(buffer),_TRUNCATE,format,args); - strncat_s(buffer,sizeof(buffer),"\n",_TRUNCATE); - - OutputDebugString(buffer); -} - HBITMAP CreateScreenCompatibleBitmap(int width,int height) { HDC hdc; @@ -237,7 +214,7 @@ HBITMAP hbm; #ifdef _DEBUG - dprintf("CreateScreenCompatibleBitmap : width = %d height = %d",width,height); + OutputDebugPrintf("CreateScreenCompatibleBitmap : width = %d height = %d\n",width,height); #endif hdc = GetDC(NULL); @@ -248,7 +225,7 @@ #ifdef _DEBUG if(!hbm) - dprintf("CreateScreenCompatibleBitmap : fail in CreateCompatibleBitmap"); + OutputDebugPrintf("CreateScreenCompatibleBitmap : fail in CreateCompatibleBitmap\n"); #endif return hbm; @@ -261,7 +238,7 @@ BITMAPINFO bmi; #ifdef _DEBUG - dprintf("CreateDIB24BPP : width = %d height = %d",width,height); + OutputDebugPrintf("CreateDIB24BPP : width = %d height = %d\n",width,height); #endif if(!width || !height) @@ -293,7 +270,7 @@ HDC hdc; #ifdef _DEBUG - dprintf("CreateBitmapDC : hbm = %x",hbm); + OutputDebugPrintf("CreateBitmapDC : hbm = %x\n",hbm); #endif hdc = CreateCompatibleDC(NULL); @@ -309,7 +286,7 @@ HBITMAP hbm; #ifdef _DEBUG - dprintf("DeleteBitmapDC : *hdc = %x",hdc); + OutputDebugPrintf("DeleteBitmapDC : *hdc = %x\n",hdc); #endif if(!hdc) @@ -335,7 +312,7 @@ HBRUSH hBrush; #ifdef _DEBUG - dprintf("FillBitmapDC : hdc = %x color = %x",hdc,color); + OutputDebugPrintf("FillBitmapDC : hdc = %x color = %x\n",hdc,color); #endif if(!hdc) @@ -362,7 +339,7 @@ return 0; } -void RandomFile(char *filespec_src,char *filename, int destlen) +static void RandomFile(const TCHAR *filespec_src, TCHAR *filename, int destlen) { int i; int file_num; @@ -372,6 +349,7 @@ HANDLE hFind; WIN32_FIND_DATA fd; + filename[0] = 0; ExpandEnvironmentStrings(filespec_src, filespec, sizeof(filespec)); //\x90\xE2\x91p\x83X\x82ɕϊ\xB7 @@ -435,13 +413,18 @@ strncat_s(filename,destlen,fd.cFileName,_TRUNCATE); } +// Susie Plug-in BOOL LoadPictureWithSPI(char *nameSPI,char *nameFile,unsigned char *bufFile,long sizeFile,HLOCAL *hbuf,HLOCAL *hbmi) { HINSTANCE hSPI; char spiVersion[8]; - int (PASCAL *SPI_IsSupported)(LPSTR,DWORD); - int (PASCAL *SPI_GetPicture)(LPSTR,long,unsigned int,HANDLE *,HANDLE *,FARPROC,long); - int (PASCAL *SPI_GetPluginInfo)(int,LPSTR,int); + typedef int (WINAPI *SPI_GetPluginInfo_t)(int infono, LPSTR buf, int buflen); + typedef int (WINAPI *SPI_IsSupported_t)(LPSTR filename, DWORD dw); + typedef int (WINAPI *SPI_GetPicture_t)(LPSTR buf, long len, unsigned int flag, HANDLE *pHBInfo, HANDLE *pHBm, FARPROC lpPrgressCallback, long lData); + + SPI_GetPluginInfo_t SPI_GetPluginInfo; + SPI_IsSupported_t SPI_IsSupported; + SPI_GetPicture_t SPI_GetPicture; int ret; ret = FALSE; @@ -453,9 +436,9 @@ if(!hSPI) goto error; - (FARPROC)SPI_GetPluginInfo = GetProcAddress(hSPI,"GetPluginInfo"); - (FARPROC)SPI_IsSupported = GetProcAddress(hSPI,"IsSupported"); - (FARPROC)SPI_GetPicture = GetProcAddress(hSPI,"GetPicture"); + SPI_GetPluginInfo = (SPI_GetPluginInfo_t)GetProcAddress(hSPI,"GetPluginInfo"); + SPI_IsSupported = (SPI_IsSupported_t)GetProcAddress(hSPI,"IsSupported"); + SPI_GetPicture = (SPI_GetPicture_t)GetProcAddress(hSPI,"GetPicture"); if(!SPI_GetPluginInfo || !SPI_IsSupported || !SPI_GetPicture) goto error; @@ -529,7 +512,7 @@ return TRUE; } -BOOL WINAPI AlphaBlendWithoutAPI(HDC hdcDest,int dx,int dy,int width,int height,HDC hdcSrc,int sx,int sy,int sw,int sh,BGBLENDFUNCTION bf) +static BOOL WINAPI AlphaBlendWithoutAPI(HDC hdcDest,int dx,int dy,int width,int height,HDC hdcSrc,int sx,int sy,int sw,int sh,BLENDFUNCTION bf) { HDC hdcDestWork,hdcSrcWork; int i,invAlpha,alpha; @@ -571,7 +554,7 @@ char filespec[MAX_PATH]; char *filePart; int fileSize; - int readByte; + DWORD readByte; unsigned char *fileBuf; HBITMAP hbm; @@ -580,7 +563,7 @@ WIN32_FIND_DATA fd; #ifdef _DEBUG - dprintf("Preload Picture : %s",src->file); + OutputDebugPrintf("Preload Picture : %s\n",src->file); #endif //\x83t\x83@\x83C\x83\x8B\x82\xF0\x93ǂݍ\x9E\x82\xDE @@ -677,7 +660,7 @@ void BGGetWallpaperInfo(WallpaperInfo *wi) { - int length; + DWORD length; int style; int tile; char str[256]; @@ -897,10 +880,6 @@ BGGetWallpaperInfo(&wi); -#ifdef DEBUG_XP - strcpy(wi.filename, "c:\\usr\\ttssh2\\1011_01.jpg"); -#endif - if (IsLoadImageOnlyEnabled()) { //\x95ǎ\x86\x82\xF0\x93ǂݍ\x9E\x82\xDD //LR_CREATEDIBSECTION \x82\xF0\x8Ew\x92肷\x82\xE9\x82̂\xAA\x83R\x83c @@ -920,12 +899,6 @@ goto createdc; } -#ifdef DEBUG_XP - //wi.pattern = BG_STRETCH; - //wi.pattern = BG_FIT_WIDTH; - //wi.pattern = BG_FIT_HEIGHT; -#endif - GetObject(hbm,sizeof(bm),&bm); // \x95ǎ\x86\x82̐ݒ\xE8\x82ɍ\x87\x82킹\x82āA\x89摜\x82̃X\x83g\x83\x8C\x83b\x83`\x83T\x83C\x83Y\x82\xF0\x8C\x88\x82߂\xE9\x81B if (wi.pattern == BG_STRETCH) { @@ -1203,9 +1176,9 @@ lws.src = src; lws.hdcDest = hdcDest; - if(BGEnumDisplayMonitors) + if(pEnumDisplayMonitors != NULL) { - (*BGEnumDisplayMonitors)(NULL,NULL,BGLoadWallpaperEnumFunc,(LPARAM)&lws); + (*pEnumDisplayMonitors)(NULL,NULL,BGLoadWallpaperEnumFunc,(LPARAM)&lws); }else{ RECT rectMonitor; @@ -1257,7 +1230,7 @@ CopyRect(&BGPrevRect,&rect); #ifdef _DEBUG - dprintf("BGSetupPrimary : BGInSizeMove = %d",BGInSizeMove); + OutputDebugPrintf("BGSetupPrimary : BGInSizeMove = %d\n",BGInSizeMove); #endif //\x8D\xEC\x8BƗp DC \x8D쐬 @@ -1272,7 +1245,7 @@ if(!BGInSizeMove) { - BGBLENDFUNCTION bf; + BLENDFUNCTION bf; HDC hdcSrc = NULL; //\x94w\x8Ci HDC @@ -1304,7 +1277,7 @@ } } -COLORREF BGGetColor(char *name,COLORREF defcolor,char *file) +COLORREF BGGetColor(const char *name,COLORREF defcolor,char *file) { unsigned int r,g,b; char colorstr[256],defstr[256]; @@ -1320,7 +1293,7 @@ return RGB(r,g,b); } -BG_PATTERN BGGetStrIndex(char *name,BG_PATTERN def,char *file,char **strList,int nList) +BG_PATTERN BGGetStrIndex(char *name,BG_PATTERN def,char *file,const char *strList[],int nList) { char defstr[64],str[64]; int i; @@ -1339,7 +1312,7 @@ BOOL BGGetOnOff(char *name,BOOL def,char *file) { - char *strList[2] = {"Off","On"}; + const static char *strList[2] = {"Off","On"}; return BGGetStrIndex(name,def,file,strList,2); } @@ -1346,7 +1319,7 @@ BG_PATTERN BGGetPattern(char *name,BG_PATTERN def,char *file) { - char *strList[6]={"stretch","tile","center","fitwidth","fitheight","autofit"}; + const static char *strList[6]={"stretch","tile","center","fitwidth","fitheight","autofit"}; return BGGetStrIndex(name,def,file,strList,6); } @@ -1353,7 +1326,7 @@ BG_PATTERN BGGetType(char *name,BG_TYPE def,char *file) { - char *strList[3]={"color","picture","wallpaper"}; + const static char *strList[3]={"color","picture","wallpaper"}; return BGGetStrIndex(name,def,file,strList,3); } @@ -1472,7 +1445,6 @@ void BGInitialize(void) { char path[MAX_PATH],config_file[MAX_PATH],tempPath[MAX_PATH]; - char msimg32_dll[MAX_PATH],user32_dll[MAX_PATH]; // VTColor \x82\xF0\x93ǂݍ\x9E\x82\xDD BGVTColor[0] = ts.VTColor[0]; @@ -1550,11 +1522,6 @@ BGFastSizeMove = ts.EtermLookfeel.BGFastSizeMove; BGNoCopyBits = ts.EtermLookfeel.BGNoCopyBits; -#if 0 - GetPrivateProfileString(BG_SECTION,"BGSPIPath","plugin",BGSPIPath,MAX_PATH,ts.SetupFName); - strncpy_s(ts.EtermLookfeel.BGSPIPath, sizeof(ts.EtermLookfeel.BGSPIPath), BGSPIPath, _TRUNCATE); -#endif - //\x83e\x83\x93\x83|\x83\x89\x83\x8A\x81[\x83t\x83@\x83C\x83\x8B\x96\xBC\x82\xAC GetTempPath(MAX_PATH,tempPath); GetTempFileName(tempPath,"ttAK",0,BGDest.fileTmp); @@ -1618,9 +1585,7 @@ // AlphaBlend \x82̃A\x83h\x83\x8C\x83X\x82\xF0\x93ǂݍ\x9E\x82\xDD if(BGUseAlphaBlendAPI) { - GetSystemDirectory(msimg32_dll, sizeof(msimg32_dll)); - strncat_s(msimg32_dll, sizeof(msimg32_dll), "\\msimg32.dll", _TRUNCATE); - (FARPROC)BGAlphaBlend = GetProcAddressWithDllName(msimg32_dll,"AlphaBlend"); + BGAlphaBlend = pAlphaBlend; } else { BGAlphaBlend = NULL; @@ -1628,11 +1593,6 @@ if(!BGAlphaBlend) BGAlphaBlend = AlphaBlendWithoutAPI; - - //EnumDisplayMonitors \x82\xF0\x92T\x82\xB7 - GetSystemDirectory(user32_dll, sizeof(user32_dll)); - strncat_s(user32_dll, sizeof(user32_dll), "\\user32.dll", _TRUNCATE); - (FARPROC)BGEnumDisplayMonitors = GetProcAddressWithDllName(user32_dll,"EnumDisplayMonitors"); } void BGExchangeColor() { @@ -2517,8 +2477,8 @@ ANSIColor[IdBack ] = ts.VTColor[1]; #ifdef ALPHABLEND_TYPE2 - ANSIColor[IdFore ] = BGVTColor[0]; - ANSIColor[IdBack ] = BGVTColor[1]; + ANSIColor[IdFore ] = BGVTColor[0]; + ANSIColor[IdBack ] = BGVTColor[1]; #endif // ALPHABLEND_TYPE2 } @@ -2818,7 +2778,7 @@ { if(BGReverseTextAlpha < 255) { - BGBLENDFUNCTION bf; + BLENDFUNCTION bf; HBRUSH hbr; hbr = CreateSolidBrush(GetBkColor(hdcBGBuffer)); Modified: branches/transparent-window/teraterm/teraterm/vtwin.cpp =================================================================== --- branches/transparent-window/teraterm/teraterm/vtwin.cpp 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/teraterm/teraterm/vtwin.cpp 2018-09-19 23:18:40 UTC (rev 7248) @@ -78,6 +78,7 @@ #include "winjump.h" #include "sizetip.h" #include "dnddlg.h" +#include "compat_win.h" #include "initguid.h" //#include "Usbiodef.h" @@ -114,9 +115,6 @@ static int AutoDisconnectedPort = -1; -// \x96{\x91̂\xCD addsetting.cpp -extern mouse_cursor_t MouseCursor[]; - ///////////////////////////////////////////////////////////////////////////// // CVTWindow @@ -259,36 +257,8 @@ //}}AFX_MSG_MAP END_MESSAGE_MAP() -static BOOL MySetLayeredWindowAttributes(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags) -{ - typedef BOOL (WINAPI *func)(HWND,COLORREF,BYTE,DWORD); - static HMODULE g_hmodUser32 = NULL; - static func g_pSetLayeredWindowAttributes = NULL; - char user32_dll[MAX_PATH]; - - GetSystemDirectory(user32_dll, sizeof(user32_dll)); - strncat_s(user32_dll, sizeof(user32_dll), "\\user32.dll", _TRUNCATE); - if (g_hmodUser32 == NULL) { - g_hmodUser32 = LoadLibrary(user32_dll); - if (g_hmodUser32 == NULL) { - return FALSE; - } - - g_pSetLayeredWindowAttributes = - (func)GetProcAddress(g_hmodUser32, "SetLayeredWindowAttributes"); - } - - if (g_pSetLayeredWindowAttributes == NULL) { - return FALSE; - } - - return g_pSetLayeredWindowAttributes(hwnd, crKey, - bAlpha, dwFlags); -} - - // Tera Term\x8BN\x93\xAE\x8E\x9E\x82\xC6URL\x95\xB6\x8E\x9A\x97\xF1mouse over\x8E\x9E\x82ɌĂ\xEA\x82\xE9 (2005.4.2 yutaka) -void SetMouseCursor(char *cursor) +static void SetMouseCursor(const char *cursor) { HCURSOR hc; LPCTSTR name = NULL; @@ -312,32 +282,36 @@ } } - -void SetWindowStyle(TTTSet *ts) +/** + * @param[in] alpha 0-255 + */ +void CVTWindow::SetWindowAlpha(BYTE alpha) { - LONG_PTR lp; + if (pSetLayeredWindowAttributes == NULL) { + return; // \x83\x8C\x83C\x83\x84\x81[\x83h\x83E\x83C\x83\x93\x83h\x83E\x82̃T\x83|\x81[\x83g\x82Ȃ\xB5 + } + if (Alpha == alpha) { + return; // \x95ω\xBB\x82Ȃ\xB5\x82Ȃ牽\x82\xE0\x82\xB5\x82Ȃ\xA2 + } + LONG_PTR lp = GetWindowLongPtr(HVTWin, GWL_EXSTYLE); + if (lp == 0) { + return; + } - SetMouseCursor(ts->MouseCursorName); - // 2006/03/16 by 337: BGUseAlphaBlendAPI\x82\xAAOn\x82Ȃ\xE7\x82\xCELayered\x91\xAE\x90\xAB\x82Ƃ\xB7\x82\xE9 //if (ts->EtermLookfeel.BGUseAlphaBlendAPI) { // \x83A\x83\x8B\x83t\x83@\x92l\x82\xAA255\x82̏ꍇ\x81A\x89\xE6\x96ʂ̂\xBF\x82\xE7\x82\xAB\x82\xF0\x97}\x82\xA6\x82邽\x82߉\xBD\x82\xE0\x82\xB5\x82Ȃ\xA2\x82\xB1\x82ƂƂ\xB7\x82\xE9\x81B(2006.4.1 yutaka) // \x8CĂяo\x82\xB5\x8C\xB3\x82ŁA\x92l\x82\xAA\x95ύX\x82\xB3\x82ꂽ\x82Ƃ\xAB\x82̂ݐݒ\xE8\x82f\x82\xB7\x82\xE9\x81B(2007.10.19 maya) - if (ts->AlphaBlend < 255) { - lp = GetWindowLongPtr(HVTWin, GWL_EXSTYLE); - if (lp != 0) { - SetWindowLongPtr(HVTWin, GWL_EXSTYLE, lp | WS_EX_LAYERED); - MySetLayeredWindowAttributes(HVTWin, 0, ts->AlphaBlend, LWA_ALPHA); - } + if (alpha < 255) { + SetWindowLongPtr(HVTWin, GWL_EXSTYLE, lp | WS_EX_LAYERED); + pSetLayeredWindowAttributes(HVTWin, 0, alpha, LWA_ALPHA); } - // \x83A\x83\x8B\x83t\x83@\x92l\x82\xAA 255 \x82̏ꍇ\x81A\x93\xA7\x96\xBE\x89\xBB\x91\xAE\x90\xAB\x82\xF0\x8D폜\x82\xB5\x82čĕ`\x89悷\x82\xE9\x81B(2007.10.22 maya) else { - lp = GetWindowLongPtr(HVTWin, GWL_EXSTYLE); - if (lp != 0) { - SetWindowLongPtr(HVTWin, GWL_EXSTYLE, lp & ~WS_EX_LAYERED); - RedrawWindow(HVTWin, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_FRAME); - } + // \x83A\x83\x8B\x83t\x83@\x92l\x82\xAA 255 \x82̏ꍇ\x81A\x93\xA7\x96\xBE\x89\xBB\x91\xAE\x90\xAB\x82\xF0\x8D폜\x82\xB5\x82čĕ`\x89悷\x82\xE9\x81B(2007.10.22 maya) + SetWindowLongPtr(HVTWin, GWL_EXSTYLE, lp & ~WS_EX_LAYERED); + ::RedrawWindow(HVTWin, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_FRAME); } + Alpha = alpha; } void RegDeviceNotify(HWND hWnd) @@ -385,7 +359,8 @@ // (2007.9.30 yutaka) // // \x97\xE1\x8AO\x83R\x81[\x83h\x82\x9A\x97\xF1\x82֕ϊ\xB7\x82\xB7\x82\xE9 -static char *GetExceptionString(int exception) +#if !defined(_M_X64) +static const char *GetExceptionString(DWORD exception) { #define EXCEPTION(x) case EXCEPTION_##x: return (#x); static char buf[16]; @@ -574,6 +549,7 @@ // return (EXCEPTION_EXECUTE_HANDLER); /* \x82\xBB\x82̂܂܃v\x83\x8D\x83Z\x83X\x82\xF0\x8FI\x97\xB9\x82\xB3\x82\xB9\x82\xE9 */ return (EXCEPTION_CONTINUE_SEARCH); /* \x88\xF8\x82\xAB\x91\xB1\x82\xAB\x81m\x83A\x83v\x83\x8A\x83P\x81[\x83V\x83\x87\x83\x93\x83G\x83\x89\x81[\x81n\x83|\x83b\x83v\x83A\x83b\x83v\x83\x81\x83b\x83Z\x81[\x83W\x83{\x83b\x83N\x83X\x82\xF0\x8CĂяo\x82\xB7 */ } +#endif // Virtual Store\x82\xAA\x97L\x8C\xF8\x82ł\xA0\x82邩\x82ǂ\xA4\x82\xA9\x82ʂ\xB7\x82\xE9\x81B @@ -669,7 +645,6 @@ #ifdef ALPHABLEND_TYPE2 DWORD ExStyle; #endif - char *Param; int CmdShow; #ifdef SHARED_KEYMAP char Temp[MAX_PATH]; @@ -679,11 +654,13 @@ BOOL isFirstInstance; #ifdef _DEBUG - ::_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); + ::_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif // \x97\xE1\x8AO\x83n\x83\x93\x83h\x83\x89\x82̃t\x83b\x83N (2007.9.30 yutaka) +#if !defined(_M_X64) SetUnhandledExceptionFilter(ApplicationFaultHandler); +#endif CommInit(&cv); isFirstInstance = StartTeraTerm(&ts); @@ -753,8 +730,8 @@ /* Parse command line parameters*/ // 256\x83o\x83C\x83g\x88ȏ\xE3\x82̃R\x83}\x83\x93\x83h\x83\x89\x83C\x83\x93\x83p\x83\x89\x83\x81\x81[\x83^\x8Ew\x92肪\x82\xA0\x82\xE9\x82ƁABOF(Buffer Over Flow)\x82\xC5 // \x97\x8E\x82\xBF\x82\xE9\x83o\x83O\x82\xF0\x8FC\x90\xB3\x81B(2007.6.12 maya) - Param = GetCommandLine(); if (LoadTTSET()) { + LPTSTR Param = GetCommandLine(); (*ParseParam)(Param, &ts, &(TopicName[0])); } FreeTTSET(); @@ -779,6 +756,7 @@ Hold = FALSE; FirstPaint = TRUE; ScrollLock = FALSE; // \x8F\x89\x8A\xFA\x92l\x82͖\xB3\x8C\xF8 (2006.11.14 yutaka) + Alpha = 255; /* Initialize scroll buffer */ InitBuffer(); @@ -838,7 +816,8 @@ SerialNo = RegWin(HVTWin,NULL); logfile_lock_initialize(); - SetWindowStyle(&ts); + SetMouseCursor(ts.MouseCursorName); + SetWindowAlpha(ts.AlphaBlendActive); // \x83\x8D\x83P\x81[\x83\x8B\x82̐ݒ\xE8 // wctomb \x82̂\xBD\x82\xDF setlocale(LC_ALL, ts.Locale); @@ -1033,7 +1012,8 @@ return; } - if (mousereport = MouseReport(IdMouseEventBtnDown, LMR, p.x, p.y)) { + mousereport = MouseReport(IdMouseEventBtnDown, LMR, p.x, p.y); + if (mousereport) { SetCapture(); return; } @@ -1644,7 +1624,7 @@ // // AlphaBlend \x82\x9E\x94\xBD\x89f\x82ł\xAB\x82\xE9\x82悤\x82ɂ\xB7\x82\xE9\x81B // (2016.12.24 yutaka) - SetWindowStyle(&ts); + SetWindowAlpha(ts.AlphaBlendActive); #else DispApplyANSIColor(); #endif @@ -1773,7 +1753,7 @@ else if ((ts.HideTitle>0) && (message == WM_NCHITTEST)) { Result = CFrameWnd::DefWindowProc(message,wParam,lParam); - if ((Result==HTCLIENT) && AltKey()) + if ((Result==HTCLIENT) && AltKey()) { #ifdef ALPHABLEND_TYPE2 if(ShiftKey()) Result = HTBOTTOMRIGHT; @@ -1782,6 +1762,7 @@ #else Result = HTCAPTION; #endif + } return Result; } @@ -1877,6 +1858,11 @@ void CVTWindow::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) { DispSetActive(nState!=WA_INACTIVE); + if (nState == WA_INACTIVE) { + SetWindowAlpha(ts.AlphaBlendInactive); + } else { + SetWindowAlpha(ts.AlphaBlendActive); + } } void CVTWindow::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) @@ -1913,7 +1899,7 @@ } /* copy from ttset.c*/ -static void WriteInt2(PCHAR Sect, PCHAR Key, PCHAR FName, int i1, int i2) +static void WriteInt2(const char *Sect, const char *Key, const char *FName, int i1, int i2) { char Temp[32]; _snprintf_s(Temp, sizeof(Temp), _TRUNCATE, "%d,%d", i1, i2); @@ -1971,7 +1957,7 @@ } // \x8FI\x97\xB9\x96₢\x8D\x87\x82킹\x82Ȃ\xB5\x82\xC9Tera Term\x82\xF0\x8FI\x97\xB9\x82\xB7\x82\xE9\x81BOnAllClose()\x8E\xF3\x90M\x97p\x81B -LONG CVTWindow::OnNonConfirmClose(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnNonConfirmClose(WPARAM wParam, LPARAM lParam) { // \x82\xB1\x82\xB1\x82\xC5 ts \x82̓\xE0\x97e\x82\xF0\x88Ӑ}\x93I\x82ɏ\x91\x82\xAB\x8A\xB7\x82\xA6\x82Ă\xE0\x81A\x8FI\x97\xB9\x8E\x9E\x82Ɏ\xA9\x93\xAE\x83Z\x81[\x83u\x82\xB3\x82\xEA\x82\xE9\x82킯\x82ł͂Ȃ\xA2\x82̂ŁA\x93\xC1\x82ɖ\xE2\x91\xE8\x82Ȃ\xB5\x81B ts.PortFlag &= ~PF_CONFIRMDISCONN; @@ -2085,7 +2071,8 @@ char msg[128]; if (h == NULL) { - if ( ((h = GetModuleHandle("ttxssh.dll")) == NULL) ) { + h = GetModuleHandle("ttxssh.dll"); + if (h == NULL) { _snprintf_s(msg, sizeof(msg), _TRUNCATE, "GetModuleHandle(\"ttxssh.dll\")) %d", GetLastError()); scp_send_error: ::MessageBox(NULL, msg, "Tera Term: scpsend command error", MB_OK | MB_ICONERROR); @@ -2120,7 +2107,7 @@ } } -LONG CVTWindow::OnDropNotify(UINT ShowDialog, LONG lParam) +LRESULT CVTWindow::OnDropNotify(WPARAM ShowDialog, LPARAM lParam) { // ini\x82ɕۑ\xB6\x82\xB3\x82\xEA\x82Ȃ\xA2\x81A\x8D\xA1\x8E\xC0\x8Ds\x82\xB5\x82Ă\xA2\x82\xE9Tera Term\x82ł̂ݗL\x8C\xF8\x82Ȑݒ\xE8 static enum drop_type DefaultDropType = DROP_TYPE_CANCEL; @@ -2133,7 +2120,7 @@ for (int i = 0; i < DropListCount; i++) { const char *FileName = DropLists[i]; const DWORD attr = GetFileAttributes(FileName); - if (attr == -1 ) { + if (attr == (DWORD)-1 ) { goto finish; } if (attr & FILE_ATTRIBUTE_DIRECTORY) { @@ -2288,11 +2275,11 @@ { // send by scp char **FileNames = &DropLists[i]; - int FileCount = DoSameProcess ? DropListCount - i : 1; - if (!SendScp(FileNames, FileCount, ts.ScpSendDir)) { + int FileCountScp = DoSameProcess ? DropListCount - i : 1; + if (!SendScp(FileNames, FileCountScp, ts.ScpSendDir)) { goto finish; } - i += FileCount - 1; + i += FileCountScp - 1; break; } } @@ -2568,6 +2555,24 @@ CPoint pt // \x83J\x81[\x83\\x83\x8B\x88ʒu ) { + if (pSetLayeredWindowAttributes != NULL) { + BOOL InTitleBar; + POINT point = pt; + GetPositionOnWindow(HVTWin, &point, + NULL, NULL, &InTitleBar); + if (InTitleBar) { + int delta = zDelta < 0 ? -1 : 1; + int newAlpha = Alpha; + newAlpha += delta * ts.MouseWheelScrollLine; + if (newAlpha > 255) + newAlpha = 255; + else if (newAlpha < 0) + newAlpha = 0; + SetWindowAlpha(newAlpha); + return TRUE; + } + } + int line, i; ::ScreenToClient(HVTWin, &pt); @@ -2951,7 +2956,7 @@ } } -void CVTWindow::OnTimer(UINT nIDEvent) +void CVTWindow::OnTimer(UINT_PTR nIDEvent) { POINT Point; WORD PortType; @@ -3153,7 +3158,7 @@ } //<!--by AKASI -LONG CVTWindow::OnWindowPosChanging(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnWindowPosChanging(WPARAM wParam, LPARAM lParam) { #ifdef ALPHABLEND_TYPE2 if(BGEnable && BGNoCopyBits) { @@ -3164,7 +3169,7 @@ return CFrameWnd::DefWindowProc(WM_WINDOWPOSCHANGING,wParam,lParam); } -LONG CVTWindow::OnSettingChange(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnSettingChange(WPARAM wParam, LPARAM lParam) { #ifdef ALPHABLEND_TYPE2 BGOnSettingChange(); @@ -3172,7 +3177,7 @@ return CFrameWnd::DefWindowProc(WM_SETTINGCHANGE,wParam,lParam); } -LONG CVTWindow::OnEnterSizeMove(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnEnterSizeMove(WPARAM wParam, LPARAM lParam) { EnableSizeTip(1); @@ -3182,7 +3187,7 @@ return CFrameWnd::DefWindowProc(WM_ENTERSIZEMOVE,wParam,lParam); } -LONG CVTWindow::OnExitSizeMove(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnExitSizeMove(WPARAM wParam, LPARAM lParam) { #ifdef ALPHABLEND_TYPE2 BGOnExitSizeMove(); @@ -3194,7 +3199,7 @@ } //--> -LONG CVTWindow::OnIMEComposition(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnIMEComposition(WPARAM wParam, LPARAM lParam) { HGLOBAL hstr; //LPSTR lpstr; @@ -3252,7 +3257,7 @@ return CFrameWnd::DefWindowProc(WM_IME_COMPOSITION,wParam,lParam); } -LONG CVTWindow::OnIMEInputChange(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnIMEInputChange(WPARAM wParam, LPARAM lParam) { ChangeCaret(); @@ -3259,7 +3264,7 @@ return CFrameWnd::DefWindowProc(WM_INPUTLANGCHANGE,wParam,lParam); } -LONG CVTWindow::OnIMENotify(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnIMENotify(WPARAM wParam, LPARAM lParam) { if (wParam == IMN_SETOPENSTATUS) { ChangeCaret(); @@ -3275,7 +3280,7 @@ // http://27213143.at.webry.info/201202/article_2.html // http://webcache.googleusercontent.com/search?q=cache:WzlX3ouMscIJ:anago.2ch.net/test/read.cgi/software/1325573999/82+IMR_DOCUMENTFEED&cd=13&hl=ja&ct=clnk&gl=jp // (2012.5.9 yutaka) -LONG CVTWindow::OnIMERequest(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnIMERequest(WPARAM wParam, LPARAM lParam) { static int complen, newsize; static char comp[512]; @@ -3337,7 +3342,7 @@ return CFrameWnd::DefWindowProc(WM_IME_REQUEST,wParam,lParam); } -LONG CVTWindow::OnAccelCommand(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnAccelCommand(WPARAM wParam, LPARAM lParam) { switch (wParam) { case IdHold: @@ -3430,7 +3435,7 @@ return 0; } -LONG CVTWindow::OnChangeMenu(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnChangeMenu(WPARAM wParam, LPARAM lParam) { HMENU SysMenu; BOOL Show, B1, B2; @@ -3492,7 +3497,7 @@ return 0; } -LONG CVTWindow::OnChangeTBar(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnChangeTBar(WPARAM wParam, LPARAM lParam) { BOOL TBar; DWORD Style,ExStyle; @@ -3554,7 +3559,7 @@ return 0; } -LONG CVTWindow::OnCommNotify(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnCommNotify(WPARAM wParam, LPARAM lParam) { switch (LOWORD(lParam)) { case FD_READ: // TCP/IP @@ -3584,7 +3589,7 @@ return 0; } -LONG CVTWindow::OnCommOpen(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnCommOpen(WPARAM wParam, LPARAM lParam) { AutoDisconnectedPort = -1; @@ -3679,7 +3684,7 @@ return 0; } -LONG CVTWindow::OnCommStart(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnCommStart(WPARAM wParam, LPARAM lParam) { // \x8E\xA9\x93\xAE\x90ڑ\xB1\x82\xAA\x96\xB3\x8C\xF8\x82̂Ƃ\xAB\x82\xE0\x90ڑ\xB1\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x8Fo\x82\xB7\x82悤\x82ɂ\xB5\x82\xBD (2006.9.15 maya) if (((ts.PortType!=IdSerial) && (ts.HostName[0]==0)) || @@ -3705,7 +3710,7 @@ return 0; } -LONG CVTWindow::OnDdeEnd(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnDdeEnd(WPARAM wParam, LPARAM lParam) { EndDDE(); if (CloseTT) { @@ -3714,42 +3719,42 @@ return 0; } -LONG CVTWindow::OnDlgHelp(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnDlgHelp(WPARAM wParam, LPARAM lParam) { OpenHelp(HH_HELP_CONTEXT, HelpId, ts.UILanguageFile); return 0; } -LONG CVTWindow::OnFileTransEnd(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnFileTransEnd(WPARAM wParam, LPARAM lParam) { FileTransEnd(wParam); return 0; } -LONG CVTWindow::OnGetSerialNo(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnGetSerialNo(WPARAM wParam, LPARAM lParam) { return (LONG)SerialNo; } -LONG CVTWindow::OnKeyCode(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnKeyCode(WPARAM wParam, LPARAM lParam) { KeyCodeSend(wParam,(WORD)lParam); return 0; } -LONG CVTWindow::OnProtoEnd(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnProtoEnd(WPARAM wParam, LPARAM lParam) { ProtoDlgCancel(); return 0; } -LONG CVTWindow::OnChangeTitle(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnChangeTitle(WPARAM wParam, LPARAM lParam) { ChangeTitle(); return 0; } -LONG CVTWindow::OnNotifyIcon(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnNotifyIcon(WPARAM wParam, LPARAM lParam) { if (wParam == 1) { switch (lParam) { @@ -3893,7 +3898,7 @@ void CVTWindow::OnDuplicateSession() { char Command[1024]; - char *exec = "ttermpro"; + const char *exec = "ttermpro"; STARTUPINFO si; PROCESS_INFORMATION pi; char cygterm_cfg[MAX_PATH]; @@ -3993,7 +3998,7 @@ char file[MAX_PATH], *filename; char c, *envptr, *envbuff=NULL; int envbufflen; - char *exename = "cygterm.exe"; + const char *exename = "cygterm.exe"; char cygterm[MAX_PATH]; STARTUPINFO si; PROCESS_INFORMATION pi; @@ -4077,7 +4082,7 @@ // void CVTWindow::OnTTMenuLaunch() { - char *exename = "ttpmenu.exe"; + const char *exename = "ttpmenu.exe"; STARTUPINFO si; PROCESS_INFORMATION pi; @@ -4085,7 +4090,7 @@ GetStartupInfo(&si); memset(&pi, 0, sizeof(pi)); - if (CreateProcess(NULL, exename, NULL, NULL, FALSE, 0, + if (CreateProcess(NULL, (LPSTR)exename, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi) == 0) { char buf[80]; char uimsg[MAX_UIMSG]; @@ -4144,7 +4149,6 @@ switch (msg) { case WM_INITDIALOG: - //SetDlgItemText(hDlgWnd, IDC_EDIT_COMMENT, "\x83T\x83\x93\x83v\x83\x8B"); // \x83G\x83f\x83B\x83b\x83g\x83R\x83\x93\x83g\x83\x8D\x81[\x83\x8B\x82Ƀt\x83H\x81[\x83J\x83X\x82\xF0\x82\xA0\x82Ă\xE9 SetFocus(GetDlgItem(hDlgWnd, IDC_EDIT_COMMENT)); @@ -4254,7 +4258,7 @@ OPENFILENAME ofn; char szFile[MAX_PATH]; char Command[MAX_PATH] = "notepad.exe"; - char *exec = "ttermpro"; + const char *exec = "ttermpro"; STARTUPINFO si; PROCESS_INFORMATION pi; char uimsg[MAX_UIMSG]; @@ -4529,7 +4533,7 @@ CAddSetting.EnableStackedTabs(FALSE); ret = CAddSetting.DoModal(); switch (ret) { - case -1: + case (DWORD)-1: case IDABORT: ret = GetLastError(); break; @@ -4908,8 +4912,9 @@ { BOOL ret = FALSE; int flag = 0; - char *s, **p; - char *virstore_env[] = { + char *s; + const char **p; + static const char *virstore_env[] = { "ProgramFiles", "ProgramData", "SystemRoot", @@ -5675,8 +5680,8 @@ // \x83T\x83u\x83N\x83\x89\x83X\x89\xBB\x82\xB3\x82\xB9\x82ă\x8A\x83A\x83\x8B\x83^\x83C\x83\x80\x83\x82\x81[\x83h\x82ɂ\xB7\x82\xE9 (2008.1.21 yutaka) hwndBroadcast = GetDlgItem(hWnd, IDC_COMMAND_EDIT); hwndBroadcastEdit = GetWindow(hwndBroadcast, GW_CHILD); - OrigBroadcastEditProc = (WNDPROC)GetWindowLong(hwndBroadcastEdit, GWL_WNDPROC); - SetWindowLong(hwndBroadcastEdit, GWL_WNDPROC, (LONG)BroadcastEditProc); + OrigBroadcastEditProc = (WNDPROC)GetWindowLong(hwndBroadcastEdit, GWLP_WNDPROC); + SetWindowLong(hwndBroadcastEdit, GWLP_WNDPROC, (LONG)BroadcastEditProc); // \x83f\x83t\x83H\x83\x8B\x83g\x82\xCDon\x81B\x8Ec\x82\xE8\x82\xCDdisable\x81B SendMessage(GetDlgItem(hWnd, IDC_REALTIME_CHECK), BM_SETCHECK, BST_CHECKED, 0); // default on EnableWindow(GetDlgItem(hWnd, IDC_HISTORY_CHECK), FALSE); @@ -5787,8 +5792,8 @@ // new handler hwndBroadcast = GetDlgItem(hWnd, IDC_COMMAND_EDIT); hwndBroadcastEdit = GetWindow(hwndBroadcast, GW_CHILD); - OrigBroadcastEditProc = (WNDPROC)GetWindowLong(hwndBroadcastEdit, GWL_WNDPROC); - SetWindowLong(hwndBroadcastEdit, GWL_WNDPROC, (LONG)BroadcastEditProc); + OrigBroadcastEditProc = (WNDPROC)GetWindowLong(hwndBroadcastEdit, GWLP_WNDPROC); + SetWindowLong(hwndBroadcastEdit, GWLP_WNDPROC, (LONG)BroadcastEditProc); EnableWindow(GetDlgItem(hWnd, IDC_HISTORY_CHECK), FALSE); EnableWindow(GetDlgItem(hWnd, IDC_RADIO_CRLF), FALSE); @@ -5799,7 +5804,7 @@ EnableWindow(GetDlgItem(hWnd, IDC_LIST), TRUE); // true } else { // restore old handler - SetWindowLong(hwndBroadcastEdit, GWL_WNDPROC, (LONG)OrigBroadcastEditProc); + SetWindowLong(hwndBroadcastEdit, GWLP_WNDPROC, (LONG)OrigBroadcastEditProc); EnableWindow(GetDlgItem(hWnd, IDC_HISTORY_CHECK), TRUE); EnableWindow(GetDlgItem(hWnd, IDC_RADIO_CRLF), TRUE); @@ -5874,7 +5879,7 @@ // \x83\x82\x81[\x83h\x83\x8C\x83X\x83_\x83C\x83A\x83\x8D\x83O\x82͈\xEA\x93x\x90\xB6\x90\xAC\x82\xB3\x82\xEA\x82\xE9\x82ƁA\x83A\x83v\x83\x8A\x83P\x81[\x83V\x83\x87\x83\x93\x82\xAA\x8FI\x97\xB9\x82\xB7\x82\xE9\x82܂\xC5 // \x94j\x8A\xFC\x82\xB3\x82\xEA\x82Ȃ\xA2\x82̂ŁA\x88ȉ\xBA\x82́u\x83E\x83B\x83\x93\x83h\x83E\x83v\x83\x8D\x83V\x81[\x83W\x83\x83\x96߂\xB5\x81v\x82͕s\x97v\x82Ǝv\x82\xED\x82\xEA\x82\xE9\x81B(yutaka) #if 0 - SetWindowLong(hwndBroadcastEdit, GWL_WNDPROC, (LONG)OrigBroadcastEditProc); + SetWindowLong(hwndBroadcastEdit, GWLP_WNDPROC, (LONG)OrigBroadcastEditProc); #endif //EndDialog(hDlgWnd, IDOK); @@ -6066,7 +6071,7 @@ } // WM_COPYDATA\x82̎\xF3\x90M -LONG CVTWindow::OnReceiveIpcMessage(UINT wParam, LONG lParam) +LRESULT CVTWindow::OnReceiveIpcMessage(WPARAM wParam, LPARAM lParam) { COPYDATASTRUCT *cds; char *buf, *msg, *name; Modified: branches/transparent-window/teraterm/teraterm/vtwin.h =================================================================== --- branches/transparent-window/teraterm/teraterm/vtwin.h 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/teraterm/teraterm/vtwin.h 2018-09-19 23:18:40 UTC (rev 7248) @@ -57,6 +57,10 @@ bool DropWithLeftbutton; bool DropWithRightbutton; + // window attribute + BYTE Alpha; + void SetWindowAlpha(BYTE alpha); + protected: public: @@ -122,35 +126,35 @@ afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnSysKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags); - afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); afx_msg BOOL OnDeviceChange(UINT nEventType, DWORD_PTR dwData); //<!--by AKASI - afx_msg LONG OnWindowPosChanging(UINT wParam, LONG lParam); - afx_msg LONG OnSettingChange(UINT wParam, LONG lParam); - afx_msg LONG OnEnterSizeMove(UINT wParam, LONG lParam); - afx_msg LONG OnExitSizeMove(UINT wParam, LONG lParam); + afx_msg LRESULT OnWindowPosChanging(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnSettingChange(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnEnterSizeMove(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnExitSizeMove(WPARAM wParam, LPARAM lParam); //--> - afx_msg LONG OnIMEComposition(UINT wParam, LONG lParam); - afx_msg LONG OnIMEInputChange(UINT wParam, LONG lParam); - afx_msg LONG OnIMENotify(UINT wParam, LONG lParam); - afx_msg LONG OnIMERequest(UINT wParam, LONG lParam); - afx_msg LONG OnAccelCommand(UINT wParam, LONG lParam); - afx_msg LONG OnChangeMenu(UINT wParam, LONG lParam); - afx_msg LONG OnChangeTBar(UINT wParam, LONG lParam); - afx_msg LONG OnCommNotify(UINT wParam, LONG lParam); - afx_msg LONG OnCommOpen(UINT wParam, LONG lParam); - afx_msg LONG OnCommStart(UINT wParam, LONG lParam); - afx_msg LONG OnDdeEnd(UINT wParam, LONG lParam); - afx_msg LONG OnDlgHelp(UINT wParam, LONG lParam); - afx_msg LONG OnFileTransEnd(UINT wParam, LONG lParam); - afx_msg LONG OnGetSerialNo(UINT wParam, LONG lParam); - afx_msg LONG OnKeyCode(UINT wParam, LONG lParam); - afx_msg LONG OnProtoEnd(UINT wParam, LONG lParam); - afx_msg LONG OnChangeTitle(UINT wParam, LONG lParam); - afx_msg LONG OnReceiveIpcMessage(UINT wParam, LONG lParam); - afx_msg LONG OnNonConfirmClose(UINT wParam, LONG lParam); - afx_msg LONG OnNotifyIcon(UINT wParam, LONG lParam); + afx_msg LRESULT OnIMEComposition(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnIMEInputChange(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnIMENotify(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnIMERequest(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnAccelCommand(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnChangeMenu(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnChangeTBar(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnCommNotify(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnCommOpen(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnCommStart(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnDdeEnd(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnDlgHelp(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnFileTransEnd(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnGetSerialNo(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnKeyCode(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnProtoEnd(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnChangeTitle(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnReceiveIpcMessage(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnNonConfirmClose(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnNotifyIcon(WPARAM wParam, LPARAM lParam); afx_msg void OnFileNewConnection(); afx_msg void OnDuplicateSession(); afx_msg void OnCygwinConnection(); Modified: branches/transparent-window/teraterm/ttpdlg/ttpdlg.rc =================================================================== --- branches/transparent-window/teraterm/ttpdlg/ttpdlg.rc 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/teraterm/ttpdlg/ttpdlg.rc 2018-09-19 23:18:40 UTC (rev 7248) @@ -259,7 +259,7 @@ LTEXT "&Language:",IDC_GENLANGLABEL,14,26,39,11,NOT WS_VISIBLE COMBOBOX IDC_GENLANG,78,25,70,45,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP LTEXT "Language&UI:",IDC_GENLANGUI_LABEL,14,42,44,8 - COMBOBOX IDC_GENLANG_UI,58,41,90,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_GENLANG_UI,58,41,90,72,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP DEFPUSHBUTTON "OK",IDOK,13,61,32,14,WS_GROUP PUSHBUTTON "Cancel",IDCANCEL,60,61,40,14 PUSHBUTTON "&Help",IDC_GENHELP,115,61,36,14 Modified: branches/transparent-window/teraterm/ttpset/ttset.c =================================================================== --- branches/transparent-window/teraterm/ttpset/ttset.c 2018-09-19 23:13:56 UTC (rev 7247) +++ branches/transparent-window/teraterm/ttpset/ttset.c 2018-09-19 23:18:40 UTC (rev 7248) @@ -1,6 +1,6 @@ /* * Copyright (C) 1994-1998 T. Teranishi - * (C) 2004-2017 TeraTerm Project + * (C) 2004-2018 TeraTerm Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,15 +52,15 @@ #define MaxStrLen (LONG)512 -static PCHAR far TermList[] = +static const char *TermList[] = { "VT100", "VT100J", "VT101", "VT102", "VT102J", "VT220J", "VT282", "VT320", "VT382", "VT420", "VT520", "VT525", NULL }; -static PCHAR far RussList[] = +static const char *RussList[] = { "Windows", "KOI8-R", "CP-866", "ISO-8859-5", NULL }; -static PCHAR far RussList2[] = { "Windows", "KOI8-R", NULL }; +static const char *RussList2[] = { "Windows", "KOI8-R", NULL }; -WORD str2id(PCHAR far * List, PCHAR str, WORD DefId) +static WORD str2id(const char *List[], PCHAR str, WORD DefId) { WORD i; i = 0; @@ -74,7 +74,7 @@ return i; } -void id2str(PCHAR far * List, WORD Id, WORD DefId, PCHAR str, int destlen) +static void id2str(const char *List[], WORD Id, WORD DefId, PCHAR str, int destlen) { int i; @@ -90,7 +90,7 @@ strncpy_s(str, destlen, List[i], _TRUNCATE); } -int IconName2IconId(const char *name) { +static int IconName2IconId(const char *name) { int id; if (_stricmp(name, "tterm") == 0) { @@ -123,7 +123,7 @@ return id; } -void IconId2IconName(char *name, int len, int id) { +static void IconId2IconName(char *name, int len, int id) { char *icon; switch (id) { case IDI_TTERM: @@ -585,13 +585,13 @@ /* VT win position */ GetPrivateProfileString(Section, "VTPos", "-2147483648,-2147483648", Temp, sizeof(Temp), FName); /* default: random position */ - GetNthNum(Temp, 1, (int far *) (&ts->VTPos.x)); - GetNthNum(Temp, 2, (int far *) (&ts->VTPos.y)); + GetNthNum(Temp, 1, (int*) (&ts->VTPos.x)); + GetNthNum(Temp, 2, (int*) (&ts->VTPos.y)); /* TEK win position */ GetPrivateProfileString(Section, "TEKPos", "-2147483648,-2147483648", Temp, sizeof(Temp), FName); /* default: random position */ - GetNthNum(Temp, 1, (int far *) &(ts->TEKPos.x)); - GetNthNum(Temp, 2, (int far *) &(ts->TEKPos.y)); + GetNthNum(Temp, 1, (int*) &(ts->TEKPos.x)); + GetNthNum(Temp, 2, (int*) &(ts->TEKPos.y)); /* Save VT Window position */ ts->SaveVTWinPos = GetOnOff(Section, "SaveVTWinPos", FName, FALSE); @@ -791,7 +791,7 @@ GetPrivateProfileString(Section, "VTColor", "0,0,0,255,255,255", Temp, sizeof(Temp), FName); for (i = 0; i <= 5; i++) - GetNthNum(Temp, i + 1, (int far *) &(ts->TmpColor[0][i])); + GetNthNum(Temp, i + 1, (int*) &(ts->TmpColor[0][i])); for (i = 0; i <= 1; i++) ts->VTColor[i] = RGB((BYTE) ts->TmpColor[0][i * 3], (BYTE) ts->TmpColor[0][i * 3 + 1], @@ -801,7 +801,7 @@ GetPrivateProfileString(Section, "VTBoldColor", "0,0,255,255,255,255", Temp, sizeof(Temp), FName); for (i = 0; i <= 5; i++) - GetNthNum(Temp, i + 1, (int far *) &(ts->TmpColor[0][i])); + GetNthNum(Temp, i + 1, (int*) &(ts->TmpColor[0][i])); for (i = 0; i <= 1; i++) ts->VTBoldColor[i] = RGB((BYTE) ts->TmpColor[0][i * 3], (BYTE) ts->TmpColor[0][i * 3 + 1], @@ -813,7 +813,7 @@ GetPrivateProfileString(Section, "VTBlinkColor", "255,0,0,255,255,255", Temp, sizeof(Temp), FName); for (i = 0; i <= 5; i++) - GetNthNum(Temp, i + 1, (int far *) &(ts->TmpColor[0][i])); + GetNthNum(Temp, i + 1, (int*) &(ts->TmpColor[0][i])); for (i = 0; i <= 1; i++) ts->VTBlinkColor[i] = RGB((BYTE) ts->TmpColor[0][i * 3], (BYTE) ts->TmpColor[0][i * 3 + 1], @@ -825,7 +825,7 @@ GetPrivateProfileString(Section, "VTReverseColor", "255,255,255,0,0,0", Temp, sizeof(Temp), FName); for (i = 0; i <= 5; i++) - GetNthNum(Temp, i + 1, (int far *) &(ts->TmpColor[0][i])); + GetNthNum(Temp, i + 1, (int*) &(ts->TmpColor[0][i])); for (i = 0; i <= 1; i++) ts->VTReverseColor[i] = RGB((BYTE) ts->TmpColor[0][i * 3], (BYTE) ts->TmpColor[0][i * 3 + 1], @@ -840,7 +840,7 @@ GetPrivateProfileString(Section, "URLColor", "0,255,0,255,255,255", Temp, sizeof(Temp), FName); for (i = 0; i <= 5; i++) - GetNthNum(Temp, i + 1, (int far *) &(ts->TmpColor[0][i])); + GetNthNum(Temp, i + 1, (int*) &(ts->TmpColor[0][i])); for (i = 0; i <= 1; i++) ts->URLColor[i] = RGB((BYTE) ts->TmpColor[0][i * 3], (BYTE) ts->TmpColor[0][i * 3 + 1], @@ -855,7 +855,7 @@ GetPrivateProfileString(Section, "TEKColor", "0,0,0,255,255,255", Temp, sizeof(Temp), FName); for (i = 0; i <= 5; i++) - GetNthNum(Temp, i + 1, (int far *) &(ts->TmpColor[0][i])); + GetNthNum(Temp, i + 1, (int*) &(ts->TmpColor[0][i])); for (i = 0; i <= 1; i++) ts->TEKColor[i] = RGB((BYTE) ts->TmpColor[0][i * 3], (BYTE) ts->TmpColor[0][i * 3 + 1], @@ -893,10 +893,10 @@ n /= 4; for (i = 0; i < n; i++) { int colorid, r, g, b; - GetNthNum(Temp, i * 4 + 1, (int far *) &colorid); - GetNthNum(Temp, i * 4 + 2, (int far *) &r); - GetNthNum(Temp, i * 4 + 3, (int far *) &g); - GetNthNum(Temp, i * 4 + 4, (int far *) &b); + GetNthNum(Temp, i * 4 + 1, (int*) &colorid); + GetNthNum(Temp, i * 4 + 2, (int*) &r); + GetNthNum(Temp, i * 4 + 3, (int*) &g); + GetNthNum(Temp, i * 4 + 4, (int*) &b); ts->ANSIColor[colorid & 15] = RGB((BYTE) r, (BYTE) g, (BYTE) b); } @@ -928,8 +928,8 @@ GetPrivateProfileString(Section, "VTFont", "Terminal,0,-13,1", Temp, sizeof(Temp), FName); GetNthString(Temp, 1, sizeof(ts->VTFont), ts->VTFont); - GetNthNum(Temp, 2, (int far *) &(ts->VTFontSize.x)); - GetNthNum(Temp, 3, (int far *) &(ts->VTFontSize.y)); + GetNthNum(Temp, 2, (int*) &(ts->VTFontSize.x)); + GetNthNum(Temp, 3, (int*) &(ts->VTFontSize.y)); GetNthNum(Temp, 4, &(ts->VTFontCharSet)); /* Bold font flag */ @@ -945,8 +945,8 @@ GetPrivateProfileString(Section, "TEKFont", "Courier,0,-13,0", Temp, sizeof(Temp), FName); GetNthString(Temp, 1, sizeof(ts->TEKFont), ts->TEKFont); - GetNthNum(Temp, 2, (int far *) &(ts->TEKFontSize.x)); - GetNthNum(Temp, 3, (int far *) &(ts->TEKFontSize.y)); + GetNthNum(Temp, 2, (int*) &(ts->TEKFontSize.x)); + GetNthNum(Temp, 3, (int*) &(ts->TEKFontSize.y)); GetNthNum(Temp, 4, &(ts->TEKFontCharSet)); /* BS key */ @@ -1342,8 +1342,8 @@ } else { GetNthString(Temp, 1, sizeof(ts->PrnFont), ts->PrnFont); - GetNthNum(Temp, 2, (int far *) &(ts->PrnFontSize.x)); - GetNthNum(Temp, 3, (int far *) &(ts->PrnFontSize.y)); + GetNthNum(Temp, 2, (int*) &(ts->PrnFontSize.x)); + GetNthNum(Temp, 3, (int*) &(ts->PrnFontSize.y)); GetNthNum(Temp, 4, &(ts->PrnFontCharSet)); } @@ -1465,14 +1465,14 @@ // VT-print scaling factors (pixels per inch) --- special option GetPrivateProfileString(Section, "VTPPI", "0,0", Temp, sizeof(Temp), FName); - GetNthNum(Temp, 1, (int far *) &ts->VTPPI.x); - GetNthNum(Temp, 2, (int far *) &ts->VTPPI.y); + GetNthNum(Temp, 1, (int*) &ts->VTPPI.x); + GetNthNum(Temp, 2, (int*) &ts->VTPPI.y); // TEK-print scaling factors (pixels per inch) --- special option GetPrivateProfileString(Section, "TEKPPI", "0,0", Temp, sizeof(Temp), FName); - GetNthNum(Temp, 1, (int far *) &ts->TEKPPI.x); - GetNthNum(Temp, 2, (int far *) &ts->TEKPPI.y); + GetNthNum(Temp, 1, (int*) &ts->TEKPPI.x); + GetNthNum(Temp, 2, (int*) &ts->TEKPPI.y); // Show "Window" menu -- special option if (GetOnOff(Section, "WindowMenu", FName, TRUE)) @@ -1561,13 +1561,17 @@ _TRUNCATE); // Translucent window - ts->AlphaBlend = - GetPrivateProfileInt(Section, "AlphaBlend ", 255, FName); - ts->AlphaBlend = max(0, ts->AlphaBlend); - ts->AlphaBlend = min(255, ts->AlphaBlend); + ts->AlphaBlendInactive = + GetPrivateProfileInt(Section, "AlphaBlend", 255, FName); + ts->AlphaBlendInactive = max(0, ts->AlphaBlendInactive); + ts->AlphaBlendInactive = min(255, ts->AlphaBlendInactive); + ts->AlphaBlendActive = + GetPrivateProfileInt(Section, "AlphaBlendActive", 255, FName); + ts->AlphaBlendActive = max(0, ts->AlphaBlendActive); + ts->AlphaBlendActive = min(255, ts->AlphaBlendActive); // Cygwin install path - GetPrivateProfileString(Section, "CygwinDirectory ", "c:\\cygwin", + GetPrivateProfileString(Section, "CygwinDirectory", "c:\\cygwin", Temp, sizeof(Temp), FName); strncpy_s(ts->CygwinDirectory, sizeof(ts->CygwinDirectory), Temp, _TRUNCATE); @@ -1579,17 +1583,17 @@ else { Temp[0] = '\0'; } - GetPrivateProfileString(Section, "ViewlogEditor ", Temp, + GetPrivateProfileString(Section, "ViewlogEditor", Temp, ts->ViewlogEditor, sizeof(ts->ViewlogEditor), FName); // Locale for UTF-8 - GetPrivateProfileString(Section, "Locale ", DEFAULT_LOCALE, + GetPrivateProfileString(Section, "Locale", DEFAULT_LOCALE, Temp, sizeof(Temp), FName); strncpy_s(ts->Locale, sizeof(ts->Locale), Temp, _TRUNCATE); // CodePage ts->CodePage = - GetPrivateProfileInt(Section, "CodePage ", DEFAULT_CODEPAGE, + GetPrivateProfileInt(Section, "CodePage", DEFAULT_CODEPAGE, FName); // UI language message file @@ -2289,8 +2293,10 @@ ts->EnableContinuedLineCopy); WritePrivateProfileString(Section, "MouseCursor", ts->MouseCursorName, FName); - _snprintf_s(Temp, sizeof(Temp), _TRUNCATE, "%d", ts->AlphaBlend); + _snprintf_s(Temp, sizeof(Temp), _TRUNCATE, "%d", ts->AlphaBlendInactive); WritePrivateProfileString(Section, "AlphaBlend", Temp, FName); + _snprintf_s(Temp, sizeof(Temp), _TRUNCATE, "%d", ts->AlphaBlendActive); + WritePrivateProfileString(Section, "AlphaBlendActive", Temp, FName); WritePrivateProfileString(Section, "CygwinDirectory", ts->CygwinDirectory, FName); WritePrivateProfileString(Section, "ViewlogEditor", ts->ViewlogEditor,