summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-27 14:23:31 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-27 14:23:31 +0000
commit2f261839b60692e33d0e160344d0d636d49c90ba (patch)
tree187921722698b681d29df3f6e60fb18394a5e9d5 /plugins/TabSRMM/src
parent2e931a0b2780587d85f3902468c935f5adba70c8 (diff)
less TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r--plugins/TabSRMM/src/TSButton.cpp4
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp10
-rw-r--r--plugins/TabSRMM/src/chat/log.cpp22
-rw-r--r--plugins/TabSRMM/src/chat/main.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/manager.cpp8
-rw-r--r--plugins/TabSRMM/src/chat/muchighlight.cpp8
-rw-r--r--plugins/TabSRMM/src/chat/options.cpp16
-rw-r--r--plugins/TabSRMM/src/chat/services.cpp6
-rw-r--r--plugins/TabSRMM/src/chat/tools.cpp18
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp74
-rw-r--r--plugins/TabSRMM/src/contactcache.cpp16
-rw-r--r--plugins/TabSRMM/src/container.cpp38
-rw-r--r--plugins/TabSRMM/src/containeroptions.cpp4
-rw-r--r--plugins/TabSRMM/src/controls.cpp8
-rw-r--r--plugins/TabSRMM/src/eventpopups.cpp52
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp34
-rw-r--r--plugins/TabSRMM/src/globals.cpp2
-rw-r--r--plugins/TabSRMM/src/infopanel.cpp42
-rw-r--r--plugins/TabSRMM/src/mim.cpp10
-rw-r--r--plugins/TabSRMM/src/modplus.cpp6
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp24
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp52
-rw-r--r--plugins/TabSRMM/src/msglog.cpp16
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp20
-rw-r--r--plugins/TabSRMM/src/msgs.cpp8
-rw-r--r--plugins/TabSRMM/src/selectcontainer.cpp12
-rw-r--r--plugins/TabSRMM/src/sendlater.cpp12
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp12
-rw-r--r--plugins/TabSRMM/src/sidebar.cpp6
-rw-r--r--plugins/TabSRMM/src/srmm.cpp6
-rw-r--r--plugins/TabSRMM/src/taskbar.cpp16
-rw-r--r--plugins/TabSRMM/src/templates.cpp2
-rw-r--r--plugins/TabSRMM/src/themeio.cpp2
-rw-r--r--plugins/TabSRMM/src/themes.cpp78
-rw-r--r--plugins/TabSRMM/src/themes.h2
-rw-r--r--plugins/TabSRMM/src/trayicon.cpp6
-rw-r--r--plugins/TabSRMM/src/typingnotify.cpp4
-rw-r--r--plugins/TabSRMM/src/userprefs.cpp2
-rw-r--r--plugins/TabSRMM/src/utils.cpp58
-rw-r--r--plugins/TabSRMM/src/utils.h2
40 files changed, 360 insertions, 360 deletions
diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp
index 673ad7d5a2..443039eba6 100644
--- a/plugins/TabSRMM/src/TSButton.cpp
+++ b/plugins/TabSRMM/src/TSButton.cpp
@@ -291,7 +291,7 @@ static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint)
}
SIZE sz;
- GetTextExtentPoint32(hdcMem, szText, (int)mir_tstrlen(szText), &sz);
+ GetTextExtentPoint32(hdcMem, szText, (int)mir_wstrlen(szText), &sz);
if (ctl->cHot) {
SIZE szHot;
GetTextExtentPoint32A(hdcMem, "&", 1, &szHot);
@@ -300,7 +300,7 @@ static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint)
if (ctl->arrow)
DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->arrow, 0, rcClient.right - rcClient.left - 5 - PluginConfig.m_smcxicon + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), (rcClient.bottom - rcClient.top) / 2 - PluginConfig.m_smcyicon / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, IsWindowEnabled(ctl->hwnd) ? DST_ICON : DST_ICON | DSS_DISABLED);
SelectObject(hdcMem, ctl->hFont);
- DrawState(hdcMem, NULL, NULL, (LPARAM)szText, mir_tstrlen(szText), (rcText.right - rcText.left - sz.cx) / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->hThemeButton ? (rcText.bottom - rcText.top - sz.cy) / 2 : (rcText.bottom - rcText.top - sz.cy) / 2 - (ctl->stateId == PBS_PRESSED ? 0 : 1), sz.cx, sz.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton ? DST_PREFIXTEXT | DSS_NORMAL : DST_PREFIXTEXT | DSS_DISABLED);
+ DrawState(hdcMem, NULL, NULL, (LPARAM)szText, mir_wstrlen(szText), (rcText.right - rcText.left - sz.cx) / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->hThemeButton ? (rcText.bottom - rcText.top - sz.cy) / 2 : (rcText.bottom - rcText.top - sz.cy) / 2 - (ctl->stateId == PBS_PRESSED ? 0 : 1), sz.cx, sz.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton ? DST_PREFIXTEXT | DSS_NORMAL : DST_PREFIXTEXT | DSS_DISABLED);
SelectObject(hdcMem, hOldFont);
}
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp
index 2e2561c2c2..b7116265d1 100644
--- a/plugins/TabSRMM/src/buttonsbar.cpp
+++ b/plugins/TabSRMM/src/buttonsbar.cpp
@@ -121,7 +121,7 @@ static INT_PTR CB_AddButton(WPARAM, LPARAM lParam)
if (bbdi->bbbFlags & BBBF_ANSITOOLTIP)
cbd->m_ptszTooltip = mir_a2u(bbdi->pszTooltip);
else
- cbd->m_ptszTooltip = mir_tstrdup(bbdi->ptszTooltip);
+ cbd->m_ptszTooltip = mir_wstrdup(bbdi->ptszTooltip);
}
else cbd->m_ptszTooltip = NULL;
@@ -314,7 +314,7 @@ static INT_PTR CB_ModifyButton(WPARAM, LPARAM lParam)
if (bbdi->bbbFlags & BBBF_ANSITOOLTIP)
cbd->m_ptszTooltip = mir_a2u(bbdi->pszTooltip);
else
- cbd->m_ptszTooltip = mir_tstrdup(bbdi->ptszTooltip);
+ cbd->m_ptszTooltip = mir_wstrdup(bbdi->ptszTooltip);
}
if (bbdi->hIcon)
cbd->m_hIcon = bbdi->hIcon;
@@ -369,7 +369,7 @@ static int SaveTree(HWND hToolBarTree)
while (tvi.hItem != NULL) {
TreeView_GetItem(hToolBarTree, &tvi);
- if (mir_tstrcmp(tvi.pszText, MIDDLE_SEPARATOR) == 0) {
+ if (mir_wstrcmp(tvi.pszText, MIDDLE_SEPARATOR) == 0) {
RSide = true;
count = TreeView_GetCount(hToolBarTree) * 10 - count;
tvi.hItem = TreeView_GetNextSibling(hToolBarTree, tvi.hItem);
@@ -708,7 +708,7 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
tvi.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_PARAM;
TreeView_GetItem(hToolBarTree, &tvi);
- if (tvi.lParam == 0 || !TreeView_GetCheckState(hToolBarTree, tvi.hItem) || !mir_tstrcmp(tvi.pszText, MIDDLE_SEPARATOR))
+ if (tvi.lParam == 0 || !TreeView_GetCheckState(hToolBarTree, tvi.hItem) || !mir_wstrcmp(tvi.pszText, MIDDLE_SEPARATOR))
break;
CustomButtonData *cbd = (CustomButtonData*)tvi.lParam;
@@ -736,7 +736,7 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
tvi.hItem = hItem;
TreeView_GetItem(hToolBarTree, &tvi);
- if (!TreeView_GetCheckState(hToolBarTree, tvi.hItem) || !mir_tstrcmp(tvi.pszText, MIDDLE_SEPARATOR)) {
+ if (!TreeView_GetCheckState(hToolBarTree, tvi.hItem) || !mir_wstrcmp(tvi.pszText, MIDDLE_SEPARATOR)) {
Utils::enableDlgControl(hwndDlg, IDC_IMCHECK, false);
Utils::enableDlgControl(hwndDlg, IDC_CHATCHECK, false);
Utils::enableDlgControl(hwndDlg, IDC_CANBEHIDDEN, false);
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp
index 09b240c6aa..3cec3e01bb 100644
--- a/plugins/TabSRMM/src/chat/log.cpp
+++ b/plugins/TabSRMM/src/chat/log.cpp
@@ -81,7 +81,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, wchar_t
MODULEINFO *mi = pci->MM_FindModule(streamData->si->pszModule);
va_start(va, fmt);
- lineLen = mir_vsntprintf(line, 8000, fmt, va);
+ lineLen = mir_vsnwprintf(line, 8000, fmt, va);
if (lineLen < 0)
return 0;
line[lineLen] = 0;
@@ -115,7 +115,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, wchar_t
szTemp3[1] = line[2];
szTemp3[2] = '\0';
col = _wtoi(szTemp3);
- mir_sntprintf(szTemp, L"%%%c#%02X%02X%02X", c, GetRValue(mi->crColors[col]), GetGValue(mi->crColors[col]), GetBValue(mi->crColors[col]));
+ mir_snwprintf(szTemp, L"%%%c#%02X%02X%02X", c, GetRValue(mi->crColors[col]), GetGValue(mi->crColors[col]), GetBValue(mi->crColors[col]));
}
}
line += 2;
@@ -123,7 +123,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, wchar_t
case 'C':
case 'F':
if (!g_Settings.bStripFormat && !streamData->bStripFormat) {
- mir_sntprintf(szTemp, L"%%%c", *line);
+ mir_snwprintf(szTemp, L"%%%c", *line);
}
break;
case 'b':
@@ -134,13 +134,13 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, wchar_t
case 'I':
case 'r':
if (!streamData->bStripFormat) {
- mir_sntprintf(szTemp, L"%%%c", *line);
+ mir_snwprintf(szTemp, L"%%%c", *line);
}
break;
}
if (szTemp[0]) {
- size_t iLen = mir_tstrlen(szTemp);
+ size_t iLen = mir_wstrlen(szTemp);
memcpy(d, szTemp, iLen * sizeof(wchar_t));
d += iLen;
}
@@ -429,7 +429,7 @@ static void Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, CMStringA
va_list va;
va_start(va, fmt);
- int lineLen = mir_vsntprintf(line, 8000, fmt, va);
+ int lineLen = mir_vsnwprintf(line, 8000, fmt, va);
if (lineLen < 0)
lineLen = 8000;
line[lineLen] = 0;
@@ -530,19 +530,19 @@ static void AddEventToBuffer(CMStringA &str, LOGSTREAMDATA *streamData)
return;
if (streamData->lin->ptszNick) {
- if (g_Settings.bLogLimitNames && mir_tstrlen(streamData->lin->ptszNick) > 20) {
+ if (g_Settings.bLogLimitNames && mir_wstrlen(streamData->lin->ptszNick) > 20) {
wcsncpy_s(szTemp, 20, streamData->lin->ptszNick, _TRUNCATE);
wcsncpy_s(szTemp + 20, 4, L"...", _TRUNCATE);
}
else wcsncpy_s(szTemp, streamData->lin->ptszNick, _TRUNCATE);
if (g_Settings.bClickableNicks)
- mir_sntprintf(szTemp2, L"~~++#%s#++~~", szTemp);
+ mir_snwprintf(szTemp2, L"~~++#%s#++~~", szTemp);
else
wcsncpy_s(szTemp2, szTemp, _TRUNCATE);
if (streamData->lin->ptszUserInfo && streamData->lin->iType != GC_EVENT_TOPIC)
- mir_sntprintf(szTemp, L"%s (%s)", szTemp2, streamData->lin->ptszUserInfo);
+ mir_snwprintf(szTemp, L"%s (%s)", szTemp2, streamData->lin->ptszUserInfo);
else
wcsncpy_s(szTemp, szTemp2, _TRUNCATE);
pszNick = szTemp;
@@ -774,7 +774,7 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData)
wcsncpy_s(szTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, lin->time), _TRUNCATE);
wcsncpy_s(szOldTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, streamData->si->LastTime), _TRUNCATE);
- if (!g_Settings.bShowTimeIfChanged || streamData->si->LastTime == 0 || mir_tstrcmp(szTimeStamp, szOldTimeStamp)) {
+ if (!g_Settings.bShowTimeIfChanged || streamData->si->LastTime == 0 || mir_wstrcmp(szTimeStamp, szOldTimeStamp)) {
streamData->si->LastTime = lin->time;
Log_AppendRTF(streamData, TRUE, str, L"%s", szTimeStamp);
}
@@ -985,7 +985,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedra
// this uses hidden marks in the rich text to find the events which should be deleted
if (si->bTrimmed) {
wchar_t szPattern[50];
- mir_sntprintf(szPattern, L"~-+%d+-~", si->pLogEnd);
+ mir_snwprintf(szPattern, L"~-+%d+-~", si->pLogEnd);
FINDTEXTEX fi;
fi.lpstrText = szPattern;
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp
index 61859eab96..0694e9f815 100644
--- a/plugins/TabSRMM/src/chat/main.cpp
+++ b/plugins/TabSRMM/src/chat/main.cpp
@@ -156,7 +156,7 @@ static void OnLoadSettings()
g_Settings.bNewLineAfterNames = M.GetBool(CHAT_MODULE, "NewlineAfterNames", false);
g_Settings.bUseCommaAsColon = M.GetBool(CHAT_MODULE, "UseCommaAsColon", false);
- replaceStrT(g_Settings.pszLogDir, M.getChatLogPath());
+ replaceStrW(g_Settings.pszLogDir, M.getChatLogPath());
g_Settings.LogIconSize = (g_Settings.bScaleIcons) ? 12 : 16;
diff --git a/plugins/TabSRMM/src/chat/manager.cpp b/plugins/TabSRMM/src/chat/manager.cpp
index 014b238b05..2b5143465c 100644
--- a/plugins/TabSRMM/src/chat/manager.cpp
+++ b/plugins/TabSRMM/src/chat/manager.cpp
@@ -41,7 +41,7 @@ static int sttCompareNicknames(const wchar_t *s1, const wchar_t *s2)
if (*s1 && !*s2) return -1;
// compare tails
- return mir_tstrcmpi(s1, s2);
+ return mir_wstrcmpi(s1, s2);
}
int UM_CompareItem(USERINFO *u1, const wchar_t* pszNick, WORD wStatus)
@@ -58,7 +58,7 @@ int UM_CompareItem(USERINFO *u1, const wchar_t* pszNick, WORD wStatus)
if (g_Settings.bAlternativeSorting)
return sttCompareNicknames(u1->pszNick, pszNick);
else
- return mir_tstrcmp(u1->pszNick, pszNick);
+ return mir_wstrcmp(u1->pszNick, pszNick);
}
dw1 = dw1 >> 1;
dw2 = dw2 >> 1;
@@ -66,7 +66,7 @@ int UM_CompareItem(USERINFO *u1, const wchar_t* pszNick, WORD wStatus)
if (g_Settings.bAlternativeSorting)
return sttCompareNicknames(u1->pszNick, pszNick);
- return mir_tstrcmp(u1->pszNick, pszNick);
+ return mir_wstrcmp(u1->pszNick, pszNick);
}
//---------------------------------------------------
@@ -121,7 +121,7 @@ SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* cu
for (SESSION_INFO *si = pci->wndList; si; si = si->next)
if (si != currSession && !mir_strcmpi(pszModule, si->pszModule))
if (my_strstri(si->ptszName, pszOriginal) == si->ptszName)
- if (prevSession != si && mir_tstrcmpi(si->ptszName, pszCurrent) > 0 && (!pszName || mir_tstrcmpi(si->ptszName, pszName) < 0)) {
+ if (prevSession != si && mir_wstrcmpi(si->ptszName, pszCurrent) > 0 && (!pszName || mir_wstrcmpi(si->ptszName, pszName) < 0)) {
pResult = si;
pszName = si->ptszName;
}
diff --git a/plugins/TabSRMM/src/chat/muchighlight.cpp b/plugins/TabSRMM/src/chat/muchighlight.cpp
index 0ec60454ff..e6a00d5784 100644
--- a/plugins/TabSRMM/src/chat/muchighlight.cpp
+++ b/plugins/TabSRMM/src/chat/muchighlight.cpp
@@ -151,7 +151,7 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF
p1 = 0;
for (UINT i = 0; i < m_iTextPatterns && !result; i++)
- result = wildcmpt(p, m_TextPatterns[i]) ? MATCH_TEXT : 0;
+ result = wildcmpw(p, m_TextPatterns[i]) ? MATCH_TEXT : 0;
if (p1) {
*p1 = ' ';
@@ -167,9 +167,9 @@ skip_textpatterns:
if ((m_dwFlags & MATCH_NICKNAME) && (dwFlags & MATCH_NICKNAME) && pgce->ptszNick && m_iNickPatterns > 0) {
for (UINT i = 0; i < m_iNickPatterns && !nResult; i++) {
if (pgce->ptszNick)
- nResult = wildcmpt(pgce->ptszNick, m_NickPatterns[i]) ? MATCH_NICKNAME : 0;
+ nResult = wildcmpw(pgce->ptszNick, m_NickPatterns[i]) ? MATCH_NICKNAME : 0;
if ((m_dwFlags & MATCH_UIN) && pgce->ptszUserInfo)
- nResult = wildcmpt(pgce->ptszUserInfo, m_NickPatterns[i]) ? MATCH_NICKNAME : 0;
+ nResult = wildcmpw(pgce->ptszUserInfo, m_NickPatterns[i]) ? MATCH_NICKNAME : 0;
}
}
@@ -300,7 +300,7 @@ INT_PTR CALLBACK CMUCHighlight::dlgProcAdd(HWND hwndDlg, UINT msg, WPARAM wParam
Utils::showDlgControl(hwndDlg, IDC_ADDHIGHLIGHTEDITLIST, SW_HIDE);
::SetDlgItemText(hwndDlg, IDC_ADDHIGHLIGHTTITLE, TranslateT("Add user to highlight list"));
::SendDlgItemMessage(hwndDlg, IDC_ADDHIGHLIGHTNAME, CB_INSERTSTRING, -1, (LPARAM)the->ui->pszNick);
- if (mir_tstrcmp(the->ui->pszNick, the->ui->pszUID))
+ if (mir_wstrcmp(the->ui->pszNick, the->ui->pszUID))
::SendDlgItemMessage(hwndDlg, IDC_ADDHIGHLIGHTNAME, CB_INSERTSTRING, -1, (LPARAM)the->ui->pszUID);
::SendDlgItemMessage(hwndDlg, IDC_ADDHIGHLIGHTNAME, CB_SETCURSEL, 0, 0);
}
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp
index 79bfc11d83..65ee0a3dee 100644
--- a/plugins/TabSRMM/src/chat/options.cpp
+++ b/plugins/TabSRMM/src/chat/options.cpp
@@ -225,7 +225,7 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM
wcsncpy_s(lf->lfFaceName, L"Webdings", _TRUNCATE);
}
else {
- ptrT tszDefFace(db_get_tsa(NULL, szMod, str));
+ ptrW tszDefFace(db_get_tsa(NULL, szMod, str));
if (tszDefFace == NULL)
wcsncpy_s(lf->lfFaceName, fol[j].szDefFace, _TRUNCATE);
else
@@ -356,8 +356,8 @@ HICON LoadIconEx(char *pszIcoLibName)
static void InitSetting(wchar_t* &ppPointer, const char *pszSetting, const wchar_t *pszDefault)
{
- ptrT val(db_get_tsa(NULL, CHAT_MODULE, pszSetting));
- replaceStrT(ppPointer, (val != NULL) ? val : pszDefault);
+ ptrW val(db_get_tsa(NULL, CHAT_MODULE, pszSetting));
+ replaceStrW(ppPointer, (val != NULL) ? val : pszDefault);
}
#define OPT_FIXHEADINGS (WM_USER+1)
@@ -691,7 +691,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
wchar_t tszTooltipText[2048];
- mir_sntprintf(tszTooltipText,
+ mir_snwprintf(tszTooltipText,
L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n"
L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n"
L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
@@ -757,12 +757,12 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
*p1 = 0;
wchar_t tszInitialDir[_MAX_DRIVE + _MAX_PATH + 10];
- mir_sntprintf(tszInitialDir, L"%s%s", M.getChatLogPath(), p);
+ mir_snwprintf(tszInitialDir, L"%s%s", M.getChatLogPath(), p);
if (!PathFileExists(tszInitialDir))
wcsncpy_s(tszInitialDir, M.getChatLogPath(), _TRUNCATE);
wchar_t tszReturnName[MAX_PATH]; tszReturnName[0] = 0;
- mir_sntprintf(tszTemp, L"%s%c*.*%c%c", TranslateT("All files"), 0, 0, 0);
+ mir_snwprintf(tszTemp, L"%s%c*.*%c%c", TranslateT("All files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lpstrInitialDir = tszInitialDir;
@@ -795,11 +795,11 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
if (idList) {
const wchar_t *szUserDir = M.getUserDir();
SHGetPathFromIDList(idList, tszDirectory);
- mir_tstrcat(tszDirectory, L"\\");
+ mir_wstrcat(tszDirectory, L"\\");
wchar_t tszTemp[MAX_PATH];
PathToRelativeT(tszDirectory, tszTemp, szUserDir);
- SetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, mir_tstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
+ SetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, mir_wstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
}
psMalloc->Free(idList);
psMalloc->Release();
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp
index 4fd40eb4d2..6f318e40f6 100644
--- a/plugins/TabSRMM/src/chat/services.cpp
+++ b/plugins/TabSRMM/src/chat/services.cpp
@@ -37,7 +37,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT
if (hContact != 0 && M.GetByte("limittabs", 0) && !wcsncmp(pContainer->szName, L"default", 6)) {
if ((pContainer = FindMatchingContainer(L"default")) == NULL) {
wchar_t szName[CONTAINER_NAMELEN + 1];
- mir_sntprintf(szName, L"default");
+ mir_snwprintf(szName, L"default");
if ((pContainer = CreateContainer(szName, CNT_CREATEFLAG_CLONED, hContact)) == NULL)
return 0;
}
@@ -53,7 +53,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT
// cut nickname if larger than x chars...
wchar_t newcontactname[128];
- if (mir_tstrlen(contactName) > 0) {
+ if (mir_wstrlen(contactName) > 0) {
if (M.GetByte("cuttitle", 0))
CutContactName(contactName, newcontactname, _countof(newcontactname));
else
@@ -167,7 +167,7 @@ void ShowRoom(SESSION_INFO *si, WPARAM, BOOL)
TContainerData *pContainer = si->pContainer;
if (pContainer == NULL) {
GetContainerNameForContact(si->hContact, szName, CONTAINER_NAMELEN);
- if (!g_Settings.bOpenInDefault && !mir_tstrcmp(szName, L"default"))
+ if (!g_Settings.bOpenInDefault && !mir_wstrcmp(szName, L"default"))
wcsncpy(szName, L"Chat Rooms", CONTAINER_NAMELEN);
szName[CONTAINER_NAMELEN] = 0;
pContainer = FindContainerByName(szName);
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp
index 274e4ab8a0..63f7f8134a 100644
--- a/plugins/TabSRMM/src/chat/tools.cpp
+++ b/plugins/TabSRMM/src/chat/tools.cpp
@@ -98,11 +98,11 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa
va_list marker;
static wchar_t szBuf[4 * 1024];
- if (!fmt || mir_tstrlen(fmt) == 0 || mir_tstrlen(fmt) > 2000)
+ if (!fmt || mir_wstrlen(fmt) == 0 || mir_wstrlen(fmt) > 2000)
return 0;
va_start(marker, fmt);
- mir_vsntprintf(szBuf, _countof(szBuf), fmt, marker);
+ mir_vsnwprintf(szBuf, _countof(szBuf), fmt, marker);
va_end(marker);
pd.lchContact = hContact;
@@ -113,7 +113,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa
pd.lchIcon = LoadIconEx("window");
PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
- mir_sntprintf(pd.lptzContactName, L"%s - %s", (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(pd.lptzContactName, L"%s - %s", (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, pcli->pfnGetContactDisplayName(hContact, 0));
wcsncpy_s(pd.lptzText, TranslateTS(szBuf), _TRUNCATE);
pd.iSeconds = g_Settings.iPopupTimeout;
@@ -532,7 +532,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO
if (pszWordText && pszWordText[0]) {
wchar_t szMenuText[4096];
- mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
+ mir_snwprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText);
}
else ModifyMenu(*hMenu, 4, MF_STRING | MF_GRAYED | MF_BYPOSITION, 4, TranslateT("No word to look up"));
@@ -541,11 +541,11 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO
else if (iIndex == 0) {
wchar_t szTemp[50];
if (pszWordText)
- mir_sntprintf(szTemp, TranslateT("&Message %s"), pszWordText);
+ mir_snwprintf(szTemp, TranslateT("&Message %s"), pszWordText);
else
wcsncpy_s(szTemp, TranslateT("&Message"), _TRUNCATE);
- if (mir_tstrlen(szTemp) > 40)
+ if (mir_wstrlen(szTemp) > 40)
wcsncpy_s(szTemp + 40, 4, L"...", _TRUNCATE);
ModifyMenu(*hMenu, ID_MESS, MF_STRING | MF_BYCOMMAND, ID_MESS, szTemp);
gcmi.Type = MENU_ON_NICKLIST;
@@ -658,7 +658,7 @@ char GetIndicator(SESSION_INFO *si, LPCTSTR ptszNick, int *iNickIndex)
*iNickIndex = 0;
for (USERINFO *ui = si->pUsers; ui; ui = ui->next) {
- if (!mir_tstrcmp(ui->pszNick, ptszNick)) {
+ if (!mir_wstrcmp(ui->pszNick, ptszNick)) {
STATUSINFO *ti = pci->TM_FindStatus(si->pStatuses, pci->TM_WordToString(si->pStatuses, ui->Status));
if (ti && (INT_PTR)ti->hIcon < si->iStatusCount) {
if (iNickIndex)
@@ -685,10 +685,10 @@ BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce)
if (gce->ptszNick != NULL) {
dwMask |= CMUCHighlight::MATCH_NICKNAME;
if (si && g_Settings.bLogClassicIndicators) {
- size_t len = mir_tstrlen(gce->ptszNick) + 1;
+ size_t len = mir_wstrlen(gce->ptszNick) + 1;
wchar_t *tmp = (wchar_t*)_alloca(sizeof(wchar_t)*(len + 1));
*tmp = GetIndicator(si, gce->ptszNick, 0);
- mir_tstrcpy(tmp + 1, gce->ptszNick);
+ mir_wstrcpy(tmp + 1, gce->ptszNick);
evTmp.ptszNick = tmp;
}
}
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp
index cde016a19e..a38dfc6291 100644
--- a/plugins/TabSRMM/src/chat/window.cpp
+++ b/plugins/TabSRMM/src/chat/window.cpp
@@ -135,7 +135,7 @@ bool IsStringValidLink(wchar_t *pszText)
if (pszText == NULL)
return false;
- if (mir_tstrlen(pszText) < 5 || wcschr(pszText, '"'))
+ if (mir_wstrlen(pszText) < 5 || wcschr(pszText, '"'))
return false;
if (towlower(pszText[0]) == 'w' && towlower(pszText[1]) == 'w' && towlower(pszText[2]) == 'w' && pszText[3] == '.' && iswalnum(pszText[4]))
@@ -451,7 +451,7 @@ static bool TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si)
start -= 2;
if (dat->szSearchResult != NULL) {
- int cbResult = (int)mir_tstrlen(dat->szSearchResult);
+ int cbResult = (int)mir_wstrlen(dat->szSearchResult);
if (start >= cbResult && !wcsnicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) {
start -= cbResult;
goto LBL_SkipEnd;
@@ -475,8 +475,8 @@ LBL_SkipEnd:
isTopic = TRUE;
}
if (dat->szSearchQuery == NULL) {
- dat->szSearchQuery = mir_tstrndup(pszText + start, end - start);
- dat->szSearchResult = mir_tstrdup(dat->szSearchQuery);
+ dat->szSearchQuery = mir_wstrndup(pszText + start, end - start);
+ dat->szSearchResult = mir_wstrdup(dat->szSearchQuery);
dat->lastSession = NULL;
}
if (isTopic)
@@ -488,12 +488,12 @@ LBL_SkipEnd:
}
else pszName = pci->UM_FindUserAutoComplete(si->pUsers, dat->szSearchQuery, dat->szSearchResult);
- replaceStrT(dat->szSearchResult, NULL);
+ replaceStrW(dat->szSearchResult, NULL);
if (pszName != NULL) {
- dat->szSearchResult = mir_tstrdup(pszName);
+ dat->szSearchResult = mir_wstrdup(pszName);
if (end != start) {
- ptrT szReplace;
+ ptrW szReplace;
if (!isRoom && !isTopic && g_Settings.bAddColonToAutoComplete && start == 0) {
szReplace = (wchar_t*)mir_alloc((mir_wstrlen(pszName) + 4) * sizeof(wchar_t));
mir_wstrcpy(szReplace, pszName);
@@ -510,7 +510,7 @@ LBL_SkipEnd:
SendMessage(hwnd, EM_SETSEL, start, end);
SendMessage(hwnd, EM_REPLACESEL, TRUE, (LPARAM)dat->szSearchQuery);
}
- replaceStrT(dat->szSearchQuery, NULL);
+ replaceStrW(dat->szSearchQuery, NULL);
return false;
}
@@ -1321,7 +1321,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *pa
}
if (tszBuf[0] == 0)
- mir_sntprintf(tszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s",
+ mir_snwprintf(tszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s",
TranslateT("Nickname"), ui1->pszNick,
TranslateT("Unique ID"), ui1->pszUID,
TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui1->Status));
@@ -1452,18 +1452,18 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
break;
}
if (wParam == '\b' && si->szSearch[0]) // backspace
- si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0';
+ si->szSearch[mir_wstrlen(si->szSearch) - 1] = '\0';
else if (wParam < ' ')
break;
else {
- if (mir_tstrlen(si->szSearch) >= _countof(si->szSearch) - 2) {
+ if (mir_wstrlen(si->szSearch) >= _countof(si->szSearch) - 2) {
MessageBeep(MB_OK);
break;
}
wchar_t szNew[2];
szNew[0] = (wchar_t)wParam;
szNew[1] = '\0';
- mir_tstrcat(si->szSearch, szNew);
+ mir_wstrcat(si->szSearch, szNew);
}
if (si->szSearch[0]) {
// iterate over the (sorted) list of nicknames and search for the
@@ -1472,7 +1472,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
for (i = 0; i < iItems; i++) {
USERINFO *ui = pci->UM_FindUserFromIndex(si->pUsers, i);
if (ui) {
- if (!wcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) {
+ if (!wcsnicmp(ui->pszNick, si->szSearch, mir_wstrlen(si->szSearch))) {
SendMessage(hwnd, LB_SETSEL, FALSE, -1);
SendMessage(hwnd, LB_SETSEL, TRUE, i);
si->iSearchItem = i;
@@ -1483,7 +1483,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
}
if (i == iItems) {
MessageBeep(MB_OK);
- si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0';
+ si->szSearch[mir_wstrlen(si->szSearch) - 1] = '\0';
return 0;
}
}
@@ -1671,7 +1671,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
}
}
if (tszBuf[0] == 0)
- mir_sntprintf(tszBuf, L"<b>%s:</b>\t%s\n<b>%s:</b>\t%s\n<b>%s:</b>\t%s",
+ mir_snwprintf(tszBuf, L"<b>%s:</b>\t%s\n<b>%s:</b>\t%s\n<b>%s:</b>\t%s",
TranslateT("Nick"), ui1->pszNick,
TranslateT("Unique ID"), ui1->pszUID,
TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui1->Status));
@@ -1890,7 +1890,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
dat->wStatus = si->wStatus;
const wchar_t *szNick = dat->cache->getNick();
- if (mir_tstrlen(szNick) > 0) {
+ if (mir_wstrlen(szNick) > 0) {
if (M.GetByte("cuttitle", 0))
CutContactName(szNick, dat->newtitle, _countof(dat->newtitle));
else
@@ -1903,19 +1903,19 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
switch (si->iType) {
case GCW_CHATROOM:
hIcon = Skin_LoadProtoIcon(si->pszModule, (dat->wStatus <= ID_STATUS_OFFLINE) ? ID_STATUS_OFFLINE : dat->wStatus);
- mir_sntprintf(szTemp,
+ mir_snwprintf(szTemp,
(si->nUsersInNicklist == 1) ? TranslateT("%s: chat room (%u user%s)") : TranslateT("%s: chat room (%u users%s)"),
szNick, si->nUsersInNicklist, si->bFilterEnabled ? TranslateT(", event filter active") : L"");
break;
case GCW_PRIVMESS:
hIcon = Skin_LoadProtoIcon(si->pszModule, (dat->wStatus <= ID_STATUS_OFFLINE) ? ID_STATUS_OFFLINE : dat->wStatus);
if (si->nUsersInNicklist == 1)
- mir_sntprintf(szTemp, TranslateT("%s: message session"), szNick);
+ mir_snwprintf(szTemp, TranslateT("%s: message session"), szNick);
else
- mir_sntprintf(szTemp, TranslateT("%s: message session (%u users)"), szNick, si->nUsersInNicklist);
+ mir_snwprintf(szTemp, TranslateT("%s: message session (%u users)"), szNick, si->nUsersInNicklist);
break;
case GCW_SERVER:
- mir_sntprintf(szTemp, L"%s: Server", szNick);
+ mir_snwprintf(szTemp, L"%s: Server", szNick);
hIcon = LoadIconEx("window");
break;
}
@@ -1978,17 +1978,17 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
else if (diff > 59) {
DWORD hours = diff / 60;
DWORD minutes = diff % 60;
- mir_sntprintf(mi->tszIdleMsg, TranslateT(", %d %s, %d %s idle"), hours, hours > 1 ?
+ mir_snwprintf(mi->tszIdleMsg, TranslateT(", %d %s, %d %s idle"), hours, hours > 1 ?
TranslateT("hours") : TranslateT("hour"),
minutes, minutes > 1 ? TranslateT("minutes") : TranslateT("minute"));
}
- else mir_sntprintf(mi->tszIdleMsg, TranslateT(", %d %s idle"), diff, diff > 1 ? TranslateT("minutes") : TranslateT("minute"));
+ else mir_snwprintf(mi->tszIdleMsg, TranslateT(", %d %s idle"), diff, diff > 1 ? TranslateT("minutes") : TranslateT("minute"));
}
- mir_sntprintf(szFinalStatusBarText, TranslateT("%s on %s%s"), dat->szMyNickname, mi->ptszModDispName, mi->tszIdleMsg);
+ mir_snwprintf(szFinalStatusBarText, TranslateT("%s on %s%s"), dat->szMyNickname, mi->ptszModDispName, mi->tszIdleMsg);
}
else {
if (si->ptszStatusbarText)
- mir_sntprintf(szFinalStatusBarText, L"%s %s", mi->ptszModDispName, si->ptszStatusbarText);
+ mir_snwprintf(szFinalStatusBarText, L"%s %s", mi->ptszModDispName, si->ptszStatusbarText);
else
wcsncpy_s(szFinalStatusBarText, mi->ptszModDispName, _TRUNCATE);
}
@@ -2213,16 +2213,16 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
SIZE sz;
if (si->iSearchItem != -1 && si->iSearchItem == index && si->szSearch[0]) {
COLORREF clr_orig = GetTextColor(dis->hDC);
- GetTextExtentPoint32(dis->hDC, ui->pszNick, (int)mir_tstrlen(si->szSearch), &sz);
+ GetTextExtentPoint32(dis->hDC, ui->pszNick, (int)mir_wstrlen(si->szSearch), &sz);
SetTextColor(dis->hDC, RGB(250, 250, 0));
- TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, (int)mir_tstrlen(si->szSearch));
+ TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, (int)mir_wstrlen(si->szSearch));
SetTextColor(dis->hDC, clr_orig);
x_offset += sz.cx;
- TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick + mir_tstrlen(si->szSearch), int(mir_tstrlen(ui->pszNick) - mir_tstrlen(si->szSearch)));
+ TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick + mir_wstrlen(si->szSearch), int(mir_wstrlen(ui->pszNick) - mir_wstrlen(si->szSearch)));
}
else {
- GetTextExtentPoint32(dis->hDC, ui->pszNick, (int)mir_tstrlen(ui->pszNick), &sz);
- TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, (int)mir_tstrlen(ui->pszNick));
+ GetTextExtentPoint32(dis->hDC, ui->pszNick, (int)mir_wstrlen(ui->pszNick), &sz);
+ TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, (int)mir_wstrlen(ui->pszNick));
SelectObject(dis->hDC, hOldFont);
}
return TRUE;
@@ -2535,7 +2535,7 @@ LABEL_SHOWWINDOW:
int iRes = SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (iRes > 0) {
- size_t iLen = mir_tstrlen(pszWord) - 1;
+ size_t iLen = mir_wstrlen(pszWord) - 1;
while (strchr(szTrimString, pszWord[iLen])) {
pszWord[iLen] = '\0';
iLen--;
@@ -2655,7 +2655,7 @@ LABEL_SHOWWINDOW:
HMENU hMenu = 0;
USERINFO uiNew;
for (USERINFO *ui = si->pUsers; ui; ui = ui->next) {
- if (mir_tstrcmp(ui->pszNick, tr.lpstrText))
+ if (mir_wstrcmp(ui->pszNick, tr.lpstrText))
continue;
pt.x = (short)LOWORD(((ENLINK*)lParam)->lParam);
@@ -2685,7 +2685,7 @@ LABEL_SHOWWINDOW:
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_EXGETSEL, 0, (LPARAM)&chr);
wchar_t tszAplTmpl[] = L"%s:";
- size_t bufSize = mir_tstrlen(tr.lpstrText) + mir_tstrlen(tszAplTmpl) + 3;
+ size_t bufSize = mir_wstrlen(tr.lpstrText) + mir_wstrlen(tszAplTmpl) + 3;
wchar_t *tszTmp = (wchar_t*)mir_alloc(bufSize * sizeof(wchar_t)), *tszAppeal = tszTmp;
TEXTRANGE tr2;
@@ -2697,12 +2697,12 @@ LABEL_SHOWWINDOW:
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETTEXTRANGE, 0, (LPARAM)&tr2);
if (!iswspace(*tr2.lpstrText))
*tszTmp++ = ' ';
- mir_tstrcpy(tszTmp, tr.lpstrText);
+ mir_wstrcpy(tszTmp, tr.lpstrText);
}
else // in the beginning of the message window
- mir_sntprintf(tszAppeal, bufSize, tszAplTmpl, tr.lpstrText);
+ mir_snwprintf(tszAppeal, bufSize, tszAplTmpl, tr.lpstrText);
- size_t st = mir_tstrlen(tszAppeal);
+ size_t st = mir_wstrlen(tszAppeal);
if (chr.cpMax != -1) {
tr2.chrg.cpMin = chr.cpMax;
tr2.chrg.cpMax = chr.cpMax + 1;
@@ -2824,7 +2824,7 @@ LABEL_SHOWWINDOW:
ptrA pszRtf(Message_GetFromStream(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE)));
pci->SM_AddCommand(si->ptszID, si->pszModule, pszRtf);
- CMString ptszText(ptrT(mir_utf8decodeT(pszRtf)));
+ CMString ptszText(ptrW(mir_utf8decodeW(pszRtf)));
if (ptszText.IsEmpty())
break;
@@ -3203,7 +3203,7 @@ LABEL_SHOWWINDOW:
case DM_CONTAINERSELECTED:
{
wchar_t *szNewName = (wchar_t*)lParam;
- if (!mir_tstrcmp(szNewName, TranslateT("Default container")))
+ if (!mir_wstrcmp(szNewName, TranslateT("Default container")))
szNewName = CGlobals::m_default_container_name;
int iOldItems = TabCtrl_GetItemCount(hwndTab);
if (!wcsncmp(dat->pContainer->szName, szNewName, CONTAINER_NAMELEN))
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp
index b955bd2cb8..e9923d78b2 100644
--- a/plugins/TabSRMM/src/contactcache.cpp
+++ b/plugins/TabSRMM/src/contactcache.cpp
@@ -118,7 +118,7 @@ bool CContactCache::updateNick()
bool fChanged = false;
if (m_Valid) {
wchar_t *tszNick = pcli->pfnGetContactDisplayName(getActiveContact(), 0);
- if (tszNick && mir_tstrcmp(m_szNick, tszNick))
+ if (tszNick && mir_wstrcmp(m_szNick, tszNick))
fChanged = true;
wcsncpy_s(m_szNick, (tszNick ? tszNick : L"<undef>"), _TRUNCATE);
}
@@ -178,7 +178,7 @@ bool CContactCache::updateUIN()
m_szUIN[0] = 0;
if (m_Valid) {
- ptrT uid(Contact_GetInfo(CNF_DISPLAYUID, getActiveContact(), getActiveProto()));
+ ptrW uid(Contact_GetInfo(CNF_DISPLAYUID, getActiveContact(), getActiveProto()));
if (uid != NULL)
wcsncpy_s(m_szUIN, uid, _TRUNCATE);
}
@@ -446,15 +446,15 @@ void CContactCache::updateStatusMsg(const char *szKey)
if (m_szStatusMsg)
mir_free(m_szStatusMsg);
m_szStatusMsg = 0;
- ptrT szStatus(db_get_tsa(hContact, "CList", "StatusMsg"));
+ ptrW szStatus(db_get_tsa(hContact, "CList", "StatusMsg"));
if (szStatus != 0)
- m_szStatusMsg = (mir_tstrlen(szStatus) > 0 ? getNormalizedStatusMsg(szStatus) : 0);
+ m_szStatusMsg = (mir_wstrlen(szStatus) > 0 ? getNormalizedStatusMsg(szStatus) : 0);
}
if (szKey == 0 || (szKey && !mir_strcmp("ListeningTo", szKey))) {
if (m_ListeningInfo)
mir_free(m_ListeningInfo);
m_ListeningInfo = 0;
- ptrT szListeningTo(db_get_tsa(hContact, cc->szProto, "ListeningTo"));
+ ptrW szListeningTo(db_get_tsa(hContact, cc->szProto, "ListeningTo"));
if (szListeningTo != 0 && *szListeningTo)
m_ListeningInfo = szListeningTo.detach();
}
@@ -462,7 +462,7 @@ void CContactCache::updateStatusMsg(const char *szKey)
if (m_xStatusMsg)
mir_free(m_xStatusMsg);
m_xStatusMsg = 0;
- ptrT szXStatusMsg(db_get_tsa(hContact, cc->szProto, "XStatusMsg"));
+ ptrW szXStatusMsg(db_get_tsa(hContact, cc->szProto, "XStatusMsg"));
if (szXStatusMsg != 0 && *szXStatusMsg)
m_xStatusMsg = szXStatusMsg.detach();
}
@@ -523,7 +523,7 @@ int CContactCache::cacheUpdateMetaChanged(WPARAM bMetaEnabled, LPARAM)
*/
wchar_t* CContactCache::getNormalizedStatusMsg(const wchar_t *src, bool fStripAll)
{
- if (src == 0 || mir_tstrlen(src) < 2)
+ if (src == 0 || mir_wstrlen(src) < 2)
return 0;
CMString dest;
@@ -542,7 +542,7 @@ wchar_t* CContactCache::getNormalizedStatusMsg(const wchar_t *src, bool fStripAl
dest.AppendChar(src[i]);
}
- return mir_tstrndup(dest, dest.GetLength());
+ return mir_wstrndup(dest, dest.GetLength());
}
/**
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index 02851f893c..06d188730a 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -803,7 +803,7 @@ panel_found:
char szIndex[10];
itoa(iSelection - IDM_CONTAINERMENU, szIndex, 10);
if (iSelection - IDM_CONTAINERMENU >= 0) {
- ptrT tszName(db_get_tsa(NULL, CONTAINER_KEY, szIndex));
+ ptrW tszName(db_get_tsa(NULL, CONTAINER_KEY, szIndex));
if (tszName != NULL)
SendMessage((HWND)tci.lParam, DM_CONTAINERSELECTED, 0, tszName);
}
@@ -1719,7 +1719,7 @@ panel_found:
char szCName[40];
mir_snprintf(szCName, "%s_theme", CONTAINER_PREFIX);
- if (mir_tstrlen(pContainer->szRelThemeFile) > 1) {
+ if (mir_wstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
PathToRelativeT(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath());
db_set_ts(hContact, SRMSGMOD_T, szCName, pContainer->szRelThemeFile);
@@ -1759,7 +1759,7 @@ TContainerData* TSAPI CreateContainer(const wchar_t *name, int iTemp, MCONTACT h
wcsncpy(pContainer->szName, name, CONTAINER_NAMELEN + 1);
AppendToContainerList(pContainer);
- if (M.GetByte("limittabs", 0) && !mir_tstrcmp(name, L"default"))
+ if (M.GetByte("limittabs", 0) && !mir_wstrcmp(name, L"default"))
iTemp |= CNT_CREATEFLAG_CLONED;
// save container name to the db
@@ -1768,7 +1768,7 @@ TContainerData* TSAPI CreateContainer(const wchar_t *name, int iTemp, MCONTACT h
do {
char szCounter[10];
itoa(i, szCounter, 10);
- ptrT tszName(db_get_tsa(NULL, CONTAINER_KEY, szCounter));
+ ptrW tszName(db_get_tsa(NULL, CONTAINER_KEY, szCounter));
if (tszName == NULL) {
if (iFirstFree != -1) {
pContainer->iContainerIndex = iFirstFree;
@@ -1876,12 +1876,12 @@ void TSAPI CloseOtherTabs(HWND hwndTab, TWindowData &dat)
int TSAPI CutContactName(const wchar_t *oldname, wchar_t *newname, size_t size)
{
- if (mir_tstrlen(oldname) <= PluginConfig.m_iTabNameLimit)
+ if (mir_wstrlen(oldname) <= PluginConfig.m_iTabNameLimit)
wcsncpy_s(newname, size, oldname, _TRUNCATE);
else {
wchar_t fmt[30];
- mir_sntprintf(fmt, L"%%%d.%ds...", PluginConfig.m_iTabNameLimit, PluginConfig.m_iTabNameLimit);
- mir_sntprintf(newname, size, fmt, oldname);
+ mir_snwprintf(fmt, L"%%%d.%ds...", PluginConfig.m_iTabNameLimit, PluginConfig.m_iTabNameLimit);
+ mir_snwprintf(newname, size, fmt, oldname);
}
return 0;
}
@@ -1906,7 +1906,7 @@ static TContainerData* TSAPI AppendToContainerList(TContainerData *pContainer)
TContainerData* TSAPI FindContainerByName(const wchar_t *name)
{
- if (name == NULL || mir_tstrlen(name) == 0)
+ if (name == NULL || mir_wstrlen(name) == 0)
return 0;
if (M.GetByte("singlewinmode", 0)) // single window mode - always return 0 and force a new container
@@ -2016,7 +2016,7 @@ int TSAPI GetContainerNameForContact(MCONTACT hContact, wchar_t *szName, int iNa
// use clist group names for containers...
if (M.GetByte("useclistgroups", 0)) {
- ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
if (tszGroup == NULL) {
wcsncpy_s(szName, iNameLen, L"default", _TRUNCATE);
return 0;
@@ -2026,7 +2026,7 @@ int TSAPI GetContainerNameForContact(MCONTACT hContact, wchar_t *szName, int iNa
return 1;
}
- ptrT tszContainerName(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
+ ptrW tszContainerName(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
if (tszContainerName == NULL) {
wcsncpy_s(szName, iNameLen, L"default", _TRUNCATE);
return 0;
@@ -2040,15 +2040,15 @@ void TSAPI DeleteContainer(int iIndex)
{
char szIndex[10];
itoa(iIndex, szIndex, 10);
- ptrT tszContainerName(db_get_tsa(NULL, CONTAINER_KEY, szIndex));
+ ptrW tszContainerName(db_get_tsa(NULL, CONTAINER_KEY, szIndex));
if (tszContainerName == NULL)
return;
db_set_ts(NULL, CONTAINER_KEY, szIndex, L"**mir_free**");
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- ptrT tszValue(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
- if (!mir_tstrcmp(tszValue, tszContainerName))
+ ptrW tszValue(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
+ if (!mir_wstrcmp(tszValue, tszContainerName))
db_unset(hContact, SRMSGMOD_T, CONTAINER_SUBKEY);
}
@@ -2069,20 +2069,20 @@ void TSAPI DeleteContainer(int iIndex)
void TSAPI RenameContainer(int iIndex, const wchar_t *szNew)
{
- if (mir_tstrlen(szNew) == 0)
+ if (mir_wstrlen(szNew) == 0)
return;
char szIndex[10];
itoa(iIndex, szIndex, 10);
- ptrT tszContainerName(db_get_tsa(NULL, CONTAINER_KEY, szIndex));
+ ptrW tszContainerName(db_get_tsa(NULL, CONTAINER_KEY, szIndex));
if (tszContainerName == NULL)
return;
db_set_ts(NULL, CONTAINER_KEY, szIndex, szNew);
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- ptrT tszValue(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
- if (!mir_tstrcmp(tszValue, tszContainerName))
+ ptrW tszValue(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
+ if (!mir_wstrcmp(tszValue, tszContainerName))
db_set_ts(hContact, SRMSGMOD_T, CONTAINER_SUBKEY, szNew);
}
}
@@ -2105,12 +2105,12 @@ HMENU TSAPI BuildContainerMenu()
while (true) {
char szCounter[10];
itoa(i, szCounter, 10);
- ptrT tszName(db_get_tsa(NULL, CONTAINER_KEY, szCounter));
+ ptrW tszName(db_get_tsa(NULL, CONTAINER_KEY, szCounter));
if (tszName == NULL)
break;
if (wcsncmp(tszName, L"**mir_free**", CONTAINER_NAMELEN))
- AppendMenu(hMenu, MF_STRING, IDM_CONTAINERMENU + i, !mir_tstrcmp(tszName, L"default") ? TranslateT("Default container") : tszName);
+ AppendMenu(hMenu, MF_STRING, IDM_CONTAINERMENU + i, !mir_wstrcmp(tszName, L"default") ? TranslateT("Default container") : tszName);
i++;
}
diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp
index 33f27f8b7c..9dbc431c96 100644
--- a/plugins/TabSRMM/src/containeroptions.cpp
+++ b/plugins/TabSRMM/src/containeroptions.cpp
@@ -153,7 +153,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
pContainer->hWndOptions = hwndDlg;
SetWindowText(hwndDlg, TranslateT("Container options"));
wchar_t szNewTitle[128];
- mir_sntprintf(szNewTitle, L"%s", !mir_tstrcmp(pContainer->szName, L"default") ?
+ mir_snwprintf(szNewTitle, L"%s", !mir_wstrcmp(pContainer->szName, L"default") ?
TranslateT("Default container") : pContainer->szName);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, szNewTitle);
Utils::enableDlgControl(hwndDlg, IDC_O_HIDETITLE, !CSkin::m_frameSkins);
@@ -338,7 +338,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
szFilename[MAX_PATH - 1] = 0;
PathToAbsoluteT(szFilename, szFinalThemeFile, M.getDataPath());
- if (mir_tstrcmp(szFilename, pContainer->szRelThemeFile))
+ if (mir_wstrcmp(szFilename, pContainer->szRelThemeFile))
pContainer->fPrivateThemeChanged = TRUE;
if (PathFileExists(szFinalThemeFile))
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp
index a60bf718a8..5d69e24d89 100644
--- a/plugins/TabSRMM/src/controls.cpp
+++ b/plugins/TabSRMM/src/controls.cpp
@@ -966,12 +966,12 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
if (!mir_strcmp(sid->szModule, MSG_ICON_MODULE)) {
if (sid->dwId == MSG_ICON_SOUND)
- mir_sntprintf(wBuf, TranslateT("Sounds are %s. Click to toggle status, hold SHIFT and click to set for all open containers"),
+ mir_snwprintf(wBuf, TranslateT("Sounds are %s. Click to toggle status, hold SHIFT and click to set for all open containers"),
pContainer->dwFlags & CNT_NOSOUND ? TranslateT("disabled") : TranslateT("enabled"));
else if (sid->dwId == MSG_ICON_UTN && (dat->bType == SESSIONTYPE_IM || dat->si->iType == GCW_PRIVMESS)) {
int mtnStatus = db_get_b(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, M.GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW));
- mir_sntprintf(wBuf, TranslateT("Sending typing notifications is %s."),
+ mir_snwprintf(wBuf, TranslateT("Sending typing notifications is %s."),
mtnStatus ? TranslateT("enabled") : TranslateT("disabled"));
}
else if (sid->dwId == MSG_ICON_SESSION)
@@ -997,7 +997,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
const wchar_t *szFormat = 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");
- mir_sntprintf(wBuf, szFormat, dat->iOpenJobs, iLength, dat->nMax ? dat->nMax : 20000, iQueued);
+ mir_snwprintf(wBuf, szFormat, dat->iOpenJobs, iLength, dat->nMax ? dat->nMax : 20000, iQueued);
CallService("mToolTip/ShowTipW", (WPARAM)wBuf, (LPARAM)&ti);
}
@@ -1010,7 +1010,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
if (PtInRect(&rc, pt) && ((rc.right - rc.left) < size.cx)) {
if (dat->bType == SESSIONTYPE_CHAT) {
- ptrT tszTopic(db_get_tsa(dat->hContact, dat->szProto, "Topic"));
+ ptrW tszTopic(db_get_tsa(dat->hContact, dat->szProto, "Topic"));
if (tszTopic != NULL) {
tooltip_active = TRUE;
CallService("mToolTip/ShowTipW", tszTopic, (LPARAM)&ti);
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp
index 0680d86d3a..24f0fe2898 100644
--- a/plugins/TabSRMM/src/eventpopups.cpp
+++ b/plugins/TabSRMM/src/eventpopups.cpp
@@ -422,7 +422,7 @@ static wchar_t* ShortenPreview(DBEVENTINFO* dbe)
iPreviewLimit = 500;
wchar_t *buf = DbGetEventTextT(dbe, CP_ACP);
- if (mir_tstrlen(buf) > iPreviewLimit) {
+ if (mir_wstrlen(buf) > iPreviewLimit) {
fAddEllipsis = true;
size_t iIndex = iPreviewLimit;
size_t iWordThreshold = 20;
@@ -432,8 +432,8 @@ static wchar_t* ShortenPreview(DBEVENTINFO* dbe)
buf[iIndex] = 0;
}
if (fAddEllipsis) {
- buf = (wchar_t*)mir_realloc(buf, (mir_tstrlen(buf) + 5) * sizeof(wchar_t));
- mir_tstrcat(buf, L"...");
+ buf = (wchar_t*)mir_realloc(buf, (mir_wstrlen(buf) + 5) * sizeof(wchar_t));
+ mir_wstrcat(buf, L"...");
}
return buf;
}
@@ -447,12 +447,12 @@ static wchar_t* GetPreviewT(WORD eventType, DBEVENTINFO* dbe)
if (pBlob && nen_options.bPreview)
return ShortenPreview(dbe);
- return mir_tstrdup(TranslateT("Message"));
+ return mir_wstrdup(TranslateT("Message"));
case EVENTTYPE_FILE:
if (pBlob) {
if (!nen_options.bPreview)
- return mir_tstrdup(TranslateT("Incoming file"));
+ return mir_wstrdup(TranslateT("Incoming file"));
if (dbe->cbBlob > 5) { // min valid size = (sizeof(DWORD) + 1 character file name + terminating 0)
char* szFileName = (char *)dbe->pBlob + sizeof(DWORD);
@@ -462,30 +462,30 @@ static wchar_t* GetPreviewT(WORD eventType, DBEVENTINFO* dbe)
if (dbe->cbBlob > (sizeof(DWORD) + namelength + 1))
szDescr = szFileName + namelength + 1;
- ptrT tszFileName(DbGetEventStringT(dbe, szFileName));
+ ptrW tszFileName(DbGetEventStringT(dbe, szFileName));
wchar_t buf[1024];
if (szDescr && Utils::safe_strlen(szDescr, dbe->cbBlob - sizeof(DWORD) - namelength - 1) > 0) {
- ptrT tszDescr(DbGetEventStringT(dbe, szDescr));
+ ptrW tszDescr(DbGetEventStringT(dbe, szDescr));
if (tszFileName && tszDescr) {
- mir_sntprintf(buf, L"%s: %s (%s)", TranslateT("Incoming file"), tszFileName, tszDescr);
- return mir_tstrdup(buf);
+ mir_snwprintf(buf, L"%s: %s (%s)", TranslateT("Incoming file"), tszFileName, tszDescr);
+ return mir_wstrdup(buf);
}
}
if (tszFileName) {
- mir_sntprintf(buf, L"%s: %s (%s)", TranslateT("Incoming file"), tszFileName, TranslateT("No description given"));
- return mir_tstrdup(buf);
+ mir_snwprintf(buf, L"%s: %s (%s)", TranslateT("Incoming file"), tszFileName, TranslateT("No description given"));
+ return mir_wstrdup(buf);
}
}
}
- return mir_tstrdup(TranslateT("Incoming file (invalid format)"));
+ return mir_wstrdup(TranslateT("Incoming file (invalid format)"));
default:
if (nen_options.bPreview)
return ShortenPreview(dbe);
- return mir_tstrdup(TranslateT("Unknown event"));
+ return mir_wstrdup(TranslateT("Unknown event"));
}
}
@@ -500,7 +500,7 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent)
wchar_t szHeader[256];
if (pdata->pluginOptions->bShowHeaders)
- mir_sntprintf(szHeader, L"%s %d\n", TranslateT("New messages: "), pdata->nrMerged + 1);
+ mir_snwprintf(szHeader, L"%s %d\n", TranslateT("New messages: "), pdata->nrMerged + 1);
else
szHeader[0] = 0;
@@ -513,14 +513,14 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent)
wchar_t timestamp[MAX_DATASIZE];
wcsftime(timestamp, MAX_DATASIZE, L"%Y.%m.%d %H:%M", _localtime32((__time32_t *)&dbe.timestamp));
- mir_sntprintf(pdata->eventData[pdata->nrMerged].tszText, L"\n\n%s\n", timestamp);
+ mir_snwprintf(pdata->eventData[pdata->nrMerged].tszText, L"\n\n%s\n", timestamp);
wchar_t *szPreview = GetPreviewT(dbe.eventType, &dbe);
if (szPreview) {
- mir_tstrncat(pdata->eventData[pdata->nrMerged].tszText, szPreview, _countof(pdata->eventData[pdata->nrMerged].tszText) - mir_tstrlen(pdata->eventData[pdata->nrMerged].tszText));
+ mir_wstrncat(pdata->eventData[pdata->nrMerged].tszText, szPreview, _countof(pdata->eventData[pdata->nrMerged].tszText) - mir_wstrlen(pdata->eventData[pdata->nrMerged].tszText));
mir_free(szPreview);
}
- else mir_tstrncat(pdata->eventData[pdata->nrMerged].tszText, L" ", _countof(pdata->eventData[pdata->nrMerged].tszText) - mir_tstrlen(pdata->eventData[pdata->nrMerged].tszText));
+ else mir_wstrncat(pdata->eventData[pdata->nrMerged].tszText, L" ", _countof(pdata->eventData[pdata->nrMerged].tszText) - mir_wstrlen(pdata->eventData[pdata->nrMerged].tszText));
pdata->eventData[pdata->nrMerged].tszText[MAX_SECONDLINE - 1] = 0;
@@ -533,18 +533,18 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent)
int i, available = MAX_SECONDLINE - 1;
if (pdata->pluginOptions->bShowHeaders) {
wcsncpy(lpzText, szHeader, MAX_SECONDLINE);
- available -= (int)mir_tstrlen(szHeader);
+ available -= (int)mir_wstrlen(szHeader);
}
else lpzText[0] = 0;
for (i = pdata->nrMerged; i >= 0; i--) {
- available -= (int)mir_tstrlen(pdata->eventData[i].tszText);
+ available -= (int)mir_wstrlen(pdata->eventData[i].tszText);
if (available <= 0)
break;
}
i = (available > 0) ? i + 1 : i + 2;
for (; i <= pdata->nrMerged; i++)
- mir_tstrncat(lpzText, pdata->eventData[i].tszText, _countof(lpzText) - mir_tstrlen(lpzText));
+ mir_wstrncat(lpzText, pdata->eventData[i].tszText, _countof(lpzText) - mir_wstrlen(lpzText));
pdata->eventData[pdata->nrMerged].hEvent = hEvent;
pdata->eventData[pdata->nrMerged].timestamp = dbe.timestamp;
@@ -670,14 +670,14 @@ void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced)
PluginConfig.m_UnreadInTray -= (mii.dwItemData & 0x0000ffff);
if (mii.dwItemData > 0 || bForced) {
wchar_t szMenuEntry[80];
- mir_sntprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszProto,
+ mir_snwprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszProto,
dat->cache->getNick(), dat->szStatus[0] ? dat->szStatus : L"(undef)", mii.dwItemData & 0x0000ffff);
if (!bForced)
mii.dwItemData = 0;
mii.fMask |= MIIM_STRING;
mii.dwTypeData = (LPTSTR)szMenuEntry;
- mii.cch = (int)mir_tstrlen(szMenuEntry) + 1;
+ mii.cch = (int)mir_wstrlen(szMenuEntry) + 1;
}
mii.hbmpItem = HBMMENU_CALLBACK;
SetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)dat->hContact, FALSE, &mii);
@@ -712,7 +712,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro
if (fromEvent == 2) // from chat...
mii.dwItemData |= 0x10000000;
DeleteMenu(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, MF_BYCOMMAND);
- mir_sntprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
+ mir_snwprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
AppendMenu(PluginConfig.g_hMenuTrayUnread, MF_BYCOMMAND | MF_STRING, (UINT_PTR)hContact, szMenuEntry);
PluginConfig.m_UnreadInTray++;
if (PluginConfig.m_UnreadInTray)
@@ -722,7 +722,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro
else {
szNick = pcli->pfnGetContactDisplayName(hContact, 0);
if (CheckMenuItem(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, MF_BYCOMMAND | MF_UNCHECKED) == -1) {
- mir_sntprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszFinalProto, szNick, szMyStatus, fromEvent ? 1 : 0);
+ mir_snwprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszFinalProto, szNick, szMyStatus, fromEvent ? 1 : 0);
AppendMenu(PluginConfig.g_hMenuTrayUnread, MF_BYCOMMAND | MF_STRING, (UINT_PTR)hContact, szMenuEntry);
mii.dwItemData = fromEvent ? 1 : 0;
PluginConfig.m_UnreadInTray += (mii.dwItemData & 0x0000ffff);
@@ -740,8 +740,8 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro
mii.fMask |= MIIM_STRING;
if (fromEvent == 2)
mii.dwItemData |= 0x10000000;
- mir_sntprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
- mii.cch = (int)mir_tstrlen(szMenuEntry) + 1;
+ mir_snwprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
+ mii.cch = (int)mir_wstrlen(szMenuEntry) + 1;
mii.dwTypeData = (LPTSTR)szMenuEntry;
}
SetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, FALSE, &mii);
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index 03317d8d5b..365fe0a812 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -44,13 +44,13 @@ void TSAPI DM_SaveLogAsRTF(const TWindowData *dat)
}
else if (dat) {
wchar_t szFilter[MAX_PATH], szFilename[MAX_PATH];
- mir_sntprintf(szFilter, L"%s%c*.rtf%c%c", TranslateT("Rich Edit file"), 0, 0, 0);
- mir_sntprintf(szFilename, L"%s.rtf", dat->cache->getNick());
+ mir_snwprintf(szFilter, L"%s%c*.rtf%c%c", TranslateT("Rich Edit file"), 0, 0, 0);
+ mir_snwprintf(szFilename, L"%s.rtf", dat->cache->getNick());
Utils::sanitizeFilename(szFilename);
wchar_t szInitialDir[MAX_PATH + 2];
- mir_sntprintf(szInitialDir, L"%s%s\\", M.getDataPath(), L"\\Saved message logs");
+ mir_snwprintf(szInitialDir, L"%s%s\\", M.getDataPath(), L"\\Saved message logs");
CreateDirectoryTreeT(szInitialDir);
OPENFILENAME ofn = { 0 };
@@ -613,7 +613,7 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)&v);
wchar_t tStr[80];
- mir_sntprintf(tStr, L"%s %d.%d.%d.%d [build %d]",
+ mir_snwprintf(tStr, L"%s %d.%d.%d.%d [build %d]",
TranslateT("Version"), __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM, v[3]);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, tStr);
}
@@ -1004,7 +1004,7 @@ void TSAPI DM_LoadLocale(TWindowData *dat)
if (!PluginConfig.m_bDontUseDefaultKbd) {
wchar_t szBuf[20];
GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, szBuf, 20);
- mir_sntprintf(szKLName, L"0000%s", szBuf);
+ mir_snwprintf(szKLName, L"0000%s", szBuf);
db_set_ts(dat->hContact, SRMSGMOD_T, "locale", szKLName);
}
else {
@@ -1042,7 +1042,7 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat)
wchar_t szBuf[100];
if (dat->bShowTyping) {
SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, (LPARAM)PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]);
- mir_sntprintf(szBuf, TranslateT("%s is typing a message..."), dat->cache->getNick());
+ mir_snwprintf(szBuf, TranslateT("%s is typing a message..."), dat->cache->getNick());
}
else if (dat->sbCustom) {
SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, (LPARAM)dat->sbCustom->hIcon);
@@ -1053,14 +1053,14 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat)
SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, 0);
if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR)
- mir_sntprintf(szBuf, L"UID: %s", dat->cache->getUIN());
+ mir_snwprintf(szBuf, L"UID: %s", dat->cache->getUIN());
else if (dat->lastMessage) {
wchar_t date[64], time[64];
TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"d", date, _countof(date), 0);
- if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR && mir_tstrlen(date) > 6)
- date[mir_tstrlen(date) - 5] = 0;
+ if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR && mir_wstrlen(date) > 6)
+ date[mir_wstrlen(date) - 5] = 0;
TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"t", time, _countof(time), 0);
- mir_sntprintf(szBuf, TranslateT("Last received: %s at %s"), date, time);
+ mir_snwprintf(szBuf, TranslateT("Last received: %s at %s"), date, time);
}
else szBuf[0] = 0;
}
@@ -1374,7 +1374,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff)
dat->bShowTyping = 2;
dat->nTypeSecs = 86400;
- mir_sntprintf(dat->szStatusBar, TranslateT("%s has entered text."), dat->cache->getNick());
+ mir_snwprintf(dat->szStatusBar, TranslateT("%s has entered text."), dat->cache->getNick());
if (hwndStatus && dat->pContainer->hwndActive == hwndDlg)
SendMessage(hwndStatus, SB_SETTEXT, 0, (LPARAM)dat->szStatusBar);
}
@@ -1399,7 +1399,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff)
UpdateStatusBar(dat);
}
else if (dat->nTypeSecs > 0) {
- mir_sntprintf(dat->szStatusBar, TranslateT("%s is typing a message"), dat->cache->getNick());
+ mir_snwprintf(dat->szStatusBar, TranslateT("%s is typing a message"), dat->cache->getNick());
dat->nTypeSecs--;
if (hwndStatus && dat->pContainer->hwndActive == hwndDlg) {
@@ -1592,7 +1592,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam)
dat->hQueuedEvents[dat->iNextQueuedEvent++] = hDbEvent;
wchar_t szBuf[100];
- mir_sntprintf(szBuf, TranslateT("Auto scrolling is disabled, %d message(s) queued (press F12 to enable it)"),
+ mir_snwprintf(szBuf, TranslateT("Auto scrolling is disabled, %d message(s) queued (press F12 to enable it)"),
dat->iNextQueuedEvent);
SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, szBuf);
RedrawWindow(GetDlgItem(hwndDlg, IDC_LOGFROZENTEXT), NULL, NULL, RDW_INVALIDATE);
@@ -1742,9 +1742,9 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam)
Utils::DoubleAmpersands(newcontactname, _countof(newcontactname));
- if (mir_tstrlen(newcontactname) != 0) {
+ if (mir_wstrlen(newcontactname) != 0) {
if (PluginConfig.m_bStatusOnTabs)
- mir_sntprintf(newtitle, L"%s (%s)", newcontactname, dat->szStatus);
+ mir_snwprintf(newtitle, L"%s (%s)", newcontactname, dat->szStatus);
else
wcsncpy_s(newtitle, newcontactname, _TRUNCATE);
}
@@ -1756,11 +1756,11 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam)
wchar_t fulluin[256];
if (dat->bIsMeta)
- mir_sntprintf(fulluin,
+ mir_snwprintf(fulluin,
TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nRight click for metacontact control\nClick dropdown to add or remove user from your favorites."),
bHasName ? dat->cache->getUIN() : TranslateT("No UID"));
else
- mir_sntprintf(fulluin,
+ mir_snwprintf(fulluin,
TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nClick dropdown to change this contact's favorite status."),
bHasName ? dat->cache->getUIN() : TranslateT("No UID"));
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 9bb015b8bf..d901380ae2 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -568,7 +568,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void)
for (int i = 0; i < arEvents.getCount(); i++) {
MSavedEvent &e = arEvents[i];
- mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(e.hContact, 0));
+ mir_snwprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(e.hContact, 0));
cle.hContact = e.hContact;
cle.hDbEvent = e.hEvent;
pcli->pfnAddEvent(&cle);
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp
index 00b3abf2fe..f2888d3f99 100644
--- a/plugins/TabSRMM/src/infopanel.cpp
+++ b/plugins/TabSRMM/src/infopanel.cpp
@@ -421,9 +421,9 @@ void CInfoPanel::RenderIPNickname(const HDC hdc, RECT &rcItem)
if (szStatusMsg) {
SIZE sStatusMsg, sMask;
- ::GetTextExtentPoint32(hdc, szTextToShow, (int)mir_tstrlen(szTextToShow), &m_szNick);
+ ::GetTextExtentPoint32(hdc, szTextToShow, (int)mir_wstrlen(szTextToShow), &m_szNick);
::GetTextExtentPoint32(hdc, L"A", 1, &sMask);
- ::GetTextExtentPoint32(hdc, szStatusMsg, (int)mir_tstrlen(szStatusMsg), &sStatusMsg);
+ ::GetTextExtentPoint32(hdc, szStatusMsg, (int)mir_wstrlen(szStatusMsg), &sStatusMsg);
DWORD dtFlagsNick = DT_SINGLELINE | DT_WORD_ELLIPSIS | DT_NOPREFIX;
if ((m_szNick.cx + sStatusMsg.cx + 6) < (rcItem.right - rcItem.left) || (rcItem.bottom - rcItem.top) < (2 * sMask.cy)) {
@@ -456,7 +456,7 @@ void CInfoPanel::RenderIPNickname(const HDC hdc, RECT &rcItem)
CSkin::RenderText(hdc, m_dat->hThemeIP, szStatusMsg, &rcItem, dtFlags, CSkin::m_glowSize, clr);
}
else {
- GetTextExtentPoint32(hdc, szTextToShow, (int)mir_tstrlen(szTextToShow), &m_szNick);
+ GetTextExtentPoint32(hdc, szTextToShow, (int)mir_wstrlen(szTextToShow), &m_szNick);
mapRealRect(rcItem, m_rcNick, m_szNick);
if (m_hoverFlags & HOVER_NICK)
setUnderlinedFont(hdc, fShowUin ? m_ipConfig.hFonts[IPFONTID_UIN] : m_ipConfig.hFonts[IPFONTID_NICK]);
@@ -496,22 +496,22 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem)
time_t diff = time(NULL) - m_dat->idle;
int i_hrs = diff / 3600;
int i_mins = (diff - i_hrs * 3600) / 60;
- mir_sntprintf(szBuf, TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins);
+ mir_snwprintf(szBuf, TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins);
}
else wcscpy_s(szBuf, 256, tszUin);
if (M.GetByte("ShowClientDescription", 1)) {
wchar_t temp[256];
- ptrT szVersion(db_get_tsa(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer"));
+ ptrW szVersion(db_get_tsa(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer"));
if (szVersion)
- mir_sntprintf(temp, TranslateT(" Client: %s"), szVersion);
+ mir_snwprintf(temp, TranslateT(" Client: %s"), szVersion);
else
- mir_sntprintf(temp, TranslateT(" Client not cached yet"));
+ mir_snwprintf(temp, TranslateT(" Client not cached yet"));
wcscat_s(szBuf, 256, temp);
}
SIZE sUIN;
- ::GetTextExtentPoint32(hdc, szBuf, (int)mir_tstrlen(szBuf), &sUIN);
+ ::GetTextExtentPoint32(hdc, szBuf, (int)mir_wstrlen(szBuf), &sUIN);
mapRealRect(rcItem, m_rcUIN, sUIN);
CSkin::RenderText(hdc, m_dat->hThemeIP, szBuf, &rcItem, DT_SINGLELINE | DT_VCENTER, CSkin::m_glowSize, clr);
}
@@ -532,19 +532,19 @@ void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem)
DWORD oldPanelStatusCX = m_dat->panelStatusCX;
if (m_dat->szStatus[0])
- GetTextExtentPoint32(hdc, m_dat->szStatus, (int)mir_tstrlen(m_dat->szStatus), &sStatus);
+ GetTextExtentPoint32(hdc, m_dat->szStatus, (int)mir_wstrlen(m_dat->szStatus), &sStatus);
// figure out final account name
const wchar_t *szFinalProto = m_dat->cache->getRealAccount();
if (szFinalProto) {
SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_PROTO]);
- GetTextExtentPoint32(hdc, szFinalProto, (int)mir_tstrlen(szFinalProto), &sProto);
+ GetTextExtentPoint32(hdc, szFinalProto, (int)mir_wstrlen(szFinalProto), &sProto);
}
wchar_t szResult[80]; szResult[0] = 0;
if (m_dat->hTimeZone) {
TimeZone_PrintDateTime(m_dat->hTimeZone, L"t", szResult, _countof(szResult), 0);
- GetTextExtentPoint32(hdc, szResult, (int)mir_tstrlen(szResult), &sTime);
+ GetTextExtentPoint32(hdc, szResult, (int)mir_wstrlen(szResult), &sTime);
}
m_dat->panelStatusCX = 3 + sStatus.cx + sProto.cx + 14 + (m_dat->hClientIcon ? 20 : 0) + sTime.cx + 13;
@@ -613,7 +613,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem)
if (m_height < DEGRADE_THRESHOLD) {
wchar_t tszText[2048];
- mir_sntprintf(tszText, TranslateT("Topic is: %s"),
+ mir_snwprintf(tszText, TranslateT("Topic is: %s"),
si->ptszTopic ? si->ptszTopic : TranslateT("no topic set."));
hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
@@ -624,7 +624,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem)
const wchar_t *tszNick = m_dat->cache->getNick();
hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_NICK]));
- ::GetTextExtentPoint32(hdc, tszNick, (int)mir_tstrlen(tszNick), &m_szNick);
+ ::GetTextExtentPoint32(hdc, tszNick, (int)mir_wstrlen(tszNick), &m_szNick);
mapRealRect(rcItem, m_rcNick, m_szNick);
if (m_hoverFlags & HOVER_NICK)
@@ -670,8 +670,8 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem)
SIZE szTitle;
wchar_t szPrefix[100];
- mir_sntprintf(szPrefix, TranslateT("Topic is: %s"), L"");
- ::GetTextExtentPoint32(hdc, szPrefix, (int)mir_tstrlen(szPrefix), &szTitle);
+ mir_snwprintf(szPrefix, TranslateT("Topic is: %s"), L"");
+ ::GetTextExtentPoint32(hdc, szPrefix, (int)mir_wstrlen(szPrefix), &szTitle);
mapRealRect(rcItem, m_rcUIN, szTitle);
if (m_hoverFlags & HOVER_UIN)
setUnderlinedFont(hdc, m_ipConfig.hFonts[IPFONTID_UIN]);
@@ -680,7 +680,7 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem)
rcItem.left += (szTitle.cx + 4);
if (m_hoverFlags & HOVER_UIN)
::DeleteObject(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
- if (si->ptszTopic && mir_tstrlen(si->ptszTopic) > 1)
+ if (si->ptszTopic && mir_wstrlen(si->ptszTopic) > 1)
CSkin::RenderText(hdc, m_dat->hThemeIP, si->ptszTopic, &rcItem, DT_WORDBREAK | DT_END_ELLIPSIS | DT_NOPREFIX | DT_TOP, CSkin::m_glowSize, clr);
else
CSkin::RenderText(hdc, m_dat->hThemeIP, TranslateT("no topic set."), &rcItem, DT_TOP | DT_SINGLELINE | DT_NOPREFIX, CSkin::m_glowSize, clr);
@@ -1061,11 +1061,11 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L
case WM_INITDIALOG:
{
wchar_t tszTitle[100];
- mir_sntprintf(tszTitle, TranslateT("Set panel visibility for this %s"),
+ mir_snwprintf(tszTitle, TranslateT("Set panel visibility for this %s"),
m_isChat ? TranslateT("chat room") : TranslateT("contact"));
::SetDlgItemText(hwnd, IDC_STATIC_VISIBILTY, tszTitle);
- mir_sntprintf(tszTitle, m_isChat ? TranslateT("Do not synchronize the panel height with IM windows") :
+ mir_snwprintf(tszTitle, m_isChat ? TranslateT("Do not synchronize the panel height with IM windows") :
TranslateT("Do not synchronize the panel height with group chat windows"));
::SetDlgItemText(hwnd, IDC_NOSYNC, tszTitle);
@@ -1322,7 +1322,7 @@ CTip::CTip(const HWND hwndParent, const MCONTACT hContact, const wchar_t *pszTex
::SendMessage(m_hRich, WM_SETFONT, (WPARAM)CInfoPanel::m_ipConfig.hFonts[IPFONTID_STATUS], 0);
m_hContact = hContact;
- m_pszText = mir_utf8encodeT(pszText);
+ m_pszText = mir_utf8encodeW(pszText);
m_panel = panel;
m_hwndParent = hwndParent;
mir_subclassWindow(m_hRich, RichEditProc);
@@ -1503,7 +1503,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
LONG cy = rc.bottom;
HANDLE hTheme = 0;
- mir_sntprintf(szTitle, m_szTitle ? L"%s (%s)" : L"%s%s", c->getNick(), m_szTitle ? m_szTitle : L"");
+ mir_snwprintf(szTitle, m_szTitle ? L"%s (%s)" : L"%s%s", c->getNick(), m_szTitle ? m_szTitle : L"");
if (m_panel) {
HDC hdcMem = ::CreateCompatibleDC(hdc);
@@ -1568,7 +1568,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
switch (((ENLINK*)lParam)->msg) {
case WM_LBUTTONUP:
ENLINK *e = reinterpret_cast<ENLINK *>(lParam);
- ptrT tszUrl(Utils::extractURLFromRichEdit(e, m_hRich));
+ ptrW tszUrl(Utils::extractURLFromRichEdit(e, m_hRich));
if (tszUrl)
Utils_OpenUrlT(tszUrl);
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index d79da9851b..73d017a64c 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -149,7 +149,7 @@ void CMimAPI::InitPaths()
{
const wchar_t *szUserdataDir = getUserDir();
- mir_sntprintf(m_szProfilePath, L"%stabSRMM", szUserdataDir);
+ mir_snwprintf(m_szProfilePath, L"%stabSRMM", szUserdataDir);
if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) {
wcsncpy_s(m_szChatLogsPath, L"%miranda_logpath%", _TRUNCATE);
wcsncpy_s(m_szSkinsPath, L"%miranda_path%\\Skins\\TabSRMM", _TRUNCATE);
@@ -160,11 +160,11 @@ void CMimAPI::InitPaths()
}
Utils::ensureTralingBackslash(m_szChatLogsPath);
- replaceStrT(g_Settings.pszLogDir, m_szChatLogsPath);
+ replaceStrW(g_Settings.pszLogDir, m_szChatLogsPath);
Utils::ensureTralingBackslash(m_szSkinsPath);
- mir_sntprintf(m_szSavedAvatarsPath, L"%s\\Saved Contact Pictures", m_szProfilePath);
+ mir_snwprintf(m_szSavedAvatarsPath, L"%s\\Saved Contact Pictures", m_szProfilePath);
}
bool CMimAPI::getAeroState()
@@ -299,7 +299,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode)
if (mode) {
wchar_t szTip[256];
- mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
if (fShowOnClist && ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && M.GetByte(SRMSGMOD, "ShowTypingBalloon", 0)) {
MIRANDASYSTRAYNOTIFY tn;
tn.szProto = NULL;
@@ -551,7 +551,7 @@ nowindowcreate:
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
contactName = pcli->pfnGetContactDisplayName(hContact, 0);
- mir_sntprintf(toolTip, TranslateT("Message from %s"), contactName);
+ mir_snwprintf(toolTip, TranslateT("Message from %s"), contactName);
cle.ptszTooltip = toolTip;
pcli->pfnAddEvent(&cle);
}
diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp
index 1fc829c606..333da241f8 100644
--- a/plugins/TabSRMM/src/modplus.cpp
+++ b/plugins/TabSRMM/src/modplus.cpp
@@ -117,9 +117,9 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam)
if (res == 0)
break;
- bufSize = textlenght + mir_tstrlen(pszMenu[res - 1]) + 2;
+ bufSize = textlenght + mir_wstrlen(pszMenu[res - 1]) + 2;
pszFormatedText = (wchar_t*)_alloca(bufSize*sizeof(wchar_t));
- mir_sntprintf(pszFormatedText, bufSize, pszMenu[res - 1], pszText);
+ mir_snwprintf(pszFormatedText, bufSize, pszMenu[res - 1], pszText);
}
break;
@@ -128,7 +128,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam)
bufSize = textlenght + 12;
pszFormatedText = (wchar_t*)_alloca(bufSize*sizeof(wchar_t));
- mir_sntprintf(pszFormatedText, bufSize, L"[img]%s[/img]", pszText);
+ mir_snwprintf(pszFormatedText, bufSize, L"[img]%s[/img]", pszText);
bbd.ptszTooltip = 0;
bbd.hIcon = 0;
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 529dac6ce1..d43e5bb62e 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -589,9 +589,9 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
if ((int)mir_strlen((char*)hClip) > mwdat->nMax) {
wchar_t szBuffer[512];
if (M.GetByte("autosplit", 0))
- mir_sntprintf(szBuffer, TranslateT("WARNING: The message you are trying to paste exceeds the message size limit for the active protocol. It will be sent in chunks of max %d characters"), mwdat->nMax - 10);
+ mir_snwprintf(szBuffer, TranslateT("WARNING: The message you are trying to paste exceeds the message size limit for the active protocol. It will be sent in chunks of max %d characters"), mwdat->nMax - 10);
else
- mir_sntprintf(szBuffer, TranslateT("The message you are trying to paste exceeds the message size limit for the active protocol. Only the first %d characters will be sent."), mwdat->nMax);
+ mir_snwprintf(szBuffer, TranslateT("The message you are trying to paste exceeds the message size limit for the active protocol. Only the first %d characters will be sent."), mwdat->nMax);
SendMessage(hwndParent, DM_ACTIVATETOOLTIP, IDC_MESSAGE, (LPARAM)szBuffer);
}
}
@@ -1342,7 +1342,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
// restore saved msg if any...
if (dat->hContact) {
- ptrT tszSavedMsg(db_get_tsa(dat->hContact, SRMSGMOD, "SavedMsg"));
+ ptrW tszSavedMsg(db_get_tsa(dat->hContact, SRMSGMOD, "SavedMsg"));
if (tszSavedMsg != 0) {
SETTEXTEX stx = { ST_DEFAULT, 1200 };
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, tszSavedMsg);
@@ -2017,7 +2017,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
case WM_RBUTTONDOWN:
case WM_LBUTTONUP:
- ptrT tszUrl(Utils::extractURLFromRichEdit((ENLINK*)lParam, GetDlgItem(hwndDlg, IDC_LOG)));
+ ptrW tszUrl(Utils::extractURLFromRichEdit((ENLINK*)lParam, GetDlgItem(hwndDlg, IDC_LOG)));
if (!IsStringValidLink(tszUrl))
break;
@@ -2326,7 +2326,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
if (iIndex < SendQueue::NR_SENDJOBS) { // single sendjob timer
SendJob *job = sendQueue->getJobByIndex(iIndex);
KillTimer(hwndDlg, wParam);
- mir_sntprintf(job->szErrorMsg, TranslateT("Delivery failure: %s"), TranslateT("The message send timed out"));
+ mir_snwprintf(job->szErrorMsg, TranslateT("Delivery failure: %s"), TranslateT("The message send timed out"));
job->iStatus = SendQueue::SQ_ERROR;
if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND))
SkinPlaySound("SendError");
@@ -2545,7 +2545,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
mir_snprintf(szIndex, "%d", iSelection - IDM_CONTAINERMENU);
if (iSelection - IDM_CONTAINERMENU >= 0) {
- ptrT val(db_get_tsa(NULL, szKey, szIndex));
+ ptrW val(db_get_tsa(NULL, szKey, szIndex));
if (val)
SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)val);
}
@@ -2623,7 +2623,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
if (streamOut == NULL)
break;
- CMString decoded(ptrT(mir_utf8decodeT(streamOut)));
+ CMString decoded(ptrW(mir_utf8decodeW(streamOut)));
if (decoded.IsEmpty())
break;
@@ -2723,7 +2723,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
}
if (selected != NULL) {
- ptrT szQuoted(QuoteText(selected));
+ ptrW szQuoted(QuoteText(selected));
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)szQuoted);
break;
}
@@ -2773,7 +2773,7 @@ quote_from_last:
bNeedsFree = true;
}
if (szConverted != NULL) {
- ptrT szQuoted(QuoteText(szConverted));
+ ptrW szQuoted(QuoteText(szConverted));
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)szQuoted);
}
mir_free(szText);
@@ -2784,7 +2784,7 @@ quote_from_last:
ptrA szFromStream(Message_GetFromStream(GetDlgItem(hwndDlg, IDC_LOG), SF_TEXT | SFF_SELECTION));
ptrW converted(mir_utf8decodeW(szFromStream));
Utils::FilterEventMarkers(converted);
- ptrT szQuoted(QuoteText(converted));
+ ptrW szQuoted(QuoteText(converted));
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)szQuoted);
}
SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
@@ -2875,7 +2875,7 @@ quote_from_last:
case DM_CONTAINERSELECTED:
{
wchar_t *szNewName = (wchar_t*)lParam;
- if (!mir_tstrcmp(szNewName, TranslateT("Default container")))
+ if (!mir_wstrcmp(szNewName, TranslateT("Default container")))
szNewName = CGlobals::m_default_container_name;
int iOldItems = TabCtrl_GetItemCount(hwndTab);
@@ -3055,7 +3055,7 @@ quote_from_last:
else {
if (ServiceExists(MS_HTTPSERVER_ADDFILENAME)) {
for (i = 0; i < totalCount; i++) {
- char* szFileName = mir_t2a(ppFiles[i]);
+ char* szFileName = mir_u2a(ppFiles[i]);
CallService(MS_HTTPSERVER_ADDFILENAME, (WPARAM)szFileName, 0);
mir_free(szFileName);
}
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index f68dd7c692..06c130e036 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -135,12 +135,12 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic)
DWORD setView = 1;
wchar_t szTimestamp[100];
- mir_sntprintf(szTimestamp, L"%04u %02u %02u_%02u%02u", lt->tm_year + 1900, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min);
+ mir_snwprintf(szTimestamp, L"%04u %02u %02u_%02u%02u", lt->tm_year + 1900, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min);
- wchar_t *szProto = mir_a2t(dat->cache->getActiveProto());
+ wchar_t *szProto = mir_a2u(dat->cache->getActiveProto());
wchar_t szFinalPath[MAX_PATH];
- mir_sntprintf(szFinalPath, L"%s\\%s", M.getSavedAvatarPath(), szProto);
+ mir_snwprintf(szFinalPath, L"%s\\%s", M.getSavedAvatarPath(), szProto);
mir_free(szProto);
if (CreateDirectory(szFinalPath, 0) == 0) {
@@ -153,17 +153,17 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic)
wchar_t szBaseName[MAX_PATH];
if (isOwnPic)
- mir_sntprintf(szBaseName, L"My Avatar_%s", szTimestamp);
+ mir_snwprintf(szBaseName, L"My Avatar_%s", szTimestamp);
else
- mir_sntprintf(szBaseName, L"%s_%s", dat->cache->getNick(), szTimestamp);
+ mir_snwprintf(szBaseName, L"%s_%s", dat->cache->getNick(), szTimestamp);
- mir_sntprintf(szFinalFilename, L"%s.png", szBaseName);
+ mir_snwprintf(szFinalFilename, L"%s.png", szBaseName);
// do not allow / or \ or % in the filename
Utils::sanitizeFilename(szFinalFilename);
wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s%c*.bmp;*.png;*.jpg;*.gif%c%c", TranslateT("Image files"), 0, 0, 0);
+ mir_snwprintf(filter, L"%s%c*.bmp;*.png;*.jpg;*.gif%c%c", TranslateT("Image files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lpstrDefExt = L"png";
@@ -286,7 +286,7 @@ int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID)
szText = TranslateT("Set your avatar...");
}
mii.dwTypeData = szText;
- mii.cch = (int)mir_tstrlen(szText) + 1;
+ mii.cch = (int)mir_wstrlen(szText) + 1;
SetMenuItemInfo(submenu, ID_PICMENU_SETTINGS, FALSE, &mii);
}
else if (menuID == MENU_PANELPICMENU) {
@@ -443,15 +443,15 @@ void TSAPI UpdateReadChars(const TWindowData *dat)
wchar_t szBuf[20]; szBuf[0] = 0;
if (dat->fInsertMode)
- mir_tstrcat(szBuf, L"O");
+ mir_wstrcat(szBuf, L"O");
if (fCaps)
- mir_tstrcat(szBuf, L"C");
+ mir_wstrcat(szBuf, L"C");
if (fNum)
- mir_tstrcat(szBuf, L"N");
+ mir_wstrcat(szBuf, L"N");
if (dat->fInsertMode || fCaps || fNum)
- mir_tstrcat(szBuf, L" | ");
+ mir_wstrcat(szBuf, L" | ");
- mir_sntprintf(buf, L"%s%s %d/%d", szBuf, dat->lcID, dat->iOpenJobs, len);
+ mir_snwprintf(buf, L"%s%s %d/%d", szBuf, dat->lcID, dat->iOpenJobs, len);
SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 1, (LPARAM)buf);
if (PluginConfig.m_visualMessageSizeIndicator)
InvalidateRect(dat->pContainer->hwndStatus, NULL, FALSE);
@@ -931,7 +931,7 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors
else if (!wcsncmp(p, L"\\highlight", 10)) { //background color
wchar_t szTemp[20];
int iCol = _wtoi(p + 10);
- mir_sntprintf(szTemp, L"%d", iCol);
+ mir_snwprintf(szTemp, L"%d", iCol);
}
else if (!wcsncmp(p, L"\\line", 5)) { // soft line break;
res.AppendChar('\n');
@@ -1037,7 +1037,7 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors
void TSAPI GetMYUIN(TWindowData *dat)
{
- ptrT uid(Contact_GetInfo(CNF_DISPLAYUID, NULL, dat->cache->getActiveProto()));
+ ptrW uid(Contact_GetInfo(CNF_DISPLAYUID, NULL, dat->cache->getActiveProto()));
if (uid != NULL)
wcsncpy_s(dat->myUin, uid, _TRUNCATE);
else
@@ -1271,7 +1271,7 @@ void TSAPI GetLocaleID(TWindowData *dat, const wchar_t *szKLName)
wchar_t szKey[20];
DWORD dwLID = wcstoul(szKLName, &stopped, 16);
- mir_sntprintf(szKey, L"%04.04x", LOWORD(dwLID));
+ mir_snwprintf(szKey, L"%04.04x", LOWORD(dwLID));
if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, L"MIME\\Database\\Rfc1766", 0, KEY_READ, &hKey)) {
DWORD dwLength = 255;
if (ERROR_SUCCESS == RegQueryValueEx(hKey, szKey, 0, 0, (unsigned char *)szLI, &dwLength)) {
@@ -1291,7 +1291,7 @@ void TSAPI GetLocaleID(TWindowData *dat, const wchar_t *szKLName)
wcsupr(szLI);
}
fLocaleNotSet = (dat->lcID[0] == 0 && dat->lcID[1] == 0);
- mir_sntprintf(dat->lcID, szLI);
+ mir_snwprintf(dat->lcID, szLI);
GetStringTypeA(dat->lcid, CT_CTYPE2, (char*)szTest, 3, wCtype2);
pf2.cbSize = sizeof(pf2);
pf2.dwMask = PFM_RTLPARA;
@@ -1625,7 +1625,7 @@ void TSAPI LoadThemeDefaults(TContainerData *pContainer)
void TSAPI LoadOverrideTheme(TContainerData *pContainer)
{
memset(&pContainer->theme, 0, sizeof(TLogTheme));
- if (mir_tstrlen(pContainer->szAbsThemeFile) > 1) {
+ if (mir_wstrlen(pContainer->szAbsThemeFile) > 1) {
if (PathFileExists(pContainer->szAbsThemeFile)) {
if (CheckThemeVersion(pContainer->szAbsThemeFile) == 0) {
LoadThemeDefaults(pContainer);
@@ -1726,7 +1726,7 @@ void TSAPI GetClientIcon(TWindowData *dat)
dat->hClientIcon = 0;
if (ServiceExists(MS_FP_GETCLIENTICONT)) {
- ptrT tszMirver(db_get_tsa(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "MirVer"));
+ ptrW tszMirver(db_get_tsa(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "MirVer"));
if (tszMirver)
dat->hClientIcon = Finger_GetClientIcon(tszMirver, 1);
}
@@ -1734,9 +1734,9 @@ void TSAPI GetClientIcon(TWindowData *dat)
void TSAPI GetMyNick(TWindowData *dat)
{
- ptrT tszNick(Contact_GetInfo(CNF_NICK, NULL, dat->cache->getActiveProto()));
+ ptrW tszNick(Contact_GetInfo(CNF_NICK, NULL, dat->cache->getActiveProto()));
if (tszNick != NULL) {
- if (mir_tstrlen(tszNick) == 0 || !mir_tstrcmp(tszNick, TranslateT("'(Unknown contact)'")))
+ if (mir_wstrlen(tszNick) == 0 || !mir_wstrcmp(tszNick, TranslateT("'(Unknown contact)'")))
wcsncpy_s(dat->szMyNickname, (dat->myUin[0] ? dat->myUin : TranslateT("'(Unknown contact)'")), _TRUNCATE);
else
wcsncpy_s(dat->szMyNickname, tszNick, _TRUNCATE);
@@ -1886,14 +1886,14 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp)
return;
}
- if (tempdirlen <= 0 || tempdirlen >= MAX_PATH - mir_tstrlen(mirandatempdir) - mir_tstrlen(filenametemplate) - 2) // -2 is because %Y takes 4 symbols
+ if (tempdirlen <= 0 || tempdirlen >= MAX_PATH - mir_wstrlen(mirandatempdir) - mir_wstrlen(filenametemplate) - 2) // -2 is because %Y takes 4 symbols
filename[0] = 0; // prompt for a new name
else {
- mir_tstrcpy(filename + tempdirlen, mirandatempdir);
+ mir_wstrcpy(filename + tempdirlen, mirandatempdir);
if ((GetFileAttributes(filename) == INVALID_FILE_ATTRIBUTES || ((GetFileAttributes(filename) & FILE_ATTRIBUTE_DIRECTORY) == 0)) && CreateDirectory(filename, NULL) == 0)
filename[0] = 0;
else {
- tempdirlen = mir_tstrlen(filename);
+ tempdirlen = mir_wstrlen(filename);
time_t rawtime;
time(&rawtime);
@@ -1917,7 +1917,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp)
if (filename[0] == 0) { // prompting to save
wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s%c*.jpg%c%c", TranslateT("JPEG-compressed images"), 0, 0, 0);
+ mir_snwprintf(filter, L"%s%c*.jpg%c%c", TranslateT("JPEG-compressed images"), 0, 0, 0);
OPENFILENAME dlg;
dlg.lStructSize = sizeof(dlg);
@@ -1943,7 +1943,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp)
wchar_t **ppFiles = NULL;
Utils::AddToFileList(&ppFiles, &totalCount, filename);
- wchar_t* _t = mir_tstrdup(filename);
+ wchar_t* _t = mir_wstrdup(filename);
vTempFilenames.insert(_t);
CallService(MS_FILE_SENDSPECIFICFILEST, (WPARAM)dat->cache->getActiveContact(), (LPARAM)ppFiles);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index 8abd3a071b..088a42847b 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -109,7 +109,7 @@ __forceinline char *GetRTFFont(DWORD dwIndex)
*/
static void TrimMessage(wchar_t *msg)
{
- size_t iLen = mir_tstrlen(msg) - 1;
+ size_t iLen = mir_wstrlen(msg) - 1;
size_t i = iLen;
while (i && (msg[i] == '\r' || msg[i] == '\n')) {
@@ -353,9 +353,9 @@ static wchar_t* Template_MakeRelativeDate(HANDLE hTimeZone, time_t check, wchar_
const wchar_t *szFormat;
if ((code == (wchar_t)'R' || code == (wchar_t)'r') && check >= today)
- mir_tstrcpy(szResult, szToday);
+ mir_wstrcpy(szResult, szToday);
else if ((code == (wchar_t)'R' || code == (wchar_t)'r') && check > (today - 86400))
- mir_tstrcpy(szResult, szYesterday);
+ mir_wstrcpy(szResult, szYesterday);
else {
if (code == 'D' || code == 'R')
szFormat = L"D";
@@ -514,7 +514,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact,
szTemplate = isSent ? this_templateset->szTemplates[TMPL_MSGOUT] : this_templateset->szTemplates[TMPL_MSGIN];
}
- size_t iTemplateLen = mir_tstrlen(szTemplate);
+ size_t iTemplateLen = mir_wstrlen(szTemplate);
BOOL showTime = dwEffectiveFlags & MWF_LOG_SHOWTIME;
BOOL showDate = dwEffectiveFlags & MWF_LOG_SHOWDATES;
@@ -824,14 +824,14 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact,
}
{
char *szFileName = (char *)dbei.pBlob + sizeof(DWORD);
- ptrT tszFileName(DbGetEventStringT(&dbei, szFileName));
+ ptrW tszFileName(DbGetEventStringT(&dbei, szFileName));
char *szDescr = szFileName + mir_strlen(szFileName) + 1;
if (*szDescr != 0) {
- ptrT tszDescr(DbGetEventStringT(&dbei, szDescr));
+ ptrW tszDescr(DbGetEventStringT(&dbei, szDescr));
wchar_t buf[1000];
- mir_sntprintf(buf, L"%s (%s)", tszFileName, tszDescr);
+ mir_snwprintf(buf, L"%s (%s)", tszFileName, tszDescr);
AppendUnicodeToBuffer(str, buf, 0);
}
else AppendUnicodeToBuffer(str, tszFileName, 0);
@@ -844,7 +844,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact,
str.AppendChar(' ');
}
- ptrT tszText(DbGetEventTextT(&dbei, CP_ACP));
+ ptrW tszText(DbGetEventTextT(&dbei, CP_ACP));
AppendUnicodeToBuffer(str, tszText, 0);
}
break;
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp
index 4928636933..0be5543c4d 100644
--- a/plugins/TabSRMM/src/msgoptions.cpp
+++ b/plugins/TabSRMM/src/msgoptions.cpp
@@ -97,12 +97,12 @@ static int TSAPI ScanSkinDir(const wchar_t* tszFolder, HWND hwndCombobox)
{
bool fValid = false;
wchar_t tszMask[MAX_PATH];
- mir_sntprintf(tszMask, L"%s*.*", tszFolder);
+ mir_snwprintf(tszMask, L"%s*.*", tszFolder);
WIN32_FIND_DATA fd = { 0 };
HANDLE h = FindFirstFile(tszMask, &fd);
while (h != INVALID_HANDLE_VALUE) {
- if (mir_tstrlen(fd.cFileName) >= 5 && !wcsnicmp(fd.cFileName + mir_tstrlen(fd.cFileName) - 4, L".tsk", 4)) {
+ if (mir_wstrlen(fd.cFileName) >= 5 && !wcsnicmp(fd.cFileName + mir_wstrlen(fd.cFileName) - 4, L".tsk", 4)) {
fValid = true;
break;
}
@@ -117,19 +117,19 @@ static int TSAPI ScanSkinDir(const wchar_t* tszFolder, HWND hwndCombobox)
LRESULT lr;
wchar_t szBuf[255];
- mir_sntprintf(tszFinalName, L"%s%s", tszFolder, fd.cFileName);
+ mir_snwprintf(tszFinalName, L"%s%s", tszFolder, fd.cFileName);
GetPrivateProfileString(L"Global", L"Name", L"None", szBuf, _countof(szBuf), tszFinalName);
- if (!mir_tstrcmp(szBuf, L"None")) {
- fd.cFileName[mir_tstrlen(fd.cFileName) - 4] = 0;
+ if (!mir_wstrcmp(szBuf, L"None")) {
+ fd.cFileName[mir_wstrlen(fd.cFileName) - 4] = 0;
wcsncpy_s(szBuf, fd.cFileName, _TRUNCATE);
}
PathToRelativeT(tszFinalName, tszRel, M.getSkinPath());
if ((lr = SendMessage(hwndCombobox, CB_INSERTSTRING, -1, (LPARAM)szBuf)) != CB_ERR) {
- wchar_t *idata = (wchar_t*)mir_alloc((mir_tstrlen(tszRel) + 1) * sizeof(wchar_t));
+ wchar_t *idata = (wchar_t*)mir_alloc((mir_wstrlen(tszRel) + 1) * sizeof(wchar_t));
- mir_tstrcpy(idata, tszRel);
+ mir_wstrcpy(idata, tszRel);
SendMessage(hwndCombobox, CB_SETITEMDATA, lr, (LPARAM)idata);
}
}
@@ -153,7 +153,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox)
wcsncpy_s(tszSkinRoot, M.getSkinPath(), _TRUNCATE);
SetDlgItemText(GetParent(hwndCombobox), IDC_SKINROOTFOLDER, tszSkinRoot);
- mir_sntprintf(tszFindMask, L"%s*.*", tszSkinRoot);
+ mir_snwprintf(tszFindMask, L"%s*.*", tszSkinRoot);
SendMessage(hwndCombobox, CB_RESETCONTENT, 0, 0);
SendMessage(hwndCombobox, CB_INSERTSTRING, -1, (LPARAM)TranslateT("<no skin>"));
@@ -163,7 +163,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox)
while (h != INVALID_HANDLE_VALUE) {
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY && fd.cFileName[0] != '.') {
wchar_t tszSubDir[MAX_PATH];
- mir_sntprintf(tszSubDir, L"%s%s\\", tszSkinRoot, fd.cFileName);
+ mir_snwprintf(tszSubDir, L"%s%s\\", tszSkinRoot, fd.cFileName);
ScanSkinDir(tszSubDir, hwndCombobox);
}
if (FindNextFile(h, &fd) == 0)
@@ -178,7 +178,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox)
for (int i = 1; i < lr; i++) {
wchar_t *idata = (wchar_t*)SendMessage(hwndCombobox, CB_GETITEMDATA, i, 0);
if (idata && idata != (wchar_t*)CB_ERR) {
- if (!mir_tstrcmpi(dbv.ptszVal, idata)) {
+ if (!mir_wstrcmpi(dbv.ptszVal, idata)) {
SendMessage(hwndCombobox, CB_SETCURSEL, i, 0);
break;
}
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index 1301f3af80..57be74dd2b 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -491,7 +491,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact,
// cut nickname if larger than x chars...
wchar_t newcontactname[128], tabtitle[128];
- if (contactName && mir_tstrlen(contactName) > 0) {
+ if (contactName && mir_wstrlen(contactName) > 0) {
if (M.GetByte("cuttitle", 0))
CutContactName(contactName, newcontactname, _countof(newcontactname));
else
@@ -504,9 +504,9 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact,
wchar_t *szStatus = pcli->pfnGetStatusModeDescription(szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
if (M.GetByte("tabstatus", 1))
- mir_sntprintf(tabtitle, L"%s (%s) ", newcontactname, szStatus);
+ mir_snwprintf(tabtitle, L"%s (%s) ", newcontactname, szStatus);
else
- mir_sntprintf(tabtitle, L"%s ", newcontactname);
+ mir_snwprintf(tabtitle, L"%s ", newcontactname);
newData.item.pszText = tabtitle;
newData.item.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;
@@ -1069,7 +1069,7 @@ STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEU
STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE *lplpstg)
{
wchar_t sztName[64];
- mir_sntprintf(sztName, L"s%u", nextStgId++);
+ mir_snwprintf(sztName, L"s%u", nextStgId++);
if (pictStg == NULL)
return STG_E_MEDIUMFULL;
return pictStg->CreateStorage(sztName, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, lplpstg);
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp
index d52a25f738..6529bfaabf 100644
--- a/plugins/TabSRMM/src/selectcontainer.cpp
+++ b/plugins/TabSRMM/src/selectcontainer.cpp
@@ -47,7 +47,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (lParam) {
TWindowData *dat = (TWindowData*)GetWindowLongPtr((HWND)lParam, GWLP_USERDATA);
if (dat) {
- mir_sntprintf(szNewTitle, TranslateT("Select container for %s"), dat->cache->getNick());
+ mir_snwprintf(szNewTitle, TranslateT("Select container for %s"), dat->cache->getNick());
SetWindowText(hwndDlg, szNewTitle);
}
}
@@ -112,7 +112,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (iItem != LB_ERR) {
wchar_t szOldName[CONTAINER_NAMELEN + 1];
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szOldName);
- if (mir_tstrlen(szOldName) == mir_tstrlen(szNewName)) {
+ if (mir_wstrlen(szOldName) == mir_wstrlen(szNewName)) {
MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
SetFocus(GetDlgItem(hwndDlg, IDC_NEWCONTAINERNAME));
break;
@@ -127,7 +127,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
RenameContainer(iIndex, szNewName);
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_RESETCONTENT, 0, 0);
for (TContainerData *p = pFirstContainer; p; p = p->pNext) {
- if (!wcsncmp(p->szName, szName, CONTAINER_NAMELEN) && mir_tstrlen(p->szName) == mir_tstrlen(szName)) {
+ if (!wcsncmp(p->szName, szName, CONTAINER_NAMELEN) && mir_wstrlen(p->szName) == mir_wstrlen(szName)) {
wcsncpy(p->szName, szNewName, CONTAINER_NAMELEN);
SendMessage(p->hwnd, DM_CONFIGURECONTAINER, 0, 0);
}
@@ -148,7 +148,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
int iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_FINDSTRING, (WPARAM)-1, (LPARAM)szNewName);
if (iItem != LB_ERR || !wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szName);
- if (mir_tstrlen(szName) == mir_tstrlen(szNewName) || !wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
+ if (mir_wstrlen(szName) == mir_wstrlen(szNewName) || !wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
SetFocus(GetDlgItem(hwndDlg, IDC_NEWCONTAINER));
break;
@@ -183,7 +183,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
break; // end of list
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) {
if (wcsncmp(dbv.ptszVal, L"**mir_free**", CONTAINER_NAMELEN)) {
- iItemNew = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_ADDSTRING, 0, (LPARAM)(!mir_tstrcmp(dbv.ptszVal, L"default") ?
+ iItemNew = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_ADDSTRING, 0, (LPARAM)(!mir_wstrcmp(dbv.ptszVal, L"default") ?
TranslateT("Default container") : dbv.ptszVal));
if (iItemNew != LB_ERR)
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_SETITEMDATA, (WPARAM)iItemNew, (LPARAM)iCounter);
@@ -200,7 +200,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (pContainer) {
LRESULT iItem;
- iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_FINDSTRING, (WPARAM)-1, (LPARAM)(!mir_tstrcmp(pContainer->szName, L"default") ?
+ iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_FINDSTRING, (WPARAM)-1, (LPARAM)(!mir_wstrcmp(pContainer->szName, L"default") ?
TranslateT("Default container") : pContainer->szName));
if (iItem != LB_ERR)
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_SETCURSEL, (WPARAM)iItem, 0);
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp
index e52fb5adb0..e717c1817b 100644
--- a/plugins/TabSRMM/src/sendlater.cpp
+++ b/plugins/TabSRMM/src/sendlater.cpp
@@ -123,12 +123,12 @@ CSendLaterJob::~CSendLaterJob()
wcsncpy_s(ppd.lptzContactName, (tszName ? tszName : TranslateT("'(Unknown contact)'")), _TRUNCATE);
wchar_t *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast<wchar_t *>(&pBuf[mir_strlen((char *)pBuf) + 1]), 100);
if (fSuccess) {
- mir_sntprintf(ppd.lptzText, TranslateT("A send later job completed successfully.\nThe original message: %s"),
+ mir_snwprintf(ppd.lptzText, TranslateT("A send later job completed successfully.\nThe original message: %s"),
msgPreview);
mir_free(msgPreview);
}
else if (fFailed) {
- mir_sntprintf(ppd.lptzText, TranslateT("A send later job failed to complete.\nThe original message: %s"),
+ mir_snwprintf(ppd.lptzText, TranslateT("A send later job failed to complete.\nThe original message: %s"),
msgPreview);
mir_free(msgPreview);
}
@@ -523,7 +523,7 @@ void CSendLater::qMgrFillList(bool fClear)
lvItem.mask = LVIF_TEXT | LVIF_PARAM;
wchar_t tszBuf[255];
- mir_sntprintf(tszBuf, L"%s [%s]", tszNick, c->getRealAccount());
+ mir_snwprintf(tszBuf, L"%s [%s]", tszNick, c->getRealAccount());
lvItem.pszText = tszBuf;
lvItem.cchTextMax = _countof(tszBuf);
lvItem.iItem = uIndex++;
@@ -540,7 +540,7 @@ void CSendLater::qMgrFillList(bool fClear)
lvItem.iSubItem = 1;
::SendMessage(m_hwndList, LVM_SETITEM, 0, LPARAM(&lvItem));
- wchar_t *msg = mir_utf8decodeT(p->sendBuffer);
+ wchar_t *msg = mir_utf8decodeW(p->sendBuffer);
wchar_t *preview = Utils::GetPreviewWithEllipsis(msg, 255);
lvItem.pszText = preview;
lvItem.iSubItem = 2;
@@ -575,7 +575,7 @@ void CSendLater::qMgrFillList(bool fClear)
bCode = p->bCode;
wchar_t tszStatus[20];
- mir_sntprintf(tszStatus, L"X/%s[%c] (%d)", tszStatusText, bCode, p->iSendCount);
+ mir_snwprintf(tszStatus, L"X/%s[%c] (%d)", tszStatusText, bCode, p->iSendCount);
tszStatus[0] = p->szId[0];
lvItem.pszText = tszStatus;
lvItem.iSubItem = 3;
@@ -807,7 +807,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
job->writeFlags();
break;
case ID_QUEUEMANAGER_COPYMESSAGETOCLIPBOARD:
- Utils::CopyToClipBoard((wchar_t*)ptrT(mir_utf8decodeT(job->sendBuffer)), m_hwndDlg);
+ Utils::CopyToClipBoard((wchar_t*)ptrW(mir_utf8decodeW(job->sendBuffer)), m_hwndDlg);
break;
case ID_QUEUEMANAGER_RESETSELECTED:
if (job->bCode == CSendLaterJob::JOB_DEFERRED) {
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp
index b7a6f80f5a..aed683997e 100644
--- a/plugins/TabSRMM/src/sendqueue.cpp
+++ b/plugins/TabSRMM/src/sendqueue.cpp
@@ -219,7 +219,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry)
if (iSendLength >= iMinLength) {
wchar_t tszError[256];
- mir_sntprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), iMinLength);
+ mir_snwprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), iMinLength);
::SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE, LPARAM(tszError));
sendQueue->clearJob(iEntry);
return 0;
@@ -274,7 +274,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry)
size_t iSendLength = getSendLength(iEntry);
if (iSendLength >= dat->nMax) {
- mir_sntprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), dat->nMax);
+ mir_snwprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), dat->nMax);
SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE, LPARAM(tszError));
clearJob(iEntry);
return 0;
@@ -543,8 +543,8 @@ int SendQueue::ackMessage(TWindowData *dat, WPARAM wParam, LPARAM lParam)
if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND))
SkinPlaySound("SendError");
- wchar_t *szAckMsg = mir_a2t((char *)ack->lParam);
- mir_sntprintf(job.szErrorMsg, TranslateT("Delivery failure: %s"), szAckMsg);
+ wchar_t *szAckMsg = mir_a2u((char *)ack->lParam);
+ mir_snwprintf(job.szErrorMsg, TranslateT("Delivery failure: %s"), szAckMsg);
job.iStatus = SQ_ERROR;
mir_free(szAckMsg);
KillTimer(dat->hwnd, TIMERID_MSGSEND + iFound);
@@ -684,9 +684,9 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b
wchar_t tszTimestamp[30];
wcsftime(tszTimestamp, _countof(tszTimestamp), L"%Y.%m.%d - %H:%M", _localtime32((__time32_t *)&now));
mir_snprintf(szKeyName, "S%d", now);
- mir_sntprintf(tszHeader, TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp);
+ mir_snwprintf(tszHeader, TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp);
}
- else mir_sntprintf(tszHeader, L"M%d|", time(0));
+ else mir_snwprintf(tszHeader, L"M%d|", time(0));
T2Utf utf_header(tszHeader);
size_t required = mir_strlen(utf_header) + mir_strlen(job->szSendBuffer) + 10;
diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp
index 908b4b59d0..ccaf889ee2 100644
--- a/plugins/TabSRMM/src/sidebar.cpp
+++ b/plugins/TabSRMM/src/sidebar.cpp
@@ -145,7 +145,7 @@ const SIZE& CSideBarButton::measureItem()
HFONT oldFont = reinterpret_cast<HFONT>(::SelectObject(dc, ::GetStockObject(DEFAULT_GUI_FONT)));
wcsncpy_s(tszLabel, m_dat->newtitle, _TRUNCATE);
- ::GetTextExtentPoint32(dc, tszLabel, (int)mir_tstrlen(tszLabel), &sz);
+ ::GetTextExtentPoint32(dc, tszLabel, (int)mir_wstrlen(tszLabel), &sz);
sz.cx += 28;
if (m_dat->pContainer->dwFlagsEx & TCF_CLOSEBUTTON)
@@ -1158,9 +1158,9 @@ const SIZE& __fastcall CSideBar::m_measureAdvancedVertical(CSideBarButton* item)
HDC dc = ::GetDC(dat->hwnd);
HFONT hOldFont = reinterpret_cast<HFONT>(::SelectObject(dc, CInfoPanel::m_ipConfig.hFonts[IPFONTID_NICK]));
- ::GetTextExtentPoint32(dc, dat->cache->getNick(), (int)mir_tstrlen(dat->cache->getNick()), &szFirstLine);
+ ::GetTextExtentPoint32(dc, dat->cache->getNick(), (int)mir_wstrlen(dat->cache->getNick()), &szFirstLine);
::SelectObject(dc, CInfoPanel::m_ipConfig.hFonts[IPFONTID_STATUS]);
- ::GetTextExtentPoint32(dc, dat->szStatus, (int)mir_tstrlen(dat->szStatus), &szSecondLine);
+ ::GetTextExtentPoint32(dc, dat->szStatus, (int)mir_wstrlen(dat->szStatus), &szSecondLine);
::SelectObject(dc, hOldFont);
ReleaseDC(dat->hwnd, dc);
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp
index 78ec8e47da..2b6de13dfd 100644
--- a/plugins/TabSRMM/src/srmm.cpp
+++ b/plugins/TabSRMM/src/srmm.cpp
@@ -111,7 +111,7 @@ int _DebugTraceW(const wchar_t *fmt, ...)
mir_snprintf(tszTime, "%02d.%02d.%04d - %02d:%02d:%02d.%04d: ", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
- mir_vsntprintf(debug, ibsize - 10, fmt, va);
+ mir_vsnwprintf(debug, ibsize - 10, fmt, va);
//#ifdef _DEBUG
OutputDebugStringW(debug);
//#else
@@ -148,12 +148,12 @@ int _DebugPopup(MCONTACT hContact, const wchar_t *fmt, ...)
int ibsize = 1023;
va_start(va, fmt);
- mir_vsntprintf(debug, ibsize, fmt, va);
+ mir_vsnwprintf(debug, ibsize, fmt, va);
if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) {
MIRANDASYSTRAYNOTIFY tn;
wchar_t szTitle[128];
- mir_sntprintf(szTitle, TranslateT("TabSRMM message (%s)"),
+ mir_snwprintf(szTitle, TranslateT("TabSRMM message (%s)"),
(hContact != 0) ? pcli->pfnGetContactDisplayName(hContact, 0) : TranslateT("Global"));
tn.szProto = NULL;
diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp
index 224053c4c8..1e319a6c96 100644
--- a/plugins/TabSRMM/src/taskbar.cpp
+++ b/plugins/TabSRMM/src/taskbar.cpp
@@ -686,7 +686,7 @@ void CThumbBase::renderBase()
wchar_t tszTemp[30];
m_rcIcon.top += m_sz.cy;
- mir_sntprintf(tszTemp, TranslateT("%d unread"), m_dat->dwUnread);
+ mir_snwprintf(tszTemp, TranslateT("%d unread"), m_dat->dwUnread);
CSkin::RenderText(m_hdc, m_dat->hTheme, tszTemp, &m_rcIcon, m_dtFlags | DT_CENTER | DT_WORD_ELLIPSIS, 10, 0, true);
}
m_rcIcon = m_rcTop;
@@ -862,7 +862,7 @@ void CThumbMUC::renderContent()
if (mi) {
if (m_dat->dwUnread) {
- mir_sntprintf(szTemp, TranslateT("%d unread"), m_dat->dwUnread);
+ mir_snwprintf(szTemp, TranslateT("%d unread"), m_dat->dwUnread);
CSkin::RenderText(m_hdc, m_dat->hTheme, szTemp, &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
m_rcIcon.top += m_sz.cy;
}
@@ -874,20 +874,20 @@ void CThumbMUC::renderContent()
_p++;
wchar_t _t = *_p;
*_p = 0;
- mir_sntprintf(szTemp, TranslateT("Chat room %s"), m_dat->si->ptszStatusbarText);
+ mir_snwprintf(szTemp, TranslateT("Chat room %s"), m_dat->si->ptszStatusbarText);
*_p = _t;
}
else
- mir_sntprintf(szTemp, TranslateT("Chat room %s"), L"");
+ mir_snwprintf(szTemp, TranslateT("Chat room %s"), L"");
CSkin::RenderText(m_hdc, m_dat->hTheme, szTemp, &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
m_rcIcon.top += m_sz.cy;
- mir_sntprintf(szTemp, TranslateT("%d user(s)"), m_dat->si->nUsersInNicklist);
+ mir_snwprintf(szTemp, TranslateT("%d user(s)"), m_dat->si->nUsersInNicklist);
CSkin::RenderText(m_hdc, m_dat->hTheme, szTemp, &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
}
else {
- mir_sntprintf(szTemp, TranslateT("Server window"));
+ mir_snwprintf(szTemp, TranslateT("Server window"));
CSkin::RenderText(m_hdc, m_dat->hTheme, szTemp, &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
- if (mi->tszIdleMsg[0] && mir_tstrlen(mi->tszIdleMsg) > 2) {
+ if (mi->tszIdleMsg[0] && mir_wstrlen(mi->tszIdleMsg) > 2) {
m_rcIcon.top += m_sz.cy;
CSkin::RenderText(m_hdc, m_dat->hTheme, &mi->tszIdleMsg[2], &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
}
@@ -904,7 +904,7 @@ void CThumbMUC::renderContent()
szStatusMsg = TranslateT("no topic set.");
}
else if (mi) {
- mir_sntprintf(szTemp, TranslateT("%s on %s%s"), m_dat->szMyNickname, mi->ptszModDispName, L"");
+ mir_snwprintf(szTemp, TranslateT("%s on %s%s"), m_dat->szMyNickname, mi->ptszModDispName, L"");
szStatusMsg = szTemp;
}
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp
index 9ad2b93557..48c8168a55 100644
--- a/plugins/TabSRMM/src/templates.cpp
+++ b/plugins/TabSRMM/src/templates.cpp
@@ -357,7 +357,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
dat->dwFlags = MWF_LOG_ALL;
dat->dwFlags = (teInfo->rtl ? dat->dwFlags | MWF_LOG_RTL : dat->dwFlags & ~MWF_LOG_RTL);
dat->dwFlags = (iIndex == 0 || iIndex == 1) ? dat->dwFlags & ~MWF_LOG_GROUPMODE : dat->dwFlags | MWF_LOG_GROUPMODE;
- mir_sntprintf(dat->szMyNickname, L"My Nickname");
+ mir_snwprintf(dat->szMyNickname, L"My Nickname");
StreamInEvents(hwndDlg, 0, 1, 0, &dbei);
SendDlgItemMessage(hwndDlg, IDC_PREVIEW, EM_SETSEL, -1, -1);
if (teInfo->changed)
diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp
index 96cbe340d7..92a6571fe3 100644
--- a/plugins/TabSRMM/src/themeio.cpp
+++ b/plugins/TabSRMM/src/themeio.cpp
@@ -425,7 +425,7 @@ const wchar_t* TSAPI GetThemeFileName(int iMode)
szFilename[0] = 0;
wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s%c*.tabsrmm%c%c", TranslateT("TabSRMM themes"), 0, 0, 0);
+ mir_snwprintf(filter, L"%s%c*.tabsrmm%c%c", TranslateT("TabSRMM themes"), 0, 0, 0);
ofn.lpstrFilter = filter;
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = 0;
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp
index 740f69c74b..d2ba2c8e3c 100644
--- a/plugins/TabSRMM/src/themes.cpp
+++ b/plugins/TabSRMM/src/themes.cpp
@@ -802,7 +802,7 @@ wchar_t* CImageItem::Read(const wchar_t *szFilename)
wchar_t *szFinalName = 0;
GetPrivateProfileString(m_szName, L"Glyph", L"None", buffer, 500, szFilename);
- if (mir_tstrcmp(buffer, L"None")) {
+ if (mir_wstrcmp(buffer, L"None")) {
swscanf(buffer, L"%d,%d,%d,%d", &m_glyphMetrics[0], &m_glyphMetrics[1],
&m_glyphMetrics[2], &m_glyphMetrics[3]);
if (m_glyphMetrics[2] > m_glyphMetrics[0] && m_glyphMetrics[3] > m_glyphMetrics[1]) {
@@ -813,12 +813,12 @@ wchar_t* CImageItem::Read(const wchar_t *szFilename)
}
GetPrivateProfileString(m_szName, L"Image", L"None", buffer, 500, szFilename);
- if (mir_tstrcmp(buffer, L"None") || m_dwFlags & IMAGE_GLYPH) {
+ if (mir_wstrcmp(buffer, L"None") || m_dwFlags & IMAGE_GLYPH) {
szFinalName = new wchar_t[MAX_PATH];
//strncpy(m_szName, &m_szName[1], sizeof(m_szName));
//m_szName[sizeof(m_szName) - 1] = 0;
_wsplitpath(szFilename, szDrive, szPath, NULL, NULL);
- mir_sntprintf(szFinalName, MAX_PATH, L"%s\\%s%s", szDrive, szPath, buffer);
+ mir_snwprintf(szFinalName, MAX_PATH, L"%s\\%s%s", szDrive, szPath, buffer);
if (!PathFileExists(szFinalName)) {
delete[] szFinalName;
szFinalName = 0;
@@ -852,7 +852,7 @@ wchar_t* CImageItem::Read(const wchar_t *szFilename)
}
}
GetPrivateProfileString(m_szName, L"Fillcolor", L"None", buffer, 500, szFilename);
- if (mir_tstrcmp(buffer, L"None")) {
+ if (mir_wstrcmp(buffer, L"None")) {
COLORREF fillColor = CSkin::HexStringToLong(buffer);
m_fillBrush = CreateSolidBrush(fillColor);
m_dwFlags |= IMAGE_FILLSOLID;
@@ -860,7 +860,7 @@ wchar_t* CImageItem::Read(const wchar_t *szFilename)
else
m_fillBrush = 0;
GetPrivateProfileString(m_szName, L"Colorkey", L"None", buffer, 500, szFilename);
- if (mir_tstrcmp(buffer, L"None")) {
+ if (mir_wstrcmp(buffer, L"None")) {
CSkin::m_ContainerColorKey = CSkin::HexStringToLong(buffer);
if (CSkin::m_ContainerColorKeyBrush)
DeleteObject(CSkin::m_ContainerColorKeyBrush);
@@ -1204,11 +1204,11 @@ void CSkin::LoadIcon(const wchar_t *szSection, const wchar_t *name, HICON &hIcon
GetPrivateProfileString(szSection, name, L"none", buffer, 250, m_tszFileName);
buffer[500] = 0;
- if (mir_tstrcmpi(buffer, L"none")) {
+ if (mir_wstrcmpi(buffer, L"none")) {
wchar_t szDrive[MAX_PATH], szDir[MAX_PATH], szImagePath[MAX_PATH];
_wsplitpath(m_tszFileName, szDrive, szDir, NULL, NULL);
- mir_sntprintf(szImagePath, L"%s\\%s\\%s", szDrive, szDir, buffer);
+ mir_snwprintf(szImagePath, L"%s\\%s\\%s", szDrive, szDir, buffer);
hIcon = (HICON)LoadImage(0, szImagePath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
}
else hIcon = NULL;
@@ -1237,12 +1237,12 @@ void CSkin::ReadItem(const int id, const wchar_t *szItem)
this_item->ALPHA = min(this_item->ALPHA, 100);
clr = RGB(GetBValue(defaults->COLOR), GetGValue(defaults->COLOR), GetRValue(defaults->COLOR));
- mir_sntprintf(def_color, L"%6.6x", clr);
+ mir_snwprintf(def_color, L"%6.6x", clr);
GetPrivateProfileString(szItem, L"Color1", def_color, buffer, 400, m_tszFileName);
this_item->COLOR = HexStringToLong(buffer);
clr = RGB(GetBValue(defaults->COLOR2), GetGValue(defaults->COLOR2), GetRValue(defaults->COLOR2));
- mir_sntprintf(def_color, L"%6.6x", clr);
+ mir_snwprintf(def_color, L"%6.6x", clr);
GetPrivateProfileString(szItem, L"Color2", def_color, buffer, 400, m_tszFileName);
this_item->COLOR2 = HexStringToLong(buffer);
@@ -1299,7 +1299,7 @@ void CSkin::ReadImageItem(const wchar_t *itemname)
wchar_t *szImageFileName = tmpItem.Read(m_tszFileName);
- if (!mir_tstrcmpi(itemname, L"$glyphs") && szImageFileName != 0) { // the glyph item MUST have a valid image
+ if (!mir_wstrcmpi(itemname, L"$glyphs") && szImageFileName != 0) { // the glyph item MUST have a valid image
tmpItem.Create(szImageFileName);
if (tmpItem.getHbm()) {
m_glyphItem = tmpItem;
@@ -1312,12 +1312,12 @@ void CSkin::ReadImageItem(const wchar_t *itemname)
// handle the assignments of image items to skin items
for (int n = 0;; n++) {
- mir_sntprintf(szItemNr, L"Item%d", n);
+ mir_snwprintf(szItemNr, L"Item%d", n);
GetPrivateProfileString(itemname, szItemNr, L"None", buffer, 500, m_tszFileName);
- if (!mir_tstrcmp(buffer, L"None"))
+ if (!mir_wstrcmp(buffer, L"None"))
break;
for (int i = 0; i <= ID_EXTBK_LAST; i++) {
- if (!mir_tstrcmpi(SkinItems[i].szName[0] == '{' ? &SkinItems[i].szName[3] : SkinItems[i].szName, buffer)) {
+ if (!mir_wstrcmpi(SkinItems[i].szName[0] == '{' ? &SkinItems[i].szName[3] : SkinItems[i].szName, buffer)) {
if (!(tmpItem.getFlags() & IMAGE_GLYPH)) {
if (szImageFileName)
tmpItem.Create(szImageFileName);
@@ -1406,18 +1406,18 @@ void CSkin::Load(void)
GetPrivateProfileSectionNames(szSections, 3000, m_tszFileName);
szSections[3001] = szSections[3000] = 0;
wchar_t *p = szSections;
- while (mir_tstrlen(p) > 1) {
+ while (mir_wstrlen(p) > 1) {
if (p[0] != '%') {
- p += (mir_tstrlen(p) + 1);
+ p += (mir_wstrlen(p) + 1);
continue;
}
for (i = 0; i <= ID_EXTBK_LAST; i++) {
- if (!mir_tstrcmpi(&p[1], SkinItems[i].szName[0] == '{' ? &SkinItems[i].szName[3] : SkinItems[i].szName)) {
+ if (!mir_wstrcmpi(&p[1], SkinItems[i].szName[0] == '{' ? &SkinItems[i].szName[3] : SkinItems[i].szName)) {
ReadItem(i, p);
break;
}
}
- p += (mir_tstrlen(p) + 1);
+ p += (mir_wstrlen(p) + 1);
j++;
}
@@ -1430,7 +1430,7 @@ void CSkin::Load(void)
m_avatarBorderClr = (COLORREF)HexStringToLong(buffer);
GetPrivateProfileString(L"Global", L"SideBarBG", L"None", buffer, 20, m_tszFileName);
- if (mir_tstrcmp(buffer, L"None"))
+ if (mir_wstrcmp(buffer, L"None"))
m_sideBarContainerBG = (COLORREF)HexStringToLong(buffer);
else
m_sideBarContainerBG = SkinItems[ID_EXTBKSIDEBARBG].COLOR;
@@ -1477,7 +1477,7 @@ void CSkin::Load(void)
GetPrivateProfileString(L"Theme", L"File", L"None", buffer, MAX_PATH, m_tszFileName);
_wsplitpath(m_tszFileName, szDrive, szPath, NULL, NULL);
- mir_sntprintf(szFinalName, L"%s\\%s\\%s", szDrive, szPath, buffer);
+ mir_snwprintf(szFinalName, L"%s\\%s\\%s", szDrive, szPath, buffer);
if (PathFileExists(szFinalName)) {
ReadThemeFromINI(szFinalName, 0, FALSE, m_fLoadOnStartup ? 0 : M.GetByte("skin_loadmode", 0));
CacheLogFonts();
@@ -1490,7 +1490,7 @@ void CSkin::Load(void)
DeleteObject(m_MenuBGBrush);
m_MenuBGBrush = 0;
}
- if (mir_tstrcmp(buffer, L"None"))
+ if (mir_wstrcmp(buffer, L"None"))
m_MenuBGBrush = CreateSolidBrush(data);
GetPrivateProfileString(L"Global", L"LightShadow", L"000000", buffer, 20, m_tszFileName);
@@ -1503,7 +1503,7 @@ void CSkin::Load(void)
SkinCalcFrameWidth();
GetPrivateProfileString(L"Global", L"FontColor", L"None", buffer, 20, m_tszFileName);
- if (mir_tstrcmp(buffer, L"None"))
+ if (mir_wstrcmp(buffer, L"None"))
CSkin::m_DefaultFontColor = HexStringToLong(buffer);
else
CSkin::m_DefaultFontColor = GetSysColor(COLOR_BTNTEXT);
@@ -1539,7 +1539,7 @@ void CSkin::LoadItems()
szSections[SECT_BUFFER_SIZE] = 0;
p = szSections;
- while (mir_tstrlen(p) > 1) {
+ while (mir_wstrlen(p) > 1) {
p1 = wcschr(p, (int)'=');
if (p1)
*p1 = 0;
@@ -1549,14 +1549,14 @@ void CSkin::LoadItems()
memset(&m_skinIcons[m_nrSkinIcons], 0, sizeof(TIconDesc));
m_skinIcons[m_nrSkinIcons].uId = tmpIconDesc.uId;
m_skinIcons[m_nrSkinIcons].phIcon = (HICON *)(&m_skinIcons[m_nrSkinIcons].uId);
- m_skinIcons[m_nrSkinIcons].szName = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(p) + 1));
- mir_tstrcpy(m_skinIcons[m_nrSkinIcons].szName, p);
+ m_skinIcons[m_nrSkinIcons].szName = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_wstrlen(p) + 1));
+ mir_wstrcpy(m_skinIcons[m_nrSkinIcons].szName, p);
m_nrSkinIcons++;
}
}
if (p1)
*p1 = '=';
- p += (mir_tstrlen(p) + 1);
+ p += (mir_wstrlen(p) + 1);
}
memset(szSections, 0, ((SECT_BUFFER_SIZE + 2) * sizeof(wchar_t)));
@@ -1564,10 +1564,10 @@ void CSkin::LoadItems()
szSections[SECT_BUFFER_SIZE] = 0;
p = szSections;
- while (mir_tstrlen(p) > 1) {
+ while (mir_wstrlen(p) > 1) {
if (p[0] == '$')
ReadImageItem(p);
- p += (mir_tstrlen(p) + 1);
+ p += (mir_wstrlen(p) + 1);
}
nextButtonID = IDC_TBFIRSTUID;
@@ -1668,14 +1668,14 @@ void CSkin::setupAeroSkins()
wchar_t tszFilename[MAX_PATH], tszBasePath[MAX_PATH];
wcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE);
- if (tszBasePath[mir_tstrlen(tszBasePath) - 1] != '\\')
- mir_tstrcat(tszBasePath, L"\\");
+ if (tszBasePath[mir_wstrlen(tszBasePath) - 1] != '\\')
+ mir_wstrcat(tszBasePath, L"\\");
// load unknown avatar..
if (0 == PluginConfig.g_hbmUnknown) {
- mir_sntprintf(tszFilename, L"%scustom_unknown.png", tszBasePath);
+ mir_snwprintf(tszFilename, L"%scustom_unknown.png", tszBasePath);
if (!PathFileExists(tszFilename))
- mir_sntprintf(tszFilename, L"%sunknown.png", tszBasePath);
+ mir_snwprintf(tszFilename, L"%sunknown.png", tszBasePath);
PluginConfig.g_hbmUnknown = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR);
if (PluginConfig.g_hbmUnknown == 0) {
HDC dc = GetDC(0);
@@ -1684,9 +1684,9 @@ void CSkin::setupAeroSkins()
}
}
- mir_sntprintf(tszFilename, L"%scustom_tabskin_aero.png", tszBasePath);
+ mir_snwprintf(tszFilename, L"%scustom_tabskin_aero.png", tszBasePath);
if (!PathFileExists(tszFilename))
- mir_sntprintf(tszFilename, L"%stabskin_aero.png", tszBasePath);
+ mir_snwprintf(tszFilename, L"%stabskin_aero.png", tszBasePath);
BOOL isOpaque = false;
if (CMimAPI::m_pfnDwmGetColorizationColor && M.isAero())
@@ -1771,9 +1771,9 @@ void CSkin::setupAeroSkins()
m_tabBottom->setMetrics(bm.bmWidth, bm.bmHeight);
- mir_sntprintf(tszFilename, L"%scustom_tabskin_aero_glow.png", tszBasePath);
+ mir_snwprintf(tszFilename, L"%scustom_tabskin_aero_glow.png", tszBasePath);
if (!PathFileExists(tszFilename))
- mir_sntprintf(tszFilename, L"%stabskin_aero_glow.png", tszBasePath);
+ mir_snwprintf(tszFilename, L"%stabskin_aero_glow.png", tszBasePath);
fib = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR | IMGL_RETURNDIB);
@@ -1804,9 +1804,9 @@ void CSkin::setupAeroSkins()
m_tabGlowBottom->setMetrics(bm.bmWidth, bm.bmHeight);
// background item for the button switch bar
- mir_sntprintf(tszFilename, L"%scustom_tabskin_aero_button.png", tszBasePath);
+ mir_snwprintf(tszFilename, L"%scustom_tabskin_aero_button.png", tszBasePath);
if (!PathFileExists(tszFilename))
- mir_sntprintf(tszFilename, L"%stabskin_aero_button.png", tszBasePath);
+ mir_snwprintf(tszFilename, L"%stabskin_aero_button.png", tszBasePath);
hbm = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR);
@@ -2439,8 +2439,8 @@ void CSkin::extractSkinsAndLogo(bool fForceOverwrite) const
{
wchar_t tszBasePath[MAX_PATH];
wcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE);
- if (tszBasePath[mir_tstrlen(tszBasePath) - 1] != '\\')
- mir_tstrcat(tszBasePath, L"\\");
+ if (tszBasePath[mir_wstrlen(tszBasePath) - 1] != '\\')
+ mir_wstrcat(tszBasePath, L"\\");
CreateDirectoryTreeT(tszBasePath);
diff --git a/plugins/TabSRMM/src/themes.h b/plugins/TabSRMM/src/themes.h
index 32d3ac2d2d..4b35e4b366 100644
--- a/plugins/TabSRMM/src/themes.h
+++ b/plugins/TabSRMM/src/themes.h
@@ -151,7 +151,7 @@ public:
CImageItem(const wchar_t *szName)
{
memset(this, 0, sizeof(CImageItem));
- mir_sntprintf(m_szName, szName);
+ mir_snwprintf(m_szName, szName);
m_szName[39] = 0;
}
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp
index f13c5195c5..f9d01f7c87 100644
--- a/plugins/TabSRMM/src/trayicon.cpp
+++ b/plugins/TabSRMM/src/trayicon.cpp
@@ -92,7 +92,7 @@ static void TrayAnimThread(LPVOID)
void TSAPI CreateTrayMenus(int mode)
{
if (mode) {
- mir_sntprintf(g_eventName, L"tsr_evt_%d", GetCurrentThreadId());
+ mir_snwprintf(g_eventName, L"tsr_evt_%d", GetCurrentThreadId());
g_hEvent = CreateEvent(NULL, FALSE, FALSE, g_eventName);
isAnimThreadRunning = TRUE;
hTrayAnimThread = mir_forkthread(TrayAnimThread, NULL);
@@ -217,7 +217,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const wchar_t *szNickname, c
if (acc && acc->tszAccountName) {
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
- mir_sntprintf(szMenuEntry, L"%s: %s (%s)", acc->tszAccountName, szFinalNick, szStatus);
+ mir_snwprintf(szMenuEntry, L"%s: %s (%s)", acc->tszAccountName, szFinalNick, szStatus);
if (mode) {
if (hMenu == PluginConfig.g_hMenuRecent) {
if (CheckMenuItem(hMenu, (UINT_PTR)hContact, MF_BYCOMMAND | MF_UNCHECKED) == 0) {
@@ -264,7 +264,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const wchar_t *szNickname, c
if (!mode) {
mii.fMask |= MIIM_STRING;
mii.dwTypeData = (LPTSTR)szMenuEntry;
- mii.cch = (int)mir_tstrlen(szMenuEntry) + 1;
+ mii.cch = (int)mir_wstrlen(szMenuEntry) + 1;
}
mii.hbmpItem = HBMMENU_CALLBACK;
mii.dwItemData = (ULONG_PTR)hIcon;
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp
index a9a06b6611..0c05c1ba27 100644
--- a/plugins/TabSRMM/src/typingnotify.cpp
+++ b/plugins/TabSRMM/src/typingnotify.cpp
@@ -528,8 +528,8 @@ int TN_ModuleInit()
for (i = 0; i < _countof(colorPicker); i++)
colorPicker[i].color = M.GetDword(Module, colorPicker[i].desc, 0);
- mir_sntprintf(szStart, TranslateT("...is typing a message."));
- mir_sntprintf(szStop, TranslateT("...has stopped typing."));
+ mir_snwprintf(szStart, TranslateT("...is typing a message."));
+ mir_snwprintf(szStop, TranslateT("...has stopped typing."));
if (PluginConfig.g_bPopupAvail && ShowMenu) {
hTypingNotify = CreateServiceFunction("TypingNotify/EnableDisableMenuCommand", EnableDisableMenuCommand);
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp
index 39f367e2c1..cd4653b191 100644
--- a/plugins/TabSRMM/src/userprefs.cpp
+++ b/plugins/TabSRMM/src/userprefs.cpp
@@ -416,7 +416,7 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP
GetClientRect(hwndDlg, &rcClient);
wchar_t szBuffer[180];
- mir_sntprintf(szBuffer, TranslateT("Set messaging options for %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(szBuffer, TranslateT("Set messaging options for %s"), pcli->pfnGetContactDisplayName(hContact, 0));
SetWindowText(hwndDlg, szBuffer);
memset(&tci, 0, sizeof(tci));
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp
index 82918649a4..5ce367b1a0 100644
--- a/plugins/TabSRMM/src/utils.cpp
+++ b/plugins/TabSRMM/src/utils.cpp
@@ -103,8 +103,8 @@ const wchar_t* Utils::FormatRaw(TWindowData *dat, const wchar_t *msg, int flags,
search_again:
bool clr_found = false;
for (int ii = 0; ii < rtf_ctable_size; ii++) {
- if (!wcsnicmp((wchar_t*)colorname.c_str(), rtf_ctable[ii].szName, mir_tstrlen(rtf_ctable[ii].szName))) {
- closing = beginmark + 7 + mir_tstrlen(rtf_ctable[ii].szName);
+ if (!wcsnicmp((wchar_t*)colorname.c_str(), rtf_ctable[ii].szName, mir_wstrlen(rtf_ctable[ii].szName))) {
+ closing = beginmark + 7 + mir_wstrlen(rtf_ctable[ii].szName);
if (endmark != message.npos) {
message.erase(endmark, 4);
message.replace(endmark, 4, L"c0 ");
@@ -113,13 +113,13 @@ search_again:
wchar_t szTemp[5];
message.insert(beginmark, L"cxxx ");
- mir_sntprintf(szTemp, L"%02d", MSGDLGFONTCOUNT + 13 + ii);
+ mir_snwprintf(szTemp, L"%02d", MSGDLGFONTCOUNT + 13 + ii);
message[beginmark + 3] = szTemp[0];
message[beginmark + 4] = szTemp[1];
clr_found = true;
if (was_added) {
wchar_t wszTemp[100];
- mir_sntprintf(wszTemp, L"##col##%06u:%04u", endmark - closing, ii);
+ mir_snwprintf(wszTemp, L"##col##%06u:%04u", endmark - closing, ii);
wszTemp[99] = 0;
message.insert(beginmark, wszTemp);
}
@@ -236,7 +236,7 @@ ok:
static wchar_t* Trunc500(wchar_t *str)
{
- if (mir_tstrlen(str) > 500)
+ if (mir_wstrlen(str) > 500)
str[500] = 0;
return str;
}
@@ -271,7 +271,7 @@ bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMSt
break;
case 'c':
- dest.Append(!mir_tstrcmp(dat->pContainer->szName, L"default") ? TranslateT("Default container") : dat->pContainer->szName);
+ dest.Append(!mir_wstrcmp(dat->pContainer->szName, L"default") ? TranslateT("Default container") : dat->pContainer->szName);
break;
case 'o':
@@ -286,7 +286,7 @@ bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMSt
{
BYTE xStatus = dat->cache->getXStatusId();
if (dat->wStatus != ID_STATUS_OFFLINE && xStatus > 0 && xStatus <= 31) {
- ptrT szXStatus(db_get_tsa(dat->hContact, dat->szProto, "XStatusName"));
+ ptrW szXStatus(db_get_tsa(dat->hContact, dat->szProto, "XStatusName"));
dest.Append((szXStatus != NULL) ? Trunc500(szXStatus) : xStatusDescr[xStatus - 1]);
}
}
@@ -296,7 +296,7 @@ bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMSt
{
BYTE xStatus = dat->cache->getXStatusId();
if (dat->wStatus != ID_STATUS_OFFLINE && xStatus > 0 && xStatus <= 31) {
- ptrT szXStatus(db_get_tsa(dat->hContact, dat->szProto, "XStatusName"));
+ ptrW szXStatus(db_get_tsa(dat->hContact, dat->szProto, "XStatusName"));
dest.Append((szXStatus != NULL) ? Trunc500(szXStatus) : xStatusDescr[xStatus - 1]);
}
else dest.Append(dat->szStatus && dat->szStatus[0] ? dat->szStatus : L"(undef)");
@@ -307,7 +307,7 @@ bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMSt
case 't':
case 'T':
{
- ptrT tszStatus(dat->cache->getNormalizedStatusMsg(dat->cache->getStatusMsg(), true));
+ ptrW tszStatus(dat->cache->getNormalizedStatusMsg(dat->cache->getStatusMsg(), true));
if (tszStatus)
dest.Append(tszStatus);
else if (*src == 't')
@@ -317,7 +317,7 @@ bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMSt
case 'g':
{
- ptrT tszGroup(db_get_tsa(dat->hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_tsa(dat->hContact, "CList", "Group"));
if (tszGroup != NULL)
dest.Append(tszGroup);
}
@@ -365,7 +365,7 @@ void Utils::DoubleAmpersands(wchar_t *pszText, size_t len)
{
CMString text(pszText);
text.Replace(L"&", L"&&");
- mir_tstrncpy(pszText, text.c_str(), len);
+ mir_wstrncpy(pszText, text.c_str(), len);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -381,8 +381,8 @@ wchar_t* Utils::GetPreviewWithEllipsis(wchar_t *szText, size_t iMaxLen)
wchar_t *p = 0, cSaved;
bool fEllipsis = false;
- if (mir_tstrlen(szText) <= iMaxLen) {
- uRequired = mir_tstrlen(szText) + 4;
+ if (mir_wstrlen(szText) <= iMaxLen) {
+ uRequired = mir_wstrlen(szText) + 4;
cSaved = 0;
}
else {
@@ -399,7 +399,7 @@ wchar_t* Utils::GetPreviewWithEllipsis(wchar_t *szText, size_t iMaxLen)
uRequired = (p - szText) + 6;
}
wchar_t *szResult = reinterpret_cast<wchar_t *>(mir_alloc((uRequired + 1) * sizeof(wchar_t)));
- mir_sntprintf(szResult, (uRequired + 1), fEllipsis ? L"%s..." : L"%s", szText);
+ mir_snwprintf(szResult, (uRequired + 1), fEllipsis ? L"%s..." : L"%s", szText);
if (p)
*p = cSaved;
@@ -457,7 +457,7 @@ void Utils::RTF_ColorAdd(const wchar_t *tszColname, size_t length)
rtf_ctable_size++;
rtf_ctable = (TRTFColorTable *)mir_realloc(rtf_ctable, sizeof(TRTFColorTable) * rtf_ctable_size);
COLORREF clr = wcstol(tszColname, &stopped, 16);
- mir_sntprintf(rtf_ctable[rtf_ctable_size - 1].szName, length + 1, L"%06x", clr);
+ mir_snwprintf(rtf_ctable[rtf_ctable_size - 1].szName, length + 1, L"%06x", clr);
rtf_ctable[rtf_ctable_size - 1].menuid = 0;
clr = wcstol(tszColname, &stopped, 16);
@@ -570,7 +570,7 @@ void Utils::SaveContainerSettings(TContainerData *pContainer, const char *szSett
WriteContainerSettingsToDB(0, pContainer->settings, szCName);
}
mir_snprintf(szCName, "%s%d_theme", szSetting, pContainer->iContainerIndex);
- if (mir_tstrlen(pContainer->szRelThemeFile) > 1) {
+ if (mir_wstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
PathToRelativeT(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath());
db_set_ts(NULL, SRMSGMOD_T, szCName, pContainer->szAbsThemeFile);
@@ -715,7 +715,7 @@ void Utils::addMenuItem(const HMENU& m, MENUITEMINFO &mii, HICON hIcon, const wc
mii.wID = uID;
mii.dwItemData = (ULONG_PTR)hIcon;
mii.dwTypeData = const_cast<wchar_t *>(szText);
- mii.cch = (int)mir_tstrlen(mii.dwTypeData) + 1;
+ mii.cch = (int)mir_wstrlen(mii.dwTypeData) + 1;
::InsertMenuItem(m, pos, TRUE, &mii);
}
@@ -800,7 +800,7 @@ bool Utils::extractResource(const HMODULE h, const UINT uID, const wchar_t *tszN
DWORD dwSize = SizeofResource(g_hInst, hRes), written = 0;
wchar_t szFilename[MAX_PATH];
- mir_sntprintf(szFilename, L"%s%s", tszPath, tszFilename);
+ mir_snwprintf(szFilename, L"%s%s", tszPath, tszFilename);
if (!fForceOverwrite)
if (PathFileExists(szFilename))
return true;
@@ -834,8 +834,8 @@ wchar_t* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRich)
tr.lpstrText = (wchar_t*)mir_alloc(sizeof(wchar_t) * (tr.chrg.cpMax - tr.chrg.cpMin + 8));
::SendMessage(hwndRich, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (wcschr(tr.lpstrText, '@') != NULL && wcschr(tr.lpstrText, ':') == NULL && wcschr(tr.lpstrText, '/') == NULL) {
- mir_tstrncpy(tr.lpstrText, L"mailto:", 7);
- mir_tstrncpy(tr.lpstrText + 7, tr.lpstrText, tr.chrg.cpMax - tr.chrg.cpMin + 1);
+ mir_wstrncpy(tr.lpstrText, L"mailto:", 7);
+ mir_wstrncpy(tr.lpstrText + 7, tr.lpstrText, tr.chrg.cpMax - tr.chrg.cpMin + 1);
}
return tr.lpstrText;
}
@@ -935,7 +935,7 @@ size_t Utils::CopyToClipBoard(const wchar_t *str, const HWND hwndOwner)
if (!OpenClipboard(hwndOwner) || str == 0)
return 0;
- size_t i = sizeof(wchar_t) * (mir_tstrlen(str) + 1);
+ size_t i = sizeof(wchar_t) * (mir_wstrlen(str) + 1);
EmptyClipboard();
HGLOBAL hData = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, i);
@@ -954,21 +954,21 @@ void Utils::AddToFileList(wchar_t ***pppFiles, int *totalCount, LPCTSTR szFilena
{
*pppFiles = (wchar_t**)mir_realloc(*pppFiles, (++*totalCount + 1) * sizeof(wchar_t*));
(*pppFiles)[*totalCount] = NULL;
- (*pppFiles)[*totalCount - 1] = mir_tstrdup(szFilename);
+ (*pppFiles)[*totalCount - 1] = mir_wstrdup(szFilename);
if (GetFileAttributes(szFilename) & FILE_ATTRIBUTE_DIRECTORY) {
WIN32_FIND_DATA fd;
wchar_t szPath[MAX_PATH];
- mir_tstrcpy(szPath, szFilename);
- mir_tstrcat(szPath, L"\\*");
+ mir_wstrcpy(szPath, szFilename);
+ mir_wstrcat(szPath, L"\\*");
HANDLE hFind = FindFirstFile(szPath, &fd);
if (hFind != INVALID_HANDLE_VALUE) {
do {
- if (!mir_tstrcmp(fd.cFileName, L".") || !mir_tstrcmp(fd.cFileName, L".."))
+ if (!mir_wstrcmp(fd.cFileName, L".") || !mir_wstrcmp(fd.cFileName, L".."))
continue;
- mir_tstrcpy(szPath, szFilename);
- mir_tstrcat(szPath, L"\\");
- mir_tstrcat(szPath, fd.cFileName);
+ mir_wstrcpy(szPath, szFilename);
+ mir_wstrcat(szPath, L"\\");
+ mir_wstrcat(szPath, fd.cFileName);
AddToFileList(pppFiles, totalCount, szPath);
} while (FindNextFile(hFind, &fd));
FindClose(hFind);
@@ -1179,7 +1179,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
::SendDlgItemMessage(hwnd, IDC_WARNTEXT, EM_AUTOURLDETECT, TRUE, 0);
::SendDlgItemMessage(hwnd, IDC_WARNTEXT, EM_SETEVENTMASK, 0, ENM_LINK);
- mir_sntprintf(temp, RTF_DEFAULT_HEADER, 0, 0, 0, 30 * 15);
+ mir_snwprintf(temp, RTF_DEFAULT_HEADER, 0, 0, 0, 30 * 15);
tstring *str = new tstring(temp);
str->append(m_szText);
diff --git a/plugins/TabSRMM/src/utils.h b/plugins/TabSRMM/src/utils.h
index 245db9db97..cd6ca460a8 100644
--- a/plugins/TabSRMM/src/utils.h
+++ b/plugins/TabSRMM/src/utils.h
@@ -167,7 +167,7 @@ public:
LRESULT ShowDialog() const;
private:
- ptrT m_szTitle, m_szText;
+ ptrW m_szTitle, m_szText;
UINT m_uId;
HFONT m_hFontCaption;
DWORD m_dwFlags;