• R/O
  • SSH
  • HTTPS

ttssh2: 提交


Commit MetaInfo

修订版7248 (tree)
时间2018-09-20 08:18:40
作者zmatsuo

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

ホイール処理追加,コンパイル時に警告が出るところを修正

更改概述

差异

--- branches/transparent-window/teraterm/common/compat_win.cpp (nonexistent)
+++ branches/transparent-window/teraterm/common/compat_win.cpp (revision 7248)
@@ -0,0 +1,95 @@
1+/*
2+ * (C) 2018 TeraTerm Project
3+ * All rights reserved.
4+ *
5+ * Redistribution and use in source and binary forms, with or without
6+ * modification, are permitted provided that the following conditions
7+ * are met:
8+ *
9+ * 1. Redistributions of source code must retain the above copyright
10+ * notice, this list of conditions and the following disclaimer.
11+ * 2. Redistributions in binary form must reproduce the above copyright
12+ * notice, this list of conditions and the following disclaimer in the
13+ * documentation and/or other materials provided with the distribution.
14+ * 3. The name of the author may not be used to endorse or promote products
15+ * derived from this software without specific prior written permission.
16+ *
17+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
18+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20+ * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+ */
28+
29+/* compat_win */
30+
31+#include "compat_win.h"
32+
33+HINSTANCE hDll_msimg32;
34+HMODULE hDll_user32;
35+
36+BOOL (WINAPI *pAlphaBlend)(HDC,int,int,int,int,HDC,int,int,int,int,BLENDFUNCTION);
37+BOOL (WINAPI *pEnumDisplayMonitors)(HDC,LPCRECT,MONITORENUMPROC,LPARAM);
38+DPI_AWARENESS_CONTEXT (WINAPI *pSetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT dpiContext);
39+UINT (WINAPI *pGetDpiForWindow)(HWND hwnd);
40+BOOL (WINAPI *pSetLayeredWindowAttributes)(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags);
41+
42+typedef struct {
43+ const char *ApiName;
44+ void **func;
45+} APIInfo;
46+
47+typedef struct {
48+ const char *DllName;
49+ HINSTANCE *hDll;
50+ const APIInfo *APIInfoPtr;
51+ size_t APIInfoCount;
52+} DllInfo;
53+
54+static const APIInfo Lists_user32[] = {
55+ { "SetLayeredWindowAttributes", (void **)&pSetLayeredWindowAttributes },
56+ { "SetThreadDpiAwarenessContext", (void **)&pSetThreadDpiAwarenessContext },
57+ { "GetDpiForWindow", (void **)&pGetDpiForWindow }
58+};
59+
60+static const APIInfo Lists_msimg32[] = {
61+ { "AlphaBlend", (void **)&pAlphaBlend },
62+};
63+
64+static const DllInfo DllInfos[] = {
65+ { "user32.dll", &hDll_user32, Lists_user32, _countof(Lists_user32) },
66+ { "msimg32.dll", &hDll_msimg32, Lists_msimg32, _countof(Lists_msimg32) },
67+};
68+
69+void WinCompatInit()
70+{
71+ static BOOL done = FALSE;
72+ if (done) return;
73+ done = TRUE;
74+
75+ for (size_t i = 0; i < _countof(DllInfos); i++) {
76+ const DllInfo *pDllInfo = &DllInfos[i];
77+
78+ char dllName[MAX_PATH];
79+ GetSystemDirectory(dllName, sizeof(dllName));
80+ strcat_s(dllName, sizeof(dllName), "/");
81+ strcat_s(dllName, sizeof(dllName), pDllInfo->DllName);
82+
83+ HINSTANCE hDll = LoadLibrary(dllName);
84+ *pDllInfo->hDll = hDll;
85+
86+ if (hDll != NULL) {
87+ const APIInfo *pApiInfo = pDllInfo->APIInfoPtr;
88+ for (size_t j = 0; j < pDllInfo->APIInfoCount; j++) {
89+ void **func = pApiInfo->func;
90+ *func = (void *)GetProcAddress(hDll, pApiInfo->ApiName);
91+ pApiInfo++;
92+ }
93+ }
94+ }
95+}
--- branches/transparent-window/teraterm/common/compat_win.h (nonexistent)
+++ branches/transparent-window/teraterm/common/compat_win.h (revision 7248)
@@ -0,0 +1,70 @@
1+/*
2+ * (C) 2018 TeraTerm Project
3+ * All rights reserved.
4+ *
5+ * Redistribution and use in source and binary forms, with or without
6+ * modification, are permitted provided that the following conditions
7+ * are met:
8+ *
9+ * 1. Redistributions of source code must retain the above copyright
10+ * notice, this list of conditions and the following disclaimer.
11+ * 2. Redistributions in binary form must reproduce the above copyright
12+ * notice, this list of conditions and the following disclaimer in the
13+ * documentation and/or other materials provided with the distribution.
14+ * 3. The name of the author may not be used to endorse or promote products
15+ * derived from this software without specific prior written permission.
16+ *
17+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
18+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20+ * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+ */
28+
29+/* compat_win */
30+
31+#pragma once
32+
33+#include <windows.h>
34+
35+#ifdef __cplusplus
36+extern "C" {
37+#endif
38+
39+#if !defined(DPI_AWARENESS_CONTEXT_SYSTEM_AWARE)
40+#define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((DPI_AWARENESS_CONTEXT)-2)
41+#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((DPI_AWARENESS_CONTEXT)-3)
42+#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT)-4)
43+DECLARE_HANDLE(DPI_AWARENESS_CONTEXT);
44+#endif
45+
46+#if !defined(WM_DPICHANGED)
47+#define WM_DPICHANGED 0x02E0
48+#endif
49+
50+#if 0
51+// BLENDFUNCTIONと同一
52+typedef struct _BGBLENDFUNCTION
53+{
54+ BYTE BlendOp;
55+ BYTE BlendFlags;
56+ BYTE SourceConstantAlpha;
57+ BYTE AlphaFormat;
58+}BGBLENDFUNCTION;
59+#endif
60+extern BOOL (WINAPI *pAlphaBlend)(HDC,int,int,int,int,HDC,int,int,int,int,BLENDFUNCTION);
61+extern BOOL (WINAPI *pEnumDisplayMonitors)(HDC,LPCRECT,MONITORENUMPROC,LPARAM);
62+extern DPI_AWARENESS_CONTEXT (WINAPI *pSetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT dpiContext);
63+extern UINT (WINAPI *pGetDpiForWindow)(HWND hwnd);
64+extern BOOL (WINAPI *pSetLayeredWindowAttributes)(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags);
65+
66+void WinCompatInit();
67+
68+#ifdef __cplusplus
69+}
70+#endif
--- branches/transparent-window/teraterm/common/tt_res.h (revision 7247)
+++ branches/transparent-window/teraterm/common/tt_res.h (revision 7248)
@@ -31,7 +31,10 @@
3131 #define IDC_FULLPATH_LABEL 1002
3232 #define IDC_LINECOPY 1003
3333 #define IDC_MOUSE_CURSOR 1004
34-#define IDC_ALPHA_BLEND 1008
34+#define IDC_ALPHA_BLEND_ACTIVE 1005
35+#define IDC_ALPHA_BLEND_INACTIVE 1006
36+#define IDC_ALPHA_BLEND_ACTIVE_LABEL 1007
37+#define IDC_ALPHA_BLEND_INACTIVE_LABEL 1008
3538 #define IDC_CYGWIN_PATH 1009
3639 #define IDC_SELECT_FILE 1010
3740 #define IDC_DELIM_LIST 1011
--- branches/transparent-window/teraterm/common/ttlib.c (revision 7247)
+++ branches/transparent-window/teraterm/common/ttlib.c (revision 7248)
@@ -1716,3 +1716,68 @@
17161716
17171717 *body = p1;
17181718 }
1719+
1720+/**
1721+ * ウィンドウ上の位置を取得する
1722+ * @Param[in] hWnd
1723+ * @Param[in] point 位置(x,y)
1724+ * @Param[in,out] InWindow ウィンドウ上
1725+ * @Param[in,out] InClient クライアント領域上
1726+ * @Param[in,out] InTitleBar タイトルバー上
1727+ * @retval FALSE 無効なhWnd
1728+ */
1729+BOOL GetPositionOnWindow(
1730+ HWND hWnd, const POINT *point,
1731+ BOOL *InWindow, BOOL *InClient, BOOL *InTitleBar)
1732+{
1733+ const int x = point->x;
1734+ const int y = point->y;
1735+ RECT winRect;
1736+ RECT clientRect;
1737+
1738+ if (InWindow != NULL) *InWindow = FALSE;
1739+ if (InClient != NULL) *InClient = FALSE;
1740+ if (InTitleBar != NULL) *InTitleBar = FALSE;
1741+
1742+ if (!GetWindowRect(hWnd, &winRect)) {
1743+ return FALSE;
1744+ }
1745+
1746+ if ((x < winRect.left) || (winRect.right < x) ||
1747+ (y < winRect.top) || (winRect.bottom < y))
1748+ {
1749+ return TRUE;
1750+ }
1751+ if (InWindow != NULL) *InWindow = TRUE;
1752+
1753+ {
1754+ POINT pos;
1755+ GetClientRect(hWnd, &clientRect);
1756+ pos.x = clientRect.left;
1757+ pos.y = clientRect.top;
1758+ ClientToScreen(hWnd, &pos);
1759+ clientRect.left = pos.x;
1760+ clientRect.top = pos.y;
1761+
1762+ pos.x = clientRect.right;
1763+ pos.y = clientRect.bottom;
1764+ ClientToScreen(hWnd, &pos);
1765+ clientRect.right = pos.x;
1766+ clientRect.bottom = pos.y;
1767+ }
1768+
1769+ if ((clientRect.left <= x) && (x < clientRect.right) &&
1770+ (clientRect.top <= y) && (y < clientRect.bottom))
1771+ {
1772+ if (InClient != NULL) *InClient = TRUE;
1773+ if (InTitleBar != NULL) *InTitleBar = FALSE;
1774+ return TRUE;
1775+ }
1776+ if (InClient != NULL) *InClient = FALSE;
1777+
1778+ if (InTitleBar != NULL) {
1779+ *InTitleBar = (y < clientRect.top) ? TRUE : FALSE;
1780+ }
1781+
1782+ return TRUE;
1783+}
--- branches/transparent-window/teraterm/common/ttlib.h (revision 7247)
+++ branches/transparent-window/teraterm/common/ttlib.h (revision 7248)
@@ -99,6 +99,9 @@
9999 void PASCAL DeleteComment(PCHAR dest, int dest_size, PCHAR src);
100100
101101 void split_buffer(char *buffer, int delimiter, char **head, char **body);
102+BOOL GetPositionOnWindow(
103+ HWND hWnd, const POINT *point,
104+ BOOL *InWindow, BOOL *InClient, BOOL *InTitleBar);
102105
103106 #define CheckFlag(var, flag) (((var) & (flag)) != 0)
104107
--- branches/transparent-window/teraterm/common/tttypes.h (revision 7247)
+++ branches/transparent-window/teraterm/common/tttypes.h (revision 7248)
@@ -549,8 +549,9 @@
549549 COLORREF ANSIColor[16];
550550 /* protocol used in connect() */
551551 int ProtocolFamily;
552- char MouseCursorName[16];
553- int AlphaBlend;
552+ char MouseCursorName[16];
553+ int AlphaBlendActive;
554+ int AlphaBlendInactive;
554555 char CygwinDirectory[MAX_PATH];
555556 #define DEFAULT_LOCALE "japanese"
556557 char Locale[80];
--- branches/transparent-window/teraterm/teraterm/addsetting.cpp (revision 7247)
+++ branches/transparent-window/teraterm/teraterm/addsetting.cpp (revision 7248)
@@ -1,5 +1,5 @@
11 /*
2- * Copyright (C) 2008-2017 TeraTerm Project
2+ * Copyright (C) 2008-2018 TeraTerm Project
33 * All rights reserved.
44 *
55 * Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,9 @@
4141 #include "ttwinman.h"
4242 #include "ttcommon.h"
4343 #include "ttftypes.h"
44+#include "dlglib.h"
4445
45-mouse_cursor_t MouseCursor[] = {
46+const mouse_cursor_t MouseCursor[] = {
4647 {"ARROW", IDC_ARROW},
4748 {"IBEAM", IDC_IBEAM},
4849 {"CROSS", IDC_CROSS},
@@ -51,10 +52,6 @@
5152 };
5253 #define MOUSE_CURSOR_MAX (sizeof(MouseCursor)/sizeof(MouseCursor[0]) - 1)
5354
54-// 本体は vtwin.cpp
55-extern void SetWindowStyle(TTTSet *ts);
56-
57-
5855 static void SetupRGBbox(HWND hDlgWnd, int index)
5956 {
6057 HWND hWnd;
@@ -102,9 +99,25 @@
10299
103100 BOOL CGeneralPropPageDlg::OnInitDialog()
104101 {
105- char uimsg[MAX_UIMSG];
106102 char buf[64];
107103 CButton *btn;
104+ static const DlgTextInfo TextInfos[] = {
105+ { IDC_CLICKABLE_URL, "DLG_TAB_GENERAL_CLICKURL" },
106+ { IDC_DISABLE_SENDBREAK, "DLG_TAB_GENERAL_DISABLESENDBREAK" },
107+ { IDC_ACCEPT_BROADCAST, "DLG_TAB_GENERAL_ACCEPTBROADCAST" },
108+ { IDC_MOUSEWHEEL_SCROLL_LINE, "DLG_TAB_GENERAL_MOUSEWHEEL_SCROLL_LINE" },
109+ { IDC_AUTOSCROLL_ONLY_IN_BOTTOM_LINE, "DLG_TAB_GENERAL_AUTOSCROLL_ONLY_IN_BOTTOM_LINE" },
110+ { IDC_CLEAR_ON_RESIZE, "DLG_TAB_GENERAL_CLEAR_ON_RESIZE" },
111+ { IDC_CURSOR_CHANGE_IME, "DLG_TAB_GENERAL_CURSOR_CHANGE_IME" },
112+ { IDC_LIST_HIDDEN_FONTS, "DLG_TAB_GENERAL_LIST_HIDDEN_FONTS" },
113+ { IDC_TITLEFMT_GROUP, "DLG_TAB_GENERAL_TITLEFMT_GROUP" },
114+ { IDC_TITLEFMT_DISPHOSTNAME, "DLG_TAB_GENERAL_TITLEFMT_DISPHOSTNAME" },
115+ { IDC_TITLEFMT_DISPSESSION, "DLG_TAB_GENERAL_TITLEFMT_DISPSESSION" },
116+ { IDC_TITLEFMT_DISPVTTEK, "DLG_TAB_GENERAL_TITLEFMT_DISPVTTEK" },
117+ { IDC_TITLEFMT_SWAPHOSTTITLE, "DLG_TAB_GENERAL_TITLEFMT_SWAPHOSTTITLE" },
118+ { IDC_TITLEFMT_DISPTCPPORT, "DLG_TAB_GENERAL_TITLEFMT_DISPTCPPORT" },
119+ { IDC_TITLEFMT_DISPSERIALSPEED, "DLG_TAB_GENERAL_TITLEFMT_DISPSERIALSPEED" }
120+ };
108121
109122 CPropertyPage::OnInitDialog();
110123
@@ -132,53 +145,8 @@
132145 DlgGeneralFont = NULL;
133146 }
134147
135- GetDlgItemText(IDC_CLICKABLE_URL, uimsg, sizeof(uimsg));
136- get_lang_msg("DLG_TAB_GENERAL_CLICKURL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
137- SetDlgItemText(IDC_CLICKABLE_URL, ts.UIMsg);
138- GetDlgItemText(IDC_DISABLE_SENDBREAK, uimsg, sizeof(uimsg));
139- get_lang_msg("DLG_TAB_GENERAL_DISABLESENDBREAK", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
140- SetDlgItemText(IDC_DISABLE_SENDBREAK, ts.UIMsg);
141- GetDlgItemText(IDC_ACCEPT_BROADCAST, uimsg, sizeof(uimsg));
142- get_lang_msg("DLG_TAB_GENERAL_ACCEPTBROADCAST", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
143- SetDlgItemText(IDC_ACCEPT_BROADCAST, ts.UIMsg);
144- GetDlgItemText(IDC_MOUSEWHEEL_SCROLL_LINE, uimsg, sizeof(uimsg));
145- get_lang_msg("DLG_TAB_GENERAL_MOUSEWHEEL_SCROLL_LINE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
146- SetDlgItemText(IDC_MOUSEWHEEL_SCROLL_LINE, ts.UIMsg);
147- GetDlgItemText(IDC_AUTOSCROLL_ONLY_IN_BOTTOM_LINE, uimsg, sizeof(uimsg));
148- get_lang_msg("DLG_TAB_GENERAL_AUTOSCROLL_ONLY_IN_BOTTOM_LINE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
149- SetDlgItemText(IDC_AUTOSCROLL_ONLY_IN_BOTTOM_LINE, ts.UIMsg);
150- GetDlgItemText(IDC_CLEAR_ON_RESIZE, uimsg, sizeof(uimsg));
151- get_lang_msg("DLG_TAB_GENERAL_CLEAR_ON_RESIZE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
152- SetDlgItemText(IDC_CLEAR_ON_RESIZE, ts.UIMsg);
153- GetDlgItemText(IDC_CURSOR_CHANGE_IME, uimsg, sizeof(uimsg));
154- get_lang_msg("DLG_TAB_GENERAL_CURSOR_CHANGE_IME", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
155- SetDlgItemText(IDC_CURSOR_CHANGE_IME, ts.UIMsg);
156- GetDlgItemText(IDC_LIST_HIDDEN_FONTS, uimsg, sizeof(uimsg));
157- get_lang_msg("DLG_TAB_GENERAL_LIST_HIDDEN_FONTS", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
158- SetDlgItemText(IDC_LIST_HIDDEN_FONTS, ts.UIMsg);
148+ SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), ts.UILanguageFile);
159149
160- GetDlgItemText(IDC_TITLEFMT_GROUP, uimsg, sizeof(uimsg));
161- get_lang_msg("DLG_TAB_GENERAL_TITLEFMT_GROUP", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
162- SetDlgItemText(IDC_TITLEFMT_GROUP, ts.UIMsg);
163- GetDlgItemText(IDC_TITLEFMT_DISPHOSTNAME, uimsg, sizeof(uimsg));
164- get_lang_msg("DLG_TAB_GENERAL_TITLEFMT_DISPHOSTNAME", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
165- SetDlgItemText(IDC_TITLEFMT_DISPHOSTNAME, ts.UIMsg);
166- GetDlgItemText(IDC_TITLEFMT_DISPSESSION, uimsg, sizeof(uimsg));
167- get_lang_msg("DLG_TAB_GENERAL_TITLEFMT_DISPSESSION", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
168- SetDlgItemText(IDC_TITLEFMT_DISPSESSION, ts.UIMsg);
169- GetDlgItemText(IDC_TITLEFMT_DISPVTTEK, uimsg, sizeof(uimsg));
170- get_lang_msg("DLG_TAB_GENERAL_TITLEFMT_DISPVTTEK", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
171- SetDlgItemText(IDC_TITLEFMT_DISPVTTEK, ts.UIMsg);
172- GetDlgItemText(IDC_TITLEFMT_SWAPHOSTTITLE, uimsg, sizeof(uimsg));
173- get_lang_msg("DLG_TAB_GENERAL_TITLEFMT_SWAPHOSTTITLE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
174- SetDlgItemText(IDC_TITLEFMT_SWAPHOSTTITLE, ts.UIMsg);
175- GetDlgItemText(IDC_TITLEFMT_DISPTCPPORT, uimsg, sizeof(uimsg));
176- get_lang_msg("DLG_TAB_GENERAL_TITLEFMT_DISPTCPPORT", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
177- SetDlgItemText(IDC_TITLEFMT_DISPTCPPORT, ts.UIMsg);
178- GetDlgItemText(IDC_TITLEFMT_DISPSERIALSPEED, uimsg, sizeof(uimsg));
179- get_lang_msg("DLG_TAB_GENERAL_TITLEFMT_DISPSERIALSPEED", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
180- SetDlgItemText(IDC_TITLEFMT_DISPSERIALSPEED, ts.UIMsg);
181-
182150 // (1)DisableAcceleratorSendBreak
183151 btn = (CButton *)GetDlgItem(IDC_DISABLE_SENDBREAK);
184152 btn->SetCheck(ts.DisableAcceleratorSendBreak);
@@ -320,10 +288,23 @@
320288
321289 BOOL CSequencePropPageDlg::OnInitDialog()
322290 {
323- char uimsg[MAX_UIMSG];
324291 CButton *btn, *btn2;
325292 CComboBox *cmb;
293+ static const DlgTextInfo TextInfos[] = {
294+ { IDC_ACCEPT_MOUSE_EVENT_TRACKING, "DLG_TAB_SEQUENCE_ACCEPT_MOUSE_EVENT_TRACKING" },
295+ { IDC_DISABLE_MOUSE_TRACKING_CTRL, "DLG_TAB_SEQUENCE_DISABLE_MOUSE_TRACKING_CTRL" },
296+ { IDC_ACCEPT_TITLE_CHANGING_LABEL, "DLG_TAB_SEQUENCE_ACCEPT_TITLE_CHANGING" },
326297
298+ { IDC_CURSOR_CTRL_SEQ, "DLG_TAB_SEQUENCE_CURSOR_CTRL" },
299+ { IDC_WINDOW_CTRL, "DLG_TAB_SEQUENCE_WINDOW_CTRL" },
300+ { IDC_WINDOW_REPORT, "DLG_TAB_SEQUENCE_WINDOW_REPORT" },
301+ { IDC_TITLE_REPORT_LABEL, "DLG_TAB_SEQUENCE_TITLE_REPORT" },
302+
303+ { IDC_CLIPBOARD_ACCESS_LABEL, "DLG_TAB_SEQUENCE_CLIPBOARD_ACCESS" },
304+
305+ { IDC_CLIPBOARD_NOTIFY, "DLG_TAB_SEQUENCE_CLIPBOARD_NOTIFY" },
306+ };
307+
327308 CPropertyPage::OnInitDialog();
328309
329310 font = (HFONT)SendMessage(WM_GETFONT, 0, 0);
@@ -346,15 +327,7 @@
346327 DlgSequenceFont = NULL;
347328 }
348329
349- GetDlgItemText(IDC_ACCEPT_MOUSE_EVENT_TRACKING, uimsg, sizeof(uimsg));
350- get_lang_msg("DLG_TAB_SEQUENCE_ACCEPT_MOUSE_EVENT_TRACKING", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
351- SetDlgItemText(IDC_ACCEPT_MOUSE_EVENT_TRACKING, ts.UIMsg);
352- GetDlgItemText(IDC_DISABLE_MOUSE_TRACKING_CTRL, uimsg, sizeof(uimsg));
353- get_lang_msg("DLG_TAB_SEQUENCE_DISABLE_MOUSE_TRACKING_CTRL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
354- SetDlgItemText(IDC_DISABLE_MOUSE_TRACKING_CTRL, ts.UIMsg);
355- GetDlgItemText(IDC_ACCEPT_TITLE_CHANGING_LABEL, uimsg, sizeof(uimsg));
356- get_lang_msg("DLG_TAB_SEQUENCE_ACCEPT_TITLE_CHANGING", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
357- SetDlgItemText(IDC_ACCEPT_TITLE_CHANGING_LABEL, ts.UIMsg);
330+ SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), ts.UILanguageFile);
358331
359332 get_lang_msg("DLG_TAB_SEQUENCE_ACCEPT_TITLE_CHANGING_OFF", ts.UIMsg, sizeof(ts.UIMsg), "off", ts.UILanguageFile);
360333 SendDlgItemMessage(IDC_ACCEPT_TITLE_CHANGING, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg);
@@ -365,19 +338,6 @@
365338 get_lang_msg("DLG_TAB_SEQUENCE_ACCEPT_TITLE_CHANGING_LAST", ts.UIMsg, sizeof(ts.UIMsg), "last", ts.UILanguageFile);
366339 SendDlgItemMessage(IDC_ACCEPT_TITLE_CHANGING, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg);
367340
368- GetDlgItemText(IDC_CURSOR_CTRL_SEQ, uimsg, sizeof(uimsg));
369- get_lang_msg("DLG_TAB_SEQUENCE_CURSOR_CTRL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
370- SetDlgItemText(IDC_CURSOR_CTRL_SEQ, ts.UIMsg);
371- GetDlgItemText(IDC_WINDOW_CTRL, uimsg, sizeof(uimsg));
372- get_lang_msg("DLG_TAB_SEQUENCE_WINDOW_CTRL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
373- SetDlgItemText(IDC_WINDOW_CTRL, ts.UIMsg);
374- GetDlgItemText(IDC_WINDOW_REPORT, uimsg, sizeof(uimsg));
375- get_lang_msg("DLG_TAB_SEQUENCE_WINDOW_REPORT", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
376- SetDlgItemText(IDC_WINDOW_REPORT, ts.UIMsg);
377- GetDlgItemText(IDC_TITLE_REPORT_LABEL, uimsg, sizeof(uimsg));
378- get_lang_msg("DLG_TAB_SEQUENCE_TITLE_REPORT", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
379- SetDlgItemText(IDC_TITLE_REPORT_LABEL, ts.UIMsg);
380-
381341 get_lang_msg("DLG_TAB_SEQUENCE_TITLE_REPORT_IGNORE", ts.UIMsg, sizeof(ts.UIMsg), "ignore", ts.UILanguageFile);
382342 SendDlgItemMessage(IDC_TITLE_REPORT, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg);
383343 get_lang_msg("DLG_TAB_SEQUENCE_TITLE_REPORT_ACCEPT", ts.UIMsg, sizeof(ts.UIMsg), "accept", ts.UILanguageFile);
@@ -385,10 +345,6 @@
385345 get_lang_msg("DLG_TAB_SEQUENCE_TITLE_REPORT_EMPTY", ts.UIMsg, sizeof(ts.UIMsg), "empty", ts.UILanguageFile);
386346 SendDlgItemMessage(IDC_TITLE_REPORT, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg);
387347
388- GetDlgItemText(IDC_CLIPBOARD_ACCESS_LABEL, uimsg, sizeof(uimsg));
389- get_lang_msg("DLG_TAB_SEQUENCE_CLIPBOARD_ACCESS", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
390- SetDlgItemText(IDC_CLIPBOARD_ACCESS_LABEL, ts.UIMsg);
391-
392348 get_lang_msg("DLG_TAB_SEQUENCE_CLIPBOARD_ACCESS_OFF", ts.UIMsg, sizeof(ts.UIMsg), "off", ts.UILanguageFile);
393349 SendDlgItemMessage(IDC_CLIPBOARD_ACCESS, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg);
394350 get_lang_msg("DLG_TAB_SEQUENCE_CLIPBOARD_ACCESS_WRITE", ts.UIMsg, sizeof(ts.UIMsg), "write only", ts.UILanguageFile);
@@ -398,10 +354,6 @@
398354 get_lang_msg("DLG_TAB_SEQUENCE_CLIPBOARD_ACCESS_ON", ts.UIMsg, sizeof(ts.UIMsg), "read/write", ts.UILanguageFile);
399355 SendDlgItemMessage(IDC_CLIPBOARD_ACCESS, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg);
400356
401- GetDlgItemText(IDC_CLIPBOARD_NOTIFY, uimsg, sizeof(uimsg));
402- get_lang_msg("DLG_TAB_SEQUENCE_CLIPBOARD_NOTIFY", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
403- SetDlgItemText(IDC_CLIPBOARD_NOTIFY, ts.UIMsg);
404-
405357 // (1)IDC_ACCEPT_MOUSE_EVENT_TRACKING
406358 btn = (CButton *)GetDlgItem(IDC_ACCEPT_MOUSE_EVENT_TRACKING);
407359 btn2 = (CButton *)GetDlgItem(IDC_DISABLE_MOUSE_TRACKING_CTRL);
@@ -603,10 +555,23 @@
603555
604556 BOOL CCopypastePropPageDlg::OnInitDialog()
605557 {
606- char uimsg[MAX_UIMSG];
607558 CButton *btn, *btn2;
608559 CEdit *edit;
609560 char buf[64];
561+ static const DlgTextInfo TextInfos[] = {
562+ { IDC_LINECOPY, "DLG_TAB_COPYPASTE_CONTINUE" },
563+ { IDC_DISABLE_PASTE_RBUTTON, "DLG_TAB_COPYPASTE_MOUSEPASTE" },
564+ { IDC_CONFIRM_PASTE_RBUTTON, "DLG_TAB_COPYPASTE_CONFIRMPASTE" },
565+ { IDC_DISABLE_PASTE_MBUTTON, "DLG_TAB_COPYPASTE_MOUSEPASTEM" },
566+ { IDC_SELECT_LBUTTON, "DLG_TAB_COPYPASTE_SELECTLBUTTON" },
567+ { IDC_TRIMNLCHAR, "DLG_TAB_COPYPASTE_TRIM_TRAILING_NL" },
568+ { IDC_NORMALIZE_LINEBREAK, "DLG_TAB_COPYPASTE_NORMALIZE_LINEBREAK" },
569+ { IDC_CONFIRM_CHANGE_PASTE, "DLG_TAB_COPYPASTE_CONFIRM_CHANGE_PASTE" },
570+ { IDC_CONFIRM_STRING_FILE_LABEL, "DLG_TAB_COPYPASTE_STRINGFILE" },
571+ { IDC_DELIMITER, "DLG_TAB_COPYPASTE_DELIMITER" },
572+ { IDC_PASTEDELAY_LABEL, "DLG_TAB_COPYPASTE_PASTEDELAY" },
573+ { IDC_PASTEDELAY_LABEL2, "DLG_TAB_COPYPASTE_PASTEDELAY2" }
574+ };
610575
611576 CPropertyPage::OnInitDialog();
612577
@@ -634,42 +599,7 @@
634599 DlgCopypasteFont = NULL;
635600 }
636601
637- GetDlgItemText(IDC_LINECOPY, uimsg, sizeof(uimsg));
638- get_lang_msg("DLG_TAB_COPYPASTE_CONTINUE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
639- SetDlgItemText(IDC_LINECOPY, ts.UIMsg);
640- GetDlgItemText(IDC_DISABLE_PASTE_RBUTTON, uimsg, sizeof(uimsg));
641- get_lang_msg("DLG_TAB_COPYPASTE_MOUSEPASTE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
642- SetDlgItemText(IDC_DISABLE_PASTE_RBUTTON, ts.UIMsg);
643- GetDlgItemText(IDC_CONFIRM_PASTE_RBUTTON, uimsg, sizeof(uimsg));
644- get_lang_msg("DLG_TAB_COPYPASTE_CONFIRMPASTE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
645- SetDlgItemText(IDC_CONFIRM_PASTE_RBUTTON, ts.UIMsg);
646- GetDlgItemText(IDC_DISABLE_PASTE_MBUTTON, uimsg, sizeof(uimsg));
647- get_lang_msg("DLG_TAB_COPYPASTE_MOUSEPASTEM", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
648- SetDlgItemText(IDC_DISABLE_PASTE_MBUTTON, ts.UIMsg);
649- GetDlgItemText(IDC_SELECT_LBUTTON, uimsg, sizeof(uimsg));
650- get_lang_msg("DLG_TAB_COPYPASTE_SELECTLBUTTON", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
651- SetDlgItemText(IDC_SELECT_LBUTTON, ts.UIMsg);
652- GetDlgItemText(IDC_TRIMNLCHAR, uimsg, sizeof(uimsg));
653- get_lang_msg("DLG_TAB_COPYPASTE_TRIM_TRAILING_NL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
654- SetDlgItemText(IDC_TRIMNLCHAR, ts.UIMsg);
655- GetDlgItemText(IDC_NORMALIZE_LINEBREAK, uimsg, sizeof(uimsg));
656- get_lang_msg("DLG_TAB_COPYPASTE_NORMALIZE_LINEBREAK", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
657- SetDlgItemText(IDC_NORMALIZE_LINEBREAK, ts.UIMsg);
658- GetDlgItemText(IDC_CONFIRM_CHANGE_PASTE, uimsg, sizeof(uimsg));
659- get_lang_msg("DLG_TAB_COPYPASTE_CONFIRM_CHANGE_PASTE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
660- SetDlgItemText(IDC_CONFIRM_CHANGE_PASTE, ts.UIMsg);
661- GetDlgItemText(IDC_CONFIRM_STRING_FILE_LABEL, uimsg, sizeof(uimsg));
662- get_lang_msg("DLG_TAB_COPYPASTE_STRINGFILE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
663- SetDlgItemText(IDC_CONFIRM_STRING_FILE_LABEL, ts.UIMsg);
664- GetDlgItemText(IDC_DELIMITER, uimsg, sizeof(uimsg));
665- get_lang_msg("DLG_TAB_COPYPASTE_DELIMITER", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
666- SetDlgItemText(IDC_DELIMITER, ts.UIMsg);
667- GetDlgItemText(IDC_PASTEDELAY_LABEL, uimsg, sizeof(uimsg));
668- get_lang_msg("DLG_TAB_COPYPASTE_PASTEDELAY", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
669- SetDlgItemText(IDC_PASTEDELAY_LABEL, ts.UIMsg);
670- GetDlgItemText(IDC_PASTEDELAY_LABEL2, uimsg, sizeof(uimsg));
671- get_lang_msg("DLG_TAB_COPYPASTE_PASTEDELAY2", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
672- SetDlgItemText(IDC_PASTEDELAY_LABEL2, ts.UIMsg);
602+ SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), ts.UILanguageFile);
673603
674604 // (1)Enable continued-line copy
675605 btn = (CButton *)GetDlgItem(IDC_LINECOPY);
@@ -888,6 +818,7 @@
888818 }
889819
890820 BEGIN_MESSAGE_MAP(CVisualPropPageDlg, CPropertyPage)
821+ ON_WM_CTLCOLOR()
891822 END_MESSAGE_MAP()
892823
893824 // CVisualPropPageDlg メッセージ ハンドラ
@@ -895,11 +826,31 @@
895826 BOOL CVisualPropPageDlg::OnInitDialog()
896827 {
897828 char buf[MAXPATHLEN];
898- char uimsg[MAX_UIMSG];
899829 CListBox *listbox;
900830 CButton *btn;
901831 CComboBox *cmb;
902832 int i;
833+ static const DlgTextInfo TextInfos[] = {
834+ { IDC_ALPHABLEND, "DLG_TAB_VISUAL_ALPHA" },
835+ { IDC_ALPHA_BLEND_ACTIVE_LABEL, "DLG_TAB_VISUAL_ALPHA_ACTIVE_LABEL" },
836+ { IDC_ALPHA_BLEND_INACTIVE_LABEL, "DLG_TAB_VISUAL_ALPHA_INACTIVE_LABEL" },
837+ { IDC_ETERM_LOOKFEEL, "DLG_TAB_VISUAL_ETERM" },
838+ { IDC_BGIMG_CHECK, "DLG_TAB_VISUAL_BGIMG" },
839+ { IDC_BGIMG_BRIGHTNESS, "DLG_TAB_VISUAL_BGIMG_BRIGHTNESS" },
840+ { IDC_MOUSE, "DLG_TAB_VISUAL_MOUSE" },
841+ { IDC_FONT_QUALITY_LABEL, "DLG_TAB_VISUAL_FONT_QUALITY" },
842+ { IDC_ANSICOLOR, "DLG_TAB_VISUAL_ANSICOLOR" },
843+ { IDC_RED, "DLG_TAB_VISUAL_RED" },
844+ { IDC_GREEN, "DLG_TAB_VISUAL_GREEN" },
845+ { IDC_BLUE, "DLG_TAB_VISUAL_BLUE" },
846+ { IDC_ENABLE_ATTR_COLOR_BOLD, "DLG_TAB_VISUAL_BOLD" },
847+ { IDC_ENABLE_ATTR_COLOR_BLINK, "DLG_TAB_VISUAL_BLINK" },
848+ { IDC_ENABLE_ATTR_COLOR_REVERSE, "DLG_TAB_VISUAL_REVERSE" },
849+ { IDC_ENABLE_URL_COLOR, "DLG_TAB_VISUAL_URL" },
850+ { IDC_ENABLE_ANSI_COLOR, "DLG_TAB_VISUAL_ANSI" },
851+ { IDC_URL_UNDERLINE, "DLG_TAB_VISUAL_URLUL" },
852+ { IDC_RESTART, "DLG_TAB_VISUAL_RESTART" },
853+ };
903854
904855 CPropertyPage::OnInitDialog();
905856
@@ -907,7 +858,10 @@
907858 GetObject(font, sizeof(LOGFONT), &logfont);
908859 if (get_lang_font("DLG_TAHOMA_FONT", GetSafeHwnd(), &logfont, &DlgVisualFont, ts.UILanguageFile)) {
909860 SendDlgItemMessage(IDC_ALPHABLEND, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
910- SendDlgItemMessage(IDC_ALPHA_BLEND, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
861+ SendDlgItemMessage(IDC_ALPHA_BLEND_ACTIVE, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
862+ SendDlgItemMessage(IDC_ALPHA_BLEND_INACTIVE, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
863+ SendDlgItemMessage(IDC_ALPHA_BLEND_ACTIVE_LABEL, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
864+ SendDlgItemMessage(IDC_ALPHA_BLEND_INACTIVE_LABEL, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
911865 SendDlgItemMessage(IDC_ETERM_LOOKFEEL, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
912866 SendDlgItemMessage(IDC_MOUSE, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
913867 SendDlgItemMessage(IDC_MOUSE_CURSOR, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
@@ -939,57 +893,7 @@
939893 DlgVisualFont = NULL;
940894 }
941895
942- GetDlgItemText(IDC_ALPHABLEND, uimsg, sizeof(uimsg));
943- get_lang_msg("DLG_TAB_VISUAL_ALPHA", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
944- SetDlgItemText(IDC_ALPHABLEND, ts.UIMsg);
945- GetDlgItemText(IDC_ETERM_LOOKFEEL, uimsg, sizeof(uimsg));
946- get_lang_msg("DLG_TAB_VISUAL_ETERM", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
947- SetDlgItemText(IDC_ETERM_LOOKFEEL, ts.UIMsg);
948- GetDlgItemText(IDC_BGIMG_CHECK, uimsg, sizeof(uimsg));
949- get_lang_msg("DLG_TAB_VISUAL_BGIMG", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
950- SetDlgItemText(IDC_BGIMG_CHECK, ts.UIMsg);
951- GetDlgItemText(IDC_BGIMG_BRIGHTNESS, uimsg, sizeof(uimsg));
952- get_lang_msg("DLG_TAB_VISUAL_BGIMG_BRIGHTNESS", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
953- SetDlgItemText(IDC_BGIMG_BRIGHTNESS, ts.UIMsg);
954- GetDlgItemText(IDC_MOUSE, uimsg, sizeof(uimsg));
955- get_lang_msg("DLG_TAB_VISUAL_MOUSE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
956- SetDlgItemText(IDC_MOUSE, ts.UIMsg);
957- GetDlgItemText(IDC_FONT_QUALITY_LABEL, uimsg, sizeof(uimsg));
958- get_lang_msg("DLG_TAB_VISUAL_FONT_QUALITY", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
959- SetDlgItemText(IDC_FONT_QUALITY_LABEL, ts.UIMsg);
960- GetDlgItemText(IDC_ANSICOLOR, uimsg, sizeof(uimsg));
961- get_lang_msg("DLG_TAB_VISUAL_ANSICOLOR", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
962- SetDlgItemText(IDC_ANSICOLOR, ts.UIMsg);
963- GetDlgItemText(IDC_RED, uimsg, sizeof(uimsg));
964- get_lang_msg("DLG_TAB_VISUAL_RED", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
965- SetDlgItemText(IDC_RED, ts.UIMsg);
966- GetDlgItemText(IDC_GREEN, uimsg, sizeof(uimsg));
967- get_lang_msg("DLG_TAB_VISUAL_GREEN", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
968- SetDlgItemText(IDC_GREEN, ts.UIMsg);
969- GetDlgItemText(IDC_BLUE, uimsg, sizeof(uimsg));
970- get_lang_msg("DLG_TAB_VISUAL_BLUE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
971- SetDlgItemText(IDC_BLUE, ts.UIMsg);
972- GetDlgItemText(IDC_ENABLE_ATTR_COLOR_BOLD, uimsg, sizeof(uimsg));
973- get_lang_msg("DLG_TAB_VISUAL_BOLD", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
974- SetDlgItemText(IDC_ENABLE_ATTR_COLOR_BOLD, ts.UIMsg);
975- GetDlgItemText(IDC_ENABLE_ATTR_COLOR_BLINK, uimsg, sizeof(uimsg));
976- get_lang_msg("DLG_TAB_VISUAL_BLINK", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
977- SetDlgItemText(IDC_ENABLE_ATTR_COLOR_BLINK, ts.UIMsg);
978- GetDlgItemText(IDC_ENABLE_ATTR_COLOR_REVERSE, uimsg, sizeof(uimsg));
979- get_lang_msg("DLG_TAB_VISUAL_REVERSE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
980- SetDlgItemText(IDC_ENABLE_ATTR_COLOR_REVERSE, ts.UIMsg);
981- GetDlgItemText(IDC_ENABLE_URL_COLOR, uimsg, sizeof(uimsg));
982- get_lang_msg("DLG_TAB_VISUAL_URL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
983- SetDlgItemText(IDC_ENABLE_URL_COLOR, ts.UIMsg);
984- GetDlgItemText(IDC_ENABLE_ANSI_COLOR, uimsg, sizeof(uimsg));
985- get_lang_msg("DLG_TAB_VISUAL_ANSI", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
986- SetDlgItemText(IDC_ENABLE_ANSI_COLOR, ts.UIMsg);
987- GetDlgItemText(IDC_URL_UNDERLINE, uimsg, sizeof(uimsg));
988- get_lang_msg("DLG_TAB_VISUAL_URLUL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
989- SetDlgItemText(IDC_URL_UNDERLINE, ts.UIMsg);
990- GetDlgItemText(IDC_RESTART, uimsg, sizeof(uimsg));
991- get_lang_msg("DLG_TAB_VISUAL_RESTART", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
992- SetDlgItemText(IDC_RESTART, ts.UIMsg);
896+ SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), ts.UILanguageFile);
993897
994898 get_lang_msg("DLG_TAB_VISUAL_FONT_QUALITY_DEFAULT", ts.UIMsg, sizeof(ts.UIMsg), "Default", ts.UILanguageFile);
995899 SendDlgItemMessage(IDC_FONT_QUALITY, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg);
@@ -1001,8 +905,10 @@
1001905 SendDlgItemMessage(IDC_FONT_QUALITY, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg);
1002906
1003907 // (1)AlphaBlend
1004- _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%d", ts.AlphaBlend);
1005- SetDlgItemText(IDC_ALPHA_BLEND, buf);
908+ _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%d", ts.AlphaBlendActive);
909+ SetDlgItemText(IDC_ALPHA_BLEND_ACTIVE, buf);
910+ _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%d", ts.AlphaBlendInactive);
911+ SetDlgItemText(IDC_ALPHA_BLEND_INACTIVE, buf);
1006912
1007913 // (2)[BG] BGEnable
1008914 btn = (CButton *)GetDlgItem(IDC_ETERM_LOOKFEEL);
@@ -1043,11 +949,16 @@
1043949 }
1044950
1045951 // (3)Mouse cursor type
1046- listbox = (CListBox *)GetDlgItem(IDC_MOUSE_CURSOR);
952+ int sel = 0;
1047953 for (i = 0 ; MouseCursor[i].name ; i++) {
1048- listbox->InsertString(i, MouseCursor[i].name);
954+ const TCHAR *name = MouseCursor[i].name;
955+ SendDlgItemMessage(IDC_MOUSE_CURSOR, CB_ADDSTRING, 0, (LPARAM)name);
956+ if (_tcscmp(name, ts.MouseCursorName) == 0) {
957+ sel = i;
958+ }
1049959 }
1050- listbox->SelectString(0, ts.MouseCursorName);
960+ cmb = (CComboBox *)GetDlgItem(IDC_MOUSE_CURSOR);
961+ cmb->SetCurSel(sel);
1051962
1052963 // (4)Font quality
1053964 cmb = (CComboBox *)GetDlgItem(IDC_FONT_QUALITY);
@@ -1104,7 +1015,7 @@
11041015 btn->SetCheck((ts.FontFlag&FF_URLUNDERLINE) != 0);
11051016
11061017 // ダイアログにフォーカスを当てる
1107- ::SetFocus(::GetDlgItem(GetSafeHwnd(), IDC_ALPHA_BLEND));
1018+ ::SetFocus(::GetDlgItem(GetSafeHwnd(), IDC_ALPHA_BLEND_ACTIVE));
11081019
11091020 return FALSE;
11101021 }
@@ -1194,11 +1105,7 @@
11941105 sel = listbox->GetCurSel();
11951106 if (sel != -1) {
11961107 SetupRGBbox(GetSafeHwnd(), sel);
1197-#if 0
1198- SendMessage(WM_CTLCOLORSTATIC,
1199- (WPARAM)label_hdc,
1200- (LPARAM)GetDlgItem(IDC_SAMPLE_COLOR));
1201-#endif
1108+ GetDlgItem(IDC_SAMPLE_COLOR)->Invalidate(TRUE);
12021109 }
12031110 return TRUE;
12041111
@@ -1227,76 +1134,61 @@
12271134
12281135 // 255を超えたRGB値は補正されるので、それをEditに表示する (2007.2.18 maya)
12291136 SetupRGBbox(GetSafeHwnd(), sel);
1230-#if 0
1231- SendMessage(WM_CTLCOLORSTATIC,
1232- (WPARAM)label_hdc,
1233- (LPARAM)GetDlgItem(IDC_SAMPLE_COLOR));
1234-#endif
1137+
1138+ GetDlgItem(IDC_SAMPLE_COLOR)->Invalidate(TRUE);
12351139 }
12361140
12371141 return TRUE;
1238-#if 0
1239- case WM_CTLCOLORSTATIC:
1240- {
1241- HDC hDC = (HDC)wp;
1242- HWND hWnd = (HWND)lp;
1142+ }
12431143
1244- //if (label_hdc == NULL) {
1245- hDC = GetWindowDC(GetDlgItem(hDlgWnd, IDC_SAMPLE_COLOR));
1246- // label_hdc = hDC;
1247- //}
1144+ return CPropertyPage::OnCommand(wParam, lParam);
1145+}
12481146
1249- if ( hWnd == GetDlgItem(hDlgWnd, IDC_SAMPLE_COLOR) ) {
1250- BYTE r, g, b;
1147+HBRUSH CVisualPropPageDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
1148+{
1149+ if(pWnd->m_hWnd==GetDlgItem(IDC_SAMPLE_COLOR)->m_hWnd){
1150+ BYTE r, g, b;
1151+ char buf[8];
12511152
1252- hWnd = GetDlgItem(hDlgWnd, IDC_COLOR_RED);
1253- SendMessage(hWnd, WM_GETTEXT , sizeof(buf), (LPARAM)buf);
1254- r = atoi(buf);
1153+ GetDlgItemText(IDC_COLOR_RED, buf, sizeof(buf));
1154+ r = atoi(buf);
12551155
1256- hWnd = GetDlgItem(hDlgWnd, IDC_COLOR_GREEN);
1257- SendMessage(hWnd, WM_GETTEXT , sizeof(buf), (LPARAM)buf);
1258- g = atoi(buf);
1156+ GetDlgItemText(IDC_COLOR_GREEN, buf, sizeof(buf));
1157+ g = atoi(buf);
12591158
1260- hWnd = GetDlgItem(hDlgWnd, IDC_COLOR_BLUE);
1261- SendMessage(hWnd, WM_GETTEXT , sizeof(buf), (LPARAM)buf);
1262- b = atoi(buf);
1159+ GetDlgItemText(IDC_COLOR_BLUE, buf, sizeof(buf));
1160+ b = atoi(buf);
12631161
1264- OutputDebugPrintf("%06x\n", RGB(r, g, b));
1162+ pDC->SetBkMode(TRANSPARENT);
1163+ pDC->SetTextColor(RGB(r, g, b));
12651164
1266- SetBkMode(hDC, TRANSPARENT);
1267- SetTextColor(hDC, RGB(r, g, b) );
1268- ReleaseDC(hDlgWnd, hDC);
1269-
1270- return (BOOL)(HBRUSH)GetStockObject(NULL_BRUSH);
1271- }
1272- return FALSE;
1273- }
1274- break ;
1275-#endif
1165+ return (HBRUSH)GetStockObject(NULL_BRUSH);
12761166 }
1277-
1278- return CPropertyPage::OnCommand(wParam, lParam);
1167+ return CPropertyPage::OnCtlColor(pDC, pWnd, nCtlColor);
12791168 }
12801169
12811170 void CVisualPropPageDlg::OnOK()
12821171 {
1283- CListBox *listbox;
12841172 CButton *btn;
12851173 CComboBox *cmb;
12861174 int sel;
1287- int beforeAlphaBlend;
12881175 char buf[MAXPATHLEN];
12891176 COLORREF TmpColor;
12901177 int flag_changed = 0;
12911178
12921179 // (1)
1293- beforeAlphaBlend = ts.AlphaBlend;
1294- GetDlgItemText(IDC_ALPHA_BLEND, buf, sizeof(buf));
1180+ GetDlgItemText(IDC_ALPHA_BLEND_ACTIVE, buf, sizeof(buf));
12951181 if (isdigit(buf[0])) {
1296- ts.AlphaBlend = atoi(buf);
1297- ts.AlphaBlend = max(0, ts.AlphaBlend);
1298- ts.AlphaBlend = min(255, ts.AlphaBlend);
1182+ ts.AlphaBlendActive = atoi(buf);
1183+ ts.AlphaBlendActive = max(0, ts.AlphaBlendActive);
1184+ ts.AlphaBlendActive = min(255, ts.AlphaBlendActive);
12991185 }
1186+ GetDlgItemText(IDC_ALPHA_BLEND_INACTIVE, buf, sizeof(buf));
1187+ if (isdigit(buf[0])) {
1188+ ts.AlphaBlendInactive = atoi(buf);
1189+ ts.AlphaBlendInactive = max(0, ts.AlphaBlendInactive);
1190+ ts.AlphaBlendInactive = min(255, ts.AlphaBlendInactive);
1191+ }
13001192
13011193 // (2)
13021194 // グローバル変数 BGEnable を直接書き換えると、プログラムが落ちることが
@@ -1321,8 +1213,8 @@
13211213 }
13221214
13231215 // (3)
1324- listbox = (CListBox *)GetDlgItem(IDC_MOUSE_CURSOR);
1325- sel = listbox->GetCurSel();
1216+ cmb = (CComboBox *)GetDlgItem(IDC_MOUSE_CURSOR);
1217+ sel = cmb->GetCurSel();
13261218 if (sel >= 0 && sel < MOUSE_CURSOR_MAX) {
13271219 strncpy_s(ts.MouseCursorName, sizeof(ts.MouseCursorName), MouseCursor[sel].name, _TRUNCATE);
13281220 }
@@ -1402,17 +1294,6 @@
14021294 ts.FontFlag ^= FF_URLUNDERLINE;
14031295 }
14041296
1405- // 2006/03/11 by 337 : Alpha値も即時変更
1406- // Layered窓になっていない場合は効果が無い
1407- if (ts.EtermLookfeel.BGUseAlphaBlendAPI) {
1408- // 起動時に半透明レイヤにしていない場合でも、即座に半透明となるようにする。(2006.4.1 yutaka)
1409- //MySetLayeredWindowAttributes(HVTWin, 0, (ts.AlphaBlend > 255) ? 255: ts.AlphaBlend, LWA_ALPHA);
1410- // 値が変更されたときのみ設定を反映する。(2007.10.19 maya)
1411- if (ts.AlphaBlend != beforeAlphaBlend) {
1412- SetWindowStyle(&ts);
1413- }
1414- }
1415-
14161297 if (flag_changed) {
14171298 // re-launch
14181299 // RestartTeraTerm(GetSafeHwnd(), &ts);
@@ -1458,10 +1339,28 @@
14581339
14591340 BOOL CLogPropPageDlg::OnInitDialog()
14601341 {
1461- char uimsg[MAX_UIMSG];
14621342 CButton *btn;
14631343 CComboBox *combo;
14641344 int i, TmpLogRotateSize;
1345+ static const DlgTextInfo TextInfos[] = {
1346+ { IDC_VIEWLOG_LABEL, "DLG_TAB_LOG_EDITOR" },
1347+ { IDC_DEFAULTNAME_LABEL, "DLG_TAB_LOG_FILENAME" },
1348+ { IDC_DEFAULTPATH_LABEL, "DLG_TAB_LOG_FILEPATH" },
1349+ { IDC_AUTOSTART, "DLG_TAB_LOG_AUTOSTART" },
1350+ // Log rotate
1351+ { IDC_LOG_ROTATE, "DLG_TAB_LOG_ROTATE" },
1352+ { IDC_ROTATE_SIZE_TEXT, "DLG_TAB_LOG_ROTATE_SIZE_TEXT" },
1353+ { IDC_ROTATE_STEP_TEXT, "DLG_TAB_LOG_ROTATESTEP" },
1354+ // Log options
1355+ // FIXME: メッセージカタログは既存のログオプションのものを流用したが、アクセラレータキーが重複するかもしれない。
1356+ { IDC_LOG_OPTION_GROUP, "DLG_FOPT" },
1357+ { IDC_OPT_BINARY, "DLG_FOPT_BINARY" },
1358+ { IDC_OPT_APPEND, "DLG_FOPT_APPEND" },
1359+ { IDC_OPT_PLAINTEXT, "DLG_FOPT_PLAIN" },
1360+ { IDC_OPT_HIDEDLG, "DLG_FOPT_HIDEDIALOG" },
1361+ { IDC_OPT_INCBUF, "DLG_FOPT_ALLBUFFINFIRST" },
1362+ { IDC_OPT_TIMESTAMP, "DLG_FOPT_TIMESTAMP" },
1363+ };
14651364
14661365 CPropertyPage::OnInitDialog();
14671366
@@ -1499,51 +1398,7 @@
14991398 DlgLogFont = NULL;
15001399 }
15011400
1502- GetDlgItemText(IDC_VIEWLOG_LABEL, uimsg, sizeof(uimsg));
1503- get_lang_msg("DLG_TAB_LOG_EDITOR", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
1504- SetDlgItemText(IDC_VIEWLOG_LABEL, ts.UIMsg);
1505- GetDlgItemText(IDC_DEFAULTNAME_LABEL, uimsg, sizeof(uimsg));
1506- get_lang_msg("DLG_TAB_LOG_FILENAME", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
1507- SetDlgItemText(IDC_DEFAULTNAME_LABEL, ts.UIMsg);
1508- GetDlgItemText(IDC_DEFAULTPATH_LABEL, uimsg, sizeof(uimsg));
1509- get_lang_msg("DLG_TAB_LOG_FILEPATH", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
1510- SetDlgItemText(IDC_DEFAULTPATH_LABEL, ts.UIMsg);
1511- GetDlgItemText(IDC_AUTOSTART, uimsg, sizeof(uimsg));
1512- get_lang_msg("DLG_TAB_LOG_AUTOSTART", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
1513- SetDlgItemText(IDC_AUTOSTART, ts.UIMsg);
1514- // Log rotate
1515- GetDlgItemText(IDC_LOG_ROTATE, uimsg, sizeof(uimsg));
1516- get_lang_msg("DLG_TAB_LOG_ROTATE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
1517- SetDlgItemText(IDC_LOG_ROTATE, ts.UIMsg);
1518- GetDlgItemText(IDC_ROTATE_SIZE_TEXT, uimsg, sizeof(uimsg));
1519- get_lang_msg("DLG_TAB_LOG_ROTATE_SIZE_TEXT", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
1520- SetDlgItemText(IDC_ROTATE_SIZE_TEXT, ts.UIMsg);
1521- GetDlgItemText(IDC_ROTATE_STEP_TEXT, uimsg, sizeof(uimsg));
1522- get_lang_msg("DLG_TAB_LOG_ROTATESTEP", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
1523- SetDlgItemText(IDC_ROTATE_STEP_TEXT, ts.UIMsg);
1524- // Log options
1525- // FIXME: メッセージカタログは既存のログオプションのものを流用したが、アクセラレータキーが重複するかもしれない。
1526- GetDlgItemText(IDC_LOG_OPTION_GROUP, uimsg, sizeof(uimsg));
1527- get_lang_msg("DLG_FOPT", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
1528- SetDlgItemText(IDC_LOG_OPTION_GROUP, ts.UIMsg);
1529- GetDlgItemText(IDC_OPT_BINARY, uimsg, sizeof(uimsg));
1530- get_lang_msg("DLG_FOPT_BINARY", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
1531- SetDlgItemText(IDC_OPT_BINARY, ts.UIMsg);
1532- GetDlgItemText(IDC_OPT_APPEND, uimsg, sizeof(uimsg));
1533- get_lang_msg("DLG_FOPT_APPEND", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
1534- SetDlgItemText(IDC_OPT_APPEND, ts.UIMsg);
1535- GetDlgItemText(IDC_OPT_PLAINTEXT, uimsg, sizeof(uimsg));
1536- get_lang_msg("DLG_FOPT_PLAIN", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
1537- SetDlgItemText(IDC_OPT_PLAINTEXT, ts.UIMsg);
1538- GetDlgItemText(IDC_OPT_HIDEDLG, uimsg, sizeof(uimsg));
1539- get_lang_msg("DLG_FOPT_HIDEDIALOG", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
1540- SetDlgItemText(IDC_OPT_HIDEDLG, ts.UIMsg);
1541- GetDlgItemText(IDC_OPT_INCBUF, uimsg, sizeof(uimsg));
1542- get_lang_msg("DLG_FOPT_ALLBUFFINFIRST", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
1543- SetDlgItemText(IDC_OPT_INCBUF, ts.UIMsg);
1544- GetDlgItemText(IDC_OPT_TIMESTAMP, uimsg, sizeof(uimsg));
1545- get_lang_msg("DLG_FOPT_TIMESTAMP", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
1546- SetDlgItemText(IDC_OPT_TIMESTAMP, ts.UIMsg);
1401+ SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), ts.UILanguageFile);
15471402
15481403 get_lang_msg("DLG_FOPT_TIMESTAMP_LOCAL", ts.UIMsg, sizeof(ts.UIMsg), "Local Time", ts.UILanguageFile);
15491404 SendDlgItemMessage(IDC_OPT_TIMESTAMP_TYPE, CB_ADDSTRING, 0, (LPARAM)ts.UIMsg);
@@ -1897,8 +1752,10 @@
18971752
18981753 BOOL CCygwinPropPageDlg::OnInitDialog()
18991754 {
1900- char uimsg[MAX_UIMSG];
19011755 CButton *btn;
1756+ static const DlgTextInfo TextInfos[] = {
1757+ { IDC_CYGWIN_PATH_LABEL, "DLG_TAB_CYGWIN_PATH" }
1758+ };
19021759
19031760 CPropertyPage::OnInitDialog();
19041761
@@ -1931,9 +1788,7 @@
19311788 DlgCygwinFont = NULL;
19321789 }
19331790
1934- GetDlgItemText(IDC_CYGWIN_PATH_LABEL, uimsg, sizeof(uimsg));
1935- get_lang_msg("DLG_TAB_CYGWIN_PATH", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
1936- SetDlgItemText(IDC_CYGWIN_PATH_LABEL, ts.UIMsg);
1791+ SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), ts.UILanguageFile);
19371792
19381793 memcpy(&settings, &ts.CygtermSettings, sizeof(cygterm_t));
19391794
--- branches/transparent-window/teraterm/teraterm/addsetting.h (revision 7247)
+++ branches/transparent-window/teraterm/teraterm/addsetting.h (revision 7248)
@@ -1,5 +1,5 @@
11 /*
2- * (C) 2008-2017 TeraTerm Project
2+ * (C) 2008-2018 TeraTerm Project
33 * All rights reserved.
44 *
55 * Redistribution and use in source and binary forms, with or without
@@ -33,12 +33,12 @@
3333
3434
3535 typedef struct {
36- char *name;
36+ const char *name;
3737 LPCTSTR id;
3838 } mouse_cursor_t;
3939
40+extern const mouse_cursor_t MouseCursor[];
4041
41-
4242 // General Page
4343 class CGeneralPropPageDlg : public CPropertyPage
4444 {
@@ -133,6 +133,7 @@
133133
134134 protected:
135135 DECLARE_MESSAGE_MAP()
136+ virtual HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
136137 virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
137138 };
138139
--- branches/transparent-window/teraterm/teraterm/teraterm.cpp (revision 7247)
+++ branches/transparent-window/teraterm/teraterm/teraterm.cpp (revision 7248)
@@ -45,6 +45,7 @@
4545 #include "tekwin.h"
4646 #include "ttdde.h"
4747 #include "keyboard.h"
48+#include "compat_win.h"
4849
4950 #include "teraapp.h"
5051
@@ -94,6 +95,7 @@
9495 BOOL CTeraApp::InitInstance()
9596 {
9697 hInst = m_hInstance;
98+ WinCompatInit();
9799 m_pMainWnd = new CVTWindow();
98100 pVTWin = m_pMainWnd;
99101 return TRUE;
--- branches/transparent-window/teraterm/teraterm/vtdisp.c (revision 7247)
+++ branches/transparent-window/teraterm/teraterm/vtdisp.c (revision 7248)
@@ -36,6 +36,7 @@
3636 #include "ttime.h"
3737 #include "ttdialog.h"
3838 #include "ttcommon.h"
39+#include "compat_win.h"
3940
4041 #include "vtdisp.h"
4142
@@ -154,17 +155,17 @@
154155 char fileTmp[MAX_PATH];
155156 }BGSrc;
156157
157-BGSrc BGDest;
158-BGSrc BGSrc1;
159-BGSrc BGSrc2;
158+static BGSrc BGDest;
159+static BGSrc BGSrc1;
160+static BGSrc BGSrc2;
160161
161162 int BGEnable;
162-int BGReverseTextAlpha;
163-int BGUseAlphaBlendAPI;
163+static int BGReverseTextAlpha;
164+static int BGUseAlphaBlendAPI;
164165 BOOL BGNoFrame;
165-BOOL BGFastSizeMove;
166+static BOOL BGFastSizeMove;
166167
167-char BGSPIPath[MAX_PATH];
168+static char BGSPIPath[MAX_PATH];
168169
169170 COLORREF BGVTColor[2];
170171 COLORREF BGVTBoldColor[2];
@@ -181,9 +182,9 @@
181182 BOOL BGInSizeMove;
182183 HBRUSH BGBrushInSizeMove;
183184
184-HDC hdcBGWork;
185-HDC hdcBGBuffer;
186-HDC hdcBG;
185+static HDC hdcBGWork;
186+static HDC hdcBGBuffer;
187+static HDC hdcBG;
187188
188189 typedef struct tagWallpaperInfo
189190 {
@@ -191,17 +192,7 @@
191192 int pattern;
192193 }WallpaperInfo;
193194
194-typedef struct _BGBLENDFUNCTION
195-{
196- BYTE BlendOp;
197- BYTE BlendFlags;
198- BYTE SourceConstantAlpha;
199- BYTE AlphaFormat;
200-}BGBLENDFUNCTION;
201-
202-BOOL (WINAPI *BGAlphaBlend)(HDC,int,int,int,int,HDC,int,int,int,int,BGBLENDFUNCTION);
203-BOOL (WINAPI *BGEnumDisplayMonitors)(HDC,LPCRECT,MONITORENUMPROC,LPARAM);
204-
195+static BOOL (WINAPI *BGAlphaBlend)(HDC,int,int,int,int,HDC,int,int,int,int,BLENDFUNCTION);
205196 static HBITMAP GetBitmapHandle(char *File);
206197
207198
@@ -217,20 +208,6 @@
217208 return !IsWindowsVistaOrLater();
218209 }
219210
220-
221-void dprintf(char *format, ...)
222-{
223- va_list args;
224- char buffer[1024];
225-
226- va_start(args,format);
227-
228- _vsnprintf_s(buffer,sizeof(buffer),_TRUNCATE,format,args);
229- strncat_s(buffer,sizeof(buffer),"\n",_TRUNCATE);
230-
231- OutputDebugString(buffer);
232-}
233-
234211 HBITMAP CreateScreenCompatibleBitmap(int width,int height)
235212 {
236213 HDC hdc;
@@ -237,7 +214,7 @@
237214 HBITMAP hbm;
238215
239216 #ifdef _DEBUG
240- dprintf("CreateScreenCompatibleBitmap : width = %d height = %d",width,height);
217+ OutputDebugPrintf("CreateScreenCompatibleBitmap : width = %d height = %d\n",width,height);
241218 #endif
242219
243220 hdc = GetDC(NULL);
@@ -248,7 +225,7 @@
248225
249226 #ifdef _DEBUG
250227 if(!hbm)
251- dprintf("CreateScreenCompatibleBitmap : fail in CreateCompatibleBitmap");
228+ OutputDebugPrintf("CreateScreenCompatibleBitmap : fail in CreateCompatibleBitmap\n");
252229 #endif
253230
254231 return hbm;
@@ -261,7 +238,7 @@
261238 BITMAPINFO bmi;
262239
263240 #ifdef _DEBUG
264- dprintf("CreateDIB24BPP : width = %d height = %d",width,height);
241+ OutputDebugPrintf("CreateDIB24BPP : width = %d height = %d\n",width,height);
265242 #endif
266243
267244 if(!width || !height)
@@ -293,7 +270,7 @@
293270 HDC hdc;
294271
295272 #ifdef _DEBUG
296- dprintf("CreateBitmapDC : hbm = %x",hbm);
273+ OutputDebugPrintf("CreateBitmapDC : hbm = %x\n",hbm);
297274 #endif
298275
299276 hdc = CreateCompatibleDC(NULL);
@@ -309,7 +286,7 @@
309286 HBITMAP hbm;
310287
311288 #ifdef _DEBUG
312- dprintf("DeleteBitmapDC : *hdc = %x",hdc);
289+ OutputDebugPrintf("DeleteBitmapDC : *hdc = %x\n",hdc);
313290 #endif
314291
315292 if(!hdc)
@@ -335,7 +312,7 @@
335312 HBRUSH hBrush;
336313
337314 #ifdef _DEBUG
338- dprintf("FillBitmapDC : hdc = %x color = %x",hdc,color);
315+ OutputDebugPrintf("FillBitmapDC : hdc = %x color = %x\n",hdc,color);
339316 #endif
340317
341318 if(!hdc)
@@ -362,7 +339,7 @@
362339 return 0;
363340 }
364341
365-void RandomFile(char *filespec_src,char *filename, int destlen)
342+static void RandomFile(const TCHAR *filespec_src, TCHAR *filename, int destlen)
366343 {
367344 int i;
368345 int file_num;
@@ -372,6 +349,7 @@
372349 HANDLE hFind;
373350 WIN32_FIND_DATA fd;
374351
352+ filename[0] = 0;
375353 ExpandEnvironmentStrings(filespec_src, filespec, sizeof(filespec));
376354
377355 //絶対パスに変換
@@ -435,13 +413,18 @@
435413 strncat_s(filename,destlen,fd.cFileName,_TRUNCATE);
436414 }
437415
416+// Susie Plug-in
438417 BOOL LoadPictureWithSPI(char *nameSPI,char *nameFile,unsigned char *bufFile,long sizeFile,HLOCAL *hbuf,HLOCAL *hbmi)
439418 {
440419 HINSTANCE hSPI;
441420 char spiVersion[8];
442- int (PASCAL *SPI_IsSupported)(LPSTR,DWORD);
443- int (PASCAL *SPI_GetPicture)(LPSTR,long,unsigned int,HANDLE *,HANDLE *,FARPROC,long);
444- int (PASCAL *SPI_GetPluginInfo)(int,LPSTR,int);
421+ typedef int (WINAPI *SPI_GetPluginInfo_t)(int infono, LPSTR buf, int buflen);
422+ typedef int (WINAPI *SPI_IsSupported_t)(LPSTR filename, DWORD dw);
423+ typedef int (WINAPI *SPI_GetPicture_t)(LPSTR buf, long len, unsigned int flag, HANDLE *pHBInfo, HANDLE *pHBm, FARPROC lpPrgressCallback, long lData);
424+
425+ SPI_GetPluginInfo_t SPI_GetPluginInfo;
426+ SPI_IsSupported_t SPI_IsSupported;
427+ SPI_GetPicture_t SPI_GetPicture;
445428 int ret;
446429
447430 ret = FALSE;
@@ -453,9 +436,9 @@
453436 if(!hSPI)
454437 goto error;
455438
456- (FARPROC)SPI_GetPluginInfo = GetProcAddress(hSPI,"GetPluginInfo");
457- (FARPROC)SPI_IsSupported = GetProcAddress(hSPI,"IsSupported");
458- (FARPROC)SPI_GetPicture = GetProcAddress(hSPI,"GetPicture");
439+ SPI_GetPluginInfo = (SPI_GetPluginInfo_t)GetProcAddress(hSPI,"GetPluginInfo");
440+ SPI_IsSupported = (SPI_IsSupported_t)GetProcAddress(hSPI,"IsSupported");
441+ SPI_GetPicture = (SPI_GetPicture_t)GetProcAddress(hSPI,"GetPicture");
459442
460443 if(!SPI_GetPluginInfo || !SPI_IsSupported || !SPI_GetPicture)
461444 goto error;
@@ -529,7 +512,7 @@
529512 return TRUE;
530513 }
531514
532-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)
515+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)
533516 {
534517 HDC hdcDestWork,hdcSrcWork;
535518 int i,invAlpha,alpha;
@@ -571,7 +554,7 @@
571554 char filespec[MAX_PATH];
572555 char *filePart;
573556 int fileSize;
574- int readByte;
557+ DWORD readByte;
575558 unsigned char *fileBuf;
576559
577560 HBITMAP hbm;
@@ -580,7 +563,7 @@
580563 WIN32_FIND_DATA fd;
581564
582565 #ifdef _DEBUG
583- dprintf("Preload Picture : %s",src->file);
566+ OutputDebugPrintf("Preload Picture : %s\n",src->file);
584567 #endif
585568
586569 //ファイルを読み込む
@@ -677,7 +660,7 @@
677660
678661 void BGGetWallpaperInfo(WallpaperInfo *wi)
679662 {
680- int length;
663+ DWORD length;
681664 int style;
682665 int tile;
683666 char str[256];
@@ -897,10 +880,6 @@
897880
898881 BGGetWallpaperInfo(&wi);
899882
900-#ifdef DEBUG_XP
901- strcpy(wi.filename, "c:\\usr\\ttssh2\\1011_01.jpg");
902-#endif
903-
904883 if (IsLoadImageOnlyEnabled()) {
905884 //壁紙を読み込み
906885 //LR_CREATEDIBSECTION を指定するのがコツ
@@ -920,12 +899,6 @@
920899 goto createdc;
921900 }
922901
923-#ifdef DEBUG_XP
924- //wi.pattern = BG_STRETCH;
925- //wi.pattern = BG_FIT_WIDTH;
926- //wi.pattern = BG_FIT_HEIGHT;
927-#endif
928-
929902 GetObject(hbm,sizeof(bm),&bm);
930903 // 壁紙の設定に合わせて、画像のストレッチサイズを決める。
931904 if (wi.pattern == BG_STRETCH) {
@@ -1203,9 +1176,9 @@
12031176 lws.src = src;
12041177 lws.hdcDest = hdcDest;
12051178
1206- if(BGEnumDisplayMonitors)
1179+ if(pEnumDisplayMonitors != NULL)
12071180 {
1208- (*BGEnumDisplayMonitors)(NULL,NULL,BGLoadWallpaperEnumFunc,(LPARAM)&lws);
1181+ (*pEnumDisplayMonitors)(NULL,NULL,BGLoadWallpaperEnumFunc,(LPARAM)&lws);
12091182 }else{
12101183 RECT rectMonitor;
12111184
@@ -1257,7 +1230,7 @@
12571230 CopyRect(&BGPrevRect,&rect);
12581231
12591232 #ifdef _DEBUG
1260- dprintf("BGSetupPrimary : BGInSizeMove = %d",BGInSizeMove);
1233+ OutputDebugPrintf("BGSetupPrimary : BGInSizeMove = %d\n",BGInSizeMove);
12611234 #endif
12621235
12631236 //作業用 DC 作成
@@ -1272,7 +1245,7 @@
12721245
12731246 if(!BGInSizeMove)
12741247 {
1275- BGBLENDFUNCTION bf;
1248+ BLENDFUNCTION bf;
12761249 HDC hdcSrc = NULL;
12771250
12781251 //背景 HDC
@@ -1304,7 +1277,7 @@
13041277 }
13051278 }
13061279
1307-COLORREF BGGetColor(char *name,COLORREF defcolor,char *file)
1280+COLORREF BGGetColor(const char *name,COLORREF defcolor,char *file)
13081281 {
13091282 unsigned int r,g,b;
13101283 char colorstr[256],defstr[256];
@@ -1320,7 +1293,7 @@
13201293 return RGB(r,g,b);
13211294 }
13221295
1323-BG_PATTERN BGGetStrIndex(char *name,BG_PATTERN def,char *file,char **strList,int nList)
1296+BG_PATTERN BGGetStrIndex(char *name,BG_PATTERN def,char *file,const char *strList[],int nList)
13241297 {
13251298 char defstr[64],str[64];
13261299 int i;
@@ -1339,7 +1312,7 @@
13391312
13401313 BOOL BGGetOnOff(char *name,BOOL def,char *file)
13411314 {
1342- char *strList[2] = {"Off","On"};
1315+ const static char *strList[2] = {"Off","On"};
13431316
13441317 return BGGetStrIndex(name,def,file,strList,2);
13451318 }
@@ -1346,7 +1319,7 @@
13461319
13471320 BG_PATTERN BGGetPattern(char *name,BG_PATTERN def,char *file)
13481321 {
1349- char *strList[6]={"stretch","tile","center","fitwidth","fitheight","autofit"};
1322+ const static char *strList[6]={"stretch","tile","center","fitwidth","fitheight","autofit"};
13501323
13511324 return BGGetStrIndex(name,def,file,strList,6);
13521325 }
@@ -1353,7 +1326,7 @@
13531326
13541327 BG_PATTERN BGGetType(char *name,BG_TYPE def,char *file)
13551328 {
1356- char *strList[3]={"color","picture","wallpaper"};
1329+ const static char *strList[3]={"color","picture","wallpaper"};
13571330
13581331 return BGGetStrIndex(name,def,file,strList,3);
13591332 }
@@ -1472,7 +1445,6 @@
14721445 void BGInitialize(void)
14731446 {
14741447 char path[MAX_PATH],config_file[MAX_PATH],tempPath[MAX_PATH];
1475- char msimg32_dll[MAX_PATH],user32_dll[MAX_PATH];
14761448
14771449 // VTColor を読み込み
14781450 BGVTColor[0] = ts.VTColor[0];
@@ -1550,11 +1522,6 @@
15501522 BGFastSizeMove = ts.EtermLookfeel.BGFastSizeMove;
15511523 BGNoCopyBits = ts.EtermLookfeel.BGNoCopyBits;
15521524
1553-#if 0
1554- GetPrivateProfileString(BG_SECTION,"BGSPIPath","plugin",BGSPIPath,MAX_PATH,ts.SetupFName);
1555- strncpy_s(ts.EtermLookfeel.BGSPIPath, sizeof(ts.EtermLookfeel.BGSPIPath), BGSPIPath, _TRUNCATE);
1556-#endif
1557-
15581525 //テンポラリーファイル名を生成
15591526 GetTempPath(MAX_PATH,tempPath);
15601527 GetTempFileName(tempPath,"ttAK",0,BGDest.fileTmp);
@@ -1618,9 +1585,7 @@
16181585
16191586 // AlphaBlend のアドレスを読み込み
16201587 if(BGUseAlphaBlendAPI) {
1621- GetSystemDirectory(msimg32_dll, sizeof(msimg32_dll));
1622- strncat_s(msimg32_dll, sizeof(msimg32_dll), "\\msimg32.dll", _TRUNCATE);
1623- (FARPROC)BGAlphaBlend = GetProcAddressWithDllName(msimg32_dll,"AlphaBlend");
1588+ BGAlphaBlend = pAlphaBlend;
16241589 }
16251590 else {
16261591 BGAlphaBlend = NULL;
@@ -1628,11 +1593,6 @@
16281593
16291594 if(!BGAlphaBlend)
16301595 BGAlphaBlend = AlphaBlendWithoutAPI;
1631-
1632- //EnumDisplayMonitors を探す
1633- GetSystemDirectory(user32_dll, sizeof(user32_dll));
1634- strncat_s(user32_dll, sizeof(user32_dll), "\\user32.dll", _TRUNCATE);
1635- (FARPROC)BGEnumDisplayMonitors = GetProcAddressWithDllName(user32_dll,"EnumDisplayMonitors");
16361596 }
16371597
16381598 void BGExchangeColor() {
@@ -2517,8 +2477,8 @@
25172477 ANSIColor[IdBack ] = ts.VTColor[1];
25182478
25192479 #ifdef ALPHABLEND_TYPE2
2520- ANSIColor[IdFore ] = BGVTColor[0];
2521- ANSIColor[IdBack ] = BGVTColor[1];
2480+ ANSIColor[IdFore ] = BGVTColor[0];
2481+ ANSIColor[IdBack ] = BGVTColor[1];
25222482 #endif // ALPHABLEND_TYPE2
25232483
25242484 }
@@ -2818,7 +2778,7 @@
28182778 {
28192779 if(BGReverseTextAlpha < 255)
28202780 {
2821- BGBLENDFUNCTION bf;
2781+ BLENDFUNCTION bf;
28222782 HBRUSH hbr;
28232783
28242784 hbr = CreateSolidBrush(GetBkColor(hdcBGBuffer));
--- branches/transparent-window/teraterm/teraterm/vtwin.cpp (revision 7247)
+++ branches/transparent-window/teraterm/teraterm/vtwin.cpp (revision 7248)
@@ -78,6 +78,7 @@
7878 #include "winjump.h"
7979 #include "sizetip.h"
8080 #include "dnddlg.h"
81+#include "compat_win.h"
8182
8283 #include "initguid.h"
8384 //#include "Usbiodef.h"
@@ -114,9 +115,6 @@
114115
115116 static int AutoDisconnectedPort = -1;
116117
117-// 本体は addsetting.cpp
118-extern mouse_cursor_t MouseCursor[];
119-
120118 /////////////////////////////////////////////////////////////////////////////
121119 // CVTWindow
122120
@@ -259,36 +257,8 @@
259257 //}}AFX_MSG_MAP
260258 END_MESSAGE_MAP()
261259
262-static BOOL MySetLayeredWindowAttributes(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags)
263-{
264- typedef BOOL (WINAPI *func)(HWND,COLORREF,BYTE,DWORD);
265- static HMODULE g_hmodUser32 = NULL;
266- static func g_pSetLayeredWindowAttributes = NULL;
267- char user32_dll[MAX_PATH];
268-
269- GetSystemDirectory(user32_dll, sizeof(user32_dll));
270- strncat_s(user32_dll, sizeof(user32_dll), "\\user32.dll", _TRUNCATE);
271- if (g_hmodUser32 == NULL) {
272- g_hmodUser32 = LoadLibrary(user32_dll);
273- if (g_hmodUser32 == NULL) {
274- return FALSE;
275- }
276-
277- g_pSetLayeredWindowAttributes =
278- (func)GetProcAddress(g_hmodUser32, "SetLayeredWindowAttributes");
279- }
280-
281- if (g_pSetLayeredWindowAttributes == NULL) {
282- return FALSE;
283- }
284-
285- return g_pSetLayeredWindowAttributes(hwnd, crKey,
286- bAlpha, dwFlags);
287-}
288-
289-
290260 // Tera Term起動時とURL文字列mouse over時に呼ばれる (2005.4.2 yutaka)
291-void SetMouseCursor(char *cursor)
261+static void SetMouseCursor(const char *cursor)
292262 {
293263 HCURSOR hc;
294264 LPCTSTR name = NULL;
@@ -312,32 +282,36 @@
312282 }
313283 }
314284
315-
316-void SetWindowStyle(TTTSet *ts)
285+/**
286+ * @param[in] alpha 0-255
287+ */
288+void CVTWindow::SetWindowAlpha(BYTE alpha)
317289 {
318- LONG_PTR lp;
290+ if (pSetLayeredWindowAttributes == NULL) {
291+ return; // レイヤードウインドウのサポートなし
292+ }
293+ if (Alpha == alpha) {
294+ return; // 変化なしなら何もしない
295+ }
296+ LONG_PTR lp = GetWindowLongPtr(HVTWin, GWL_EXSTYLE);
297+ if (lp == 0) {
298+ return;
299+ }
319300
320- SetMouseCursor(ts->MouseCursorName);
321-
322301 // 2006/03/16 by 337: BGUseAlphaBlendAPIがOnならばLayered属性とする
323302 //if (ts->EtermLookfeel.BGUseAlphaBlendAPI) {
324303 // アルファ値が255の場合、画面のちらつきを抑えるため何もしないこととする。(2006.4.1 yutaka)
325304 // 呼び出し元で、値が変更されたときのみ設定を反映する。(2007.10.19 maya)
326- if (ts->AlphaBlend < 255) {
327- lp = GetWindowLongPtr(HVTWin, GWL_EXSTYLE);
328- if (lp != 0) {
329- SetWindowLongPtr(HVTWin, GWL_EXSTYLE, lp | WS_EX_LAYERED);
330- MySetLayeredWindowAttributes(HVTWin, 0, ts->AlphaBlend, LWA_ALPHA);
331- }
305+ if (alpha < 255) {
306+ SetWindowLongPtr(HVTWin, GWL_EXSTYLE, lp | WS_EX_LAYERED);
307+ pSetLayeredWindowAttributes(HVTWin, 0, alpha, LWA_ALPHA);
332308 }
333- // アルファ値が 255 の場合、透明化属性を削除して再描画する。(2007.10.22 maya)
334309 else {
335- lp = GetWindowLongPtr(HVTWin, GWL_EXSTYLE);
336- if (lp != 0) {
337- SetWindowLongPtr(HVTWin, GWL_EXSTYLE, lp & ~WS_EX_LAYERED);
338- RedrawWindow(HVTWin, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_FRAME);
339- }
310+ // アルファ値が 255 の場合、透明化属性を削除して再描画する。(2007.10.22 maya)
311+ SetWindowLongPtr(HVTWin, GWL_EXSTYLE, lp & ~WS_EX_LAYERED);
312+ ::RedrawWindow(HVTWin, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_FRAME);
340313 }
314+ Alpha = alpha;
341315 }
342316
343317 void RegDeviceNotify(HWND hWnd)
@@ -385,7 +359,8 @@
385359 // (2007.9.30 yutaka)
386360 //
387361 // 例外コードを文字列へ変換する
388-static char *GetExceptionString(int exception)
362+#if !defined(_M_X64)
363+static const char *GetExceptionString(DWORD exception)
389364 {
390365 #define EXCEPTION(x) case EXCEPTION_##x: return (#x);
391366 static char buf[16];
@@ -574,6 +549,7 @@
574549 // return (EXCEPTION_EXECUTE_HANDLER); /* そのままプロセスを終了させる */
575550 return (EXCEPTION_CONTINUE_SEARCH); /* 引き続き[アプリケーションエラー]ポップアップメッセージボックスを呼び出す */
576551 }
552+#endif
577553
578554
579555 // Virtual Storeが有効であるかどうかを判別する。
@@ -669,7 +645,6 @@
669645 #ifdef ALPHABLEND_TYPE2
670646 DWORD ExStyle;
671647 #endif
672- char *Param;
673648 int CmdShow;
674649 #ifdef SHARED_KEYMAP
675650 char Temp[MAX_PATH];
@@ -679,11 +654,13 @@
679654 BOOL isFirstInstance;
680655
681656 #ifdef _DEBUG
682- ::_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
657+ ::_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
683658 #endif
684659
685660 // 例外ハンドラのフック (2007.9.30 yutaka)
661+#if !defined(_M_X64)
686662 SetUnhandledExceptionFilter(ApplicationFaultHandler);
663+#endif
687664
688665 CommInit(&cv);
689666 isFirstInstance = StartTeraTerm(&ts);
@@ -753,8 +730,8 @@
753730 /* Parse command line parameters*/
754731 // 256バイト以上のコマンドラインパラメータ指定があると、BOF(Buffer Over Flow)で
755732 // 落ちるバグを修正。(2007.6.12 maya)
756- Param = GetCommandLine();
757733 if (LoadTTSET()) {
734+ LPTSTR Param = GetCommandLine();
758735 (*ParseParam)(Param, &ts, &(TopicName[0]));
759736 }
760737 FreeTTSET();
@@ -779,6 +756,7 @@
779756 Hold = FALSE;
780757 FirstPaint = TRUE;
781758 ScrollLock = FALSE; // 初期値は無効 (2006.11.14 yutaka)
759+ Alpha = 255;
782760
783761 /* Initialize scroll buffer */
784762 InitBuffer();
@@ -838,7 +816,8 @@
838816 SerialNo = RegWin(HVTWin,NULL);
839817
840818 logfile_lock_initialize();
841- SetWindowStyle(&ts);
819+ SetMouseCursor(ts.MouseCursorName);
820+ SetWindowAlpha(ts.AlphaBlendActive);
842821 // ロケールの設定
843822 // wctomb のため
844823 setlocale(LC_ALL, ts.Locale);
@@ -1033,7 +1012,8 @@
10331012 return;
10341013 }
10351014
1036- if (mousereport = MouseReport(IdMouseEventBtnDown, LMR, p.x, p.y)) {
1015+ mousereport = MouseReport(IdMouseEventBtnDown, LMR, p.x, p.y);
1016+ if (mousereport) {
10371017 SetCapture();
10381018 return;
10391019 }
@@ -1644,7 +1624,7 @@
16441624 //
16451625 // AlphaBlend を即時反映できるようにする。
16461626 // (2016.12.24 yutaka)
1647- SetWindowStyle(&ts);
1627+ SetWindowAlpha(ts.AlphaBlendActive);
16481628 #else
16491629 DispApplyANSIColor();
16501630 #endif
@@ -1773,7 +1753,7 @@
17731753 else if ((ts.HideTitle>0) &&
17741754 (message == WM_NCHITTEST)) {
17751755 Result = CFrameWnd::DefWindowProc(message,wParam,lParam);
1776- if ((Result==HTCLIENT) && AltKey())
1756+ if ((Result==HTCLIENT) && AltKey()) {
17771757 #ifdef ALPHABLEND_TYPE2
17781758 if(ShiftKey())
17791759 Result = HTBOTTOMRIGHT;
@@ -1782,6 +1762,7 @@
17821762 #else
17831763 Result = HTCAPTION;
17841764 #endif
1765+ }
17851766 return Result;
17861767 }
17871768
@@ -1877,6 +1858,11 @@
18771858 void CVTWindow::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
18781859 {
18791860 DispSetActive(nState!=WA_INACTIVE);
1861+ if (nState == WA_INACTIVE) {
1862+ SetWindowAlpha(ts.AlphaBlendInactive);
1863+ } else {
1864+ SetWindowAlpha(ts.AlphaBlendActive);
1865+ }
18801866 }
18811867
18821868 void CVTWindow::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
@@ -1913,7 +1899,7 @@
19131899 }
19141900
19151901 /* copy from ttset.c*/
1916-static void WriteInt2(PCHAR Sect, PCHAR Key, PCHAR FName, int i1, int i2)
1902+static void WriteInt2(const char *Sect, const char *Key, const char *FName, int i1, int i2)
19171903 {
19181904 char Temp[32];
19191905 _snprintf_s(Temp, sizeof(Temp), _TRUNCATE, "%d,%d", i1, i2);
@@ -1971,7 +1957,7 @@
19711957 }
19721958
19731959 // 終了問い合わせなしにTera Termを終了する。OnAllClose()受信用。
1974-LONG CVTWindow::OnNonConfirmClose(UINT wParam, LONG lParam)
1960+LRESULT CVTWindow::OnNonConfirmClose(WPARAM wParam, LPARAM lParam)
19751961 {
19761962 // ここで ts の内容を意図的に書き換えても、終了時に自動セーブされるわけではないので、特に問題なし。
19771963 ts.PortFlag &= ~PF_CONFIRMDISCONN;
@@ -2085,7 +2071,8 @@
20852071 char msg[128];
20862072
20872073 if (h == NULL) {
2088- if ( ((h = GetModuleHandle("ttxssh.dll")) == NULL) ) {
2074+ h = GetModuleHandle("ttxssh.dll");
2075+ if (h == NULL) {
20892076 _snprintf_s(msg, sizeof(msg), _TRUNCATE, "GetModuleHandle(\"ttxssh.dll\")) %d", GetLastError());
20902077 scp_send_error:
20912078 ::MessageBox(NULL, msg, "Tera Term: scpsend command error", MB_OK | MB_ICONERROR);
@@ -2120,7 +2107,7 @@
21202107 }
21212108 }
21222109
2123-LONG CVTWindow::OnDropNotify(UINT ShowDialog, LONG lParam)
2110+LRESULT CVTWindow::OnDropNotify(WPARAM ShowDialog, LPARAM lParam)
21242111 {
21252112 // iniに保存されない、今実行しているTera Termでのみ有効な設定
21262113 static enum drop_type DefaultDropType = DROP_TYPE_CANCEL;
@@ -2133,7 +2120,7 @@
21332120 for (int i = 0; i < DropListCount; i++) {
21342121 const char *FileName = DropLists[i];
21352122 const DWORD attr = GetFileAttributes(FileName);
2136- if (attr == -1 ) {
2123+ if (attr == (DWORD)-1 ) {
21372124 goto finish;
21382125 }
21392126 if (attr & FILE_ATTRIBUTE_DIRECTORY) {
@@ -2288,11 +2275,11 @@
22882275 {
22892276 // send by scp
22902277 char **FileNames = &DropLists[i];
2291- int FileCount = DoSameProcess ? DropListCount - i : 1;
2292- if (!SendScp(FileNames, FileCount, ts.ScpSendDir)) {
2278+ int FileCountScp = DoSameProcess ? DropListCount - i : 1;
2279+ if (!SendScp(FileNames, FileCountScp, ts.ScpSendDir)) {
22932280 goto finish;
22942281 }
2295- i += FileCount - 1;
2282+ i += FileCountScp - 1;
22962283 break;
22972284 }
22982285 }
@@ -2568,6 +2555,24 @@
25682555 CPoint pt // カーソル位置
25692556 )
25702557 {
2558+ if (pSetLayeredWindowAttributes != NULL) {
2559+ BOOL InTitleBar;
2560+ POINT point = pt;
2561+ GetPositionOnWindow(HVTWin, &point,
2562+ NULL, NULL, &InTitleBar);
2563+ if (InTitleBar) {
2564+ int delta = zDelta < 0 ? -1 : 1;
2565+ int newAlpha = Alpha;
2566+ newAlpha += delta * ts.MouseWheelScrollLine;
2567+ if (newAlpha > 255)
2568+ newAlpha = 255;
2569+ else if (newAlpha < 0)
2570+ newAlpha = 0;
2571+ SetWindowAlpha(newAlpha);
2572+ return TRUE;
2573+ }
2574+ }
2575+
25712576 int line, i;
25722577
25732578 ::ScreenToClient(HVTWin, &pt);
@@ -2951,7 +2956,7 @@
29512956 }
29522957 }
29532958
2954-void CVTWindow::OnTimer(UINT nIDEvent)
2959+void CVTWindow::OnTimer(UINT_PTR nIDEvent)
29552960 {
29562961 POINT Point;
29572962 WORD PortType;
@@ -3153,7 +3158,7 @@
31533158 }
31543159
31553160 //<!--by AKASI
3156-LONG CVTWindow::OnWindowPosChanging(UINT wParam, LONG lParam)
3161+LRESULT CVTWindow::OnWindowPosChanging(WPARAM wParam, LPARAM lParam)
31573162 {
31583163 #ifdef ALPHABLEND_TYPE2
31593164 if(BGEnable && BGNoCopyBits) {
@@ -3164,7 +3169,7 @@
31643169 return CFrameWnd::DefWindowProc(WM_WINDOWPOSCHANGING,wParam,lParam);
31653170 }
31663171
3167-LONG CVTWindow::OnSettingChange(UINT wParam, LONG lParam)
3172+LRESULT CVTWindow::OnSettingChange(WPARAM wParam, LPARAM lParam)
31683173 {
31693174 #ifdef ALPHABLEND_TYPE2
31703175 BGOnSettingChange();
@@ -3172,7 +3177,7 @@
31723177 return CFrameWnd::DefWindowProc(WM_SETTINGCHANGE,wParam,lParam);
31733178 }
31743179
3175-LONG CVTWindow::OnEnterSizeMove(UINT wParam, LONG lParam)
3180+LRESULT CVTWindow::OnEnterSizeMove(WPARAM wParam, LPARAM lParam)
31763181 {
31773182 EnableSizeTip(1);
31783183
@@ -3182,7 +3187,7 @@
31823187 return CFrameWnd::DefWindowProc(WM_ENTERSIZEMOVE,wParam,lParam);
31833188 }
31843189
3185-LONG CVTWindow::OnExitSizeMove(UINT wParam, LONG lParam)
3190+LRESULT CVTWindow::OnExitSizeMove(WPARAM wParam, LPARAM lParam)
31863191 {
31873192 #ifdef ALPHABLEND_TYPE2
31883193 BGOnExitSizeMove();
@@ -3194,7 +3199,7 @@
31943199 }
31953200 //-->
31963201
3197-LONG CVTWindow::OnIMEComposition(UINT wParam, LONG lParam)
3202+LRESULT CVTWindow::OnIMEComposition(WPARAM wParam, LPARAM lParam)
31983203 {
31993204 HGLOBAL hstr;
32003205 //LPSTR lpstr;
@@ -3252,7 +3257,7 @@
32523257 return CFrameWnd::DefWindowProc(WM_IME_COMPOSITION,wParam,lParam);
32533258 }
32543259
3255-LONG CVTWindow::OnIMEInputChange(UINT wParam, LONG lParam)
3260+LRESULT CVTWindow::OnIMEInputChange(WPARAM wParam, LPARAM lParam)
32563261 {
32573262 ChangeCaret();
32583263
@@ -3259,7 +3264,7 @@
32593264 return CFrameWnd::DefWindowProc(WM_INPUTLANGCHANGE,wParam,lParam);
32603265 }
32613266
3262-LONG CVTWindow::OnIMENotify(UINT wParam, LONG lParam)
3267+LRESULT CVTWindow::OnIMENotify(WPARAM wParam, LPARAM lParam)
32633268 {
32643269 if (wParam == IMN_SETOPENSTATUS) {
32653270 ChangeCaret();
@@ -3275,7 +3280,7 @@
32753280 // http://27213143.at.webry.info/201202/article_2.html
32763281 // 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
32773282 // (2012.5.9 yutaka)
3278-LONG CVTWindow::OnIMERequest(UINT wParam, LONG lParam)
3283+LRESULT CVTWindow::OnIMERequest(WPARAM wParam, LPARAM lParam)
32793284 {
32803285 static int complen, newsize;
32813286 static char comp[512];
@@ -3337,7 +3342,7 @@
33373342 return CFrameWnd::DefWindowProc(WM_IME_REQUEST,wParam,lParam);
33383343 }
33393344
3340-LONG CVTWindow::OnAccelCommand(UINT wParam, LONG lParam)
3345+LRESULT CVTWindow::OnAccelCommand(WPARAM wParam, LPARAM lParam)
33413346 {
33423347 switch (wParam) {
33433348 case IdHold:
@@ -3430,7 +3435,7 @@
34303435 return 0;
34313436 }
34323437
3433-LONG CVTWindow::OnChangeMenu(UINT wParam, LONG lParam)
3438+LRESULT CVTWindow::OnChangeMenu(WPARAM wParam, LPARAM lParam)
34343439 {
34353440 HMENU SysMenu;
34363441 BOOL Show, B1, B2;
@@ -3492,7 +3497,7 @@
34923497 return 0;
34933498 }
34943499
3495-LONG CVTWindow::OnChangeTBar(UINT wParam, LONG lParam)
3500+LRESULT CVTWindow::OnChangeTBar(WPARAM wParam, LPARAM lParam)
34963501 {
34973502 BOOL TBar;
34983503 DWORD Style,ExStyle;
@@ -3554,7 +3559,7 @@
35543559 return 0;
35553560 }
35563561
3557-LONG CVTWindow::OnCommNotify(UINT wParam, LONG lParam)
3562+LRESULT CVTWindow::OnCommNotify(WPARAM wParam, LPARAM lParam)
35583563 {
35593564 switch (LOWORD(lParam)) {
35603565 case FD_READ: // TCP/IP
@@ -3584,7 +3589,7 @@
35843589 return 0;
35853590 }
35863591
3587-LONG CVTWindow::OnCommOpen(UINT wParam, LONG lParam)
3592+LRESULT CVTWindow::OnCommOpen(WPARAM wParam, LPARAM lParam)
35883593 {
35893594 AutoDisconnectedPort = -1;
35903595
@@ -3679,7 +3684,7 @@
36793684 return 0;
36803685 }
36813686
3682-LONG CVTWindow::OnCommStart(UINT wParam, LONG lParam)
3687+LRESULT CVTWindow::OnCommStart(WPARAM wParam, LPARAM lParam)
36833688 {
36843689 // 自動接続が無効のときも接続ダイアログを出すようにした (2006.9.15 maya)
36853690 if (((ts.PortType!=IdSerial) && (ts.HostName[0]==0)) ||
@@ -3705,7 +3710,7 @@
37053710 return 0;
37063711 }
37073712
3708-LONG CVTWindow::OnDdeEnd(UINT wParam, LONG lParam)
3713+LRESULT CVTWindow::OnDdeEnd(WPARAM wParam, LPARAM lParam)
37093714 {
37103715 EndDDE();
37113716 if (CloseTT) {
@@ -3714,42 +3719,42 @@
37143719 return 0;
37153720 }
37163721
3717-LONG CVTWindow::OnDlgHelp(UINT wParam, LONG lParam)
3722+LRESULT CVTWindow::OnDlgHelp(WPARAM wParam, LPARAM lParam)
37183723 {
37193724 OpenHelp(HH_HELP_CONTEXT, HelpId, ts.UILanguageFile);
37203725 return 0;
37213726 }
37223727
3723-LONG CVTWindow::OnFileTransEnd(UINT wParam, LONG lParam)
3728+LRESULT CVTWindow::OnFileTransEnd(WPARAM wParam, LPARAM lParam)
37243729 {
37253730 FileTransEnd(wParam);
37263731 return 0;
37273732 }
37283733
3729-LONG CVTWindow::OnGetSerialNo(UINT wParam, LONG lParam)
3734+LRESULT CVTWindow::OnGetSerialNo(WPARAM wParam, LPARAM lParam)
37303735 {
37313736 return (LONG)SerialNo;
37323737 }
37333738
3734-LONG CVTWindow::OnKeyCode(UINT wParam, LONG lParam)
3739+LRESULT CVTWindow::OnKeyCode(WPARAM wParam, LPARAM lParam)
37353740 {
37363741 KeyCodeSend(wParam,(WORD)lParam);
37373742 return 0;
37383743 }
37393744
3740-LONG CVTWindow::OnProtoEnd(UINT wParam, LONG lParam)
3745+LRESULT CVTWindow::OnProtoEnd(WPARAM wParam, LPARAM lParam)
37413746 {
37423747 ProtoDlgCancel();
37433748 return 0;
37443749 }
37453750
3746-LONG CVTWindow::OnChangeTitle(UINT wParam, LONG lParam)
3751+LRESULT CVTWindow::OnChangeTitle(WPARAM wParam, LPARAM lParam)
37473752 {
37483753 ChangeTitle();
37493754 return 0;
37503755 }
37513756
3752-LONG CVTWindow::OnNotifyIcon(UINT wParam, LONG lParam)
3757+LRESULT CVTWindow::OnNotifyIcon(WPARAM wParam, LPARAM lParam)
37533758 {
37543759 if (wParam == 1) {
37553760 switch (lParam) {
@@ -3893,7 +3898,7 @@
38933898 void CVTWindow::OnDuplicateSession()
38943899 {
38953900 char Command[1024];
3896- char *exec = "ttermpro";
3901+ const char *exec = "ttermpro";
38973902 STARTUPINFO si;
38983903 PROCESS_INFORMATION pi;
38993904 char cygterm_cfg[MAX_PATH];
@@ -3993,7 +3998,7 @@
39933998 char file[MAX_PATH], *filename;
39943999 char c, *envptr, *envbuff=NULL;
39954000 int envbufflen;
3996- char *exename = "cygterm.exe";
4001+ const char *exename = "cygterm.exe";
39974002 char cygterm[MAX_PATH];
39984003 STARTUPINFO si;
39994004 PROCESS_INFORMATION pi;
@@ -4077,7 +4082,7 @@
40774082 //
40784083 void CVTWindow::OnTTMenuLaunch()
40794084 {
4080- char *exename = "ttpmenu.exe";
4085+ const char *exename = "ttpmenu.exe";
40814086 STARTUPINFO si;
40824087 PROCESS_INFORMATION pi;
40834088
@@ -4085,7 +4090,7 @@
40854090 GetStartupInfo(&si);
40864091 memset(&pi, 0, sizeof(pi));
40874092
4088- if (CreateProcess(NULL, exename, NULL, NULL, FALSE, 0,
4093+ if (CreateProcess(NULL, (LPSTR)exename, NULL, NULL, FALSE, 0,
40894094 NULL, NULL, &si, &pi) == 0) {
40904095 char buf[80];
40914096 char uimsg[MAX_UIMSG];
@@ -4144,7 +4149,6 @@
41444149
41454150 switch (msg) {
41464151 case WM_INITDIALOG:
4147- //SetDlgItemText(hDlgWnd, IDC_EDIT_COMMENT, "サンプル");
41484152 // エディットコントロールにフォーカスをあてる
41494153 SetFocus(GetDlgItem(hDlgWnd, IDC_EDIT_COMMENT));
41504154
@@ -4254,7 +4258,7 @@
42544258 OPENFILENAME ofn;
42554259 char szFile[MAX_PATH];
42564260 char Command[MAX_PATH] = "notepad.exe";
4257- char *exec = "ttermpro";
4261+ const char *exec = "ttermpro";
42584262 STARTUPINFO si;
42594263 PROCESS_INFORMATION pi;
42604264 char uimsg[MAX_UIMSG];
@@ -4529,7 +4533,7 @@
45294533 CAddSetting.EnableStackedTabs(FALSE);
45304534 ret = CAddSetting.DoModal();
45314535 switch (ret) {
4532- case -1:
4536+ case (DWORD)-1:
45334537 case IDABORT:
45344538 ret = GetLastError();
45354539 break;
@@ -4908,8 +4912,9 @@
49084912 {
49094913 BOOL ret = FALSE;
49104914 int flag = 0;
4911- char *s, **p;
4912- char *virstore_env[] = {
4915+ char *s;
4916+ const char **p;
4917+ static const char *virstore_env[] = {
49134918 "ProgramFiles",
49144919 "ProgramData",
49154920 "SystemRoot",
@@ -5675,8 +5680,8 @@
56755680 // サブクラス化させてリアルタイムモードにする (2008.1.21 yutaka)
56765681 hwndBroadcast = GetDlgItem(hWnd, IDC_COMMAND_EDIT);
56775682 hwndBroadcastEdit = GetWindow(hwndBroadcast, GW_CHILD);
5678- OrigBroadcastEditProc = (WNDPROC)GetWindowLong(hwndBroadcastEdit, GWL_WNDPROC);
5679- SetWindowLong(hwndBroadcastEdit, GWL_WNDPROC, (LONG)BroadcastEditProc);
5683+ OrigBroadcastEditProc = (WNDPROC)GetWindowLong(hwndBroadcastEdit, GWLP_WNDPROC);
5684+ SetWindowLong(hwndBroadcastEdit, GWLP_WNDPROC, (LONG)BroadcastEditProc);
56805685 // デフォルトはon。残りはdisable。
56815686 SendMessage(GetDlgItem(hWnd, IDC_REALTIME_CHECK), BM_SETCHECK, BST_CHECKED, 0); // default on
56825687 EnableWindow(GetDlgItem(hWnd, IDC_HISTORY_CHECK), FALSE);
@@ -5787,8 +5792,8 @@
57875792 // new handler
57885793 hwndBroadcast = GetDlgItem(hWnd, IDC_COMMAND_EDIT);
57895794 hwndBroadcastEdit = GetWindow(hwndBroadcast, GW_CHILD);
5790- OrigBroadcastEditProc = (WNDPROC)GetWindowLong(hwndBroadcastEdit, GWL_WNDPROC);
5791- SetWindowLong(hwndBroadcastEdit, GWL_WNDPROC, (LONG)BroadcastEditProc);
5795+ OrigBroadcastEditProc = (WNDPROC)GetWindowLong(hwndBroadcastEdit, GWLP_WNDPROC);
5796+ SetWindowLong(hwndBroadcastEdit, GWLP_WNDPROC, (LONG)BroadcastEditProc);
57925797
57935798 EnableWindow(GetDlgItem(hWnd, IDC_HISTORY_CHECK), FALSE);
57945799 EnableWindow(GetDlgItem(hWnd, IDC_RADIO_CRLF), FALSE);
@@ -5799,7 +5804,7 @@
57995804 EnableWindow(GetDlgItem(hWnd, IDC_LIST), TRUE); // true
58005805 } else {
58015806 // restore old handler
5802- SetWindowLong(hwndBroadcastEdit, GWL_WNDPROC, (LONG)OrigBroadcastEditProc);
5807+ SetWindowLong(hwndBroadcastEdit, GWLP_WNDPROC, (LONG)OrigBroadcastEditProc);
58035808
58045809 EnableWindow(GetDlgItem(hWnd, IDC_HISTORY_CHECK), TRUE);
58055810 EnableWindow(GetDlgItem(hWnd, IDC_RADIO_CRLF), TRUE);
@@ -5874,7 +5879,7 @@
58745879 // モードレスダイアログは一度生成されると、アプリケーションが終了するまで
58755880 // 破棄されないので、以下の「ウィンドウプロシージャ戻し」は不要と思われる。(yutaka)
58765881 #if 0
5877- SetWindowLong(hwndBroadcastEdit, GWL_WNDPROC, (LONG)OrigBroadcastEditProc);
5882+ SetWindowLong(hwndBroadcastEdit, GWLP_WNDPROC, (LONG)OrigBroadcastEditProc);
58785883 #endif
58795884
58805885 //EndDialog(hDlgWnd, IDOK);
@@ -6066,7 +6071,7 @@
60666071 }
60676072
60686073 // WM_COPYDATAの受信
6069-LONG CVTWindow::OnReceiveIpcMessage(UINT wParam, LONG lParam)
6074+LRESULT CVTWindow::OnReceiveIpcMessage(WPARAM wParam, LPARAM lParam)
60706075 {
60716076 COPYDATASTRUCT *cds;
60726077 char *buf, *msg, *name;
--- branches/transparent-window/teraterm/teraterm/vtwin.h (revision 7247)
+++ branches/transparent-window/teraterm/teraterm/vtwin.h (revision 7248)
@@ -57,6 +57,10 @@
5757 bool DropWithLeftbutton;
5858 bool DropWithRightbutton;
5959
60+ // window attribute
61+ BYTE Alpha;
62+ void SetWindowAlpha(BYTE alpha);
63+
6064 protected:
6165
6266 public:
@@ -122,35 +126,35 @@
122126 afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
123127 afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
124128 afx_msg void OnSysKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
125- afx_msg void OnTimer(UINT nIDEvent);
129+ afx_msg void OnTimer(UINT_PTR nIDEvent);
126130 afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
127131 afx_msg BOOL OnDeviceChange(UINT nEventType, DWORD_PTR dwData);
128132 //<!--by AKASI
129- afx_msg LONG OnWindowPosChanging(UINT wParam, LONG lParam);
130- afx_msg LONG OnSettingChange(UINT wParam, LONG lParam);
131- afx_msg LONG OnEnterSizeMove(UINT wParam, LONG lParam);
132- afx_msg LONG OnExitSizeMove(UINT wParam, LONG lParam);
133+ afx_msg LRESULT OnWindowPosChanging(WPARAM wParam, LPARAM lParam);
134+ afx_msg LRESULT OnSettingChange(WPARAM wParam, LPARAM lParam);
135+ afx_msg LRESULT OnEnterSizeMove(WPARAM wParam, LPARAM lParam);
136+ afx_msg LRESULT OnExitSizeMove(WPARAM wParam, LPARAM lParam);
133137 //-->
134- afx_msg LONG OnIMEComposition(UINT wParam, LONG lParam);
135- afx_msg LONG OnIMEInputChange(UINT wParam, LONG lParam);
136- afx_msg LONG OnIMENotify(UINT wParam, LONG lParam);
137- afx_msg LONG OnIMERequest(UINT wParam, LONG lParam);
138- afx_msg LONG OnAccelCommand(UINT wParam, LONG lParam);
139- afx_msg LONG OnChangeMenu(UINT wParam, LONG lParam);
140- afx_msg LONG OnChangeTBar(UINT wParam, LONG lParam);
141- afx_msg LONG OnCommNotify(UINT wParam, LONG lParam);
142- afx_msg LONG OnCommOpen(UINT wParam, LONG lParam);
143- afx_msg LONG OnCommStart(UINT wParam, LONG lParam);
144- afx_msg LONG OnDdeEnd(UINT wParam, LONG lParam);
145- afx_msg LONG OnDlgHelp(UINT wParam, LONG lParam);
146- afx_msg LONG OnFileTransEnd(UINT wParam, LONG lParam);
147- afx_msg LONG OnGetSerialNo(UINT wParam, LONG lParam);
148- afx_msg LONG OnKeyCode(UINT wParam, LONG lParam);
149- afx_msg LONG OnProtoEnd(UINT wParam, LONG lParam);
150- afx_msg LONG OnChangeTitle(UINT wParam, LONG lParam);
151- afx_msg LONG OnReceiveIpcMessage(UINT wParam, LONG lParam);
152- afx_msg LONG OnNonConfirmClose(UINT wParam, LONG lParam);
153- afx_msg LONG OnNotifyIcon(UINT wParam, LONG lParam);
138+ afx_msg LRESULT OnIMEComposition(WPARAM wParam, LPARAM lParam);
139+ afx_msg LRESULT OnIMEInputChange(WPARAM wParam, LPARAM lParam);
140+ afx_msg LRESULT OnIMENotify(WPARAM wParam, LPARAM lParam);
141+ afx_msg LRESULT OnIMERequest(WPARAM wParam, LPARAM lParam);
142+ afx_msg LRESULT OnAccelCommand(WPARAM wParam, LPARAM lParam);
143+ afx_msg LRESULT OnChangeMenu(WPARAM wParam, LPARAM lParam);
144+ afx_msg LRESULT OnChangeTBar(WPARAM wParam, LPARAM lParam);
145+ afx_msg LRESULT OnCommNotify(WPARAM wParam, LPARAM lParam);
146+ afx_msg LRESULT OnCommOpen(WPARAM wParam, LPARAM lParam);
147+ afx_msg LRESULT OnCommStart(WPARAM wParam, LPARAM lParam);
148+ afx_msg LRESULT OnDdeEnd(WPARAM wParam, LPARAM lParam);
149+ afx_msg LRESULT OnDlgHelp(WPARAM wParam, LPARAM lParam);
150+ afx_msg LRESULT OnFileTransEnd(WPARAM wParam, LPARAM lParam);
151+ afx_msg LRESULT OnGetSerialNo(WPARAM wParam, LPARAM lParam);
152+ afx_msg LRESULT OnKeyCode(WPARAM wParam, LPARAM lParam);
153+ afx_msg LRESULT OnProtoEnd(WPARAM wParam, LPARAM lParam);
154+ afx_msg LRESULT OnChangeTitle(WPARAM wParam, LPARAM lParam);
155+ afx_msg LRESULT OnReceiveIpcMessage(WPARAM wParam, LPARAM lParam);
156+ afx_msg LRESULT OnNonConfirmClose(WPARAM wParam, LPARAM lParam);
157+ afx_msg LRESULT OnNotifyIcon(WPARAM wParam, LPARAM lParam);
154158 afx_msg void OnFileNewConnection();
155159 afx_msg void OnDuplicateSession();
156160 afx_msg void OnCygwinConnection();
--- branches/transparent-window/teraterm/ttpset/ttset.c (revision 7247)
+++ branches/transparent-window/teraterm/ttpset/ttset.c (revision 7248)
@@ -1,6 +1,6 @@
11 /*
22 * Copyright (C) 1994-1998 T. Teranishi
3- * (C) 2004-2017 TeraTerm Project
3+ * (C) 2004-2018 TeraTerm Project
44 * All rights reserved.
55 *
66 * Redistribution and use in source and binary forms, with or without
@@ -52,15 +52,15 @@
5252
5353 #define MaxStrLen (LONG)512
5454
55-static PCHAR far TermList[] =
55+static const char *TermList[] =
5656 { "VT100", "VT100J", "VT101", "VT102", "VT102J", "VT220J", "VT282",
5757 "VT320", "VT382", "VT420", "VT520", "VT525", NULL };
5858
59-static PCHAR far RussList[] =
59+static const char *RussList[] =
6060 { "Windows", "KOI8-R", "CP-866", "ISO-8859-5", NULL };
61-static PCHAR far RussList2[] = { "Windows", "KOI8-R", NULL };
61+static const char *RussList2[] = { "Windows", "KOI8-R", NULL };
6262
63-WORD str2id(PCHAR far * List, PCHAR str, WORD DefId)
63+static WORD str2id(const char *List[], PCHAR str, WORD DefId)
6464 {
6565 WORD i;
6666 i = 0;
@@ -74,7 +74,7 @@
7474 return i;
7575 }
7676
77-void id2str(PCHAR far * List, WORD Id, WORD DefId, PCHAR str, int destlen)
77+static void id2str(const char *List[], WORD Id, WORD DefId, PCHAR str, int destlen)
7878 {
7979 int i;
8080
@@ -90,7 +90,7 @@
9090 strncpy_s(str, destlen, List[i], _TRUNCATE);
9191 }
9292
93-int IconName2IconId(const char *name) {
93+static int IconName2IconId(const char *name) {
9494 int id;
9595
9696 if (_stricmp(name, "tterm") == 0) {
@@ -123,7 +123,7 @@
123123 return id;
124124 }
125125
126-void IconId2IconName(char *name, int len, int id) {
126+static void IconId2IconName(char *name, int len, int id) {
127127 char *icon;
128128 switch (id) {
129129 case IDI_TTERM:
@@ -585,13 +585,13 @@
585585
586586 /* VT win position */
587587 GetPrivateProfileString(Section, "VTPos", "-2147483648,-2147483648", Temp, sizeof(Temp), FName); /* default: random position */
588- GetNthNum(Temp, 1, (int far *) (&ts->VTPos.x));
589- GetNthNum(Temp, 2, (int far *) (&ts->VTPos.y));
588+ GetNthNum(Temp, 1, (int*) (&ts->VTPos.x));
589+ GetNthNum(Temp, 2, (int*) (&ts->VTPos.y));
590590
591591 /* TEK win position */
592592 GetPrivateProfileString(Section, "TEKPos", "-2147483648,-2147483648", Temp, sizeof(Temp), FName); /* default: random position */
593- GetNthNum(Temp, 1, (int far *) &(ts->TEKPos.x));
594- GetNthNum(Temp, 2, (int far *) &(ts->TEKPos.y));
593+ GetNthNum(Temp, 1, (int*) &(ts->TEKPos.x));
594+ GetNthNum(Temp, 2, (int*) &(ts->TEKPos.y));
595595
596596 /* Save VT Window position */
597597 ts->SaveVTWinPos = GetOnOff(Section, "SaveVTWinPos", FName, FALSE);
@@ -791,7 +791,7 @@
791791 GetPrivateProfileString(Section, "VTColor", "0,0,0,255,255,255",
792792 Temp, sizeof(Temp), FName);
793793 for (i = 0; i <= 5; i++)
794- GetNthNum(Temp, i + 1, (int far *) &(ts->TmpColor[0][i]));
794+ GetNthNum(Temp, i + 1, (int*) &(ts->TmpColor[0][i]));
795795 for (i = 0; i <= 1; i++)
796796 ts->VTColor[i] = RGB((BYTE) ts->TmpColor[0][i * 3],
797797 (BYTE) ts->TmpColor[0][i * 3 + 1],
@@ -801,7 +801,7 @@
801801 GetPrivateProfileString(Section, "VTBoldColor", "0,0,255,255,255,255",
802802 Temp, sizeof(Temp), FName);
803803 for (i = 0; i <= 5; i++)
804- GetNthNum(Temp, i + 1, (int far *) &(ts->TmpColor[0][i]));
804+ GetNthNum(Temp, i + 1, (int*) &(ts->TmpColor[0][i]));
805805 for (i = 0; i <= 1; i++)
806806 ts->VTBoldColor[i] = RGB((BYTE) ts->TmpColor[0][i * 3],
807807 (BYTE) ts->TmpColor[0][i * 3 + 1],
@@ -813,7 +813,7 @@
813813 GetPrivateProfileString(Section, "VTBlinkColor", "255,0,0,255,255,255",
814814 Temp, sizeof(Temp), FName);
815815 for (i = 0; i <= 5; i++)
816- GetNthNum(Temp, i + 1, (int far *) &(ts->TmpColor[0][i]));
816+ GetNthNum(Temp, i + 1, (int*) &(ts->TmpColor[0][i]));
817817 for (i = 0; i <= 1; i++)
818818 ts->VTBlinkColor[i] = RGB((BYTE) ts->TmpColor[0][i * 3],
819819 (BYTE) ts->TmpColor[0][i * 3 + 1],
@@ -825,7 +825,7 @@
825825 GetPrivateProfileString(Section, "VTReverseColor", "255,255,255,0,0,0",
826826 Temp, sizeof(Temp), FName);
827827 for (i = 0; i <= 5; i++)
828- GetNthNum(Temp, i + 1, (int far *) &(ts->TmpColor[0][i]));
828+ GetNthNum(Temp, i + 1, (int*) &(ts->TmpColor[0][i]));
829829 for (i = 0; i <= 1; i++)
830830 ts->VTReverseColor[i] = RGB((BYTE) ts->TmpColor[0][i * 3],
831831 (BYTE) ts->TmpColor[0][i * 3 + 1],
@@ -840,7 +840,7 @@
840840 GetPrivateProfileString(Section, "URLColor", "0,255,0,255,255,255",
841841 Temp, sizeof(Temp), FName);
842842 for (i = 0; i <= 5; i++)
843- GetNthNum(Temp, i + 1, (int far *) &(ts->TmpColor[0][i]));
843+ GetNthNum(Temp, i + 1, (int*) &(ts->TmpColor[0][i]));
844844 for (i = 0; i <= 1; i++)
845845 ts->URLColor[i] = RGB((BYTE) ts->TmpColor[0][i * 3],
846846 (BYTE) ts->TmpColor[0][i * 3 + 1],
@@ -855,7 +855,7 @@
855855 GetPrivateProfileString(Section, "TEKColor", "0,0,0,255,255,255",
856856 Temp, sizeof(Temp), FName);
857857 for (i = 0; i <= 5; i++)
858- GetNthNum(Temp, i + 1, (int far *) &(ts->TmpColor[0][i]));
858+ GetNthNum(Temp, i + 1, (int*) &(ts->TmpColor[0][i]));
859859 for (i = 0; i <= 1; i++)
860860 ts->TEKColor[i] = RGB((BYTE) ts->TmpColor[0][i * 3],
861861 (BYTE) ts->TmpColor[0][i * 3 + 1],
@@ -893,10 +893,10 @@
893893 n /= 4;
894894 for (i = 0; i < n; i++) {
895895 int colorid, r, g, b;
896- GetNthNum(Temp, i * 4 + 1, (int far *) &colorid);
897- GetNthNum(Temp, i * 4 + 2, (int far *) &r);
898- GetNthNum(Temp, i * 4 + 3, (int far *) &g);
899- GetNthNum(Temp, i * 4 + 4, (int far *) &b);
896+ GetNthNum(Temp, i * 4 + 1, (int*) &colorid);
897+ GetNthNum(Temp, i * 4 + 2, (int*) &r);
898+ GetNthNum(Temp, i * 4 + 3, (int*) &g);
899+ GetNthNum(Temp, i * 4 + 4, (int*) &b);
900900 ts->ANSIColor[colorid & 15] =
901901 RGB((BYTE) r, (BYTE) g, (BYTE) b);
902902 }
@@ -928,8 +928,8 @@
928928 GetPrivateProfileString(Section, "VTFont", "Terminal,0,-13,1",
929929 Temp, sizeof(Temp), FName);
930930 GetNthString(Temp, 1, sizeof(ts->VTFont), ts->VTFont);
931- GetNthNum(Temp, 2, (int far *) &(ts->VTFontSize.x));
932- GetNthNum(Temp, 3, (int far *) &(ts->VTFontSize.y));
931+ GetNthNum(Temp, 2, (int*) &(ts->VTFontSize.x));
932+ GetNthNum(Temp, 3, (int*) &(ts->VTFontSize.y));
933933 GetNthNum(Temp, 4, &(ts->VTFontCharSet));
934934
935935 /* Bold font flag */
@@ -945,8 +945,8 @@
945945 GetPrivateProfileString(Section, "TEKFont", "Courier,0,-13,0",
946946 Temp, sizeof(Temp), FName);
947947 GetNthString(Temp, 1, sizeof(ts->TEKFont), ts->TEKFont);
948- GetNthNum(Temp, 2, (int far *) &(ts->TEKFontSize.x));
949- GetNthNum(Temp, 3, (int far *) &(ts->TEKFontSize.y));
948+ GetNthNum(Temp, 2, (int*) &(ts->TEKFontSize.x));
949+ GetNthNum(Temp, 3, (int*) &(ts->TEKFontSize.y));
950950 GetNthNum(Temp, 4, &(ts->TEKFontCharSet));
951951
952952 /* BS key */
@@ -1342,8 +1342,8 @@
13421342 }
13431343 else {
13441344 GetNthString(Temp, 1, sizeof(ts->PrnFont), ts->PrnFont);
1345- GetNthNum(Temp, 2, (int far *) &(ts->PrnFontSize.x));
1346- GetNthNum(Temp, 3, (int far *) &(ts->PrnFontSize.y));
1345+ GetNthNum(Temp, 2, (int*) &(ts->PrnFontSize.x));
1346+ GetNthNum(Temp, 3, (int*) &(ts->PrnFontSize.y));
13471347 GetNthNum(Temp, 4, &(ts->PrnFontCharSet));
13481348 }
13491349
@@ -1465,14 +1465,14 @@
14651465 // VT-print scaling factors (pixels per inch) --- special option
14661466 GetPrivateProfileString(Section, "VTPPI", "0,0",
14671467 Temp, sizeof(Temp), FName);
1468- GetNthNum(Temp, 1, (int far *) &ts->VTPPI.x);
1469- GetNthNum(Temp, 2, (int far *) &ts->VTPPI.y);
1468+ GetNthNum(Temp, 1, (int*) &ts->VTPPI.x);
1469+ GetNthNum(Temp, 2, (int*) &ts->VTPPI.y);
14701470
14711471 // TEK-print scaling factors (pixels per inch) --- special option
14721472 GetPrivateProfileString(Section, "TEKPPI", "0,0",
14731473 Temp, sizeof(Temp), FName);
1474- GetNthNum(Temp, 1, (int far *) &ts->TEKPPI.x);
1475- GetNthNum(Temp, 2, (int far *) &ts->TEKPPI.y);
1474+ GetNthNum(Temp, 1, (int*) &ts->TEKPPI.x);
1475+ GetNthNum(Temp, 2, (int*) &ts->TEKPPI.y);
14761476
14771477 // Show "Window" menu -- special option
14781478 if (GetOnOff(Section, "WindowMenu", FName, TRUE))
@@ -1561,13 +1561,17 @@
15611561 _TRUNCATE);
15621562
15631563 // Translucent window
1564- ts->AlphaBlend =
1565- GetPrivateProfileInt(Section, "AlphaBlend ", 255, FName);
1566- ts->AlphaBlend = max(0, ts->AlphaBlend);
1567- ts->AlphaBlend = min(255, ts->AlphaBlend);
1564+ ts->AlphaBlendInactive =
1565+ GetPrivateProfileInt(Section, "AlphaBlend", 255, FName);
1566+ ts->AlphaBlendInactive = max(0, ts->AlphaBlendInactive);
1567+ ts->AlphaBlendInactive = min(255, ts->AlphaBlendInactive);
1568+ ts->AlphaBlendActive =
1569+ GetPrivateProfileInt(Section, "AlphaBlendActive", 255, FName);
1570+ ts->AlphaBlendActive = max(0, ts->AlphaBlendActive);
1571+ ts->AlphaBlendActive = min(255, ts->AlphaBlendActive);
15681572
15691573 // Cygwin install path
1570- GetPrivateProfileString(Section, "CygwinDirectory ", "c:\\cygwin",
1574+ GetPrivateProfileString(Section, "CygwinDirectory", "c:\\cygwin",
15711575 Temp, sizeof(Temp), FName);
15721576 strncpy_s(ts->CygwinDirectory, sizeof(ts->CygwinDirectory), Temp,
15731577 _TRUNCATE);
@@ -1579,17 +1583,17 @@
15791583 else {
15801584 Temp[0] = '\0';
15811585 }
1582- GetPrivateProfileString(Section, "ViewlogEditor ", Temp,
1586+ GetPrivateProfileString(Section, "ViewlogEditor", Temp,
15831587 ts->ViewlogEditor, sizeof(ts->ViewlogEditor), FName);
15841588
15851589 // Locale for UTF-8
1586- GetPrivateProfileString(Section, "Locale ", DEFAULT_LOCALE,
1590+ GetPrivateProfileString(Section, "Locale", DEFAULT_LOCALE,
15871591 Temp, sizeof(Temp), FName);
15881592 strncpy_s(ts->Locale, sizeof(ts->Locale), Temp, _TRUNCATE);
15891593
15901594 // CodePage
15911595 ts->CodePage =
1592- GetPrivateProfileInt(Section, "CodePage ", DEFAULT_CODEPAGE,
1596+ GetPrivateProfileInt(Section, "CodePage", DEFAULT_CODEPAGE,
15931597 FName);
15941598
15951599 // UI language message file
@@ -2289,8 +2293,10 @@
22892293 ts->EnableContinuedLineCopy);
22902294 WritePrivateProfileString(Section, "MouseCursor", ts->MouseCursorName,
22912295 FName);
2292- _snprintf_s(Temp, sizeof(Temp), _TRUNCATE, "%d", ts->AlphaBlend);
2296+ _snprintf_s(Temp, sizeof(Temp), _TRUNCATE, "%d", ts->AlphaBlendInactive);
22932297 WritePrivateProfileString(Section, "AlphaBlend", Temp, FName);
2298+ _snprintf_s(Temp, sizeof(Temp), _TRUNCATE, "%d", ts->AlphaBlendActive);
2299+ WritePrivateProfileString(Section, "AlphaBlendActive", Temp, FName);
22942300 WritePrivateProfileString(Section, "CygwinDirectory",
22952301 ts->CygwinDirectory, FName);
22962302 WritePrivateProfileString(Section, "ViewlogEditor", ts->ViewlogEditor,
Show on old repository browser