• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision8472 (tree)
Time2020-01-14 01:26:16
Authorzmatsuo

Log Message

DialogBoxIndirectParamW() を使用

- ダイアログのタイトルバーが文字化けする場合があった
- 可能なら DialogBoxIndirectParamW() を使用する

- 使用できなければ従来どおり DialogBoxIndirectParamA() を使用する

Change Summary

Incremental Difference

--- trunk/teraterm/common/dlglib_cpp.cpp (revision 8471)
+++ trunk/teraterm/common/dlglib_cpp.cpp (revision 8472)
@@ -1,5 +1,5 @@
11 /*
2- * (C) 2005-2019 TeraTerm Project
2+ * (C) 2005-2020 TeraTerm Project
33 * All rights reserved.
44 *
55 * Redistribution and use in source and binary forms, with or without
@@ -225,9 +225,25 @@
225225 return DlgResult;
226226 #else
227227 DLGTEMPLATE *lpTemplate = TTGetDlgTemplate(hInstance, lpTemplateName);
228- INT_PTR DlgResult = DialogBoxIndirectParam(
229- hInstance, lpTemplate, hWndParent,
230- lpDialogFunc, lParamInit);
228+ INT_PTR DlgResult;
229+ static INT_PTR (WINAPI *pDialogBoxIndirectParamW)(HINSTANCE hInstance, LPCDLGTEMPLATEW hDialogTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam);
230+
231+ if (pDialogBoxIndirectParamW == NULL) {
232+ HMODULE hDll = LoadLibrary("user32.dll");
233+ FARPROC *proc = (FARPROC *)&pDialogBoxIndirectParamW;
234+ *proc = GetProcAddress(hDll, "DialogBoxIndirectParamW");
235+ }
236+
237+ if (pDialogBoxIndirectParamW == NULL) {
238+ DlgResult = DialogBoxIndirectParamA(
239+ hInstance, lpTemplate, hWndParent,
240+ lpDialogFunc, lParamInit);
241+ }
242+ else {
243+ DlgResult = pDialogBoxIndirectParamW(
244+ hInstance, lpTemplate, hWndParent,
245+ lpDialogFunc, lParamInit);
246+ }
231247 free(lpTemplate);
232248 return DlgResult;
233249 #endif
Show on old repository browser