svnno****@sourc*****
svnno****@sourc*****
2017年 4月 24日 (月) 20:49:52 JST
Revision: 6691 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6691 Author: doda Date: 2017-04-24 20:49:52 +0900 (Mon, 24 Apr 2017) Log Message: ----------- Windows 2000 の時は ttssh 側でも通知アイコンをセットするようにした。 Modified Paths: -------------- trunk/teraterm/common/ttcommon.h trunk/teraterm/ttpcmn/ttcmn.c trunk/teraterm/ttpcmn/ttpcmn.def trunk/ttssh2/ttxssh/ttxssh.c -------------- next part -------------- Modified: trunk/teraterm/common/ttcommon.h =================================================================== --- trunk/teraterm/common/ttcommon.h 2017-04-24 11:49:49 UTC (rev 6690) +++ trunk/teraterm/common/ttcommon.h 2017-04-24 11:49:52 UTC (rev 6691) @@ -60,6 +60,7 @@ void FAR PASCAL HideNotifyIcon(PComVar cv); void FAR PASCAL SetVerNotifyIcon(PComVar cv, unsigned int ver); void FAR PASCAL SetCustomNotifyIcon(HICON icon); +HICON FAR PASCAL GetCustomNotifyIcon(); #define NotifyInfoMessage(cv, msg, title) NotifyMessage(cv, msg, title, 1) #define NotifyWarnMessage(cv, msg, title) NotifyMessage(cv, msg, title, 2) Modified: trunk/teraterm/ttpcmn/ttcmn.c =================================================================== --- trunk/teraterm/ttpcmn/ttcmn.c 2017-04-24 11:49:49 UTC (rev 6690) +++ trunk/teraterm/ttpcmn/ttcmn.c 2017-04-24 11:49:52 UTC (rev 6691) @@ -2391,6 +2391,11 @@ CustomIcon = icon; } +HICON FAR PASCAL GetCustomNotifyIcon() +{ + return CustomIcon; +} + void FAR PASCAL CreateNotifyIcon(PComVar cv) { if (cv->NotifyIcon == NULL) { Modified: trunk/teraterm/ttpcmn/ttpcmn.def =================================================================== --- trunk/teraterm/ttpcmn/ttpcmn.def 2017-04-24 11:49:49 UTC (rev 6690) +++ trunk/teraterm/ttpcmn/ttpcmn.def 2017-04-24 11:49:52 UTC (rev 6691) @@ -37,6 +37,7 @@ SetVerNotifyIcon @82 NotifyMessage @79 SetCustomNotifyIcon @85 + GetCustomNotifyIcon @86 SJIS2JIS @30 SJIS2EUC @31 Modified: trunk/ttssh2/ttxssh/ttxssh.c =================================================================== --- trunk/ttssh2/ttxssh/ttxssh.c 2017-04-24 11:49:49 UTC (rev 6690) +++ trunk/ttssh2/ttxssh/ttxssh.c 2017-04-24 11:49:52 UTC (rev 6691) @@ -94,6 +94,8 @@ static HICON SecureLargeIcon = NULL; static HICON SecureSmallIcon = NULL; +static HICON SecureNotifyIcon = NULL; +static HICON OldNotifyIcon = NULL; static HFONT DlgHostFont; static HFONT DlgAboutFont; @@ -166,6 +168,9 @@ (LPARAM) pvar->OldSmallIcon); pvar->OldSmallIcon = NULL; } + if (OldNotifyIcon) { + SetCustomNotifyIcon(OldNotifyIcon); + } ssh_heartbeat_lock_finalize(); } @@ -914,6 +919,15 @@ (LPARAM) SecureSmallIcon); } + if (IsWindows2000()) { + if (SecureNotifyIcon == NULL) { + SecureNotifyIcon = LoadImage(hInst, MAKEINTRESOURCE(pvar->settings.IconID), + IMAGE_ICON, 0, 0, LR_VGACOLOR | LR_SHARED); + } + OldNotifyIcon = GetCustomNotifyIcon(); + SetCustomNotifyIcon(SecureNotifyIcon); + } + notify_verbose_message(pvar, "Entering secure mode", LOG_LEVEL_VERBOSE); }