_SendDlgItemMessageW()を追加
- SendDlgItemMessageW() の layer for uncode版
@@ -34,6 +34,7 @@ | ||
34 | 34 | |
35 | 35 | #include "dllutil.h" |
36 | 36 | |
37 | +LRESULT (WINAPI *pSendDlgItemMessageW)(HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam); | |
37 | 38 | BOOL (WINAPI *pModifyMenuW)(HMENU hMnu, UINT uPosition, UINT uFlags, UINT_PTR uIDNewItem, LPCWSTR lpNewItem); |
38 | 39 | BOOL (WINAPI *pSetWindowTextW)(HWND hWnd, LPCWSTR lpString); |
39 | 40 | DWORD (WINAPI *pGetPrivateProfileStringW)(LPCWSTR lpAppName, LPCWSTR lpKeyName, LPCWSTR lpDefault, LPWSTR lpReturnedString, DWORD nSize, LPCWSTR lpFileName); |
@@ -64,6 +65,7 @@ | ||
64 | 65 | { "SetDlgItemTextW", (void **)&pSetDlgItemTextW }, |
65 | 66 | { "SetWindowTextW", (void **)&pSetWindowTextW }, |
66 | 67 | { "ModifyMenuW", (void **)&pModifyMenuW }, |
68 | + { "SendDlgItemMessageW", (void **)&pSendDlgItemMessageW }, | |
67 | 69 | { NULL, NULL }, |
68 | 70 | }; |
69 | 71 |
@@ -67,6 +67,7 @@ | ||
67 | 67 | #define OPENFILENAME_SIZE_VERSION_400A 76 |
68 | 68 | #endif |
69 | 69 | |
70 | +extern LRESULT (WINAPI *pSendDlgItemMessageW)(HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam); | |
70 | 71 | extern BOOL(WINAPI *pModifyMenuW)(HMENU hMnu, UINT uPosition, UINT uFlags, UINT_PTR uIDNewItem, LPCWSTR lpNewItem); |
71 | 72 | extern BOOL(WINAPI *pSetWindowTextW)(HWND hWnd, LPCWSTR lpString); |
72 | 73 | extern DWORD(WINAPI *pGetPrivateProfileStringW)(LPCWSTR lpAppName, LPCWSTR lpKeyName, LPCWSTR lpDefault, |
@@ -54,7 +54,7 @@ | ||
54 | 54 | UINT _DragQueryFileW(HDROP hDrop, UINT iFile, LPWSTR lpszFile, UINT cch) |
55 | 55 | { |
56 | 56 | if (pDragQueryFileW != NULL) { |
57 | - return DragQueryFileW(hDrop, iFile, lpszFile, cch); | |
57 | + return pDragQueryFileW(hDrop, iFile, lpszFile, cch); | |
58 | 58 | } |
59 | 59 | |
60 | 60 | UINT retval; |
@@ -88,7 +88,7 @@ | ||
88 | 88 | DWORD _GetFileAttributesW(LPCWSTR lpFileName) |
89 | 89 | { |
90 | 90 | if (pGetFileAttributesW != NULL) { |
91 | - return GetFileAttributesW(lpFileName); | |
91 | + return pGetFileAttributesW(lpFileName); | |
92 | 92 | } |
93 | 93 | |
94 | 94 | char *FileNameA; |
@@ -101,3 +101,20 @@ | ||
101 | 101 | free(FileNameA); |
102 | 102 | return attr; |
103 | 103 | } |
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 | +} |
@@ -43,6 +43,7 @@ | ||
43 | 43 | BOOL _SetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPCWSTR lpString); |
44 | 44 | DWORD _GetFileAttributesW(LPCWSTR lpFileName); |
45 | 45 | UINT _DragQueryFileW(HDROP hDrop, UINT iFile, LPWSTR lpszFile, UINT cch); |
46 | +LRESULT _SendDlgItemMessageW(HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam); | |
46 | 47 | |
47 | 48 | #ifdef __cplusplus |
48 | 49 | } |
@@ -36,6 +36,7 @@ | ||
36 | 36 | #include <tchar.h> |
37 | 37 | #include "dlglib.h" |
38 | 38 | #include "ttlib.h" |
39 | +#include "layer_for_unicode.h" | |
39 | 40 | |
40 | 41 | // テンプレートの書き換えを行う |
41 | 42 | #define REWRITE_TEMPLATE |
@@ -70,7 +71,7 @@ | ||
70 | 71 | |
71 | 72 | LRESULT TTCWnd::SendDlgItemMessageW(int id, UINT msg, WPARAM wp, LPARAM lp) |
72 | 73 | { |
73 | - return ::SendDlgItemMessageW(m_hWnd, id, msg, wp, lp); | |
74 | + return ::_SendDlgItemMessageW(m_hWnd, id, msg, wp, lp); | |
74 | 75 | } |
75 | 76 | |
76 | 77 | LRESULT TTCWnd::SendDlgItemMessageA(int id, UINT msg, WPARAM wp, LPARAM lp) |
@@ -33,7 +33,10 @@ | ||
33 | 33 | ../common/win16api.c |
34 | 34 | ../common/codeconv.h |
35 | 35 | ../common/codeconv.cpp |
36 | + ../common/dllutil.h | |
36 | 37 | ../common/dllutil.cpp |
38 | + ../common/layer_for_unicode.h | |
39 | + ../common/layer_for_unicode.cpp | |
37 | 40 | ) |
38 | 41 | |
39 | 42 | source_group( |