Revision: 10394 https://osdn.net/projects/ttssh2/scm/svn/commits/10394 Author: zmatsuo Date: 2022-12-03 15:40:18 +0900 (Sat, 03 Dec 2022) Log Message: ----------- 通知関連のAPIを整理した - ttermpro.exe 内部用とplugin用に分離した - ttcmn_notify.h plugin用 - ttcmn_notify2.h 内部用 - API名は Notify2...() - トレイアイコンを出したままにできるAPIを追加 - Notify2SetBallonDontHide() Modified Paths: -------------- trunk/teraterm/teraterm/addsetting.cpp trunk/teraterm/teraterm/vtwin.cpp trunk/teraterm/ttpcmn/ttcmn_notify.cpp trunk/teraterm/ttpcmn/ttcmn_notify.h trunk/teraterm/ttpcmn/ttpcmn.def Added Paths: ----------- trunk/teraterm/ttpcmn/ttcmn_notify2.h -------------- next part -------------- Modified: trunk/teraterm/teraterm/addsetting.cpp =================================================================== --- trunk/teraterm/teraterm/addsetting.cpp 2022-12-03 06:40:03 UTC (rev 10393) +++ trunk/teraterm/teraterm/addsetting.cpp 2022-12-03 06:40:18 UTC (rev 10394) @@ -42,8 +42,6 @@ #include "teraterm.h" #include "tttypes.h" #include "ttwinman.h" // for ts -#define TTCMN_NOTIFY_INTERNAL -#include "ttcommon.h" #include "dlglib.h" #include "compat_win.h" #include "helpid.h" @@ -58,6 +56,7 @@ #include "win32helper.h" #include "themedlg.h" #include "theme.h" +#include "ttcmn_notify2.h" const mouse_cursor_t MouseCursor[] = { {"ARROW", IDC_ARROW}, @@ -214,9 +213,8 @@ { BOOL notify_sound = (BOOL)GetCheck(IDC_NOTIFY_SOUND); if (notify_sound != ts.NotifySound) { - PComVar pcv = &cv; ts.NotifySound = notify_sound; - NotifySetSound(pcv, notify_sound); + Notify2SetSound((NotifyIcon *)cv.NotifyIcon, notify_sound); } } } @@ -230,13 +228,13 @@ { switch (wParam) { case IDC_NOTIFICATION_TEST | (BN_CLICKED << 16): { - PComVar pcv = &cv; + NotifyIcon *ni = (NotifyIcon *)cv.NotifyIcon; const wchar_t *msg = L"Test button was pushed"; - BOOL prev_sound = NotifyGetSound(pcv); + BOOL prev_sound = Notify2GetSound(ni); BOOL notify_sound = (BOOL)GetCheck(IDC_NOTIFY_SOUND); - NotifySetSound(pcv, notify_sound); - NotifyMessageW(pcv, msg, NULL, 1); - NotifySetSound(pcv, prev_sound); + Notify2SetSound(ni, notify_sound); + Notify2SetMessageW(ni, msg, NULL, 1); + Notify2SetSound(ni, prev_sound); break; } default: Modified: trunk/teraterm/teraterm/vtwin.cpp =================================================================== --- trunk/teraterm/teraterm/vtwin.cpp 2022-12-03 06:40:03 UTC (rev 10393) +++ trunk/teraterm/teraterm/vtwin.cpp 2022-12-03 06:40:18 UTC (rev 10394) @@ -41,7 +41,6 @@ #include "tttypes.h" #include "tttypes_key.h" -#define TTCMN_NOTIFY_INTERNAL 1 #include "ttcommon.h" #include "ttwinman.h" #include "ttsetup.h" @@ -108,6 +107,7 @@ #include "setupdirdlg.h" #include "themedlg.h" #include "ttcmn_static.h" +#include "ttcmn_notify2.h" #include <initguid.h> #if _MSC_VER < 1600 @@ -437,9 +437,10 @@ RegDeviceNotify(HVTWin); // \x92ʒm\x97̈揉\x8A\xFA\x89\xBB - NotifyInitialize(&cv); - NotifySetWindow(&cv, m_hWnd, WM_USER_NOTIFYICON, m_hInst, (ts.VTIcon != IdIconDefault) ? ts.VTIcon: IDI_VT); - NotifySetSound(&cv, ts.NotifySound); + NotifyIcon *ni = Notify2Initialize(); + cv.NotifyIcon = ni; + Notify2SetWindow(ni, m_hWnd, WM_USER_NOTIFYICON, m_hInst, (ts.VTIcon != IdIconDefault) ? ts.VTIcon: IDI_VT); + Notify2SetSound(ni, ts.NotifySound); // VT \x83E\x83B\x83\x93\x83h\x83E\x82̃A\x83C\x83R\x83\x93 SetVTIconID(&cv, NULL, 0); @@ -1407,7 +1408,7 @@ ProtoEnd(); SaveVTPos(); - NotifyUnsetWindow(&cv); + Notify2UnsetWindow((NotifyIcon *)cv.NotifyIcon); // \x83A\x83v\x83\x8A\x83P\x81[\x83V\x83\x87\x83\x93\x8FI\x97\xB9\x8E\x9E\x82ɃA\x83C\x83R\x83\x93\x82\xF0\x94j\x8A\xFC\x82\xB7\x82\xE9\x82ƁA\x83E\x83B\x83\x93\x83h\x83E\x82\xAA\x8F\xC1\x82\xA6\x82\xE9\x91O\x82\xC9 // \x83^\x83C\x83g\x83\x8B\x83o\x81[\x82̃A\x83C\x83R\x83\x93\x82\xAA "Windows \x82̎\xC0\x8Ds\x83t\x83@\x83C\x83\x8B\x82̃A\x83C\x83R\x83\x93" \x82ɕς\xED\x82\xE9 @@ -1485,7 +1486,8 @@ TTSetUnInit(&ts); - NotifyUninitialize(&cv); + Notify2Uninitialize((NotifyIcon *)cv.NotifyIcon); + cv.NotifyIcon = NULL; } static void EscapeFilename(const wchar_t *src, wchar_t *dest) @@ -3492,32 +3494,10 @@ LRESULT CVTWindow::OnNotifyIcon(WPARAM wParam, LPARAM lParam) { - if (wParam == 1) { - switch (lParam) { - case WM_MOUSEMOVE: - case WM_LBUTTONUP: - case WM_LBUTTONDBLCLK: - case WM_RBUTTONUP: - case WM_RBUTTONDBLCLK: - case WM_CONTEXTMENU: - case NIN_BALLOONSHOW: - case NIN_BALLOONHIDE: - case NIN_KEYSELECT: - case NIN_SELECT: - // nothing to do - break; - case WM_LBUTTONDOWN: - case WM_RBUTTONDOWN: - NotifyHideIcon(&cv); - break; - case NIN_BALLOONTIMEOUT: - NotifyHideIcon(&cv); - break; - case NIN_BALLOONUSERCLICK: - ::SetForegroundWindow(HVTWin); - NotifyHideIcon(&cv); - break; - } + Notify2Event((NotifyIcon *)cv.NotifyIcon, wParam, lParam); + + if (lParam == NIN_BALLOONUSERCLICK) { + ::SetForegroundWindow(m_hWnd); } return 0; @@ -5149,9 +5129,9 @@ } else if (msg == WM_TASKBER_CREATED) { // \x83^\x83X\x83N\x83o\x81[\x82\xAA\x8DċN\x93\xAE\x82\xB5\x82\xBD - NotifyHideIcon(&cv); - NotifySetWindow(&cv, m_hWnd, WM_USER_NOTIFYICON, m_hInst, (ts.VTIcon != IdIconDefault) ? ts.VTIcon: IDI_VT); - NotifySetSound(&cv, ts.NotifySound); + NotifyIcon *ni = (NotifyIcon *)cv.NotifyIcon; + Notify2Hide(ni); + Notify2SetWindow(ni, m_hWnd, WM_USER_NOTIFYICON, m_hInst, (ts.VTIcon != IdIconDefault) ? ts.VTIcon: IDI_VT); return 0; } switch(msg) Modified: trunk/teraterm/ttpcmn/ttcmn_notify.cpp =================================================================== --- trunk/teraterm/ttpcmn/ttcmn_notify.cpp 2022-12-03 06:40:03 UTC (rev 10393) +++ trunk/teraterm/ttpcmn/ttcmn_notify.cpp 2022-12-03 06:40:18 UTC (rev 10394) @@ -50,10 +50,13 @@ #include "compat_win.h" #include "dlglib.h" -#define TTCMN_NOTIFY_INTERNAL 1 +#undef DllExport +#define DllExport __declspec(dllexport) + #include "ttcmn_notify.h" +#include "ttcmn_notify2.h" -typedef struct { +typedef struct NotifyIconST { BOOL enable; // FALSE \x92ʒmAPI\x82\xAA\x8Eg\x82\xA6\x82Ȃ\xA2OS or \x8Eg\x82\xA6\x82Ȃ\xA2\x8F\xF3\x91\xD4 int NotifyIconShowCount; HWND parent_wnd; @@ -64,6 +67,7 @@ WORD IconID; HINSTANCE CustomIconInstance; WORD CustomIconID; + BOOL BallonDontHide; } NotifyIcon; /** @@ -101,28 +105,36 @@ p->uFlags = (ni->callback_msg != 0) ? NIF_MESSAGE : 0; } -static void NotifyHide(NotifyIcon *ni) +void Notify2Hide(NotifyIcon *ni) { if (ni->NotifyIconShowCount > 1) { ni->NotifyIconShowCount -= 1; + return; } - else { - TT_NOTIFYICONDATAW_V2 notify_icon; - InitializeNotifyIconData(ni, ¬ify_icon); - notify_icon.uFlags |= NIF_STATE; - notify_icon.dwState = NIS_HIDDEN; - notify_icon.dwStateMask = NIS_HIDDEN; - BOOL r = Shell_NotifyIconW(NIM_MODIFY, ¬ify_icon); - ni->NotifyIconShowCount = 0; - if (r == FALSE) { - // \x83^\x83X\x83N\x83o\x81[\x82\xA9\x82\xE7\x82Ȃ\xAD\x82Ȃ\xC1\x82Ă\xA2\x82\xE9 - ni->created = FALSE; - } + + if (!ni->BallonDontHide) { + return; } + + TT_NOTIFYICONDATAW_V2 notify_icon; + InitializeNotifyIconData(ni, ¬ify_icon); + notify_icon.uFlags |= NIF_STATE; + notify_icon.dwState = NIS_HIDDEN; + notify_icon.dwStateMask = NIS_HIDDEN; + BOOL r = Shell_NotifyIconW(NIM_MODIFY, ¬ify_icon); + ni->NotifyIconShowCount = 0; + if (r == FALSE) { + // \x83^\x83X\x83N\x83o\x81[\x82\xA9\x82\xE7\x82Ȃ\xAD\x82Ȃ\xC1\x82Ă\xA2\x82\xE9 + ni->created = FALSE; + } } /** + * \x83^\x83X\x83N\x83g\x83\x8C\x83C\x82ɃA\x83C\x83R\x83\x93\x81A\x83o\x83\x8B\x81[\x83\x93\x83c\x81[\x83\x8B\x83`\x83b\x83v\x82\xF0\x95\\x8E\xA6\x82\xB7\x82\xE9 * + * @param msg \x95\\x8E\xA6\x82\xB7\x82郁\x83b\x83Z\x81[\x83W + * NULL\x82̂Ƃ\xAB\x83o\x83\x8B\x81[\x83\x93\x83c\x81[\x83\x8B\x83`\x83b\x83v\x82͕\\x8E\xA6\x82\xB3\x82\xEA\x82Ȃ\xA2 + * @param title NULL\x82̂Ƃ\xAB\x83^\x83C\x83g\x83\x8B\x82Ȃ\xB5 * @param flag NOTIFYICONDATA.dwInfoFlags * 1 information icon (NIIF_INFO) * 2 warning icon (NIIF_WARNING) @@ -129,9 +141,9 @@ * 3 error icon (NIIF_ERROR) * 0x10 (NIIF_NOSOUND) XP+ */ -static void NotifySetMessageW(NotifyIcon *ni, const wchar_t *msg, const wchar_t *title, DWORD flag) +void Notify2SetMessageW(NotifyIcon *ni, const wchar_t *msg, const wchar_t *title, DWORD flag) { - if (!ni->enable || msg == NULL) { + if (!ni->enable) { return; } if (ni->parent_wnd == NULL) { @@ -164,7 +176,12 @@ } notify_icon.dwInfoFlags = flag; - wcsncpy_s(notify_icon.szInfo, _countof(notify_icon.szInfo), msg, _TRUNCATE); + if (msg) { + wcsncpy_s(notify_icon.szInfo, _countof(notify_icon.szInfo), msg, _TRUNCATE); + } + else { + notify_icon.szInfo[0] = 0; + } if (ni->created) { BOOL r = Shell_NotifyIconW(NIM_MODIFY, ¬ify_icon); @@ -193,13 +210,18 @@ } } -static void NotifySetIconID(NotifyIcon *ni, HINSTANCE hInstance, WORD IconID) +void Notify2SetIconID(NotifyIcon *ni, HINSTANCE hInstance, WORD IconID) { ni->CustomIconInstance = hInstance; ni->CustomIconID = IconID; } -static NotifyIcon *NotifyInitialize(void) +/** + * \x92ʒm\x97̈揉\x8A\xFA\x89\xBB + * + * \x8E\x9F\x82\xC9 Notify2SetWindow() \x82\xF0\x83R\x81[\x83\x8B\x82\xB7\x82\xE9 + */ +NotifyIcon *Notify2Initialize(void) { NotifyIcon *ni = (NotifyIcon *)calloc(sizeof(NotifyIcon) ,1); return ni; @@ -209,9 +231,14 @@ * \x90e\x83E\x83B\x83\x93\x83h\x83E\x82ƒʒm\x97̈\xE6\x82̃A\x83C\x83R\x83\x93\x82\xF0\x83Z\x83b\x83g\x82\xB7\x82\xE9 * \x82\xB1\x82\xCCAPI\x82\xF0\x83R\x81[\x83\x8B\x82\xB7\x82\xE9\x82ƒʒm\x97̈悪\x8Eg\x82\xA6\x82\xE9\x82悤\x82ɂȂ\xE9 * - * @param hWnd \x92ʒm\x97̈\xE6\x82Ɋ֘A\x95t\x82\xAF\x82\xE9\x83E\x83B\x83\x93\x83h\x83E(\x82\xB1\x82\xB1\x82ł͐e\x83E\x83B\x83\x93\x83h\x83E\x82ƌĂ\xD4) + * \x83Z\x83b\x83g\x82\xB5\x82\xBD\x83A\x83C\x83R\x83\x93\x82\xAA\x83f\x83t\x83H\x83\x8B\x83g\x82̃A\x83C\x83R\x83\x93\x82ƂȂ\xE9 + * + * @param hWnd \x92ʒm\x97̈\xE6\x82Ɋ֘A\x95t\x82\xAF\x82\xE9\x83E\x83B\x83\x93\x83h\x83E(\x82\xB1\x82\xB1\x82ł͐e\x83E\x83B\x83\x93\x83h\x83E\x82ƌĂ\xD4) + * @param msg \x90e\x83E\x83B\x83\x93\x83h\x83E\x82֑\x97\x82\xE7\x82\xEA\x82郁\x83b\x83Z\x81[\x83WID + * @param hInstance \x83A\x83C\x83R\x83\x93\x82\xF0\x8E\x9D\x82\x82\x83W\x83\x85\x81[\x83\x8B\x82\xCCinstance + * @param IconID \x83A\x83C\x83R\x83\x93\x82̃\x8A\x83\\x81[\x83XID */ -static void NotifySetWindow(NotifyIcon *ni, HWND hWnd, UINT msg, HINSTANCE hInstance, WORD IconID) +void Notify2SetWindow(NotifyIcon *ni, HWND hWnd, UINT msg, HINSTANCE hInstance, WORD IconID) { assert(hWnd != NULL); if (! HasBalloonTipSupport()) { @@ -230,7 +257,7 @@ * \x90e\x83E\x83B\x83\x93\x83h\x83E\x82\xF0\x94j\x8A\xFC\x82\xB7\x82\xE9\x91O\x82ɒʒm\x97̈\xE6\x82̃A\x83C\x83R\x83\x93\x82\xF0\x8D폜\x82\xB7\x82\xE9 * \x82\xB1\x82\xCCAPI\x82\xF0\x83R\x81[\x83\x8B\x82\xB7\x82\xE9\x82ƒʒm\x97̈\xE6\x82͎g\x82\xA6\x82Ȃ\xAD\x82Ȃ\xE9 */ -static void NotifyUnsetWindow(NotifyIcon *ni) +void Notify2UnsetWindow(NotifyIcon *ni) { if (ni->enable && ni->created) { TT_NOTIFYICONDATAW_V2 notify_icon; @@ -241,22 +268,67 @@ } } -static void NotifyUninitialize(NotifyIcon *ni) +/** + * \x92ʒm\x97̈\xE6\x8FI\x97\xB9 + */ +void Notify2Uninitialize(NotifyIcon *ni) { - NotifyUnsetWindow(ni); + Notify2UnsetWindow(ni); free(ni); } -static void NotifySetSound(NotifyIcon *ni, BOOL sound) +void Notify2SetSound(NotifyIcon *ni, BOOL sound) { ni->no_sound = sound == FALSE ? TRUE : FALSE; } -static BOOL NotifyGetSound(NotifyIcon *ni) +BOOL Notify2GetSound(NotifyIcon *ni) { return ni->no_sound; } +void Notify2SetBallonDontHide(NotifyIcon *ni, BOOL dont_hide) +{ + ni->BallonDontHide = dont_hide; +} + +/** + * Notify2SetWindow() \x82Ŏw\x92肵\x82\xBD\x83E\x83B\x83\x93\x83h\x83E\x83\x81\x83b\x83Z\x81[\x83W\x8F\x88\x97\x9D + */ +void Notify2Event(NotifyIcon *ni, WPARAM wParam, LPARAM lParam) +{ + if (wParam != 1) { + // NOTIFYICONDATA.uID, 1\x82\xB5\x82\xA9\x82Ȃ\xA2 + return; + } + + switch (lParam) { + case WM_MOUSEMOVE: + case WM_LBUTTONUP: + case WM_LBUTTONDBLCLK: + case WM_RBUTTONUP: + case WM_RBUTTONDBLCLK: + case WM_CONTEXTMENU: + case NIN_BALLOONSHOW: + case NIN_BALLOONHIDE: + case NIN_KEYSELECT: + case NIN_SELECT: + default: + // nothing to do + break; + case WM_LBUTTONDOWN: + case WM_RBUTTONDOWN: + case NIN_BALLOONTIMEOUT: + Notify2Hide(ni); + break; + case NIN_BALLOONUSERCLICK: + Notify2Hide(ni); + break; + } +} + +//////////////////// + static NotifyIcon *GetNotifyData(PComVar cv) { assert(cv != NULL); @@ -266,18 +338,13 @@ } /* - * EXPORT API + * for plug-in APIs */ -void WINAPI NotifyHideIcon(PComVar cv) -{ - NotifyIcon *ni = GetNotifyData(cv); - NotifyHide(ni); -} void WINAPI NotifyMessageW(PComVar cv, const wchar_t *msg, const wchar_t *title, DWORD flag) { NotifyIcon *ni = GetNotifyData(cv); - NotifySetMessageW(ni, msg, title, flag); + Notify2SetMessageW(ni, msg, title, flag); } void WINAPI NotifyMessage(PComVar cv, const char *msg, const char *title, DWORD flag) @@ -289,70 +356,7 @@ free(msgW); } -DllExport void NotifySetSound(PComVar cv, BOOL sound) -{ - NotifyIcon *ni = GetNotifyData(cv); - NotifySetSound(ni, sound); -} - -DllExport BOOL NotifyGetSound(PComVar cv) -{ - NotifyIcon *ni = GetNotifyData(cv); - return NotifyGetSound(ni); -} - /** - * \x92ʒm\x97̈揉\x8A\xFA\x89\xBB - * - * @param hWnd \x92ʒm\x97̈\xE6\x82̐e\x83E\x83B\x83\x93\x83h\x83E - * @param msg \x90e\x83E\x83B\x83\x93\x83h\x83E\x82֑\x97\x82\xE7\x82\xEA\x82郁\x83b\x83Z\x81[\x83WID - * @param hInstance \x83A\x83C\x83R\x83\x93\x82\xF0\x8E\x9D\x82\x82\x83W\x83\x85\x81[\x83\x8B\x82\xCCinstance - * @param IconID \x83A\x83C\x83R\x83\x93\x82̃\x8A\x83\\x81[\x83XID - */ -void WINAPI NotifyInitialize(PComVar cv) -{ - assert(cv->NotifyIcon == NULL); // 2\x8Fd\x8F\x89\x8A\xFA\x89\xBB - NotifyIcon *ni = NotifyInitialize(); - cv->NotifyIcon = ni; -} - -/** - * \x92ʒm\x97̈抮\x97\xB9 - */ -void WINAPI NotifyUninitialize(PComVar cv) -{ - NotifyIcon *ni = GetNotifyData(cv); - NotifyUninitialize(ni); - cv->NotifyIcon = NULL; -} - -/** - * \x83E\x83B\x83\x93\x83h\x83E\x82ƃA\x83C\x83R\x83\x93\x82\xF0\x83Z\x83b\x83g\x82\xB7\x82\xE9 - * - * @param hWnd \x92ʒm\x97̈\xE6\x82̐e\x83E\x83B\x83\x93\x83h\x83E - * @param msg \x90e\x83E\x83B\x83\x93\x83h\x83E\x82֑\x97\x82\xE7\x82\xEA\x82郁\x83b\x83Z\x81[\x83WID - * @param hInstance \x83A\x83C\x83R\x83\x93\x82\xF0\x8E\x9D\x82\x82\x83W\x83\x85\x81[\x83\x8B\x82\xCCinstance - * @param IconID \x83A\x83C\x83R\x83\x93\x82̃\x8A\x83\\x81[\x83XID - * - * \x82\xB1\x82\xB1\x82ŃZ\x83b\x83g\x82\xB5\x82\xBD\x83A\x83C\x83R\x83\x93\x82\xAA\x83f\x83t\x83H\x83\x8B\x83g\x82̃A\x83C\x83R\x83\x93\x82ƂȂ\xE9 - */ -void WINAPI NotifySetWindow(PComVar cv, HWND hWnd, UINT msg, HINSTANCE hInstance, WORD IconID) -{ - NotifyIcon *ni = GetNotifyData(cv); - NotifySetWindow(ni, hWnd, msg, hInstance, IconID); -} - -/** - * \x92ʒm\x97̈\xE6\x82̐e\x83E\x83B\x83\x93\x83h\x83E\x82\xF0\x94j\x8A\xFC\x82\xB7\x82\xE9\x91O\x82ɃR\x81[\x83\x8B\x82\xB7\x82\xE9 - * \x82\xB1\x82\xCCAPI\x82\xF0\x83R\x81[\x83\x8B\x82\xB7\x82\xE9\x82ƒʒm\x97̈\xE6\x82͎g\x82\xA6\x82Ȃ\xAD\x82Ȃ\xE9 - */ -void WINAPI NotifyUnsetWindow(PComVar cv) -{ - NotifyIcon *ni = GetNotifyData(cv); - NotifyUnsetWindow(ni); -} - -/** * \x92ʒm\x97̈\xE6\x82Ŏg\x97p\x82\xB7\x82\xE9\x83A\x83C\x83R\x83\x93\x82\xF0\x83Z\x83b\x83g\x82\xB7\x82\xE9 * * @param hInstance \x83A\x83C\x83R\x83\x93\x82\xF0\x8E\x9D\x82\x82\x83W\x83\x85\x81[\x83\x8B\x82\xCCinstance @@ -363,7 +367,7 @@ void WINAPI NotifySetIconID(PComVar cv, HINSTANCE hInstance, WORD IconID) { NotifyIcon *ni = GetNotifyData(cv); - NotifySetIconID(ni, hInstance, IconID); + Notify2SetIconID(ni, hInstance, IconID); } /** Modified: trunk/teraterm/ttpcmn/ttcmn_notify.h =================================================================== --- trunk/teraterm/ttpcmn/ttcmn_notify.h 2022-12-03 06:40:03 UTC (rev 10393) +++ trunk/teraterm/ttpcmn/ttcmn_notify.h 2022-12-03 06:40:18 UTC (rev 10394) @@ -26,6 +26,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// \x83v\x83\x89\x83O\x83C\x83\x93\x82\xA9\x82\xE7\x8Eg\x97p\x82\xB7\x82\xE9API + #pragma once #include <windows.h> @@ -38,18 +40,6 @@ #define DllExport __declspec(dllimport) #endif -// ttermpro.exe \x93\xE0\x95\x94\x82Ŏg\x97p(Tera Term plugin\x82\xA9\x82\xE7\x82͗\x98\x97p\x82\xB5\x82Ȃ\xA2) -#if defined(TTCMN_NOTIFY_INTERNAL) -DllExport void WINAPI NotifyInitialize(PComVar cv); -DllExport void WINAPI NotifyUninitialize(PComVar cv); -DllExport void WINAPI NotifySetWindow(PComVar cv, HWND hWnd, UINT msg, HINSTANCE hInstance, WORD IconID); -DllExport void WINAPI NotifyUnsetWindow(PComVar cv); -DllExport void WINAPI NotifyHideIcon(PComVar cv); -DllExport void NotifySetSound(PComVar cv, BOOL sound); -DllExport BOOL NotifyGetSound(PComVar cv); -#endif - -// plugin \x82\xA9\x82\xE7\x82\xE0\x8Eg\x97p\x89\\x82\xC8IF DllExport void WINAPI NotifyMessageW(PComVar cv, const wchar_t *message, const wchar_t *title, DWORD flag); DllExport void WINAPI NotifyMessage(PComVar cv, const char *message, const char *title, DWORD flag); DllExport void WINAPI NotifySetIconID(PComVar cv, HINSTANCE hInstance, WORD IconID); Copied: trunk/teraterm/ttpcmn/ttcmn_notify2.h (from rev 10393, trunk/teraterm/ttpcmn/ttcmn_notify.h) =================================================================== --- trunk/teraterm/ttpcmn/ttcmn_notify2.h (rev 0) +++ trunk/teraterm/ttpcmn/ttcmn_notify2.h 2022-12-03 06:40:18 UTC (rev 10394) @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2022- TeraTerm Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// ttermpro.exe \x93\xE0\x82Ŏg\x97p\x82\xB7\x82\xE9\x92ʒm\x8A֘A\x82\xCCAPI +// \x83v\x83\x89\x83O\x83C\x83\x93\x82\xA9\x82\xE7\x8Eg\x97p\x82\xB7\x82\xE9API\x82\xCD ttcmn_notify.h \x82\xF0\x8EQ\x8F\xC6 + +#pragma once + +#include <windows.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(DllExport) +#define DllExport __declspec(dllimport) +#endif + +typedef struct NotifyIconST NotifyIcon; + +DllExport NotifyIcon *Notify2Initialize(void); +DllExport void Notify2Uninitialize(NotifyIcon *ni); +DllExport void Notify2SetWindow(NotifyIcon *ni, HWND hWnd, UINT msg, HINSTANCE hInstance, WORD IconID); +DllExport void Notify2Hide(NotifyIcon *ni); +DllExport void Notify2SetMessageW(NotifyIcon *ni, const wchar_t *msg, const wchar_t *title, DWORD flag); +DllExport void Notify2SetIconID(NotifyIcon *ni, HINSTANCE hInstance, WORD IconID); +DllExport void Notify2UnsetWindow(NotifyIcon *ni); +DllExport void Notify2SetSound(NotifyIcon *ni, BOOL sound); +DllExport BOOL Notify2GetSound(NotifyIcon *ni); +DllExport void Notify2Event(NotifyIcon *ni, WPARAM wParam, LPARAM lParam); +DllExport void Notify2SetBallonDontHide(NotifyIcon *ni, BOOL dont_hide); + +#ifdef __cplusplus +} +#endif Modified: trunk/teraterm/ttpcmn/ttpcmn.def =================================================================== --- trunk/teraterm/ttpcmn/ttpcmn.def 2022-12-03 06:40:03 UTC (rev 10393) +++ trunk/teraterm/ttpcmn/ttpcmn.def 2022-12-03 06:40:18 UTC (rev 10394) @@ -26,7 +26,6 @@ b64encode @75 b64decode @76 - NotifyHideIcon @81 NotifyMessage @79 NotifyMessageW NotifySetIconID