Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/teraterm/ttpcmn/ttcmn.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 9336 by zmatsuo, Tue Jun 29 15:20:20 2021 UTC revision 9337 by zmatsuo, Sun Aug 1 05:36:29 2021 UTC
# Line 47  Line 47 
47  #include "tt_res.h"  #include "tt_res.h"
48  #include "codeconv.h"  #include "codeconv.h"
49  #include "compat_win.h"  #include "compat_win.h"
50    #include "asprintf.h"
51    
52  #define DllExport __declspec(dllexport)  #define DllExport __declspec(dllexport)
53  #include "ttcommon.h"  #include "ttcommon.h"
# Line 492  void WINAPI UndoAllWin(void) { Line 493  void WINAPI UndoAllWin(void) {
493    
494  void WINAPI OpenHelp(UINT Command, DWORD Data, char *UILanguageFile)  void WINAPI OpenHelp(UINT Command, DWORD Data, char *UILanguageFile)
495  {  {
496          char HomeDir[MAX_PATH];          wchar_t Temp[MAX_PATH];
         char Temp[MAX_PATH];  
497          HWND HWin;          HWND HWin;
498          wchar_t HelpFN[MAX_PATH];          wchar_t *HelpFN;
499          wchar_t uimsg[MAX_UIMSG];          wchar_t uimsg[MAX_UIMSG];
500          wchar_t *HomeDirW;          wchar_t *HomeDirW;
501    
502           /* Get home directory */          /* Get home directory  TODO ts.HomeDirW へ切り替え */
503          if (GetModuleFileNameA(NULL,Temp,_countof(Temp)) == 0) {          if (GetModuleFileNameW(NULL,Temp,_countof(Temp)) == 0) {
504                  return;                  return;
505          }          }
506          ExtractDirName(Temp, HomeDir);          HomeDirW = ExtractDirNameW(Temp);
         HomeDirW = ToWcharA(HomeDir);  
507          get_lang_msgW("HELPFILE", uimsg, _countof(uimsg), L"teraterm.chm", UILanguageFile);          get_lang_msgW("HELPFILE", uimsg, _countof(uimsg), L"teraterm.chm", UILanguageFile);
508          _snwprintf_s(HelpFN, _countof(HelpFN), _TRUNCATE, L"%s\\%s", HomeDirW, uimsg);          aswprintf(&HelpFN, L"%s\\%s", HomeDirW, uimsg);
509          free(HomeDirW);          free(HomeDirW);
510    
511          // ヘルプのオーナーは常にデスクトップになる (2007.5.12 maya)          // ヘルプのオーナーは常にデスクトップになる (2007.5.12 maya)
# Line 518  void WINAPI OpenHelp(UINT Command, DWORD Line 517  void WINAPI OpenHelp(UINT Command, DWORD
517                          NULL, L"Tera Term: HTML help",                          NULL, L"Tera Term: HTML help",
518                          "MSG_OPENHELP_ERROR", L"Can't open HTML help file(%s)." };                          "MSG_OPENHELP_ERROR", L"Can't open HTML help file(%s)." };
519                  TTMessageBoxW(HWin, &info, MB_OK | MB_ICONERROR, UILanguageFile, HelpFN);                  TTMessageBoxW(HWin, &info, MB_OK | MB_ICONERROR, UILanguageFile, HelpFN);
                 return;  
520          }          }
521            free(HelpFN);
522  }  }
523    
524  HWND WINAPI GetNthWin(int n)  HWND WINAPI GetNthWin(int n)

Legend:
Removed from v.9336  
changed lines
  Added in v.9337

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26