summaryrefslogtreecommitdiff
path: root/plugins/SimpleStatusMsg
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/SimpleStatusMsg
parent2e931a0b2780587d85f3902468c935f5adba70c8 (diff)
less TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SimpleStatusMsg')
-rw-r--r--plugins/SimpleStatusMsg/src/awaymsg.cpp20
-rw-r--r--plugins/SimpleStatusMsg/src/main.cpp118
-rw-r--r--plugins/SimpleStatusMsg/src/msgbox.cpp40
-rw-r--r--plugins/SimpleStatusMsg/src/options.cpp30
4 files changed, 104 insertions, 104 deletions
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp
index dc3896efa3..177282ccad 100644
--- a/plugins/SimpleStatusMsg/src/awaymsg.cpp
+++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp
@@ -41,9 +41,9 @@ static wchar_t *StrNormNewline(wchar_t *tszStr)
nCR++;
if (!nCR)
- return mir_tstrdup(tszStr);
+ return mir_wstrdup(tszStr);
- wchar_t *tszNewStr = (wchar_t *)mir_alloc((mir_tstrlen(tszStr) + nCR + 1) * sizeof(wchar_t)), *ptszStr = tszNewStr;
+ wchar_t *tszNewStr = (wchar_t *)mir_alloc((mir_wstrlen(tszStr) + nCR + 1) * sizeof(wchar_t)), *ptszStr = tszNewStr;
while (*tszStr) {
if (*tszStr == 0x0A)
*ptszStr++ = 0x0D;
@@ -86,14 +86,14 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP
wchar_t *status = pcli->pfnGetStatusModeDescription(dwStatus, 0);
GetWindowText(hwndDlg, format, _countof(format));
- mir_sntprintf(str, format, status, contactName);
+ mir_snwprintf(str, format, status, contactName);
SetWindowText(hwndDlg, str);
if (dat->hSeq) {
GetDlgItemText(hwndDlg, IDC_RETRIEVING, format, _countof(format));
- mir_sntprintf(str, format, status);
+ mir_snwprintf(str, format, status);
}
else {
- mir_sntprintf(str, TranslateT("Failed to retrieve %s message."), status);
+ mir_snwprintf(str, TranslateT("Failed to retrieve %s message."), status);
SetDlgItemText(hwndDlg, IDOK, TranslateT("&Close"));
}
SetDlgItemText(hwndDlg, IDC_RETRIEVING, str);
@@ -205,7 +205,7 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP
wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
wchar_t str[256], format[128];
GetWindowText(hwndDlg, format, _countof(format));
- mir_sntprintf(str, format, contactName);
+ mir_snwprintf(str, format, contactName);
SetWindowText(hwndDlg, str);
if (!dat->hSeq)
DestroyWindow(hwndDlg);
@@ -237,7 +237,7 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP
wchar_t *tszMsg = StrNormNewline((wchar_t *)ack->lParam);
wcsncpy_s(msg, tszMsg, _TRUNCATE);
mir_free(tszMsg);
- size_t len = mir_tstrlen(msg);
+ size_t len = mir_wstrlen(msg);
if (len) {
LPTSTR lptstrCopy;
HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(wchar_t));
@@ -344,17 +344,17 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM)
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) {
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iStatus == ID_STATUS_OFFLINE ? ID_STATUS_INVISIBLE : iStatus)) {
HICON hIcon = Skin_LoadProtoIcon(szProto, iStatus);
- mir_sntprintf(str, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ mir_snwprintf(str, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hAwayMsgMenuItem, str, hIcon, 0);
IcoLib_ReleaseIcon(hIcon);
ptrA szMsg(db_get_sa(hContact, "CList", "StatusMsg"));
if (szMsg != NULL) {
- mir_sntprintf(str, TranslateT("Copy %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ mir_snwprintf(str, TranslateT("Copy %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hCopyMsgMenuItem, str);
if (StrFindURL(szMsg) != NULL) {
- mir_sntprintf(str, TranslateT("&Go to URL in %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ mir_snwprintf(str, TranslateT("&Go to URL in %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hGoToURLMenuItem, str);
}
}
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp
index 942eaa19a5..13893bcc83 100644
--- a/plugins/SimpleStatusMsg/src/main.cpp
+++ b/plugins/SimpleStatusMsg/src/main.cpp
@@ -122,7 +122,7 @@ static wchar_t *GetWinampSong(void)
if (pstr < szTitle + (iTitleLen / 2))
{
- memmove(szTitle, pstr + 9, mir_tstrlen(pstr + 9) * sizeof(wchar_t));
+ memmove(szTitle, pstr + 9, mir_wstrlen(pstr + 9) * sizeof(wchar_t));
pstr = wcsstr(pstr + 1, L" - Winamp");
if (pstr == NULL)
{
@@ -140,7 +140,7 @@ static wchar_t *GetWinampSong(void)
}
pstr += 2;
- res = mir_tstrdup(pstr);
+ res = mir_wstrdup(pstr);
mir_free(szTitle);
return res;
@@ -149,7 +149,7 @@ static wchar_t *GetWinampSong(void)
wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int)
{
int i, count = 0, len;
- wchar_t substituteStr[1024], *msg = mir_tstrdup(in);
+ wchar_t substituteStr[1024], *msg = mir_wstrdup(in);
for (i = 0; msg[i]; i++)
{
@@ -163,7 +163,7 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int)
if (i + 2 <= 1024 && msg[i + 2])
{
count++;
- memmove(p, p + 1, (mir_tstrlen(p) - 1) * sizeof(wchar_t));
+ memmove(p, p + 1, (mir_wstrlen(p) - 1) * sizeof(wchar_t));
}
else
{
@@ -184,21 +184,21 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int)
if (ptszWinampTitle != NULL)
{
mir_free(g_ptszWinampSong);
- g_ptszWinampSong = mir_tstrdup(ptszWinampTitle);
+ g_ptszWinampSong = mir_wstrdup(ptszWinampTitle);
}
- else if (g_ptszWinampSong && mir_tstrcmp(g_ptszWinampSong, L"SimpleStatusMsg")
+ else if (g_ptszWinampSong && mir_wstrcmp(g_ptszWinampSong, L"SimpleStatusMsg")
&& db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))
{
- ptszWinampTitle = mir_tstrdup(g_ptszWinampSong);
+ ptszWinampTitle = mir_wstrdup(g_ptszWinampSong);
}
else
continue;
- if (mir_tstrlen(ptszWinampTitle) > 12)
- msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(ptszWinampTitle) - 12) * sizeof(wchar_t));
+ if (mir_wstrlen(ptszWinampTitle) > 12)
+ msg = (wchar_t *)mir_realloc(msg, (mir_wstrlen(msg) + 1 + mir_wstrlen(ptszWinampTitle) - 12) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(ptszWinampTitle), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(wchar_t));
- memcpy(msg + i, ptszWinampTitle, mir_tstrlen(ptszWinampTitle) * sizeof(wchar_t));
+ memmove(msg + i + mir_wstrlen(ptszWinampTitle), msg + i + 12, (mir_wstrlen(msg) - i - 11) * sizeof(wchar_t));
+ memcpy(msg + i, ptszWinampTitle, mir_wstrlen(ptszWinampTitle) * sizeof(wchar_t));
mir_free(ptszWinampTitle);
}
@@ -229,28 +229,28 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int)
}
else GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, substituteStr, _countof(substituteStr));
- if (mir_tstrlen(substituteStr) > 6)
- msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(wchar_t));
+ if (mir_wstrlen(substituteStr) > 6)
+ msg = (wchar_t *)mir_realloc(msg, (mir_wstrlen(msg) + 1 + mir_wstrlen(substituteStr) - 6) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(wchar_t));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
+ memmove(msg + i + mir_wstrlen(substituteStr), msg + i + 6, (mir_wstrlen(msg) - i - 5) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_wstrlen(substituteStr) * sizeof(wchar_t));
}
else if (!wcsnicmp(msg + i, L"%date%", 6))
{
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, substituteStr, _countof(substituteStr));
- if (mir_tstrlen(substituteStr) > 6)
- msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(wchar_t));
+ if (mir_wstrlen(substituteStr) > 6)
+ msg = (wchar_t *)mir_realloc(msg, (mir_wstrlen(msg) + 1 + mir_wstrlen(substituteStr) - 6) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(wchar_t));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
+ memmove(msg + i + mir_wstrlen(substituteStr), msg + i + 6, (mir_wstrlen(msg) - i - 5) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_wstrlen(substituteStr) * sizeof(wchar_t));
}
else if (!wcsnicmp(msg+i, L"%rand(", 6))
{
wchar_t *temp, *token;
int ran_from, ran_to, k;
- temp = mir_tstrdup(msg + i + 6);
+ temp = mir_wstrdup(msg + i + 6);
token = wcstok(temp, L",)");
ran_from = _wtoi(token);
token = wcstok(NULL, L",)%%");
@@ -258,14 +258,14 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int)
if (ran_to > ran_from)
{
- mir_sntprintf(substituteStr, L"%d", GetRandom(ran_from, ran_to));
+ mir_snwprintf(substituteStr, L"%d", GetRandom(ran_from, ran_to));
for (k = i + 1; msg[k]; k++) if (msg[k] == '%') { k++; break; }
- if (mir_tstrlen(substituteStr) > k - i)
- msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - (k - i)) * sizeof(wchar_t));
+ if (mir_wstrlen(substituteStr) > k - i)
+ msg = (wchar_t *)mir_realloc(msg, (mir_wstrlen(msg) + 1 + mir_wstrlen(substituteStr) - (k - i)) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + (k - i), (mir_tstrlen(msg) - i - (k - i - 1)) * sizeof(wchar_t));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
+ memmove(msg + i + mir_wstrlen(substituteStr), msg + i + (k - i), (mir_wstrlen(msg) - i - (k - i - 1)) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_wstrlen(substituteStr) * sizeof(wchar_t));
}
mir_free(temp);
}
@@ -293,10 +293,10 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int)
if (tszStatusMsg == NULL)
continue;
- mir_tstrcpy(substituteStr, tszStatusMsg);
+ mir_wstrcpy(substituteStr, tszStatusMsg);
mir_free(tszStatusMsg);
- if (!mir_tstrlen(substituteStr))
+ if (!mir_wstrlen(substituteStr))
continue;
if (wcsstr(substituteStr, L"%randmsg%") != NULL || wcsstr(substituteStr, L"%randdefmsg%") != NULL)
@@ -306,13 +306,13 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int)
else rmark[0] = TRUE;
}
- if (k2 == maxk || k2 > maxk) mir_tstrcpy(substituteStr, L"");
+ if (k2 == maxk || k2 > maxk) mir_wstrcpy(substituteStr, L"");
- if (mir_tstrlen(substituteStr) > 9)
- msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 9) * sizeof(wchar_t));
+ if (mir_wstrlen(substituteStr) > 9)
+ msg = (wchar_t *)mir_realloc(msg, (mir_wstrlen(msg) + 1 + mir_wstrlen(substituteStr) - 9) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 9, (mir_tstrlen(msg) - i - 8) * sizeof(wchar_t));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
+ memmove(msg + i + mir_wstrlen(substituteStr), msg + i + 9, (mir_wstrlen(msg) - i - 8) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_wstrlen(substituteStr) * sizeof(wchar_t));
}
else if (!wcsnicmp(msg+i, L"%randdefmsg%", 12))
{
@@ -338,10 +338,10 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int)
if (tszStatusMsg == NULL)
continue;
- mir_tstrcpy(substituteStr, tszStatusMsg);
+ mir_wstrcpy(substituteStr, tszStatusMsg);
mir_free(tszStatusMsg);
- if (!mir_tstrlen(substituteStr))
+ if (!mir_wstrlen(substituteStr))
continue;
if (wcsstr(substituteStr, L"%randmsg%") != NULL || wcsstr(substituteStr, L"%randdefmsg%") != NULL)
@@ -351,24 +351,24 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int)
else rmark[0] = TRUE;
}
- if (k2 == maxk || k2 > maxk) mir_tstrcpy(substituteStr, L"");
+ if (k2 == maxk || k2 > maxk) mir_wstrcpy(substituteStr, L"");
- if (mir_tstrlen(substituteStr) > 12)
- msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg)+1+mir_tstrlen(substituteStr)-12) * sizeof(wchar_t));
+ if (mir_wstrlen(substituteStr) > 12)
+ msg = (wchar_t *)mir_realloc(msg, (mir_wstrlen(msg)+1+mir_wstrlen(substituteStr)-12) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(wchar_t));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
+ memmove(msg + i + mir_wstrlen(substituteStr), msg + i + 12, (mir_wstrlen(msg) - i - 11) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_wstrlen(substituteStr) * sizeof(wchar_t));
}
}
- if (count) msg[mir_tstrlen(msg) - count] = 0;
+ if (count) msg[mir_wstrlen(msg) - count] = 0;
if (szProto)
{
char szSetting[80];
mir_snprintf(szSetting, "Proto%sMaxLen", szProto);
len = db_get_w(NULL, "SimpleStatusMsg", szSetting, 1024);
- if (len < mir_tstrlen(msg))
+ if (len < mir_wstrlen(msg))
{
msg = (wchar_t *)mir_realloc(msg, len * sizeof(wchar_t));
msg[len] = 0;
@@ -404,7 +404,7 @@ static wchar_t *GetAwayMessageFormat(int iStatus, const char *szProto)
if (flags & STATUS_EMPTY_MSG)
{
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
}
else if (flags & STATUS_LAST_STATUS_MSG)
{
@@ -424,7 +424,7 @@ static wchar_t *GetAwayMessageFormat(int iStatus, const char *szProto)
char *szLastMsg = db_get_sa(NULL, "SimpleStatusMsg", szSetting);
if (szLastMsg == NULL)
- return NULL; //mir_tstrdup(L"");
+ return NULL; //mir_wstrdup(L"");
format = db_get_tsa(NULL, "SimpleStatusMsg", szLastMsg);
mir_free(szLastMsg);
@@ -438,17 +438,17 @@ static wchar_t *GetAwayMessageFormat(int iStatus, const char *szProto)
format = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting));
if (format == NULL)
- format = mir_tstrdup(L"");
+ format = mir_wstrdup(L"");
}
else
- format = mir_tstrdup(GetDefaultMessage(iStatus));
+ format = mir_wstrdup(GetDefaultMessage(iStatus));
return format;
}
void DBWriteMessage(char *szSetting, wchar_t *tszMsg)
{
- if (tszMsg && mir_tstrlen(tszMsg))
+ if (tszMsg && mir_wstrlen(tszMsg))
db_set_ts(NULL, "SimpleStatusMsg", szSetting, tszMsg);
else
db_unset(NULL, "SimpleStatusMsg", szSetting);
@@ -527,7 +527,7 @@ static wchar_t *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVar
//if (flags & PROTO_NO_MSG)
//{
- // format = mir_tstrdup(L"");
+ // format = mir_wstrdup(L"");
//}
//else
if (flags & PROTO_THIS_MSG)
@@ -535,7 +535,7 @@ static wchar_t *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVar
mir_snprintf(szSetting, "Proto%sDefault", szProto);
format = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
if (format == NULL)
- format = mir_tstrdup(L"");
+ format = mir_wstrdup(L"");
}
else if (flags & PROTO_NOCHANGE && szProto)
{
@@ -1306,7 +1306,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD)
mir_snprintf(szBuffer, "Cur%sMsg", accounts->pa[i]->szModuleName);
tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szBuffer);
- if ((tszMsg && tszStatusMsg && !mir_tstrcmp(tszMsg, tszStatusMsg)) || (!tszMsg && !tszStatusMsg))
+ if ((tszMsg && tszStatusMsg && !mir_wstrcmp(tszMsg, tszStatusMsg)) || (!tszMsg && !tszStatusMsg))
{
mir_free(tszStatusMsg);
mir_free(tszMsg);
@@ -1315,7 +1315,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD)
else
mir_free(tszStatusMsg);
- if (tszMsg && mir_tstrlen(tszMsg))
+ if (tszMsg && mir_wstrlen(tszMsg))
{
#ifdef _DEBUG
log2file("UpdateMsgTimerProc(): Set %s status and \"%S\" status message for %s.", StatusModeToDbSetting(iCurrentStatus, ""), tszMsg, accounts->pa[i]->szModuleName);
@@ -1419,7 +1419,7 @@ static int ChangeStatusMsgPrebuild(WPARAM, LPARAM)
if (Proto_IsAccountLocked(pa[i]))
{
wchar_t szBuffer[256];
- mir_sntprintf(szBuffer, TranslateT("%s (locked)"), pa[i]->tszAccountName);
+ mir_snwprintf(szBuffer, TranslateT("%s (locked)"), pa[i]->tszAccountName);
mi.root = Menu_CreateRoot(MO_STATUS, szBuffer, mi.position);
}
else mi.root = Menu_CreateRoot(MO_STATUS, pa[i]->tszAccountName, mi.position);
@@ -1520,7 +1520,7 @@ static int CSStatusChange(WPARAM wParam, LPARAM)
char buff[80];
bool found = false;
- wchar_t *szMsgW = mir_t2u(ps[i]->szMsg);
+ wchar_t *szMsgW = mir_wstrdup(ps[i]->szMsg);
#ifdef _DEBUG
@@ -1533,7 +1533,7 @@ static int CSStatusChange(WPARAM wParam, LPARAM)
wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
if (tszStatusMsg != NULL)
{
- if (!mir_tstrcmp(tszStatusMsg, szMsgW))
+ if (!mir_wstrcmp(tszStatusMsg, szMsgW))
{
found = true;
mir_snprintf(szSetting, "Last%sMsg", ps[i]->szName);
@@ -1578,10 +1578,10 @@ static wchar_t *ParseWinampSong(ARGUMENTSINFO *ai)
if (ptszWinampTitle != NULL) {
mir_free(g_ptszWinampSong);
- g_ptszWinampSong = mir_tstrdup(ptszWinampTitle);
+ g_ptszWinampSong = mir_wstrdup(ptszWinampTitle);
}
- else if (g_ptszWinampSong && mir_tstrcmp(g_ptszWinampSong, L"SimpleStatusMsg") && db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))
- ptszWinampTitle = mir_tstrdup(g_ptszWinampSong);
+ else if (g_ptszWinampSong && mir_wstrcmp(g_ptszWinampSong, L"SimpleStatusMsg") && db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))
+ ptszWinampTitle = mir_wstrdup(g_ptszWinampSong);
return ptszWinampTitle;
}
@@ -1595,7 +1595,7 @@ static wchar_t *ParseDate(ARGUMENTSINFO *ai)
ai->flags |= AIF_DONTPARSE;
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, szStr, _countof(szStr));
- return mir_tstrdup(szStr);
+ return mir_wstrdup(szStr);
}
int ICQMsgTypeToStatus(int iMsgType)
@@ -1720,7 +1720,7 @@ static int OnModulesLoaded(WPARAM, LPARAM)
g_ptszWinampSong = db_get_tsa(NULL, "SimpleStatusMsg", "AmpLastTitle");
if (g_ptszWinampSong == NULL)
- g_ptszWinampSong = mir_tstrdup(L"SimpleStatusMsg");
+ g_ptszWinampSong = mir_wstrdup(L"SimpleStatusMsg");
if (db_get_b(NULL, "SimpleStatusMsg", "UpdateMsgOn", 1))
g_uUpdateMsgTimer = SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", "UpdateMsgInt", 10) * 1000, UpdateMsgTimerProc);
@@ -1769,7 +1769,7 @@ static int OnOkToExit(WPARAM, LPARAM)
db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)CallProtoService(accounts->pa[i]->szModuleName, PS_GETSTATUS, 0, 0));
}
- if (g_ptszWinampSong && mir_tstrcmp(g_ptszWinampSong, L"SimpleStatusMsg") /*&& db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1)*/)
+ if (g_ptszWinampSong && mir_wstrcmp(g_ptszWinampSong, L"SimpleStatusMsg") /*&& db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1)*/)
DBWriteMessage("AmpLastTitle", g_ptszWinampSong);
}
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp
index 6162d10dbe..20bc2a0347 100644
--- a/plugins/SimpleStatusMsg/src/msgbox.cpp
+++ b/plugins/SimpleStatusMsg/src/msgbox.cpp
@@ -274,12 +274,12 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data)
else if (data->m_iDlgFlags & DLG_SHOW_BUTTONS_INLIST) {
if (found) {
if (data->m_iDlgFlags & DLG_SHOW_LIST_ICONS) {
- mir_sntprintf(text, TranslateT("Clear history"));
+ mir_snwprintf(text, TranslateT("Clear history"));
cbei.iImage = I_ICON_CLEAR;
cbei.iSelectedImage = I_ICON_CLEAR;
}
else {
- mir_sntprintf(text, L"## %s ##", TranslateT("Clear history"));
+ mir_snwprintf(text, L"## %s ##", TranslateT("Clear history"));
cbei.iIndent = 1;
}
cbei.iItem = -1;
@@ -291,12 +291,12 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data)
cbei.iItem = -1;
if (data->m_iDlgFlags & DLG_SHOW_LIST_ICONS) {
- mir_sntprintf(text, TranslateT("Add to predefined"));
+ mir_snwprintf(text, TranslateT("Add to predefined"));
cbei.iImage = I_ICON_ADD;
cbei.iSelectedImage = I_ICON_ADD;
}
else {
- mir_sntprintf(text, L"## %s ##", TranslateT("Add to predefined"));
+ mir_snwprintf(text, L"## %s ##", TranslateT("Add to predefined"));
cbei.iIndent = 1;
}
cbei.pszText = (LPTSTR)text;
@@ -305,13 +305,13 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data)
SendMessage(handle, CBEM_INSERTITEM, 0, (LPARAM)&cbei);
if (data->m_iDlgFlags & DLG_SHOW_LIST_ICONS) {
- mir_sntprintf(text, TranslateT("Delete selected"));
+ mir_snwprintf(text, TranslateT("Delete selected"));
cbei.iImage = I_ICON_DEL;
cbei.iSelectedImage = I_ICON_DEL;
}
else {
cbei.iIndent = 1;
- mir_sntprintf(text, L"## %s ##", TranslateT("Delete selected"));
+ mir_snwprintf(text, L"## %s ##", TranslateT("Delete selected"));
}
cbei.iItem = -1;
cbei.pszText = (LPTSTR)text;
@@ -468,7 +468,7 @@ VOID APIENTRY HandlePopupMenu(HWND hwnd, POINT pt, HWND edit_control)
wchar_t item_string[128];
GetMenuString(hmenu, m_selection, (LPTSTR)&item_string, 128, MF_BYCOMMAND);
- int len = (int)mir_tstrlen(item_string);
+ int len = (int)mir_wstrlen(item_string);
if (len) {
LPTSTR lptstrCopy;
HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(wchar_t));
@@ -609,7 +609,7 @@ int AddToPredefined(HWND hwndDlg, struct MsgBoxData *data)
newitem.pszText = text;
SendMessage(data->recent_cbex, CBEM_GETITEM, 0, (LPARAM)&newitem);
- if (LOWORD(newitem.lParam) == PREDEFINED_MSG && !mir_tstrcmp(text, msg))
+ if (LOWORD(newitem.lParam) == PREDEFINED_MSG && !mir_wstrcmp(text, msg))
return num_items;
}
@@ -692,7 +692,7 @@ void DisplayCharsCount(struct MsgBoxData *dlg_data, HWND hwndDlg)
lines++;
}
}
- mir_sntprintf(status_text, TranslateT("OK (%d)"), len - (lines - 1));
+ mir_snwprintf(status_text, TranslateT("OK (%d)"), len - (lines - 1));
SetDlgItemText(hwndDlg, IDC_OK, status_text);
}
@@ -779,12 +779,12 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus)
wchar_t szTitle[256], szProtoName[128];
BOOL bDisabled = msgbox_data->m_szProto && !(CallProtoService(msgbox_data->m_szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND);
- mir_sntprintf(szProtoName, msgbox_data->m_szProto ? Proto_GetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global"));
+ mir_snwprintf(szProtoName, msgbox_data->m_szProto ? Proto_GetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global"));
if (iStatus == ID_STATUS_CURRENT) {
if (msgbox_data->m_bOnStartup)
- mir_sntprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<startup>"), szProtoName);
+ mir_snwprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<startup>"), szProtoName);
else
- mir_sntprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<current>"), szProtoName);
+ mir_snwprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<current>"), szProtoName);
}
else if (iStatus > ID_STATUS_CURRENT) {
wchar_t buff[128];
@@ -793,10 +793,10 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus)
CallService(MS_SS_GETPROFILENAME, iStatus - 40083, (LPARAM)buff1);
MultiByteToWideChar(Langpack_GetDefaultCodePage(), 0, buff1, -1, buff, 128);
- mir_sntprintf(szTitle, TranslateT("%s message (%s)"), buff, szProtoName);
+ mir_snwprintf(szTitle, TranslateT("%s message (%s)"), buff, szProtoName);
}
else
- mir_sntprintf(szTitle, TranslateT("%s message (%s)"), pcli->pfnGetStatusModeDescription(iStatus, 0), szProtoName);
+ mir_snwprintf(szTitle, TranslateT("%s message (%s)"), pcli->pfnGetStatusModeDescription(iStatus, 0), szProtoName);
SetWindowText(hwndDlg, szTitle);
if (iStatus == ID_STATUS_CURRENT)
@@ -904,16 +904,16 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
TranslateDialogDefault(hwndDlg);
init_data = (struct MsgBoxInitData *)lParam;
GetWindowText(hwndDlg, szFormat, _countof(szFormat));
- mir_sntprintf(szProtoName, init_data->m_szProto ? Proto_GetAccount(init_data->m_szProto)->tszAccountName : TranslateT("global"));
+ mir_snwprintf(szProtoName, init_data->m_szProto ? Proto_GetAccount(init_data->m_szProto)->tszAccountName : TranslateT("global"));
if (init_data->m_iStatus == ID_STATUS_CURRENT) {
if (init_data->m_bOnStartup)
- mir_sntprintf(szTitle, szFormat, TranslateT("<startup>"), szProtoName);
+ mir_snwprintf(szTitle, szFormat, TranslateT("<startup>"), szProtoName);
else
- mir_sntprintf(szTitle, szFormat, TranslateT("<current>"), szProtoName);
+ mir_snwprintf(szTitle, szFormat, TranslateT("<current>"), szProtoName);
}
else
- mir_sntprintf(szTitle, szFormat, pcli->pfnGetStatusModeDescription(init_data->m_iStatus, 0), szProtoName);
+ mir_snwprintf(szTitle, szFormat, pcli->pfnGetStatusModeDescription(init_data->m_iStatus, 0), szProtoName);
SetWindowText(hwndDlg, szTitle);
int icoStatus = ID_STATUS_OFFLINE;
@@ -1097,7 +1097,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
}
else {
wchar_t str[64];
- mir_sntprintf(str, TranslateT("Closing in %d"), msgbox_data->m_iCountdown);
+ mir_snwprintf(str, TranslateT("Closing in %d"), msgbox_data->m_iCountdown);
SetDlgItemText(hwndDlg, IDC_OK, str);
}
msgbox_data->m_iCountdown--;
@@ -1174,7 +1174,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
mir_snprintf(buff, "SMsg%d", i);
wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
if (tszStatusMsg != NULL) {
- if (!mir_tstrcmp(tszStatusMsg, tszMsg)) {
+ if (!mir_wstrcmp(tszStatusMsg, tszMsg)) {
found = true;
if (msgbox_data->m_szProto) {
mir_snprintf(buff2, "Last%sMsg", msgbox_data->m_szProto);
diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp
index e7695ca304..ebed7ada43 100644
--- a/plugins/SimpleStatusMsg/src/options.cpp
+++ b/plugins/SimpleStatusMsg/src/options.cpp
@@ -138,8 +138,8 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
val = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(i, "Flags"), STATUS_DEFAULT);
data->status_msg[0].flags[i - ID_STATUS_ONLINE] = val;
- ptrT text( db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i, "Default")));
- mir_tstrncpy(data->status_msg[0].msg[i - ID_STATUS_ONLINE], (text == NULL) ? GetDefaultMessage(i) : text, 1024);
+ ptrW text( db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i, "Default")));
+ mir_wstrncpy(data->status_msg[0].msg[i - ID_STATUS_ONLINE], (text == NULL) ? GetDefaultMessage(i) : text, 1024);
for (j = 0; j < accounts->count; j++)
{
@@ -151,7 +151,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
data->status_msg[j+1].flags[i-ID_STATUS_ONLINE] = val;
mir_snprintf(setting, "%sDefault", accounts->pa[j]->szModuleName);
text = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i, setting));
- mir_tstrncpy(data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE], (text == NULL) ? GetDefaultMessage(i) : text, 1024);
+ mir_wstrncpy(data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE], (text == NULL) ? GetDefaultMessage(i) : text, 1024);
}
}
}
@@ -452,9 +452,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
if (szSetting)
{
wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
- if (tszStatusMsg && mir_tstrlen(tszStatusMsg))
+ if (tszStatusMsg && mir_wstrlen(tszStatusMsg))
{
- if (tszStatusMsg && mir_tstrlen(tszStatusMsg))
+ if (tszStatusMsg && mir_wstrlen(tszStatusMsg))
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
mir_free(tszStatusMsg);
@@ -870,11 +870,11 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
if (len > 0)
{
if (data->proto_msg[j].msg == NULL)
- data->proto_msg[j].msg = mir_tstrdup(msg);
+ data->proto_msg[j].msg = mir_wstrdup(msg);
else
{
mir_free(data->proto_msg[j].msg);
- data->proto_msg[j].msg = mir_tstrdup(msg);
+ data->proto_msg[j].msg = mir_wstrdup(msg);
}
}
else
@@ -889,7 +889,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
else
{
GetDlgItemText(hwndDlg, IDC_OPTEDIT1, msg, _countof(msg));
- mir_tstrcpy(data->status_msg[j].msg[i], msg);
+ mir_wstrcpy(data->status_msg[j].msg[i], msg);
}
}
break;
@@ -911,7 +911,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
{
data->status_msg[0].flags[i-ID_STATUS_ONLINE] = data->status_msg[j].flags[i-ID_STATUS_ONLINE];
if (data->status_msg[j].flags[i-ID_STATUS_ONLINE] & STATUS_THIS_MSG)
- mir_tstrcpy(data->status_msg[0].msg[i-ID_STATUS_ONLINE], data->status_msg[j].msg[i-ID_STATUS_ONLINE]);
+ mir_wstrcpy(data->status_msg[0].msg[i-ID_STATUS_ONLINE], data->status_msg[j].msg[i-ID_STATUS_ONLINE]);
}
}
}
@@ -929,15 +929,15 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
if (data->proto_msg[j].flags & PROTO_THIS_MSG)
{
- size_t len = mir_tstrlen(data->proto_msg[j].msg);
+ size_t len = mir_wstrlen(data->proto_msg[j].msg);
if (len > 0)
{
if (data->proto_msg[k+1].msg == NULL)
- data->proto_msg[k+1].msg = mir_tstrdup(data->proto_msg[j].msg);
+ data->proto_msg[k+1].msg = mir_wstrdup(data->proto_msg[j].msg);
else
{
mir_free(data->proto_msg[k+1].msg);
- data->proto_msg[k+1].msg = mir_tstrdup(data->proto_msg[j].msg);
+ data->proto_msg[k+1].msg = mir_wstrdup(data->proto_msg[j].msg);
}
}
else
@@ -957,7 +957,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
{
data->status_msg[k + 1].flags[i - ID_STATUS_ONLINE] = data->status_msg[j].flags[i - ID_STATUS_ONLINE];
if (data->status_msg[j].flags[i - ID_STATUS_ONLINE] & STATUS_THIS_MSG)
- mir_tstrcpy(data->status_msg[k + 1].msg[i - ID_STATUS_ONLINE], data->status_msg[j].msg[i - ID_STATUS_ONLINE]);
+ mir_wstrcpy(data->status_msg[k + 1].msg[i - ID_STATUS_ONLINE], data->status_msg[j].msg[i - ID_STATUS_ONLINE]);
}
}
}
@@ -983,7 +983,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
{
data->status_msg[j].flags[k - ID_STATUS_ONLINE] = data->status_msg[j].flags[i];
if (data->status_msg[j].flags[i] & STATUS_THIS_MSG)
- mir_tstrcpy(data->status_msg[j].msg[k - ID_STATUS_ONLINE], data->status_msg[j].msg[i]);
+ mir_wstrcpy(data->status_msg[j].msg[k - ID_STATUS_ONLINE], data->status_msg[j].msg[i]);
}
}
break;
@@ -1235,7 +1235,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w
if (!ServiceExists(MS_SS_GETPROFILECOUNT)) {
wchar_t szText[100];
- mir_sntprintf(szText, L"%s *", TranslateT("Show status profiles in status list"));
+ mir_snwprintf(szText, L"%s *", TranslateT("Show status profiles in status list"));
SetDlgItemText(hwndDlg, IDC_CPROFILES, szText);
EnableWindow(GetDlgItem(hwndDlg, IDC_CPROFILES), FALSE);
ShowWindow(GetDlgItem(hwndDlg, IDC_NOTE1), SW_SHOW);