Revision: 7486 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7486 Author: zmatsuo Date: 2019-03-15 00:54:31 +0900 (Fri, 15 Mar 2019) Log Message: ----------- LoadIME()#ttime.cのエラー表示処理を呼び元のvtdisp.cに移動した Modified Paths: -------------- trunk/teraterm/teraterm/ttime.c trunk/teraterm/teraterm/ttime.h trunk/teraterm/teraterm/vtdisp.c trunk/teraterm/teraterm/vtwin.cpp -------------- next part -------------- Modified: trunk/teraterm/teraterm/ttime.c =================================================================== --- trunk/teraterm/teraterm/ttime.c 2019-03-14 15:54:13 UTC (rev 7485) +++ trunk/teraterm/teraterm/ttime.c 2019-03-14 15:54:31 UTC (rev 7486) @@ -45,7 +45,8 @@ #include "buffer.h" // for BuffGetCurrentLineData() #endif -#if 0 // #ifndef _IMM_ +// imm.h \x82\xAA include \x82ł\xAB\x82\xEA\x82\xCE _IMM_ \x82\xAA define \x82\xB3\x82\xEA\x82\xE9 \x81\xA8 \x82\xB1\x82̃u\x83\x8D\x83b\x83N\x95s\x97v? +#ifndef _IMM_ #define _IMM_ typedef DWORD HIMC; @@ -81,33 +82,8 @@ static HANDLE HIMEDLL = NULL; static LOGFONTA lfIME; -#if 1 -static void show_message() +BOOL LoadIME(void) { -#if 0 - PTTSet tempts; -#endif - char uimsg[MAX_UIMSG]; - get_lang_msg("MSG_TT_ERROR", uimsg, sizeof(uimsg), "Tera Term: Error", ts.UILanguageFile); - get_lang_msg("MSG_USE_IME_ERROR", ts.UIMsg, sizeof(ts.UIMsg), "Can't use IME", ts.UILanguageFile); - MessageBoxA(0,ts.UIMsg,uimsg,MB_ICONEXCLAMATION); - WritePrivateProfileStringA("Tera Term","IME","off",ts.SetupFName); - ts.UseIME = 0; -#if 0 - tempts = (PTTSet)malloc(sizeof(TTTSet)); - if (tempts!=NULL) - { - GetDefaultSet(tempts); - tempts->UseIME = 0; - ChangeDefaultSet(tempts,NULL); - free(tempts); - } -#endif -} -#endif - -BOOL LoadIME() -{ BOOL Err; char imm32_dll[MAX_PATH]; @@ -117,7 +93,6 @@ HIMEDLL = LoadLibraryA(imm32_dll); if (HIMEDLL == NULL) { - show_message(); return FALSE; } @@ -179,7 +154,7 @@ FreeLibrary(HTemp); } -BOOL CanUseIME() +BOOL CanUseIME(void) { return (HIMEDLL != NULL); } @@ -280,7 +255,8 @@ } -void SetIMEOpenStatus(HWND hWnd, BOOL stat) { +void SetIMEOpenStatus(HWND hWnd, BOOL stat) +{ HIMC hIMC; if (HIMEDLL==NULL) return; Modified: trunk/teraterm/teraterm/ttime.h =================================================================== --- trunk/teraterm/teraterm/ttime.h 2019-03-14 15:54:13 UTC (rev 7485) +++ trunk/teraterm/teraterm/ttime.h 2019-03-14 15:54:31 UTC (rev 7486) @@ -34,9 +34,9 @@ #endif /* proto types */ -BOOL LoadIME(); +BOOL LoadIME(void); void FreeIME(HWND hWnd); -BOOL CanUseIME(); +BOOL CanUseIME(void); void SetConversionWindow(HWND HWnd, int X, int Y); void SetConversionLogFont(HWND HWnd, PLOGFONTA lf); BOOL GetIMEOpenStatus(HWND hWnd); Modified: trunk/teraterm/teraterm/vtdisp.c =================================================================== --- trunk/teraterm/teraterm/vtdisp.c 2019-03-14 15:54:13 UTC (rev 7485) +++ trunk/teraterm/teraterm/vtdisp.c 2019-03-14 15:54:31 UTC (rev 7486) @@ -2058,8 +2058,14 @@ { if (ts.UseIME==0) FreeIME(HVTWin); - else if (! LoadIME()) + else if (! LoadIME()) { + char uimsg[MAX_UIMSG]; + get_lang_msg("MSG_TT_ERROR", uimsg, sizeof(uimsg), "Tera Term: Error", ts.UILanguageFile); + get_lang_msg("MSG_USE_IME_ERROR", ts.UIMsg, sizeof(ts.UIMsg), "Can't use IME", ts.UILanguageFile); + MessageBoxA(0,ts.UIMsg,uimsg,MB_ICONEXCLAMATION); + WritePrivateProfileStringA("Tera Term","IME","off",ts.SetupFName); ts.UseIME = 0; + } if (ts.UseIME>0) { Modified: trunk/teraterm/teraterm/vtwin.cpp =================================================================== --- trunk/teraterm/teraterm/vtwin.cpp 2019-03-14 15:54:13 UTC (rev 7485) +++ trunk/teraterm/teraterm/vtwin.cpp 2019-03-14 15:54:31 UTC (rev 7486) @@ -3226,22 +3226,23 @@ size_t len; const wchar_t *lpstr = GetConvString(HVTWin, wParam, lParam, &len); if (lpstr != NULL) { + const wchar_t *output_wstr = lpstr; if (len == 1 && ControlKey()) { const static wchar_t code_ctrl_space = 0; const static wchar_t code_ctrl_backslash = 0x1c; switch(*lpstr) { case 0x20: - lpstr = &code_ctrl_space; + output_wstr = &code_ctrl_space; break; case 0x5c: // Ctrl-\ support for NEC-PC98 - lpstr = &code_ctrl_backslash; + output_wstr = &code_ctrl_backslash; break; } } if (ts.LocalEcho>0) { - CommTextEchoW(&cv,lpstr,len); + CommTextEchoW(&cv,output_wstr,len); } - CommTextOutW(&cv,lpstr,len); + CommTextOutW(&cv,output_wstr,len); free((void *)lpstr); return 0; }