Tera Termの個人的な作業用リポジトリ
Revision | ded96dbfe6005824f2cf365a63158998007abcdc (tree) |
---|---|
Time | 2018-07-20 00:34:03 |
Author | zmatsuo <zmatsuo@user...> |
Commiter | zmatsuo |
dlglib.cをdlglib.cppにリネーム、
dlglib.cppインクルードヘッダファイルを最適化
vs2017のプロジェクトファイルを修正
git-svn-id: svn+ssh://svn.osdn.net/svnroot/ttssh2/trunk@7159 f5f01b69-1e22-0410-acbf-894ab4bd6246
@@ -28,7 +28,8 @@ | ||
28 | 28 | */ |
29 | 29 | |
30 | 30 | /* Routines for dialog boxes */ |
31 | -#include "teraterm.h" | |
31 | +#include <windows.h> | |
32 | +#include "dlglib.h" | |
32 | 33 | #include <stdio.h> |
33 | 34 | #include <commctrl.h> |
34 | 35 |
@@ -269,7 +270,7 @@ static LRESULT CALLBACK HostnameEditProc(HWND dlg, UINT msg, | ||
269 | 270 | SendMessage(dlg, EM_GETSEL, 0, (LPARAM)&select); |
270 | 271 | max = GetWindowTextLength(dlg); |
271 | 272 | max++; // '\0' |
272 | - orgstr = str = malloc(max); | |
273 | + orgstr = str = (char *)malloc(max); | |
273 | 274 | if (str != NULL) { |
274 | 275 | len = GetWindowText(dlg, str, max); |
275 | 276 | if (select >= 0 && select < len) { |
@@ -319,16 +320,16 @@ static LRESULT CALLBACK HostnameEditProc(HWND dlg, UINT msg, | ||
319 | 320 | break; |
320 | 321 | } |
321 | 322 | |
322 | - SetWindowLong(dlg, GWL_WNDPROC, (LONG_PTR)data->OrigProc); | |
323 | - SetWindowLong(dlg, GWLP_USERDATA, (LONG_PTR)data->OrigUser); | |
324 | - LRESULT Result = CallWindowProc(data->OrigProc, dlg, msg, wParam, lParam); | |
325 | - SetWindowLong(dlg, GWL_WNDPROC, (LONG_PTR)HostnameEditProc); | |
326 | - SetWindowLong(dlg, GWLP_USERDATA, (LONG_PTR)data); | |
323 | + SetWindowLongPtr(dlg, GWLP_WNDPROC, (LONG_PTR)data->OrigProc); | |
324 | + SetWindowLongPtr(dlg, GWLP_USERDATA, (LONG_PTR)data->OrigUser); | |
325 | + const LRESULT Result = CallWindowProc(data->OrigProc, dlg, msg, wParam, lParam); | |
326 | + SetWindowLongPtr(dlg, GWLP_WNDPROC, (LONG_PTR)HostnameEditProc); | |
327 | + SetWindowLongPtr(dlg, GWLP_USERDATA, (LONG_PTR)data); | |
327 | 328 | |
328 | 329 | switch (msg) { |
329 | 330 | case WM_DESTROY: |
330 | - SetWindowLong(dlg, GWL_WNDPROC, (LONG_PTR)data->OrigProc); | |
331 | - SetWindowLong(dlg, GWLP_USERDATA, (LONG_PTR)data->OrigUser); | |
331 | + SetWindowLongPtr(dlg, GWLP_WNDPROC, (LONG_PTR)data->OrigProc); | |
332 | + SetWindowLongPtr(dlg, GWLP_USERDATA, (LONG_PTR)data->OrigUser); | |
332 | 333 | free(data); |
333 | 334 | break; |
334 | 335 | } |
@@ -344,9 +345,9 @@ void SetEditboxSubclass(HWND hDlg, int nID, BOOL ComboBox) | ||
344 | 345 | hWndEdit = GetWindow(hWndEdit, GW_CHILD); |
345 | 346 | } |
346 | 347 | EditSubclassData *data = (EditSubclassData *)malloc(sizeof(EditSubclassData)); |
347 | - data->OrigProc = (WNDPROC)GetWindowLong(hWndEdit, GWL_WNDPROC); | |
348 | + data->OrigProc = (WNDPROC)GetWindowLong(hWndEdit, GWLP_WNDPROC); | |
348 | 349 | data->OrigUser = (LONG_PTR)GetWindowLong(hWndEdit, GWLP_USERDATA); |
349 | 350 | data->ComboBox = ComboBox; |
350 | - SetWindowLong(hWndEdit, GWL_WNDPROC, (LONG_PTR)HostnameEditProc); | |
351 | - SetWindowLong(hWndEdit, GWLP_USERDATA, (LONG_PTR)data); | |
351 | + SetWindowLongPtr(hWndEdit, GWL_WNDPROC, (LONG_PTR)HostnameEditProc); | |
352 | + SetWindowLongPtr(hWndEdit, GWLP_USERDATA, (LONG_PTR)data); | |
352 | 353 | } |
@@ -142,7 +142,7 @@ | ||
142 | 142 | </Manifest> |
143 | 143 | </ItemDefinitionGroup> |
144 | 144 | <ItemGroup> |
145 | - <ClCompile Include="..\common\dlglib.c" /> | |
145 | + <ClCompile Include="..\common\dlglib.cpp" /> | |
146 | 146 | <ClCompile Include="..\common\stdafx.cpp" /> |
147 | 147 | <ClCompile Include="..\common\ttlib.c" /> |
148 | 148 | <ClCompile Include="addsetting.cpp" /> |
@@ -264,4 +264,4 @@ | ||
264 | 264 | <UserProperties RESOURCE_FILE="ttermpro.rc" /> |
265 | 265 | </VisualStudio> |
266 | 266 | </ProjectExtensions> |
267 | -</Project> | |
267 | +</Project> | |
\ No newline at end of file |
@@ -96,9 +96,6 @@ | ||
96 | 96 | <ClCompile Include="WSAAsyncGetAddrInfo.c"> |
97 | 97 | <Filter>Source Files %28C%29</Filter> |
98 | 98 | </ClCompile> |
99 | - <ClCompile Include="..\common\dlglib.c"> | |
100 | - <Filter>dialog</Filter> | |
101 | - </ClCompile> | |
102 | 99 | <ClCompile Include="dnddlg.cpp"> |
103 | 100 | <Filter>dialog</Filter> |
104 | 101 | </ClCompile> |
@@ -117,6 +114,9 @@ | ||
117 | 114 | <ClCompile Include="addsetting.cpp"> |
118 | 115 | <Filter>dialog</Filter> |
119 | 116 | </ClCompile> |
117 | + <ClCompile Include="..\common\dlglib.cpp"> | |
118 | + <Filter>dialog</Filter> | |
119 | + </ClCompile> | |
120 | 120 | </ItemGroup> |
121 | 121 | <ItemGroup> |
122 | 122 | <Image Include="..\..\cygterm\cygterm.ico"> |
@@ -1,4 +1,4 @@ | ||
1 | -<?xml version="1.0" encoding="utf-8"?> | |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | 2 | <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
3 | 3 | <ItemGroup Label="ProjectConfigurations"> |
4 | 4 | <ProjectConfiguration Include="Debug|Win32"> |
@@ -133,7 +133,7 @@ | ||
133 | 133 | </Link> |
134 | 134 | </ItemDefinitionGroup> |
135 | 135 | <ItemGroup> |
136 | - <ClCompile Include="..\common\dlglib.c" /> | |
136 | + <ClCompile Include="..\common\dlglib.cpp" /> | |
137 | 137 | <ClCompile Include="..\common\ttlib.c" /> |
138 | 138 | <ClCompile Include="ttdlg.c" /> |
139 | 139 | </ItemGroup> |
@@ -167,4 +167,4 @@ | ||
167 | 167 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
168 | 168 | <ImportGroup Label="ExtensionTargets"> |
169 | 169 | </ImportGroup> |
170 | -</Project> | |
\ No newline at end of file | ||
170 | +</Project> |
@@ -18,15 +18,15 @@ | ||
18 | 18 | </Filter> |
19 | 19 | </ItemGroup> |
20 | 20 | <ItemGroup> |
21 | - <ClCompile Include="..\common\dlglib.c"> | |
22 | - <Filter>Source Files</Filter> | |
23 | - </ClCompile> | |
24 | 21 | <ClCompile Include="ttdlg.c"> |
25 | 22 | <Filter>Source Files</Filter> |
26 | 23 | </ClCompile> |
27 | 24 | <ClCompile Include="..\common\ttlib.c"> |
28 | 25 | <Filter>Source Files</Filter> |
29 | 26 | </ClCompile> |
27 | + <ClCompile Include="..\common\dlglib.cpp"> | |
28 | + <Filter>Source Files</Filter> | |
29 | + </ClCompile> | |
30 | 30 | </ItemGroup> |
31 | 31 | <ItemGroup> |
32 | 32 | <ClInclude Include="dlg_res.h"> |
@@ -60,4 +60,4 @@ | ||
60 | 60 | <Filter>Def File</Filter> |
61 | 61 | </None> |
62 | 62 | </ItemGroup> |
63 | -</Project> | |
63 | +</Project> | |
\ No newline at end of file |
@@ -1,4 +1,4 @@ | ||
1 | -<?xml version="1.0" encoding="utf-8"?> | |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | 2 | <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
3 | 3 | <ItemGroup Label="ProjectConfigurations"> |
4 | 4 | <ProjectConfiguration Include="Debug|Win32"> |
@@ -127,7 +127,7 @@ | ||
127 | 127 | </Link> |
128 | 128 | </ItemDefinitionGroup> |
129 | 129 | <ItemGroup> |
130 | - <ClCompile Include="..\common\dlglib.c" /> | |
130 | + <ClCompile Include="..\common\dlglib.cpp" /> | |
131 | 131 | <ClCompile Include="..\common\ttlib.c" /> |
132 | 132 | <ClCompile Include="bplus.c" /> |
133 | 133 | <ClCompile Include="ftlib.c" /> |
@@ -22,9 +22,6 @@ | ||
22 | 22 | <ClCompile Include="bplus.c"> |
23 | 23 | <Filter>Source Files</Filter> |
24 | 24 | </ClCompile> |
25 | - <ClCompile Include="..\common\dlglib.c"> | |
26 | - <Filter>Source Files</Filter> | |
27 | - </ClCompile> | |
28 | 25 | <ClCompile Include="ftlib.c"> |
29 | 26 | <Filter>Source Files</Filter> |
30 | 27 | </ClCompile> |
@@ -49,6 +46,9 @@ | ||
49 | 46 | <ClCompile Include="zmodem.c"> |
50 | 47 | <Filter>Source Files</Filter> |
51 | 48 | </ClCompile> |
49 | + <ClCompile Include="..\common\dlglib.cpp"> | |
50 | + <Filter>Source Files</Filter> | |
51 | + </ClCompile> | |
52 | 52 | </ItemGroup> |
53 | 53 | <ItemGroup> |
54 | 54 | <ClInclude Include="bplus.h"> |
@@ -92,4 +92,4 @@ | ||
92 | 92 | <Filter>Def File</Filter> |
93 | 93 | </None> |
94 | 94 | </ItemGroup> |
95 | -</Project> | |
95 | +</Project> | |
\ No newline at end of file |