Revision: 8395 https://osdn.net/projects/ttssh2/scm/svn/commits/8395 Author: doda Date: 2019-11-23 00:14:44 +0900 (Sat, 23 Nov 2019) Log Message: ----------- isLogMeTTExist() の結果を記憶するようにした 気軽に isLogMeTTExist() を呼べるようにするため Modified Paths: -------------- trunk/teraterm/teraterm/vtwin.cpp -------------- next part -------------- Modified: trunk/teraterm/teraterm/vtwin.cpp =================================================================== --- trunk/teraterm/teraterm/vtwin.cpp 2019-11-22 14:10:15 UTC (rev 8394) +++ trunk/teraterm/teraterm/vtwin.cpp 2019-11-22 15:14:44 UTC (rev 8395) @@ -1018,6 +1018,10 @@ static char LogMeTTMenuString[] = "Log&MeTT"; static char LogMeTT[MAX_PATH]; +#define IS_LOGMETT_NOTFOUND 0 +#define IS_LOGMETT_FOUND 1 +#define IS_LOGMETT_UNKNOWN 2 + static BOOL isLogMeTTExist() { const char *LogMeTTexename = "LogMeTT.exe"; @@ -1029,6 +1033,12 @@ DWORD dwDisposition; char *path; + static int status = IS_LOGMETT_UNKNOWN; + + if (status != IS_LOGMETT_UNKNOWN) { + return status == IS_LOGMETT_FOUND; + } + /* LogMeTT 2.9.6\x82\xA9\x82\xE7\x82̓\x8C\x83W\x83X\x83g\x83\x8A\x82ɃC\x83\x93\x83X\x83g\x81[\x83\x8B\x83p\x83X\x82\xAA\x8A܂܂\xEA\x82\xE9\x81B*/ result = RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\LogMeTT", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_READ, NULL, &key, &dwDisposition); @@ -1055,8 +1065,10 @@ } if (_access(LogMeTT, 0) == -1) { + status = IS_LOGMETT_NOTFOUND; return FALSE; } + status = IS_LOGMETT_FOUND; return TRUE; }