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/core/stdauth/src/authdialogs.cpp | 20 ++--- src/core/stdaway/src/sendmsg.cpp | 6 +- src/core/stdchat/src/options.cpp | 6 +- src/core/stdchat/src/tools.cpp | 6 +- src/core/stdchat/src/window.cpp | 54 +++++++------- src/core/stdclist/src/clcfonts.cpp | 2 +- src/core/stdclist/src/clcopts.cpp | 4 +- src/core/stdclist/src/clcpaint.cpp | 2 +- src/core/stdclist/src/cluiopts.cpp | 2 +- src/core/stdcrypt/src/utils.cpp | 2 +- src/core/stdfile/src/file.cpp | 14 ++-- src/core/stdfile/src/fileexistsdlg.cpp | 16 ++-- src/core/stdfile/src/fileopts.cpp | 28 +++---- src/core/stdfile/src/filerecvdlg.cpp | 20 ++--- src/core/stdfile/src/filesenddlg.cpp | 6 +- src/core/stdfile/src/filexferdlg.cpp | 24 +++--- src/core/stdhelp/src/about.cpp | 6 +- src/core/stdmsg/src/msgdialog.cpp | 34 ++++----- src/core/stdmsg/src/msglog.cpp | 20 ++--- src/core/stdmsg/src/msgoptions.cpp | 20 ++--- src/core/stdmsg/src/msgs.cpp | 4 +- src/core/stdssl/src/netlibssl.cpp | 2 +- src/core/stduihist/src/history.cpp | 8 +- src/core/stduserinfo/src/contactinfo.cpp | 12 +-- src/core/stduserinfo/src/stdinfo.cpp | 8 +- src/core/stduserinfo/src/userinfo.cpp | 4 +- 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 ++-- src/mir_core/src/bitmaps.cpp | 10 +-- src/mir_core/src/cmdline.cpp | 8 +- src/mir_core/src/langpack.cpp | 34 ++++----- src/mir_core/src/logger.cpp | 10 +-- src/mir_core/src/miranda.cpp | 10 +-- src/mir_core/src/openurl.cpp | 12 +-- src/mir_core/src/path.cpp | 4 +- src/mir_core/src/threads.cpp | 2 +- src/mir_core/src/timezones.cpp | 22 +++--- src/mir_core/src/ui_utils.cpp | 2 +- src/mir_core/src/winver.cpp | 124 +++++++++++++++---------------- src/miranda32/src/miranda.cpp | 16 ++-- 97 files changed, 712 insertions(+), 712 deletions(-) (limited to 'src') diff --git a/src/core/stdauth/src/authdialogs.cpp b/src/core/stdauth/src/authdialogs.cpp index 9bb745a113..6ce9a9e66f 100644 --- a/src/core/stdauth/src/authdialogs.cpp +++ b/src/core/stdauth/src/authdialogs.cpp @@ -60,17 +60,17 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar TCHAR* nickT = dbei.flags & DBEF_UTF ? Utf8DecodeT(nick) : mir_a2t(nick); TCHAR* emailT = dbei.flags & DBEF_UTF ? Utf8DecodeT(email) : mir_a2t(email); - TCHAR name[128] = _T(""); + TCHAR name[128] = L""; int off = 0; if (firstT[0] && lastT[0]) - off = mir_sntprintf(name, _T("%s %s"), firstT, lastT); + off = mir_sntprintf(name, L"%s %s", firstT, lastT); else if (firstT[0]) - off = mir_sntprintf(name, _T("%s"), firstT); + off = mir_sntprintf(name, L"%s", firstT); else if (lastT[0]) - off = mir_sntprintf(name, _T("%s"), lastT); + off = mir_sntprintf(name, L"%s", lastT); if (nickT[0]) { if (off) - mir_sntprintf(name + off, _countof(name) - off, _T(" (%s)"), nickT); + mir_sntprintf(name + off, _countof(name) - off, L" (%s)", nickT); else _tcsncpy_s(name, nickT, _TRUNCATE); } @@ -185,17 +185,17 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ptrT emailT(dbei.flags & DBEF_UTF ? Utf8DecodeT(email) : mir_a2t(email)); ptrT reasonT(dbei.flags & DBEF_UTF ? Utf8DecodeT(reason) : mir_a2t(reason)); - TCHAR name[128] = _T(""); + TCHAR name[128] = L""; int off = 0; if (firstT[0] && lastT[0]) - off = mir_sntprintf(name, _T("%s %s"), (TCHAR*)firstT, (TCHAR*)lastT); + off = mir_sntprintf(name, L"%s %s", (TCHAR*)firstT, (TCHAR*)lastT); else if (firstT[0]) - off = mir_sntprintf(name, _T("%s"), (TCHAR*)firstT); + off = mir_sntprintf(name, L"%s", (TCHAR*)firstT); else if (lastT[0]) - off = mir_sntprintf(name, _T("%s"), (TCHAR*)lastT); + off = mir_sntprintf(name, L"%s", (TCHAR*)lastT); if (mir_tstrlen(nickT)) { if (off) - mir_sntprintf(name + off, _countof(name) - off, _T(" (%s)"), (TCHAR*)nickT); + mir_sntprintf(name + off, _countof(name) - off, L" (%s)", (TCHAR*)nickT); else _tcsncpy_s(name, nickT, _TRUNCATE); } diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp index b57afb57cd..c2460a8a34 100644 --- a/src/core/stdaway/src/sendmsg.cpp +++ b/src/core/stdaway/src/sendmsg.cpp @@ -101,7 +101,7 @@ static TCHAR* GetAwayMessage(int statusMode, char *szProto) continue; TCHAR substituteStr[128]; - if ( !_tcsnicmp(dbv.ptszVal + i, _T("%time%"), 6)) { + if ( !_tcsnicmp(dbv.ptszVal + i, L"%time%", 6)) { MIRANDA_IDLE_INFO mii = { sizeof(mii) }; CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii); @@ -117,7 +117,7 @@ static TCHAR* GetAwayMessage(int statusMode, char *szProto) } else GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, substituteStr, _countof(substituteStr)); } - else if ( !_tcsnicmp(dbv.ptszVal + i, _T("%date%"), 6)) + else if ( !_tcsnicmp(dbv.ptszVal + i, L"%date%", 6)) GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, substituteStr, _countof(substituteStr)); else continue; @@ -461,7 +461,7 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam CheckDlgButton(hwndDlg, IDC_USEPREVIOUS, (i < 0 ? 0 : dat->info[i].usePrevious) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_USESPECIFIC, (i < 0 ? 0 : !dat->info[i].usePrevious) ? BST_CHECKED : BST_UNCHECKED); - SetDlgItemText(hwndDlg, IDC_MSG, i < 0 ? _T("") : dat->info[i].msg); + SetDlgItemText(hwndDlg, IDC_MSG, i < 0 ? L"" : dat->info[i].msg); EnableWindow(GetDlgItem(hwndDlg, IDC_NODIALOG), i < 0 ? 0 : !dat->info[i].ignore); EnableWindow(GetDlgItem(hwndDlg, IDC_USEPREVIOUS), i < 0 ? 0 : !dat->info[i].ignore); diff --git a/src/core/stdchat/src/options.cpp b/src/core/stdchat/src/options.cpp index b5ddfdc7d4..1bd3a33c5c 100644 --- a/src/core/stdchat/src/options.cpp +++ b/src/core/stdchat/src/options.cpp @@ -485,7 +485,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, SendDlgItemMessage(hwndDlg, IDC_SPIN4, UDM_SETPOS, 0, MAKELONG(db_get_b(NULL, CHAT_MODULE, "NicklistRowDist", 12), 0)); { TCHAR* pszGroup = NULL; - InitSetting(&pszGroup, "AddToGroup", _T("Chat rooms")); + InitSetting(&pszGroup, "AddToGroup", L"Chat rooms"); SetDlgItemText(hwndDlg, IDC_GROUP, pszGroup); mir_free(pszGroup); } @@ -542,9 +542,9 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPITEMIDLIST idList = SHBrowseForFolder(&bi); if (idList) { SHGetPathFromIDList(idList, szDirectory); - mir_tstrcat(szDirectory, _T("\\")); + mir_tstrcat(szDirectory, L"\\"); PathToRelativeT(szDirectory, szTemp); - SetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, mir_tstrlen(szTemp) > 1 ? szTemp : _T("Logs\\")); + SetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, mir_tstrlen(szTemp) > 1 ? szTemp : L"Logs\\"); CoTaskMemFree(idList); } } diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp index 1068df1ef9..56765958bd 100644 --- a/src/core/stdchat/src/tools.cpp +++ b/src/core/stdchat/src/tools.cpp @@ -51,7 +51,7 @@ bool LoadMessageFont(LOGFONT *lf, COLORREF *colour) DBVARIANT dbv; if (db_get_ts(NULL, "SRMM", str, &dbv)) - mir_tstrcpy(lf->lfFaceName, _T("Arial")); + mir_tstrcpy(lf->lfFaceName, L"Arial"); else { mir_tstrncpy(lf->lfFaceName, dbv.ptszVal, _countof(lf->lfFaceName)); db_free(&dbv); @@ -149,7 +149,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO mir_tstrncpy(szTemp, TranslateT("&Message"), _countof(szTemp) - 1); if (mir_tstrlen(szTemp) > 40) - mir_tstrcpy(szTemp + 40, _T("...")); + mir_tstrcpy(szTemp + 40, L"..."); ModifyMenu(*hMenu, ID_MESS, MF_STRING | MF_BYCOMMAND, ID_MESS, szTemp); gcmi.Type = MENU_ON_NICKLIST; } @@ -202,7 +202,7 @@ void DestroyGCMenu(HMENU *hMenu, int iIndex) void ValidateFilename(TCHAR *filename) { TCHAR *p1 = filename; - TCHAR szForbidden[] = _T("\\/:*?\"<>|"); + TCHAR szForbidden[] = L"\\/:*?\"<>|"; while (*p1 != '\0') { if (_tcschr(szForbidden, *p1)) *p1 = '_'; diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index eff7d1c9bd..7fdbf8f562 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -30,7 +30,7 @@ struct MESSAGESUBDATA TCHAR szTabSave[20]; }; -static TCHAR szTrimString[] = _T(":;,.!?\'\"><()[]- \r\n"); +static TCHAR szTrimString[] = L":;,.!?\'\"><()[]- \r\n"; static LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -524,7 +524,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, ste.codepage = CP_ACP; SendMessage(hwnd, EM_SETTEXTEX, (WPARAM)&ste, (LPARAM)lpPrevCmd); } - else SetWindowText(hwnd, _T("")); + else SetWindowText(hwnd, L""); GETTEXTLENGTHEX gtl = { 0 }; gtl.flags = GTL_PRECISE; @@ -548,7 +548,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, ste.codepage = CP_ACP; SendMessage(hwnd, EM_SETTEXTEX, (WPARAM)&ste, (LPARAM)lpPrevCmd); } - else SetWindowText(hwnd, _T("")); + else SetWindowText(hwnd, L""); GETTEXTLENGTHEX gtl = { 0 }; gtl.flags = GTL_PRECISE; @@ -619,7 +619,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, break; case ID_MESSAGE_CLEAR: - SetWindowText(hwnd, _T("")); + SetWindowText(hwnd, L""); break; } PostMessage(hwnd, WM_KEYUP, 0, 0); @@ -996,7 +996,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *si } if (tszBuf[0] == 0) - mir_sntprintf(tszBuf, _T("%s: %s\r\n%s: %s\r\n%s: %s"), + mir_sntprintf(tszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s", TranslateT("Nickname"), ui->pszNick, TranslateT("Unique ID"), ui->pszUID, TranslateT("Status"), pci->TM_WordToString(si->pStatuses, ui->Status)); @@ -1292,8 +1292,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETCHARFORMAT, (WPARAM)SCF_ALL, (LPARAM)&cf); // nicklist - int ih = GetTextPixelSize(_T("AQGglo"), g_Settings.UserListFont, FALSE); - int ih2 = GetTextPixelSize(_T("AQGglo"), g_Settings.UserListHeadingsFont, FALSE); + int ih = GetTextPixelSize(L"AQGglo", g_Settings.UserListFont, FALSE); + int ih2 = GetTextPixelSize(L"AQGglo", g_Settings.UserListHeadingsFont, FALSE); int height = db_get_b(NULL, CHAT_MODULE, "NicklistRowDist", 12); int font = ih > ih2 ? ih : ih2; @@ -1324,7 +1324,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar si->ptszName, si->nUsersInNicklist); break; case GCW_SERVER: - mir_sntprintf(szTemp, _T("%s: Server"), si->ptszName); + mir_sntprintf(szTemp, L"%s: Server", si->ptszName); break; } SetWindowText(hwndDlg, szTemp); @@ -1353,8 +1353,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar SendMessage(si->hwndStatus, SB_SETTEXT, 0, (LPARAM)ptszDispName); - SendMessage(si->hwndStatus, SB_SETTEXT, 1, (LPARAM)(si->ptszStatusbarText ? si->ptszStatusbarText : _T(""))); - SendMessage(si->hwndStatus, SB_SETTIPTEXT, 1, (LPARAM)(si->ptszStatusbarText ? si->ptszStatusbarText : _T(""))); + SendMessage(si->hwndStatus, SB_SETTEXT, 1, (LPARAM)(si->ptszStatusbarText ? si->ptszStatusbarText : L"")); + SendMessage(si->hwndStatus, SB_SETTIPTEXT, 1, (LPARAM)(si->ptszStatusbarText ? si->ptszStatusbarText : L"")); } return TRUE; @@ -1607,7 +1607,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar mir_tstrncpy(szTemp, s1->ptszName, 21); if (mir_tstrlen(s1->ptszName) > 20) - mir_tstrncpy(szTemp + 20, _T("..."), 4); + mir_tstrncpy(szTemp + 20, L"...", 4); tci.mask = TCIF_TEXT | TCIF_PARAM; tci.pszText = szTemp; @@ -1797,7 +1797,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case GC_ACKMESSAGE: SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETREADONLY, FALSE, 0); - SetDlgItemText(hwndDlg, IDC_MESSAGE, _T("")); + SetDlgItemText(hwndDlg, IDC_MESSAGE, L""); return TRUE; case WM_CTLCOLORLISTBOX: @@ -1810,8 +1810,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (mis->CtlType == ODT_MENU) return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); - int ih = GetTextPixelSize(_T("AQGgl'"), g_Settings.UserListFont, FALSE); - int ih2 = GetTextPixelSize(_T("AQGg'"), g_Settings.UserListHeadingsFont, FALSE); + int ih = GetTextPixelSize(L"AQGgl'", g_Settings.UserListFont, FALSE); + int ih2 = GetTextPixelSize(L"AQGg'", g_Settings.UserListHeadingsFont, FALSE); int font = ih > ih2 ? ih : ih2; int height = db_get_b(NULL, CHAT_MODULE, "NicklistRowDist", 12); @@ -1902,7 +1902,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar return TRUE; case WINDOW_CLEARLOG: - SetDlgItemText(hwndDlg, IDC_LOG, _T("")); + SetDlgItemText(hwndDlg, IDC_LOG, L""); return TRUE; case SESSION_TERMINATE: @@ -2221,7 +2221,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar { SESSION_INFO *s = pci->SM_FindSession(si->ptszID, si->pszModule); if (s) { - SetDlgItemText(hwndDlg, IDC_LOG, _T("")); + SetDlgItemText(hwndDlg, IDC_LOG, L""); pci->LM_RemoveAll(&s->pLog, &s->pLogEnd); s->iEventCount = 0; s->LastTime = 0; @@ -2236,14 +2236,14 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case ID_SEARCH_GOOGLE: if (pszWord[0]) - Utils_OpenUrlT(CMString(FORMAT, _T("http://www.google.com/search?q=%s"), pszWord)); + Utils_OpenUrlT(CMString(FORMAT, L"http://www.google.com/search?q=%s", pszWord)); PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0); break; case ID_SEARCH_WIKIPEDIA: if (pszWord[0]) - Utils_OpenUrlT(CMString(FORMAT, _T("http://en.wikipedia.org/wiki/%s"), pszWord)); + Utils_OpenUrlT(CMString(FORMAT, L"http://en.wikipedia.org/wiki/%s", pszWord)); PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0); break; @@ -2331,7 +2331,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item); if (ui != NULL) { static TCHAR ptszBuf[1024]; - mir_sntprintf(ptszBuf, _T("%s: %s\r\n%s: %s\r\n%s: %s"), + mir_sntprintf(ptszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s", TranslateT("Nickname"), ui->pszNick, TranslateT("Unique ID"), ui->pszUID, TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui->Status)); @@ -2359,9 +2359,9 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar size_t dwNameLenMax = (mir_tstrlen(ui->pszUID) + 3); TCHAR* pszName = (TCHAR*)alloca(sizeof(TCHAR) * dwNameLenMax); if (start == 0) - mir_sntprintf(pszName, dwNameLenMax, _T("%s: "), ui->pszUID); + mir_sntprintf(pszName, dwNameLenMax, L"%s: ", ui->pszUID); else - mir_sntprintf(pszName, dwNameLenMax, _T("%s "), ui->pszUID); + mir_sntprintf(pszName, dwNameLenMax, L"%s ", ui->pszUID); SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_REPLACESEL, FALSE, (LPARAM)pszName); PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0); @@ -2391,13 +2391,13 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar CMString ptszText(ptrT(mir_utf8decodeT(pszRtf))); pci->DoRtfToTags(ptszText, mi->nColorCount, mi->crColors); ptszText.Trim(); - ptszText.Replace(_T("%"), _T("%%")); + ptszText.Replace(L"%", L"%%"); if (mi->bAckMsg) { EnableWindow(GetDlgItem(hwndDlg, IDC_MESSAGE), FALSE); SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETREADONLY, TRUE, 0); } - else SetDlgItemText(hwndDlg, IDC_MESSAGE, _T("")); + else SetDlgItemText(hwndDlg, IDC_MESSAGE, L""); EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE); @@ -2450,12 +2450,12 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar _tcsncpy_s(szName, (pInfo->ptszModDispName ? pInfo->ptszModDispName : _A2T(si->pszModule)), _TRUNCATE); ValidateFilename(szName); - mir_sntprintf(szFolder, _T("%s\\%s"), g_Settings.pszLogDir, szName); - mir_sntprintf(szName, _T("%s.log"), si->ptszID); + mir_sntprintf(szFolder, L"%s\\%s", g_Settings.pszLogDir, szName); + mir_sntprintf(szName, L"%s.log", si->ptszID); ValidateFilename(szName); - mir_sntprintf(szFile, _T("%s\\%s"), szFolder, szName); - ShellExecute(hwndDlg, _T("open"), szFile, NULL, NULL, SW_SHOW); + mir_sntprintf(szFile, L"%s\\%s", szFolder, szName); + ShellExecute(hwndDlg, L"open", szFile, NULL, NULL, SW_SHOW); } } break; diff --git a/src/core/stdclist/src/clcfonts.cpp b/src/core/stdclist/src/clcfonts.cpp index 316675b312..79150a51f4 100644 --- a/src/core/stdclist/src/clcfonts.cpp +++ b/src/core/stdclist/src/clcfonts.cpp @@ -129,7 +129,7 @@ void LoadClcOptions(HWND hwnd, struct ClcData *dat, BOOL bFirst) HFONT holdfont = (HFONT)SelectObject(hdc, dat->fontInfo[i].hFont); SIZE fontSize; - GetTextExtentPoint32(hdc, _T("x"), 1, &fontSize); + GetTextExtentPoint32(hdc, L"x", 1, &fontSize); SelectObject(hdc, holdfont); dat->fontInfo[i].fontHeight = fontSize.cy; diff --git a/src/core/stdclist/src/clcopts.cpp b/src/core/stdclist/src/clcopts.cpp index 37747c7b2b..ef529785e9 100644 --- a/src/core/stdclist/src/clcopts.cpp +++ b/src/core/stdclist/src/clcopts.cpp @@ -129,7 +129,7 @@ static LONG CalcMinRowHeight() HFONT hFont = CreateFontIndirect(&lf); hFont = (HFONT)SelectObject(hdc, hFont); SIZE fontSize; - GetTextExtentPoint32(hdc, _T("x"), 1, &fontSize); + GetTextExtentPoint32(hdc, L"x", 1, &fontSize); if (fontSize.cy > minHeight) minHeight = fontSize.cy; hFont = (HFONT)SelectObject(hdc, hFont); @@ -353,7 +353,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; ofn.nMaxFile = _countof(str); ofn.nMaxFileTitle = MAX_PATH; - ofn.lpstrDefExt = _T("bmp"); + ofn.lpstrDefExt = L"bmp"; if (!GetOpenFileName(&ofn)) break; SetDlgItemText(hwndDlg, IDC_FILENAME, str); diff --git a/src/core/stdclist/src/clcpaint.cpp b/src/core/stdclist/src/clcpaint.cpp index d95d126fbd..3360176522 100644 --- a/src/core/stdclist/src/clcpaint.cpp +++ b/src/core/stdclist/src/clcpaint.cpp @@ -320,7 +320,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) if (cc->type == CLCIT_GROUP) { ptszGroupCount = pcli->pfnGetGroupCountsText(dat, cc); if (*ptszGroupCount) { - GetTextExtentPoint32(hdcMem, _T(" "), 1, &spaceSize); + GetTextExtentPoint32(hdcMem, L" ", 1, &spaceSize); ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight); GetTextExtentPoint32(hdcMem, ptszGroupCount, (int)mir_tstrlen(ptszGroupCount), &countsSize); width += spaceSize.cx + countsSize.cx; diff --git a/src/core/stdclist/src/cluiopts.cpp b/src/core/stdclist/src/cluiopts.cpp index 82c9eb6ef9..00f163105c 100644 --- a/src/core/stdclist/src/cluiopts.cpp +++ b/src/core/stdclist/src/cluiopts.cpp @@ -195,7 +195,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW | WS_EX_APPWINDOW); if (IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)) { - HWND hProgMan = FindWindow(_T("Progman"), NULL); + HWND hProgMan = FindWindow(L"Progman", NULL); if (hProgMan) SetParent(pcli->hwndContactList, hProgMan); } diff --git a/src/core/stdcrypt/src/utils.cpp b/src/core/stdcrypt/src/utils.cpp index a669540320..04ac8bab4f 100644 --- a/src/core/stdcrypt/src/utils.cpp +++ b/src/core/stdcrypt/src/utils.cpp @@ -27,7 +27,7 @@ bool getRandomBytes(BYTE *buf, size_t bufLen) { // try to use Intel hardware randomizer first HCRYPTPROV hProvider = NULL; - if (::CryptAcquireContext(&hProvider, NULL, _T("Intel Hardware Cryptographic Service Provider"), PROV_INTEL_SEC, 0) || + if (::CryptAcquireContext(&hProvider, NULL, L"Intel Hardware Cryptographic Service Provider", PROV_INTEL_SEC, 0) || ::CryptAcquireContext(&hProvider, NULL, MS_STRONG_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT) || ::CryptAcquireContext(&hProvider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 2e6409bbfd..a9f28f51d9 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -164,11 +164,11 @@ void GetSensiblyFormattedSize(__int64 size, TCHAR *szOut, int cchOut, int unitsO *unitsUsed = unitsOverride; switch (unitsOverride) { - case UNITS_BYTES: mir_sntprintf(szOut, cchOut, _T("%u%s%s"), (int)size, appendUnits ? _T(" ") : _T(""), appendUnits ? TranslateT("bytes") : _T("")); break; - case UNITS_KBPOINT1: mir_sntprintf(szOut, cchOut, _T("%.1lf%s"), size / 1024.0, appendUnits ? _T(" KB") : _T("")); break; - case UNITS_KBPOINT0: mir_sntprintf(szOut, cchOut, _T("%u%s"), (int)(size / 1024), appendUnits ? _T(" KB") : _T("")); break; - case UNITS_GBPOINT3: mir_sntprintf(szOut, cchOut, _T("%.3f%s"), (size >> 20) / 1024.0, appendUnits ? _T(" GB") : _T("")); break; - default: mir_sntprintf(szOut, cchOut, _T("%.2lf%s"), size / 1048576.0, appendUnits ? _T(" MB") : _T("")); break; + case UNITS_BYTES: mir_sntprintf(szOut, cchOut, L"%u%s%s", (int)size, appendUnits ? L" " : L"", appendUnits ? TranslateT("bytes") : L""); break; + case UNITS_KBPOINT1: mir_sntprintf(szOut, cchOut, L"%.1lf%s", size / 1024.0, appendUnits ? L" KB" : L""); break; + case UNITS_KBPOINT0: mir_sntprintf(szOut, cchOut, L"%u%s", (int)(size / 1024), appendUnits ? L" KB" : L""); break; + case UNITS_GBPOINT3: mir_sntprintf(szOut, cchOut, L"%.3f%s", (size >> 20) / 1024.0, appendUnits ? L" GB" : L""); break; + default: mir_sntprintf(szOut, cchOut, L"%.2lf%s", size / 1048576.0, appendUnits ? L" MB" : L""); break; } } @@ -338,7 +338,7 @@ INT_PTR openContRecDir(WPARAM hContact, LPARAM) { TCHAR szContRecDir[MAX_PATH]; GetContactReceivedFilesDir(hContact, szContRecDir, _countof(szContRecDir), TRUE); - ShellExecute(0, _T("open"), szContRecDir, 0, 0, SW_SHOW); + ShellExecute(0, L"open", szContRecDir, 0, 0, SW_SHOW); return 0; } @@ -346,7 +346,7 @@ INT_PTR openRecDir(WPARAM, LPARAM) { TCHAR szContRecDir[MAX_PATH]; GetReceivedFilesDir(szContRecDir, _countof(szContRecDir)); - ShellExecute(0, _T("open"), szContRecDir, 0, 0, SW_SHOW); + ShellExecute(0, L"open", szContRecDir, 0, 0, SW_SHOW); return 0; } diff --git a/src/core/stdfile/src/fileexistsdlg.cpp b/src/core/stdfile/src/fileexistsdlg.cpp index 14561bde0e..a5243ee528 100644 --- a/src/core/stdfile/src/fileexistsdlg.cpp +++ b/src/core/stdfile/src/fileexistsdlg.cpp @@ -151,7 +151,7 @@ void __cdecl LoadIconsAndTypesThread(void* param) if (pszExtension) mir_tstrncpy(szExtension, pszExtension + 1, _countof(szExtension)); else { - pszExtension = _T("."); + pszExtension = L"."; szExtension[0] = '\0'; } CharUpper(szExtension); @@ -161,15 +161,15 @@ void __cdecl LoadIconsAndTypesThread(void* param) SetDlgItemText(info->hwndDlg, IDC_NEWTYPE, fileInfo.szTypeName); SendDlgItemMessage(info->hwndDlg, IDC_EXISTINGICON, STM_SETICON, (WPARAM)fileInfo.hIcon, 0); szIconFile[0] = '\0'; - if (!mir_tstrcmp(szExtension, _T("EXE"))) - SRFile_GetRegValue(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons"), _T("2"), szIconFile, _countof(szIconFile)); + if (!mir_tstrcmp(szExtension, L"EXE")) + SRFile_GetRegValue(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons", L"2", szIconFile, _countof(szIconFile)); else { TCHAR szTypeName[MAX_PATH]; if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, pszExtension, NULL, szTypeName, _countof(szTypeName))) { - mir_tstrcat(szTypeName, _T("\\DefaultIcon")); + mir_tstrcat(szTypeName, L"\\DefaultIcon"); if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, szTypeName, NULL, szIconFile, _countof(szIconFile))) { - if (_tcsstr(szIconFile, _T("%1"))) - SRFile_GetRegValue(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons"), _T("0"), szIconFile, _countof(szIconFile)); + if (_tcsstr(szIconFile, L"%1")) + SRFile_GetRegValue(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons", L"0", szIconFile, _countof(szIconFile)); else szIconFile[0] = '\0'; } } @@ -288,9 +288,9 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ofn.hwndOwner = hwndDlg; ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY; _tcsncpy(filter, TranslateT("All files"),_countof(filter)-1); - mir_tstrcat(filter, _T(" (*)")); + mir_tstrcat(filter, L" (*)"); pfilter = filter + mir_tstrlen(filter) + 1; - mir_tstrcpy(pfilter, _T("*")); + mir_tstrcpy(pfilter, L"*"); pfilter = pfilter + mir_tstrlen(pfilter) + 1; *pfilter = '\0'; ofn.lpstrFilter = filter; diff --git a/src/core/stdfile/src/fileopts.cpp b/src/core/stdfile/src/fileopts.cpp index 7251c276ae..c608f7311a 100644 --- a/src/core/stdfile/src/fileopts.cpp +++ b/src/core/stdfile/src/fileopts.cpp @@ -35,16 +35,16 @@ struct virusscannerinfo { const TCHAR *szExeRegValue; const TCHAR *szCommandLine; } virusScanners[] = { - {_T("Network Associates/McAfee VirusScan"), _T("SOFTWARE\\McAfee\\VirusScan"), _T("Scan32EXE"), _T("\"%s\" %%f /nosplash /comp /autoscan /autoexit /noboot")}, - {_T("Dr Solomon's VirusScan (Network Associates)"), _T("SOFTWARE\\Network Associates\\TVD\\VirusScan\\AVConsol\\General"), _T("szScannerExe"), _T("\"%s\" %%f /uinone /noboot /comp /prompt /autoexit")}, - {_T("Norton AntiVirus"), _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Navw32.exe"), NULL, _T("\"%s\" %%f /b- /m- /s+ /noresults")}, - {_T("Computer Associates/Inoculate IT"), _T("Software\\Antivirus"), _T("ImageFilename"), _T("\"%s\" %%f /display = progress /exit")}, - {_T("Computer Associates eTrust"), _T("SOFTWARE\\ComputerAssociates\\Anti-Virus\\Resident"), _T("VetPath"), _T("\"%s\" %%f /display = progress /exit")}, - {_T("Kaspersky Anti-Virus"), _T("SOFTWARE\\KasperskyLab\\Components\\101"), _T("EXEName"), _T("\"%s\" /S /Q %%f")}, - {_T("Kaspersky Anti-Virus"), _T("SOFTWARE\\KasperskyLab\\SetupFolders"), _T("KAV8"), _T("\"%savp.exe\" SCAN %%f")}, - {_T("Kaspersky Anti-Virus"), _T("SOFTWARE\\KasperskyLab\\SetupFolders"), _T("KAV9"), _T("\"%savp.exe\" SCAN %%f")}, - {_T("AntiVir PersonalEdition Classic"), _T("SOFTWARE\\Avira\\AntiVir PersonalEdition Classic"), _T("Path"), _T("\"%savscan.exe\" /GUIMODE = 2 /PATH = \"%%f\"")}, - {_T("ESET NOD32 Antivirus"), _T("SOFTWARE\\ESET\\ESET Security\\CurrentVersion\\Info"), _T("InstallDir"), _T("\"%secls.exe\" /log-all /aind /no-boots /adware /sfx /unsafe /unwanted /heur /adv-heur /action = clean \"%%f\"")}, + {L"Network Associates/McAfee VirusScan", L"SOFTWARE\\McAfee\\VirusScan", L"Scan32EXE", L"\"%s\" %%f /nosplash /comp /autoscan /autoexit /noboot"}, + {L"Dr Solomon's VirusScan (Network Associates)", L"SOFTWARE\\Network Associates\\TVD\\VirusScan\\AVConsol\\General", L"szScannerExe", L"\"%s\" %%f /uinone /noboot /comp /prompt /autoexit"}, + {L"Norton AntiVirus", L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Navw32.exe", NULL, L"\"%s\" %%f /b- /m- /s+ /noresults"}, + {L"Computer Associates/Inoculate IT", L"Software\\Antivirus", L"ImageFilename", L"\"%s\" %%f /display = progress /exit"}, + {L"Computer Associates eTrust", L"SOFTWARE\\ComputerAssociates\\Anti-Virus\\Resident", L"VetPath", L"\"%s\" %%f /display = progress /exit"}, + {L"Kaspersky Anti-Virus", L"SOFTWARE\\KasperskyLab\\Components\\101", L"EXEName", L"\"%s\" /S /Q %%f"}, + {L"Kaspersky Anti-Virus", L"SOFTWARE\\KasperskyLab\\SetupFolders", L"KAV8", L"\"%savp.exe\" SCAN %%f"}, + {L"Kaspersky Anti-Virus", L"SOFTWARE\\KasperskyLab\\SetupFolders", L"KAV9", L"\"%savp.exe\" SCAN %%f"}, + {L"AntiVir PersonalEdition Classic", L"SOFTWARE\\Avira\\AntiVir PersonalEdition Classic", L"Path", L"\"%savscan.exe\" /GUIMODE = 2 /PATH = \"%%f\""}, + {L"ESET NOD32 Antivirus", L"SOFTWARE\\ESET\\ESET Security\\CurrentVersion\\Info", L"InstallDir", L"\"%secls.exe\" /log-all /aind /no-boots /adware /sfx /unsafe /unwanted /heur /adv-heur /action = clean \"%%f\""}, }; #define M_UPDATEENABLING (WM_USER+100) @@ -85,7 +85,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L } } if (SendDlgItemMessageA(hwndDlg, IDC_SCANCMDLINE, CB_GETCOUNT, 0, 0) == 0) { - int iItem = SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_ADDSTRING, 0, (LPARAM)_T("")); + int iItem = SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_ADDSTRING, 0, (LPARAM)L""); SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_SETITEMDATA, iItem, (LPARAM)-1); } @@ -166,8 +166,8 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L GetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str, _countof(str)); CMString tszFilter; - tszFilter.AppendFormat(_T("%s (*.exe)%c*.exe%c"), TranslateT("Executable files"), 0, 0); - tszFilter.AppendFormat(_T("%s (*)%c*%c"), TranslateT("All files"), 0, 0); + tszFilter.AppendFormat(L"%s (*.exe)%c*.exe%c", TranslateT("Executable files"), 0, 0); + tszFilter.AppendFormat(L"%s (*)%c*%c", TranslateT("All files"), 0, 0); OPENFILENAME ofn = { 0 }; ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; @@ -191,7 +191,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L if (_tcschr(str, ' ') != NULL) { memmove(str + 1, str, ((_countof(str) - 2) * sizeof(TCHAR))); str[0] = '"'; - mir_tstrcat(str, _T("\"")); + mir_tstrcat(str, L"\""); } SetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str); break; diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index 637ab19208..3c75d282c0 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -48,7 +48,7 @@ static void GetLowestExistingDirName(const TCHAR *szTestDir, TCHAR *szExistingDi GetCurrentDirectory(cchExistingDir, szExistingDir); } -static const TCHAR InvalidFilenameChars[] = _T("\\/:*?\"<>|"); +static const TCHAR InvalidFilenameChars[] = L"\\/:*?\"<>|"; void RemoveInvalidFilenameChars(TCHAR *tszString) { size_t i; @@ -58,7 +58,7 @@ void RemoveInvalidFilenameChars(TCHAR *tszString) } } -static const TCHAR InvalidPathChars[] = _T("*?\"<>|"); // "\/:" are excluded as they are allowed in file path +static const TCHAR InvalidPathChars[] = L"*?\"<>|"; // "\/:" are excluded as they are allowed in file path void RemoveInvalidPathChars(TCHAR *tszString) { if (tszString) @@ -94,7 +94,7 @@ int BrowseForFolder(HWND hwnd, TCHAR *szPath) LPITEMIDLIST pidlResult = SHBrowseForFolder(&bi); if (pidlResult) { SHGetPathFromIDList(pidlResult, szPath); - mir_tstrcat(szPath, _T("\\")); + mir_tstrcat(szPath, L"\\"); CoTaskMemFree(pidlResult); } return pidlResult != NULL; @@ -118,7 +118,7 @@ static void patchDir(TCHAR *str, size_t strSize) size_t len = mir_tstrlen(str); if (len + 1 < strSize && str[len - 1] != '\\') - mir_tstrcpy(str + len, _T("\\")); + mir_tstrcpy(str + len, L"\\"); } void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOOL patchVars) @@ -129,17 +129,17 @@ void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOO if (tszRecvPath) _tcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE); else - mir_sntprintf(tszTemp, _T("%%mydocuments%%\\%s\\%%userid%%"), TranslateT("My received files")); + mir_sntprintf(tszTemp, L"%%mydocuments%%\\%s\\%%userid%%", TranslateT("My received files")); if (hContact) { hContact = db_mc_tryMeta(hContact); REPLACEVARSARRAY rvaVarsToReplace[4]; - rvaVarsToReplace[0].key.t = _T("nick"); + rvaVarsToReplace[0].key.t = L"nick"; rvaVarsToReplace[0].value.t = mir_tstrdup((TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0)); - rvaVarsToReplace[1].key.t = _T("userid"); + rvaVarsToReplace[1].key.t = L"userid"; rvaVarsToReplace[1].value.t = GetContactID(hContact); - rvaVarsToReplace[2].key.t = _T("proto"); + rvaVarsToReplace[2].key.t = L"proto"; rvaVarsToReplace[2].value.t = mir_a2t(GetContactProto(hContact)); rvaVarsToReplace[3].key.t = NULL; rvaVarsToReplace[3].value.t = NULL; @@ -169,7 +169,7 @@ void GetReceivedFilesDir(TCHAR *szDir, int cchDir) if (tszRecvPath) _tcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE); else - mir_sntprintf(tszTemp, _T("%%mydocuments%%\\%s\\%%userid%%"), TranslateT("My received files")); + mir_sntprintf(tszTemp, L"%%mydocuments%%\\%s\\%%userid%%", TranslateT("My received files")); patchDir(tszTemp, _countof(tszTemp)); RemoveInvalidPathChars(tszTemp); @@ -244,7 +244,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l else DestroyWindow(hwndDlg); TCHAR datetimestr[64]; - TimeZone_PrintTimeStamp(NULL, dbei.timestamp, _T("t d"), datetimestr, _countof(datetimestr), 0); + TimeZone_PrintTimeStamp(NULL, dbei.timestamp, L"t d", datetimestr, _countof(datetimestr), 0); SetDlgItemText(hwndDlg, IDC_DATE, datetimestr); ptrT info(Contact_GetInfo(CNF_UNIQUEID, dat->hContact)); diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp index 54c6a9a786..318dcab932 100644 --- a/src/core/stdfile/src/filesenddlg.cpp +++ b/src/core/stdfile/src/filesenddlg.cpp @@ -49,7 +49,7 @@ static void SetFileListAndSizeControls(HWND hwndDlg, FileDlgData *dat) if (i > 1) { TCHAR szFormat[32]; if (fileCount && dirCount) { - mir_sntprintf(szFormat, _T("%s, %s"), TranslateTS(fileCount == 1 ? _T("%d file") : _T("%d files")), TranslateTS(dirCount == 1 ? _T("%d directory") : _T("%d directories"))); + mir_sntprintf(szFormat, L"%s, %s", TranslateTS(fileCount == 1 ? L"%d file" : L"%d files"), TranslateTS(dirCount == 1 ? L"%d directory" : L"%d directories")); mir_sntprintf(str, szFormat, fileCount, dirCount); } else if (fileCount) { @@ -147,9 +147,9 @@ void __cdecl ChooseFilesThread(void* param) TCHAR filter[128]; mir_tstrcpy(filter, TranslateT("All files")); - mir_tstrcat(filter, _T(" (*)")); + mir_tstrcat(filter, L" (*)"); TCHAR *pfilter = filter + mir_tstrlen(filter) + 1; - mir_tstrcpy(pfilter, _T("*")); + mir_tstrcpy(pfilter, L"*"); pfilter = filter + mir_tstrlen(filter) + 1; pfilter[0] = '\0'; diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index e8f4d1212b..036e75068e 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -99,13 +99,13 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info) if (dbv.ptszVal[0]) { STARTUPINFO si = { 0 }; si.cb = sizeof(si); - TCHAR *pszReplace = _tcsstr(dbv.ptszVal, _T("%f")); + TCHAR *pszReplace = _tcsstr(dbv.ptszVal, L"%f"); TCHAR szCmdLine[768]; if (pszReplace) { if (info->szFile[mir_tstrlen(info->szFile) - 1] == '\\') info->szFile[mir_tstrlen(info->szFile) - 1] = '\0'; *pszReplace = 0; - mir_sntprintf(szCmdLine, _T("%s\"%s\"%s"), dbv.ptszVal, info->szFile, pszReplace + 2); + mir_sntprintf(szCmdLine, L"%s\"%s\"%s", dbv.ptszVal, info->szFile, pszReplace + 2); } else _tcsncpy_s(szCmdLine, dbv.ptszVal, _TRUNCATE); @@ -139,7 +139,7 @@ static void SetFilenameControls(HWND hwndDlg, FileDlgData *dat, PROTOFILETRANSFE if (dat->hIcon) DestroyIcon(dat->hIcon); dat->hIcon = NULL; if (fn && (fts->totalFiles > 1)) { - mir_sntprintf(msg, _T("%s: %s (%d %s %d)"), + mir_sntprintf(msg, L"%s: %s (%d %s %d)", pcli->pfnGetContactDisplayName(fts->hContact, 0), fn, fts->currentFileNumber + 1, TranslateT("of"), fts->totalFiles); @@ -147,7 +147,7 @@ static void SetFilenameControls(HWND hwndDlg, FileDlgData *dat, PROTOFILETRANSFE dat->hIcon = shfi.hIcon; } else if (fn) { - mir_sntprintf(msg, _T("%s: %s"), pcli->pfnGetContactDisplayName(fts->hContact, 0), fn); + mir_sntprintf(msg, L"%s: %s", pcli->pfnGetContactDisplayName(fts->hContact, 0), fn); SHGetFileInfo(fn, FILE_ATTRIBUTE_NORMAL, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES | SHGFI_ICON | SHGFI_SMALLICON); dat->hIcon = shfi.hIcon; @@ -267,7 +267,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR SendDlgItemMessage(hwndDlg, IDC_CONTACTNAME, WM_SETFONT, (WPARAM)hFont, 0); SHFILEINFO shfi = { 0 }; - SHGetFileInfo(_T(""), FILE_ATTRIBUTE_DIRECTORY, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES | SHGFI_ICON | SHGFI_SMALLICON); + SHGetFileInfo(L"", FILE_ATTRIBUTE_DIRECTORY, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES | SHGFI_ICON | SHGFI_SMALLICON); dat->hIconFolder = shfi.hIcon; } dat->hIcon = NULL; @@ -308,7 +308,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR GetSensiblyFormattedSize((dat->bytesRecvedHistory[0] - dat->bytesRecvedHistory[dat->bytesRecvedHistorySize - 1]) / dat->bytesRecvedHistorySize, szSpeed, _countof(szSpeed), 0, 1, NULL); if (dat->bytesRecvedHistory[0] == dat->bytesRecvedHistory[dat->bytesRecvedHistorySize - 1]) - mir_tstrcpy(szTime, _T("??:??:??")); + mir_tstrcpy(szTime, L"??:??:??"); else { li.QuadPart = BIGI(10000000)*(dat->transferStatus.currentFileSize - dat->transferStatus.currentFileProgress)*dat->bytesRecvedHistorySize / (dat->bytesRecvedHistory[0] - dat->bytesRecvedHistory[dat->bytesRecvedHistorySize - 1]); ft.dwHighDateTime = li.HighPart; ft.dwLowDateTime = li.LowPart; @@ -322,7 +322,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR GetTimeFormat(LOCALE_USER_DEFAULT, TIME_FORCE24HOURFORMAT | TIME_NOTIMEMARKER, &st, NULL, szTime, _countof(szTime)); } - mir_sntprintf(szDisplay, _T("%s/%s (%s %s)"), szSpeed, TranslateT("sec"), szTime, TranslateT("remaining")); + mir_sntprintf(szDisplay, L"%s/%s (%s %s)", szSpeed, TranslateT("sec"), szTime, TranslateT("remaining")); SetDlgItemText(hwndDlg, IDC_ALLSPEED, szDisplay); } break; @@ -378,7 +378,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR TCHAR *p = _tcsrchr(path, '\\'); if (p) *p = 0; } - if (path) ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOW); + if (path) ShellExecute(NULL, L"open", path, NULL, NULL, SW_SHOW); } break; @@ -446,7 +446,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR *p = 0; } - if (path) ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOW); + if (path) ShellExecute(NULL, L"open", path, NULL, NULL, SW_SHOW); } else if (ret && CheckVirusScanned(hwndDlg, dat, ret)) ShellExecute(NULL, NULL, files[ret - 10], NULL, NULL, SW_SHOW); @@ -483,7 +483,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR size_t size = (pszExtension - szOriginalFilename) + 21 + mir_tstrlen(pszExtension); pfr->szFilename = (TCHAR*)mir_alloc(sizeof(TCHAR)*size); for (int i = 1;; i++) { - mir_sntprintf((TCHAR*)pfr->szFilename, size, _T("%.*s (%u)%s"), pszExtension - szOriginalFilename, szOriginalFilename, i, pszExtension); + mir_sntprintf((TCHAR*)pfr->szFilename, size, L"%.*s (%u)%s", pszExtension - szOriginalFilename, szOriginalFilename, i, pszExtension); if (_taccess(pfr->szFilename, 0) != 0) break; } @@ -596,14 +596,14 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR const unsigned long nextPos = fts->totalBytes ? (BIGI(100) * fts->totalProgress / fts->totalBytes) : 0; if (lastPos != nextPos || firstTime) { SendDlgItemMessage(hwndDlg, IDC_ALLFILESPROGRESS, PBM_SETPOS, nextPos, 0); - mir_sntprintf(str, _T("%u%%"), nextPos); + mir_sntprintf(str, L"%u%%", nextPos); SetDlgItemText(hwndDlg, IDC_ALLPRECENTS, str); } int units; GetSensiblyFormattedSize(fts->totalBytes, szSizeTotal, _countof(szSizeTotal), 0, 1, &units); GetSensiblyFormattedSize(fts->totalProgress, szSizeDone, _countof(szSizeDone), units, 0, NULL); - mir_sntprintf(str, _T("%s/%s"), szSizeDone, szSizeTotal); + mir_sntprintf(str, L"%s/%s", szSizeDone, szSizeTotal); str2[0] = 0; GetDlgItemText(hwndDlg, IDC_ALLTRANSFERRED, str2, _countof(str2)); if (mir_tstrcmp(str, str2)) diff --git a/src/core/stdhelp/src/about.cpp b/src/core/stdhelp/src/about.cpp index d7f21012bf..7ef45cf054 100644 --- a/src/core/stdhelp/src/about.cpp +++ b/src/core/stdhelp/src/about.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" -#define STR_VERSION_FORMAT _T("Miranda NG\nv%S") +#define STR_VERSION_FORMAT L"Miranda NG\nv%S" INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -42,7 +42,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar verInfoSize = GetFileVersionInfoSize(filename, &unused); pVerInfo = mir_alloc(verInfoSize); GetFileVersionInfo(filename, 0, verInfoSize, pVerInfo); - VerQueryValue(pVerInfo, _T("\\StringFileInfo\\000004b0\\LegalCopyright"), (LPVOID*)&productCopyright, &blockSize); + VerQueryValue(pVerInfo, L"\\StringFileInfo\\000004b0\\LegalCopyright", (LPVOID*)&productCopyright, &blockSize); SetDlgItemText(hwndDlg, IDC_DEVS, productCopyright); mir_free(pVerInfo); } @@ -56,7 +56,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar } ShowWindow(GetDlgItem(hwndDlg, IDC_CREDITSFILE), SW_HIDE); { - HRSRC hResInfo = FindResource(hInst, MAKEINTRESOURCE(IDR_CREDITS), _T("TEXT")); + HRSRC hResInfo = FindResource(hInst, MAKEINTRESOURCE(IDR_CREDITS), L"TEXT"); DWORD ResSize = SizeofResource(hInst, hResInfo); HGLOBAL hRes = LoadResource(hInst, hResInfo); char* pszMsg = (char*)LockResource(hRes); diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index ce327aad3a..26e30e224b 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -96,12 +96,12 @@ static void AddToFileList(TCHAR ***pppFiles, int *totalCount, const TCHAR* szFil if (GetFileAttributes(szFilename) & FILE_ATTRIBUTE_DIRECTORY) { WIN32_FIND_DATA fd; TCHAR szPath[MAX_PATH]; - mir_sntprintf(szPath, _T("%s\\*"), szFilename); + mir_sntprintf(szPath, L"%s\\*", szFilename); HANDLE hFind = FindFirstFile(szPath, &fd); if (hFind != INVALID_HANDLE_VALUE) { do { - if (!mir_tstrcmp(fd.cFileName, _T(".")) || !mir_tstrcmp(fd.cFileName, _T(".."))) continue; - mir_sntprintf(szPath, _T("%s\\%s"), szFilename, fd.cFileName); + if (!mir_tstrcmp(fd.cFileName, L".") || !mir_tstrcmp(fd.cFileName, L"..")) continue; + mir_sntprintf(szPath, L"%s\\%s", szFilename, fd.cFileName); AddToFileList(pppFiles, totalCount, szPath); } while (FindNextFile(hFind, &fd)); @@ -122,7 +122,7 @@ static void UpdateReadChars(HWND hwndDlg, HWND hwndStatus) TCHAR buf[32]; int len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE)); - mir_sntprintf(buf, _T("%d"), len); + mir_sntprintf(buf, L"%d", len); SendMessage(hwndStatus, SB_SETTEXT, 1, (LPARAM)buf); } } @@ -136,7 +136,7 @@ static void ShowTime(SrmmWindowData *dat) TCHAR buf[32]; unsigned i = (g_dat.flags & SMF_SHOWREADCHAR) ? 2 : 1; - TimeZone_PrintDateTime(dat->hTimeZone, _T("t"), buf, _countof(buf), 0); + TimeZone_PrintDateTime(dat->hTimeZone, L"t", buf, _countof(buf), 0); SendMessage(dat->hwndStatus, SB_SETTEXT, i, (LPARAM)buf); dat->wMinute = st.wMinute; } @@ -413,7 +413,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar break; case IDM_CLEAR: - SetWindowText(hwnd, _T("")); + SetWindowText(hwnd, L""); break; } DestroyMenu(hMenu); @@ -936,12 +936,12 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (dat->lastMessage) { TCHAR date[64], time[64], fmt[128]; - TimeZone_PrintTimeStamp(NULL, dat->lastMessage, _T("d"), date, _countof(date), 0); - TimeZone_PrintTimeStamp(NULL, dat->lastMessage, _T("t"), time, _countof(time), 0); + TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"d", date, _countof(date), 0); + TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"t", time, _countof(time), 0); mir_sntprintf(fmt, TranslateT("Last message received on %s at %s."), date, time); SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)fmt); } - else SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)_T("")); + else SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)L""); SendMessage(dat->hwndStatus, SB_SETICON, 0, (LPARAM)NULL); break; @@ -988,7 +988,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l pf2.wEffects = PFE_RTLPARA; pf2.dwMask = PFM_RTLPARA; - SetDlgItemText(hwndDlg, IDC_LOG, _T("")); + SetDlgItemText(hwndDlg, IDC_LOG, L""); SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETPARAFORMAT, 0, (LPARAM)&pf2); pf2.wEffects = 0; SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETPARAFORMAT, 0, (LPARAM)&pf2); @@ -1012,9 +1012,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l TCHAR *szStatus = pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE), 0); if (statusIcon) - mir_sntprintf(newtitle, _T("%s - %s"), contactName, TranslateT("Message session")); + mir_sntprintf(newtitle, L"%s - %s", contactName, TranslateT("Message session")); else - mir_sntprintf(newtitle, _T("%s (%s): %s"), contactName, szStatus, TranslateT("Message session")); + mir_sntprintf(newtitle, L"%s (%s): %s", contactName, szStatus, TranslateT("Message session")); DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)wParam; if (!cws || (!mir_strcmp(cws->szModule, dat->szProto) && !mir_strcmp(cws->szSetting, "Status"))) { @@ -1357,7 +1357,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE); SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE)); - SetDlgItemText(hwndDlg, IDC_MESSAGE, _T("")); + SetDlgItemText(hwndDlg, IDC_MESSAGE, L""); if (g_dat.flags & SMF_AUTOCLOSE) DestroyWindow(hwndDlg); @@ -1483,7 +1483,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l SendMessage(((NMHDR *)lParam)->hwndFrom, EM_EXSETSEL, 0, (LPARAM)& all); break; case IDM_CLEAR: - SetDlgItemText(hwndDlg, IDC_LOG, _T("")); + SetDlgItemText(hwndDlg, IDC_LOG, L""); dat->hDbEventFirst = NULL; break; } @@ -1526,7 +1526,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETTEXTRANGE, 0, (LPARAM)& tr); if (_tcschr(tr.lpstrText, '@') != NULL && _tcschr(tr.lpstrText, ':') == NULL && _tcschr(tr.lpstrText, '/') == NULL) { memmove(tr.lpstrText + 7, tr.lpstrText, (tr.chrg.cpMax - tr.chrg.cpMin + 1) * sizeof(TCHAR)); - memcpy(tr.lpstrText, _T("mailto:"), 7 * sizeof(TCHAR)); + memcpy(tr.lpstrText, L"mailto:", 7 * sizeof(TCHAR)); } if (((ENLINK *)lParam)->msg == WM_RBUTTONDOWN) { @@ -1540,7 +1540,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l switch (TrackPopupMenu(hSubMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL)) { case IDM_OPENLINK: - ShellExecute(NULL, _T("open"), tr.lpstrText, NULL, NULL, SW_SHOW); + ShellExecute(NULL, L"open", tr.lpstrText, NULL, NULL, SW_SHOW); break; case IDM_COPYLINK: @@ -1560,7 +1560,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l return TRUE; } - ShellExecute(NULL, _T("open"), tr.lpstrText, NULL, NULL, SW_SHOW); + ShellExecute(NULL, L"open", tr.lpstrText, NULL, NULL, SW_SHOW); SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE)); break; } diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 38e583c2ca..c40c4eb27f 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -50,7 +50,7 @@ struct LogStreamData static int logPixelSY; static char szSep2[40], szSep2_RTL[50]; -static const TCHAR *bbcodes[] = { _T("[b]"), _T("[i]"), _T("[u]"), _T("[s]"), _T("[/b]"), _T("[/i]"), _T("[/u]"), _T("[/s]") }; +static const TCHAR *bbcodes[] = { L"[b]", L"[i]", L"[u]", L"[s]", L"[/b]", L"[/i]", L"[/u]", L"[/s]" }; static const char *bbcodefmt[] = { "\\b ", "\\i ", "\\ul ", "\\strike ", "\\b0 ", "\\i0 ", "\\ul0 ", "\\strike0 " }; static void AppendPlainUnicode(CMStringA &buf, const TCHAR *str) @@ -99,12 +99,12 @@ static void AppendToBufferWithRTF(CMStringA &buf, const TCHAR *line) } } if (!found) { - if (!_tcsnicmp(line, _T("[url"), 4)) { + if (!_tcsnicmp(line, L"[url", 4)) { const TCHAR* tag = _tcschr(line + 4, ']'); if (tag) { const TCHAR *tagu = (line[4] == '=') ? line + 5 : tag + 1; - const TCHAR *tage = _tcsstr(tag, _T("[/url]")); - if (!tage) tage = _tcsstr(tag, _T("[/URL]")); + const TCHAR *tage = _tcsstr(tag, L"[/url]"); + if (!tage) tage = _tcsstr(tag, L"[/URL]"); if (tage) { *(TCHAR*)tag = 0; *(TCHAR*)tage = 0; @@ -118,14 +118,14 @@ static void AppendToBufferWithRTF(CMStringA &buf, const TCHAR *line) } } } - else if (!_tcsnicmp(line, _T("[color="), 7)) { + else if (!_tcsnicmp(line, L"[color=", 7)) { const TCHAR* tag = _tcschr(line + 7, ']'); if (tag) { line = tag; found = 1; } } - else if (!_tcsnicmp(line, _T("[/color]"), 8)) { + else if (!_tcsnicmp(line, L"[/color]", 8)) { line += 7; found = 1; } @@ -258,9 +258,9 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT TCHAR str[64]; if (g_dat.flags & SMF_SHOWSECS) - szFormat = g_dat.flags & SMF_SHOWDATE ? _T("d s") : _T("s"); + szFormat = g_dat.flags & SMF_SHOWDATE ? L"d s" : L"s"; else - szFormat = g_dat.flags & SMF_SHOWDATE ? _T("d t") : _T("t"); + szFormat = g_dat.flags & SMF_SHOWDATE ? L"d t" : L"t"; TimeZone_PrintTimeStamp(NULL, dbei.timestamp, szFormat, str, _countof(str), 0); @@ -297,13 +297,13 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT szName = NEWTSTR_ALLOCA(p); mir_free(p); } - else szName = _T(""); + else szName = L""; } else szName = pcli->pfnGetContactDisplayName(hContact, 0); buffer.AppendFormat(" %s ", SetToStyle(MSGFONTID_NOTICE)); AppendToBufferWithRTF(buffer, szName); - AppendToBufferWithRTF(buffer, _T(" ")); + AppendToBufferWithRTF(buffer, L" "); msg = DbGetEventTextT(&dbei, CP_ACP); if (msg) { diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index 5797b2a9c7..b14d0ec51b 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -34,16 +34,16 @@ struct FontOptionsList } static const fontOptionsList[] = { - { LPGENT("Outgoing messages"), RGB(106, 106, 106), _T("Arial"), 0, -12}, - { LPGENT("Incoming messages"), RGB(0, 0, 0), _T("Arial"), 0, -12}, - { LPGENT("Outgoing name"), RGB(89, 89, 89), _T("Arial"), DBFONTF_BOLD, -12}, - { LPGENT("Outgoing time"), RGB(0, 0, 0), _T("Terminal"), DBFONTF_BOLD, -9}, - { LPGENT("Outgoing colon"), RGB(89, 89, 89), _T("Arial"), 0, -11}, - { LPGENT("Incoming name"), RGB(215, 0, 0), _T("Arial"), DBFONTF_BOLD, -12}, - { LPGENT("Incoming time"), RGB(0, 0, 0), _T("Terminal"), DBFONTF_BOLD, -9}, - { LPGENT("Incoming colon"), RGB(215, 0, 0), _T("Arial"), 0, -11}, - { LPGENT("Message area"), RGB(0, 0, 0), _T("Arial"), 0, -12}, - { LPGENT("Other events"), RGB(90, 90, 160), _T("Arial"), 0, -12}, + { LPGENT("Outgoing messages"), RGB(106, 106, 106), L"Arial", 0, -12}, + { LPGENT("Incoming messages"), RGB(0, 0, 0), L"Arial", 0, -12}, + { LPGENT("Outgoing name"), RGB(89, 89, 89), L"Arial", DBFONTF_BOLD, -12}, + { LPGENT("Outgoing time"), RGB(0, 0, 0), L"Terminal", DBFONTF_BOLD, -9}, + { LPGENT("Outgoing colon"), RGB(89, 89, 89), L"Arial", 0, -11}, + { LPGENT("Incoming name"), RGB(215, 0, 0), L"Arial", DBFONTF_BOLD, -12}, + { LPGENT("Incoming time"), RGB(0, 0, 0), L"Terminal", DBFONTF_BOLD, -9}, + { LPGENT("Incoming colon"), RGB(215, 0, 0), L"Arial", 0, -11}, + { LPGENT("Message area"), RGB(0, 0, 0), L"Arial", 0, -12}, + { LPGENT("Other events"), RGB(90, 90, 160), L"Arial", 0, -12}, }; static BYTE MsgDlgGetFontDefaultCharset(const TCHAR*) diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index aeeaceb504..7c9952c0ee 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -379,7 +379,7 @@ static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam) return 1; SendMessage(dat->hwndStatus, SB_SETICON, 0, (LPARAM)(st == NULL ? 0 : st->hIcon)); - SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)(st == NULL ? _T("") : st->tszText)); + SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)(st == NULL ? L"" : st->tszText)); return 0; } @@ -406,7 +406,7 @@ static TCHAR tszError[] = LPGENT("Miranda could not load the built-in message mo int LoadSendRecvMessageModule(void) { - if ((hMsftEdit = LoadLibrary(_T("Msftedit.dll"))) == NULL) { + if ((hMsftEdit = LoadLibrary(L"Msftedit.dll")) == NULL) { if (IDYES != MessageBox(0, TranslateTS(tszError), TranslateT("Information"), MB_YESNO | MB_ICONINFORMATION)) return 1; return 0; diff --git a/src/core/stdssl/src/netlibssl.cpp b/src/core/stdssl/src/netlibssl.cpp index eee3541d06..d59c92c0ec 100644 --- a/src/core/stdssl/src/netlibssl.cpp +++ b/src/core/stdssl/src/netlibssl.cpp @@ -80,7 +80,7 @@ static void ReportSslError(SECURITY_STATUS scRet, int line, bool = false) } TCHAR szMsgBuf2[512]; - mir_sntprintf(szMsgBuf2, _T("SSL connection failure (%x %u): %s"), scRet, line, szMsgBuf); + mir_sntprintf(szMsgBuf2, L"SSL connection failure (%x %u): %s", scRet, line, szMsgBuf); char* szMsg = Utf8EncodeT(szMsgBuf2); Netlib_Logf(NULL, szMsg); diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp index f1e6b26602..6b4815309f 100644 --- a/src/core/stduihist/src/history.cpp +++ b/src/core/stduihist/src/history.cpp @@ -55,7 +55,7 @@ static void GetUrlDescription(DBEVENTINFO *dbei, TCHAR* buf, int cbBuf) buf[ len ] = 0; if (len < cbBuf-3) - mir_tstrcat(buf, _T("\r\n")); + mir_tstrcat(buf, L"\r\n"); } static void GetFileDescription(DBEVENTINFO *dbei, TCHAR* buf, int cbBuf) @@ -68,7 +68,7 @@ static void GetFileDescription(DBEVENTINFO *dbei, TCHAR* buf, int cbBuf) buf[ len ] = 0; if (len < cbBuf-3) - mir_tstrcat(buf, _T("\r\n")); + mir_tstrcat(buf, L"\r\n"); } static void GetObjectDescription(DBEVENTINFO *dbei, TCHAR* str, int cbStr) @@ -164,8 +164,8 @@ static void FillHistoryThread(void* param) TCHAR str[200], eventText[256], strdatetime[64]; GetObjectSummary(&dbei, str, _countof(str)); if (str[0]) { - TimeZone_PrintTimeStamp(NULL, dbei.timestamp, _T("d t"), strdatetime, _countof(strdatetime), 0); - mir_sntprintf(eventText, _T("%s: %s"), strdatetime, str); + TimeZone_PrintTimeStamp(NULL, dbei.timestamp, L"d t", strdatetime, _countof(strdatetime), 0); + mir_sntprintf(eventText, L"%s: %s", strdatetime, str); i = SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM)eventText); SendMessage(hwndList, LB_SETITEMDATA, i, (LPARAM)hDbEvent); } diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp index 53d2fcfd67..1fc523b3ea 100644 --- a/src/core/stduserinfo/src/contactinfo.cpp +++ b/src/core/stduserinfo/src/contactinfo.cpp @@ -284,7 +284,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP break; lvi.pszText = idstr2; - mir_sntprintf(idstr2, _T("%d"), i + 2); + mir_sntprintf(idstr2, L"%d", i + 2); } ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi); ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal); @@ -331,7 +331,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.pszText = TranslateT("Mobile"); ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi); if (mir_strlen(dbv.pszVal) > 4 && !mir_strcmp(dbv.pszVal + mir_strlen(dbv.pszVal) - 4, " SMS")) { - ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, _T("y")); + ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, L"y"); dbv.ptszVal[mir_tstrlen(dbv.ptszVal) - 4] = '\0'; } ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal); @@ -361,8 +361,8 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.pszText = idstr2; mir_sntprintf(idstr2, TranslateT("Custom %d"), i + 1); ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi); - if (mir_tstrlen(dbv.ptszVal) > 4 && !mir_tstrcmp(dbv.ptszVal + mir_tstrlen(dbv.ptszVal) - 4, _T(" SMS"))) { - ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, _T("y")); + if (mir_tstrlen(dbv.ptszVal) > 4 && !mir_tstrcmp(dbv.ptszVal + mir_tstrlen(dbv.ptszVal) - 4, L" SMS")) { + ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, L"y"); dbv.ptszVal[mir_tstrlen(dbv.ptszVal) - 4] = '\0'; } ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal); @@ -439,8 +439,8 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP TCHAR szEmail[256]; if (IsOverEmail(hwndDlg, szEmail, _countof(szEmail))) { TCHAR szExec[264]; - mir_sntprintf(szExec, _T("mailto:%s"), szEmail); - ShellExecute(hwndDlg, _T("open"), szExec, NULL, NULL, SW_SHOW); + mir_sntprintf(szExec, L"mailto:%s", szEmail); + ShellExecute(hwndDlg, L"open", szExec, NULL, NULL, SW_SHOW); break; } if (nm->iSubItem < 2) diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp index 558469bae1..4b93ab8cd1 100644 --- a/src/core/stduserinfo/src/stdinfo.cpp +++ b/src/core/stduserinfo/src/stdinfo.cpp @@ -255,8 +255,8 @@ static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EMAIL))) { TCHAR szExec[264], szEmail[256]; GetDlgItemText(hwndDlg, IDC_EMAIL, szEmail, _countof(szEmail)); - mir_sntprintf(szExec, _T("mailto:%s"), szEmail); - ShellExecute(hwndDlg, _T("open"), szExec, NULL, NULL, SW_SHOW); + mir_sntprintf(szExec, L"mailto:%s", szEmail); + ShellExecute(hwndDlg, L"open", szExec, NULL, NULL, SW_SHOW); } break; } @@ -283,7 +283,7 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); if (hContact != NULL) { TCHAR szTime[80]; - if (printDateTimeByContact(hContact, _T("s"), szTime, _countof(szTime), TZF_KNOWNONLY)) { + if (printDateTimeByContact(hContact, L"s", szTime, _countof(szTime), TZF_KNOWNONLY)) { EnableWindow(GetDlgItem(hwndDlg, IDC_LOCALTIME), FALSE); SetDlgItemText(hwndDlg, IDC_LOCALTIME, TranslateT("")); } @@ -543,7 +543,7 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; lf.lfQuality = DEFAULT_QUALITY; lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; - mir_tstrcpy(lf.lfFaceName, _T("Courier New")); + mir_tstrcpy(lf.lfFaceName, L"Courier New"); lf.lfCharSet = DEFAULT_CHARSET; HFONT hFont = CreateFontIndirect(&lf); SendDlgItemMessage(hwndDlg, IDC_ABOUT, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index 97948126df..9e3d50ddda 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -318,7 +318,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP TCITEM tci; tci.mask = TCIF_TEXT | TCIF_IMAGE; tci.iImage = -1; - tci.pszText = _T("X"); + tci.pszText = L"X"; TabCtrl_InsertItem(hwndTab, 0, &tci); GetWindowRect(hwndTab, &dat->rcDisplayTab); @@ -355,7 +355,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_TIMER: TCHAR str[128]; - mir_sntprintf(str, _T("%.*s%s%.*s"), dat->updateAnimFrame % 10, _T("........."), dat->szUpdating, dat->updateAnimFrame % 10, _T(".........")); + mir_sntprintf(str, L"%.*s%s%.*s", dat->updateAnimFrame % 10, L".........", dat->szUpdating, dat->updateAnimFrame % 10, L"........."); SetDlgItemText(hwndDlg, IDC_UPDATING, str); if (++dat->updateAnimFrame == UPDATEANIMFRAMES) dat->updateAnimFrame = 0; 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); diff --git a/src/mir_core/src/bitmaps.cpp b/src/mir_core/src/bitmaps.cpp index ee964c482c..c997a61a93 100644 --- a/src/mir_core/src/bitmaps.cpp +++ b/src/mir_core/src/bitmaps.cpp @@ -43,10 +43,10 @@ MIR_CORE_DLL(void) Bitmap_GetFilter(TCHAR *dest, size_t destLen) return; mir_sntprintf(dest, destLen, - _T("%s (*.bmp;*.jpg;*.gif;*.png)%c*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG%c") - _T("%s (*.bmp;*.rle)%c*.BMP;*.RLE%c") - _T("%s (*.jpg;*.jpeg)%c*.JPG;*.JPEG%c") - _T("%s (*.gif)%c*.GIF%c") - _T("%s (*.png)%c*.PNG%c%c"), + L"%s (*.bmp;*.jpg;*.gif;*.png)%c*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG%c" + L"%s (*.bmp;*.rle)%c*.BMP;*.RLE%c" + L"%s (*.jpg;*.jpeg)%c*.JPG;*.JPEG%c" + L"%s (*.gif)%c*.GIF%c" + L"%s (*.png)%c*.PNG%c%c", TranslateT("All Files"), 0, 0, TranslateT("Windows bitmaps"), 0, 0, TranslateT("JPEG bitmaps"), 0, 0, TranslateT("GIF bitmaps"), 0, 0, TranslateT("PNG bitmaps"), 0, 0, 0); } diff --git a/src/mir_core/src/cmdline.cpp b/src/mir_core/src/cmdline.cpp index aa83fc2a2b..4896cdf347 100644 --- a/src/mir_core/src/cmdline.cpp +++ b/src/mir_core/src/cmdline.cpp @@ -60,13 +60,13 @@ MIR_CORE_DLL(void) CmdLine_Parse(LPTSTR ptszCmdLine) else continue; // skip a text that isn't an option TCHAR *pOptionName = p+1; - if ((p = _tcspbrk(pOptionName, _T(" \t=:"))) == NULL) { // no more text in string - arParams.insert(new CmdLineParam(pOptionName, _T(""))); + if ((p = _tcspbrk(pOptionName, L" \t=:")) == NULL) { // no more text in string + arParams.insert(new CmdLineParam(pOptionName, L"")); break; } if (*p == ' ' || *p == '\t') { - arParams.insert(new CmdLineParam(pOptionName, _T(""))); + arParams.insert(new CmdLineParam(pOptionName, L"")); p--; // the cycle will wipe this space automatically continue; } @@ -74,7 +74,7 @@ MIR_CORE_DLL(void) CmdLine_Parse(LPTSTR ptszCmdLine) // parameter with value *p = 0; arParams.insert(new CmdLineParam(pOptionName, ++p)); - if ((p = _tcspbrk(p, _T(" \t"))) == NULL) // no more text in string + if ((p = _tcspbrk(p, L" \t")) == NULL) // no more text in string break; p--; // the cycle will wipe this space automatically diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp index 0412510b1e..348719b1a0 100644 --- a/src/mir_core/src/langpack.cpp +++ b/src/mir_core/src/langpack.cpp @@ -219,11 +219,11 @@ static void LoadLangPackFile(FILE *fp, char *line) TCHAR *p = _tcsrchr(langPack.tszFullPath, '\\'); if (p) *p = 0; - mir_sntprintf(tszFileName, _T("%s\\%S"), langPack.tszFullPath, ltrim(line + 9)); + mir_sntprintf(tszFileName, L"%s\\%S", langPack.tszFullPath, ltrim(line + 9)); if (p) *p = '\\'; - FILE *fpNew = _tfopen(tszFileName, _T("r")); + FILE *fpNew = _tfopen(tszFileName, L"r"); if (fpNew) { line[0] = 0; fgets(line, LANGPACK_BUF_SIZE, fpNew); @@ -374,13 +374,13 @@ static int LoadLangDescr(LANGPACK_INFO &lpinfo, FILE *fp, char *line, int &start MIR_CORE_DLL(int) LoadLangPack(const TCHAR *ptszLangPack) { - if (ptszLangPack == NULL || !mir_tstrcmpi(ptszLangPack, _T(""))) + if (ptszLangPack == NULL || !mir_tstrcmpi(ptszLangPack, L"")) return 1; // ensure that a lang's name is a full file name TCHAR tszFullPath[MAX_PATH]; if (!PathIsAbsoluteT(ptszLangPack)) - mir_sntprintf(tszFullPath, _T("%s\\%s"), g_tszRoot, ptszLangPack); + mir_sntprintf(tszFullPath, L"%s\\%s", g_tszRoot, ptszLangPack); else _tcsncpy_s(tszFullPath, ptszLangPack, _TRUNCATE); @@ -403,7 +403,7 @@ MIR_CORE_DLL(int) LoadLangPack(const TCHAR *ptszLangPack) _tcsncpy_s(langPack.tszFileName, (p == NULL) ? tszFullPath : p + 1, _TRUNCATE); CharLower(langPack.tszFileName); - FILE *fp = _tfopen(tszFullPath, _T("rt")); + FILE *fp = _tfopen(tszFullPath, L"rt"); if (fp == NULL) return 1; @@ -435,7 +435,7 @@ MIR_CORE_DLL(int) LoadLangPackDescr(const TCHAR *ptszLangPack, LANGPACK_INFO *lp _tcsncpy_s(lpInfo->tszFileName, (p == NULL) ? ptszLangPack : p+1, _TRUNCATE); CharLower(lpInfo->tszFileName); - FILE *fp = _tfopen(ptszLangPack, _T("rt")); + FILE *fp = _tfopen(ptszLangPack, L"rt"); if (fp == NULL) return 1; @@ -563,9 +563,9 @@ static BOOL CALLBACK TranslateDialogEnumProc(HWND hwnd, LPARAM lParam) TCHAR szClass[32]; GetClassName(hwnd, szClass, _countof(szClass)); - if (!mir_tstrcmpi(szClass, _T("static")) || !mir_tstrcmpi(szClass, _T("hyperlink")) || !mir_tstrcmpi(szClass, _T("button")) || !mir_tstrcmpi(szClass, _T("MButtonClass")) || !mir_tstrcmpi(szClass, _T("MHeaderbarCtrl"))) + if (!mir_tstrcmpi(szClass, L"static") || !mir_tstrcmpi(szClass, L"hyperlink") || !mir_tstrcmpi(szClass, L"button") || !mir_tstrcmpi(szClass, L"MButtonClass") || !mir_tstrcmpi(szClass, L"MHeaderbarCtrl")) TranslateWindow(uuid, hwnd); - else if (!mir_tstrcmpi(szClass, _T("edit"))) { + else if (!mir_tstrcmpi(szClass, L"edit")) { if (GetWindowLongPtr(hwnd, GWL_STYLE) & ES_READONLY) TranslateWindow(uuid, hwnd); } @@ -632,17 +632,17 @@ MIR_CORE_DLL(void) Langpack_SortDuplicates(void) void GetDefaultLang() { // calculate the langpacks' root - PathToAbsoluteT(_T("\\Languages"), g_tszRoot); + PathToAbsoluteT(L"\\Languages", g_tszRoot); if (_taccess(g_tszRoot, 0) != 0) // directory Languages exists - PathToAbsoluteT(_T("."), g_tszRoot); + PathToAbsoluteT(L".", g_tszRoot); // look into mirandaboot.ini TCHAR tszPath[MAX_PATH], tszLangName[256]; - PathToAbsoluteT(_T("\\mirandaboot.ini"), tszPath); - GetPrivateProfileString(_T("Language"), _T("DefaultLanguage"), _T(""), tszLangName, _countof(tszLangName), tszPath); + PathToAbsoluteT(L"\\mirandaboot.ini", tszPath); + GetPrivateProfileString(L"Language", L"DefaultLanguage", L"", tszLangName, _countof(tszLangName), tszPath); if (tszLangName[0]) { - if (!mir_tstrcmpi(tszLangName, _T("default"))) { - db_set_ts(NULL, "Langpack", "Current", _T("default")); + if (!mir_tstrcmpi(tszLangName, L"default")) { + db_set_ts(NULL, "Langpack", "Current", L"default"); return; } if (!LoadLangPack(tszLangName)) { @@ -653,7 +653,7 @@ void GetDefaultLang() // try to load langpack that matches UserDefaultUILanguage if (GetLocaleInfo(MAKELCID(GetUserDefaultUILanguage(), SORT_DEFAULT), LOCALE_SENGLANGUAGE, tszLangName, _countof(tszLangName))) { - mir_sntprintf(tszPath, _T("langpack_%s.txt"), _tcslwr(tszLangName)); + mir_sntprintf(tszPath, L"langpack_%s.txt", _tcslwr(tszLangName)); if (!LoadLangPack(tszPath)) { db_set_ts(NULL, "Langpack", "Current", tszPath); return; @@ -661,7 +661,7 @@ void GetDefaultLang() } // finally try to load first file - mir_sntprintf(tszPath, _T("%s\\langpack_*.txt"), g_tszRoot); + mir_sntprintf(tszPath, L"%s\\langpack_*.txt", g_tszRoot); WIN32_FIND_DATA fd; HANDLE hFind = FindFirstFile(tszPath, &fd); @@ -678,7 +678,7 @@ void GetDefaultLang() } while (FindNextFile(hFind, &fd)); FindClose(hFind); } - else db_set_ts(NULL, "Langpack", "Current", _T("default")); + else db_set_ts(NULL, "Langpack", "Current", L"default"); } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/mir_core/src/logger.cpp b/src/mir_core/src/logger.cpp index 4a229c367b..27b9f58e18 100644 --- a/src/mir_core/src/logger.cpp +++ b/src/mir_core/src/logger.cpp @@ -108,7 +108,7 @@ MIR_CORE_DLL(HANDLE) mir_createLog(const char* pszName, const TCHAR *ptszDescr, return &arLoggers[idx]; } - FILE *fp = _tfopen(ptszFile, _T("ab")); + FILE *fp = _tfopen(ptszFile, L"ab"); if (fp == NULL) { TCHAR tszPath[MAX_PATH]; _tcsncpy_s(tszPath, ptszFile, _TRUNCATE); @@ -149,7 +149,7 @@ MIR_C_CORE_DLL(int) mir_writeLogA(HANDLE hLogger, const char *format, ...) mir_cslock lck(p->m_cs); if (p->m_out == NULL) - if ((p->m_out = _tfopen(p->m_fileName, _T("ab"))) == NULL) + if ((p->m_out = _tfopen(p->m_fileName, L"ab")) == NULL) return 2; va_list args; @@ -171,7 +171,7 @@ MIR_C_CORE_DLL(int) mir_writeLogW(HANDLE hLogger, const WCHAR *format, ...) mir_cslock lck(p->m_cs); if (p->m_out == NULL) - if ((p->m_out = _tfopen(p->m_fileName, _T("ab"))) == NULL) + if ((p->m_out = _tfopen(p->m_fileName, L"ab")) == NULL) return 2; va_list args; @@ -195,7 +195,7 @@ MIR_CORE_DLL(int) mir_writeLogVA(HANDLE hLogger, const char *format, va_list arg mir_cslock lck(p->m_cs); if (p->m_out == NULL) - if ((p->m_out = _tfopen(p->m_fileName, _T("ab"))) == NULL) + if ((p->m_out = _tfopen(p->m_fileName, L"ab")) == NULL) return 2; vfprintf(p->m_out, format, args); @@ -214,7 +214,7 @@ MIR_CORE_DLL(int) mir_writeLogVW(HANDLE hLogger, const WCHAR *format, va_list ar mir_cslock lck(p->m_cs); if (p->m_out == NULL) - if ((p->m_out = _tfopen(p->m_fileName, _T("ab"))) == NULL) + if ((p->m_out = _tfopen(p->m_fileName, L"ab")) == NULL) return 2; vfwprintf(p->m_out, format, args); diff --git a/src/mir_core/src/miranda.cpp b/src/mir_core/src/miranda.cpp index f5a2997367..514aaa4306 100644 --- a/src/mir_core/src/miranda.cpp +++ b/src/mir_core/src/miranda.cpp @@ -57,10 +57,10 @@ static INT_PTR RestartMiranda(WPARAM wParam, LPARAM lParam) GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath)); if (wParam) { - VARST profilename(_T("%miranda_profilename%")); - mir_sntprintf(cmdLine, _T("\"%s\" /restart:%d /profile=%s"), mirandaPath, GetCurrentProcessId(), (TCHAR*)profilename); + VARST profilename(L"%miranda_profilename%"); + mir_sntprintf(cmdLine, L"\"%s\" /restart:%d /profile=%s", mirandaPath, GetCurrentProcessId(), (TCHAR*)profilename); } - else mir_sntprintf(cmdLine, _T("\"%s\" /restart:%d"), mirandaPath, GetCurrentProcessId()); + else mir_sntprintf(cmdLine, L"\"%s\" /restart:%d", mirandaPath, GetCurrentProcessId()); CallService("CloseAction", 0, 0); @@ -98,11 +98,11 @@ static void LoadCoreModule(void) icce.dwICC = ICC_WIN95_CLASSES | ICC_USEREX_CLASSES; InitCommonControlsEx(&icce); - hAPCWindow = CreateWindowEx(0, _T("ComboLBox"), NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); + hAPCWindow = CreateWindowEx(0, L"ComboLBox", NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); SetClassLongPtr(hAPCWindow, GCL_STYLE, GetClassLongPtr(hAPCWindow, GCL_STYLE) | CS_DROPSHADOW); DestroyWindow(hAPCWindow); - hAPCWindow = CreateWindowEx(0, _T("STATIC"), NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); + hAPCWindow = CreateWindowEx(0, L"STATIC", NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); SetWindowLongPtr(hAPCWindow, GWLP_WNDPROC, (LONG_PTR)APCWndProc); SetTimer(hAPCWindow, 1, 1000, NULL); hStackMutex = CreateMutex(NULL, FALSE, NULL); diff --git a/src/mir_core/src/openurl.cpp b/src/mir_core/src/openurl.cpp index dcd2516543..084bba84a7 100644 --- a/src/mir_core/src/openurl.cpp +++ b/src/mir_core/src/openurl.cpp @@ -43,24 +43,24 @@ static void OpenURLThread(void *arg) // wack a protocol on it CMString tszUrl; if ((isalpha(hUrlInfo->szUrl[0]) && hUrlInfo->szUrl[1] == ':') || hUrlInfo->szUrl[0] == '\\') - tszUrl.Format(_T("file:///%s"), hUrlInfo->szUrl); + tszUrl.Format(L"file:///%s", hUrlInfo->szUrl); else { int i; for (i = 0; _istalpha(hUrlInfo->szUrl[i]); i++); if (hUrlInfo->szUrl[i] == ':') tszUrl = hUrlInfo->szUrl; - else if (!_tcsnicmp(hUrlInfo->szUrl, _T("ftp."), 4)) - tszUrl.Format(_T("ftp://%s"), hUrlInfo->szUrl); + else if (!_tcsnicmp(hUrlInfo->szUrl, L"ftp.", 4)) + tszUrl.Format(L"ftp://%s", hUrlInfo->szUrl); else - tszUrl.Format(_T("http://%s"), hUrlInfo->szUrl); + tszUrl.Format(L"http://%s", hUrlInfo->szUrl); } // check user defined browser for opening urls ptrT tszBrowser(db_get_tsa(NULL, "Miranda", "OpenUrlBrowser")); if (tszBrowser) - ShellExecute(NULL, _T("open"), tszBrowser, tszUrl, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT); + ShellExecute(NULL, L"open", tszBrowser, tszUrl, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT); else - ShellExecute(NULL, _T("open"), tszUrl, NULL, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT); + ShellExecute(NULL, L"open", tszUrl, NULL, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT); delete hUrlInfo; } diff --git a/src/mir_core/src/path.cpp b/src/mir_core/src/path.cpp index 7327f619c8..64d00da713 100644 --- a/src/mir_core/src/path.cpp +++ b/src/mir_core/src/path.cpp @@ -156,7 +156,7 @@ MIR_CORE_DLL(int) PathToAbsoluteW(const WCHAR *pSrc, WCHAR *pOut, const WCHAR *b WCHAR buf[MAX_PATH]; if (pSrc[0] < ' ') - return mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc); + return mir_sntprintf(pOut, MAX_PATH, L"%s", pSrc); if (PathIsAbsoluteW(pSrc)) return GetFullPathName(pSrc, MAX_PATH, pOut, NULL); @@ -167,7 +167,7 @@ MIR_CORE_DLL(int) PathToAbsoluteW(const WCHAR *pSrc, WCHAR *pOut, const WCHAR *b if (pSrc[0] == '\\') pSrc++; - mir_sntprintf(buf, MAX_PATH, _T("%s%s"), base, pSrc); + mir_sntprintf(buf, MAX_PATH, L"%s%s", base, pSrc); return GetFullPathName(buf, MAX_PATH, pOut, NULL); } diff --git a/src/mir_core/src/threads.cpp b/src/mir_core/src/threads.cpp index cdd7ca4621..91d4c281b7 100644 --- a/src/mir_core/src/threads.cpp +++ b/src/mir_core/src/threads.cpp @@ -290,7 +290,7 @@ typedef LONG (WINAPI *pNtQIT)(HANDLE, LONG, PVOID, ULONG, PULONG); static void* GetCurrentThreadEntryPoint() { - pNtQIT NtQueryInformationThread = (pNtQIT)GetProcAddress(GetModuleHandle(_T("ntdll.dll")), "NtQueryInformationThread"); + pNtQIT NtQueryInformationThread = (pNtQIT)GetProcAddress(GetModuleHandle(L"ntdll.dll"), "NtQueryInformationThread"); if (NtQueryInformationThread == NULL) return 0; diff --git a/src/mir_core/src/timezones.cpp b/src/mir_core/src/timezones.cpp index 322bdbf747..38281b123f 100644 --- a/src/mir_core/src/timezones.cpp +++ b/src/mir_core/src/timezones.cpp @@ -128,7 +128,7 @@ void FormatTime(const SYSTEMTIME *st, const TCHAR *szFormat, TCHAR *szDest, size TCHAR dateTimeStr[64]; if (iso) - tszTemp.AppendFormat(_T("%d-%02d-%02dT%02d:%02d:%02dZ"), st->wYear, st->wMonth, st->wDay, st->wHour, st->wMinute, st->wSecond); + tszTemp.AppendFormat(L"%d-%02d-%02dT%02d:%02d:%02dZ", st->wYear, st->wMonth, st->wDay, st->wHour, st->wMinute, st->wSecond); else if (date) { GetDateFormat(LOCALE_USER_DEFAULT, fmt, st, NULL, dateTimeStr, _countof(dateTimeStr)); tszTemp.Append(dateTimeStr); @@ -166,7 +166,7 @@ MIR_CORE_DLL(LPCTSTR) TimeZone_GetName(HANDLE hTZ) if (tz == NULL) return myInfo.myTZ.tszName; else if (tz == UTC_TIME_HANDLE) - return _T("UTC"); + return L"UTC"; return tz->tszName; } @@ -179,7 +179,7 @@ MIR_CORE_DLL(LPCTSTR) TimeZone_GetDescription(LPCTSTR TZname) if (!mir_tstrcmp(tz->tszName, TZname)) return tz->szDisplay; } - return _T(""); + return L""; } static void CalcTsOffset(MIM_TIMEZONE *tz) @@ -381,9 +381,9 @@ static const ListMessages* GetListMessages(HWND hWnd, DWORD dwFlags) if (!(dwFlags & (TZF_PLF_CB | TZF_PLF_LB))) { TCHAR tszClassName[128]; GetClassName(hWnd, tszClassName, _countof(tszClassName)); - if (!mir_tstrcmpi(tszClassName, _T("COMBOBOX"))) + if (!mir_tstrcmpi(tszClassName, L"COMBOBOX")) dwFlags |= TZF_PLF_CB; - else if (!mir_tstrcmpi(tszClassName, _T("LISTBOX"))) + else if (!mir_tstrcmpi(tszClassName, L"LISTBOX")) dwFlags |= TZF_PLF_LB; } if (dwFlags & TZF_PLF_CB) @@ -531,7 +531,7 @@ void InitTimeZones(void) REG_TZI_FORMAT tzi; HKEY hKey; - const TCHAR *tszKey = _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones"); + const TCHAR *tszKey = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones"; /* * use GetDynamicTimeZoneInformation() on Vista+ - this will return a structure with @@ -539,7 +539,7 @@ void InitTimeZones(void) * localized systems or systems with a MUI pack installed */ if (IsWinVerVistaPlus()) - pfnGetDynamicTimeZoneInformation = (pfnGetDynamicTimeZoneInformation_t)GetProcAddress(GetModuleHandle(_T("kernel32")), "GetDynamicTimeZoneInformation"); + pfnGetDynamicTimeZoneInformation = (pfnGetDynamicTimeZoneInformation_t)GetProcAddress(GetModuleHandle(L"kernel32"), "GetDynamicTimeZoneInformation"); if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, tszKey, 0, KEY_ENUMERATE_SUB_KEYS, &hKey)) { DWORD dwIndex = 0; @@ -552,7 +552,7 @@ void InitTimeZones(void) dwSize = sizeof(tszName); DWORD dwLength = sizeof(tzi); - if (ERROR_SUCCESS != RegQueryValueEx(hSubKey, _T("TZI"), NULL, NULL, (unsigned char *)&tzi, &dwLength)) + if (ERROR_SUCCESS != RegQueryValueEx(hSubKey, L"TZI", NULL, NULL, (unsigned char *)&tzi, &dwLength)) continue; MIM_TIMEZONE *tz = new MIM_TIMEZONE; @@ -567,9 +567,9 @@ void InitTimeZones(void) tz->hash = mir_hashstrT(tszName); tz->offset = INT_MIN; - GetLocalizedString(hSubKey, _T("Display"), tz->szDisplay, _countof(tz->szDisplay)); - GetLocalizedString(hSubKey, _T("Std"), tz->tzi.StandardName, _countof(tz->tzi.StandardName)); - GetLocalizedString(hSubKey, _T("Dlt"), tz->tzi.DaylightName, _countof(tz->tzi.DaylightName)); + GetLocalizedString(hSubKey, L"Display", tz->szDisplay, _countof(tz->szDisplay)); + GetLocalizedString(hSubKey, L"Std", tz->tzi.StandardName, _countof(tz->tzi.StandardName)); + GetLocalizedString(hSubKey, L"Dlt", tz->tzi.DaylightName, _countof(tz->tzi.DaylightName)); g_timezones.insert(tz); g_timezonesBias.insert(tz); diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp index f9dec18581..0860e797f9 100644 --- a/src/mir_core/src/ui_utils.cpp +++ b/src/mir_core/src/ui_utils.cpp @@ -2372,7 +2372,7 @@ void CCtrlBase::SetTextA(const char *text) void CCtrlBase::SetInt(int value) { TCHAR buf[32] = { 0 }; - mir_sntprintf(buf, _T("%d"), value); + mir_sntprintf(buf, L"%d", value); SetWindowText(m_hwnd, buf); } diff --git a/src/mir_core/src/winver.cpp b/src/mir_core/src/winver.cpp index 5c7e983761..cdda5b55cc 100644 --- a/src/mir_core/src/winver.cpp +++ b/src/mir_core/src/winver.cpp @@ -69,9 +69,9 @@ MIR_CORE_DLL(BOOL) IsFullScreen() // check foregroundwindow HWND hWnd = GetForegroundWindow(); if (hWnd && hWnd != hWndDesktop && hWnd != hWndShell) { - TCHAR tszClassName[128] = _T(""); + TCHAR tszClassName[128] = L""; GetClassName(hWnd, tszClassName, _countof(tszClassName)); - if (_tcscmp(tszClassName, _T("WorkerW"))) { + if (_tcscmp(tszClassName, L"WorkerW")) { RECT rect, rectw, recti; GetWindowRect(hWnd, &rectw); @@ -95,7 +95,7 @@ MIR_CORE_DLL(BOOL) IsWorkstationLocked(void) TCHAR tszName[100]; DWORD cbName; - BOOL bLocked = (!GetUserObjectInformation(hDesk, UOI_NAME, tszName, _countof(tszName), &cbName) || mir_tstrcmpi(tszName, _T("default")) != 0); + BOOL bLocked = (!GetUserObjectInformation(hDesk, UOI_NAME, tszName, _countof(tszName), &cbName) || mir_tstrcmpi(tszName, L"default") != 0); CloseDesktop(hDesk); return bLocked; } @@ -220,192 +220,192 @@ MIR_CORE_DLL(BOOL) GetOSDisplayString(TCHAR *buf, size_t bufSize) SYSTEM_INFO sysInfo = { 0 }; GetNativeSystemInfo(&sysInfo); - CMString ret(_T("Microsoft ")); + CMString ret(L"Microsoft "); // Test for the specific product. if (osvi.dwMajorVersion >= 6) { if (osvi.dwMajorVersion == 10) { if (osvi.wProductType == VER_NT_WORKSTATION) - ret.Append(_T("Windows 10 ")); + ret.Append(L"Windows 10 "); else - ret.Append(_T("Windows Server 10 ")); + ret.Append(L"Windows Server 10 "); } else switch (osvi.dwMinorVersion) { case 0: if (osvi.wProductType == VER_NT_WORKSTATION) - ret.Append(_T("Windows Vista ")); + ret.Append(L"Windows Vista "); else - ret.Append(_T("Windows Server 2008 ")); + ret.Append(L"Windows Server 2008 "); break; case 1: if (osvi.wProductType == VER_NT_WORKSTATION) - ret.Append(_T("Windows 7 ")); + ret.Append(L"Windows 7 "); else - ret.Append(_T("Windows Server 2008 R2 ")); + ret.Append(L"Windows Server 2008 R2 "); break; case 2: if (osvi.wProductType == VER_NT_WORKSTATION) - ret.Append(_T("Windows 8 ")); + ret.Append(L"Windows 8 "); else - ret.Append(_T("Windows Server 2012 ")); + ret.Append(L"Windows Server 2012 "); break; case 3: if (osvi.wProductType == VER_NT_WORKSTATION) - ret.Append(_T("Windows 8.1 ")); + ret.Append(L"Windows 8.1 "); else - ret.Append(_T("Windows Server 2012 R2 ")); + ret.Append(L"Windows Server 2012 R2 "); break; } DWORD dwType = 0; - HMODULE hKernel = GetModuleHandle(_T("kernel32.dll")); + HMODULE hKernel = GetModuleHandle(L"kernel32.dll"); PGPI pGPI = (PGPI)GetProcAddress(hKernel, "GetProductInfo"); if (pGPI != NULL) pGPI(osvi.dwMajorVersion, osvi.dwMinorVersion, 0, 0, &dwType); switch (dwType) { case PRODUCT_ULTIMATE: - ret.Append(_T("Ultimate Edition")); + ret.Append(L"Ultimate Edition"); break; case PRODUCT_PROFESSIONAL: - ret.Append(_T("Professional Edition")); + ret.Append(L"Professional Edition"); break; case PRODUCT_PROFESSIONAL_WMC: - ret.Append(_T("Professional Edition with Media Center")); + ret.Append(L"Professional Edition with Media Center"); break; case PRODUCT_HOME_PREMIUM: - ret.Append(_T("Home Premium Edition")); + ret.Append(L"Home Premium Edition"); break; case PRODUCT_HOME_BASIC: - ret.Append(_T("Home Basic Edition")); + ret.Append(L"Home Basic Edition"); break; case PRODUCT_ENTERPRISE: - ret.Append(_T("Enterprise Edition")); + ret.Append(L"Enterprise Edition"); break; case PRODUCT_BUSINESS: - ret.Append(_T("Business Edition")); + ret.Append(L"Business Edition"); break; case PRODUCT_STARTER: - ret.Append(_T("Starter Edition")); + ret.Append(L"Starter Edition"); break; case PRODUCT_CLUSTER_SERVER: - ret.Append(_T("Cluster Server Edition")); + ret.Append(L"Cluster Server Edition"); break; case PRODUCT_DATACENTER_SERVER: - ret.Append(_T("Datacenter Edition")); + ret.Append(L"Datacenter Edition"); break; case PRODUCT_DATACENTER_SERVER_CORE: - ret.Append(_T("Datacenter Edition (core installation)")); + ret.Append(L"Datacenter Edition (core installation)"); break; case PRODUCT_ENTERPRISE_SERVER: - ret.Append(_T("Enterprise Edition")); + ret.Append(L"Enterprise Edition"); break; case PRODUCT_ENTERPRISE_SERVER_CORE: - ret.Append(_T("Enterprise Edition (core installation)")); + ret.Append(L"Enterprise Edition (core installation)"); break; case PRODUCT_ENTERPRISE_SERVER_IA64: - ret.Append(_T("Enterprise Edition for Itanium-based Systems")); + ret.Append(L"Enterprise Edition for Itanium-based Systems"); break; case PRODUCT_SMALLBUSINESS_SERVER: - ret.Append(_T("Small Business Server")); + ret.Append(L"Small Business Server"); break; case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM: - ret.Append(_T("Small Business Server Premium Edition")); + ret.Append(L"Small Business Server Premium Edition"); break; case PRODUCT_STANDARD_SERVER: - ret.Append(_T("Standard Edition")); + ret.Append(L"Standard Edition"); break; case PRODUCT_STANDARD_SERVER_CORE: - ret.Append(_T("Standard Edition (core installation)")); + ret.Append(L"Standard Edition (core installation)"); break; case PRODUCT_WEB_SERVER: - ret.Append(_T("Web Server Edition")); + ret.Append(L"Web Server Edition"); break; } if (sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) - ret.Append(_T(", 64-bit")); + ret.Append(L", 64-bit"); else if (sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) - ret.Append(_T(", 32-bit")); + ret.Append(L", 32-bit"); } if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) { if (GetSystemMetrics(SM_SERVERR2)) - ret.Append(_T("Windows Server 2003 R2, ")); + ret.Append(L"Windows Server 2003 R2, "); else if (osvi.wSuiteMask == VER_SUITE_STORAGE_SERVER) - ret.Append(_T("Windows Storage Server 2003")); + ret.Append(L"Windows Storage Server 2003"); else if (osvi.wSuiteMask == VER_SUITE_WH_SERVER) - ret.Append(_T("Windows Home Server")); + ret.Append(L"Windows Home Server"); else if (osvi.wProductType == VER_NT_WORKSTATION && sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) - ret.Append(_T("Windows XP Professional x64 Edition")); + ret.Append(L"Windows XP Professional x64 Edition"); else - ret.Append(_T("Windows Server 2003, ")); + ret.Append(L"Windows Server 2003, "); // Test for the server type. if (osvi.wProductType != VER_NT_WORKSTATION) { if (sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64) { if (osvi.wSuiteMask & VER_SUITE_DATACENTER) - ret.Append(_T("Datacenter Edition for Itanium-based Systems")); + ret.Append(L"Datacenter Edition for Itanium-based Systems"); else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) - ret.Append(_T("Enterprise Edition for Itanium-based Systems")); + ret.Append(L"Enterprise Edition for Itanium-based Systems"); } else if (sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) { if (osvi.wSuiteMask & VER_SUITE_DATACENTER) - ret.Append(_T("Datacenter x64 Edition")); + ret.Append(L"Datacenter x64 Edition"); else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) - ret.Append(_T("Enterprise x64 Edition")); - else ret.Append(_T("Standard x64 Edition")); + ret.Append(L"Enterprise x64 Edition"); + else ret.Append(L"Standard x64 Edition"); } else { if (osvi.wSuiteMask & VER_SUITE_COMPUTE_SERVER) - ret.Append(_T("Compute Cluster Edition")); + ret.Append(L"Compute Cluster Edition"); else if (osvi.wSuiteMask & VER_SUITE_DATACENTER) - ret.Append(_T("Datacenter Edition")); + ret.Append(L"Datacenter Edition"); else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) - ret.Append(_T("Enterprise Edition")); + ret.Append(L"Enterprise Edition"); else if (osvi.wSuiteMask & VER_SUITE_BLADE) - ret.Append(_T("Web Edition")); - else ret.Append(_T("Standard Edition")); + ret.Append(L"Web Edition"); + else ret.Append(L"Standard Edition"); } } } if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) { - ret.Append(_T("Windows XP ")); + ret.Append(L"Windows XP "); if (osvi.wSuiteMask & VER_SUITE_PERSONAL) - ret.Append(_T("Home Edition")); - else ret.Append(_T("Professional")); + ret.Append(L"Home Edition"); + else ret.Append(L"Professional"); } if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) { - ret.Append(_T("Windows 2000 ")); + ret.Append(L"Windows 2000 "); if (osvi.wProductType == VER_NT_WORKSTATION) - ret.Append(_T("Professional")); + ret.Append(L"Professional"); else { if (osvi.wSuiteMask & VER_SUITE_DATACENTER) - ret.Append(_T("Datacenter Server")); + ret.Append(L"Datacenter Server"); else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) - ret.Append(_T("Advanced Server")); - else ret.Append(_T("Server")); + ret.Append(L"Advanced Server"); + else ret.Append(L"Server"); } } // Include service pack (if any) and build number. if (mir_tstrlen(osvi.szCSDVersion) > 0) { - ret.Append(_T(" ")); + ret.Append(L" "); ret.Append(osvi.szCSDVersion); } - ret.AppendFormat(_T(" (build %d)"), osvi.dwBuildNumber); + ret.AppendFormat(L" (build %d)", osvi.dwBuildNumber); HMODULE hNtDll = GetModuleHandleA("ntdll.dll"); if (WGV wine_get_version = (WGV)GetProcAddress(hNtDll, "wine_get_version")) { - ret.AppendFormat(_T(" (Wine %s)"), _A2T(wine_get_version())); + ret.AppendFormat(L" (Wine %s)", _A2T(wine_get_version())); } mir_tstrncpy(buf, ret, bufSize); diff --git a/src/miranda32/src/miranda.cpp b/src/miranda32/src/miranda.cpp index fdb2ec3a0e..d8c1b60ad2 100644 --- a/src/miranda32/src/miranda.cpp +++ b/src/miranda32/src/miranda.cpp @@ -39,26 +39,26 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR cmdLine, int) p[1] = 0; SetCurrentDirectory(tszPath); - _tcsncat_s(tszPath, _T("libs"), _TRUNCATE); + _tcsncat_s(tszPath, L"libs", _TRUNCATE); DWORD cbPath = (DWORD)_tcslen(tszPath); - DWORD cbSize = GetEnvironmentVariable(_T("PATH"), NULL, 0); + DWORD cbSize = GetEnvironmentVariable(L"PATH", NULL, 0); TCHAR *ptszVal = new TCHAR[cbSize + MAX_PATH + 2]; _tcscpy(ptszVal, tszPath); - _tcscat(ptszVal, _T(";")); - GetEnvironmentVariable(_T("PATH"), ptszVal + cbPath + 1, cbSize); - SetEnvironmentVariable(_T("PATH"), ptszVal); + _tcscat(ptszVal, L";"); + GetEnvironmentVariable(L"PATH", ptszVal + cbPath + 1, cbSize); + SetEnvironmentVariable(L"PATH", ptszVal); int retVal; - HINSTANCE hMirApp = LoadLibrary(_T("mir_app.mir")); + HINSTANCE hMirApp = LoadLibrary(L"mir_app.mir"); if (hMirApp == NULL) { - MessageBox(NULL, _T("mir_app.mir cannot be loaded"), _T("Fatal error"), MB_ICONERROR | MB_OK); + MessageBox(NULL, L"mir_app.mir cannot be loaded", L"Fatal error", MB_ICONERROR | MB_OK); retVal = 1; } else { pfnMain fnMain = (pfnMain)GetProcAddress(hMirApp, "mir_main"); if (fnMain == NULL) { - MessageBox(NULL, _T("invalid mir_app.mir present, program exiting"), _T("Fatal error"), MB_ICONERROR | MB_OK); + MessageBox(NULL, L"invalid mir_app.mir present, program exiting", L"Fatal error", MB_ICONERROR | MB_OK); retVal = 2; } else -- cgit v1.2.3