From 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jul 2016 09:20:25 +0000 Subject: less TCHARs: - TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdmsg/src/msgdialog.cpp | 60 +++++++++++++++++------------------ src/core/stdmsg/src/msglog.cpp | 44 +++++++++++++------------- src/core/stdmsg/src/msgoptions.cpp | 64 +++++++++++++++++++------------------- src/core/stdmsg/src/msgs.cpp | 8 ++--- src/core/stdmsg/src/msgs.h | 4 +-- 5 files changed, 90 insertions(+), 90 deletions(-) (limited to 'src/core/stdmsg') diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 26e30e224b..79822ad339 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -53,7 +53,7 @@ static void NotifyLocalWinEvent(MCONTACT hContact, HWND hwnd, unsigned int type) } } -static int RTL_Detect(const TCHAR *ptszText) +static int RTL_Detect(const wchar_t *ptszText) { int iLen = (int)mir_tstrlen(ptszText); WORD *infoTypeC2 = (WORD*)alloca(sizeof(WORD)* (iLen + 2)); @@ -66,7 +66,7 @@ static int RTL_Detect(const TCHAR *ptszText) return 0; } -int SendMessageDirect(const TCHAR *szMsg, MCONTACT hContact, char*) +int SendMessageDirect(const wchar_t *szMsg, MCONTACT hContact, char*) { if (hContact == NULL) return NULL; @@ -87,15 +87,15 @@ int SendMessageDirect(const TCHAR *szMsg, MCONTACT hContact, char*) return sendId; } -static void AddToFileList(TCHAR ***pppFiles, int *totalCount, const TCHAR* szFilename) +static void AddToFileList(wchar_t ***pppFiles, int *totalCount, const wchar_t* szFilename) { - *pppFiles = (TCHAR**)mir_realloc(*pppFiles, (++*totalCount + 1)*sizeof(TCHAR*)); + *pppFiles = (wchar_t**)mir_realloc(*pppFiles, (++*totalCount + 1)*sizeof(wchar_t*)); (*pppFiles)[*totalCount] = NULL; (*pppFiles)[*totalCount - 1] = mir_tstrdup(szFilename); if (GetFileAttributes(szFilename) & FILE_ATTRIBUTE_DIRECTORY) { WIN32_FIND_DATA fd; - TCHAR szPath[MAX_PATH]; + wchar_t szPath[MAX_PATH]; mir_sntprintf(szPath, L"%s\\*", szFilename); HANDLE hFind = FindFirstFile(szPath, &fd); if (hFind != INVALID_HANDLE_VALUE) { @@ -119,7 +119,7 @@ static void ShowMultipleControls(HWND hwndDlg, const UINT * controls, int cContr static void UpdateReadChars(HWND hwndDlg, HWND hwndStatus) { if (hwndStatus && (g_dat.flags & SMF_SHOWREADCHAR)) { - TCHAR buf[32]; + wchar_t buf[32]; int len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE)); mir_sntprintf(buf, L"%d", len); @@ -133,7 +133,7 @@ static void ShowTime(SrmmWindowData *dat) SYSTEMTIME st; GetSystemTime(&st); if (dat->wMinute != st.wMinute) { - TCHAR buf[32]; + wchar_t buf[32]; unsigned i = (g_dat.flags & SMF_SHOWREADCHAR) ? 2 : 1; TimeZone_PrintDateTime(dat->hTimeZone, L"t", buf, _countof(buf), 0); @@ -206,7 +206,7 @@ struct MsgEditSubclassData DWORD lastEnterTime; }; -static void SetEditorText(HWND hwnd, const TCHAR* txt) +static void SetEditorText(HWND hwnd, const wchar_t* txt) { SetWindowText(hwnd, txt); SendMessage(hwnd, EM_SETSEL, -1, -1); @@ -488,7 +488,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * HWND h = GetDlgItem(hwndDlg, IDC_NAME); int len = GetWindowTextLength(h); if (len > 0) { - TCHAR buf[256]; + wchar_t buf[256]; GetWindowText(h, buf, _countof(buf)); HDC hdc = GetDC(h); @@ -624,7 +624,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l int len; if (newData->isWchar) - SetDlgItemText(hwndDlg, IDC_MESSAGE, (TCHAR*)newData->szInitialText); + SetDlgItemText(hwndDlg, IDC_MESSAGE, (wchar_t*)newData->szInitialText); else SetDlgItemTextA(hwndDlg, IDC_MESSAGE, newData->szInitialText); len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE)); @@ -687,7 +687,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_LIMITTEXT, (WPARAM)nMax, 0); // get around a lame bug in the Windows template resource code where richedits are limited to 0x7FFF - SendDlgItemMessage(hwndDlg, IDC_LOG, EM_LIMITTEXT, (WPARAM) sizeof(TCHAR) * 0x7FFFFFFF, 0); + SendDlgItemMessage(hwndDlg, IDC_LOG, EM_LIMITTEXT, (WPARAM) sizeof(wchar_t) * 0x7FFFFFFF, 0); } mir_subclassWindow(GetDlgItem(hwndDlg, IDC_MESSAGE), MessageEditSubclassProc); @@ -828,10 +828,10 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (!(CallProtoService(dat->szProto, PS_GETCAPS, PFLAGNUM_1, 0)&PF1_FILESEND)) break; if (dat->wStatus == ID_STATUS_OFFLINE) break; if (dat->hContact != NULL) { - TCHAR szFilename[MAX_PATH]; + wchar_t szFilename[MAX_PATH]; HDROP hDrop = (HDROP)wParam; int fileCount = DragQueryFile(hDrop, -1, NULL, 0), totalCount = 0, i; - TCHAR** ppFiles = NULL; + wchar_t** ppFiles = NULL; for (i = 0; i < fileCount; i++) { DragQueryFile(hDrop, i, szFilename, _countof(szFilename)); AddToFileList(&ppFiles, &totalCount, szFilename); @@ -921,8 +921,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l ptrT id(Contact_GetInfo(CNF_UNIQUEID, dat->hContact, dat->szProto)); if (id != NULL && OpenClipboard(hwndDlg)) { EmptyClipboard(); - HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, mir_tstrlen(id) * sizeof(TCHAR)+1); - mir_tstrcpy((TCHAR*)GlobalLock(hData), id); + HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, mir_tstrlen(id) * sizeof(wchar_t)+1); + mir_tstrcpy((wchar_t*)GlobalLock(hData), id); GlobalUnlock(hData); SetClipboardData(CF_UNICODETEXT, hData); CloseClipboard(); @@ -935,7 +935,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l break; if (dat->lastMessage) { - TCHAR date[64], time[64], fmt[128]; + wchar_t date[64], time[64], fmt[128]; 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); @@ -1000,17 +1000,17 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l case DM_UPDATETITLE: { - TCHAR newtitle[256]; + wchar_t newtitle[256]; if (dat->hContact && dat->szProto) { int statusIcon = db_get_b(NULL, SRMMMOD, SRMSGSET_STATUSICON, SRMSGDEFSET_STATUSICON); dat->wStatus = db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE); - TCHAR *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0); + wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0); ptrT id(Contact_GetInfo(CNF_DISPLAYUID, dat->hContact, dat->szProto)); SetDlgItemText(hwndDlg, IDC_NAME, (id) ? id : contactName); - TCHAR *szStatus = pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE), 0); + wchar_t *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, L"%s - %s", contactName, TranslateT("Message session")); else @@ -1028,7 +1028,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l else mir_tstrncpy(newtitle, TranslateT("Message session"), _countof(newtitle)); - TCHAR oldtitle[256]; + wchar_t oldtitle[256]; GetWindowText(hwndDlg, oldtitle, _countof(oldtitle)); if (mir_tstrcmp(newtitle, oldtitle)) { //swt() flickers even if the title hasn't actually changed SetWindowText(hwndDlg, newtitle); @@ -1254,8 +1254,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l } else { if (dat->nTypeSecs) { - TCHAR szBuf[256]; - TCHAR* szContactName = pcli->pfnGetContactDisplayName(dat->hContact, 0); + wchar_t szBuf[256]; + wchar_t* szContactName = pcli->pfnGetContactDisplayName(dat->hContact, 0); HICON hTyping = Skin_LoadIcon(SKINICON_OTHER_TYPING); mir_sntprintf(szBuf, TranslateT("%s is typing a message..."), szContactName); @@ -1341,7 +1341,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l case IDOK: if (IsWindowEnabled(GetDlgItem(hwndDlg, IDOK))) { int bufSize = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE)) + 1; - TCHAR *temp = (TCHAR*)alloca(bufSize * sizeof(TCHAR)); + wchar_t *temp = (wchar_t*)alloca(bufSize * sizeof(wchar_t)); GetDlgItemText(hwndDlg, IDC_MESSAGE, temp, bufSize); if (!temp[0]) break; @@ -1522,11 +1522,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l TEXTRANGE tr; tr.chrg = ((ENLINK *)lParam)->chrg; - tr.lpstrText = (TCHAR*)_alloca((tr.chrg.cpMax - tr.chrg.cpMin + 8) * sizeof(TCHAR)); + tr.lpstrText = (wchar_t*)_alloca((tr.chrg.cpMax - tr.chrg.cpMin + 8) * sizeof(wchar_t)); 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, L"mailto:", 7 * sizeof(TCHAR)); + if (wcschr(tr.lpstrText, '@') != NULL && wcschr(tr.lpstrText, ':') == NULL && wcschr(tr.lpstrText, '/') == NULL) { + memmove(tr.lpstrText + 7, tr.lpstrText, (tr.chrg.cpMax - tr.chrg.cpMin + 1) * sizeof(wchar_t)); + memcpy(tr.lpstrText, L"mailto:", 7 * sizeof(wchar_t)); } if (((ENLINK *)lParam)->msg == WM_RBUTTONDOWN) { @@ -1546,8 +1546,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l case IDM_COPYLINK: if (OpenClipboard(hwndDlg)) { EmptyClipboard(); - HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(tr.lpstrText) + 1) * sizeof(TCHAR)); - mir_tstrcpy((TCHAR*)GlobalLock(hData), tr.lpstrText); + HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(tr.lpstrText) + 1) * sizeof(wchar_t)); + mir_tstrcpy((wchar_t*)GlobalLock(hData), tr.lpstrText); GlobalUnlock(hData); SetClipboardData(CF_UNICODETEXT, hData); CloseClipboard(); @@ -1586,7 +1586,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l // save string from the editor if (dat->hContact) { int len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE)) + 1; - TCHAR *msg = (TCHAR*)alloca(sizeof(TCHAR)*len); + wchar_t *msg = (wchar_t*)alloca(sizeof(wchar_t)*len); GetDlgItemText(hwndDlg, IDC_MESSAGE, msg, len); if (msg[0]) db_set_ts(dat->hContact, SRMSGMOD, DBSAVEDMSG, msg); diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index c40c4eb27f..62ab631a35 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -50,10 +50,10 @@ struct LogStreamData static int logPixelSY; static char szSep2[40], szSep2_RTL[50]; -static const TCHAR *bbcodes[] = { L"[b]", L"[i]", L"[u]", L"[s]", L"[/b]", L"[/i]", L"[/u]", L"[/s]" }; +static const wchar_t *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) +static void AppendPlainUnicode(CMStringA &buf, const wchar_t *str) { for (; *str; str++) { if (*str < 128) @@ -63,7 +63,7 @@ static void AppendPlainUnicode(CMStringA &buf, const TCHAR *str) } } -static void AppendToBufferWithRTF(CMStringA &buf, const TCHAR *line) +static void AppendToBufferWithRTF(CMStringA &buf, const wchar_t *line) { if (line == NULL) return; @@ -90,7 +90,7 @@ static void AppendToBufferWithRTF(CMStringA &buf, const TCHAR *line) for (i = 0; i < _countof(bbcodes); ++i) { if (line[1] == bbcodes[i][1]) { size_t lenb = mir_tstrlen(bbcodes[i]); - if (!_tcsnicmp(line, bbcodes[i], lenb)) { + if (!wcsnicmp(line, bbcodes[i], lenb)) { buf.Append(bbcodefmt[i]); line += lenb - 1; found = 1; @@ -99,15 +99,15 @@ static void AppendToBufferWithRTF(CMStringA &buf, const TCHAR *line) } } if (!found) { - if (!_tcsnicmp(line, L"[url", 4)) { - const TCHAR* tag = _tcschr(line + 4, ']'); + if (!wcsnicmp(line, L"[url", 4)) { + const wchar_t* tag = wcschr(line + 4, ']'); if (tag) { - const TCHAR *tagu = (line[4] == '=') ? line + 5 : tag + 1; - const TCHAR *tage = _tcsstr(tag, L"[/url]"); - if (!tage) tage = _tcsstr(tag, L"[/URL]"); + const wchar_t *tagu = (line[4] == '=') ? line + 5 : tag + 1; + const wchar_t *tage = wcsstr(tag, L"[/url]"); + if (!tage) tage = wcsstr(tag, L"[/URL]"); if (tage) { - *(TCHAR*)tag = 0; - *(TCHAR*)tage = 0; + *(wchar_t*)tag = 0; + *(wchar_t*)tage = 0; buf.Append("{\\field{\\*\\fldinst HYPERLINK \""); AppendPlainUnicode(buf, tagu); buf.Append("\"}{\\fldrslt "); @@ -118,14 +118,14 @@ static void AppendToBufferWithRTF(CMStringA &buf, const TCHAR *line) } } } - else if (!_tcsnicmp(line, L"[color=", 7)) { - const TCHAR* tag = _tcschr(line + 7, ']'); + else if (!wcsnicmp(line, L"[color=", 7)) { + const wchar_t* tag = wcschr(line + 7, ']'); if (tag) { line = tag; found = 1; } } - else if (!_tcsnicmp(line, L"[/color]", 8)) { + else if (!wcsnicmp(line, L"[/color]", 8)) { line += 7; found = 1; } @@ -254,8 +254,8 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT } if (g_dat.flags & SMF_SHOWTIME) { - const TCHAR* szFormat; - TCHAR str[64]; + const wchar_t* szFormat; + wchar_t str[64]; if (g_dat.flags & SMF_SHOWSECS) szFormat = g_dat.flags & SMF_SHOWDATE ? L"d s" : L"s"; @@ -270,11 +270,11 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT } if (!(g_dat.flags & SMF_HIDENAMES) && dbei.eventType != EVENTTYPE_JABBER_CHATSTATES && dbei.eventType != EVENTTYPE_JABBER_PRESENCE) { - TCHAR *szName; + wchar_t *szName; if (dbei.flags & DBEF_SENT) { - if (TCHAR *p = Contact_GetInfo(CNF_DISPLAY, NULL, dbei.szModule)) - szName = NEWTSTR_ALLOCA(p); + if (wchar_t *p = Contact_GetInfo(CNF_DISPLAY, NULL, dbei.szModule)) + szName = NEWWSTR_ALLOCA(p); else szName = TranslateT("Me"); } @@ -288,13 +288,13 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT if (showColon) buffer.AppendFormat("%s :", SetToStyle(dbei.flags & DBEF_SENT ? MSGFONTID_MYCOLON : MSGFONTID_YOURCOLON)); - TCHAR *msg, *szName; + wchar_t *msg, *szName; switch (dbei.eventType) { case EVENTTYPE_JABBER_CHATSTATES: case EVENTTYPE_JABBER_PRESENCE: if (dbei.flags & DBEF_SENT) { - if (TCHAR *p = Contact_GetInfo(CNF_DISPLAY, NULL, dbei.szModule)) { - szName = NEWTSTR_ALLOCA(p); + if (wchar_t *p = Contact_GetInfo(CNF_DISPLAY, NULL, dbei.szModule)) { + szName = NEWWSTR_ALLOCA(p); mir_free(p); } else szName = L""; diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index b14d0ec51b..52bfb5f630 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -26,27 +26,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct FontOptionsList { - const TCHAR* szDescr; + const wchar_t* szDescr; COLORREF defColour; - const TCHAR* szDefFace; + const wchar_t* szDefFace; BYTE defStyle; char defSize; } static const fontOptionsList[] = { - { 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}, + { LPGENW("Outgoing messages"), RGB(106, 106, 106), L"Arial", 0, -12}, + { LPGENW("Incoming messages"), RGB(0, 0, 0), L"Arial", 0, -12}, + { LPGENW("Outgoing name"), RGB(89, 89, 89), L"Arial", DBFONTF_BOLD, -12}, + { LPGENW("Outgoing time"), RGB(0, 0, 0), L"Terminal", DBFONTF_BOLD, -9}, + { LPGENW("Outgoing colon"), RGB(89, 89, 89), L"Arial", 0, -11}, + { LPGENW("Incoming name"), RGB(215, 0, 0), L"Arial", DBFONTF_BOLD, -12}, + { LPGENW("Incoming time"), RGB(0, 0, 0), L"Terminal", DBFONTF_BOLD, -9}, + { LPGENW("Incoming colon"), RGB(215, 0, 0), L"Arial", 0, -11}, + { LPGENW("Message area"), RGB(0, 0, 0), L"Arial", 0, -12}, + { LPGENW("Other events"), RGB(90, 90, 160), L"Arial", 0, -12}, }; -static BYTE MsgDlgGetFontDefaultCharset(const TCHAR*) +static BYTE MsgDlgGetFontDefaultCharset(const wchar_t*) { return DEFAULT_CHARSET; } @@ -82,7 +82,7 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour) DBVARIANT dbv; if (db_get_ts(NULL, SRMMMOD, str, &dbv)) - _tcsncpy(lf->lfFaceName, fontOptionsList[i].szDefFace, _countof(lf->lfFaceName)-1); + wcsncpy(lf->lfFaceName, fontOptionsList[i].szDefFace, _countof(lf->lfFaceName)-1); else { mir_tstrncpy(lf->lfFaceName, dbv.ptszVal, _countof(lf->lfFaceName)); db_free(&dbv); @@ -101,8 +101,8 @@ void RegisterSRMMFonts(void) fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID; for (int i = 0; i < _countof(fontOptionsList); i++) { strncpy_s(fontid.dbSettingsGroup, SRMMMOD, _TRUNCATE); - _tcsncpy_s(fontid.group, LPGENT("Message log"), _TRUNCATE); - _tcsncpy_s(fontid.name, fontOptionsList[i].szDescr, _TRUNCATE); + wcsncpy_s(fontid.group, LPGENW("Message log"), _TRUNCATE); + wcsncpy_s(fontid.name, fontOptionsList[i].szDescr, _TRUNCATE); mir_snprintf(idstr, "SRMFont%d", i); strncpy_s(fontid.prefix, idstr, _TRUNCATE); fontid.order = i; @@ -113,10 +113,10 @@ void RegisterSRMMFonts(void) fontid.deffontsettings.colour = fontOptionsList[i].defColour; fontid.deffontsettings.size = fontOptionsList[i].defSize; fontid.deffontsettings.style = fontOptionsList[i].defStyle; - _tcsncpy_s(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _TRUNCATE); + wcsncpy_s(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _TRUNCATE); fontid.deffontsettings.charset = MsgDlgGetFontDefaultCharset(fontOptionsList[i].szDefFace); - _tcsncpy_s(fontid.backgroundGroup, LPGENT("Message log"), _TRUNCATE); - _tcsncpy_s(fontid.backgroundName, LPGENT("Background"), _TRUNCATE); + wcsncpy_s(fontid.backgroundGroup, LPGENW("Message log"), _TRUNCATE); + wcsncpy_s(fontid.backgroundName, LPGENW("Background"), _TRUNCATE); FontRegisterT(&fontid); } @@ -124,8 +124,8 @@ void RegisterSRMMFonts(void) strncpy_s(colourid.dbSettingsGroup, SRMMMOD, _TRUNCATE); strncpy_s(colourid.setting, SRMSGSET_BKGCOLOUR, _TRUNCATE); colourid.defcolour = SRMSGDEFSET_BKGCOLOUR; - _tcsncpy_s(colourid.name, LPGENT("Background"), _TRUNCATE); - _tcsncpy_s(colourid.group, LPGENT("Message log"), _TRUNCATE); + wcsncpy_s(colourid.name, LPGENW("Background"), _TRUNCATE); + wcsncpy_s(colourid.group, LPGENW("Message log"), _TRUNCATE); ColourRegisterT(&colourid); } @@ -134,20 +134,20 @@ void RegisterSRMMFonts(void) struct CheckBoxValues_t { DWORD style; - TCHAR* szDescr; + wchar_t* szDescr; } statusValues[] = { - { MODEF_OFFLINE, LPGENT("Offline") }, - { PF2_ONLINE, LPGENT("Online") }, - { PF2_SHORTAWAY, LPGENT("Away") }, - { PF2_LONGAWAY, LPGENT("Not available") }, - { PF2_LIGHTDND, LPGENT("Occupied") }, - { PF2_HEAVYDND, LPGENT("Do not disturb") }, - { PF2_FREECHAT, LPGENT("Free for chat") }, - { PF2_INVISIBLE, LPGENT("Invisible") }, - { PF2_OUTTOLUNCH, LPGENT("Out to lunch") }, - { PF2_ONTHEPHONE, LPGENT("On the phone") } + { MODEF_OFFLINE, LPGENW("Offline") }, + { PF2_ONLINE, LPGENW("Online") }, + { PF2_SHORTAWAY, LPGENW("Away") }, + { PF2_LONGAWAY, LPGENW("Not available") }, + { PF2_LIGHTDND, LPGENW("Occupied") }, + { PF2_HEAVYDND, LPGENW("Do not disturb") }, + { PF2_FREECHAT, LPGENW("Free for chat") }, + { PF2_INVISIBLE, LPGENW("Invisible") }, + { PF2_OUTTOLUNCH, LPGENW("Out to lunch") }, + { PF2_ONTHEPHONE, LPGENW("On the phone") } }; static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style) diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 7c9952c0ee..2b67cb4590 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -88,7 +88,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) return 0; } - TCHAR toolTip[256]; + wchar_t toolTip[256]; mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); CLISTEVENT cle = {}; @@ -166,7 +166,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) if (hwnd) SendMessage(hwnd, DM_TYPING, 0, lParam); else if (lParam && (g_dat.flags & SMF_SHOWTYPINGTRAY)) { - TCHAR szTip[256]; + wchar_t szTip[256]; mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0)); if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && !(g_dat.flags & SMF_SHOWTYPINGCLIST)) { @@ -271,7 +271,7 @@ static void RestoreUnreadMessageAlerts(void) } } - TCHAR toolTip[256]; + wchar_t toolTip[256]; CLISTEVENT cle = {}; cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); @@ -402,7 +402,7 @@ static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam) return 0; } -static TCHAR tszError[] = LPGENT("Miranda could not load the built-in message module, msftedit.dll is missing. Press 'Yes' to continue loading Miranda."); +static wchar_t tszError[] = LPGENW("Miranda could not load the built-in message module, msftedit.dll is missing. Press 'Yes' to continue loading Miranda."); int LoadSendRecvMessageModule(void) { diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h index ac5c99a003..c034551fa9 100644 --- a/src/core/stdmsg/src/msgs.h +++ b/src/core/stdmsg/src/msgs.h @@ -65,7 +65,7 @@ struct SrmmWindowData : public MZeroedObject WORD wStatus; WORD wOldStatus; int cmdListInd; - LIST cmdList; + LIST cmdList; bool bIsAutoRTL, bIsMeta; WORD wMinute; @@ -126,7 +126,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar int DbEventIsForMsgWindow(DBEVENTINFO *dbei); int DbEventIsShown(DBEVENTINFO *dbei); void StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend); -int SendMessageDirect(const TCHAR *szMsg, MCONTACT hContact, char *szProto); +int SendMessageDirect(const wchar_t *szMsg, MCONTACT hContact, char *szProto); INT_PTR SendMessageCmd(MCONTACT hContact, char *msg, int isWchar); void LoadMsgLogIcons(void); -- cgit v1.2.3