[Ttssh2-commit] [6504] チケット #36655 ログファイルオープンエラー

svnno****@sourc***** svnno****@sourc*****
2016年 10月 5日 (水) 20:08:01 JST


Revision: 6504
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6504
Author:   yutakapon
Date:     2016-10-05 20:08:00 +0900 (Wed, 05 Oct 2016)
Log Message:
-----------
チケット #36655 ログファイルオープンエラー

ログダイアログをクローズする際、アイコンリソースを削除するようにした。

Ticket Links:
------------
    http://sourceforge.jp/projects/ttssh2/tracker/detail/36655

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

-------------- next part --------------
Modified: trunk/teraterm/teraterm/ftdlg.cpp
===================================================================
--- trunk/teraterm/teraterm/ftdlg.cpp	2016-10-04 07:15:55 UTC (rev 6503)
+++ trunk/teraterm/teraterm/ftdlg.cpp	2016-10-05 11:08:00 UTC (rev 6504)
@@ -180,15 +180,18 @@
 	if (IsWindowsNT4()) {
 		fuLoad = LR_VGACOLOR;
 	}
-	::PostMessage(GetSafeHwnd(),WM_SETICON,ICON_SMALL,
-	              (LPARAM)LoadImage(AfxGetInstanceHandle(),
-	                                MAKEINTRESOURCE(IDI_TTERM),
-	                                IMAGE_ICON,16,16,fuLoad));
-	::PostMessage(GetSafeHwnd(),WM_SETICON,ICON_BIG,
-	              (LPARAM)LoadImage(AfxGetInstanceHandle(),
-	                                MAKEINTRESOURCE(IDI_TTERM),
-	                                IMAGE_ICON, 0, 0, fuLoad));
+	SmallIcon = LoadImage(AfxGetInstanceHandle(),
+		MAKEINTRESOURCE(IDI_TTERM),
+		IMAGE_ICON, 16, 16, fuLoad);
+	::PostMessage(GetSafeHwnd(), WM_SETICON, ICON_SMALL,
+		(LPARAM)SmallIcon);
 
+	BigIcon = LoadImage(AfxGetInstanceHandle(),
+			MAKEINTRESOURCE(IDI_TTERM),
+			IMAGE_ICON, 0, 0, fuLoad);
+	::PostMessage(GetSafeHwnd(), WM_SETICON, ICON_BIG,
+		(LPARAM)BigIcon);
+
 	return 1;
 }
 
@@ -216,13 +219,25 @@
 
 void CFileTransDlg::PostNcDestroy()
 {
-	// CreateFontIndirect()\x82ō쐬\x82\xB5\x82\xBD\x98_\x97\x9D\x83t\x83H\x83\x93\x83g\x82\xF0\x8D폜\x82\xB7\x82\xE9\x81B
-	// (2016.10.13 yutaka)
+	// logopen\x82\xC6logclose\x82\xF0\x8CJ\x82\xE8\x95Ԃ\xB7\x82ƁAGDI\x83\x8A\x83\\x81[\x83X\x83\x8A\x81[\x83N\x82ƂȂ\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B
+	//   - CreateFontIndirect()\x82ō쐬\x82\xB5\x82\xBD\x98_\x97\x9D\x83t\x83H\x83\x93\x83g\x82\xF0\x8D폜\x82\xB7\x82\xE9\x81B
+	//   - LoadImage()\x82ɂ\xE6\x82\xE9\x83A\x83C\x83R\x83\x93\x83\x8A\x83\\x81[\x83X\x82\xF0\x89\xF0\x95\xFA\x82\xB7\x82\xE9\x81B
+	// (2016.10.5 yutaka)
 	if (DlgFont) {
 		DeleteObject(DlgFont);
 		DlgFont = NULL;
 	}
 
+	if (SmallIcon) {
+		DestroyIcon((HICON)SmallIcon);
+		SmallIcon = NULL;
+	}
+
+	if (BigIcon) {
+		DestroyIcon((HICON)BigIcon);
+		BigIcon = NULL;
+	}
+
 	delete this;
 }
 

Modified: trunk/teraterm/teraterm/ftdlg.h
===================================================================
--- trunk/teraterm/teraterm/ftdlg.h	2016-10-04 07:15:55 UTC (rev 6503)
+++ trunk/teraterm/teraterm/ftdlg.h	2016-10-05 11:08:00 UTC (rev 6504)
@@ -17,10 +17,14 @@
 	PTTSet ts;
 	HFONT DlgFont;
 #endif
+	HANDLE SmallIcon;
+	HANDLE BigIcon;
 
 public:
 	CFileTransDlg() {
 		DlgFont = NULL;
+		SmallIcon = NULL;
+		BigIcon = NULL;
 	}
 
 #ifndef NO_I18N



Ttssh2-commit メーリングリストの案内