From 8ae3679aa1339ce9abee53adb69902bd6b7513dc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 25 Jul 2016 10:31:04 +0000 Subject: hello, Unix. phase 1: removing _T() git-svn-id: http://svn.miranda-ng.org/main/trunk@17127 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_app/src/ExtraIconGroup.cpp | 2 +- src/mir_app/src/FontOptions.cpp | 16 ++++---- src/mir_app/src/FontService.h | 2 +- src/mir_app/src/button.cpp | 4 +- src/mir_app/src/chat_clist.cpp | 2 +- src/mir_app/src/chat_log.cpp | 26 ++++++------ src/mir_app/src/chat_opts.cpp | 18 ++++---- src/mir_app/src/chat_rtf.cpp | 60 +++++++++++++-------------- src/mir_app/src/chat_svc.cpp | 2 +- src/mir_app/src/chat_tools.cpp | 84 +++++++++++++++++++------------------- src/mir_app/src/clc.cpp | 4 +- src/mir_app/src/clcfiledrop.cpp | 6 +-- src/mir_app/src/clcitems.cpp | 2 +- src/mir_app/src/clcutils.cpp | 14 +++---- src/mir_app/src/clistgroups.cpp | 8 ++-- src/mir_app/src/clistsettings.cpp | 2 +- src/mir_app/src/clisttray.cpp | 24 +++++------ src/mir_app/src/clui.cpp | 12 +++--- src/mir_app/src/cluiservices.cpp | 4 +- src/mir_app/src/database.cpp | 66 +++++++++++++++--------------- src/mir_app/src/dbini.cpp | 52 +++++++++++------------ src/mir_app/src/dbutils.cpp | 14 +++---- src/mir_app/src/enterstring.cpp | 4 +- src/mir_app/src/extraicons.cpp | 2 +- src/mir_app/src/filter.cpp | 8 ++-- src/mir_app/src/findadd.cpp | 2 +- src/mir_app/src/headerbar.cpp | 2 +- src/mir_app/src/hotkey_opts.cpp | 12 +++--- src/mir_app/src/hotkeys.cpp | 4 +- src/mir_app/src/icolib.cpp | 2 +- src/mir_app/src/keyboard.cpp | 10 ++--- src/mir_app/src/langpack.cpp | 8 ++-- src/mir_app/src/lpopts.cpp | 6 +-- src/mir_app/src/menu_clist.cpp | 6 +-- src/mir_app/src/menu_options.cpp | 6 +-- src/mir_app/src/menu_utils.cpp | 10 ++--- src/mir_app/src/meta_edit.cpp | 4 +- src/mir_app/src/meta_menu.cpp | 2 +- src/mir_app/src/meta_services.cpp | 6 +-- src/mir_app/src/meta_utils.cpp | 8 ++-- src/mir_app/src/miranda.cpp | 14 +++---- src/mir_app/src/netlibhttp.cpp | 2 +- src/mir_app/src/netliblog.cpp | 6 +-- src/mir_app/src/netlibopts.cpp | 2 +- src/mir_app/src/netlibsecurity.cpp | 14 +++---- src/mir_app/src/newplugins.cpp | 68 +++++++++++++++--------------- src/mir_app/src/options.cpp | 6 +-- src/mir_app/src/options_ei.cpp | 2 +- src/mir_app/src/path.cpp | 16 ++++---- src/mir_app/src/pluginopts.cpp | 30 +++++++------- src/mir_app/src/profilemanager.cpp | 38 ++++++++--------- src/mir_app/src/proto_opts.cpp | 16 ++++---- src/mir_app/src/proto_ui.cpp | 2 +- src/mir_app/src/proto_utils.cpp | 42 +++++++++---------- src/mir_app/src/searchresults.cpp | 10 ++--- src/mir_app/src/services.cpp | 2 +- src/mir_app/src/skin2opts.cpp | 24 +++++------ src/mir_app/src/skinicons.cpp | 6 +-- src/mir_app/src/sounds.cpp | 14 +++---- 59 files changed, 420 insertions(+), 420 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/ExtraIconGroup.cpp b/src/mir_app/src/ExtraIconGroup.cpp index effbdd5862..5031889689 100644 --- a/src/mir_app/src/ExtraIconGroup.cpp +++ b/src/mir_app/src/ExtraIconGroup.cpp @@ -41,7 +41,7 @@ void ExtraIconGroup::addExtraIcon(BaseExtraIcon *extra) CMString description; for (int i = 0; i < m_items.getCount(); i++) { if (i > 0) - description += _T(" / "); + description += L" / "; description += m_items[i]->getDescription(); } diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp index 8d5eb6faa0..55653f7dbc 100644 --- a/src/mir_app/src/FontOptions.cpp +++ b/src/mir_app/src/FontOptions.cpp @@ -133,7 +133,7 @@ static void WriteLine(FILE *out, const char pszText[]) static BOOL ExportSettings(HWND hwndDlg, const TCHAR *filename, OBJLIST& flist, OBJLIST& clist, OBJLIST& elist) { - FILE *out = _tfopen(filename, _T("w")); + FILE *out = _tfopen(filename, L"w"); if (out == NULL) { MessageBox(hwndDlg, filename, TranslateT("Failed to create file"), MB_ICONWARNING | MB_OK); return FALSE; @@ -164,7 +164,7 @@ static BOOL ExportSettings(HWND hwndDlg, const TCHAR *filename, OBJLISThDC, clText); - DrawTextWithEffect(dis->hDC, _T("abc"), 3, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER | DT_WORD_ELLIPSIS, pEffect); + DrawTextWithEffect(dis->hDC, L"abc", 3, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER | DT_WORD_ELLIPSIS, pEffect); if (dis->itemState & ODS_SELECTED) { SetTextColor(dis->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT)); @@ -1028,7 +1028,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, if (itemData->colour_id < 0) continue; colour_id_list_w2[itemData->colour_id].value = SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_GETCOLOUR, 0, 0); - if (mir_tstrcmp(colour_id_list_w2[itemData->colour_id].name, _T("Background")) == 0) { + if (mir_tstrcmp(colour_id_list_w2[itemData->colour_id].name, L"Background") == 0) { if (hBkgColourBrush) DeleteObject(hBkgColourBrush); hBkgColourBrush = CreateSolidBrush(colour_id_list_w2[itemData->colour_id].value); } @@ -1075,7 +1075,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, case IDC_BTN_EXPORT: { TCHAR fname_buff[MAX_PATH], filter[MAX_PATH]; - mir_sntprintf(filter, _T("%s (*.ini)%c*.ini%c%s (*.txt)%c*.TXT%c%s (*.*)%c*.*%c"), TranslateT("Configuration files"), 0, 0, TranslateT("Text files"), 0, 0, TranslateT("All files"), 0, 0); + mir_sntprintf(filter, L"%s (*.ini)%c*.ini%c%s (*.txt)%c*.TXT%c%s (*.*)%c*.*%c", TranslateT("Configuration files"), 0, 0, TranslateT("Text files"), 0, 0, TranslateT("All files"), 0, 0); OPENFILENAME ofn = { 0 }; ofn.lStructSize = sizeof(ofn); @@ -1087,7 +1087,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, ofn.lpstrFilter = filter; ofn.nFilterIndex = 1; - ofn.lpstrDefExt = _T("ini"); + ofn.lpstrDefExt = L"ini"; if (GetSaveFileName(&ofn) == TRUE) if (!ExportSettings(hwndDlg, ofn.lpstrFile, font_id_list, colour_id_list, effect_id_list)) diff --git a/src/mir_app/src/FontService.h b/src/mir_app/src/FontService.h index 2f34931f07..d530c311d7 100644 --- a/src/mir_app/src/FontService.h +++ b/src/mir_app/src/FontService.h @@ -39,7 +39,7 @@ struct FontInternal : public FontIDT return true; if ((flags & FIDF_CLASSMASK) == 0) - if (_tcsstr(name, _T("Incoming nick")) || _tcsstr(name, _T("Outgoing nick")) || _tcsstr(name, _T("Incoming timestamp")) || _tcsstr(name, _T("Outgoing timestamp"))) + if (_tcsstr(name, L"Incoming nick") || _tcsstr(name, L"Outgoing nick") || _tcsstr(name, L"Incoming timestamp") || _tcsstr(name, L"Outgoing timestamp")) return true; return false; } diff --git a/src/mir_app/src/button.cpp b/src/mir_app/src/button.cpp index 708b60e84b..d831d1b4d3 100644 --- a/src/mir_app/src/button.cpp +++ b/src/mir_app/src/button.cpp @@ -214,7 +214,7 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) //!! move it up, to text extent points? if (ctl->cHot) { SIZE szHot; - GetTextExtentPoint32 (hdcMem, _T("&"), 1, &szHot); + GetTextExtentPoint32 (hdcMem, L"&", 1, &szHot); sz.cx -= szHot.cx; } if (ctl->arrow) @@ -471,7 +471,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR else { TTooltips *ptt = (TTooltips*)mir_alloc(sizeof(TTooltips)); ptt->ThreadId = tt.ThreadId; - ptt->hwnd = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, _T(""), TTS_ALWAYSTIP, 0, 0, 0, 0, NULL, NULL, g_hInst, NULL); + ptt->hwnd = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, L"", TTS_ALWAYSTIP, 0, 0, 0, 0, NULL, NULL, g_hInst, NULL); lToolTips.insert(ptt); bct->hwndToolTips = ptt->hwnd; } diff --git a/src/mir_app/src/chat_clist.cpp b/src/mir_app/src/chat_clist.cpp index 1abd72c32b..1c47006d0b 100644 --- a/src/mir_app/src/chat_clist.cpp +++ b/src/mir_app/src/chat_clist.cpp @@ -29,7 +29,7 @@ MCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDi if (groupName) _tcsncpy_s(pszGroup, groupName, _TRUNCATE); else - mir_tstrcpy(pszGroup, _T("Chat rooms")); + mir_tstrcpy(pszGroup, L"Chat rooms"); if (pszGroup[0]) { MGROUP hGroup = Clist_GroupExists(pszGroup); diff --git a/src/mir_app/src/chat_log.cpp b/src/mir_app/src/chat_log.cpp index 41eab518cb..ac2a9ba75e 100644 --- a/src/mir_app/src/chat_log.cpp +++ b/src/mir_app/src/chat_log.cpp @@ -227,12 +227,12 @@ static void AddEventToBuffer(char *&buffer, size_t &bufferEnd, size_t &bufferAll if (streamData->lin->ptszNick) { if (g_Settings->bLogLimitNames && mir_tstrlen(streamData->lin->ptszNick) > 20) { mir_tstrncpy(szTemp2, streamData->lin->ptszNick, 20); - mir_tstrncpy(szTemp2 + 20, _T("..."), 4); + mir_tstrncpy(szTemp2 + 20, L"...", 4); } else mir_tstrncpy(szTemp2, streamData->lin->ptszNick, 511); if (streamData->lin->ptszUserInfo) - mir_sntprintf(szTemp, _T("%s (%s)"), szTemp2, streamData->lin->ptszUserInfo); + mir_sntprintf(szTemp, L"%s (%s)", szTemp2, streamData->lin->ptszUserInfo); else _tcsncpy_s(szTemp, szTemp2, _TRUNCATE); pszNick = szTemp; @@ -241,12 +241,12 @@ static void AddEventToBuffer(char *&buffer, size_t &bufferEnd, size_t &bufferAll switch (streamData->lin->iType) { case GC_EVENT_MESSAGE: if (streamData->lin->ptszText) - Log_AppendRTF(streamData, FALSE, buffer, bufferEnd, bufferAlloced, _T("%s"), streamData->lin->ptszText); + Log_AppendRTF(streamData, FALSE, buffer, bufferEnd, bufferAlloced, L"%s", streamData->lin->ptszText); break; case GC_EVENT_ACTION: if (streamData->lin->ptszNick && streamData->lin->ptszText) { - Log_AppendRTF(streamData, TRUE, buffer, bufferEnd, bufferAlloced, _T("%s "), streamData->lin->ptszNick); - Log_AppendRTF(streamData, FALSE, buffer, bufferEnd, bufferAlloced, _T("%s"), streamData->lin->ptszText); + Log_AppendRTF(streamData, TRUE, buffer, bufferEnd, bufferAlloced, L"%s ", streamData->lin->ptszNick); + Log_AppendRTF(streamData, FALSE, buffer, bufferEnd, bufferAlloced, L"%s", streamData->lin->ptszText); } break; case GC_EVENT_JOIN: @@ -261,13 +261,13 @@ static void AddEventToBuffer(char *&buffer, size_t &bufferEnd, size_t &bufferAll if (pszNick) Log_AppendRTF(streamData, TRUE, buffer, bufferEnd, bufferAlloced, TranslateT("%s has left"), pszNick); if (streamData->lin->ptszText) - Log_AppendRTF(streamData, TRUE, buffer, bufferEnd, bufferAlloced, _T(": %s"), streamData->lin->ptszText); + Log_AppendRTF(streamData, TRUE, buffer, bufferEnd, bufferAlloced, L": %s", streamData->lin->ptszText); break; case GC_EVENT_QUIT: if (pszNick) Log_AppendRTF(streamData, TRUE, buffer, bufferEnd, bufferAlloced, TranslateT("%s has disconnected"), pszNick); if (streamData->lin->ptszText) - Log_AppendRTF(streamData, FALSE, buffer, bufferEnd, bufferAlloced, _T(": %s"), streamData->lin->ptszText); + Log_AppendRTF(streamData, FALSE, buffer, bufferEnd, bufferAlloced, L": %s", streamData->lin->ptszText); break; case GC_EVENT_NICK: if (pszNick && streamData->lin->ptszText) { @@ -281,17 +281,17 @@ static void AddEventToBuffer(char *&buffer, size_t &bufferEnd, size_t &bufferAll if (streamData->lin->ptszNick && streamData->lin->ptszStatus) Log_AppendRTF(streamData, TRUE, buffer, bufferEnd, bufferAlloced, TranslateT("%s kicked %s"), streamData->lin->ptszStatus, streamData->lin->ptszNick); if (streamData->lin->ptszText) - Log_AppendRTF(streamData, FALSE, buffer, bufferEnd, bufferAlloced, _T(": %s"), streamData->lin->ptszText); + Log_AppendRTF(streamData, FALSE, buffer, bufferEnd, bufferAlloced, L": %s", streamData->lin->ptszText); break; case GC_EVENT_NOTICE: if (pszNick && streamData->lin->ptszText) { Log_AppendRTF(streamData, TRUE, buffer, bufferEnd, bufferAlloced, TranslateT("Notice from %s: "), pszNick); - Log_AppendRTF(streamData, FALSE, buffer, bufferEnd, bufferAlloced, _T("%s"), streamData->lin->ptszText); + Log_AppendRTF(streamData, FALSE, buffer, bufferEnd, bufferAlloced, L"%s", streamData->lin->ptszText); } break; case GC_EVENT_TOPIC: if (streamData->lin->ptszText) - Log_AppendRTF(streamData, FALSE, buffer, bufferEnd, bufferAlloced, TranslateT("The topic is '%s%s'"), streamData->lin->ptszText, _T("%r")); + Log_AppendRTF(streamData, FALSE, buffer, bufferEnd, bufferAlloced, TranslateT("The topic is '%s%s'"), streamData->lin->ptszText, L"%r"); if (streamData->lin->ptszNick) Log_AppendRTF(streamData, TRUE, buffer, bufferEnd, bufferAlloced, streamData->lin->ptszUserInfo ? TranslateT(" (set by %s on %s)") : TranslateT(" (set by %s)"), @@ -299,7 +299,7 @@ static void AddEventToBuffer(char *&buffer, size_t &bufferEnd, size_t &bufferAll break; case GC_EVENT_INFORMATION: if (streamData->lin->ptszText) - Log_AppendRTF(streamData, FALSE, buffer, bufferEnd, bufferAlloced, (streamData->lin->bIsMe) ? _T("--> %s") : _T("%s"), streamData->lin->ptszText); + Log_AppendRTF(streamData, FALSE, buffer, bufferEnd, bufferAlloced, (streamData->lin->bIsMe) ? L"--> %s" : L"%s", streamData->lin->ptszText); break; case GC_EVENT_ADDSTATUS: if (streamData->lin->ptszNick && streamData->lin->ptszText && streamData->lin->ptszStatus) @@ -386,7 +386,7 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData) mir_tstrncpy(szOldTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, streamData->si->LastTime), 30); if (!g_Settings->bShowTimeIfChanged || streamData->si->LastTime == 0 || mir_tstrcmp(szTimeStamp, szOldTimeStamp)) { streamData->si->LastTime = lin->time; - Log_AppendRTF(streamData, TRUE, buffer, bufferEnd, bufferAlloced, _T("%s"), szTimeStamp); + Log_AppendRTF(streamData, TRUE, buffer, bufferEnd, bufferAlloced, L"%s", szTimeStamp); } Log_Append(buffer, bufferEnd, bufferAlloced, "\\tab "); } @@ -397,7 +397,7 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData) Log_Append(buffer, bufferEnd, bufferAlloced, "%s ", Log_SetStyle(lin->bIsMe ? 2 : 1)); mir_tstrncpy(pszTemp, lin->bIsMe ? g_Settings->pszOutgoingNick : g_Settings->pszIncomingNick, 299); - p1 = _tcsstr(pszTemp, _T("%n")); + p1 = _tcsstr(pszTemp, L"%n"); if (p1) p1[1] = 's'; diff --git a/src/mir_app/src/chat_opts.cpp b/src/mir_app/src/chat_opts.cpp index b631984f2d..238cc43008 100644 --- a/src/mir_app/src/chat_opts.cpp +++ b/src/mir_app/src/chat_opts.cpp @@ -64,7 +64,7 @@ static FontOptionsList fontOptionsList[] = { LPGENT("User disables status for ..."), RGB(150, 70, 70), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, { LPGENT("Action message"), RGB(160, 90, 160), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, { LPGENT("Highlighted message"), RGB(180, 150, 80), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { _T(""), 0, lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { L"", 0, lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, { LPGENT("Nick list members (online)"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, { LPGENT("Nick list members (away)"), RGB(170, 170, 170), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 } }; @@ -163,7 +163,7 @@ void RegisterFonts(void) } _tcsncpy_s(fontid.name, LPGENT("Chat log symbols (Webdings)"), _TRUNCATE); - FO.szDefFace = _T("Webdings"); + FO.szDefFace = L"Webdings"; FO.defColour = RGB(170, 170, 170); FO.defCharset = SYMBOL_CHARSET; // fall through @@ -237,13 +237,13 @@ void LoadGlobalSettings(void) if (chatApi.OnLoadSettings) chatApi.OnLoadSettings(); - InitSetting(&g_Settings->pszTimeStamp, "HeaderTime", _T("[%H:%M]")); - InitSetting(&g_Settings->pszTimeStampLog, "LogTimestamp", _T("[%d %b %y %H:%M]")); - InitSetting(&g_Settings->pszIncomingNick, "HeaderIncoming", _T("%n:")); - InitSetting(&g_Settings->pszOutgoingNick, "HeaderOutgoing", _T("%n:")); - InitSetting(&g_Settings->pszHighlightWords, "HighlightWords", _T("%m")); + InitSetting(&g_Settings->pszTimeStamp, "HeaderTime", L"[%H:%M]"); + InitSetting(&g_Settings->pszTimeStampLog, "LogTimestamp", L"[%d %b %y %H:%M]"); + InitSetting(&g_Settings->pszIncomingNick, "HeaderIncoming", L"%n:"); + InitSetting(&g_Settings->pszOutgoingNick, "HeaderOutgoing", L"%n:"); + InitSetting(&g_Settings->pszHighlightWords, "HighlightWords", L"%m"); - InitSetting(&g_Settings->pszLogDir, "LogDirectory", _T("%miranda_logpath%\\%proto%\\%userid%.log")); + InitSetting(&g_Settings->pszLogDir, "LogDirectory", L"%miranda_logpath%\\%proto%\\%userid%.log"); g_Settings->bLogIndentEnabled = db_get_b(NULL, CHAT_MODULE, "LogIndentEnabled", 1) != 0; LOGFONT lf; @@ -313,7 +313,7 @@ int OptionsInit(void) LOGFONT lf; LoadMsgDlgFont(18, &lf, NULL); - mir_tstrcpy(lf.lfFaceName, _T("MS Shell Dlg")); + mir_tstrcpy(lf.lfFaceName, L"MS Shell Dlg"); lf.lfUnderline = lf.lfItalic = lf.lfStrikeOut = 0; lf.lfHeight = -17; lf.lfWeight = FW_BOLD; diff --git a/src/mir_app/src/chat_rtf.cpp b/src/mir_app/src/chat_rtf.cpp index 43edf3925d..d4382834b0 100644 --- a/src/mir_app/src/chat_rtf.cpp +++ b/src/mir_app/src/chat_rtf.cpp @@ -28,23 +28,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // convert rich edit code to bbcode (if wanted). Otherwise, strip all RTF formatting // tags and return plain text -static TCHAR tszRtfBreaks[] = _T(" \\\n\r"); +static TCHAR tszRtfBreaks[] = L" \\\n\r"; static void CreateColorMap(CMString &Text, int iCount, COLORREF *pSrc, int *pDst) { const TCHAR *pszText = Text; int iIndex = 1; - static const TCHAR *lpszFmt = _T("\\red%[^ \x5b\\]\\green%[^ \x5b\\]\\blue%[^ \x5b;];"); + static const TCHAR *lpszFmt = L"\\red%[^ \x5b\\]\\green%[^ \x5b\\]\\blue%[^ \x5b;];"; TCHAR szRed[10], szGreen[10], szBlue[10]; - const TCHAR *p1 = _tcsstr(pszText, _T("\\colortbl")); + const TCHAR *p1 = _tcsstr(pszText, L"\\colortbl"); if (!p1) return; const TCHAR *pEnd = _tcschr(p1, '}'); - const TCHAR *p2 = _tcsstr(p1, _T("\\red")); + const TCHAR *p2 = _tcsstr(p1, L"\\red"); for (int i = 0; i < iCount; i++) pDst[i] = -1; @@ -60,7 +60,7 @@ static void CreateColorMap(CMString &Text, int iCount, COLORREF *pSrc, int *pDst p1 = p2; p1++; - p2 = _tcsstr(p1, _T("\\red")); + p2 = _tcsstr(p1, L"\\red"); } } @@ -84,9 +84,9 @@ int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors) CreateColorMap(pszText, iNumColors, pColors, pIndex); // scan the file for rtf commands and remove or parse them - int idx = pszText.Find(_T("\\pard")); + int idx = pszText.Find(L"\\pard"); if (idx == -1) { - if ((idx = pszText.Find(_T("\\ltrpar"))) == -1) + if ((idx = pszText.Find(L"\\ltrpar")) == -1) return FALSE; idx += 7; } @@ -108,61 +108,61 @@ int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors) p += 2; break; } - if (!_tcsncmp(p, _T("\\cf"), 3)) { // foreground color + if (!_tcsncmp(p, L"\\cf", 3)) { // foreground color int iCol = _ttoi(p + 3); int iInd = GetRtfIndex(iCol, iNumColors, pIndex); bInsideColor = iInd > 0; } - else if (!_tcsncmp(p, _T("\\highlight"), 10)) { //background color + else if (!_tcsncmp(p, L"\\highlight", 10)) { //background color TCHAR szTemp[20]; int iCol = _ttoi(p + 10); - mir_sntprintf(szTemp, _T("%d"), iCol); + mir_sntprintf(szTemp, L"%d", iCol); } - else if (!_tcsncmp(p, _T("\\line"), 5)) { // soft line break; + else if (!_tcsncmp(p, L"\\line", 5)) { // soft line break; res.AppendChar('\n'); } - else if (!_tcsncmp(p, _T("\\endash"), 7)) { + else if (!_tcsncmp(p, L"\\endash", 7)) { res.AppendChar(0x2013); } - else if (!_tcsncmp(p, _T("\\emdash"), 7)) { + else if (!_tcsncmp(p, L"\\emdash", 7)) { res.AppendChar(0x2014); } - else if (!_tcsncmp(p, _T("\\bullet"), 7)) { + else if (!_tcsncmp(p, L"\\bullet", 7)) { res.AppendChar(0x2022); } - else if (!_tcsncmp(p, _T("\\ldblquote"), 10)) { + else if (!_tcsncmp(p, L"\\ldblquote", 10)) { res.AppendChar(0x201C); } - else if (!_tcsncmp(p, _T("\\rdblquote"), 10)) { + else if (!_tcsncmp(p, L"\\rdblquote", 10)) { res.AppendChar(0x201D); } - else if (!_tcsncmp(p, _T("\\lquote"), 7)) { + else if (!_tcsncmp(p, L"\\lquote", 7)) { res.AppendChar(0x2018); } - else if (!_tcsncmp(p, _T("\\rquote"), 7)) { + else if (!_tcsncmp(p, L"\\rquote", 7)) { res.AppendChar(0x2019); } - else if (!_tcsncmp(p, _T("\\b"), 2)) { //bold - res.Append((p[2] != '0') ? _T("[b]") : _T("[/b]")); + else if (!_tcsncmp(p, L"\\b", 2)) { //bold + res.Append((p[2] != '0') ? L"[b]" : L"[/b]"); } - else if (!_tcsncmp(p, _T("\\i"), 2)) { // italics - res.Append((p[2] != '0') ? _T("[i]") : _T("[/i]")); + else if (!_tcsncmp(p, L"\\i", 2)) { // italics + res.Append((p[2] != '0') ? L"[i]" : L"[/i]"); } - else if (!_tcsncmp(p, _T("\\strike"), 7)) { // strike-out - res.Append((p[7] != '0') ? _T("[s]") : _T("[/s]")); + else if (!_tcsncmp(p, L"\\strike", 7)) { // strike-out + res.Append((p[7] != '0') ? L"[s]" : L"[/s]"); } - else if (!_tcsncmp(p, _T("\\ul"), 3)) { // underlined + else if (!_tcsncmp(p, L"\\ul", 3)) { // underlined if (p[3] == 0 || _tcschr(tszRtfBreaks, p[3])) { - res.Append(_T("[u]")); + res.Append(L"[u]"); bInsideUl = true; } - else if (!_tcsnccmp(p + 3, _T("none"), 4)) { + else if (!_tcsnccmp(p + 3, L"none", 4)) { if (bInsideUl) - res.Append(_T("[/u]")); + res.Append(L"[/u]"); bInsideUl = false; } } - else if (!_tcsncmp(p, _T("\\tab"), 4)) { // tab + else if (!_tcsncmp(p, L"\\tab", 4)) { // tab res.AppendChar('\t'); } else if (p[1] == '\'') { // special character @@ -197,7 +197,7 @@ int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors) } if (bInsideUl) - res.Append(_T("[/u]")); + res.Append(L"[/u]"); pszText = res; return TRUE; diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp index e0801e8218..3d50d2c559 100644 --- a/src/mir_app/src/chat_svc.cpp +++ b/src/mir_app/src/chat_svc.cpp @@ -250,7 +250,7 @@ static INT_PTR Service_NewChat(WPARAM, LPARAM lParam) TCHAR szTemp[256]; if (si->iType == GCW_SERVER) - mir_sntprintf(szTemp, _T("Server: %s"), si->ptszName); + mir_sntprintf(szTemp, L"Server: %s", si->ptszName); else _tcsncpy_s(szTemp, si->ptszName, _TRUNCATE); si->hContact = chatApi.AddRoom(gcw->pszModule, gcw->ptszID, szTemp, si->iType); diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index 2497dabec7..4f822f1779 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -184,7 +184,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char *pszProtoNa pd.lchIcon = LoadIconEx("window", FALSE); PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName); - mir_sntprintf(pd.lptzContactName, _T("%s - %s"), (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, cli.pfnGetContactDisplayName(hContact, 0)); + mir_sntprintf(pd.lptzContactName, L"%s - %s", (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, cli.pfnGetContactDisplayName(hContact, 0)); mir_tstrncpy(pd.lptzText, TranslateTS(szBuf), _countof(pd.lptzText)); pd.iSeconds = g_Settings->iPopupTimeout; @@ -213,13 +213,13 @@ BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce) chatApi.ShowPopup(si->hContact, si, Skin_LoadIcon(SKINICON_EVENT_MESSAGE), si->pszModule, si->ptszName, chatApi.aFonts[16].color, TranslateT("%s says: %s"), gce->ptszNick, RemoveFormatting(gce->ptszText)); break; case GC_EVENT_ACTION | GC_EVENT_HIGHLIGHT: - chatApi.ShowPopup(si->hContact, si, Skin_LoadIcon(SKINICON_EVENT_MESSAGE), si->pszModule, si->ptszName, chatApi.aFonts[16].color, _T("%s %s"), gce->ptszNick, RemoveFormatting(gce->ptszText)); + chatApi.ShowPopup(si->hContact, si, Skin_LoadIcon(SKINICON_EVENT_MESSAGE), si->pszModule, si->ptszName, chatApi.aFonts[16].color, L"%s %s", gce->ptszNick, RemoveFormatting(gce->ptszText)); break; case GC_EVENT_MESSAGE: chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_MESSAGE], si->pszModule, si->ptszName, chatApi.aFonts[9].color, TranslateT("%s says: %s"), gce->ptszNick, RemoveFormatting(gce->ptszText)); break; case GC_EVENT_ACTION: - chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_ACTION], si->pszModule, si->ptszName, chatApi.aFonts[15].color, _T("%s %s"), gce->ptszNick, RemoveFormatting(gce->ptszText)); + chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_ACTION], si->pszModule, si->ptszName, chatApi.aFonts[15].color, L"%s %s", gce->ptszNick, RemoveFormatting(gce->ptszText)); break; case GC_EVENT_JOIN: chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_JOIN], si->pszModule, si->ptszName, chatApi.aFonts[3].color, TranslateT("%s has joined"), gce->ptszNick); @@ -255,7 +255,7 @@ BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce) chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_TOPIC], si->pszModule, si->ptszName, chatApi.aFonts[11].color, TranslateT("The topic is '%s' (set by %s)"), RemoveFormatting(gce->ptszText), gce->ptszNick); break; case GC_EVENT_INFORMATION: - chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_INFO], si->pszModule, si->ptszName, chatApi.aFonts[12].color, _T("%s"), RemoveFormatting(gce->ptszText)); + chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_INFO], si->pszModule, si->ptszName, chatApi.aFonts[12].color, L"%s", RemoveFormatting(gce->ptszText)); break; case GC_EVENT_ADDSTATUS: chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_ADDSTATUS], si->pszModule, si->ptszName, chatApi.aFonts[13].color, TranslateT("%s enables '%s' status for %s"), gce->ptszText, (char *)gce->ptszStatus, gce->ptszNick); @@ -411,7 +411,7 @@ const TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2) return NULL; } -static TCHAR szTrimString[] = _T(":,.!?;\'>)"); +static TCHAR szTrimString[] = L":,.!?;\'>)"; BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce) { @@ -427,20 +427,20 @@ BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce) CMString tszHighlightWords(g_Settings->pszHighlightWords); while (true) { - CMString tszToken = tszHighlightWords.Tokenize(_T("\t "), iStart); + CMString tszToken = tszHighlightWords.Tokenize(L"\t ", iStart); if (iStart == -1) break; // replace %m with the users nickname - if (tszToken == _T("%m")) + if (tszToken == L"%m") tszToken = si->pMe->pszNick; if (tszToken.Find('*') == -1) tszToken = '*' + tszToken + '*'; // time to get the next/first word in the incoming text string - for (const TCHAR *p = buf; *p != '\0'; p += _tcscspn(p, _T(" "))) { - p += _tcsspn(p, _T(" ")); + for (const TCHAR *p = buf; *p != '\0'; p += _tcscspn(p, L" ")) { + p += _tcsspn(p, L" "); // compare the words, using wildcards if (wildcmpit(p, tszToken)) @@ -470,7 +470,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) TCHAR szTime[100]; mir_tstrncpy(szTime, chatApi.MakeTimeStamp(g_Settings->pszTimeStampLog, gce->time), 99); - FILE *hFile = _tfopen(si->pszLogFileName, _T("ab+")); + FILE *hFile = _tfopen(si->pszLogFileName, L"ab+"); if (hFile == NULL) return FALSE; @@ -481,12 +481,12 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) if (gce->ptszNick) { if (g_Settings->bLogLimitNames && mir_tstrlen(gce->ptszNick) > 20) { mir_tstrncpy(szTemp2, gce->ptszNick, 20); - mir_tstrncpy(szTemp2 + 20, _T("..."), 4); + mir_tstrncpy(szTemp2 + 20, L"...", 4); } else mir_tstrncpy(szTemp2, gce->ptszNick, 511); if (gce->ptszUserInfo) - mir_sntprintf(szTemp, _T("%s (%s)"), szTemp2, gce->ptszUserInfo); + mir_sntprintf(szTemp, L"%s (%s)", szTemp2, gce->ptszUserInfo); else _tcsncpy_s(szTemp, szTemp2, _TRUNCATE); pszNick = szTemp; @@ -496,12 +496,12 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) case GC_EVENT_MESSAGE: case GC_EVENT_MESSAGE | GC_EVENT_HIGHLIGHT: p = '*'; - mir_sntprintf(szBuffer, _T("%s: %s"), gce->ptszNick, chatApi.RemoveFormatting(gce->ptszText)); + mir_sntprintf(szBuffer, L"%s: %s", gce->ptszNick, chatApi.RemoveFormatting(gce->ptszText)); break; case GC_EVENT_ACTION: case GC_EVENT_ACTION | GC_EVENT_HIGHLIGHT: p = '*'; - mir_sntprintf(szBuffer, _T("%s %s"), gce->ptszNick, chatApi.RemoveFormatting(gce->ptszText)); + mir_sntprintf(szBuffer, L"%s %s", gce->ptszNick, chatApi.RemoveFormatting(gce->ptszText)); break; case GC_EVENT_JOIN: p = '>'; @@ -560,9 +560,9 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) // formatting strings don't need to be translatable - changing them via language pack would // only screw up the log format. if (p) - mir_sntprintf(szLine, _T("%s %c %s\r\n"), szTime, p, szBuffer); + mir_sntprintf(szLine, L"%s %c %s\r\n", szTime, p, szBuffer); else - mir_sntprintf(szLine, _T("%s %s\r\n"), szTime, szBuffer); + mir_sntprintf(szLine, L"%s %s\r\n", szTime, szBuffer); if (szLine[0]) { _fputts(szLine, hFile); @@ -577,7 +577,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) time_t now = time(0); TCHAR tszTimestamp[20]; - _tcsftime(tszTimestamp, 20, _T("%Y%m%d-%H%M%S"), _localtime32((__time32_t *)&now)); + _tcsftime(tszTimestamp, 20, L"%Y%m%d-%H%M%S", _localtime32((__time32_t *)&now)); tszTimestamp[19] = 0; // max size reached, rotate the log @@ -587,11 +587,11 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) _tsplitpath(si->pszLogFileName, tszDrive, tszDir, tszName, tszExt); TCHAR tszNewPath[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20]; - mir_sntprintf(tszNewPath, _T("%s%sarchived\\"), tszDrive, tszDir); + mir_sntprintf(tszNewPath, L"%s%sarchived\\", tszDrive, tszDir); CreateDirectoryTreeT(tszNewPath); TCHAR tszNewName[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20]; - mir_sntprintf(tszNewName, _T("%s%s-%s%s"), tszNewPath, tszName, tszTimestamp, tszExt); + mir_sntprintf(tszNewName, L"%s%s-%s%s", tszNewPath, tszName, tszTimestamp, tszExt); fclose(hFile); hFile = 0; if (!PathFileExists(tszNewName)) @@ -679,7 +679,7 @@ BOOL IsEventSupported(int eventType) void ValidateFilename(TCHAR *filename) { TCHAR *p1 = filename; - TCHAR szForbidden[] = _T("\\/:*?\"<>|"); + TCHAR szForbidden[] = L"\\/:*?\"<>|"; while (*p1 != '\0') { if (_tcschr(szForbidden, *p1)) *p1 = '_'; @@ -696,7 +696,7 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime) // check whether relevant parts of the timestamp have changed and // we have to reparse the filename - TCHAR *tszNow = chatApi.MakeTimeStamp(_T("%a%d%m%Y"), tTime); // once a day + TCHAR *tszNow = chatApi.MakeTimeStamp(L"%a%d%m%Y", tTime); // once a day if (mir_tstrcmp(tszOldTimeStamp, tszNow)) { _tcsncpy_s(tszOldTimeStamp, tszNow, _TRUNCATE); *si->pszLogFileName = 0; @@ -704,42 +704,42 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime) if (si->pszLogFileName[0] == 0) { REPLACEVARSARRAY rva[11]; - rva[0].key.t = _T("d"); - rva[0].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%#d"), tTime)); + rva[0].key.t = L"d"; + rva[0].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%#d", tTime)); // day 01-31 - rva[1].key.t = _T("dd"); - rva[1].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%d"), tTime)); + rva[1].key.t = L"dd"; + rva[1].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%d", tTime)); // month 1-12 - rva[2].key.t = _T("m"); - rva[2].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%#m"), tTime)); + rva[2].key.t = L"m"; + rva[2].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%#m", tTime)); // month 01-12 - rva[3].key.t = _T("mm"); - rva[3].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%m"), tTime)); + rva[3].key.t = L"mm"; + rva[3].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%m", tTime)); // month text short - rva[4].key.t = _T("mon"); - rva[4].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%b"), tTime)); + rva[4].key.t = L"mon"; + rva[4].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%b", tTime)); // month text - rva[5].key.t = _T("month"); - rva[5].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%B"), tTime)); + rva[5].key.t = L"month"; + rva[5].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%B", tTime)); // year 01-99 - rva[6].key.t = _T("yy"); - rva[6].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%y"), tTime)); + rva[6].key.t = L"yy"; + rva[6].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%y", tTime)); // year 1901-9999 - rva[7].key.t = _T("yyyy"); - rva[7].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%Y"), tTime)); + rva[7].key.t = L"yyyy"; + rva[7].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%Y", tTime)); // weekday short - rva[8].key.t = _T("wday"); - rva[8].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%a"), tTime)); + rva[8].key.t = L"wday"; + rva[8].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%a", tTime)); // weekday - rva[9].key.t = _T("weekday"); - rva[9].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%A"), tTime)); + rva[9].key.t = L"weekday"; + rva[9].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%A", tTime)); // end of array rva[10].key.t = NULL; rva[10].value.t = NULL; TCHAR tszTemp[MAX_PATH], *ptszVarPath; if (g_Settings->pszLogDir[mir_tstrlen(g_Settings->pszLogDir) - 1] == '\\') { - mir_sntprintf(tszTemp, _T("%s%s"), g_Settings->pszLogDir, _T("%userid%.log")); + mir_sntprintf(tszTemp, L"%s%s", g_Settings->pszLogDir, L"%userid%.log"); ptszVarPath = tszTemp; } else ptszVarPath = g_Settings->pszLogDir; diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index afe24c34e7..e4ef46e543 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -401,7 +401,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam szFullName.Empty(); break; } - szFullName = CMString(cc->szText) + _T("\\") + szFullName; + szFullName = CMString(cc->szText) + L"\\" + szFullName; group = group->parent; } @@ -1111,7 +1111,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam CallService(MS_CLIST_CONTACTCHANGEGROUP, (WPARAM)contacto->hContact, contactn->groupId); else if (contacto->type == CLCIT_GROUP) { //dropee is a group TCHAR szNewName[120]; - mir_sntprintf(szNewName, _T("%s\\%s"), Clist_GroupGetName(contactn->groupId, NULL), contacto->szText); + mir_sntprintf(szNewName, L"%s\\%s", Clist_GroupGetName(contactn->groupId, NULL), contacto->szText); Clist_GroupRename(contacto->groupId, szNewName); } } diff --git a/src/mir_app/src/clcfiledrop.cpp b/src/mir_app/src/clcfiledrop.cpp index aadd459d60..382512016c 100644 --- a/src/mir_app/src/clcfiledrop.cpp +++ b/src/mir_app/src/clcfiledrop.cpp @@ -182,13 +182,13 @@ static void AddToFileList(TCHAR ***pppFiles, int *totalCount, const TCHAR *szFil HANDLE hFind; TCHAR szPath[MAX_PATH]; mir_tstrcpy(szPath, szFilename); - mir_tstrcat(szPath, _T("\\*")); + mir_tstrcat(szPath, L"\\*"); if (hFind = FindFirstFile(szPath, &fd)) { do { - if (!mir_tstrcmp(fd.cFileName, _T(".")) || !mir_tstrcmp(fd.cFileName, _T(".."))) + if (!mir_tstrcmp(fd.cFileName, L".") || !mir_tstrcmp(fd.cFileName, L"..")) continue; mir_tstrcpy(szPath, szFilename); - mir_tstrcat(szPath, _T("\\")); + mir_tstrcat(szPath, L"\\"); mir_tstrcat(szPath, fd.cFileName); AddToFileList(pppFiles, totalCount, szPath); } while (FindNextFile(hFind, &fd)); diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp index 407346a86a..c53da45fbe 100644 --- a/src/mir_app/src/clcitems.cpp +++ b/src/mir_app/src/clcitems.cpp @@ -707,7 +707,7 @@ void fnSaveStateAndRebuildList(HWND hwnd, ClcData *dat) group = contact->group; } - ClcContact *cc = cli.pfnAddInfoItemToGroup(group, saveInfo[i].contact.flags, _T("")); + ClcContact *cc = cli.pfnAddInfoItemToGroup(group, saveInfo[i].contact.flags, L""); *cc = saveInfo[i].contact; } diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp index b8cdb04f8f..fdeae935e2 100644 --- a/src/mir_app/src/clcutils.cpp +++ b/src/mir_app/src/clcutils.cpp @@ -32,7 +32,7 @@ extern HANDLE hHideInfoTipEvent; TCHAR* fnGetGroupCountsText(ClcData *dat, ClcContact *contact) { if (contact->type != CLCIT_GROUP || !(dat->exStyle & CLS_EX_SHOWGROUPCOUNTS)) - return _T(""); + return L""; ClcGroup *group = contact->group, *topgroup = group; int onlineCount = 0; @@ -60,10 +60,10 @@ TCHAR* fnGetGroupCountsText(ClcData *dat, ClcContact *contact) group->scanIndex++; } if (onlineCount == 0 && dat->exStyle & CLS_EX_HIDECOUNTSWHENEMPTY) - return _T(""); + return L""; static TCHAR szName[32]; - mir_sntprintf(szName, _T("(%u/%u)"), onlineCount, totalCount); + mir_sntprintf(szName, L"(%u/%u)", onlineCount, totalCount); return szName; } @@ -174,7 +174,7 @@ int fnHitTest(HWND hwnd, ClcData *dat, int testx, int testy, ClcContact **contac TCHAR *szCounts; szCounts = cli.pfnGetGroupCountsText(dat, hitcontact); if (szCounts[0]) { - GetTextExtentPoint32(hdc, _T(" "), 1, &textSize); + GetTextExtentPoint32(hdc, L" ", 1, &textSize); width += textSize.cx; SelectObject(hdc, dat->fontInfo[FONTID_GROUPCOUNTS].hFont); GetTextExtentPoint32(hdc, szCounts, (int)mir_tstrlen(szCounts), &textSize); @@ -417,11 +417,11 @@ void fnEndRename(HWND, ClcData *dat, int save) ClcContact *contact; if (cli.pfnGetRowByIndex(dat, dat->selection, &contact, NULL) != -1) { - if (mir_tstrcmp(contact->szText, text) && !_tcsstr(text, _T("\\"))) { + if (mir_tstrcmp(contact->szText, text) && !_tcsstr(text, L"\\")) { if (contact->type == CLCIT_GROUP) { if (contact->group->parent && contact->group->parent->parent) { TCHAR szFullName[256]; - mir_sntprintf(szFullName, _T("%s\\%s"), + mir_sntprintf(szFullName, L"%s\\%s", Clist_GroupGetName(contact->group->parent->groupId, NULL), text); Clist_GroupRename(contact->groupId, szFullName); } @@ -508,7 +508,7 @@ void fnBeginRenameSelection(HWND hwnd, ClcData *dat) POINT pt; cli.pfnCalcEipPosition(dat, contact, group, &pt); int h = cli.pfnGetRowHeight(dat, dat->selection); - dat->hwndRenameEdit = CreateWindow(_T("EDIT"), contact->szText, WS_CHILD | WS_BORDER | ES_AUTOHSCROLL, pt.x, pt.y, clRect.right - pt.x, h, hwnd, NULL, cli.hInst, NULL); + dat->hwndRenameEdit = CreateWindow(L"EDIT", contact->szText, WS_CHILD | WS_BORDER | ES_AUTOHSCROLL, pt.x, pt.y, clRect.right - pt.x, h, hwnd, NULL, cli.hInst, NULL); mir_subclassWindow(dat->hwndRenameEdit, RenameEditSubclassProc); SendMessage(dat->hwndRenameEdit, WM_SETFONT, (WPARAM)(contact->type == CLCIT_GROUP ? dat->fontInfo[FONTID_GROUPS].hFont : dat->fontInfo[FONTID_CONTACTS].hFont), 0); SendMessage(dat->hwndRenameEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN | EC_USEFONTINFO, 0); diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp index a903646839..720c4d0001 100644 --- a/src/mir_app/src/clistgroups.cpp +++ b/src/mir_app/src/clistgroups.cpp @@ -111,7 +111,7 @@ static INT_PTR CreateGroupInternal(MGROUP hParent, const TCHAR *ptszName) if (tmp == NULL) return NULL; - mir_sntprintf(newBaseName, _T("%s\\%s"), tmp->groupName+1, grpName); + mir_sntprintf(newBaseName, L"%s\\%s", tmp->groupName+1, grpName); } else _tcsncpy_s(newBaseName, grpName, _TRUNCATE); @@ -123,7 +123,7 @@ static INT_PTR CreateGroupInternal(MGROUP hParent, const TCHAR *ptszName) } else { for (int idCopy = 1; GroupNameExists(newName + 1, -1); idCopy++) - mir_sntprintf(newName + 1, _countof(newName) - 1, _T("%s (%d)"), newBaseName, idCopy); + mir_sntprintf(newName + 1, _countof(newName) - 1, L"%s (%d)", newBaseName, idCopy); } int newId = arByIds.getCount(); @@ -244,7 +244,7 @@ MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup) if (!_tcsncmp(pGroup->groupName+1, p->groupName+1, len) && p->groupName[len+1] == '\\' && _tcschr(p->groupName + len + 2, '\\') == NULL) { if (szNewParent[0]) - mir_sntprintf(szNewName, _T("%s\\%s"), szNewParent, p->groupName + len + 2); + mir_sntprintf(szNewName, L"%s\\%s", szNewParent, p->groupName + len + 2); else mir_tstrncpy(szNewName, p->groupName + len + 2, _countof(szNewName)); Clist_GroupRename(i + 1, szNewName); @@ -354,7 +354,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) CGroupInternal *p = arByIds[i]; if (!_tcsncmp(p->groupName+1, oldName, len) && p->groupName[len+1] == '\\' && _tcschr(p->groupName + len + 2, '\\') == NULL) { TCHAR szNewName[256]; - mir_sntprintf(szNewName, _T("%s\\%s"), szName, p->groupName + len + 2); + mir_sntprintf(szNewName, L"%s\\%s", szName, p->groupName + len + 2); RenameGroupWithMove(i, szNewName, 0); // luckily, child groups will never need reordering } } diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp index 0e452807de..1732c9943a 100644 --- a/src/mir_app/src/clistsettings.cpp +++ b/src/mir_app/src/clistsettings.cpp @@ -57,7 +57,7 @@ void fnCheckCacheItem(ClcCacheEntry *p) if (p->tszGroup == NULL) { p->tszGroup = db_get_tsa(p->hContact, "CList", "Group"); if (p->tszGroup == NULL) - p->tszGroup = mir_tstrdup(_T("")); + p->tszGroup = mir_tstrdup(L""); } if (p->bIsHidden == -1) diff --git a/src/mir_app/src/clisttray.cpp b/src/mir_app/src/clisttray.cpp index de2dae1621..abb54f5c9b 100644 --- a/src/mir_app/src/clisttray.cpp +++ b/src/mir_app/src/clisttray.cpp @@ -72,7 +72,7 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto) initcheck NULL; mir_cslock lck(trayLockCS); - TCHAR *szSeparator = _T("\n"); + TCHAR *szSeparator = L"\n"; if (szProto == NULL) { if (accounts.getCount() == 0) @@ -107,16 +107,16 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto) if (!tszTip.IsEmpty()) tszTip.AppendChar('\n'); if (hasTips()) { - tszTip.AppendFormat(_T("%-12.12s\t%s"), pa->tszAccountName, szStatus); + tszTip.AppendFormat(L"%-12.12s\t%s", pa->tszAccountName, szStatus); ptrT ProtoXStatus(sttGetXStatus(pa->szModuleName)); if (ProtoXStatus != NULL) { if (!tszTip.IsEmpty()) tszTip.AppendChar('\n'); - tszTip.AppendFormat(_T("%-24.24s\n"), ProtoXStatus); + tszTip.AppendFormat(L"%-24.24s\n", ProtoXStatus); } } - else tszTip.AppendFormat(_T("%s %s"), pa->tszAccountName, szStatus); + else tszTip.AppendFormat(L"%s %s", pa->tszAccountName, szStatus); } _tcsncpy_s(cli.szTip, MAX_TIP_SIZE, tszTip, _TRUNCATE); @@ -130,22 +130,22 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto) if (db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT)) { if (hasTips()) { if (ProtoXStatus != NULL) - mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%s%s%-12.12s\t%s%s%-24.24s"), szPrefix, szSeparator, pa->tszAccountName, szStatus, szSeparator, ProtoXStatus); + mir_sntprintf(cli.szTip, MAX_TIP_SIZE, L"%s%s%-12.12s\t%s%s%-24.24s", szPrefix, szSeparator, pa->tszAccountName, szStatus, szSeparator, ProtoXStatus); else - mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%s%s%-12.12s\t%s"), szPrefix, szSeparator, pa->tszAccountName, szStatus); + mir_sntprintf(cli.szTip, MAX_TIP_SIZE, L"%s%s%-12.12s\t%s", szPrefix, szSeparator, pa->tszAccountName, szStatus); } - else mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%s%s%s %s"), szPrefix, szSeparator, pa->tszAccountName, szStatus); + else mir_sntprintf(cli.szTip, MAX_TIP_SIZE, L"%s%s%s %s", szPrefix, szSeparator, pa->tszAccountName, szStatus); } else mir_tstrncpy(cli.szTip, szPrefix, MAX_TIP_SIZE); } else { if (hasTips()) { if (ProtoXStatus != NULL) - mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%-12.12s\t%s\n%-24.24s"), pa->tszAccountName, szStatus, ProtoXStatus); + mir_sntprintf(cli.szTip, MAX_TIP_SIZE, L"%-12.12s\t%s\n%-24.24s", pa->tszAccountName, szStatus, ProtoXStatus); else - mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%-12.12s\t%s"), pa->tszAccountName, szStatus); + mir_sntprintf(cli.szTip, MAX_TIP_SIZE, L"%-12.12s\t%s", pa->tszAccountName, szStatus); } - else mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%s %s"), pa->tszAccountName, szStatus); + else mir_sntprintf(cli.szTip, MAX_TIP_SIZE, L"%s %s", pa->tszAccountName, szStatus); } } } @@ -645,8 +645,8 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) MSG *msg = (MSG *)wParam; switch (msg->message) { case WM_CREATE: { - WM_TASKBARCREATED = RegisterWindowMessage(_T("TaskbarCreated")); - WM_TASKBARBUTTONCREATED = RegisterWindowMessage(_T("TaskbarButtonCreated")); + WM_TASKBARCREATED = RegisterWindowMessage(L"TaskbarCreated"); + WM_TASKBARBUTTONCREATED = RegisterWindowMessage(L"TaskbarButtonCreated"); PostMessage(msg->hwnd, TIM_CREATE, 0, 0); break; } diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 23890363a2..3ba4cbc915 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -242,7 +242,7 @@ int LoadCLUIModule(void) DBVARIANT dbv; TCHAR titleText[256]; - uMsgProcessProfile = RegisterWindowMessage(_T("Miranda::ProcessProfile")); + uMsgProcessProfile = RegisterWindowMessage(L"Miranda::ProcessProfile"); cli.pfnLoadCluiGlobalOpts(); HookEvent(ME_SYSTEM_MODULESLOADED, CluiModulesLoaded); @@ -301,7 +301,7 @@ int LoadCLUIModule(void) NULL, NULL, cli.hInst, NULL); if (db_get_b(NULL, "CList", "OnDesktop", 0)) { - HWND hProgMan = FindWindow(_T("Progman"), NULL); + HWND hProgMan = FindWindow(L"Progman", NULL); if (IsWindow(hProgMan)) SetParent(cli.hwndContactList, hProgMan); } @@ -412,7 +412,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (msg == uMsgProcessProfile) { TCHAR profile[MAX_PATH]; if (GlobalGetAtomName((ATOM)wParam, profile, _countof(profile))) { - int rc = mir_tstrcmpi(profile, VARST(_T("%miranda_userdata%\\%miranda_profilename%.dat"))) == 0; + int rc = mir_tstrcmpi(profile, VARST(L"%miranda_userdata%\\%miranda_profilename%.dat")) == 0; ReplyMessage(rc); if (rc) { ShowWindow(hwnd, SW_RESTORE); @@ -460,7 +460,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return FALSE; case M_CREATECLC: - cli.hwndContactTree = CreateWindow(_T(CLISTCONTROL_CLASS), _T(""), + cli.hwndContactTree = CreateWindow(_T(CLISTCONTROL_CLASS), L"", WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | CLS_CONTACTLIST | (db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0) @@ -994,7 +994,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM PROTOACCOUNT *pa; TCHAR tszName[64]; if ((pa = Proto_GetAccount(szProto)) != NULL) - mir_sntprintf(tszName, _T("%s "), pa->tszAccountName); + mir_sntprintf(tszName, L"%s ", pa->tszAccountName); else tszName[0] = 0; @@ -1005,7 +1005,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (showOpts & 4) { TCHAR* szStatus = cli.pfnGetStatusModeDescription(status, 0); if (!szStatus) - szStatus = _T(""); + szStatus = L""; GetTextExtentPoint32(dis->hDC, szStatus, (int)mir_tstrlen(szStatus), &textSize); TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, (int)mir_tstrlen(szStatus)); } diff --git a/src/mir_app/src/cluiservices.cpp b/src/mir_app/src/cluiservices.cpp index 867187129f..8163c22124 100644 --- a/src/mir_app/src/cluiservices.cpp +++ b/src/mir_app/src/cluiservices.cpp @@ -114,12 +114,12 @@ void fnCluiProtocolStatusChanged(int, const char*) TCHAR tszName[64]; PROTOACCOUNT *pa = Proto_GetAccount(cli.menuProtos[i].szProto); if (pa) - mir_sntprintf(tszName, _T("%s "), pa->tszAccountName); + mir_sntprintf(tszName, L"%s ", pa->tszAccountName); else tszName[0] = 0; if (showOpts & 4 && mir_tstrlen(tszName) < _countof(tszName) - 1) - mir_tstrcat(tszName, _T(" ")); + mir_tstrcat(tszName, L" "); GetTextExtentPoint32(hdc, tszName, (int)mir_tstrlen(tszName), &textSize); x += textSize.cx; x += GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room diff --git a/src/mir_app/src/database.cpp b/src/mir_app/src/database.cpp index 9c9265807a..6fa2ae5bf0 100644 --- a/src/mir_app/src/database.cpp +++ b/src/mir_app/src/database.cpp @@ -38,7 +38,7 @@ bool fileExist(const TCHAR *fname) if (*fname == 0) return false; - FILE *fp = _tfopen(fname, _T("r+")); + FILE *fp = _tfopen(fname, L"r+"); bool res = (fp != NULL); if (fp) fclose(fp); return res; @@ -56,13 +56,13 @@ static void fillProfileName(const TCHAR* ptszFileName) _tcsncpy_s(g_shortProfileName, p, _TRUNCATE); TCHAR *pos = _tcsrchr(g_shortProfileName, '.'); - if (mir_tstrcmpi(pos, _T(".dat")) == 0) + if (mir_tstrcmpi(pos, L".dat") == 0) *pos = 0; } bool IsInsideRootDir(TCHAR* profiledir, bool exact) { - VARST pfd(_T("%miranda_path%")); + VARST pfd(L"%miranda_path%"); if (exact) return mir_tstrcmpi(profiledir, pfd) == 0; @@ -73,10 +73,10 @@ bool IsInsideRootDir(TCHAR* profiledir, bool exact) int getProfilePath(TCHAR *buf, size_t) { TCHAR profiledir[MAX_PATH]; - GetPrivateProfileString(_T("Database"), _T("ProfileDir"), _T(""), profiledir, _countof(profiledir), mirandabootini); + GetPrivateProfileString(L"Database", L"ProfileDir", L"", profiledir, _countof(profiledir), mirandabootini); if (profiledir[0] == 0) - mir_tstrcpy(profiledir, _T("%miranda_path%\\Profiles")); + mir_tstrcpy(profiledir, L"%miranda_path%\\Profiles"); size_t len = PathToAbsoluteT(VARST(profiledir), buf); @@ -90,7 +90,7 @@ int getProfilePath(TCHAR *buf, size_t) int isValidProfileName(const TCHAR *name) { size_t len = mir_tstrlen(name) - 4; - return len > 0 && mir_tstrcmpi(&name[len], _T(".dat")) == 0; + return len > 0 && mir_tstrcmpi(&name[len], L".dat") == 0; } // returns 1 if the profile manager should be shown @@ -102,8 +102,8 @@ static bool showProfileManager(void) return 1; // wanna show it? - GetPrivateProfileString(_T("Database"), _T("ShowProfileMgr"), _T("never"), Mgr, _countof(Mgr), mirandabootini); - return (mir_tstrcmpi(Mgr, _T("yes")) == 0); + GetPrivateProfileString(L"Database", L"ShowProfileMgr", L"never", Mgr, _countof(Mgr), mirandabootini); + return (mir_tstrcmpi(Mgr, L"yes") == 0); } bool shouldAutoCreate(TCHAR *szProfile) @@ -112,21 +112,21 @@ bool shouldAutoCreate(TCHAR *szProfile) return false; TCHAR ac[32]; - GetPrivateProfileString(_T("Database"), _T("AutoCreate"), _T(""), ac, _countof(ac), mirandabootini); - return mir_tstrcmpi(ac, _T("yes")) == 0; + GetPrivateProfileString(L"Database", L"AutoCreate", L"", ac, _countof(ac), mirandabootini); + return mir_tstrcmpi(ac, L"yes") == 0; } static void getDefaultProfile(TCHAR *szProfile, size_t cch) { TCHAR defaultProfile[MAX_PATH]; - GetPrivateProfileString(_T("Database"), _T("DefaultProfile"), _T(""), defaultProfile, _countof(defaultProfile), mirandabootini); + GetPrivateProfileString(L"Database", L"DefaultProfile", L"", defaultProfile, _countof(defaultProfile), mirandabootini); if (defaultProfile[0] == 0) return; VARST res(defaultProfile); if (res) - mir_sntprintf(szProfile, cch, _T("%s\\%s\\%s%s"), g_profileDir, (TCHAR*)res, (TCHAR*)res, isValidProfileName(res) ? _T("") : _T(".dat")); + mir_sntprintf(szProfile, cch, L"%s\\%s\\%s%s", g_profileDir, (TCHAR*)res, (TCHAR*)res, isValidProfileName(res) ? L"" : L".dat"); else szProfile[0] = 0; } @@ -139,17 +139,17 @@ static void loadProfileByShortName(const TCHAR* src, TCHAR *szProfile, size_t cc TCHAR *p = _tcsrchr(buf, '\\'); if (p) ++p; else p = buf; if (!isValidProfileName(buf) && *p) - mir_tstrcat(buf, _T(".dat")); + mir_tstrcat(buf, L".dat"); TCHAR profileName[MAX_PATH], newProfileDir[MAX_PATH]; _tcsncpy_s(profileName, p, _TRUNCATE); if (!isValidProfileName(profileName) && *p) - mir_tstrcat(profileName, _T(".dat")); + mir_tstrcat(profileName, L".dat"); _tcsncpy_s(profileName, p, _TRUNCATE); p = _tcsrchr(profileName, '.'); if (p) *p = 0; - mir_sntprintf(newProfileDir, cch, _T("%s\\%s\\"), g_profileDir, profileName); + mir_sntprintf(newProfileDir, cch, L"%s\\%s\\", g_profileDir, profileName); PathToAbsoluteT(buf, szProfile, newProfileDir); if (_tcschr(buf, '\\')) { @@ -166,7 +166,7 @@ static void loadProfileByShortName(const TCHAR* src, TCHAR *szProfile, size_t cc void getProfileCmdLine(TCHAR *szProfile, size_t cch) { - LPCTSTR ptszProfileName = CmdLine_GetOption(_T("profile")); + LPCTSTR ptszProfileName = CmdLine_GetOption(L"profile"); if (ptszProfileName != NULL) loadProfileByShortName(ptszProfileName, szProfile, cch); } @@ -184,9 +184,9 @@ static void moveProfileDirProfiles(TCHAR *profiledir, BOOL isRootDir = TRUE) { TCHAR pfd[MAX_PATH]; if (isRootDir) - _tcsncpy_s(pfd, VARST(_T("%miranda_path%\\*.dat")), _TRUNCATE); + _tcsncpy_s(pfd, VARST(L"%miranda_path%\\*.dat"), _TRUNCATE); else - mir_sntprintf(pfd, _T("%s\\*.dat"), profiledir); + mir_sntprintf(pfd, L"%s\\*.dat", profiledir); WIN32_FIND_DATA ffd; HANDLE hFind = FindFirstFile(pfd, &ffd); @@ -196,23 +196,23 @@ static void moveProfileDirProfiles(TCHAR *profiledir, BOOL isRootDir = TRUE) TCHAR path[MAX_PATH], path2[MAX_PATH]; TCHAR* profile = mir_tstrdup(ffd.cFileName); c = _tcsrchr(profile, '.'); if (c) *c = 0; - mir_sntprintf(path, _T("%s\\%s"), pfd, ffd.cFileName); - mir_sntprintf(path2, _T("%s\\%s"), profiledir, profile); + mir_sntprintf(path, L"%s\\%s", pfd, ffd.cFileName); + mir_sntprintf(path2, L"%s\\%s", profiledir, profile); CreateDirectoryTreeT(path2); - mir_sntprintf(path2, _T("%s\\%s\\%s"), profiledir, profile, ffd.cFileName); + mir_sntprintf(path2, L"%s\\%s\\%s", profiledir, profile, ffd.cFileName); if (_taccess(path2, 0) == 0) { TCHAR buf[512]; mir_sntprintf(buf, TranslateT("Miranda is trying to upgrade your profile structure.\nIt cannot move profile %s to the new location %s\nBecause profile with this name already exists. Please resolve the issue manually."), path, path2); - MessageBox(NULL, buf, _T("Miranda NG"), MB_ICONERROR | MB_OK); + MessageBox(NULL, buf, L"Miranda NG", MB_ICONERROR | MB_OK); } else if (MoveFile(path, path2) == 0) { TCHAR buf[512]; mir_sntprintf(buf, TranslateT("Miranda is trying to upgrade your profile structure.\nIt cannot move profile %s to the new location %s automatically\nMost likely this is due to insufficient privileges. Please move profile manually."), path, path2); - MessageBox(NULL, buf, _T("Miranda NG"), MB_ICONERROR | MB_OK); + MessageBox(NULL, buf, L"Miranda NG", MB_ICONERROR | MB_OK); mir_free(profile); break; } @@ -240,18 +240,18 @@ static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * n if (bShowProfileManager || !reqfd) { TCHAR searchspec[MAX_PATH]; - mir_sntprintf(searchspec, _T("%s\\*.*"), profiledir); + mir_sntprintf(searchspec, L"%s\\*.*", profiledir); WIN32_FIND_DATA ffd; HANDLE hFind = FindFirstFile(searchspec, &ffd); if (hFind != INVALID_HANDLE_VALUE) { do { // make sure the first hit is actually a *.dat file - if (!(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || !mir_tstrcmp(ffd.cFileName, _T(".")) || !mir_tstrcmp(ffd.cFileName, _T(".."))) + if (!(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || !mir_tstrcmp(ffd.cFileName, L".") || !mir_tstrcmp(ffd.cFileName, L"..")) continue; TCHAR newProfile[MAX_PATH]; - mir_sntprintf(newProfile, _T("%s\\%s\\%s.dat"), profiledir, ffd.cFileName, ffd.cFileName); + mir_sntprintf(newProfile, L"%s\\%s\\%s.dat", profiledir, ffd.cFileName, ffd.cFileName); if (_taccess(newProfile, 0) != 0) continue; @@ -285,8 +285,8 @@ static int getProfileAutoRun(TCHAR *szProfile) return false; TCHAR Mgr[32]; - GetPrivateProfileString(_T("Database"), _T("ShowProfileMgr"), _T(""), Mgr, _countof(Mgr), mirandabootini); - if (mir_tstrcmpi(Mgr, _T("never"))) + GetPrivateProfileString(L"Database", L"ShowProfileMgr", L"", Mgr, _countof(Mgr), mirandabootini); + if (mir_tstrcmpi(Mgr, L"never")) return 0; return fileExist(szProfile) || shouldAutoCreate(szProfile); @@ -297,7 +297,7 @@ static int getProfile(TCHAR *szProfile, size_t cch) { getProfilePath(g_profileDir, _countof(g_profileDir)); if (IsInsideRootDir(g_profileDir, true)) - if (WritePrivateProfileString(_T("Database"), _T("ProfileDir"), _T(""), mirandabootini)) + if (WritePrivateProfileString(L"Database", L"ProfileDir", L"", mirandabootini)) getProfilePath(g_profileDir, _countof(g_profileDir)); getDefaultProfile(szProfile, cch); @@ -312,7 +312,7 @@ static int getProfile(TCHAR *szProfile, size_t cch) } PROFILEMANAGERDATA pd = { 0 }; - if (CmdLine_GetOption(_T("ForceShowPM"))) { + if (CmdLine_GetOption(L"ForceShowPM")) { LBL_Show: pd.ptszProfile = szProfile; pd.ptszProfileDir = g_profileDir; @@ -454,7 +454,7 @@ static BOOL CALLBACK EnumMirandaWindows(HWND hwnd, LPARAM lParam) TCHAR classname[256]; ENUMMIRANDAWINDOW *x = (ENUMMIRANDAWINDOW *)lParam; DWORD_PTR res = 0; - if (GetClassName(hwnd, classname, _countof(classname)) && mir_tstrcmp(_T("Miranda"), classname) == 0) { + if (GetClassName(hwnd, classname, _countof(classname)) && mir_tstrcmp(L"Miranda", classname) == 0) { if (SendMessageTimeout(hwnd, x->msg, (WPARAM)x->aPath, 0, SMTO_ABORTIFHUNG, 100, &res) && res) { x->found++; return FALSE; @@ -467,7 +467,7 @@ static int FindMirandaForProfile(TCHAR *szProfile) { ENUMMIRANDAWINDOW x = { 0 }; x.profile = szProfile; - x.msg = RegisterWindowMessage(_T("Miranda::ProcessProfile")); + x.msg = RegisterWindowMessage(L"Miranda::ProcessProfile"); x.aPath = GlobalAddAtom(szProfile); EnumWindows(EnumMirandaWindows, (LPARAM)&x); GlobalDeleteAtom(x.aPath); @@ -482,7 +482,7 @@ static TCHAR tszNoSuitableDriver[] = LPGENT("Miranda was unable to open '%s'\nTh int LoadDatabaseModule(void) { TCHAR szProfile[MAX_PATH]; - PathToAbsoluteT(_T("."), szProfile); + PathToAbsoluteT(L".", szProfile); _tchdir(szProfile); szProfile[0] = 0; diff --git a/src/mir_app/src/dbini.cpp b/src/mir_app/src/dbini.cpp index b45e520ac8..855c624fce 100644 --- a/src/mir_app/src/dbini.cpp +++ b/src/mir_app/src/dbini.cpp @@ -38,12 +38,12 @@ static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg, UINT message, WPARAM wPa TCHAR szSecurity[11]; const TCHAR *pszSecurityInfo; - GetPrivateProfileString(_T("AutoExec"), _T("Warn"), _T("notsafe"), szSecurity, _countof(szSecurity), mirandabootini); - if (!mir_tstrcmpi(szSecurity, _T("all"))) + GetPrivateProfileString(L"AutoExec", L"Warn", L"notsafe", szSecurity, _countof(szSecurity), mirandabootini); + if (!mir_tstrcmpi(szSecurity, L"all")) pszSecurityInfo = LPGENT("Security systems to prevent malicious changes are in place and you will be warned before every change that is made."); - else if (!mir_tstrcmpi(szSecurity, _T("onlyunsafe"))) + else if (!mir_tstrcmpi(szSecurity, L"onlyunsafe")) pszSecurityInfo = LPGENT("Security systems to prevent malicious changes are in place and you will be warned before changes that are known to be unsafe."); - else if (!mir_tstrcmpi(szSecurity, _T("none"))) + else if (!mir_tstrcmpi(szSecurity, L"none")) pszSecurityInfo = LPGENT("Security systems to prevent malicious changes have been disabled. You will receive no further warnings."); else pszSecurityInfo = NULL; if (pszSecurityInfo) SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateTS(pszSecurityInfo)); @@ -56,7 +56,7 @@ static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg, UINT message, WPARAM wPa { TCHAR szPath[MAX_PATH]; GetDlgItemText(hwndDlg, IDC_ININAME, szPath, _countof(szPath)); - ShellExecute(hwndDlg, _T("open"), szPath, NULL, NULL, SW_SHOW); + ShellExecute(hwndDlg, L"open", szPath, NULL, NULL, SW_SHOW); } break; @@ -232,7 +232,7 @@ static int EnumSettingsForDeletion(const char *szSetting, LPARAM param) static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsafeSections, int secur, bool secFN) { - FILE *fp = _tfopen(szIniPath, _T("rt")); + FILE *fp = _tfopen(szIniPath, L"rt"); if (fp == NULL) return; @@ -437,22 +437,22 @@ static void DoAutoExec(void) TCHAR szUse[7], szIniPath[MAX_PATH], szFindPath[MAX_PATH]; TCHAR buf[2048], szSecurity[11], szOverrideSecurityFilename[MAX_PATH], szOnCreateFilename[MAX_PATH]; - GetPrivateProfileString(_T("AutoExec"), _T("Use"), _T("prompt"), szUse, _countof(szUse), mirandabootini); - if (!mir_tstrcmpi(szUse, _T("no"))) return; - GetPrivateProfileString(_T("AutoExec"), _T("Safe"), _T("CLC Icons CLUI CList SkinSounds"), buf, _countof(buf), mirandabootini); + GetPrivateProfileString(L"AutoExec", L"Use", L"prompt", szUse, _countof(szUse), mirandabootini); + if (!mir_tstrcmpi(szUse, L"no")) return; + GetPrivateProfileString(L"AutoExec", L"Safe", L"CLC Icons CLUI CList SkinSounds", buf, _countof(buf), mirandabootini); ptrA szSafeSections(mir_t2a(buf)); - GetPrivateProfileString(_T("AutoExec"), _T("Unsafe"), _T("AIM Facebook GG ICQ IRC JABBER MRA MSN SKYPE Tlen TWITTER VKontakte XFire"), buf, _countof(buf), mirandabootini); + GetPrivateProfileString(L"AutoExec", L"Unsafe", L"AIM Facebook GG ICQ IRC JABBER MRA MSN SKYPE Tlen TWITTER VKontakte XFire", buf, _countof(buf), mirandabootini); ptrA szUnsafeSections(mir_t2a(buf)); - GetPrivateProfileString(_T("AutoExec"), _T("Warn"), _T("notsafe"), szSecurity, _countof(szSecurity), mirandabootini); + GetPrivateProfileString(L"AutoExec", L"Warn", L"notsafe", szSecurity, _countof(szSecurity), mirandabootini); int secur = 0; - if (!mir_tstrcmpi(szSecurity, _T("none"))) secur = 0; - else if (!mir_tstrcmpi(szSecurity, _T("notsafe"))) secur = 1; - else if (!mir_tstrcmpi(szSecurity, _T("onlyunsafe"))) secur = 2; + if (!mir_tstrcmpi(szSecurity, L"none")) secur = 0; + else if (!mir_tstrcmpi(szSecurity, L"notsafe")) secur = 1; + else if (!mir_tstrcmpi(szSecurity, L"onlyunsafe")) secur = 2; - GetPrivateProfileString(_T("AutoExec"), _T("OverrideSecurityFilename"), _T(""), szOverrideSecurityFilename, _countof(szOverrideSecurityFilename), mirandabootini); - GetPrivateProfileString(_T("AutoExec"), _T("OnCreateFilename"), _T(""), szOnCreateFilename, _countof(szOnCreateFilename), mirandabootini); - GetPrivateProfileString(_T("AutoExec"), _T("Glob"), _T("autoexec_*.ini"), szFindPath, _countof(szFindPath), mirandabootini); + GetPrivateProfileString(L"AutoExec", L"OverrideSecurityFilename", L"", szOverrideSecurityFilename, _countof(szOverrideSecurityFilename), mirandabootini); + GetPrivateProfileString(L"AutoExec", L"OnCreateFilename", L"", szOnCreateFilename, _countof(szOnCreateFilename), mirandabootini); + GetPrivateProfileString(L"AutoExec", L"Glob", L"autoexec_*.ini", szFindPath, _countof(szFindPath), mirandabootini); if (g_bDbCreated && szOnCreateFilename[0]) { PathToAbsoluteT(VARST(szOnCreateFilename), szIniPath); @@ -475,8 +475,8 @@ static void DoAutoExec(void) do { bool secFN = mir_tstrcmpi(fd.cFileName, szOverrideSecurityFilename) == 0; - mir_sntprintf(szIniPath, _T("%s%s"), szFindPath, fd.cFileName); - if (!mir_tstrcmpi(szUse, _T("prompt")) && !secFN) { + mir_sntprintf(szIniPath, L"%s%s", szFindPath, fd.cFileName); + if (!mir_tstrcmpi(szUse, L"prompt") && !secFN) { int result = DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_INSTALLINI), NULL, InstallIniDlgProc, (LPARAM)szIniPath); if (result == IDC_NOTOALL) break; if (result == IDCANCEL) continue; @@ -488,10 +488,10 @@ static void DoAutoExec(void) DeleteFile(szIniPath); else { TCHAR szOnCompletion[8]; - GetPrivateProfileString(_T("AutoExec"), _T("OnCompletion"), _T("recycle"), szOnCompletion, _countof(szOnCompletion), mirandabootini); - if (!mir_tstrcmpi(szOnCompletion, _T("delete"))) + GetPrivateProfileString(L"AutoExec", L"OnCompletion", L"recycle", szOnCompletion, _countof(szOnCompletion), mirandabootini); + if (!mir_tstrcmpi(szOnCompletion, L"delete")) DeleteFile(szIniPath); - else if (!mir_tstrcmpi(szOnCompletion, _T("recycle"))) { + else if (!mir_tstrcmpi(szOnCompletion, L"recycle")) { SHFILEOPSTRUCT shfo = { 0 }; shfo.wFunc = FO_DELETE; shfo.pFrom = szIniPath; @@ -499,15 +499,15 @@ static void DoAutoExec(void) shfo.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOF_ALLOWUNDO; SHFileOperation(&shfo); } - else if (!mir_tstrcmpi(szOnCompletion, _T("rename"))) { + else if (!mir_tstrcmpi(szOnCompletion, L"rename")) { TCHAR szRenamePrefix[MAX_PATH], szNewPath[MAX_PATH]; - GetPrivateProfileString(_T("AutoExec"), _T("RenamePrefix"), _T("done_"), szRenamePrefix, _countof(szRenamePrefix), mirandabootini); + GetPrivateProfileString(L"AutoExec", L"RenamePrefix", L"done_", szRenamePrefix, _countof(szRenamePrefix), mirandabootini); mir_tstrcpy(szNewPath, szFindPath); mir_tstrcat(szNewPath, szRenamePrefix); mir_tstrcat(szNewPath, fd.cFileName); MoveFile(szIniPath, szNewPath); } - else if (!mir_tstrcmpi(szOnCompletion, _T("ask"))) + else if (!mir_tstrcmpi(szOnCompletion, L"ask")) DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_INIIMPORTDONE), NULL, IniImportDoneDlgProc, (LPARAM)szIniPath); } } @@ -537,7 +537,7 @@ int InitIni(void) DoAutoExec(); TCHAR szMirandaDir[MAX_PATH]; - PathToAbsoluteT(_T("."), szMirandaDir); + PathToAbsoluteT(L".", szMirandaDir); hIniChangeNotification = FindFirstChangeNotification(szMirandaDir, 0, FILE_NOTIFY_CHANGE_FILE_NAME); if (hIniChangeNotification != INVALID_HANDLE_VALUE) { CreateServiceFunction("DB/Ini/CheckImportNow", CheckIniImportNow); diff --git a/src/mir_app/src/dbutils.cpp b/src/mir_app/src/dbutils.cpp index 093553c5a8..d7a958004f 100644 --- a/src/mir_app/src/dbutils.cpp +++ b/src/mir_app/src/dbutils.cpp @@ -120,21 +120,21 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam) CMString nick, text; if (tszFirst || tszLast) { - nick.AppendFormat(_T("%s %s"), tszFirst, tszLast); + nick.AppendFormat(L"%s %s", tszFirst, tszLast); nick.Trim(); } if (tszEmail) { if (!nick.IsEmpty()) - nick.Append(_T(", ")); + nick.Append(L", "); nick.Append(tszEmail); } if (uin != 0) { if (!nick.IsEmpty()) - nick.Append(_T(", ")); - nick.AppendFormat(_T("%d"), uin); + nick.Append(L", "); + nick.AppendFormat(L"%d", uin); } if (!nick.IsEmpty()) - nick = _T("(") + nick + _T(")"); + nick = L"(" + nick + L")"; if (dbei->eventType == EVENTTYPE_AUTHREQUEST) { ptrT tszReason(getEventString(dbei, buf)); @@ -154,9 +154,9 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam) ptrT tszUin(getEventString(dbei, buf)); ptrT tszNick(getEventString(dbei, buf)); if (tszNick && *tszNick) - text.AppendFormat(_T("\"%s\" "), tszNick); + text.AppendFormat(L"\"%s\" ", tszNick); if (tszUin && *tszUin) - text.AppendFormat(_T("<%s>; "), tszUin); + text.AppendFormat(L"<%s>; ", tszUin); } return (egt->datatype == DBVT_WCHAR) ? (INT_PTR)mir_tstrdup(text) : (INT_PTR)mir_t2a(text); } diff --git a/src/mir_app/src/enterstring.cpp b/src/mir_app/src/enterstring.cpp index 1a54815172..09503a08d8 100644 --- a/src/mir_app/src/enterstring.cpp +++ b/src/mir_app/src/enterstring.cpp @@ -63,7 +63,7 @@ static void ComboLoadRecentStrings(HWND hwndDlg, EnterStringFormParam *pForm) } if (!SendDlgItemMessage(hwndDlg, pForm->idcControl, CB_GETCOUNT, 0, 0)) - SendDlgItemMessage(hwndDlg, pForm->idcControl, CB_ADDSTRING, 0, (LPARAM)_T("")); + SendDlgItemMessage(hwndDlg, pForm->idcControl, CB_ADDSTRING, 0, (LPARAM)L""); } static void ComboAddRecentString(HWND hwndDlg, EnterStringFormParam *pForm) @@ -77,7 +77,7 @@ static void ComboAddRecentString(HWND hwndDlg, EnterStringFormParam *pForm) int id; SendDlgItemMessage(hwndDlg, pForm->idcControl, CB_ADDSTRING, 0, (LPARAM)string); - if ((id = SendDlgItemMessage(hwndDlg, pForm->idcControl, CB_FINDSTRING, (WPARAM)-1, (LPARAM)_T(""))) != CB_ERR) + if ((id = SendDlgItemMessage(hwndDlg, pForm->idcControl, CB_FINDSTRING, (WPARAM)-1, (LPARAM)L"")) != CB_ERR) SendDlgItemMessage(hwndDlg, pForm->idcControl, CB_DELETESTRING, id, 0); id = db_get_b(NULL, pForm->szModuleName, pForm->szDataPrefix, 0); diff --git a/src/mir_app/src/extraicons.cpp b/src/mir_app/src/extraicons.cpp index bdaa2d746f..03efd88a84 100644 --- a/src/mir_app/src/extraicons.cpp +++ b/src/mir_app/src/extraicons.cpp @@ -420,7 +420,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterIcolib(const char *name, const ch // Found one, now merge it if (mir_tstrcmpi(extra->getDescription(), desc)) { CMString newDesc = extra->getDescription(); - newDesc += _T(" / "); + newDesc += L" / "; newDesc += desc; extra->setDescription(newDesc.c_str()); } diff --git a/src/mir_app/src/filter.cpp b/src/mir_app/src/filter.cpp index a51009897b..1470314864 100644 --- a/src/mir_app/src/filter.cpp +++ b/src/mir_app/src/filter.cpp @@ -85,13 +85,13 @@ void AddDialogString(HWND hWndDlg, const PageHash key) TCHAR szClass[64]; GetClassName(hWndDlg, szClass, _countof(szClass)); - if (mir_tstrcmpi(szClass, _T("SysTreeView32")) == 0) { + if (mir_tstrcmpi(szClass, L"SysTreeView32") == 0) { HTREEITEM hItem = TreeView_GetRoot(hWndDlg); AddTreeViewNodes(hWndDlg, key, hItem); return; } - if (mir_tstrcmpi(szClass, _T("listbox")) == 0) { + if (mir_tstrcmpi(szClass, L"listbox") == 0) { if (GetWindowStyle(hWndDlg) & LBS_HASSTRINGS) { int count = ListBox_GetCount(hWndDlg); for (int i=0; i < count; i++) { @@ -107,7 +107,7 @@ void AddDialogString(HWND hWndDlg, const PageHash key) return; } - if (mir_tstrcmpi(szClass, _T("SysListView32")) == 0) { + if (mir_tstrcmpi(szClass, L"SysListView32") == 0) { int count = ListView_GetItemCount(hWndDlg); for (int i=0; i < count; i++) { title[0] = 0; //safety @@ -119,7 +119,7 @@ void AddDialogString(HWND hWndDlg, const PageHash key) return; } - if (mir_tstrcmpi(szClass, _T("combobox")) == 0) { + if (mir_tstrcmpi(szClass, L"combobox") == 0) { if (GetWindowStyle(hWndDlg) & CBS_HASSTRINGS) { int count = ComboBox_GetCount(hWndDlg); for (int i=0; i < count; i++) { diff --git a/src/mir_app/src/findadd.cpp b/src/mir_app/src/findadd.cpp index 582dd53c2a..0cad9fcd93 100644 --- a/src/mir_app/src/findadd.cpp +++ b/src/mir_app/src/findadd.cpp @@ -354,7 +354,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP int partWidth[3]; partWidth[0] = textSize.cx; - GetTextExtentPoint32(hdc, _T("01234567890123456789"), 20, &textSize); + GetTextExtentPoint32(hdc, L"01234567890123456789", 20, &textSize); partWidth[0] += textSize.cx; ReleaseDC(GetDlgItem(hwndDlg, IDC_STATUSBAR), hdc); partWidth[1] = partWidth[0] + 150; diff --git a/src/mir_app/src/headerbar.cpp b/src/mir_app/src/headerbar.cpp index f372781bf6..1230ca922f 100644 --- a/src/mir_app/src/headerbar.cpp +++ b/src/mir_app/src/headerbar.cpp @@ -72,7 +72,7 @@ int LoadHeaderbarModule() { WNDCLASSEX wc = { 0 }; wc.cbSize = sizeof(wc); - wc.lpszClassName = _T("MHeaderbarCtrl"); + wc.lpszClassName = L"MHeaderbarCtrl"; wc.lpfnWndProc = MHeaderbarWndProc; wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.cbWndExtra = sizeof(MHeaderbarCtrl*); diff --git a/src/mir_app/src/hotkey_opts.cpp b/src/mir_app/src/hotkey_opts.cpp index 1db90d6693..cec2a06d5f 100644 --- a/src/mir_app/src/hotkey_opts.cpp +++ b/src/mir_app/src/hotkey_opts.cpp @@ -43,7 +43,7 @@ static TCHAR* sttHokeyVkToName(WORD vkKey) case VK_NUMLOCK: case VK_CAPITAL: case VK_SCROLL: - return _T(""); + return L""; case VK_BROWSER_BACK: return TranslateT("Browser: Back"); case VK_BROWSER_FORWARD: @@ -101,11 +101,11 @@ static TCHAR* sttHokeyVkToName(WORD vkKey) void HotkeyToName(TCHAR *buf, int size, BYTE shift, BYTE key) { - mir_sntprintf(buf, size, _T("%s%s%s%s%s"), - (shift & HOTKEYF_CONTROL) ? TranslateT("Ctrl + ") : _T(""), - (shift & HOTKEYF_ALT) ? TranslateT("Alt + ") : _T(""), - (shift & HOTKEYF_SHIFT) ? TranslateT("Shift + ") : _T(""), - (shift & HOTKEYF_EXT) ? TranslateT("Win + ") : _T(""), + mir_sntprintf(buf, size, L"%s%s%s%s%s", + (shift & HOTKEYF_CONTROL) ? TranslateT("Ctrl + ") : L"", + (shift & HOTKEYF_ALT) ? TranslateT("Alt + ") : L"", + (shift & HOTKEYF_SHIFT) ? TranslateT("Shift + ") : L"", + (shift & HOTKEYF_EXT) ? TranslateT("Win + ") : L"", sttHokeyVkToName(key)); } diff --git a/src/mir_app/src/hotkeys.cpp b/src/mir_app/src/hotkeys.cpp index 2dfaaed5fe..6d3946840d 100644 --- a/src/mir_app/src/hotkeys.cpp +++ b/src/mir_app/src/hotkeys.cpp @@ -357,13 +357,13 @@ int LoadSkinHotkeys(void) wcl.hCursor = LoadCursor(NULL, IDC_ARROW); wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH); wcl.lpszMenuName = NULL; - wcl.lpszClassName = _T("MirandaHotkeyHostWnd"); + wcl.lpszClassName = L"MirandaHotkeyHostWnd"; wcl.hIconSm = NULL; RegisterClassEx(&wcl); g_pid = GetCurrentProcessId(); - g_hwndHotkeyHost = CreateWindow(_T("MirandaHotkeyHostWnd"), NULL, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, g_hInst, NULL); + g_hwndHotkeyHost = CreateWindow(L"MirandaHotkeyHostWnd", NULL, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, g_hInst, NULL); SetWindowPos(g_hwndHotkeyHost, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOSENDCHANGING | SWP_HIDEWINDOW); hhkKeyboard = SetWindowsHookEx(WH_KEYBOARD, sttKeyboardProc, NULL, hMainThreadId); diff --git a/src/mir_app/src/icolib.cpp b/src/mir_app/src/icolib.cpp index d25898780f..ec21467e84 100644 --- a/src/mir_app/src/icolib.cpp +++ b/src/mir_app/src/icolib.cpp @@ -352,7 +352,7 @@ IconSourceItem* GetIconSourceItemFromPath(const TCHAR *path, int cxIcon, int cyI IconSourceItem* CreateStaticIconSourceItem(int cxIcon, int cyIcon) { TCHAR tszName[100]; - mir_sntprintf(tszName, _T("*StaticIcon_%d"), iStaticCount++); + mir_sntprintf(tszName, L"*StaticIcon_%d", iStaticCount++); IconSourceItemKey key = { IconSourceFile_Get(tszName, false), 0, cxIcon, cyIcon }; IconSourceItem *newItem = new IconSourceItem(key); diff --git a/src/mir_app/src/keyboard.cpp b/src/mir_app/src/keyboard.cpp index 83c1d00ec2..576e239747 100644 --- a/src/mir_app/src/keyboard.cpp +++ b/src/mir_app/src/keyboard.cpp @@ -56,35 +56,35 @@ int InitClistHotKeys(void) shk.dwFlags = HKD_TCHAR; shk.ptszDescription = LPGENT("Show/Hide contact list"); shk.pszName = "ShowHide"; - shk.ptszSection = _T("Main"); + shk.ptszSection = L"Main"; shk.pszService = "CLIST/HK/SHOWHIDE"; shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'A'); Hotkey_Register(&shk); shk.ptszDescription = LPGENT("Read message"); shk.pszName = "ReadMessage"; - shk.ptszSection = _T("Main"); + shk.ptszSection = L"Main"; shk.pszService = "CLIST/HK/Read"; shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'I'); Hotkey_Register(&shk); shk.ptszDescription = LPGENT("Open Options page"); shk.pszName = "ShowOptions"; - shk.ptszSection = _T("Main"); + shk.ptszSection = L"Main"; shk.pszService = "CLIST/HK/Opts"; shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'O') | HKF_MIRANDA_LOCAL; Hotkey_Register(&shk); shk.ptszDescription = LPGENT("Open logging options"); shk.pszName = "ShowLogOptions"; - shk.ptszSection = _T("Main"); + shk.ptszSection = L"Main"; shk.pszService = "Netlib/Log/Win"; shk.DefHotKey = 0; Hotkey_Register(&shk); shk.ptszDescription = LPGENT("Open 'Find user' dialog"); shk.pszName = "FindUsers"; - shk.ptszSection = _T("Main"); + shk.ptszSection = L"Main"; shk.pszService = "FindAdd/FindAddCommand"; shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'F') | HKF_MIRANDA_LOCAL; Hotkey_Register(&shk); diff --git a/src/mir_app/src/langpack.cpp b/src/mir_app/src/langpack.cpp index dec933cbe4..c418707a34 100644 --- a/src/mir_app/src/langpack.cpp +++ b/src/mir_app/src/langpack.cpp @@ -37,7 +37,7 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam) ptrT langpack(db_get_tsa(NULL, "Langpack", "Current")); TCHAR tszFullPath[MAX_PATH]; - PathToAbsoluteT(_T("\\Languages\\langpack_*.txt"), tszFullPath); + PathToAbsoluteT(L"\\Languages\\langpack_*.txt", tszFullPath); BOOL fPackFound = FALSE; WIN32_FIND_DATA wfd; @@ -46,7 +46,7 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam) do { if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; /* get data */ - PathToAbsoluteT(_T("\\Languages\\"), tszFullPath); + PathToAbsoluteT(L"\\Languages\\", tszFullPath); mir_tstrcat(tszFullPath, wfd.cFileName); LANGPACK_INFO pack; @@ -69,14 +69,14 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam) if (callback != NULL) { LANGPACK_INFO pack; pack.Locale = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT); - mir_tstrcpy(pack.tszLanguage, _T("English")); + mir_tstrcpy(pack.tszLanguage, L"English"); pack.szAuthors = "Miranda NG Development Team"; pack.szAuthorEmail = "project-info@miranda-ng.org"; DWORD v = CallService(MS_SYSTEM_GETVERSION, 0, 0); pack.szLastModifiedUsing.Format("%d.%d.%d", ((v >> 24) & 0xFF), ((v >> 16) & 0xFF), ((v >> 8) & 0xFF)); /* file date */ if (GetModuleFileName(NULL, pack.tszFullPath, _countof(pack.tszFullPath))) { - mir_tstrcpy(pack.tszFileName, _T("default")); + mir_tstrcpy(pack.tszFileName, L"default"); HANDLE hFile = CreateFile(pack.tszFileName, 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); if (hFile != INVALID_HANDLE_VALUE) { GetFileTime(hFile, NULL, NULL, &pack.ftFileDate); diff --git a/src/mir_app/src/lpopts.cpp b/src/mir_app/src/lpopts.cpp index 2d2091e078..d34dc23152 100644 --- a/src/mir_app/src/lpopts.cpp +++ b/src/mir_app/src/lpopts.cpp @@ -43,12 +43,12 @@ static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack) /* add some note if its incompatible */ if (szLanguageName[0] && szContryName[0]) { - mir_sntprintf(szLocaleName, _T("%s (%s)"), TranslateTS(szLanguageName), TranslateTS(szContryName)); + mir_sntprintf(szLocaleName, L"%s (%s)", TranslateTS(szLanguageName), TranslateTS(szContryName)); if (!IsValidLocale(pack->Locale, LCID_INSTALLED)) { TCHAR *pszIncompat; pszIncompat = TranslateT("(incompatible)"); szLocaleName[_countof(szLocaleName) - mir_tstrlen(pszIncompat) - 1] = 0; - mir_tstrcat(mir_tstrcat(szLocaleName, _T(" ")), pszIncompat); + mir_tstrcat(mir_tstrcat(szLocaleName, L" "), pszIncompat); } SetDlgItemText(hwndDlg, IDC_LANGLOCALE, szLocaleName); } @@ -77,7 +77,7 @@ static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack, WPARAM wParam, LPARAM) /* insert */ TCHAR tszName[512]; - mir_sntprintf(tszName, _T("%s [%s]"), + mir_sntprintf(tszName, L"%s [%s]", TranslateTS(pack->tszLanguage), pack->flags & LPF_DEFAULT ? TranslateT("built-in") : pack->tszFileName); UINT message = pack->flags & LPF_DEFAULT ? CB_INSERTSTRING : CB_ADDSTRING; diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index 0661fbcd48..cfd1447b66 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -928,7 +928,7 @@ void RebuildMenuOrder(void) TCHAR buf[256], hotkeyName[100]; WORD hotKey = GetHotkeyValue(statusHotkeys[j]); HotkeyToName(hotkeyName, _countof(hotkeyName), HIBYTE(hotKey), LOBYTE(hotKey)); - mir_sntprintf(buf, _T("%s\t%s"), cli.pfnGetStatusModeDescription(statusModeList[j], 0), hotkeyName); + mir_sntprintf(buf, L"%s\t%s", cli.pfnGetStatusModeDescription(statusModeList[j], 0), hotkeyName); mi.name.t = buf; hStatusMainMenuHandles[j] = Menu_AddItem(hStatusMenuObject, &mi, smep); @@ -958,7 +958,7 @@ static int sttRebuildHotkeys(WPARAM, LPARAM) TCHAR buf[256], hotkeyName[100]; WORD hotKey = GetHotkeyValue(statusHotkeys[j]); HotkeyToName(hotkeyName, _countof(hotkeyName), HIBYTE(hotKey), LOBYTE(hotKey)); - mir_sntprintf(buf, _T("%s\t%s"), cli.pfnGetStatusModeDescription(statusModeList[j], 0), hotkeyName); + mir_sntprintf(buf, L"%s\t%s", cli.pfnGetStatusModeDescription(statusModeList[j], 0), hotkeyName); Menu_ModifyItem(hStatusMainMenuHandles[j], buf); hStatusMainMenuHandles[j]->hotKey = MAKELONG(HIBYTE(hotKey), LOBYTE(hotKey)); @@ -1145,7 +1145,7 @@ void InitCustomMenus(void) CreateServiceFunction(MS_CLIST_HKSTATUS, HotkeySetStatus); HOTKEYDESC hkd = { sizeof(hkd) }; - hkd.ptszSection = _T("Status"); + hkd.ptszSection = L"Status"; hkd.dwFlags = HKD_TCHAR; for (int i = 0; i < _countof(statusHotkeys); i++) { char szName[30]; diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp index f5348f8b43..6245ae2a13 100644 --- a/src/mir_app/src/menu_options.cpp +++ b/src/mir_app/src/menu_options.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "genmenu.h" #include "plugins.h" -#define STR_SEPARATOR _T("-----------------------------------") +#define STR_SEPARATOR L"-----------------------------------" extern bool bIconsDisabled; extern int DefaultImageListColorDepth; @@ -94,9 +94,9 @@ class CGenMenuOptionsPage : public CDlgBase if (iod->name != NULL && iod->defname != NULL && mir_tstrcmp(iod->name, iod->defname) != 0) ptszCustomName = iod->name; else - ptszCustomName = _T(""); + ptszCustomName = L""; - CMString tszValue(FORMAT, _T("%d;%d;%S;%s"), visible, runtimepos, pszParent, ptszCustomName); + CMString tszValue(FORMAT, L"%d;%d;%S;%s", visible, runtimepos, pszParent, ptszCustomName); db_set_ts(NULL, szModule, menuItemName, tszValue); if (pimi->mi.flags & CMIF_CUSTOM) diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp index e2bb5df76a..b03cec352a 100644 --- a/src/mir_app/src/menu_utils.cpp +++ b/src/mir_app/src/menu_utils.cpp @@ -898,7 +898,7 @@ static int sttDumpItem(TMO_IntMenuItem *pmi, void *szModule) bin2hex(&pmi->mi.uid, sizeof(pmi->mi.uid), menuItemName); int bVisible = (pmi->mi.flags & CMIF_HIDDEN) == 0; - const TCHAR *ptszName = (pmi->ptszCustomName != NULL) ? pmi->ptszCustomName : _T(""); + const TCHAR *ptszName = (pmi->ptszCustomName != NULL) ? pmi->ptszCustomName : L""; char szRootUid[33]; if (pmi->mi.root == NULL) @@ -906,7 +906,7 @@ static int sttDumpItem(TMO_IntMenuItem *pmi, void *szModule) else bin2hex(&pmi->mi.root->mi.uid, sizeof(MUUID), szRootUid); - CMString szNewValue(FORMAT, _T("%d;%d;%S;%s"), bVisible, pmi->mi.position, szRootUid, ptszName); + CMString szNewValue(FORMAT, L"%d;%d;%S;%s", bVisible, pmi->mi.position, szRootUid, ptszName); db_set_ts(NULL, (char*)szModule, menuItemName, szNewValue); Netlib_Logf(NULL, "MENU[%s] => %s, %d, %d", menuItemName, pmi->pszUniqName, bVisible, pmi->mi.position); @@ -1128,7 +1128,7 @@ static HMENU BuildRecursiveMenu(HMENU hMenu, TMO_IntMenuItem *pRootMenu, WPARAM #ifdef PUTPOSITIONSONMENU if (GetKeyState(VK_CONTROL) & 0x8000) { TCHAR str[256]; - mir_sntprintf(str, _T("%s (%d, id %x)"), mi->name.a, mi->position, mii.dwItemData); + mir_sntprintf(str, L"%s (%d, id %x)", mi->name.a, mi->position, mii.dwItemData); mii.dwTypeData = str; } #endif @@ -1142,7 +1142,7 @@ static HMENU BuildRecursiveMenu(HMENU hMenu, TMO_IntMenuItem *pRootMenu, WPARAM #ifdef PUTPOSITIONSONMENU if (GetKeyState(VK_CONTROL) & 0x8000) { TCHAR str[256]; - mir_sntprintf(str, _T("%s (%d, id %x)"), mi->name.a, mi->position, mii.dwItemData); + mir_sntprintf(str, L"%s (%d, id %x)", mi->name.a, mi->position, mii.dwItemData); mii.dwTypeData = str; } #endif @@ -1221,7 +1221,7 @@ static int MO_RegisterIcon(TMO_IntMenuItem *pmi, void*) HICON hIcon = ImageList_GetIcon(pmi->parent->m_hMenuIcons, pmi->iconId, 0); TCHAR sectionName[256]; - mir_sntprintf(sectionName, LPGENT("Menu icons") _T("/%s"), TranslateTS(pmi->parent->ptszDisplayName)); + mir_sntprintf(sectionName, LPGENT("Menu icons") L"/%s", TranslateTS(pmi->parent->ptszDisplayName)); char iconame[256], uname[100]; bin2hex(&pmi->mi.uid, sizeof(pmi->mi.uid), uname); diff --git a/src/mir_app/src/meta_edit.cpp b/src/mir_app/src/meta_edit.cpp index 87dc0aa609..376c431a73 100644 --- a/src/mir_app/src/meta_edit.cpp +++ b/src/mir_app/src/meta_edit.cpp @@ -167,7 +167,7 @@ static void ApplyChanges() PROTO_AVATAR_INFORMATION ai = { 0 }; ai.hContact = g_data.hMeta; ai.format = PA_FORMAT_UNKNOWN; - _tcsncpy_s(ai.filename, _T("X"), _TRUNCATE); + _tcsncpy_s(ai.filename, L"X", _TRUNCATE); if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS) db_set_ts(g_data.hMeta, "ContactPhoto", "File", ai.filename); } @@ -370,7 +370,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara } else { g_data.hDefaultContact = 0; - SetDlgItemText(hwndDlg, IDC_ED_DEFAULT, _T("None")); + SetDlgItemText(hwndDlg, IDC_ED_DEFAULT, L"None"); } } diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp index b2ded22f38..54f41af521 100644 --- a/src/mir_app/src/meta_menu.cpp +++ b/src/mir_app/src/meta_menu.cpp @@ -164,7 +164,7 @@ void Meta_RemoveContactNumber(DBCachedContact *ccMeta, int number, bool bUpdateI PROTO_AVATAR_INFORMATION ai = { 0 }; ai.hContact = ccMeta->contactID; ai.format = PA_FORMAT_UNKNOWN; - _tcsncpy_s(ai.filename, _T("X"), _TRUNCATE); + _tcsncpy_s(ai.filename, L"X", _TRUNCATE); if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS) db_set_ts(ccMeta->contactID, "ContactPhoto", "File", ai.filename); diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index a4c9d1988b..4961d73f12 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -446,7 +446,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) PROTO_AVATAR_INFORMATION ai = { 0 }; ai.hContact = ccMeta->contactID; ai.format = PA_FORMAT_UNKNOWN; - _tcsncpy_s(ai.filename, _T("X"), _TRUNCATE); + _tcsncpy_s(ai.filename, L"X", _TRUNCATE); if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS) db_set_ts(ccMeta->contactID, "ContactPhoto", "File", ai.filename); } @@ -612,7 +612,7 @@ static int Meta_SrmmIconClicked(WPARAM hMeta, LPARAM lParam) tszNick = cli.pfnGetContactDisplayName(cc->pSubs[i], 0); else Meta_GetSubNick(hMeta, i, tszNick); - tszNick.AppendFormat(_T(" [%s]"), pa->tszAccountName); + tszNick.AppendFormat(L" [%s]", pa->tszAccountName); mii.wID = i + 1; mii.fState = (i == iDefault) ? MFS_CHECKED : MFS_ENABLED; @@ -796,7 +796,7 @@ INT_PTR Meta_GetInfo(WPARAM, LPARAM lParam) PROTO_AVATAR_INFORMATION ai; ai.hContact = ccs->hContact; ai.format = PA_FORMAT_UNKNOWN; - _tcsncpy_s(ai.filename, _T("X"), _TRUNCATE); + _tcsncpy_s(ai.filename, L"X", _TRUNCATE); if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS) db_set_ts(ccs->hContact, "ContactPhoto", "File", ai.filename); diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp index a8499971a4..99e307af66 100644 --- a/src/mir_app/src/meta_utils.cpp +++ b/src/mir_app/src/meta_utils.cpp @@ -170,7 +170,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) PROTO_AVATAR_INFORMATION ai; ai.hContact = hMeta; ai.format = PA_FORMAT_UNKNOWN; - _tcsncpy_s(ai.filename, _T("X"), _TRUNCATE); + _tcsncpy_s(ai.filename, L"X", _TRUNCATE); if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS) db_set_ts(hMeta, "ContactPhoto", "File", ai.filename); @@ -512,13 +512,13 @@ void Meta_GetSubNick(MCONTACT hMeta, int i, CMString &tszDest) tszDest = dbv.pszVal; break; case DBVT_BYTE: - tszDest.Format(_T("%d"), dbv.bVal); + tszDest.Format(L"%d", dbv.bVal); break; case DBVT_WORD: - tszDest.Format(_T("%d"), dbv.wVal); + tszDest.Format(L"%d", dbv.wVal); break; case DBVT_DWORD: - tszDest.Format(_T("%d"), dbv.dVal); + tszDest.Format(L"%d", dbv.dVal); break; default: tszDest.Empty(); diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp index 1dd8ccc0a6..12886122d8 100644 --- a/src/mir_app/src/miranda.cpp +++ b/src/mir_app/src/miranda.cpp @@ -177,7 +177,7 @@ static INT_PTR CALLBACK WaitForProcessDlgProc(HWND hwnd, UINT msg, WPARAM wParam INT_PTR CheckRestart() { - LPCTSTR tszPID = CmdLine_GetOption(_T("restart")); + LPCTSTR tszPID = CmdLine_GetOption(L"restart"); if (tszPID) { HANDLE hProcess = OpenProcess(SYNCHRONIZE, FALSE, _ttol(tszPID)); if (hProcess) { @@ -205,18 +205,18 @@ int WINAPI mir_main(LPTSTR cmdLine) setlocale(LC_ALL, ""); #ifdef _DEBUG - if (CmdLine_GetOption(_T("memdebug"))) + if (CmdLine_GetOption(L"memdebug")) _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif HMODULE hDwmApi, hThemeAPI; if (IsWinVerVistaPlus()) { - hDwmApi = LoadLibrary(_T("dwmapi.dll")); + hDwmApi = LoadLibrary(L"dwmapi.dll"); if (hDwmApi) { dwmExtendFrameIntoClientArea = (pfnDwmExtendFrameIntoClientArea)GetProcAddress(hDwmApi, "DwmExtendFrameIntoClientArea"); dwmIsCompositionEnabled = (pfnDwmIsCompositionEnabled)GetProcAddress(hDwmApi, "DwmIsCompositionEnabled"); } - hThemeAPI = LoadLibrary(_T("uxtheme.dll")); + hThemeAPI = LoadLibrary(L"uxtheme.dll"); if (hThemeAPI) { drawThemeTextEx = (pfnDrawThemeTextEx)GetProcAddress(hThemeAPI, "DrawThemeTextEx"); setWindowThemeAttribute = (pfnSetWindowThemeAttribute)GetProcAddress(hThemeAPI, "SetWindowThemeAttribute"); @@ -333,7 +333,7 @@ static INT_PTR GetMirandaVersion(WPARAM, LPARAM) UINT blockSize; VS_FIXEDFILEINFO *vsffi; - VerQueryValue(pVerInfo, _T("\\"), (PVOID*)&vsffi, &blockSize); + VerQueryValue(pVerInfo, L"\\", (PVOID*)&vsffi, &blockSize); DWORD ver = (((vsffi->dwProductVersionMS >> 16) & 0xFF) << 24) | ((vsffi->dwProductVersionMS & 0xFF) << 16) | (((vsffi->dwProductVersionLS >> 16) & 0xFF) << 8) | @@ -352,7 +352,7 @@ static INT_PTR GetMirandaFileVersion(WPARAM, LPARAM lParam) UINT blockSize; VS_FIXEDFILEINFO *vsffi; - VerQueryValue(pVerInfo, _T("\\"), (PVOID*)&vsffi, &blockSize); + VerQueryValue(pVerInfo, L"\\", (PVOID*)&vsffi, &blockSize); WORD* p = (WORD*)lParam; p[0] = HIWORD(vsffi->dwProductVersionMS); @@ -372,7 +372,7 @@ static INT_PTR GetMirandaVersionText(WPARAM wParam, LPARAM lParam) GetFileVersionInfo(filename, 0, verInfoSize, pVerInfo); UINT blockSize; - VerQueryValue(pVerInfo, _T("\\StringFileInfo\\000004b0\\ProductVersion"), (LPVOID*)&productVersion, &blockSize); + VerQueryValue(pVerInfo, L"\\StringFileInfo\\000004b0\\ProductVersion", (LPVOID*)&productVersion, &blockSize); strncpy((char*)lParam, _T2A(productVersion), wParam); #if defined(_WIN64) strcat_s((char*)lParam, wParam, " x64"); diff --git a/src/mir_app/src/netlibhttp.cpp b/src/mir_app/src/netlibhttp.cpp index cb811f339c..e641c08209 100644 --- a/src/mir_app/src/netlibhttp.cpp +++ b/src/mir_app/src/netlibhttp.cpp @@ -267,7 +267,7 @@ struct HttpSecurityContext szAuthHdr = NtlmCreateResponseFromChallenge(m_hNtlmSecurity, szChallenge, szLogin, szPassw, true, complete); if (!szAuthHdr) - NetlibLogf(NULL, "Security login %s failed, user: %S pssw: %S", szProvider, szLogin ? szLogin.get() : _T("(no user)"), szPassw ? _T("(exist)") : _T("(no psw)")); + NetlibLogf(NULL, "Security login %s failed, user: %S pssw: %S", szProvider, szLogin ? szLogin.get() : L"(no user)", szPassw ? L"(exist)" : L"(no psw)"); else if (justCreated) proxyAuthList.add(m_szHost, m_szProvider); } diff --git a/src/mir_app/src/netliblog.cpp b/src/mir_app/src/netliblog.cpp index 9957a631c4..b65e7f1d0a 100644 --- a/src/mir_app/src/netliblog.cpp +++ b/src/mir_app/src/netliblog.cpp @@ -73,7 +73,7 @@ static void InitLog() logOptions.tszFile = path; } else { - db_set_ts(NULL, "Netlib", "File", logOptions.tszUserFile = _T("%miranda_logpath%\\netlog.txt")); + db_set_ts(NULL, "Netlib", "File", logOptions.tszUserFile = L"%miranda_logpath%\\netlog.txt"); logOptions.tszFile = Utils_ReplaceVarsT(logOptions.tszUserFile); } @@ -160,7 +160,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa GetWindowText(GetWindow((HWND)lParam, GW_HWNDPREV), str, _countof(str)); { TCHAR filter[200]; - mir_sntprintf(filter, _T("%s (*)%c*%c"), TranslateT("All files"), 0, 0); + mir_sntprintf(filter, L"%s (*)%c*%c", TranslateT("All files"), 0, 0); OPENFILENAME ofn = { 0 }; ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; @@ -185,7 +185,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa if (LOWORD(wParam) == IDC_RUNATSTARTBROWSE && _tcschr(str, ' ') != NULL) { memmove(str + 1, str, ((_countof(str) - 2) * sizeof(TCHAR))); str[0] = '"'; - mir_tstrcat(str, _T("\"")); + mir_tstrcat(str, L"\""); } SetWindowText(GetWindow((HWND)lParam, GW_HWNDPREV), str); } diff --git a/src/mir_app/src/netlibopts.cpp b/src/mir_app/src/netlibopts.cpp index d02b4c5794..1423761260 100644 --- a/src/mir_app/src/netlibopts.cpp +++ b/src/mir_app/src/netlibopts.cpp @@ -67,7 +67,7 @@ static const UINT specifyPortsControls[] = { IDC_PORTSRANGE, IDC_STATIC52}; -static const TCHAR* szProxyTypes[] = {LPGENT(""), _T("SOCKS4"), _T("SOCKS5"), _T("HTTP"), _T("HTTPS"), _T("Internet Explorer")}; +static const TCHAR* szProxyTypes[] = {LPGENT(""), L"SOCKS4", L"SOCKS5", L"HTTP", L"HTTPS", L"Internet Explorer"}; static const WORD oftenProxyPorts[] = {1080, 1080, 1080, 8080, 8080, 8080}; #define M_REFRESHALL (WM_USER+100) diff --git a/src/mir_app/src/netlibsecurity.cpp b/src/mir_app/src/netlibsecurity.cpp index 827c52bb5b..24d095ec00 100644 --- a/src/mir_app/src/netlibsecurity.cpp +++ b/src/mir_app/src/netlibsecurity.cpp @@ -77,7 +77,7 @@ HANDLE NetlibInitSecurityProvider(const TCHAR* szProvider, const TCHAR* szPrinci { HANDLE hSecurity = NULL; - if (mir_tstrcmpi(szProvider, _T("Basic")) == 0) { + if (mir_tstrcmpi(szProvider, L"Basic") == 0) { NtlmHandleType* hNtlm = (NtlmHandleType*)mir_calloc(sizeof(NtlmHandleType)); hNtlm->szProvider = mir_tstrdup(szProvider); SecInvalidateHandle(&hNtlm->hClientContext); @@ -90,8 +90,8 @@ HANDLE NetlibInitSecurityProvider(const TCHAR* szProvider, const TCHAR* szPrinci mir_cslock lck(csSec); PSecPkgInfo ntlmSecurityPackageInfo; - bool isGSSAPI = mir_tstrcmpi(szProvider, _T("GSSAPI")) == 0; - const TCHAR *szProviderC = isGSSAPI ? _T("Kerberos") : szProvider; + bool isGSSAPI = mir_tstrcmpi(szProvider, L"GSSAPI") == 0; + const TCHAR *szProviderC = isGSSAPI ? L"Kerberos" : szProvider; SECURITY_STATUS sc = QuerySecurityPackageInfo((LPTSTR)szProviderC, &ntlmSecurityPackageInfo); if (sc == SEC_E_OK) { NtlmHandleType* hNtlm; @@ -101,7 +101,7 @@ HANDLE NetlibInitSecurityProvider(const TCHAR* szProvider, const TCHAR* szPrinci FreeContextBuffer(ntlmSecurityPackageInfo); hNtlm->szProvider = mir_tstrdup(szProvider); - hNtlm->szPrincipal = mir_tstrdup(szPrincipal ? szPrincipal : _T("")); + hNtlm->szPrincipal = mir_tstrdup(szPrincipal ? szPrincipal : L""); SecInvalidateHandle(&hNtlm->hClientContext); SecInvalidateHandle(&hNtlm->hClientCredential); ntlmCnt++; @@ -213,9 +213,9 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, char *szOutputToken; NtlmHandleType* hNtlm = (NtlmHandleType*)hSecurity; - if (mir_tstrcmpi(hNtlm->szProvider, _T("Basic"))) { - bool isGSSAPI = mir_tstrcmpi(hNtlm->szProvider, _T("GSSAPI")) == 0; - TCHAR *szProvider = isGSSAPI ? (TCHAR*)_T("Kerberos") : hNtlm->szProvider; + if (mir_tstrcmpi(hNtlm->szProvider, L"Basic")) { + bool isGSSAPI = mir_tstrcmpi(hNtlm->szProvider, L"GSSAPI") == 0; + TCHAR *szProvider = isGSSAPI ? (TCHAR*)L"Kerberos" : hNtlm->szProvider; bool hasChallenge = szChallenge != NULL && szChallenge[0] != '\0'; if (hasChallenge) { unsigned tokenLen; diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index e6a9f23a5e..6b187cc73f 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -127,19 +127,19 @@ static bool isPluginBanned(const MUUID& u1) static MuuidReplacement pluginDefault[] = { - { MIID_UIUSERINFO, _T("stduserinfo"), NULL }, // 0 - { MIID_SREMAIL, _T("stdemail"), NULL }, // 1 - { MIID_SRAUTH, _T("stdauth"), NULL }, // 2 - { MIID_SRFILE, _T("stdfile"), NULL }, // 3 - { MIID_UIHELP, _T("stdhelp"), NULL }, // 4 - { MIID_UIHISTORY, _T("stduihist"), NULL }, // 5 - { MIID_IDLE, _T("stdidle"), NULL }, // 6 - { MIID_AUTOAWAY, _T("stdautoaway"), NULL }, // 7 - { MIID_USERONLINE, _T("stduseronline"), NULL }, // 8 - { MIID_SRAWAY, _T("stdaway"), NULL }, // 9 - { MIID_CLIST, _T("stdclist"), NULL }, // 10 - { MIID_CHAT, _T("stdchat"), NULL }, // 11 - { MIID_SRMM, _T("stdmsg"), NULL } // 12 + { MIID_UIUSERINFO, L"stduserinfo", NULL }, // 0 + { MIID_SREMAIL, L"stdemail", NULL }, // 1 + { MIID_SRAUTH, L"stdauth", NULL }, // 2 + { MIID_SRFILE, L"stdfile", NULL }, // 3 + { MIID_UIHELP, L"stdhelp", NULL }, // 4 + { MIID_UIHISTORY, L"stduihist", NULL }, // 5 + { MIID_IDLE, L"stdidle", NULL }, // 6 + { MIID_AUTOAWAY, L"stdautoaway", NULL }, // 7 + { MIID_USERONLINE, L"stduseronline", NULL }, // 8 + { MIID_SRAWAY, L"stdaway", NULL }, // 9 + { MIID_CLIST, L"stdclist", NULL }, // 10 + { MIID_CHAT, L"stdchat", NULL }, // 11 + { MIID_SRMM, L"stdmsg", NULL } // 12 }; int getDefaultPluginIdx(const MUUID &muuid) @@ -162,7 +162,7 @@ int LoadStdPlugins() } if (pluginDefault[12].pImpl == NULL) - MessageBox(NULL, TranslateT("No messaging plugins loaded. Please install/enable one of the messaging plugins, for instance, \"StdMsg.dll\""), _T("Miranda NG"), MB_OK | MB_ICONWARNING); + MessageBox(NULL, TranslateT("No messaging plugins loaded. Please install/enable one of the messaging plugins, for instance, \"StdMsg.dll\""), L"Miranda NG", MB_OK | MB_ICONWARNING); return 0; } @@ -373,7 +373,7 @@ int Plugin_UnloadDyn(pluginEntry *p) static int valid_library_name(TCHAR *name) { TCHAR *dot = _tcsrchr(name, '.'); - if (dot != NULL && mir_tstrcmpi(dot + 1, _T("dll")) == 0) + if (dot != NULL && mir_tstrcmpi(dot + 1, L"dll") == 0) if (dot[4] == 0) return 1; @@ -389,7 +389,7 @@ void enumPlugins(SCAN_PLUGINS_CALLBACK cb, WPARAM wParam, LPARAM lParam) // create the search filter TCHAR search[MAX_PATH]; - mir_sntprintf(search, _T("%s\\Plugins\\*.dll"), exe); + mir_sntprintf(search, L"%s\\Plugins\\*.dll", exe); // FFFN will return filenames for things like dot dll+ or dot dllx WIN32_FIND_DATA ffd; @@ -413,7 +413,7 @@ pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path) pluginList.insert(p); TCHAR tszFullPath[MAX_PATH]; - mir_sntprintf(tszFullPath, _T("%s\\%s\\%s"), path, dir, tszFileName); + mir_sntprintf(tszFullPath, L"%s\\%s\\%s", path, dir, tszFileName); // map dll into the memory and check its exports bool bIsPlugin = false; @@ -506,7 +506,7 @@ bool TryLoadPlugin(pluginEntry *p, bool bDynamic) if (!(p->pclass & PCLASS_BASICAPI)) { BASIC_PLUGIN_INFO bpi; - mir_sntprintf(tszFullPath, _T("%s\\%s\\%s"), exe, (p->pclass & PCLASS_CORE) ? _T("Core") : _T("Plugins"), p->pluginname); + mir_sntprintf(tszFullPath, L"%s\\%s\\%s", exe, (p->pclass & PCLASS_CORE) ? L"Core" : L"Plugins", p->pluginname); if (!checkAPI(tszFullPath, &bpi, mirandaVersion, CHECKAPI_NONE)) { p->pclass |= PCLASS_FAILED; return false; @@ -565,8 +565,8 @@ bool LoadCorePlugin(MuuidReplacement &mr) GetModuleFileName(NULL, exe, _countof(exe)); TCHAR *p = _tcsrchr(exe, '\\'); if (p) *p = 0; - mir_sntprintf(tszPlugName, _T("%s.dll"), mr.stdplugname); - pluginEntry* pPlug = OpenPlugin(tszPlugName, _T("Core"), exe); + mir_sntprintf(tszPlugName, L"%s.dll", mr.stdplugname); + pluginEntry* pPlug = OpenPlugin(tszPlugName, L"Core", exe); if (pPlug->pclass & PCLASS_FAILED) { LBL_Error: MessageBox(NULL, CMString(FORMAT, TranslateTS(tszCoreErr), mr.stdplugname), TranslateT("Fatal error"), MB_OK | MB_ICONSTOP); @@ -623,14 +623,14 @@ static pluginEntry* getCListModule(TCHAR *exe) if (!isPluginOnWhiteList(p->pluginname)) continue; - mir_sntprintf(tszFullPath, _T("%s\\Plugins\\%s"), exe, p->pluginname); + mir_sntprintf(tszFullPath, L"%s\\Plugins\\%s", exe, p->pluginname); if (loadClistModule(tszFullPath, p)) return p; } MuuidReplacement& stdClist = pluginDefault[10]; if (LoadCorePlugin(stdClist)) { - mir_sntprintf(tszFullPath, _T("%s\\Core\\%s.dll"), exe, stdClist.stdplugname); + mir_sntprintf(tszFullPath, L"%s\\Core\\%s.dll", exe, stdClist.stdplugname); if (loadClistModule(tszFullPath, stdClist.pImpl)) return stdClist.pImpl; } @@ -682,7 +682,7 @@ static int LaunchServicePlugin(pluginEntry *p) int LoadDefaultServiceModePlugin() { - LPCTSTR param = CmdLine_GetOption(_T("svc")); + LPCTSTR param = CmdLine_GetOption(L"svc"); if (param == NULL || *param == 0) return SERVICE_CONTINUE; @@ -709,7 +709,7 @@ void EnsureCheckerLoaded(bool bEnable) { for (int i = 0; i < pluginList.getCount(); i++) { pluginEntry *p = pluginList[i]; - if (mir_tstrcmpi(p->pluginname, _T("dbchecker.dll"))) + if (mir_tstrcmpi(p->pluginname, L"dbchecker.dll")) continue; if (bEnable) { @@ -744,7 +744,7 @@ int LoadSslModule(void) } if (!bExtSSLLoaded) { - MuuidReplacement stdSsl = { MIID_SSL, _T("stdssl"), NULL }; + MuuidReplacement stdSsl = { MIID_SSL, L"stdssl", NULL }; if (!LoadCorePlugin(stdSsl)) return 1; } @@ -779,7 +779,7 @@ int LoadNewPluginsModule(void) *slice = 0; // remember some useful options - askAboutIgnoredPlugins = (UINT)GetPrivateProfileInt(_T("PluginLoader"), _T("AskAboutIgnoredPlugins"), 0, mirandabootini); + askAboutIgnoredPlugins = (UINT)GetPrivateProfileInt(L"PluginLoader", L"AskAboutIgnoredPlugins", 0, mirandabootini); // if Crash Dumper is present, load it to provide Crash Reports if (plugin_crshdmp != NULL && isPluginOnWhiteList(plugin_crshdmp->pluginname)) @@ -789,7 +789,7 @@ int LoadNewPluginsModule(void) // if freeimage is present, load it to provide the basic core functions if (plugin_freeimg != NULL) { BASIC_PLUGIN_INFO bpi; - mir_sntprintf(fullPath, _T("%s\\Plugins\\%s"), exe, plugin_freeimg->pluginname); + mir_sntprintf(fullPath, L"%s\\Plugins\\%s", exe, plugin_freeimg->pluginname); if (checkAPI(fullPath, &bpi, mirandaVersion, CHECKAPI_NONE)) { plugin_freeimg->bpi = bpi; plugin_freeimg->pclass |= PCLASS_OK | PCLASS_BASICAPI; @@ -807,9 +807,9 @@ int LoadNewPluginsModule(void) if (clist == NULL) { // result = 0, no clist_* can be found if (clistPlugins.getCount()) - MessageBox(NULL, TranslateT("Unable to start any of the installed contact list plugins, I even ignored your preferences for which contact list couldn't load any."), _T("Miranda NG"), MB_OK | MB_ICONERROR); + MessageBox(NULL, TranslateT("Unable to start any of the installed contact list plugins, I even ignored your preferences for which contact list couldn't load any."), L"Miranda NG", MB_OK | MB_ICONERROR); else - MessageBox(NULL, TranslateT("Can't find a contact list plugin! You need StdClist or any other contact list plugin."), _T("Miranda NG"), MB_OK | MB_ICONERROR); + MessageBox(NULL, TranslateT("Can't find a contact list plugin! You need StdClist or any other contact list plugin."), L"Miranda NG", MB_OK | MB_ICONERROR); return 1; } @@ -836,14 +836,14 @@ int LoadNewPluginsModule(void) static BOOL scanPluginsDir(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM) { - pluginEntry *p = OpenPlugin(fd->cFileName, _T("Plugins"), path); + pluginEntry *p = OpenPlugin(fd->cFileName, L"Plugins", path); if (!(p->pclass & PCLASS_FAILED)) { - if (plugin_freeimg == NULL && mir_tstrcmpi(fd->cFileName, _T("advaimg.dll")) == 0) { + if (plugin_freeimg == NULL && mir_tstrcmpi(fd->cFileName, L"advaimg.dll") == 0) { plugin_freeimg = p; p->pclass |= PCLASS_LAST; } - if (plugin_crshdmp == NULL && mir_tstrcmpi(fd->cFileName, _T("crashdumper.dll")) == 0) { + if (plugin_crshdmp == NULL && mir_tstrcmpi(fd->cFileName, L"crashdumper.dll") == 0) { plugin_crshdmp = p; p->pclass |= PCLASS_LAST; } @@ -862,12 +862,12 @@ int LoadNewPluginsModuleInfos(void) mirandaVersion = (DWORD)CallService(MS_SYSTEM_GETVERSION, 0, 0); // remember where the mirandaboot.ini goes - PathToAbsoluteT(_T("mirandaboot.ini"), mirandabootini); + PathToAbsoluteT(L"mirandaboot.ini", mirandabootini); // look for all *.dll's enumPlugins(scanPluginsDir, 0, 0); - MuuidReplacement stdCrypt = { MIID_CRYPTO, _T("stdcrypt"), NULL }; + MuuidReplacement stdCrypt = { MIID_CRYPTO, L"stdcrypt", NULL }; return !LoadCorePlugin(stdCrypt); } diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index bb41ab3100..61d1d81b16 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -195,7 +195,7 @@ static BOOL CALLBACK BoldGroupTitlesEnumChildren(HWND hwnd, LPARAM lParam) TCHAR szClass[64]; GetClassName(hwnd, szClass, _countof(szClass)); - if (!mir_tstrcmp(szClass, _T("Button")) && (GetWindowLongPtr(hwnd, GWL_STYLE) & 0x0F) == BS_GROUPBOX) + if (!mir_tstrcmp(szClass, L"Button") && (GetWindowLongPtr(hwnd, GWL_STYLE) & 0x0F) == BS_GROUPBOX) SendMessage(hwnd, WM_SETFONT, lParam, 0); return TRUE; } @@ -676,7 +676,7 @@ static void RebuildPageTree(HWND hdlg, OptionsDlgData *dat) } if (dat->szFilterString[0] == 0) // Clear the keyword combo box - SetDlgItemText(hdlg, IDC_KEYWORD_FILTER, _T("")); + SetDlgItemText(hdlg, IDC_KEYWORD_FILTER, L""); if (!bRemoveFocusFromFilter) SetFocus(GetDlgItem(hdlg, IDC_KEYWORD_FILTER)); //set the focus back to the combo box @@ -835,7 +835,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L TCITEM tie; tie.mask = TCIF_TEXT | TCIF_IMAGE; tie.iImage = -1; - tie.pszText = _T("X"); + tie.pszText = L"X"; TabCtrl_InsertItem(GetDlgItem(hdlg, IDC_TAB), 0, &tie); GetWindowRect(GetDlgItem(hdlg, IDC_TAB), &dat->rcTab); diff --git a/src/mir_app/src/options_ei.cpp b/src/mir_app/src/options_ei.cpp index c64d025d70..ff8d2861c1 100644 --- a/src/mir_app/src/options_ei.cpp +++ b/src/mir_app/src/options_ei.cpp @@ -121,7 +121,7 @@ class CExtraIconOptsDlg : public CDlgBase img = extra->getID(); if (i > 0) - desc += _T(" / "); + desc += L" / "; desc += extra->getDescription(); } diff --git a/src/mir_app/src/path.cpp b/src/mir_app/src/path.cpp index 07d5ddee3f..96cc60358a 100644 --- a/src/mir_app/src/path.cpp +++ b/src/mir_app/src/path.cpp @@ -121,13 +121,13 @@ static __forceinline char* GetPathVarX(const char*, int code) if (hAvatarFolder != NULL) _tcsncpy_s(szFullPath, tszAvatarRoot, _TRUNCATE); else - mir_sntprintf(szFullPath, _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName); + mir_sntprintf(szFullPath, L"%s\\%s\\AvatarCache", g_profileDir, g_shortProfileName); break; case 2: - mir_sntprintf(szFullPath, _T("%s\\%s\\Logs"), g_profileDir, g_shortProfileName); + mir_sntprintf(szFullPath, L"%s\\%s\\Logs", g_profileDir, g_shortProfileName); break; case 3: - mir_sntprintf(szFullPath, _T("%s\\%s"), g_profileDir, g_shortProfileName); + mir_sntprintf(szFullPath, L"%s\\%s", g_profileDir, g_shortProfileName); break; } return makeFileName(szFullPath); @@ -205,13 +205,13 @@ static __forceinline TCHAR* GetPathVarX(const TCHAR*, int code) if (hAvatarFolder != NULL) _tcsncpy_s(szFullPath, tszAvatarRoot, _TRUNCATE); else - mir_sntprintf(szFullPath, _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName); + mir_sntprintf(szFullPath, L"%s\\%s\\AvatarCache", g_profileDir, g_shortProfileName); break; case 2: - mir_sntprintf(szFullPath, _T("%s\\%s\\Logs"), g_profileDir, g_shortProfileName); + mir_sntprintf(szFullPath, L"%s\\%s\\Logs", g_profileDir, g_shortProfileName); break; case 3: - mir_sntprintf(szFullPath, _T("%s\\%s"), g_profileDir, g_shortProfileName); + mir_sntprintf(szFullPath, L"%s\\%s", g_profileDir, g_shortProfileName); break; } return mir_tstrdup(szFullPath); @@ -364,7 +364,7 @@ MIR_APP_DLL(wchar_t*) Utils_ReplaceVarsW(const wchar_t *wszData, MCONTACT hConta static int OnFoldersChanged(WPARAM, LPARAM) { - mir_sntprintf(tszAvatarRoot, _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName); + mir_sntprintf(tszAvatarRoot, L"%s\\%s\\AvatarCache", g_profileDir, g_shortProfileName); TCHAR tmpVar[MAX_PATH]; if (!FoldersGetCustomPathT(hAvatarFolder, tmpVar, _countof(tmpVar), tszAvatarRoot)) @@ -374,7 +374,7 @@ static int OnFoldersChanged(WPARAM, LPARAM) void InitPathVar() { - mir_sntprintf(tszAvatarRoot, _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName); + mir_sntprintf(tszAvatarRoot, L"%s\\%s\\AvatarCache", g_profileDir, g_shortProfileName); if (hAvatarFolder = FoldersRegisterCustomPathT( LPGEN("Avatars"), LPGEN("Avatars root folder"), tszAvatarRoot)) { TCHAR tmpVar[MAX_PATH]; if (!FoldersGetCustomPathT(hAvatarFolder, tmpVar, _countof(tmpVar), tszAvatarRoot)) diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp index 8f26724714..eda32700e3 100644 --- a/src/mir_app/src/pluginopts.cpp +++ b/src/mir_app/src/pluginopts.cpp @@ -61,7 +61,7 @@ static LIST arPluginList(10, sttSortPlugins); static BOOL dialogListPlugins(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM lParam) { TCHAR buf[MAX_PATH]; - mir_sntprintf(buf, _T("%s\\Plugins\\%s"), path, fd->cFileName); + mir_sntprintf(buf, L"%s\\Plugins\\%s", path, fd->cFileName); HINSTANCE hInst = GetModuleHandle(buf); BASIC_PLUGIN_INFO pi; @@ -135,13 +135,13 @@ static BOOL dialogListPlugins(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM l VS_FIXEDFILEINFO *fi; void *pVerInfo = mir_alloc(verInfoSize); GetFileVersionInfo(buf, 0, verInfoSize, pVerInfo); - VerQueryValue(pVerInfo, _T("\\"), (LPVOID*)&fi, &blockSize); - mir_sntprintf(buf, _T("%d.%d.%d.%d"), HIWORD(fi->dwProductVersionMS), + VerQueryValue(pVerInfo, L"\\", (LPVOID*)&fi, &blockSize); + mir_sntprintf(buf, L"%d.%d.%d.%d", HIWORD(fi->dwProductVersionMS), LOWORD(fi->dwProductVersionMS), HIWORD(fi->dwProductVersionLS), LOWORD(fi->dwProductVersionLS)); mir_free(pVerInfo); } else - mir_sntprintf(buf, _T("%d.%d.%d.%d"), HIBYTE(HIWORD(pi.pluginInfo->version)), + mir_sntprintf(buf, L"%d.%d.%d.%d", HIBYTE(HIWORD(pi.pluginInfo->version)), LOBYTE(HIWORD(pi.pluginInfo->version)), HIBYTE(LOWORD(pi.pluginInfo->version)), LOBYTE(LOWORD(pi.pluginInfo->version))); @@ -187,7 +187,7 @@ static bool LoadPluginDynamically(PluginListItemData *dat) GetModuleFileName(NULL, exe, _countof(exe)); TCHAR *p = _tcsrchr(exe, '\\'); if (p) *p = 0; - pluginEntry* pPlug = OpenPlugin(dat->fileName, _T("Plugins"), exe); + pluginEntry* pPlug = OpenPlugin(dat->fileName, L"Plugins", exe); if (pPlug->pclass & PCLASS_FAILED) { LBL_Error: Plugin_UnloadDyn(pPlug); @@ -305,7 +305,7 @@ static int CALLBACK SortPlugins(WPARAM i1, LPARAM i2, LPARAM) static TCHAR *latin2t(const char *p) { if (p == NULL) - return mir_tstrdup(_T("")); + return mir_tstrdup(L""); return mir_a2t_cp(p, 1250); } @@ -331,7 +331,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar LVCOLUMN col; col.mask = LVCF_TEXT | LVCF_WIDTH; - col.pszText = _T(""); + col.pszText = L""; col.cx = 40; ListView_InsertColumn(hwndList, 0, &col); @@ -425,7 +425,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar TCHAR buf[1024]; ListView_GetItemText(hwndList, hdr->iItem, 2, buf, _countof(buf)); - SetDlgItemText(hwndDlg, IDC_PLUGININFOFRAME, sel ? buf : _T("")); + SetDlgItemText(hwndDlg, IDC_PLUGININFOFRAME, sel ? buf : L""); ptrT tszAuthor(latin2t(sel ? dat->author : NULL)); SetDlgItemText(hwndDlg, IDC_PLUGINAUTHOR, tszAuthor); @@ -434,7 +434,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar SetDlgItemText(hwndDlg, IDC_PLUGINEMAIL, tszEmail); ptrT p(Langpack_PcharToTchar(dat->description)); - SetDlgItemText(hwndDlg, IDC_PLUGINLONGINFO, sel ? p.get() : _T("")); + SetDlgItemText(hwndDlg, IDC_PLUGINLONGINFO, sel ? p.get() : L""); ptrT tszCopyright(latin2t(sel ? dat->copyright : NULL)); SetDlgItemText(hwndDlg, IDC_PLUGINCPYR, tszCopyright); @@ -447,7 +447,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar uuidToString(dat->uuid, szUID, sizeof(szUID)); SetDlgItemTextA(hwndDlg, IDC_PLUGINPID, sel ? szUID : ""); } - else SetDlgItemText(hwndDlg, IDC_PLUGINPID, sel ? TranslateT("") : _T("")); + else SetDlgItemText(hwndDlg, IDC_PLUGINPID, sel ? TranslateT("") : L""); } } } @@ -455,7 +455,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar if (hdr->hdr.code == PSN_APPLY) { bool needRestart = false; TCHAR bufRestart[1024]; - int bufLen = mir_sntprintf(bufRestart, _T("%s\n"), TranslateT("Miranda NG must be restarted to apply changes for these plugins:")); + int bufLen = mir_sntprintf(bufRestart, L"%s\n", TranslateT("Miranda NG must be restarted to apply changes for these plugins:")); HWND hwndList = GetDlgItem(hwndDlg, IDC_PLUGLIST); for (int iRow = 0; iRow != -1;) { @@ -482,7 +482,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar ListView_SetItem(hwndList, &lvi); } else { - bufLen += mir_sntprintf(bufRestart + bufLen, _countof(bufRestart) - bufLen, _T(" - %s\n"), buf); + bufLen += mir_sntprintf(bufRestart + bufLen, _countof(bufRestart) - bufLen, L" - %s\n", buf); needRestart = true; } } @@ -495,7 +495,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar ListView_SetItem(hwndList, &lvi); } else { - bufLen += mir_sntprintf(bufRestart + bufLen, _countof(bufRestart) - bufLen, _T(" - %s\n"), buf); + bufLen += mir_sntprintf(bufRestart + bufLen, _countof(bufRestart) - bufLen, L" - %s\n", buf); needRestart = true; } } @@ -509,8 +509,8 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar ShowWindow(GetDlgItem(hwndDlg, IDC_RESTART), needRestart); if (needRestart) { - mir_sntprintf(bufRestart + bufLen, _countof(bufRestart) - bufLen, _T("\n%s"), TranslateT("Do you want to restart it now?")); - if (MessageBox(hwndDlg, bufRestart, _T("Miranda NG"), MB_ICONWARNING | MB_YESNO) == IDYES) + mir_sntprintf(bufRestart + bufLen, _countof(bufRestart) - bufLen, L"\n%s", TranslateT("Do you want to restart it now?")); + if (MessageBox(hwndDlg, bufRestart, L"Miranda NG", MB_ICONWARNING | MB_YESNO) == IDYES) CallService(MS_SYSTEM_RESTART, 1, 0); } } diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp index 8828a2de55..9ab844d821 100644 --- a/src/mir_app/src/profilemanager.cpp +++ b/src/mir_app/src/profilemanager.cpp @@ -46,7 +46,7 @@ static int findProfiles(TCHAR *szProfileDir, ENUMPROFILECALLBACK callback, LPARA { // find in Miranda NG profile subfolders TCHAR searchspec[MAX_PATH]; - mir_sntprintf(searchspec, _T("%s\\*.*"), szProfileDir); + mir_sntprintf(searchspec, L"%s\\*.*", szProfileDir); WIN32_FIND_DATA ffd; HANDLE hFind = FindFirstFile(searchspec, &ffd); @@ -55,11 +55,11 @@ static int findProfiles(TCHAR *szProfileDir, ENUMPROFILECALLBACK callback, LPARA do { // find all subfolders except "." and ".." - if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && mir_tstrcmp(ffd.cFileName, _T(".")) && mir_tstrcmp(ffd.cFileName, _T(".."))) { + if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && mir_tstrcmp(ffd.cFileName, L".") && mir_tstrcmp(ffd.cFileName, L"..")) { TCHAR buf[MAX_PATH], profile[MAX_PATH]; - mir_sntprintf(buf, _T("%s\\%s\\%s.dat"), szProfileDir, ffd.cFileName, ffd.cFileName); + mir_sntprintf(buf, L"%s\\%s\\%s.dat", szProfileDir, ffd.cFileName, ffd.cFileName); if (_taccess(buf, 0) == 0) { - mir_sntprintf(profile, _T("%s.dat"), ffd.cFileName); + mir_sntprintf(profile, L"%s.dat", ffd.cFileName); if (!callback(buf, profile, lParam)) break; } @@ -74,7 +74,7 @@ static int findProfiles(TCHAR *szProfileDir, ENUMPROFILECALLBACK callback, LPARA static LRESULT CALLBACK ProfileNameValidate(HWND edit, UINT msg, WPARAM wParam, LPARAM lParam) { if (msg == WM_CHAR) { - if (_tcschr(_T(".?/\\#' "), (TCHAR)wParam) != 0) + if (_tcschr(L".?/\\#' ", (TCHAR)wParam) != 0) return 0; PostMessage(GetParent(edit), WM_INPUTCHANGED, 0, 0); } @@ -106,7 +106,7 @@ class CCreateProfileDlg : public CDlgBase sf.wFunc = FO_DELETE; sf.pFrom = buf; sf.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOF_ALLOWUNDO; - mir_sntprintf(buf, _T("%s\0"), profile); + mir_sntprintf(buf, L"%s\0", profile); if (SHFileOperation(&sf) != 0) { mir_sntprintf(buf, TranslateT("Couldn't move '%s' to the Recycle Bin. Please select another profile name."), file); MessageBox(m_hwnd, buf, TranslateT("Problem moving profile"), MB_ICONINFORMATION | MB_OK); @@ -217,7 +217,7 @@ public: return; // profile placed in "profile_name" subfolder - mir_sntprintf(m_pd->ptszProfile, MAX_PATH, _T("%s\\%s\\%s.dat"), m_pd->ptszProfileDir, szName, szName); + mir_sntprintf(m_pd->ptszProfile, MAX_PATH, L"%s\\%s\\%s.dat", m_pd->ptszProfileDir, szName, szName); m_pd->newProfile = 1; m_pd->dblink = (DATABASELINK *)m_driverList.GetItemData(curSel); @@ -257,7 +257,7 @@ class CChooseProfileDlg : public CDlgBase bool bFileLocked = true; TCHAR *p = _tcsrchr(profile, '.'); - mir_tstrcpy(sizeBuf, _T("0 KB")); + mir_tstrcpy(sizeBuf, L"0 KB"); if (p != NULL) *p = 0; LVITEM item = { 0 }; @@ -268,12 +268,12 @@ class CChooseProfileDlg : public CDlgBase struct _stat statbuf; if (_tstat(tszFullPath, &statbuf) == 0) { if (statbuf.st_size > 1000000) { - mir_sntprintf(sizeBuf, _T("%.3lf"), (double)statbuf.st_size / 1048576.0); - mir_tstrcpy(sizeBuf + 5, _T(" MB")); + mir_sntprintf(sizeBuf, L"%.3lf", (double)statbuf.st_size / 1048576.0); + mir_tstrcpy(sizeBuf + 5, L" MB"); } else { - mir_sntprintf(sizeBuf, _T("%.3lf"), (double)statbuf.st_size / 1024.0); - mir_tstrcpy(sizeBuf + 5, _T(" KB")); + mir_sntprintf(sizeBuf, L"%.3lf", (double)statbuf.st_size / 1024.0); + mir_tstrcpy(sizeBuf + 5, L" KB"); } bFileLocked = !fileExist(tszFullPath); } @@ -323,7 +323,7 @@ class CChooseProfileDlg : public CDlgBase if (!m_profileList.GetItem(&item)) return; - mir_sntprintf(fullName, _T("%s\\%s\\%s.dat"), m_pd->ptszProfileDir, profile, profile); + mir_sntprintf(fullName, L"%s\\%s\\%s.dat", m_pd->ptszProfileDir, profile, profile); CallService(MS_DB_CHECKPROFILE, (WPARAM)fullName, item.iImage == 2); } @@ -343,10 +343,10 @@ class CChooseProfileDlg : public CDlgBase return; mir_sntprintf(profilef, TranslateT("Are you sure you want to remove profile \"%s\"?"), profile); - if (IDYES != MessageBox(NULL, profilef, _T("Miranda NG"), MB_YESNO | MB_TASKMODAL | MB_ICONWARNING)) + if (IDYES != MessageBox(NULL, profilef, L"Miranda NG", MB_YESNO | MB_TASKMODAL | MB_ICONWARNING)) return; - mir_sntprintf(profilef, _T("%s\\%s%c"), m_pd->ptszProfileDir, profile, 0); + mir_sntprintf(profilef, L"%s\\%s%c", m_pd->ptszProfileDir, profile, 0); SHFILEOPSTRUCT sf = { 0 }; sf.wFunc = FO_DELETE; @@ -387,9 +387,9 @@ class CChooseProfileDlg : public CDlgBase // profile is placed in "profile_name" subfolder TCHAR tmpPath[MAX_PATH]; - mir_sntprintf(tmpPath, _T("%s\\%s.dat"), m_pd->ptszProfileDir, profile); + mir_sntprintf(tmpPath, L"%s\\%s.dat", m_pd->ptszProfileDir, profile); if (_taccess(tmpPath, 2)) - mir_sntprintf(m_pd->ptszProfile, MAX_PATH, _T("%s\\%s\\%s.dat"), m_pd->ptszProfileDir, profile, profile); + mir_sntprintf(m_pd->ptszProfile, MAX_PATH, L"%s\\%s\\%s.dat", m_pd->ptszProfileDir, profile, profile); else _tcsncpy_s(m_pd->ptszProfile, MAX_PATH, tmpPath, _TRUNCATE); } @@ -524,9 +524,9 @@ public: TCHAR profilename[MAX_PATH], tszFullPath[MAX_PATH]; struct _stat statbuf; m_profileList.GetItemText(pTip->iItem, 0, profilename, _countof(profilename)); - mir_sntprintf(tszFullPath, _T("%s\\%s\\%s.dat"), m_pd->ptszProfileDir, profilename, profilename); + mir_sntprintf(tszFullPath, L"%s\\%s\\%s.dat", m_pd->ptszProfileDir, profilename, profilename); _tstat(tszFullPath, &statbuf); - mir_sntprintf(pTip->pszText, pTip->cchTextMax, _T("%s\n%s: %s\n%s: %s"), tszFullPath, TranslateT("Created"), rtrimt(NEWTSTR_ALLOCA(_tctime(&statbuf.st_ctime))), TranslateT("Modified"), rtrimt(NEWTSTR_ALLOCA(_tctime(&statbuf.st_mtime)))); + mir_sntprintf(pTip->pszText, pTip->cchTextMax, L"%s\n%s: %s\n%s: %s", tszFullPath, TranslateT("Created"), rtrimt(NEWTSTR_ALLOCA(_tctime(&statbuf.st_ctime))), TranslateT("Modified"), rtrimt(NEWTSTR_ALLOCA(_tctime(&statbuf.st_mtime)))); } } diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp index 43178651aa..096fdf0ed0 100644 --- a/src/mir_app/src/proto_opts.cpp +++ b/src/mir_app/src/proto_opts.cpp @@ -143,13 +143,13 @@ static bool OnCreateAccount(HWND hwndDlg) if (param->action == PRAC_UPGRADED) { BOOL oldProto = pa->bOldProto; TCHAR szPlugin[MAX_PATH]; - mir_sntprintf(szPlugin, _T("%s.dll"), _A2T(pa->szProtoName)); + mir_sntprintf(szPlugin, L"%s.dll", _A2T(pa->szProtoName)); int idx = accounts.getIndex(pa); UnloadAccount(pa, false, false); accounts.remove(idx); if (oldProto && UnloadPlugin(szPlugin, _countof(szPlugin))) { TCHAR szNewName[MAX_PATH]; - mir_sntprintf(szNewName, _T("%s~"), szPlugin); + mir_sntprintf(szNewName, L"%s~", szPlugin); MoveFile(szPlugin, szNewName); } param->action = PRAC_ADDED; @@ -202,9 +202,9 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam TCHAR str[200]; if (param->action == PRAC_CHANGED) { // update EnableWindow(GetDlgItem(hwndDlg, IDC_PROTOTYPECOMBO), FALSE); - mir_sntprintf(str, _T("%s: %s"), TranslateT("Editing account"), param->pa->tszAccountName); + mir_sntprintf(str, L"%s: %s", TranslateT("Editing account"), param->pa->tszAccountName); } - else mir_sntprintf(str, _T("%s: %s"), TranslateT("Upgrading account"), param->pa->tszAccountName); + else mir_sntprintf(str, L"%s: %s", TranslateT("Upgrading account"), param->pa->tszAccountName); SetWindowText(hwndDlg, str); SetDlgItemText(hwndDlg, IDC_ACCNAME, param->pa->tszAccountName); @@ -351,7 +351,7 @@ static LRESULT CALLBACK AccListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA rc.bottom = rc.top + max(g_iIconSX, parentDat->titleHeight) + 4 - 1; ++rc.top; --rc.right; - dat->hwndEdit = CreateWindow(_T("EDIT"), pa->tszAccountName, WS_CHILD | WS_BORDER | ES_AUTOHSCROLL, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, hwnd, NULL, g_hInst, NULL); + dat->hwndEdit = CreateWindow(L"EDIT", pa->tszAccountName, WS_CHILD | WS_BORDER | ES_AUTOHSCROLL, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, hwnd, NULL, g_hInst, NULL); mir_subclassWindow(dat->hwndEdit, sttEditSubclassProc); SendMessage(dat->hwndEdit, WM_SETFONT, (WPARAM)parentDat->hfntTitle, 0); SendMessage(dat->hwndEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN | EC_USEFONTINFO, 0); @@ -618,7 +618,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM if (lps->itemID == (unsigned)dat->iSelected) { SelectObject(lps->hDC, dat->hfntText); - mir_sntprintf(text, size, _T("%s: %S"), TranslateT("Protocol"), acc->szProtoName); + mir_sntprintf(text, size, L"%s: %S", TranslateT("Protocol"), acc->szProtoName); length = (int)mir_tstrlen(text); DrawText(lps->hDC, text, -1, &lps->rcItem, DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS); GetTextExtentPoint32(lps->hDC, text, length, &sz); @@ -629,9 +629,9 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM ptrT tszIdName(szIdName ? mir_a2t(szIdName) : mir_tstrdup(TranslateT("Account ID"))); ptrT tszUniqueID(Contact_GetInfo(CNF_UNIQUEID, NULL, acc->szModuleName)); if (tszUniqueID != NULL) - mir_sntprintf(text, size, _T("%s: %s"), tszIdName, tszUniqueID); + mir_sntprintf(text, size, L"%s: %s", tszIdName, tszUniqueID); else - mir_sntprintf(text, size, _T("%s: %s"), tszIdName, TranslateT("")); + mir_sntprintf(text, size, L"%s: %s", tszIdName, TranslateT("")); } else mir_sntprintf(text, size, TranslateT("Protocol is not loaded.")); diff --git a/src/mir_app/src/proto_ui.cpp b/src/mir_app/src/proto_ui.cpp index 7d54485e58..ed0ac48b16 100644 --- a/src/mir_app/src/proto_ui.cpp +++ b/src/mir_app/src/proto_ui.cpp @@ -144,7 +144,7 @@ void CProtoIntDlgBase::UpdateProtoTitle(const TCHAR *szText) if (!_tcsstr(curText, m_proto_interface->m_tszUserName)) { size_t length = curLength + mir_tstrlen(m_proto_interface->m_tszUserName) + 256; TCHAR *text = (TCHAR *)_alloca(length * sizeof(TCHAR)); - mir_sntprintf(text, length, _T("%s [%s: %s]"), curText, TranslateT("Account"), m_proto_interface->m_tszUserName); + mir_sntprintf(text, length, L"%s [%s: %s]", curText, TranslateT("Account"), m_proto_interface->m_tszUserName); SetWindowText(m_hwnd, text); } } diff --git a/src/mir_app/src/proto_utils.cpp b/src/mir_app/src/proto_utils.cpp index fc3aac1354..3274381078 100644 --- a/src/mir_app/src/proto_utils.cpp +++ b/src/mir_app/src/proto_utils.cpp @@ -155,21 +155,21 @@ MIR_APP_DLL(void) ProtoWindowRemove(PROTO_INTERFACE *pThis, HWND hwnd) MIR_APP_DLL(LPCTSTR) ProtoGetAvatarExtension(int format) { if (format == PA_FORMAT_PNG) - return _T(".png"); + return L".png"; if (format == PA_FORMAT_JPEG) - return _T(".jpg"); + return L".jpg"; if (format == PA_FORMAT_ICON) - return _T(".ico"); + return L".ico"; if (format == PA_FORMAT_BMP) - return _T(".bmp"); + return L".bmp"; if (format == PA_FORMAT_GIF) - return _T(".gif"); + return L".gif"; if (format == PA_FORMAT_SWF) - return _T(".swf"); + return L".swf"; if (format == PA_FORMAT_XML) - return _T(".xml"); + return L".xml"; - return _T(""); + return L""; } MIR_APP_DLL(int) ProtoGetAvatarFormat(const TCHAR *ptszFileName) @@ -181,25 +181,25 @@ MIR_APP_DLL(int) ProtoGetAvatarFormat(const TCHAR *ptszFileName) if (ptszExt == NULL) return PA_FORMAT_UNKNOWN; - if (!_tcsicmp(ptszExt, _T(".png"))) + if (!_tcsicmp(ptszExt, L".png")) return PA_FORMAT_PNG; - if (!_tcsicmp(ptszExt, _T(".jpg")) || !_tcsicmp(ptszExt, _T(".jpeg"))) + if (!_tcsicmp(ptszExt, L".jpg") || !_tcsicmp(ptszExt, L".jpeg")) return PA_FORMAT_JPEG; - if (!_tcsicmp(ptszExt, _T(".ico"))) + if (!_tcsicmp(ptszExt, L".ico")) return PA_FORMAT_ICON; - if (!_tcsicmp(ptszExt, _T(".bmp")) || !_tcsicmp(ptszExt, _T(".rle"))) + if (!_tcsicmp(ptszExt, L".bmp") || !_tcsicmp(ptszExt, L".rle")) return PA_FORMAT_BMP; - if (!_tcsicmp(ptszExt, _T(".gif"))) + if (!_tcsicmp(ptszExt, L".gif")) return PA_FORMAT_GIF; - if (!_tcsicmp(ptszExt, _T(".swf"))) + if (!_tcsicmp(ptszExt, L".swf")) return PA_FORMAT_SWF; - if (!_tcsicmp(ptszExt, _T(".xml"))) + if (!_tcsicmp(ptszExt, L".xml")) return PA_FORMAT_XML; return PA_FORMAT_UNKNOWN; @@ -208,31 +208,31 @@ MIR_APP_DLL(int) ProtoGetAvatarFormat(const TCHAR *ptszFileName) MIR_APP_DLL(int) ProtoGetBufferFormat(const void *pBuffer, const TCHAR **ptszExtension) { if (!memcmp(pBuffer, "\x89PNG", 4)) { - if (ptszExtension) *ptszExtension = _T(".png"); + if (ptszExtension) *ptszExtension = L".png"; return PA_FORMAT_PNG; } if (!memcmp(pBuffer, "GIF8", 4)) { - if (ptszExtension) *ptszExtension = _T(".gif"); + if (ptszExtension) *ptszExtension = L".gif"; return PA_FORMAT_GIF; } if (!memicmp(pBuffer, "bSortAscending); } -static const TCHAR *szColumnNames[] = { NULL, NULL, _T("Nick"), _T("First Name"), _T("Last Name"), _T("E-mail") }; +static const TCHAR *szColumnNames[] = { NULL, NULL, L"Nick", L"First Name", L"Last Name", L"E-mail" }; static int defaultColumnSizes[] = { 0, 90, 100, 100, 100, 2000 }; void LoadColumnSizes(HWND hwndResults, const char *szProto) { @@ -74,7 +74,7 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto) lvc.pszText = TranslateTS(szColumnNames[i]); else { if (i == COLUMNID_HANDLE) { - lvc.pszText = _T("ID"); + lvc.pszText = L"ID"; if (szProto) { INT_PTR ret = CallProtoServiceInt(NULL, szProto, PS_GETCAPS, PFLAG_UNIQUEIDTEXT, 0); if (ret != CALLSERVICE_NOTFOUND) { @@ -252,7 +252,7 @@ void SetStatusBarSearchInfo(HWND hwndStatus, struct FindAddDlgData *dat) if (!pa) continue; - str.Append(i ? _T(", ") : _T(" ")); + str.Append(i ? L", " : L" "); str.Append(pa->tszAccountName); } } @@ -317,9 +317,9 @@ void SetStatusBarResultInfo(HWND hwndDlg) continue; if (i) - str.Append(_T(", ")); + str.Append(L", "); - str.AppendFormat(_T("%d %s"), subtotal[i].count, pa->tszAccountName); + str.AppendFormat(L"%d %s", subtotal[i].count, pa->tszAccountName); } str.AppendChar(')'); } diff --git a/src/mir_app/src/services.cpp b/src/mir_app/src/services.cpp index 22206c3800..08eaadbbff 100644 --- a/src/mir_app/src/services.cpp +++ b/src/mir_app/src/services.cpp @@ -258,7 +258,7 @@ static int sttRegisterFontWorker(FontIDW *font_id, int _hLang) memcpy(newItem, font_id, font_id->cbSize); newItem->hLangpack = _hLang; - if (!mir_tstrcmp(newItem->deffontsettings.szFace, _T("MS Shell Dlg"))) { + if (!mir_tstrcmp(newItem->deffontsettings.szFace, L"MS Shell Dlg")) { LOGFONT lf; SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &lf, FALSE); mir_tstrncpy(newItem->deffontsettings.szFace, lf.lfFaceName, _countof(newItem->deffontsettings.szFace)); diff --git a/src/mir_app/src/skin2opts.cpp b/src/mir_app/src/skin2opts.cpp index 853a80cf3f..b8563f05ec 100644 --- a/src/mir_app/src/skin2opts.cpp +++ b/src/mir_app/src/skin2opts.cpp @@ -118,7 +118,7 @@ static void __fastcall MySetCursor(TCHAR* nCursor) static void LoadSectionIcons(TCHAR *filename, SectionItem* sectionActive) { TCHAR path[MAX_PATH]; - mir_sntprintf(path, _T("%s,"), filename); + mir_sntprintf(path, L"%s,", filename); size_t suffIndx = mir_tstrlen(path); mir_cslock lck(csIconList); @@ -230,26 +230,26 @@ static TCHAR* OpenFileDlg(HWND hParent, const TCHAR* szFile, BOOL bAll) mir_tstrcpy(filter, TranslateT("Icon sets")); if (bAll) - mir_tstrcat(filter, _T(" (*.dll;*.mir;*.icl;*.exe;*.ico)")); + mir_tstrcat(filter, L" (*.dll;*.mir;*.icl;*.exe;*.ico)"); else - mir_tstrcat(filter, _T(" (*.dll;*.mir)")); + mir_tstrcat(filter, L" (*.dll;*.mir)"); pfilter = filter + mir_tstrlen(filter) + 1; if (bAll) - mir_tstrcpy(pfilter, _T("*.DLL;*.MIR;*.ICL;*.EXE;*.ICO")); + mir_tstrcpy(pfilter, L"*.DLL;*.MIR;*.ICL;*.EXE;*.ICO"); else - mir_tstrcpy(pfilter, _T("*.DLL;*.MIR")); + mir_tstrcpy(pfilter, L"*.DLL;*.MIR"); pfilter += mir_tstrlen(pfilter) + 1; mir_tstrcpy(pfilter, TranslateT("All files")); - mir_tstrcat(pfilter, _T(" (*)")); + mir_tstrcat(pfilter, L" (*)"); pfilter += mir_tstrlen(pfilter) + 1; - mir_tstrcpy(pfilter, _T("*")); + mir_tstrcpy(pfilter, L"*"); pfilter += mir_tstrlen(pfilter) + 1; *pfilter = '\0'; ofn.lpstrFilter = filter; - ofn.lpstrDefExt = _T("dll"); + ofn.lpstrDefExt = L"dll"; mir_tstrncpy(file, szFile, _countof(file)); ofn.lpstrFile = file; ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_DONTADDTORECENT; @@ -387,7 +387,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SHAutoComplete(GetDlgItem(hwndDlg, IDC_ICONSET), 1); - SetDlgItemText(hwndDlg, IDC_ICONSET, _T("icons.dll")); + SetDlgItemText(hwndDlg, IDC_ICONSET, L"icons.dll"); return TRUE; case DM_REBUILDICONSPREVIEW: @@ -418,7 +418,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lvi.iItem = 0; int count = (int)_ExtractIconEx(filename, -1, 16, 16, NULL, LR_DEFAULTCOLOR); for (int i = 0; i < count; lvi.iItem++, i++) { - mir_sntprintf(caption, _T("%d"), i + 1); + mir_sntprintf(caption, L"%d", i + 1); lvi.pszText = caption; HICON hIcon = NULL; @@ -520,7 +520,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lvi.mask = LVIF_PARAM; lvi.iItem = dragItem; lvi.iSubItem = 0; ListView_GetItem(hPreview, &lvi); - mir_sntprintf(path, _T("%s,%d"), filename, (int)lvi.lParam); + mir_sntprintf(path, L"%s,%d", filename, (int)lvi.lParam); SendMessage(hwndParent, DM_CHANGEICON, dropHiLite, (LPARAM)path); ListView_SetItemState(GetDlgItem(hwndParent, IDC_PREVIEW), dropHiLite, 0, LVIS_DROPHILITED); } @@ -934,7 +934,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (item->temp_file) _tcsncpy_s(pInfoTip->pszText, pInfoTip->cchTextMax, item->temp_file, _TRUNCATE); else if (item->default_file) - mir_sntprintf(pInfoTip->pszText, pInfoTip->cchTextMax, _T("%s, %d"), item->default_file->file, item->default_indx); + mir_sntprintf(pInfoTip->pszText, pInfoTip->cchTextMax, L"%s, %d", item->default_file->file, item->default_indx); } } if (bNeedRebuild) { diff --git a/src/mir_app/src/skinicons.cpp b/src/mir_app/src/skinicons.cpp index b1639ae6a2..858ccabc22 100644 --- a/src/mir_app/src/skinicons.cpp +++ b/src/mir_app/src/skinicons.cpp @@ -278,7 +278,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) // Queried protocol isn't in list, adding TCHAR tszSection[MAX_PATH]; - mir_sntprintf(tszSection, _T(PROTOCOLS_PREFIX)_T("/%s"), pa->tszAccountName); + mir_sntprintf(tszSection, _T(PROTOCOLS_PREFIX)L"/%s", pa->tszAccountName); SKINICONDESC sid = { 0 }; sid.section.t = tszSection; @@ -287,11 +287,11 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) str = _tcsrchr(szPath, '\\'); if (str != NULL) *str = 0; - mir_sntprintf(szFullPath, _T("%s\\Icons\\proto_%S.dll"), szPath, pa->szProtoName); + mir_sntprintf(szFullPath, L"%s\\Icons\\proto_%S.dll", szPath, pa->szProtoName); if (GetFileAttributes(szFullPath) != INVALID_FILE_ATTRIBUTES) sid.defaultFile.t = szFullPath; else { - mir_sntprintf(szFullPath, _T("%s\\Plugins\\%S.dll"), szPath, szProto); + mir_sntprintf(szFullPath, L"%s\\Plugins\\%S.dll", szPath, szProto); if (int(ExtractIconEx(szFullPath, statusIcons[statusIndx].resource_id, NULL, &hIcon, 1)) > 0) { DestroyIcon(hIcon); sid.defaultFile.t = szFullPath; diff --git a/src/mir_app/src/sounds.cpp b/src/mir_app/src/sounds.cpp index 7492025ef3..abda0e43fd 100644 --- a/src/mir_app/src/sounds.cpp +++ b/src/mir_app/src/sounds.cpp @@ -86,7 +86,7 @@ static INT_PTR ServiceSkinAddNewSound(WPARAM wParam, LPARAM lParam) TCHAR* ptszDefaultFile; if (ssd->dwFlags & SSDF_UNICODE) { item->ptszDescription = mir_tstrdup(ssd->ptszDescription); - item->ptszSection = mir_tstrdup((ssd->pszSection != NULL) ? ssd->ptszSection : _T("Other")); + item->ptszSection = mir_tstrdup((ssd->pszSection != NULL) ? ssd->ptszSection : L"Other"); ptszDefaultFile = mir_tstrdup(ssd->ptszDefaultFile); } else { @@ -301,15 +301,15 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM db_free(&dbv); } } } - _tcsncpy_s(strFull, (snd.ptszTempFile ? snd.ptszTempFile : _T("")), _TRUNCATE); + _tcsncpy_s(strFull, (snd.ptszTempFile ? snd.ptszTempFile : L""), _TRUNCATE); PathToAbsoluteT(strFull, strdir); OPENFILENAME ofn; memset(&ofn, 0, sizeof(ofn)); - if (GetModuleHandle(_T("bass_interface.dll"))) - mir_sntprintf(filter, _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%s (*)%c*%c"), TranslateT("Sound files"), 0, 0, TranslateT("All files"), 0, 0); + if (GetModuleHandle(L"bass_interface.dll")) + mir_sntprintf(filter, L"%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%s (*)%c*%c", TranslateT("Sound files"), 0, 0, TranslateT("All files"), 0, 0); else - mir_sntprintf(filter, _T("%s (*.wav)%c*.wav%c%s (*)%c*%c"), TranslateT("WAV files"), 0, 0, TranslateT("All files"), 0, 0); + mir_sntprintf(filter, L"%s (*.wav)%c*.wav%c%s (*)%c*%c", TranslateT("WAV files"), 0, 0, TranslateT("All files"), 0, 0); ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; ofn.hwndOwner = GetParent(hwndDlg); ofn.hInstance = NULL; @@ -326,7 +326,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ofn.Flags = OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_EXPLORER|OFN_LONGNAMES|OFN_NOCHANGEDIR; ofn.nMaxFile = _countof(str); ofn.nMaxFileTitle = MAX_PATH; - ofn.lpstrDefExt = _T("wav"); + ofn.lpstrDefExt = L"wav"; if (!GetOpenFileName(&ofn)) break; @@ -388,7 +388,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SendMessage(hwndDlg, DM_HIDEPANE, 0, 0); else { TCHAR buf[256]; - mir_sntprintf(buf, _T("%s: %s"), arSounds[tvi.lParam].getSection(), arSounds[tvi.lParam].getDescr()); + mir_sntprintf(buf, L"%s: %s", arSounds[tvi.lParam].getSection(), arSounds[tvi.lParam].getDescr()); SetDlgItemText(hwndDlg, IDC_NAMEVAL, buf); if (arSounds[tvi.lParam].ptszTempFile) SetDlgItemText(hwndDlg, IDC_LOCATION, arSounds[tvi.lParam].ptszTempFile); -- cgit v1.2.3