[Ttssh2-commit] [8582] htmlhelp の初期化と終了処理を vtwin.cpp から teraterm.cpp に移動

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2020年 3月 10日 (火) 23:09:16 JST


Revision: 8582
          https://osdn.net/projects/ttssh2/scm/svn/commits/8582
Author:   zmatsuo
Date:     2020-03-10 23:09:15 +0900 (Tue, 10 Mar 2020)
Log Message:
-----------
htmlhelp の初期化と終了処理を vtwin.cpp から teraterm.cpp に移動

- HtmlHelp() の HH_INITIALIZE, HH_UNINITIALIZE, HH_CLOSE_ALL コマンド
- 引数に hWnd がないので、exe の最初と最後で呼ぶことが意図されていると思われる
  - ウィンドウの生成、破棄時に呼ぶのではない
- r8576

Revision Links:
--------------
    https://osdn.net/projects/ttssh2/scm/svn/commits/8576

Modified Paths:
--------------
    trunk/teraterm/teraterm/teraterm.cpp
    trunk/teraterm/teraterm/vtwin.cpp
    trunk/teraterm/teraterm/vtwin.h

-------------- next part --------------
Modified: trunk/teraterm/teraterm/teraterm.cpp
===================================================================
--- trunk/teraterm/teraterm/teraterm.cpp	2020-03-07 15:13:24 UTC (rev 8581)
+++ trunk/teraterm/teraterm/teraterm.cpp	2020-03-10 14:09:15 UTC (rev 8582)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2006-2019 TeraTerm Project
+ * (C) 2006-2020 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -33,8 +33,9 @@
 
 #include <stdio.h>
 #include <crtdbg.h>
-#include <tchar.h>
 #include <io.h>			// for access()
+#include <windows.h>
+#include <htmlhelp.h>
 #include "teraterm.h"
 #include "tttypes.h"
 #include "commlib.h"
@@ -68,6 +69,7 @@
 static BOOL AddFontFlag;
 static wchar_t TSpecialFont[MAX_PATH];
 static CVTWindow* pVTWin;
+static DWORD HtmlHelpCookie;
 
 static void LoadSpecialFont()
 {
@@ -313,6 +315,7 @@
 	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
 #endif
 
+	_HtmlHelpW(NULL, NULL, HH_INITIALIZE, (DWORD_PTR)&HtmlHelpCookie);
 	init();
 	hInst = hInstance;
 	CVTWindow *m_pMainWnd = new CVTWindow(hInstance);
@@ -387,6 +390,9 @@
 	delete m_pMainWnd;
 	m_pMainWnd = NULL;
 
+	_HtmlHelpW(NULL, NULL, HH_CLOSE_ALL, 0);
+	_HtmlHelpW(NULL, NULL, HH_UNINITIALIZE, HtmlHelpCookie);
+
 	UnloadSpecialFont();
 	DLLExit();
 

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2020-03-07 15:13:24 UTC (rev 8581)
+++ trunk/teraterm/teraterm/vtwin.cpp	2020-03-10 14:09:15 UTC (rev 8582)
@@ -534,8 +534,6 @@
 	CommInit(&cv);
 	isFirstInstance = StartTeraTerm(&ts);
 
-	_HtmlHelpW(NULL, NULL, HH_INITIALIZE, (DWORD_PTR)&dwCookie);
-
 	TTXInit(&ts, &cv); /* TTPLUG */
 
 	MsgDlgHelp = RegisterWindowMessage(HELPMSGSTRING);
@@ -1709,8 +1707,6 @@
 		}
 	}
 
-	_HtmlHelpW(NULL, NULL, HH_CLOSE_ALL, 0);
-	_HtmlHelpW(NULL, NULL, HH_UNINITIALIZE, dwCookie);
 	FileTransEnd(0);
 	ProtoEnd();
 

Modified: trunk/teraterm/teraterm/vtwin.h
===================================================================
--- trunk/teraterm/teraterm/vtwin.h	2020-03-07 15:13:24 UTC (rev 8581)
+++ trunk/teraterm/teraterm/vtwin.h	2020-03-10 14:09:15 UTC (rev 8582)
@@ -78,7 +78,6 @@
 
   // for html help
   LONG HelpId;
-  DWORD dwCookie;
 
 public:
 	CVTWindow(HINSTANCE hInstance);


Ttssh2-commit メーリングリストの案内
Back to archive index