• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision8248 (tree)
Time2019-10-03 00:07:34
Authorzmatsuo

Log Message

_SendDlgItemMessageW()を追加

- SendDlgItemMessageW() の layer for uncode版

Change Summary

Incremental Difference

--- branches/unicode_buf/teraterm/common/compat_win.cpp (revision 8247)
+++ branches/unicode_buf/teraterm/common/compat_win.cpp (revision 8248)
@@ -34,6 +34,7 @@
3434
3535 #include "dllutil.h"
3636
37+LRESULT (WINAPI *pSendDlgItemMessageW)(HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam);
3738 BOOL (WINAPI *pModifyMenuW)(HMENU hMnu, UINT uPosition, UINT uFlags, UINT_PTR uIDNewItem, LPCWSTR lpNewItem);
3839 BOOL (WINAPI *pSetWindowTextW)(HWND hWnd, LPCWSTR lpString);
3940 DWORD (WINAPI *pGetPrivateProfileStringW)(LPCWSTR lpAppName, LPCWSTR lpKeyName, LPCWSTR lpDefault, LPWSTR lpReturnedString, DWORD nSize, LPCWSTR lpFileName);
@@ -64,6 +65,7 @@
6465 { "SetDlgItemTextW", (void **)&pSetDlgItemTextW },
6566 { "SetWindowTextW", (void **)&pSetWindowTextW },
6667 { "ModifyMenuW", (void **)&pModifyMenuW },
68+ { "SendDlgItemMessageW", (void **)&pSendDlgItemMessageW },
6769 { NULL, NULL },
6870 };
6971
--- branches/unicode_buf/teraterm/common/compat_win.h (revision 8247)
+++ branches/unicode_buf/teraterm/common/compat_win.h (revision 8248)
@@ -67,6 +67,7 @@
6767 #define OPENFILENAME_SIZE_VERSION_400A 76
6868 #endif
6969
70+extern LRESULT (WINAPI *pSendDlgItemMessageW)(HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam);
7071 extern BOOL(WINAPI *pModifyMenuW)(HMENU hMnu, UINT uPosition, UINT uFlags, UINT_PTR uIDNewItem, LPCWSTR lpNewItem);
7172 extern BOOL(WINAPI *pSetWindowTextW)(HWND hWnd, LPCWSTR lpString);
7273 extern DWORD(WINAPI *pGetPrivateProfileStringW)(LPCWSTR lpAppName, LPCWSTR lpKeyName, LPCWSTR lpDefault,
--- branches/unicode_buf/teraterm/common/layer_for_unicode.cpp (revision 8247)
+++ branches/unicode_buf/teraterm/common/layer_for_unicode.cpp (revision 8248)
@@ -54,7 +54,7 @@
5454 UINT _DragQueryFileW(HDROP hDrop, UINT iFile, LPWSTR lpszFile, UINT cch)
5555 {
5656 if (pDragQueryFileW != NULL) {
57- return DragQueryFileW(hDrop, iFile, lpszFile, cch);
57+ return pDragQueryFileW(hDrop, iFile, lpszFile, cch);
5858 }
5959
6060 UINT retval;
@@ -88,7 +88,7 @@
8888 DWORD _GetFileAttributesW(LPCWSTR lpFileName)
8989 {
9090 if (pGetFileAttributesW != NULL) {
91- return GetFileAttributesW(lpFileName);
91+ return pGetFileAttributesW(lpFileName);
9292 }
9393
9494 char *FileNameA;
@@ -101,3 +101,20 @@
101101 free(FileNameA);
102102 return attr;
103103 }
104+
105+LRESULT _SendDlgItemMessageW(HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam)
106+{
107+ if (pSendDlgItemMessageW != NULL) {
108+ return pSendDlgItemMessageW(hDlg, nIDDlgItem, Msg, wParam, lParam);
109+ }
110+
111+ LRESULT retval;
112+ if (Msg == CB_ADDSTRING || Msg == LB_ADDSTRING) {
113+ char *strA = ToCharW((wchar_t *)lParam);
114+ retval = SendDlgItemMessageA(hDlg, nIDDlgItem, Msg, wParam, (LPARAM)strA);
115+ free(strA);
116+ } else {
117+ retval = SendDlgItemMessageA(hDlg, nIDDlgItem, Msg, wParam, lParam);
118+ }
119+ return retval;
120+}
--- branches/unicode_buf/teraterm/common/layer_for_unicode.h (revision 8247)
+++ branches/unicode_buf/teraterm/common/layer_for_unicode.h (revision 8248)
@@ -43,6 +43,7 @@
4343 BOOL _SetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPCWSTR lpString);
4444 DWORD _GetFileAttributesW(LPCWSTR lpFileName);
4545 UINT _DragQueryFileW(HDROP hDrop, UINT iFile, LPWSTR lpszFile, UINT cch);
46+LRESULT _SendDlgItemMessageW(HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam);
4647
4748 #ifdef __cplusplus
4849 }
--- branches/unicode_buf/teraterm/common/tmfc.cpp (revision 8247)
+++ branches/unicode_buf/teraterm/common/tmfc.cpp (revision 8248)
@@ -36,6 +36,7 @@
3636 #include <tchar.h>
3737 #include "dlglib.h"
3838 #include "ttlib.h"
39+#include "layer_for_unicode.h"
3940
4041 // テンプレートの書き換えを行う
4142 #define REWRITE_TEMPLATE
@@ -70,7 +71,7 @@
7071
7172 LRESULT TTCWnd::SendDlgItemMessageW(int id, UINT msg, WPARAM wp, LPARAM lp)
7273 {
73- return ::SendDlgItemMessageW(m_hWnd, id, msg, wp, lp);
74+ return ::_SendDlgItemMessageW(m_hWnd, id, msg, wp, lp);
7475 }
7576
7677 LRESULT TTCWnd::SendDlgItemMessageA(int id, UINT msg, WPARAM wp, LPARAM lp)
--- branches/unicode_buf/teraterm/ttpmacro/CMakeLists.txt (revision 8247)
+++ branches/unicode_buf/teraterm/ttpmacro/CMakeLists.txt (revision 8248)
@@ -33,7 +33,10 @@
3333 ../common/win16api.c
3434 ../common/codeconv.h
3535 ../common/codeconv.cpp
36+ ../common/dllutil.h
3637 ../common/dllutil.cpp
38+ ../common/layer_for_unicode.h
39+ ../common/layer_for_unicode.cpp
3740 )
3841
3942 source_group(
Show on old repository browser