From 50c2fbbb1f7f6f233c980d7e4a52151fb72820f7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 9 May 2021 18:45:30 +0300 Subject: suddenly: tipper services were used as string constants (cherry picked from commit 15fcbbc128178ea5a4cdb1a58927a43ea740be88) --- plugins/TabSRMM/src/container.cpp | 2 +- plugins/TabSRMM/src/controls.cpp | 10 +++++----- plugins/TabSRMM/src/stdafx.h | 1 + plugins/TabSRMM/src/tabctrl.cpp | 12 ++++++------ 4 files changed, 13 insertions(+), 12 deletions(-) (limited to 'plugins/TabSRMM/src') diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 9ab8c299a2..32d3aba8da 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -408,7 +408,7 @@ void TContainerData::InitDialog(HWND hwndDlg) Configure(); // tab tooltips... - if (!::ServiceExists("mToolTip/ShowTip") || M.GetByte("d_tooltips", 0) == 0) { + if (!::ServiceExists(MS_TIPPER_SHOWTIPW) || M.GetByte("d_tooltips", 0) == 0) { m_hwndTip = ::CreateWindowEx(0, TOOLTIPS_CLASS, nullptr, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hwndDlg, nullptr, g_plugin.getInst(), (LPVOID)nullptr); diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index 94d1b72dd3..4c426a9e1d 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -903,7 +903,7 @@ LONG_PTR CALLBACK CMsgDialog::StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM ptMouse = pt; if (tooltip_active) { KillTimer(hWnd, TIMERID_HOVER); - CallService("mToolTip/HideTip", 0, 0); + Tipper_Hide(); tooltip_active = FALSE; } KillTimer(hWnd, TIMERID_HOVER); @@ -913,7 +913,7 @@ LONG_PTR CALLBACK CMsgDialog::StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM case WM_LBUTTONDOWN: case WM_RBUTTONDOWN: KillTimer(hWnd, TIMERID_HOVER); - CallService("mToolTip/HideTip", 0, 0); + Tipper_Hide(); tooltip_active = FALSE; GetCursorPos(&pt); rcLastStatusBarClick.left = pt.x - 2; @@ -970,7 +970,7 @@ LONG_PTR CALLBACK CMsgDialog::StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wcsncpy_s(wBuf, sid->szTooltip.w, _TRUNCATE); if (wBuf[0]) { - CallService("mToolTip/ShowTipW", (WPARAM)wBuf, (LPARAM)&ti); + Tipper_ShowTip(wBuf, &ti); tooltip_active = TRUE; } } @@ -982,7 +982,7 @@ LONG_PTR CALLBACK CMsgDialog::StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM mir_snwprintf(wBuf, TranslateT("There are %d pending send jobs. Message length: %d bytes, message length limit: %d bytes\n\n%d messages are queued for later delivery"), dat->m_iOpenJobs, dat->m_message.GetRichTextLength(CP_UTF8), dat->m_cache->getMaxMessageLength(), iQueued); - CallService("mToolTip/ShowTipW", (WPARAM)wBuf, (LPARAM)&ti); + Tipper_ShowTip(wBuf, &ti); } if (SendMessage(dat->m_pContainer->m_hwndStatus, SB_GETTEXT, 0, (LPARAM)wBuf)) { @@ -997,7 +997,7 @@ LONG_PTR CALLBACK CMsgDialog::StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM ptrW tszTopic(db_get_wsa(dat->m_hContact, dat->m_szProto, "Topic")); if (tszTopic != nullptr) { tooltip_active = TRUE; - CallService("mToolTip/ShowTipW", tszTopic, (LPARAM)&ti); + Tipper_ShowTip(tszTopic, &ti); } } } diff --git a/plugins/TabSRMM/src/stdafx.h b/plugins/TabSRMM/src/stdafx.h index 35440301fa..4299063adc 100644 --- a/plugins/TabSRMM/src/stdafx.h +++ b/plugins/TabSRMM/src/stdafx.h @@ -78,6 +78,7 @@ #include #include #include +#include #include #include diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp index 62aaf2a189..5c9de4d029 100644 --- a/plugins/TabSRMM/src/tabctrl.cpp +++ b/plugins/TabSRMM/src/tabctrl.cpp @@ -1098,7 +1098,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara ptMouseT = pt; if (tabdat->bTipActive) { KillTimer(hwnd, TIMERID_HOVER_T); - CallService("mToolTip/HideTip", 0, 0); + Tipper_Hide(); tabdat->bTipActive = false; } KillTimer(hwnd, TIMERID_HOVER_T); @@ -1147,13 +1147,13 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara case WM_RBUTTONDOWN: KillTimer(hwnd, TIMERID_HOVER_T); - CallService("mToolTip/HideTip", 0, 0); + Tipper_Hide(); tabdat->bTipActive = false; break; case WM_LBUTTONDOWN: KillTimer(hwnd, TIMERID_HOVER_T); - CallService("mToolTip/HideTip", 0, 0); + Tipper_Hide(); tabdat->bTipActive = false; if (GetKeyState(VK_CONTROL) & 0x8000) @@ -1258,7 +1258,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara GetCursorPos(&pt); if (abs(pt.x - ptMouseT.x) < 5 && abs(pt.y - ptMouseT.y) < 5) { - CLCINFOTIP ti = { 0 }; + CLCINFOTIP ti = {}; ti.cbSize = sizeof(ti); ti.ptCursor = pt; @@ -1274,7 +1274,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara ti.isGroup = 0; ti.hItem = (HANDLE)dat->m_hContact; ti.isTreeFocused = 0; - CallService("mToolTip/ShowTip", 0, (LPARAM)&ti); + Tipper_ShowTip(0, &ti); } } } @@ -1295,7 +1295,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara case WM_USER + 100: if (tabdat->bTipActive) { tabdat->bTipActive = false; - CallService("mToolTip/HideTip", 0, 0); + Tipper_Hide(); } break; } -- cgit v1.2.3