diff --git a/TTProxy/YCL/include/YCL/Dialog.h b/TTProxy/YCL/include/YCL/Dialog.h index 7e837bed8..7c2ca8f1d 100644 --- a/TTProxy/YCL/include/YCL/Dialog.h +++ b/TTProxy/YCL/include/YCL/Dialog.h @@ -92,7 +92,7 @@ class Dialog : virtual public Window { SendMessage(WM_NEXTDLGCTL, previous, FALSE); } void gotoDlgCtrl(HWND control) { - SendMessage(WM_NEXTDLGCTL, (WPARAM) control, TRUE); + SendMessage(WM_NEXTDLGCTL, (WPARAM) control, TRUE); } @@ -101,11 +101,7 @@ class Dialog : virtual public Window { } INT_PTR open(HINSTANCE instance, int resourceId, HWND owner = NULL) { YCLVERIFY(prepareOpen(this) == NULL, "Another dialog has been opening yet."); -#if 0 - return ::DialogBoxParam(instance, MAKEINTRESOURCE(resourceId), owner, DialogProc, NULL); -#else - return TTDialogBoxParam(instance, MAKEINTRESOURCE(resourceId), owner, DialogProc, NULL); -#endif + return TTDialogBoxParam(instance, MAKEINTRESOURCEW(resourceId), owner, DialogProc, NULL); } protected: virtual bool dispatch(UINT message, WPARAM wparam, LPARAM lparam) { diff --git a/TTXSamples/TTXCheckUpdate/ttxcheckupdate.c b/TTXSamples/TTXCheckUpdate/ttxcheckupdate.c index 6aec91fa5..cab35a3f0 100644 --- a/TTXSamples/TTXCheckUpdate/ttxcheckupdate.c +++ b/TTXSamples/TTXCheckUpdate/ttxcheckupdate.c @@ -237,7 +237,7 @@ static void ShowDialog(HWND hWnd) /* ダイアログを出す */ SetDialogFont(pvar->ts->DialogFontNameW, pvar->ts->DialogFontPoint, pvar->ts->DialogFontCharSet, pvar->ts->UILanguageFileW, "Tera Term", "DLG_TAHOMA_FONT"); - TTDialogBoxParam(pvar->hInst, MAKEINTRESOURCE(IDD_CHECK_UPDATE_DIALOG), hWnd, DlgProc, (LPARAM)pvar); + TTDialogBoxParam(pvar->hInst, MAKEINTRESOURCEW(IDD_CHECK_UPDATE_DIALOG), hWnd, DlgProc, (LPARAM)pvar); /* 終了 */ free(json_ptr); diff --git a/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c b/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c index 34e718b38..5de730d7c 100644 --- a/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c +++ b/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c @@ -539,7 +539,7 @@ static int PASCAL TTXProcessCommand(HWND hWin, WORD cmd) { case ID_MENU_SETUP: SetDialogFont(pvar->ts->DialogFontNameW, pvar->ts->DialogFontPoint, pvar->ts->DialogFontCharSet, pvar->ts->UILanguageFileW, SECTION, "DLG_TAHOMA_FONT"); - switch (TTDialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SETUP_RECURRINGCOMMAND), + switch (TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_SETUP_RECURRINGCOMMAND), hWin, RecurringCommandSetting, (LPARAM)NULL)) { case IDOK: break; diff --git a/TTXSamples/TTXViewMode/TTXViewMode.c b/TTXSamples/TTXViewMode/TTXViewMode.c index 0852a305f..62b7132dd 100644 --- a/TTXSamples/TTXViewMode/TTXViewMode.c +++ b/TTXSamples/TTXViewMode/TTXViewMode.c @@ -224,7 +224,7 @@ static int PASCAL TTXProcessCommand(HWND hWin, WORD cmd) { if (strcmp(pvar->password, "") != 0) { SetDialogFont(pvar->ts->DialogFontNameW, pvar->ts->DialogFontPoint, pvar->ts->DialogFontCharSet, pvar->ts->UILanguageFileW, "TTXViewMode", "DLG_TAHOMA_FONT"); - switch (TTDialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INPUT_PASSWORD), hWin, ViewModeInputPass, (LPARAM)NULL)) { + switch (TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_INPUT_PASSWORD), hWin, ViewModeInputPass, (LPARAM)NULL)) { case IDOK: pvar->enable = FALSE; CheckMenuItem(pvar->ControlMenu, ID_MENU_VIEWMODE, MF_BYCOMMAND | MF_UNCHECKED); @@ -251,7 +251,7 @@ static int PASCAL TTXProcessCommand(HWND hWin, WORD cmd) { case ID_MENU_SETPASS: SetDialogFont(pvar->ts->DialogFontNameW, pvar->ts->DialogFontPoint, pvar->ts->DialogFontCharSet, pvar->ts->UILanguageFileW, "TTXViewMode", "DLG_TAHOMA_FONT"); - switch (TTDialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SET_PASSWORD), hWin, ViewModeSetPass, (LPARAM)NULL)) { + switch (TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_SET_PASSWORD), hWin, ViewModeSetPass, (LPARAM)NULL)) { case IDOK: break; case IDCANCEL: diff --git a/teraterm/common/dlglib.h b/teraterm/common/dlglib.h index 166a2dc33..4181cb848 100644 --- a/teraterm/common/dlglib.h +++ b/teraterm/common/dlglib.h @@ -53,7 +53,7 @@ void SetEditboxEmacsKeybind(HWND hDlg, int nID); void TTSetDlgFontA(const char *face, int height, int charset); void TTSetDlgFontW(const wchar_t *face, int height, int charset); const wchar_t *TTGetClassName(const DLGTEMPLATE *DlgTempl); -DLGTEMPLATE *TTGetDlgTemplate(HINSTANCE hInst, LPCTSTR lpTemplateName); +DLGTEMPLATE *TTGetDlgTemplate(HINSTANCE hInst, LPCWSTR lpTemplateName); DLGTEMPLATE *TTGetNewDlgTemplate( HINSTANCE hInst, const DLGTEMPLATE *src, size_t *PrevTemplSize, size_t *NewTemplSize); @@ -66,24 +66,24 @@ HWND TTCreateDialogIndirectParam( LPARAM lParamInit); HWND TTCreateDialogParam( HINSTANCE hInstance, - LPCTSTR lpTemplateName, + LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit); HWND TTCreateDialog( HINSTANCE hInstance, - LPCTSTR lpTemplateName, + LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc); INT_PTR TTDialogBoxParam( HINSTANCE hInstance, - LPCTSTR lpTemplateName, + LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit); INT_PTR TTDialogBox( HINSTANCE hInstance, - LPCTSTR lpTemplateName, + LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc); void SetDialogFont(const wchar_t *FontName, int FontHeight, int FontCharSet, diff --git a/teraterm/common/dlglib_cpp.cpp b/teraterm/common/dlglib_cpp.cpp index 4d8f770f5..30ee02619 100644 --- a/teraterm/common/dlglib_cpp.cpp +++ b/teraterm/common/dlglib_cpp.cpp @@ -57,7 +57,7 @@ BOOL TTEndDialog(HWND hDlgWnd, INT_PTR nResult) */ HWND TTCreateDialogIndirectParam( HINSTANCE hInstance, - LPCTSTR lpTemplateName, + LPCWSTR lpTemplateName, HWND hWndParent, // オーナーウィンドウのハンドル DLGPROC lpDialogFunc, // ダイアログボックスプロシージャへのポインタ LPARAM lParamInit) // 初期化値 @@ -73,7 +73,7 @@ HWND TTCreateDialogIndirectParam( */ HWND TTCreateDialogParam( HINSTANCE hInstance, - LPCTSTR lpTemplateName, + LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit) @@ -87,7 +87,7 @@ HWND TTCreateDialogParam( */ HWND TTCreateDialog( HINSTANCE hInstance, - LPCTSTR lpTemplateName, + LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc) { @@ -99,7 +99,7 @@ HWND TTCreateDialog( * DialogBoxParam() 互換関数 * EndDialog()ではなく、TTEndDialog()を使用すること */ -INT_PTR TTDialogBoxParam(HINSTANCE hInstance, LPCTSTR lpTemplateName, +INT_PTR TTDialogBoxParam(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, // オーナーウィンドウのハンドル DLGPROC lpDialogFunc, // ダイアログボックスプロシージャへのポインタ LPARAM lParamInit) // 初期化値 @@ -114,7 +114,7 @@ INT_PTR TTDialogBoxParam(HINSTANCE hInstance, LPCTSTR lpTemplateName, * DialogBox() 互換関数 * EndDialog()ではなく、TTEndDialog()を使用すること */ -INT_PTR TTDialogBox(HINSTANCE hInstance, LPCTSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc) +INT_PTR TTDialogBox(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc) { return TTDialogBoxParam(hInstance, lpTemplateName, hWndParent, lpDialogFunc, (LPARAM)NULL); } diff --git a/teraterm/common/dlglib_tmpl.cpp b/teraterm/common/dlglib_tmpl.cpp index 180e6f9d4..5a09d3ed3 100644 --- a/teraterm/common/dlglib_tmpl.cpp +++ b/teraterm/common/dlglib_tmpl.cpp @@ -403,11 +403,13 @@ static DLGTEMPLATE *GetDlgTemplate( } static DLGTEMPLATE *GetDlgTemplate( - HINSTANCE hInst, LPCTSTR lpTemplateName, + HINSTANCE hInst, LPCWSTR lpTemplateName, const WCHAR *FontFaceName, LONG FontHeight, BYTE FontCharSet, size_t *PrevTemplSize, size_t *NewTemplSize) { - HRSRC hResource = ::FindResource(hInst, lpTemplateName, RT_DIALOG); +#define RT_DIALOG_W MAKEINTRESOURCEW(5) + + HRSRC hResource = ::FindResourceW(hInst, lpTemplateName, RT_DIALOG_W); assert(hResource != NULL); HANDLE hDlgTemplate = ::LoadResource(hInst, hResource); const DLGTEMPLATE *src = (DLGTEMPLATE *)::LockResource(hDlgTemplate); @@ -471,7 +473,7 @@ DLGTEMPLATE *TTGetNewDlgTemplate( return DlgTemplate; } -DLGTEMPLATE *TTGetDlgTemplate(HINSTANCE hInst, LPCTSTR lpTemplateName) +DLGTEMPLATE *TTGetDlgTemplate(HINSTANCE hInst, LPCWSTR lpTemplateName) { DLGTEMPLATE *DlgTemplate = GetDlgTemplate(hInst, lpTemplateName, diff --git a/teraterm/common/edithistory.cpp b/teraterm/common/edithistory.cpp index 9b725634b..bd632a42f 100644 --- a/teraterm/common/edithistory.cpp +++ b/teraterm/common/edithistory.cpp @@ -336,7 +336,7 @@ BOOL EditHistoryDlg(HWND WndParent, PTTSet ts) const HINSTANCE hinst = (HINSTANCE)GetWindowLongPtr(WndParent, GWLP_HINSTANCE); data->ts = ts; r= (BOOL)TTDialogBoxParam(hinst, - MAKEINTRESOURCE(IDD_EDITHISTORYDLG), + MAKEINTRESOURCEW(IDD_EDITHISTORYDLG), WndParent, TCPIPDlg, (LPARAM)data); free(data); return r; diff --git a/teraterm/common/tmfc.cpp b/teraterm/common/tmfc.cpp index d1cbfcd65..aafce1f49 100644 --- a/teraterm/common/tmfc.cpp +++ b/teraterm/common/tmfc.cpp @@ -481,7 +481,7 @@ INT_PTR TTCDialog::DoModal(HINSTANCE hInstance, HWND hParent, int idd) #if defined(REWRITE_TEMPLATE) INT_PTR result = TTDialogBoxParam(hInstance, - MAKEINTRESOURCE(idd), + MAKEINTRESOURCEW(idd), hParent, &DlgProcStub, (LPARAM)this); #else @@ -503,7 +503,7 @@ BOOL TTCDialog::Create(HINSTANCE hInstance, HWND hParent, int idd) m_hInst = hInstance; m_hParentWnd = hParent; #if defined(REWRITE_TEMPLATE) - DLGTEMPLATE *lpTemplate = TTGetDlgTemplate(hInstance, MAKEINTRESOURCE(idd)); + DLGTEMPLATE *lpTemplate = TTGetDlgTemplate(hInstance, MAKEINTRESOURCEW(idd)); #else HRSRC hResource = ::FindResource(hInstance, MAKEINTRESOURCE(idd), RT_DIALOG); HANDLE hDlgTemplate = ::LoadResource(hInstance, hResource); diff --git a/teraterm/common/tmfc_property.cpp b/teraterm/common/tmfc_property.cpp index ec348017b..78a03ff06 100644 --- a/teraterm/common/tmfc_property.cpp +++ b/teraterm/common/tmfc_property.cpp @@ -51,7 +51,7 @@ TTCPropertyPage::TTCPropertyPage(HINSTANCE inst, int id) m_psp.pszTemplate = MAKEINTRESOURCEW(id); #if defined(REWRITE_TEMPLATE) m_psp.dwFlags |= PSP_DLGINDIRECT; - m_psp.pResource = TTGetDlgTemplate(inst, MAKEINTRESOURCEA(id)); + m_psp.pResource = TTGetDlgTemplate(inst, MAKEINTRESOURCEW(id)); #endif m_psp.pfnDlgProc = Proc; m_psp.lParam = (LPARAM)this; diff --git a/teraterm/teraterm/broadcast.cpp b/teraterm/teraterm/broadcast.cpp index 53cdba342..8aa255f92 100644 --- a/teraterm/teraterm/broadcast.cpp +++ b/teraterm/teraterm/broadcast.cpp @@ -1020,7 +1020,7 @@ void BroadCastShowDialog(HINSTANCE hInst, HWND hWnd) // CreateDialogW() で生成したダイアログは、 // エディットボックスにIMEからの入力が化けることがある (20/05/27,Windows10 64bit) // ペーストはok - hDlgWnd = TTCreateDialog(hInst, MAKEINTRESOURCE(IDD_BROADCAST_DIALOG), + hDlgWnd = TTCreateDialog(hInst, MAKEINTRESOURCEW(IDD_BROADCAST_DIALOG), hWnd, BroadcastCommandDlgProc); if (hDlgWnd == NULL) { diff --git a/teraterm/teraterm/clipboarddlg.cpp b/teraterm/teraterm/clipboarddlg.cpp index d9f574b04..a230e1965 100644 --- a/teraterm/teraterm/clipboarddlg.cpp +++ b/teraterm/teraterm/clipboarddlg.cpp @@ -246,7 +246,7 @@ INT_PTR clipboarddlg( DlgPrivateData *pdata = (DlgPrivateData * )calloc(1, sizeof(DlgPrivateData)); INT_PTR ret; pdata->data = data; - ret = TTDialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_CLIPBOARD_DIALOG), + ret = TTDialogBoxParam(hInstance, MAKEINTRESOURCEW(IDD_CLIPBOARD_DIALOG), hWndParent, OnClipboardDlgProc, (LPARAM)pdata); free(pdata); return ret; diff --git a/teraterm/teraterm/coding_pp.cpp b/teraterm/teraterm/coding_pp.cpp index be7542ccb..c571ddc2f 100644 --- a/teraterm/teraterm/coding_pp.cpp +++ b/teraterm/teraterm/coding_pp.cpp @@ -414,7 +414,7 @@ HPROPSHEETPAGE CodingPageCreate(HINSTANCE inst, TTTSet *pts) psp.pszTemplate = MAKEINTRESOURCEW(id); #if defined(REWRITE_TEMPLATE) psp.dwFlags |= PSP_DLGINDIRECT; - Param->dlg_templ = TTGetDlgTemplate(inst, MAKEINTRESOURCEA(id)); + Param->dlg_templ = TTGetDlgTemplate(inst, MAKEINTRESOURCEW(id)); psp.pResource = Param->dlg_templ; #endif diff --git a/teraterm/teraterm/dnddlg.cpp b/teraterm/teraterm/dnddlg.cpp index cc7d60396..40b00f593 100644 --- a/teraterm/teraterm/dnddlg.cpp +++ b/teraterm/teraterm/dnddlg.cpp @@ -274,7 +274,7 @@ enum drop_type ShowDropDialogBox( Param.UILanguageFile = pts->UILanguageFileW; INT_PTR ret = TTDialogBoxParam( - hInstance, MAKEINTRESOURCE(IDD_DAD_DIALOG), + hInstance, MAKEINTRESOURCEW(IDD_DAD_DIALOG), hWndParent, (DLGPROC)OnDragDropDlgProc, (LPARAM)&Param); if (ret != IDOK) { diff --git a/teraterm/teraterm/filesys_log.cpp b/teraterm/teraterm/filesys_log.cpp index 20609ec51..321314a68 100644 --- a/teraterm/teraterm/filesys_log.cpp +++ b/teraterm/teraterm/filesys_log.cpp @@ -869,7 +869,7 @@ void FLogAddCommentDlg(HINSTANCE hInst, HWND hWnd) if (fv == NULL) { return; } - TTDialogBox(hInst, MAKEINTRESOURCE(IDD_COMMENT_DIALOG), + TTDialogBox(hInst, MAKEINTRESOURCEW(IDD_COMMENT_DIALOG), hWnd, OnCommentDlgProc); } diff --git a/teraterm/teraterm/filesys_proto.cpp b/teraterm/teraterm/filesys_proto.cpp index fb61f4229..0eeeea511 100644 --- a/teraterm/teraterm/filesys_proto.cpp +++ b/teraterm/teraterm/filesys_proto.cpp @@ -854,7 +854,7 @@ static BOOL _GetGetFname(HWND HWin, PFileVarProto fv, PTTSet ts) SetDialogFont(ts->DialogFontNameW, ts->DialogFontPoint, ts->DialogFontCharSet, ts->UILanguageFileW, "Tera Term", "DLG_SYSTEM_FONT"); return (BOOL)TTDialogBoxParam(hInst, - MAKEINTRESOURCE(IDD_GETFNDLG), + MAKEINTRESOURCEW(IDD_GETFNDLG), HWin, GetFnDlg, (LPARAM)fv); } diff --git a/teraterm/teraterm/font_pp.cpp b/teraterm/teraterm/font_pp.cpp index 8a82cef95..540e4fd1b 100644 --- a/teraterm/teraterm/font_pp.cpp +++ b/teraterm/teraterm/font_pp.cpp @@ -391,7 +391,7 @@ HPROPSHEETPAGE FontPageCreate(HINSTANCE inst, TTTSet *pts) psp.pszTemplate = MAKEINTRESOURCEW(id); #if defined(REWRITE_TEMPLATE) psp.dwFlags |= PSP_DLGINDIRECT; - Param->dlg_templ = TTGetDlgTemplate(inst, MAKEINTRESOURCEA(id)); + Param->dlg_templ = TTGetDlgTemplate(inst, MAKEINTRESOURCEW(id)); psp.pResource = Param->dlg_templ; #endif diff --git a/teraterm/teraterm/keyboard_pp.c b/teraterm/teraterm/keyboard_pp.c index 71e27ad03..2390cb6fb 100644 --- a/teraterm/teraterm/keyboard_pp.c +++ b/teraterm/teraterm/keyboard_pp.c @@ -178,7 +178,7 @@ HPROPSHEETPAGE KeyboardPageCreate(HINSTANCE inst, TTTSet *pts) psp.pszTemplate = MAKEINTRESOURCEW(id); #if defined(REWRITE_TEMPLATE) psp.dwFlags |= PSP_DLGINDIRECT; - Param->dlg_templ = TTGetDlgTemplate(inst, MAKEINTRESOURCEA(id)); + Param->dlg_templ = TTGetDlgTemplate(inst, MAKEINTRESOURCEW(id)); psp.pResource = Param->dlg_templ; #endif diff --git a/teraterm/teraterm/logdlg.cpp b/teraterm/teraterm/logdlg.cpp index 891ec4bff..02f3ff806 100644 --- a/teraterm/teraterm/logdlg.cpp +++ b/teraterm/teraterm/logdlg.cpp @@ -475,7 +475,7 @@ BOOL FLogOpenDialog(HINSTANCE hInst_, HWND hWnd, FLogDlgInfo_t *info) work->pts = info->pts; work->pcv = info->pcv; INT_PTR ret = TTDialogBoxParam( - hInst_, MAKEINTRESOURCE(IDD_LOGDLG), + hInst_, MAKEINTRESOURCEW(IDD_LOGDLG), hWnd, LogFnHook, (LPARAM)work); free(work); return ret == IDOK ? TRUE : FALSE; diff --git a/teraterm/teraterm/mouse_pp.cpp b/teraterm/teraterm/mouse_pp.cpp index 6c9500a70..2fdb74ae0 100644 --- a/teraterm/teraterm/mouse_pp.cpp +++ b/teraterm/teraterm/mouse_pp.cpp @@ -134,7 +134,7 @@ HPROPSHEETPAGE MousePageCreate(HINSTANCE inst, TTTSet *pts) psp.pszTemplate = MAKEINTRESOURCEW(IDD_TABSHEET_MOUSE); #if defined(REWRITE_TEMPLATE) psp.dwFlags |= PSP_DLGINDIRECT; - Param->dlg_templ = TTGetDlgTemplate(inst, MAKEINTRESOURCEA(IDD_TABSHEET_MOUSE)); + Param->dlg_templ = TTGetDlgTemplate(inst, MAKEINTRESOURCEW(IDD_TABSHEET_MOUSE)); psp.pResource = Param->dlg_templ; #endif diff --git a/teraterm/teraterm/prnabort.cpp b/teraterm/teraterm/prnabort.cpp index 7eebf6828..edce4badc 100644 --- a/teraterm/teraterm/prnabort.cpp +++ b/teraterm/teraterm/prnabort.cpp @@ -85,7 +85,7 @@ BOOL CPrnAbortDlg::Create(HINSTANCE hInstance, HWND hParent, PBOOL AbortFlag, PT SetDialogFont(m_ts->DialogFontNameW, m_ts->DialogFontPoint, m_ts->DialogFontCharSet, m_ts->UILanguageFileW, "Tera Term", "DLG_SYSTEM_FONT"); HWND hWnd = TTCreateDialogParam( - hInstance, MAKEINTRESOURCE(IDD_PRNABORTDLG), hParent, + hInstance, MAKEINTRESOURCEW(IDD_PRNABORTDLG), hParent, (DLGPROC)OnDlgProc, (LPARAM)this); if (hWnd == NULL) { diff --git a/teraterm/teraterm/sendfiledlg.cpp b/teraterm/teraterm/sendfiledlg.cpp index 095e97386..5d53560ca 100644 --- a/teraterm/teraterm/sendfiledlg.cpp +++ b/teraterm/teraterm/sendfiledlg.cpp @@ -248,6 +248,6 @@ INT_PTR sendfiledlg(HINSTANCE hInstance, HWND hWndParent, sendfiledlgdata *data) { INT_PTR ret; data->method_4 = FALSE; - ret = TTDialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_SENDFILEDLG), hWndParent, SendFileDlgProc, (LPARAM)data); + ret = TTDialogBoxParam(hInstance, MAKEINTRESOURCEW(IDD_SENDFILEDLG), hWndParent, SendFileDlgProc, (LPARAM)data); return ret; } diff --git a/teraterm/teraterm/setupdirdlg.cpp b/teraterm/teraterm/setupdirdlg.cpp index 0132627c7..eaf68a3b0 100644 --- a/teraterm/teraterm/setupdirdlg.cpp +++ b/teraterm/teraterm/setupdirdlg.cpp @@ -707,7 +707,7 @@ void SetupDirectoryDialog(HINSTANCE hInst, HWND hWnd, TComVar *pcv) { dlg_data_t* dlg_data = (dlg_data_t*)calloc(1, sizeof(dlg_data_t)); dlg_data->pcv = pcv; - TTDialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SETUP_DIR_DIALOG), + TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_SETUP_DIR_DIALOG), hWnd, OnSetupDirectoryDlgProc, (LPARAM)dlg_data); free(dlg_data); } diff --git a/teraterm/teraterm/tcpip_pp.cpp b/teraterm/teraterm/tcpip_pp.cpp index 86170f264..6e523e72e 100644 --- a/teraterm/teraterm/tcpip_pp.cpp +++ b/teraterm/teraterm/tcpip_pp.cpp @@ -178,7 +178,7 @@ HPROPSHEETPAGE TcpIPPageCreate(HINSTANCE inst, TTTSet *pts) psp.pszTemplate = MAKEINTRESOURCEW(IDD_TCPIPDLG); #if defined(REWRITE_TEMPLATE) psp.dwFlags |= PSP_DLGINDIRECT; - Param->dlg_templ = TTGetDlgTemplate(inst, MAKEINTRESOURCEA(IDD_TCPIPDLG)); + Param->dlg_templ = TTGetDlgTemplate(inst, MAKEINTRESOURCEW(IDD_TCPIPDLG)); psp.pResource = Param->dlg_templ; #endif diff --git a/teraterm/teraterm/term_pp.cpp b/teraterm/teraterm/term_pp.cpp index ea38df233..d33378b87 100644 --- a/teraterm/teraterm/term_pp.cpp +++ b/teraterm/teraterm/term_pp.cpp @@ -294,7 +294,7 @@ HPROPSHEETPAGE CreateTerminalPP(HINSTANCE inst, HWND vtwin, TTTSet *pts) psp.pszTemplate = MAKEINTRESOURCEW(id); #if defined(REWRITE_TEMPLATE) psp.dwFlags |= PSP_DLGINDIRECT; - psp.pResource = TTGetDlgTemplate(inst, MAKEINTRESOURCEA(id)); + psp.pResource = TTGetDlgTemplate(inst, MAKEINTRESOURCEW(id)); #endif psp.pfnDlgProc = TermDlg; psp.lParam = (LPARAM)data; diff --git a/teraterm/teraterm/theme_pp.cpp b/teraterm/teraterm/theme_pp.cpp index 4acba4383..ca5cb0d34 100644 --- a/teraterm/teraterm/theme_pp.cpp +++ b/teraterm/teraterm/theme_pp.cpp @@ -303,7 +303,7 @@ HPROPSHEETPAGE ThemePageCreate(HINSTANCE inst, TTTSet *pts) psp.pszTemplate = MAKEINTRESOURCEW(id); #if defined(REWRITE_TEMPLATE) psp.dwFlags |= PSP_DLGINDIRECT; - Param->dlg_templ = TTGetDlgTemplate(inst, MAKEINTRESOURCEA(id)); + Param->dlg_templ = TTGetDlgTemplate(inst, MAKEINTRESOURCEW(id)); psp.pResource = Param->dlg_templ; #endif diff --git a/teraterm/teraterm/themedlg.cpp b/teraterm/teraterm/themedlg.cpp index 423dab673..2a0abd151 100644 --- a/teraterm/teraterm/themedlg.cpp +++ b/teraterm/teraterm/themedlg.cpp @@ -472,7 +472,7 @@ static HPROPSHEETPAGE ThemeEditorCreate(ThemeDlgData *dlg_data) psp.pszTitle = title; psp.pszTemplate = MAKEINTRESOURCEW(id); psp.dwFlags |= PSP_DLGINDIRECT; - psp.pResource = TTGetDlgTemplate(inst, MAKEINTRESOURCEA(id)); + psp.pResource = TTGetDlgTemplate(inst, MAKEINTRESOURCEW(id)); psp.pfnDlgProc = BGThemeProc; psp.lParam = (LPARAM)dlg_data; @@ -813,7 +813,7 @@ static HPROPSHEETPAGE ColorThemeEditorCreate(ThemeDlgData *dlg_data) psp.pszTemplate = MAKEINTRESOURCEW(id); #if 1 psp.dwFlags |= PSP_DLGINDIRECT; - psp.pResource = TTGetDlgTemplate(inst, MAKEINTRESOURCEA(id)); + psp.pResource = TTGetDlgTemplate(inst, MAKEINTRESOURCEW(id)); #endif psp.pfnDlgProc = ColorThemeProc; @@ -1013,7 +1013,7 @@ static HPROPSHEETPAGE ThemeEditorFile(ThemeDlgData* dlg_data) psp.pszTemplate = MAKEINTRESOURCEW(id); #if 1 psp.dwFlags |= PSP_DLGINDIRECT; - psp.pResource = TTGetDlgTemplate(inst, MAKEINTRESOURCEA(id)); + psp.pResource = TTGetDlgTemplate(inst, MAKEINTRESOURCEW(id)); #endif psp.pfnDlgProc = FileProc; @@ -1118,7 +1118,7 @@ static HPROPSHEETPAGE BGAlphaCreate(ThemeDlgData *dlg_data) psp.pszTemplate = MAKEINTRESOURCEW(id); #if 1 psp.dwFlags |= PSP_DLGINDIRECT; - psp.pResource = TTGetDlgTemplate(inst, MAKEINTRESOURCEA(id)); + psp.pResource = TTGetDlgTemplate(inst, MAKEINTRESOURCEW(id)); #endif psp.pfnDlgProc = BGAlphaProc; diff --git a/teraterm/teraterm/win_pp.cpp b/teraterm/teraterm/win_pp.cpp index b90002a10..beb4c2dac 100644 --- a/teraterm/teraterm/win_pp.cpp +++ b/teraterm/teraterm/win_pp.cpp @@ -565,7 +565,7 @@ HPROPSHEETPAGE CreateWinPP(HINSTANCE inst, HWND vtwin, TTTSet *pts) psp.pszTemplate = MAKEINTRESOURCEW(id); #if defined(REWRITE_TEMPLATE) psp.dwFlags |= PSP_DLGINDIRECT; - psp.pResource = TTGetDlgTemplate(inst, MAKEINTRESOURCEA(id)); + psp.pResource = TTGetDlgTemplate(inst, MAKEINTRESOURCEW(id)); #endif psp.pfnDlgProc = WinDlg; psp.lParam = (LPARAM)data; diff --git a/teraterm/ttpdlg/aboutdlg.c b/teraterm/ttpdlg/aboutdlg.c index 9d2d04b88..8b7907f4c 100644 --- a/teraterm/ttpdlg/aboutdlg.c +++ b/teraterm/ttpdlg/aboutdlg.c @@ -529,6 +529,6 @@ BOOL WINAPI _AboutDialog(HWND WndParent) { return (BOOL)TTDialogBox(hInst, - MAKEINTRESOURCE(IDD_ABOUTDLG), + MAKEINTRESOURCEW(IDD_ABOUTDLG), WndParent, AboutDlg); } diff --git a/teraterm/ttpdlg/generaldlg.c b/teraterm/ttpdlg/generaldlg.c index 3cea3d8cd..b9a7d569f 100644 --- a/teraterm/ttpdlg/generaldlg.c +++ b/teraterm/ttpdlg/generaldlg.c @@ -282,7 +282,7 @@ BOOL WINAPI _SetupGeneral(HWND WndParent, PTTSet ts) data.lng_infos = infos; data.lng_size = infos_size; INT_PTR r = TTDialogBoxParam(hInst, - MAKEINTRESOURCE(IDD_GENDLG), + MAKEINTRESOURCEW(IDD_GENDLG), WndParent, GenDlg, (LPARAM)&data); LangFree(infos, infos_size); return (BOOL)r; diff --git a/teraterm/ttpdlg/hostdlg.c b/teraterm/ttpdlg/hostdlg.c index 4b1d0658c..df5a6e7bf 100644 --- a/teraterm/ttpdlg/hostdlg.c +++ b/teraterm/ttpdlg/hostdlg.c @@ -301,6 +301,6 @@ BOOL WINAPI _GetHostName(HWND WndParent, PGetHNRec GetHNRec) { return (BOOL)TTDialogBoxParam(hInst, - MAKEINTRESOURCE(IDD_HOSTDLG), + MAKEINTRESOURCEW(IDD_HOSTDLG), WndParent, HostDlg, (LPARAM)GetHNRec); } diff --git a/teraterm/ttpdlg/serialdlg.cpp b/teraterm/ttpdlg/serialdlg.cpp index d7e36239a..9cbb3db48 100644 --- a/teraterm/ttpdlg/serialdlg.cpp +++ b/teraterm/ttpdlg/serialdlg.cpp @@ -450,7 +450,7 @@ BOOL WINAPI _SetupSerialPort(HWND WndParent, PTTSet ts) } r = (BOOL)TTDialogBoxParam(hInst, - MAKEINTRESOURCE(IDD_SERIALDLG), + MAKEINTRESOURCEW(IDD_SERIALDLG), WndParent, SerialDlg, (LPARAM)dlg_data); ComPortInfoFree(dlg_data->ComPortInfoPtr, dlg_data->ComPortInfoCount); diff --git a/teraterm/ttpdlg/windowdlg.cpp b/teraterm/ttpdlg/windowdlg.cpp index 062ac56ce..476777fa8 100644 --- a/teraterm/ttpdlg/windowdlg.cpp +++ b/teraterm/ttpdlg/windowdlg.cpp @@ -141,7 +141,7 @@ BOOL WINAPI _WindowWindow(HWND WndParent, PBOOL Close) *Close = FALSE; return (BOOL)TTDialogBoxParam(hInst, - MAKEINTRESOURCE(IDD_WINLISTDLG), + MAKEINTRESOURCEW(IDD_WINLISTDLG), WndParent, WinListDlg, (LPARAM)Close); } diff --git a/ttpmenu/ttpmenu.cpp b/ttpmenu/ttpmenu.cpp index 53877114a..689ff2d39 100644 --- a/ttpmenu/ttpmenu.cpp +++ b/ttpmenu/ttpmenu.cpp @@ -2026,7 +2026,7 @@ BOOL ManageWMCommand_Config(HWND hWnd, WPARAM wParam) return TRUE; case BUTTON_ETC: ::GetDlgItemTextW(hWnd, EDIT_ENTRY, g_JobInfo.szName, MAX_PATH); - TTDialogBox(g_hI, MAKEINTRESOURCE(DIALOG_ETC), hWnd, DlgCallBack_Etc); + TTDialogBox(g_hI, MAKEINTRESOURCEW(DIALOG_ETC), hWnd, DlgCallBack_Etc); return TRUE; case LIST_HOST: if (HIWORD(wParam) == LBN_SELCHANGE) @@ -2065,7 +2065,7 @@ BOOL ManageWMCommand_Config(HWND hWnd, WPARAM wParam) pData.pEncryptPassword = g_JobInfo.szPassword; pData.pDecryptPassword = szPassword; pData.nMessageFlag = 0; - if (TTDialogBoxParam(g_hI, MAKEINTRESOURCE(DIALOG_LOCKBOX), hWnd, DlgCallBack_LockBox, (LPARAM)&pData) == TRUE) { + if (TTDialogBoxParam(g_hI, MAKEINTRESOURCEW(DIALOG_LOCKBOX), hWnd, DlgCallBack_LockBox, (LPARAM)&pData) == TRUE) { ::CheckDlgButton(hWnd, CHECK_LOCKBOX, 1); ::PostMessage(hWnd, WM_COMMAND, (WPARAM) CHECK_LOCKBOX, (LPARAM) 1); } @@ -2077,7 +2077,7 @@ BOOL ManageWMCommand_Config(HWND hWnd, WPARAM wParam) pData.pEncryptPassword = g_JobInfo.szPassword; pData.pDecryptPassword = szPassword; pData.nMessageFlag = 0; - if (TTDialogBoxParam(g_hI, MAKEINTRESOURCE(DIALOG_LOCKBOX), hWnd, DlgCallBack_LockBox, (LPARAM)&pData) == TRUE) { + if (TTDialogBoxParam(g_hI, MAKEINTRESOURCEW(DIALOG_LOCKBOX), hWnd, DlgCallBack_LockBox, (LPARAM)&pData) == TRUE) { if (g_JobInfo.bLockBox == TRUE) { ::SetDlgItemTextA(hWnd, EDIT_PASSWORD, pData.pDecryptPassword); } @@ -2263,13 +2263,13 @@ BOOL ManageWMCommand_Menu(HWND hWnd, WPARAM wParam) switch(LOWORD(wParam)) { case ID_TMENU_ADD: - TTDialogBox(g_hI, MAKEINTRESOURCE(DIALOG_CONFIG), 0, DlgCallBack_Config); + TTDialogBox(g_hI, MAKEINTRESOURCEW(DIALOG_CONFIG), 0, DlgCallBack_Config); return TRUE; case ID_TMENU_CLOSE: ::DestroyWindow(hWnd); return TRUE; case ID_VERSION: - TTDialogBox(g_hI, MAKEINTRESOURCE(DIALOG_VERSION), hWnd, DlgCallBack_Version); + TTDialogBox(g_hI, MAKEINTRESOURCEW(DIALOG_VERSION), hWnd, DlgCallBack_Version); return TRUE; case ID_ICON: if (GetMenuState(g_hConfigMenu, ID_ICON, MF_BYCOMMAND & MF_CHECKED) != 0) { @@ -2496,7 +2496,7 @@ BOOL DecryptPassword(char *szEncryptPassword, char *szDecryptPassword, HWND hWnd pData.bLockBox = TRUE; pData.pEncryptPassword = szEncryptPassword; pData.pDecryptPassword = szDecryptPassword; - if ((ret = (BOOL)TTDialogBoxParam(g_hI, MAKEINTRESOURCE(DIALOG_LOCKBOX), hWnd, DlgCallBack_LockBox, (LPARAM)&pData)) == FALSE) { + if ((ret = (BOOL)TTDialogBoxParam(g_hI, MAKEINTRESOURCEW(DIALOG_LOCKBOX), hWnd, DlgCallBack_LockBox, (LPARAM)&pData)) == FALSE) { szDecryptPassword[0] = 0; } } diff --git a/ttssh2/ttxssh/auth.c b/ttssh2/ttxssh/auth.c index bfaf312a3..9e0c2bb5e 100644 --- a/ttssh2/ttxssh/auth.c +++ b/ttssh2/ttxssh/auth.c @@ -63,13 +63,6 @@ #define USER_PASSWORD_IS_UTF8 1 -#undef DialogBoxParam -#define DialogBoxParam(p1,p2,p3,p4,p5) \ - TTDialogBoxParam(p1,p2,p3,p4,p5) -#undef EndDialog -#define EndDialog(p1,p2) \ - TTEndDialog(p1, p2) - void destroy_malloced_string(char **str) { if (*str != NULL) { @@ -835,7 +828,7 @@ static BOOL end_auth_dlg(PTInstVar pvar, HWND dlg) do_SSH2_userauth(pvar); } - EndDialog(dlg, 1); + TTEndDialog(dlg, 1); return TRUE; } @@ -1013,13 +1006,13 @@ static INT_PTR CALLBACK auth_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, canceled: pvar->auth_state.auth_dialog = NULL; notify_closed_connection(pvar, "authentication cancelled"); - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; case IDCLOSE: // 認証中にネットワーク切断された場合、当該メッセージでダイアログを閉じる。 pvar->auth_state.auth_dialog = NULL; - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; case IDC_SSHUSERNAME: @@ -1434,7 +1427,7 @@ static BOOL end_TIS_dlg(PTInstVar pvar, HWND dlg) SSH_notify_cred(pvar); - EndDialog(dlg, 1); + TTEndDialog(dlg, 1); return TRUE; } @@ -1470,13 +1463,13 @@ static INT_PTR CALLBACK TIS_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, case IDCANCEL: /* kill the connection */ pvar->auth_state.auth_dialog = NULL; notify_closed_connection(pvar, "authentication cancelled"); - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; case IDCLOSE: // 認証中にネットワーク切断された場合、当該メッセージでダイアログを閉じる。 pvar->auth_state.auth_dialog = NULL; - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; default: @@ -1493,24 +1486,24 @@ void AUTH_do_cred_dialog(PTInstVar pvar) if (pvar->auth_state.auth_dialog == NULL) { HWND cur_active = GetActiveWindow(); DLGPROC dlg_proc; - LPCTSTR dialog_template; + LPCWSTR dialog_template; INT_PTR r; switch (pvar->auth_state.mode) { case TIS_AUTH_MODE: - dialog_template = MAKEINTRESOURCE(IDD_SSHTISAUTH); + dialog_template = MAKEINTRESOURCEW(IDD_SSHTISAUTH); dlg_proc = TIS_dlg_proc; break; case GENERIC_AUTH_MODE: default: - dialog_template = MAKEINTRESOURCE(IDD_SSHAUTH); + dialog_template = MAKEINTRESOURCEW(IDD_SSHAUTH); dlg_proc = auth_dlg_proc; } - r = DialogBoxParam(hInst, dialog_template, - cur_active != - NULL ? cur_active : pvar->NotificationWindow, - dlg_proc, (LPARAM) pvar); + r = TTDialogBoxParam(hInst, dialog_template, + cur_active != + NULL ? cur_active : pvar->NotificationWindow, + dlg_proc, (LPARAM) pvar); if (r == -1) { UTIL_get_lang_msg("MSG_CREATEWINDOW_AUTH_ERROR", pvar, "Unable to display authentication dialog box.\n" @@ -1647,7 +1640,7 @@ static BOOL end_default_auth_dlg(PTInstVar pvar, HWND dlg) pvar->settings.CheckAuthListFirst = FALSE; } - EndDialog(dlg, 1); + TTEndDialog(dlg, 1); return TRUE; } @@ -1673,7 +1666,7 @@ static INT_PTR CALLBACK default_auth_dlg_proc(HWND dlg, UINT msg, return end_default_auth_dlg(pvar, dlg); case IDCANCEL: - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; case IDC_SSHAUTHSETUP_HELP: @@ -1740,10 +1733,10 @@ void AUTH_do_default_cred_dialog(PTInstVar pvar) { HWND cur_active = GetActiveWindow(); - if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SSHAUTHSETUP), - cur_active != NULL ? cur_active + if (TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_SSHAUTHSETUP), + cur_active != NULL ? cur_active : pvar->NotificationWindow, - default_auth_dlg_proc, (LPARAM) pvar) == -1) { + default_auth_dlg_proc, (LPARAM) pvar) == -1) { UTIL_get_lang_msg("MSG_CREATEWINDOW_AUTHSETUP_ERROR", pvar, "Unable to display authentication setup dialog box."); notify_nonfatal_error(pvar, pvar->UIMsg); diff --git a/ttssh2/ttxssh/fwdui.c b/ttssh2/ttxssh/fwdui.c index 796a63ca7..4cca27164 100644 --- a/ttssh2/ttxssh/fwdui.c +++ b/ttssh2/ttxssh/fwdui.c @@ -42,13 +42,6 @@ See LICENSE.TXT for the license. #include "servicenames.h" #include "helpid.h" -#undef DialogBoxParam -#define DialogBoxParam(p1,p2,p3,p4,p5) \ - TTDialogBoxParam(p1,p2,p3,p4,p5) -#undef EndDialog -#define EndDialog(p1,p2) \ - TTEndDialog(p1, p2) - typedef struct { FWDRequestSpec *spec; PTInstVar pvar; @@ -631,7 +624,7 @@ static BOOL end_fwd_dlg(PTInstVar pvar, HWND dlg) FWD_set_request_specs(pvar, specs, num_specs); FWDUI_save_settings(pvar); free_all_listbox_specs(dlg); - EndDialog(dlg, 1); + TTEndDialog(dlg, 1); free(specs); @@ -929,7 +922,7 @@ static BOOL end_fwd_edit_dlg(PTInstVar pvar, FWDRequestSpec *spec, HWND dlg) *spec = new_spec; - EndDialog(dlg, 1); + TTEndDialog(dlg, 1); return TRUE; } @@ -963,7 +956,7 @@ static INT_PTR CALLBACK fwd_edit_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, LPA return result; case IDCANCEL: - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; case IDC_SSHFWDLOCALTOREMOTE: @@ -993,8 +986,8 @@ static void add_forwarding_entry(PTInstVar pvar, HWND dlg) new_spec.to_host[0] = 0; new_spec.to_port_name[0] = 0; - result = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SSHFWDEDIT), - dlg, fwd_edit_dlg_proc, (LPARAM) & closure); + result = TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_SSHFWDEDIT), + dlg, fwd_edit_dlg_proc, (LPARAM) & closure); if (result == -1) { UTIL_get_lang_msg("MSG_CREATEWINDOW_FWDEDIT_ERROR", pvar, @@ -1024,8 +1017,8 @@ static void edit_forwarding_entry(PTInstVar pvar, HWND dlg) FWDEditClosure closure = { spec, pvar }; INT_PTR result = - DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SSHFWDEDIT), - dlg, fwd_edit_dlg_proc, (LPARAM) & closure); + TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_SSHFWDEDIT), + dlg, fwd_edit_dlg_proc, (LPARAM) & closure); if (result == -1) { UTIL_get_lang_msg("MSG_CREATEWINDOW_FWDEDIT_ERROR", pvar, @@ -1083,7 +1076,7 @@ static INT_PTR CALLBACK fwd_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, LPARAM l case IDCANCEL: free_all_listbox_specs(dlg); - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; case IDC_SSHFWDSETUP_HELP: @@ -1119,8 +1112,8 @@ void FWDUI_do_forwarding_dialog(PTInstVar pvar) { HWND cur_active = GetActiveWindow(); - if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SSHFWDSETUP), - cur_active != NULL ? cur_active + if (TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_SSHFWDSETUP), + cur_active != NULL ? cur_active : pvar->NotificationWindow, fwd_dlg_proc, (LPARAM) pvar) == -1) { UTIL_get_lang_msg("MSG_CREATEWINDOW_FWDSETUP_ERROR", pvar, diff --git a/ttssh2/ttxssh/hosts.c b/ttssh2/ttxssh/hosts.c index 9439059ab..945389f11 100644 --- a/ttssh2/ttxssh/hosts.c +++ b/ttssh2/ttxssh/hosts.c @@ -59,13 +59,6 @@ See LICENSE.TXT for the license. #include "codeconv.h" #include "asprintf.h" -#undef DialogBoxParam -#define DialogBoxParam(p1,p2,p3,p4,p5) \ - TTDialogBoxParam(p1,p2,p3,p4,p5) -#undef EndDialog -#define EndDialog(p1,p2) \ - TTEndDialog(p1, p2) - // BASE64構成文字列(ここでは'='は含まれていない) static char base64[] ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; @@ -1869,14 +1862,14 @@ static INT_PTR CALLBACK hosts_add_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, pvar->hosts_state.hosts_dialog = NULL; - EndDialog(dlg, 1); + TTEndDialog(dlg, 1); return TRUE; case IDCANCEL: /* kill the connection */ canceled: pvar->hosts_state.hosts_dialog = NULL; notify_closed_connection(pvar, "authentication cancelled"); - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; case IDCLOSE: @@ -1885,7 +1878,7 @@ static INT_PTR CALLBACK hosts_add_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, * ダイアログのみを閉じる。 */ pvar->hosts_state.hosts_dialog = NULL; - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; case IDC_FP_HASH_ALG_MD5: @@ -2017,14 +2010,14 @@ static INT_PTR CALLBACK hosts_replace_dlg_proc(HWND dlg, UINT msg, WPARAM wParam pvar->hosts_state.hosts_dialog = NULL; - EndDialog(dlg, 1); + TTEndDialog(dlg, 1); return TRUE; case IDCANCEL: /* kill the connection */ canceled: pvar->hosts_state.hosts_dialog = NULL; notify_closed_connection(pvar, "authentication cancelled"); - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; case IDCLOSE: @@ -2033,7 +2026,7 @@ static INT_PTR CALLBACK hosts_replace_dlg_proc(HWND dlg, UINT msg, WPARAM wParam * ダイアログのみを閉じる。 */ pvar->hosts_state.hosts_dialog = NULL; - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; case IDC_FP_HASH_ALG_MD5: @@ -2166,14 +2159,14 @@ static INT_PTR CALLBACK hosts_add2_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, pvar->hosts_state.hosts_dialog = NULL; - EndDialog(dlg, 1); + TTEndDialog(dlg, 1); return TRUE; case IDCANCEL: /* kill the connection */ canceled: pvar->hosts_state.hosts_dialog = NULL; notify_closed_connection(pvar, "authentication cancelled"); - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; case IDCLOSE: @@ -2182,7 +2175,7 @@ static INT_PTR CALLBACK hosts_add2_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, * ダイアログのみを閉じる。 */ pvar->hosts_state.hosts_dialog = NULL; - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; case IDC_FP_HASH_ALG_MD5: @@ -2235,9 +2228,9 @@ void HOSTS_do_unknown_host_dialog(HWND wnd, PTInstVar pvar) */ HWND cur_active = NULL; - DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SSHUNKNOWNHOST), - cur_active != NULL ? cur_active : wnd, - hosts_add_dlg_proc, (LPARAM) pvar); + TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_SSHUNKNOWNHOST), + cur_active != NULL ? cur_active : wnd, + hosts_add_dlg_proc, (LPARAM) pvar); } } @@ -2254,9 +2247,9 @@ void HOSTS_do_different_key_dialog(HWND wnd, PTInstVar pvar) */ HWND cur_active = NULL; - DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SSHDIFFERENTKEY), - cur_active != NULL ? cur_active : wnd, - hosts_replace_dlg_proc, (LPARAM) pvar); + TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_SSHDIFFERENTKEY), + cur_active != NULL ? cur_active : wnd, + hosts_replace_dlg_proc, (LPARAM) pvar); } } @@ -2273,9 +2266,9 @@ void HOSTS_do_different_type_key_dialog(HWND wnd, PTInstVar pvar) */ HWND cur_active = NULL; - DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SSHDIFFERENTTYPEKEY), - cur_active != NULL ? cur_active : wnd, - hosts_add2_dlg_proc, (LPARAM) pvar); + TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_SSHDIFFERENTTYPEKEY), + cur_active != NULL ? cur_active : wnd, + hosts_add2_dlg_proc, (LPARAM) pvar); } } diff --git a/ttssh2/ttxssh/key.c b/ttssh2/ttxssh/key.c index 5744c8cd5..4805d451d 100644 --- a/ttssh2/ttxssh/key.c +++ b/ttssh2/ttxssh/key.c @@ -34,13 +34,6 @@ #include #include -#undef DialogBoxParam -#define DialogBoxParam(p1,p2,p3,p4,p5) \ - TTDialogBoxParam(p1,p2,p3,p4,p5) -#undef EndDialog -#define EndDialog(p1,p2) \ - TTEndDialog(p1, p2) - #define INTBLOB_LEN 20 #define SIGBLOB_LEN (2*INTBLOB_LEN) @@ -2436,11 +2429,11 @@ static INT_PTR CALLBACK hosts_updatekey_dlg_proc(HWND dlg, UINT msg, WPARAM wPar switch (LOWORD(wParam)) { case IDOK: - EndDialog(dlg, 1); + TTEndDialog(dlg, 1); return TRUE; case IDCANCEL: /* kill the connection */ - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; case IDC_FP_HASH_ALG_MD5: @@ -2476,7 +2469,7 @@ static void update_known_hosts(PTInstVar pvar, struct hostkeys_update_ctx *ctx) HWND cur_active = GetActiveWindow(); pvar->hostkey_ctx = ctx; - dlgresult = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SSHUPDATE_HOSTKEY), + dlgresult = TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_SSHUPDATE_HOSTKEY), cur_active != NULL ? cur_active : pvar->NotificationWindow, hosts_updatekey_dlg_proc, (LPARAM)pvar); if (dlgresult != 1) { diff --git a/ttssh2/ttxssh/ssh.c b/ttssh2/ttxssh/ssh.c index 0f2d55ccc..1b03e3175 100644 --- a/ttssh2/ttxssh/ssh.c +++ b/ttssh2/ttxssh/ssh.c @@ -6693,7 +6693,7 @@ static LRESULT CALLBACK ssh_heartbeat_dlg_proc(HWND hWnd, UINT msg, WPARAM wp, L } case IDCANCEL: - EndDialog(hWnd, 0); + TTEndDialog(hWnd, 0); return TRUE; default: return FALSE; @@ -7548,13 +7548,13 @@ static INT_PTR CALLBACK passwd_change_dialog(HWND dlg, UINT msg, WPARAM wParam, strncpy_s(cp->passwd, sizeof(cp->passwd), old_passwd, _TRUNCATE); strncpy_s(cp->new_passwd, sizeof(cp->new_passwd), new_passwd, _TRUNCATE); - EndDialog(dlg, 1); // dialog close + TTEndDialog(dlg, 1); // dialog close return TRUE; case IDCANCEL: // 接続を切る notify_closed_connection(pvar, "authentication cancelled"); - EndDialog(dlg, 0); // dialog close + TTEndDialog(dlg, 0); // dialog close return TRUE; } } @@ -7578,7 +7578,7 @@ BOOL handle_SSH2_userauth_passwd_changereq(PTInstVar pvar) memset(&cp, 0, sizeof(cp)); cp.pvar = pvar; - ret = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SSHPASSWD_INPUT), pvar->cv->HWin, passwd_change_dialog, (LPARAM)&cp); + ret = TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_SSHPASSWD_INPUT), pvar->cv->HWin, passwd_change_dialog, (LPARAM)&cp); if (ret == -1) { logprintf(LOG_LEVEL_WARNING, "%s: DialogBoxParam failed.", __FUNCTION__); @@ -8487,7 +8487,7 @@ static void SSH2_scp_toremote(PTInstVar pvar, Channel_t *c, unsigned char *data, HANDLE thread; unsigned int tid; - hDlgWnd = TTCreateDialog(hInst, MAKEINTRESOURCE(IDD_SSHSCP_PROGRESS), + hDlgWnd = TTCreateDialog(hInst, MAKEINTRESOURCEW(IDD_SSHSCP_PROGRESS), pvar->cv->HWin, ssh_scp_dlg_proc); if (hDlgWnd != NULL) { static const DlgTextInfo text_info[] = { @@ -8833,7 +8833,7 @@ static BOOL SSH2_scp_fromremote(PTInstVar pvar, Channel_t *c, unsigned char *dat // 進捗ウィンドウ c->scp.pvar = pvar; - hDlgWnd = TTCreateDialog(hInst, MAKEINTRESOURCE(IDD_SSHSCP_PROGRESS), + hDlgWnd = TTCreateDialog(hInst, MAKEINTRESOURCEW(IDD_SSHSCP_PROGRESS), pvar->cv->HWin, ssh_scp_dlg_proc); if (hDlgWnd != NULL) { static const DlgTextInfo text_info[] = { diff --git a/ttssh2/ttxssh/ttxssh.c b/ttssh2/ttxssh/ttxssh.c index 9a2b96726..5dfbc5868 100644 --- a/ttssh2/ttxssh/ttxssh.c +++ b/ttssh2/ttxssh/ttxssh.c @@ -115,12 +115,6 @@ static OSSL_PROVIDER *legacy_provider = NULL; static OSSL_PROVIDER *default_provider = NULL; #endif -#undef DialogBoxParam -#define DialogBoxParam(p1,p2,p3,p4,p5) \ - TTDialogBoxParam(p1,p2,p3,p4,p5) -#undef EndDialog -#define EndDialog(p1,p2) \ - TTEndDialog(p1, p2) #undef GetPrivateProfileInt #undef GetPrivateProfileString #undef WritePrivateProfileString @@ -1291,11 +1285,11 @@ static INT_PTR CALLBACK TTXHostDlg(HWND dlg, UINT msg, WPARAM wParam, LPARAM lPa index = (int)SendDlgItemMessageA(dlg, IDC_HOSTCOM, CB_GETITEMDATA, pos, 0); GetHNRec->ComPort = dlg_data->ComPortInfoPtr[index].port_no; } - EndDialog(dlg, 1); + TTEndDialog(dlg, 1); return TRUE; case IDCANCEL: - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; case IDC_HOSTTCPIP: @@ -1391,7 +1385,7 @@ static BOOL PASCAL TTXGetHostName(HWND parent, PGetHNRec rec) SetDialogFont(pvar->ts->DialogFontNameW, pvar->ts->DialogFontPoint, pvar->ts->DialogFontCharSet, pvar->ts->UILanguageFileW, "TTSSH", "DLG_TAHOMA_FONT"); // pvar->ts->UILanguageFile, "TTSSH", "DLG_SYSTEM_FONT"); - return (BOOL)DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_HOSTDLG), parent, TTXHostDlg, (LPARAM)rec); + return (BOOL)TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_HOSTDLG), parent, TTXHostDlg, (LPARAM)rec); } static void PASCAL TTXGetUIHooks(TTXUIHooks *hooks) @@ -2252,11 +2246,11 @@ static INT_PTR CALLBACK TTXAboutDlg(HWND dlg, UINT msg, WPARAM wParam, LPARAM lP case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: - EndDialog(dlg, 1); + TTEndDialog(dlg, 1); return TRUE; case IDCANCEL: /* there isn't a cancel button, but other Windows UI things can send this message */ - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; case IDC_FP_HASH_ALG_MD5: about_dlg_set_abouttext(pvar, dlg, SSH_DIGEST_MD5); @@ -2975,11 +2969,11 @@ static INT_PTR CALLBACK TTXSetupDlg(HWND dlg, UINT msg, WPARAM wParam, switch (LOWORD(wParam)) { case IDOK: complete_setup_dlg((PTInstVar) GetWindowLongPtr(dlg, DWLP_USER), dlg); - EndDialog(dlg, 1); + TTEndDialog(dlg, 1); return TRUE; case IDCANCEL: /* there isn't a cancel button, but other Windows UI things can send this message */ - EndDialog(dlg, 0); + TTEndDialog(dlg, 0); return TRUE; case IDC_SSHSETUP_HELP: PostMessage(GetParent(dlg), WM_USER_DLGHELP2, HlpMenuSetupSsh, 0); @@ -3524,7 +3518,7 @@ static INT_PTR CALLBACK TTXScpDialog(HWND dlg, UINT msg, WPARAM wParam, SavePaths(dlg, pvar->ts); - EndDialog(dlg, 1); // dialog close + TTEndDialog(dlg, 1); // dialog close return TRUE; } return FALSE; @@ -3533,7 +3527,7 @@ static INT_PTR CALLBACK TTXScpDialog(HWND dlg, UINT msg, WPARAM wParam, case IDCANCEL: { SavePaths(dlg, pvar->ts); - EndDialog(dlg, 0); // dialog close + TTEndDialog(dlg, 0); // dialog close return TRUE; } @@ -3580,7 +3574,7 @@ static INT_PTR CALLBACK TTXScpDialog(HWND dlg, UINT msg, WPARAM wParam, SavePaths(dlg, pvar->ts); - EndDialog(dlg, 1); // dialog close + TTEndDialog(dlg, 1); // dialog close return TRUE; } return FALSE; @@ -4051,7 +4045,7 @@ static INT_PTR CALLBACK TTXKeyGenerator(HWND dlg, UINT msg, WPARAM wParam, case IDCANCEL: // don't forget to free SSH resource! free_ssh_key(); - EndDialog(dlg, 0); // dialog close + TTEndDialog(dlg, 0); // dialog close return TRUE; case IDC_SSHKEYGENSETUP_HELP: @@ -4683,7 +4677,7 @@ static int PASCAL TTXProcessCommand(HWND hWin, WORD cmd) case ID_SSHSCPMENU: UTIL_SetDialogFont(); - if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SSHSCP), hWin, TTXScpDialog, + if (TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_SSHSCP), hWin, TTXScpDialog, (LPARAM) pvar) == -1) { static const TTMessageBoxInfoW info = { "TTSSH", @@ -4697,7 +4691,7 @@ static int PASCAL TTXProcessCommand(HWND hWin, WORD cmd) case ID_SSHKEYGENMENU: UTIL_SetDialogFont(); - if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SSHKEYGEN), hWin, TTXKeyGenerator, + if (TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_SSHKEYGEN), hWin, TTXKeyGenerator, (LPARAM) pvar) == -1) { static const TTMessageBoxInfoW info = { "TTSSH", @@ -4713,7 +4707,7 @@ static int PASCAL TTXProcessCommand(HWND hWin, WORD cmd) AboutDlgData *data = (AboutDlgData *)calloc(1, sizeof(*data)); UTIL_SetDialogFont(); data->pvar = pvar; - if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ABOUTDIALOG), hWin, TTXAboutDlg, (LPARAM)data) == -1) { + if (TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_ABOUTDIALOG), hWin, TTXAboutDlg, (LPARAM)data) == -1) { static const TTMessageBoxInfoW info = { "TTSSH", "MSG_TTSSH_ERROR", L"TTSSH Error", @@ -4731,8 +4725,8 @@ static int PASCAL TTXProcessCommand(HWND hWin, WORD cmd) return 1; case ID_SSHSETUPMENU: UTIL_SetDialogFont(); - if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SSHSETUP), - hWin, TTXSetupDlg, (LPARAM) pvar) == -1) { + if (TTDialogBoxParam(hInst, MAKEINTRESOURCEW(IDD_SSHSETUP), + hWin, TTXSetupDlg, (LPARAM) pvar) == -1) { static const TTMessageBoxInfoW info = { "TTSSH", "MSG_TTSSH_ERROR", L"TTSSH Error",