diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
commit | 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch) | |
tree | 2e8bb660c908b54914abd562af8aafa4a486c846 /src | |
parent | a61c8728b379057fe7f0a0d86fe0b037598229dd (diff) |
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
Diffstat (limited to 'src')
154 files changed, 1780 insertions, 1797 deletions
diff --git a/src/core/stdauth/src/auth.cpp b/src/core/stdauth/src/auth.cpp index da81b55068..191031062c 100644 --- a/src/core/stdauth/src/auth.cpp +++ b/src/core/stdauth/src/auth.cpp @@ -44,7 +44,7 @@ INT_PTR ShowAddedWindow(WPARAM, LPARAM lParam) static int AuthEventAdded(WPARAM, LPARAM lParam)
{
- TCHAR szTooltip[256];
+ wchar_t szTooltip[256];
MEVENT hDbEvent = (MEVENT)lParam;
DBEVENTINFO dbei = { sizeof(dbei) };
diff --git a/src/core/stdauth/src/authdialogs.cpp b/src/core/stdauth/src/authdialogs.cpp index 6ce9a9e66f..86f9db4ec4 100644 --- a/src/core/stdauth/src/authdialogs.cpp +++ b/src/core/stdauth/src/authdialogs.cpp @@ -55,12 +55,12 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar PROTOACCOUNT* acc = Proto_GetAccount(dbei.szModule);
- TCHAR* lastT = dbei.flags & DBEF_UTF ? Utf8DecodeT(last) : mir_a2t(last);
- TCHAR* firstT = dbei.flags & DBEF_UTF ? Utf8DecodeT(first) : mir_a2t(first);
- TCHAR* nickT = dbei.flags & DBEF_UTF ? Utf8DecodeT(nick) : mir_a2t(nick);
- TCHAR* emailT = dbei.flags & DBEF_UTF ? Utf8DecodeT(email) : mir_a2t(email);
+ wchar_t* lastT = dbei.flags & DBEF_UTF ? Utf8DecodeT(last) : mir_a2t(last);
+ wchar_t* firstT = dbei.flags & DBEF_UTF ? Utf8DecodeT(first) : mir_a2t(first);
+ wchar_t* nickT = dbei.flags & DBEF_UTF ? Utf8DecodeT(nick) : mir_a2t(nick);
+ wchar_t* emailT = dbei.flags & DBEF_UTF ? Utf8DecodeT(email) : mir_a2t(email);
- TCHAR name[128] = L"";
+ wchar_t name[128] = L"";
int off = 0;
if (firstT[0] && lastT[0])
off = mir_sntprintf(name, L"%s %s", firstT, lastT);
@@ -72,12 +72,12 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar if (off)
mir_sntprintf(name + off, _countof(name) - off, L" (%s)", nickT);
else
- _tcsncpy_s(name, nickT, _TRUNCATE);
+ wcsncpy_s(name, nickT, _TRUNCATE);
}
if (!name[0])
- _tcsncpy_s(name, TranslateT("<Unknown>"), _TRUNCATE);
+ wcsncpy_s(name, TranslateT("<Unknown>"), _TRUNCATE);
- TCHAR hdr[256];
+ wchar_t hdr[256];
if (uin && emailT[0])
mir_sntprintf(hdr, TranslateT("%s added you to the contact list\n%u (%s) on %s"), name, uin, emailT, acc->tszAccountName);
else if (uin)
@@ -185,30 +185,30 @@ 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] = L"";
+ wchar_t name[128] = L"";
int off = 0;
if (firstT[0] && lastT[0])
- off = mir_sntprintf(name, L"%s %s", (TCHAR*)firstT, (TCHAR*)lastT);
+ off = mir_sntprintf(name, L"%s %s", (wchar_t*)firstT, (wchar_t*)lastT);
else if (firstT[0])
- off = mir_sntprintf(name, L"%s", (TCHAR*)firstT);
+ off = mir_sntprintf(name, L"%s", (wchar_t*)firstT);
else if (lastT[0])
- off = mir_sntprintf(name, L"%s", (TCHAR*)lastT);
+ off = mir_sntprintf(name, L"%s", (wchar_t*)lastT);
if (mir_tstrlen(nickT)) {
if (off)
- mir_sntprintf(name + off, _countof(name) - off, L" (%s)", (TCHAR*)nickT);
+ mir_sntprintf(name + off, _countof(name) - off, L" (%s)", (wchar_t*)nickT);
else
- _tcsncpy_s(name, nickT, _TRUNCATE);
+ wcsncpy_s(name, nickT, _TRUNCATE);
}
if (!name[0])
- _tcsncpy_s(name, TranslateT("<Unknown>"), _TRUNCATE);
+ wcsncpy_s(name, TranslateT("<Unknown>"), _TRUNCATE);
- TCHAR hdr[256];
+ wchar_t hdr[256];
if (uin && emailT[0])
- mir_sntprintf(hdr, TranslateT("%s requested authorization\n%u (%s) on %s"), name, uin, (TCHAR*)emailT, acc->tszAccountName);
+ mir_sntprintf(hdr, TranslateT("%s requested authorization\n%u (%s) on %s"), name, uin, (wchar_t*)emailT, acc->tszAccountName);
else if (uin)
mir_sntprintf(hdr, TranslateT("%s requested authorization\n%u on %s"), name, uin, acc->tszAccountName);
else
- mir_sntprintf(hdr, TranslateT("%s requested authorization\n%s on %s"), name, emailT[0] ? (TCHAR*)emailT : TranslateT("(Unknown)"), acc->tszAccountName);
+ mir_sntprintf(hdr, TranslateT("%s requested authorization\n%s on %s"), name, emailT[0] ? (wchar_t*)emailT : TranslateT("(Unknown)"), acc->tszAccountName);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, hdr);
SetDlgItemText(hwndDlg, IDC_REASON, reasonT);
@@ -264,7 +264,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP db_event_get(hDbEvent, &dbei);
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_DENYREASON))) {
- TCHAR tszReason[256];
+ wchar_t tszReason[256];
GetDlgItemText(hwndDlg, IDC_DENYREASON, tszReason, _countof(tszReason));
CallProtoService(dbei.szModule, PS_AUTHDENY, hDbEvent, (LPARAM)tszReason);
}
diff --git a/src/core/stdauth/src/stdafx.h b/src/core/stdauth/src/stdafx.h index 06f20fb566..7112db5e94 100644 --- a/src/core/stdauth/src/stdafx.h +++ b/src/core/stdauth/src/stdafx.h @@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stdautoaway/src/autoaway.cpp b/src/core/stdautoaway/src/autoaway.cpp index 9eb35a7d25..2a490ba693 100644 --- a/src/core/stdautoaway/src/autoaway.cpp +++ b/src/core/stdautoaway/src/autoaway.cpp @@ -38,7 +38,7 @@ static int AutoAwaySound(WPARAM, LPARAM) static void Proto_SetStatus(const char *szProto, unsigned status)
{
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) {
- ptrT awayMsg((TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGW, status, (LPARAM)szProto));
+ ptrT awayMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGW, status, (LPARAM)szProto));
CallProtoService(szProto, PS_SETAWAYMSG, status, awayMsg);
}
diff --git a/src/core/stdautoaway/src/stdafx.h b/src/core/stdautoaway/src/stdafx.h index debc097003..7ac8638151 100644 --- a/src/core/stdautoaway/src/stdafx.h +++ b/src/core/stdautoaway/src/stdafx.h @@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stdaway/src/awaymsg.cpp b/src/core/stdaway/src/awaymsg.cpp index 2efff40a04..b51b6f4d7a 100644 --- a/src/core/stdaway/src/awaymsg.cpp +++ b/src/core/stdaway/src/awaymsg.cpp @@ -54,11 +54,11 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP dat->hSeq = (HANDLE)ProtoChainSend(dat->hContact, PSS_GETAWAYMSG, 0, 0);
WindowList_Add(hWindowList, hwndDlg, dat->hContact);
{
- TCHAR str[256], format[128];
- TCHAR *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ wchar_t str[256], format[128];
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
char *szProto = GetContactProto(dat->hContact);
WORD dwStatus = db_get_w(dat->hContact, szProto, "Status", ID_STATUS_OFFLINE);
- TCHAR *status = pcli->pfnGetStatusModeDescription(dwStatus, 0);
+ wchar_t *status = pcli->pfnGetStatusModeDescription(dwStatus, 0);
GetWindowText(hwndDlg, format, _countof(format));
mir_sntprintf(str, format, status, contactName);
@@ -89,7 +89,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP if (ack->result != ACKRESULT_SUCCESS) break;
if (dat->hAwayMsgEvent && ack->hProcess == dat->hSeq) { UnhookEvent(dat->hAwayMsgEvent); dat->hAwayMsgEvent = NULL; }
- SetDlgItemText(hwndDlg, IDC_MSG, (const TCHAR*)ack->lParam);
+ SetDlgItemText(hwndDlg, IDC_MSG, (const wchar_t*)ack->lParam);
ShowWindow(GetDlgItem(hwndDlg, IDC_RETRIEVING), SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDC_MSG), SW_SHOW);
@@ -140,7 +140,7 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM) int status = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) {
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(status)) {
- TCHAR str[128];
+ wchar_t str[128];
mir_sntprintf(str, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(status, 0));
Menu_ModifyItem(hAwayMsgMenuItem, str, Skin_LoadProtoIcon(szProto, status), CMIF_NOTOFFLINE);
return 0;
diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp index c2460a8a34..a3f2968588 100644 --- a/src/core/stdaway/src/sendmsg.cpp +++ b/src/core/stdaway/src/sendmsg.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static DWORD protoModeMsgFlags;
static HWND hwndStatusMsg;
-static const TCHAR *GetDefaultMessage(int status)
+static const wchar_t *GetDefaultMessage(int status)
{
switch(status) {
case ID_STATUS_AWAY: return TranslateT("I've been away since %time%.");
@@ -79,7 +79,7 @@ static void SetStatusModeByte(int status, const char *suffix, BYTE value) db_set_b(NULL, "SRAway", StatusModeToDbSetting(status, suffix), value);
}
-static TCHAR* GetAwayMessage(int statusMode, char *szProto)
+static wchar_t* GetAwayMessage(int statusMode, char *szProto)
{
if (szProto && !(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(statusMode)))
return NULL;
@@ -100,8 +100,8 @@ static TCHAR* GetAwayMessage(int statusMode, char *szProto) if (dbv.ptszVal[i] != '%')
continue;
- TCHAR substituteStr[128];
- if ( !_tcsnicmp(dbv.ptszVal + i, L"%time%", 6)) {
+ wchar_t substituteStr[128];
+ if ( !wcsnicmp(dbv.ptszVal + i, L"%time%", 6)) {
MIRANDA_IDLE_INFO mii = { sizeof(mii) };
CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii);
@@ -117,14 +117,14 @@ 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, L"%date%", 6))
+ else if ( !wcsnicmp(dbv.ptszVal + i, L"%date%", 6))
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, substituteStr, _countof(substituteStr));
else continue;
if (mir_tstrlen(substituteStr) > 6)
- dbv.ptszVal = (TCHAR*)mir_realloc(dbv.ptszVal, (mir_tstrlen(dbv.ptszVal) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(TCHAR));
- memmove(dbv.ptszVal + i + mir_tstrlen(substituteStr), dbv.ptszVal + i + 6, (mir_tstrlen(dbv.ptszVal) - i - 5) * sizeof(TCHAR));
- memcpy(dbv.ptszVal+i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ dbv.ptszVal = (wchar_t*)mir_realloc(dbv.ptszVal, (mir_tstrlen(dbv.ptszVal) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(wchar_t));
+ memmove(dbv.ptszVal + i + mir_tstrlen(substituteStr), dbv.ptszVal + i + 6, (mir_tstrlen(dbv.ptszVal) - i - 5) * sizeof(wchar_t));
+ memcpy(dbv.ptszVal+i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
}
}
return dbv.ptszVal;
@@ -152,15 +152,15 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar if (wParam == 127 && GetKeyState(VK_CONTROL) & 0x8000) //ctrl-backspace
{
DWORD start, end;
- TCHAR *text;
+ wchar_t *text;
int textLen;
SendMessage(hwnd, EM_GETSEL, (WPARAM)&end, 0);
SendMessage(hwnd, WM_KEYDOWN, VK_LEFT, 0);
SendMessage(hwnd, EM_GETSEL, (WPARAM)&start, 0);
textLen = GetWindowTextLength(hwnd);
- text = (TCHAR *)alloca(sizeof(TCHAR) * (textLen + 1));
+ text = (wchar_t *)alloca(sizeof(wchar_t) * (textLen + 1));
GetWindowText(hwnd, text, textLen + 1);
- memmove(text + start, text + end, sizeof(TCHAR) * (textLen + 1 - end));
+ memmove(text + start, text + end, sizeof(wchar_t) * (textLen + 1 - end));
SetWindowText(hwnd, text);
SendMessage(hwnd, EM_SETSEL, start, start);
SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), EN_CHANGE), (LPARAM)hwnd);
@@ -171,7 +171,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar return mir_callNextSubclass(hwnd, MessageEditSubclassProc, msg, wParam, lParam);
}
-void ChangeAllProtoMessages(char *szProto, int statusMode, TCHAR *msg)
+void ChangeAllProtoMessages(char *szProto, int statusMode, wchar_t *msg)
{
if (szProto == NULL) {
int nAccounts;
@@ -194,7 +194,7 @@ struct SetAwayMsgData {
int statusMode;
int countdown;
- TCHAR okButtonFormat[64];
+ wchar_t okButtonFormat[64];
char *szProto;
HANDLE hPreshutdown;
};
@@ -224,14 +224,14 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa SendDlgItemMessage(hwndDlg, IDC_MSG, EM_LIMITTEXT, 1024, 0);
mir_subclassWindow(GetDlgItem(hwndDlg, IDC_MSG), MessageEditSubclassProc);
{
- TCHAR str[256], format[128];
+ wchar_t str[256], format[128];
GetWindowText(hwndDlg, format, _countof(format));
mir_sntprintf(str, format, pcli->pfnGetStatusModeDescription(dat->statusMode, 0));
SetWindowText(hwndDlg, str);
}
GetDlgItemText(hwndDlg, IDOK, dat->okButtonFormat, _countof(dat->okButtonFormat));
{
- TCHAR *msg = GetAwayMessage(dat->statusMode, dat->szProto);
+ wchar_t *msg = GetAwayMessage(dat->statusMode, dat->szProto);
SetDlgItemText(hwndDlg, IDC_MSG, msg);
mir_free(msg);
}
@@ -246,7 +246,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa case WM_TIMER:
if (--dat->countdown >= 0) {
- TCHAR str[64];
+ wchar_t str[64];
mir_sntprintf(str, dat->okButtonFormat, dat->countdown);
SetDlgItemText(hwndDlg, IDOK, str);
}
@@ -258,7 +258,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa case WM_CLOSE:
{
- TCHAR *msg = GetAwayMessage(dat->statusMode, dat->szProto);
+ wchar_t *msg = GetAwayMessage(dat->statusMode, dat->szProto);
ChangeAllProtoMessages(dat->szProto, dat->statusMode, msg);
mir_free(msg);
}
@@ -269,7 +269,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa switch (LOWORD(wParam)) {
case IDOK:
if (dat->countdown < 0) {
- TCHAR str[1024];
+ wchar_t str[1024];
GetDlgItemText(hwndDlg, IDC_MSG, str, _countof(str));
ChangeAllProtoMessages(dat->szProto, dat->statusMode, str);
db_set_ts(NULL, "SRAway", StatusModeToDbSetting(dat->statusMode, "Msg"), str);
@@ -329,7 +329,7 @@ static int StatusModeChange(WPARAM wParam, LPARAM lParam) ChangeAllProtoMessages(szProto, statusMode, NULL);
else if (bScreenSaverRunning || GetStatusModeByte(statusMode, "NoDlg", true)) {
- TCHAR *msg = GetAwayMessage(statusMode, szProto);
+ wchar_t *msg = GetAwayMessage(statusMode, szProto);
ChangeAllProtoMessages(szProto, statusMode, msg);
mir_free(msg);
}
@@ -355,7 +355,7 @@ struct AwayMsgInfo int ignore;
int noDialog;
int usePrevious;
- TCHAR msg[1024];
+ wchar_t msg[1024];
};
struct AwayMsgDlgData
@@ -422,7 +422,7 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (dis->CtlID != IDC_LST_STATUS) break;
- TCHAR buf[128];
+ wchar_t buf[128];
SendDlgItemMessage(hwndDlg, IDC_LST_STATUS, LB_GETTEXT, dis->itemID, (LPARAM)buf);
if (dis->itemState & (ODS_SELECTED | ODS_FOCUS)) {
diff --git a/src/core/stdaway/src/stdafx.h b/src/core/stdaway/src/stdafx.h index b9f0df09cd..d8bb7b74e3 100644 --- a/src/core/stdaway/src/stdafx.h +++ b/src/core/stdaway/src/stdafx.h @@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp index 28e27f8b5d..430992defb 100644 --- a/src/core/stdchat/src/main.cpp +++ b/src/core/stdchat/src/main.cpp @@ -287,30 +287,30 @@ static void RegisterFonts() {
ColourIDT colourid = { sizeof(colourid) };
strncpy(colourid.dbSettingsGroup, CHAT_MODULE, sizeof(colourid.dbSettingsGroup));
- _tcsncpy(colourid.group, LPGENT("Chat module"), _countof(colourid.group));
+ wcsncpy(colourid.group, LPGENW("Chat module"), _countof(colourid.group));
strncpy(colourid.setting, "ColorLogBG", _countof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Group chat log background"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Group chat log background"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_WINDOW);
ColourRegisterT(&colourid);
strncpy(colourid.setting, "ColorMessageBG", _countof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Message background"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Message background"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_WINDOW);
ColourRegisterT(&colourid);
strncpy(colourid.setting, "ColorNicklistBG", _countof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Nick list background"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Nick list background"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_WINDOW);
ColourRegisterT(&colourid);
strncpy(colourid.setting, "ColorNicklistLines", _countof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Nick list lines"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Nick list lines"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_INACTIVEBORDER);
ColourRegisterT(&colourid);
strncpy(colourid.setting, "ColorNicklistSelectedBG", _countof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Nick list background (selected)"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Nick list background (selected)"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT);
ColourRegisterT(&colourid);
}
@@ -345,7 +345,7 @@ extern "C" __declspec(dllexport) int Load(void) AddIcons();
RegisterFonts();
- CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENT("Chat module"), FONTMODE_SKIP };
+ CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Chat module"), FONTMODE_SKIP };
mir_getCI(&data);
saveCI = *pci;
diff --git a/src/core/stdchat/src/manager.cpp b/src/core/stdchat/src/manager.cpp index f0fd3076cc..bc901042e8 100644 --- a/src/core/stdchat/src/manager.cpp +++ b/src/core/stdchat/src/manager.cpp @@ -78,7 +78,7 @@ SESSION_INFO* SM_GetNextWindow(SESSION_INFO *si) // be restored
//---------------------------------------------------
-BOOL TabM_AddTab(const TCHAR *pszID, const char* pszModule)
+BOOL TabM_AddTab(const wchar_t *pszID, const char* pszModule)
{
TABLIST *node = NULL;
if (!pszID || !pszModule)
diff --git a/src/core/stdchat/src/options.cpp b/src/core/stdchat/src/options.cpp index 1bd3a33c5c..5ce45f72ce 100644 --- a/src/core/stdchat/src/options.cpp +++ b/src/core/stdchat/src/options.cpp @@ -23,109 +23,109 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct branch_t
{
- const TCHAR* szDescr;
+ const wchar_t* szDescr;
const char* szDBName;
int iMode;
BYTE bDefault;
};
static const struct branch_t branch0[] = {
- { LPGENT("Use a tabbed interface"), "Tabs", 0, 1 },
- { LPGENT("Close tab on double click"), "TabCloseOnDblClick", 0, 0 },
- { LPGENT("Restore previously open tabs when showing the window"), "TabRestore", 0, 0 },
- { LPGENT("Show tabs at the bottom"), "TabBottom", 0, 0 },
+ { LPGENW("Use a tabbed interface"), "Tabs", 0, 1 },
+ { LPGENW("Close tab on double click"), "TabCloseOnDblClick", 0, 0 },
+ { LPGENW("Restore previously open tabs when showing the window"), "TabRestore", 0, 0 },
+ { LPGENW("Show tabs at the bottom"), "TabBottom", 0, 0 },
};
static const struct branch_t branch1[] = {
- { LPGENT("Send message by pressing the 'Enter' key"), "SendOnEnter", 0, 1 },
- { LPGENT("Send message by pressing the 'Enter' key twice"), "SendOnDblEnter", 0, 0 },
- { LPGENT("Flash window when someone speaks"), "FlashWindow", 0, 0 },
- { LPGENT("Flash window when a word is highlighted"), "FlashWindowHighlight", 0, 1 },
- { LPGENT("Show list of users in the chat room"), "ShowNicklist", 0, 1 },
- { LPGENT("Show button for sending messages"), "ShowSend", 0, 0 },
- { LPGENT("Show buttons for controlling the chat room"), "ShowTopButtons", 0, 1 },
- { LPGENT("Show buttons for formatting the text you are typing"), "ShowFormatButtons", 0, 1 },
- { LPGENT("Show button menus when right clicking the buttons"), "RightClickFilter", 0, 0 },
- { LPGENT("Show new windows cascaded"), "CascadeWindows", 0, 1 },
- { LPGENT("Save the size and position of chat rooms"), "SavePosition", 0, 0 },
- { LPGENT("Show the topic of the room on your contact list (if supported)"), "TopicOnClist", 0, 0 },
- { LPGENT("Do not play sounds when the chat room is focused"), "SoundsFocus", 0, 0 },
- { LPGENT("Do not pop up the window when joining a chat room"), "PopupOnJoin", 0, 0 },
- { LPGENT("Toggle the visible state when double clicking in the contact list"), "ToggleVisibility", 0, 0 },
- { LPGENT("Show contact statuses if protocol supports them"), "ShowContactStatus", 0, 0 },
- { LPGENT("Display contact status icon before user role icon"), "ContactStatusFirst", 0, 0 },
+ { LPGENW("Send message by pressing the 'Enter' key"), "SendOnEnter", 0, 1 },
+ { LPGENW("Send message by pressing the 'Enter' key twice"), "SendOnDblEnter", 0, 0 },
+ { LPGENW("Flash window when someone speaks"), "FlashWindow", 0, 0 },
+ { LPGENW("Flash window when a word is highlighted"), "FlashWindowHighlight", 0, 1 },
+ { LPGENW("Show list of users in the chat room"), "ShowNicklist", 0, 1 },
+ { LPGENW("Show button for sending messages"), "ShowSend", 0, 0 },
+ { LPGENW("Show buttons for controlling the chat room"), "ShowTopButtons", 0, 1 },
+ { LPGENW("Show buttons for formatting the text you are typing"), "ShowFormatButtons", 0, 1 },
+ { LPGENW("Show button menus when right clicking the buttons"), "RightClickFilter", 0, 0 },
+ { LPGENW("Show new windows cascaded"), "CascadeWindows", 0, 1 },
+ { LPGENW("Save the size and position of chat rooms"), "SavePosition", 0, 0 },
+ { LPGENW("Show the topic of the room on your contact list (if supported)"), "TopicOnClist", 0, 0 },
+ { LPGENW("Do not play sounds when the chat room is focused"), "SoundsFocus", 0, 0 },
+ { LPGENW("Do not pop up the window when joining a chat room"), "PopupOnJoin", 0, 0 },
+ { LPGENW("Toggle the visible state when double clicking in the contact list"), "ToggleVisibility", 0, 0 },
+ { LPGENW("Show contact statuses if protocol supports them"), "ShowContactStatus", 0, 0 },
+ { LPGENW("Display contact status icon before user role icon"), "ContactStatusFirst", 0, 0 },
};
static const struct branch_t branch2[] = {
- { LPGENT("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1 },
- { LPGENT("Only prefix with timestamp if it has changed"), "ShowTimeStampIfChanged", 0, 0 },
- { LPGENT("Timestamp has same color as the event"), "TimeStampEventColour", 0, 0 },
- { LPGENT("Indent the second line of a message"), "LogIndentEnabled", 0, 1 },
- { LPGENT("Limit user names in the message log to 20 characters"), "LogLimitNames", 0, 1 },
- { LPGENT("Add ':' to auto-completed user names"), "AddColonToAutoComplete", 0, 1 },
- { LPGENT("Strip colors from messages in the log"), "StripFormatting", 0, 0 },
- { LPGENT("Enable the 'event filter' for new rooms"), "FilterEnabled", 0, 0 }
+ { LPGENW("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1 },
+ { LPGENW("Only prefix with timestamp if it has changed"), "ShowTimeStampIfChanged", 0, 0 },
+ { LPGENW("Timestamp has same color as the event"), "TimeStampEventColour", 0, 0 },
+ { LPGENW("Indent the second line of a message"), "LogIndentEnabled", 0, 1 },
+ { LPGENW("Limit user names in the message log to 20 characters"), "LogLimitNames", 0, 1 },
+ { LPGENW("Add ':' to auto-completed user names"), "AddColonToAutoComplete", 0, 1 },
+ { LPGENW("Strip colors from messages in the log"), "StripFormatting", 0, 0 },
+ { LPGENW("Enable the 'event filter' for new rooms"), "FilterEnabled", 0, 0 }
};
static const struct branch_t branch3[] = {
- { LPGENT("Show topic changes"), "FilterFlags", GC_EVENT_TOPIC, 0 },
- { LPGENT("Show users joining"), "FilterFlags", GC_EVENT_JOIN, 0 },
- { LPGENT("Show users disconnecting"), "FilterFlags", GC_EVENT_QUIT, 0 },
- { LPGENT("Show messages"), "FilterFlags", GC_EVENT_MESSAGE, 1 },
- { LPGENT("Show actions"), "FilterFlags", GC_EVENT_ACTION, 1 },
- { LPGENT("Show users leaving"), "FilterFlags", GC_EVENT_PART, 0 },
- { LPGENT("Show users being kicked"), "FilterFlags", GC_EVENT_KICK, 1 },
- { LPGENT("Show notices"), "FilterFlags", GC_EVENT_NOTICE, 1 },
- { LPGENT("Show users changing name"), "FilterFlags", GC_EVENT_NICK, 0 },
- { LPGENT("Show information messages"), "FilterFlags", GC_EVENT_INFORMATION, 1 },
- { LPGENT("Show status changes of users"), "FilterFlags", GC_EVENT_ADDSTATUS, 0 },
+ { LPGENW("Show topic changes"), "FilterFlags", GC_EVENT_TOPIC, 0 },
+ { LPGENW("Show users joining"), "FilterFlags", GC_EVENT_JOIN, 0 },
+ { LPGENW("Show users disconnecting"), "FilterFlags", GC_EVENT_QUIT, 0 },
+ { LPGENW("Show messages"), "FilterFlags", GC_EVENT_MESSAGE, 1 },
+ { LPGENW("Show actions"), "FilterFlags", GC_EVENT_ACTION, 1 },
+ { LPGENW("Show users leaving"), "FilterFlags", GC_EVENT_PART, 0 },
+ { LPGENW("Show users being kicked"), "FilterFlags", GC_EVENT_KICK, 1 },
+ { LPGENW("Show notices"), "FilterFlags", GC_EVENT_NOTICE, 1 },
+ { LPGENW("Show users changing name"), "FilterFlags", GC_EVENT_NICK, 0 },
+ { LPGENW("Show information messages"), "FilterFlags", GC_EVENT_INFORMATION, 1 },
+ { LPGENW("Show status changes of users"), "FilterFlags", GC_EVENT_ADDSTATUS, 0 },
};
static const struct branch_t branch4[] = {
- { LPGENT("Show icon for topic changes"), "IconFlags", GC_EVENT_TOPIC, 0 },
- { LPGENT("Show icon for users joining"), "IconFlags", GC_EVENT_JOIN, 1 },
- { LPGENT("Show icon for users disconnecting"), "IconFlags", GC_EVENT_QUIT, 0 },
- { LPGENT("Show icon for messages"), "IconFlags", GC_EVENT_MESSAGE, 0 },
- { LPGENT("Show icon for actions"), "IconFlags", GC_EVENT_ACTION, 0 },
- { LPGENT("Show icon for highlights"), "IconFlags", GC_EVENT_HIGHLIGHT, 0 },
- { LPGENT("Show icon for users leaving"), "IconFlags", GC_EVENT_PART, 0 },
- { LPGENT("Show icon for users kicking other user"), "IconFlags", GC_EVENT_KICK, 0 },
- { LPGENT("Show icon for notices"), "IconFlags", GC_EVENT_NOTICE, 0 },
- { LPGENT("Show icon for name changes"), "IconFlags", GC_EVENT_NICK, 0 },
- { LPGENT("Show icon for information messages"), "IconFlags", GC_EVENT_INFORMATION, 0 },
- { LPGENT("Show icon for status changes"), "IconFlags", GC_EVENT_ADDSTATUS, 0 },
+ { LPGENW("Show icon for topic changes"), "IconFlags", GC_EVENT_TOPIC, 0 },
+ { LPGENW("Show icon for users joining"), "IconFlags", GC_EVENT_JOIN, 1 },
+ { LPGENW("Show icon for users disconnecting"), "IconFlags", GC_EVENT_QUIT, 0 },
+ { LPGENW("Show icon for messages"), "IconFlags", GC_EVENT_MESSAGE, 0 },
+ { LPGENW("Show icon for actions"), "IconFlags", GC_EVENT_ACTION, 0 },
+ { LPGENW("Show icon for highlights"), "IconFlags", GC_EVENT_HIGHLIGHT, 0 },
+ { LPGENW("Show icon for users leaving"), "IconFlags", GC_EVENT_PART, 0 },
+ { LPGENW("Show icon for users kicking other user"), "IconFlags", GC_EVENT_KICK, 0 },
+ { LPGENW("Show icon for notices"), "IconFlags", GC_EVENT_NOTICE, 0 },
+ { LPGENW("Show icon for name changes"), "IconFlags", GC_EVENT_NICK, 0 },
+ { LPGENW("Show icon for information messages"), "IconFlags", GC_EVENT_INFORMATION, 0 },
+ { LPGENW("Show icon for status changes"), "IconFlags", GC_EVENT_ADDSTATUS, 0 },
};
static const struct branch_t branch5[] = {
- { LPGENT("Show icons in tray only when the chat room is not active"), "TrayIconInactiveOnly", 0, 1 },
- { LPGENT("Show icon in tray for topic changes"), "TrayIconFlags", GC_EVENT_TOPIC, 0 },
- { LPGENT("Show icon in tray for users joining"), "TrayIconFlags", GC_EVENT_JOIN, 0 },
- { LPGENT("Show icon in tray for users disconnecting"), "TrayIconFlags", GC_EVENT_QUIT, 0 },
- { LPGENT("Show icon in tray for messages"), "TrayIconFlags", GC_EVENT_MESSAGE, 0 },
- { LPGENT("Show icon in tray for actions"), "TrayIconFlags", GC_EVENT_ACTION, 0 },
- { LPGENT("Show icon in tray for highlights"), "TrayIconFlags", GC_EVENT_HIGHLIGHT, 1 },
- { LPGENT("Show icon in tray for users leaving"), "TrayIconFlags", GC_EVENT_PART, 0 },
- { LPGENT("Show icon in tray for users kicking other user"), "TrayIconFlags", GC_EVENT_KICK, 0 },
- { LPGENT("Show icon in tray for notices"), "TrayIconFlags", GC_EVENT_NOTICE, 0 },
- { LPGENT("Show icon in tray for name changes"), "TrayIconFlags", GC_EVENT_NICK, 0 },
- { LPGENT("Show icon in tray for information messages"), "TrayIconFlags", GC_EVENT_INFORMATION, 0 },
- { LPGENT("Show icon in tray for status changes"), "TrayIconFlags", GC_EVENT_ADDSTATUS, 0 },
+ { LPGENW("Show icons in tray only when the chat room is not active"), "TrayIconInactiveOnly", 0, 1 },
+ { LPGENW("Show icon in tray for topic changes"), "TrayIconFlags", GC_EVENT_TOPIC, 0 },
+ { LPGENW("Show icon in tray for users joining"), "TrayIconFlags", GC_EVENT_JOIN, 0 },
+ { LPGENW("Show icon in tray for users disconnecting"), "TrayIconFlags", GC_EVENT_QUIT, 0 },
+ { LPGENW("Show icon in tray for messages"), "TrayIconFlags", GC_EVENT_MESSAGE, 0 },
+ { LPGENW("Show icon in tray for actions"), "TrayIconFlags", GC_EVENT_ACTION, 0 },
+ { LPGENW("Show icon in tray for highlights"), "TrayIconFlags", GC_EVENT_HIGHLIGHT, 1 },
+ { LPGENW("Show icon in tray for users leaving"), "TrayIconFlags", GC_EVENT_PART, 0 },
+ { LPGENW("Show icon in tray for users kicking other user"), "TrayIconFlags", GC_EVENT_KICK, 0 },
+ { LPGENW("Show icon in tray for notices"), "TrayIconFlags", GC_EVENT_NOTICE, 0 },
+ { LPGENW("Show icon in tray for name changes"), "TrayIconFlags", GC_EVENT_NICK, 0 },
+ { LPGENW("Show icon in tray for information messages"), "TrayIconFlags", GC_EVENT_INFORMATION, 0 },
+ { LPGENW("Show icon in tray for status changes"), "TrayIconFlags", GC_EVENT_ADDSTATUS, 0 },
};
static const struct branch_t branch6[] = {
- { LPGENT("Show popups only when the chat room is not active"), "PopupInactiveOnly", 0, 1 },
- { LPGENT("Show popup for topic changes"), "PopupFlags", GC_EVENT_TOPIC, 0 },
- { LPGENT("Show popup for users joining"), "PopupFlags", GC_EVENT_JOIN, 0 },
- { LPGENT("Show popup for users disconnecting"), "PopupFlags", GC_EVENT_QUIT, 0 },
- { LPGENT("Show popup for messages"), "PopupFlags", GC_EVENT_MESSAGE, 0 },
- { LPGENT("Show popup for actions"), "PopupFlags", GC_EVENT_ACTION, 0 },
- { LPGENT("Show popup for highlights"), "PopupFlags", GC_EVENT_HIGHLIGHT, 0 },
- { LPGENT("Show popup for users leaving"), "PopupFlags", GC_EVENT_PART, 0 },
- { LPGENT("Show popup for users kicking other user"), "PopupFlags", GC_EVENT_KICK, 0 },
- { LPGENT("Show popup for notices"), "PopupFlags", GC_EVENT_NOTICE, 0 },
- { LPGENT("Show popup for name changes"), "PopupFlags", GC_EVENT_NICK, 0 },
- { LPGENT("Show popup for information messages"), "PopupFlags", GC_EVENT_INFORMATION, 0 },
- { LPGENT("Show popup for status changes"), "PopupFlags", GC_EVENT_ADDSTATUS, 0 },
+ { LPGENW("Show popups only when the chat room is not active"), "PopupInactiveOnly", 0, 1 },
+ { LPGENW("Show popup for topic changes"), "PopupFlags", GC_EVENT_TOPIC, 0 },
+ { LPGENW("Show popup for users joining"), "PopupFlags", GC_EVENT_JOIN, 0 },
+ { LPGENW("Show popup for users disconnecting"), "PopupFlags", GC_EVENT_QUIT, 0 },
+ { LPGENW("Show popup for messages"), "PopupFlags", GC_EVENT_MESSAGE, 0 },
+ { LPGENW("Show popup for actions"), "PopupFlags", GC_EVENT_ACTION, 0 },
+ { LPGENW("Show popup for highlights"), "PopupFlags", GC_EVENT_HIGHLIGHT, 0 },
+ { LPGENW("Show popup for users leaving"), "PopupFlags", GC_EVENT_PART, 0 },
+ { LPGENW("Show popup for users kicking other user"), "PopupFlags", GC_EVENT_KICK, 0 },
+ { LPGENW("Show popup for notices"), "PopupFlags", GC_EVENT_NOTICE, 0 },
+ { LPGENW("Show popup for name changes"), "PopupFlags", GC_EVENT_NICK, 0 },
+ { LPGENW("Show popup for information messages"), "PopupFlags", GC_EVENT_INFORMATION, 0 },
+ { LPGENW("Show popup for status changes"), "PopupFlags", GC_EVENT_ADDSTATUS, 0 },
};
HTREEITEM hItemB0[_countof(branch0)];
@@ -242,7 +242,7 @@ static void CheckBranches(HWND hwndTree, HTREEITEM hHeading) static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData)
{
- TCHAR szDir[MAX_PATH];
+ wchar_t szDir[MAX_PATH];
switch (uMsg) {
case BFFM_INITIALIZED:
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData);
@@ -320,7 +320,7 @@ HANDLE GetIconHandle(const char *pszIcoLibName) return IcoLib_GetIconHandle(szTemp);
}
-static void InitSetting(TCHAR** ppPointer, char* pszSetting, TCHAR* pszDefault)
+static void InitSetting(wchar_t** ppPointer, char* pszSetting, wchar_t* pszDefault)
{
DBVARIANT dbv;
if (!db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv)) {
@@ -484,13 +484,13 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, SendDlgItemMessage(hwndDlg, IDC_SPIN4, UDM_SETRANGE, 0, MAKELONG(255, 10));
SendDlgItemMessage(hwndDlg, IDC_SPIN4, UDM_SETPOS, 0, MAKELONG(db_get_b(NULL, CHAT_MODULE, "NicklistRowDist", 12), 0));
{
- TCHAR* pszGroup = NULL;
+ wchar_t* pszGroup = NULL;
InitSetting(&pszGroup, "AddToGroup", L"Chat rooms");
SetDlgItemText(hwndDlg, IDC_GROUP, pszGroup);
mir_free(pszGroup);
}
{
- TCHAR szTemp[MAX_PATH];
+ wchar_t szTemp[MAX_PATH];
PathToRelativeT(g_Settings.pszLogDir, szTemp);
SetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, szTemp);
}
@@ -529,8 +529,8 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, case IDC_FONTCHOOSE:
{
- TCHAR szDirectory[MAX_PATH];
- TCHAR szTemp[MAX_PATH];
+ wchar_t szDirectory[MAX_PATH];
+ wchar_t szTemp[MAX_PATH];
BROWSEINFO bi = { 0 };
bi.hwndOwner = hwndDlg;
@@ -561,18 +561,18 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, case WM_NOTIFY:
if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY) {
- TCHAR * pszText = NULL;
+ wchar_t * pszText = NULL;
int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_HIGHLIGHTWORDS));
if (iLen > 0) {
- TCHAR *ptszText = (TCHAR *)mir_alloc((iLen + 2) * sizeof(TCHAR));
- TCHAR *p2 = NULL;
+ wchar_t *ptszText = (wchar_t *)mir_alloc((iLen + 2) * sizeof(wchar_t));
+ wchar_t *p2 = NULL;
if (ptszText) {
GetDlgItemText(hwndDlg, IDC_HIGHLIGHTWORDS, ptszText, iLen + 1);
- p2 = _tcschr(ptszText, ',');
+ p2 = wcschr(ptszText, ',');
while (p2) {
*p2 = ' ';
- p2 = _tcschr(ptszText, ',');
+ p2 = wcschr(ptszText, ',');
}
db_set_ts(NULL, CHAT_MODULE, "HighlightWords", ptszText);
mir_free(ptszText);
@@ -582,7 +582,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY));
if (iLen > 0) {
- pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
+ pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, pszText, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "LogDirectory", pszText);
}
@@ -591,7 +591,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOGTIMESTAMP));
if (iLen > 0) {
- pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
+ pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_LOGTIMESTAMP, pszText, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "LogTimestamp", pszText);
}
@@ -599,7 +599,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_TIMESTAMP));
if (iLen > 0) {
- pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
+ pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_TIMESTAMP, pszText, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "HeaderTime", pszText);
}
@@ -607,7 +607,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_INSTAMP));
if (iLen > 0) {
- pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
+ pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_INSTAMP, pszText, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "HeaderIncoming", pszText);
}
@@ -615,7 +615,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_OUTSTAMP));
if (iLen > 0) {
- pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
+ pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_OUTSTAMP, pszText, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "HeaderOutgoing", pszText);
}
@@ -634,7 +634,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_GROUP));
if (iLen > 0) {
- pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
+ pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_GROUP, pszText, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "AddToGroup", pszText);
}
diff --git a/src/core/stdchat/src/stdafx.h b/src/core/stdchat/src/stdafx.h index 5acc72626b..5e27b6b467 100644 --- a/src/core/stdchat/src/stdafx.h +++ b/src/core/stdchat/src/stdafx.h @@ -67,7 +67,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct TABLIST
{
- TCHAR *pszID;
+ wchar_t *pszID;
char *pszModule;
TABLIST *next;
};
@@ -135,12 +135,12 @@ void LoadIcons(void); // log.c
void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, BOOL bRedraw, BOOL bPhaseTwo);
-void ValidateFilename (TCHAR * filename);
+void ValidateFilename (wchar_t * filename);
char* Log_CreateRtfHeader(MODULEINFO * mi);
// window.c
INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
-int GetTextPixelSize( TCHAR* pszText, HFONT hFont, BOOL bWidth);
+int GetTextPixelSize( wchar_t* pszText, HFONT hFont, BOOL bWidth);
SESSION_INFO* SM_GetPrevWindow(SESSION_INFO *si);
SESSION_INFO* SM_GetNextWindow(SESSION_INFO *si);
@@ -158,14 +158,14 @@ void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground); int GetColorIndex(const char* pszModule, COLORREF cr);
void CheckColorsInModule(const char* pszModule);
int GetRichTextLength(HWND hwnd);
-UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText);
+UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, wchar_t* pszUID, wchar_t* pszWordText);
void DestroyGCMenu(HMENU *hMenu, int iIndex);
bool LoadMessageFont(LOGFONT *lf, COLORREF *colour);
// message.c
char* Message_GetFromStream(HWND hwndDlg, SESSION_INFO *si);
-BOOL TabM_AddTab(const TCHAR *pszID, const char* pszModule);
+BOOL TabM_AddTab(const wchar_t *pszID, const char* pszModule);
BOOL TabM_RemoveAll(void);
#pragma comment(lib,"comctl32.lib")
diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp index 56765958bd..12731649f2 100644 --- a/src/core/stdchat/src/tools.cpp +++ b/src/core/stdchat/src/tools.cpp @@ -109,7 +109,7 @@ void CheckColorsInModule(const char* pszModule) }
}
-UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText)
+UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, wchar_t* pszUID, wchar_t* pszWordText)
{
HMENU hSubMenu = 0;
*hMenu = GetSubMenu(g_hMenu, iIndex);
@@ -134,7 +134,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO }
if (pszWordText && pszWordText[0]) {
- TCHAR szMenuText[4096];
+ wchar_t szMenuText[4096];
mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText);
}
@@ -142,7 +142,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO gcmi.Type = MENU_ON_LOG;
}
else if (iIndex == 0) {
- TCHAR szTemp[50];
+ wchar_t szTemp[50];
if (pszWordText)
mir_sntprintf(szTemp, TranslateT("&Message %s"), pszWordText);
else
@@ -160,7 +160,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO AppendMenu(*hMenu, MF_SEPARATOR, 0, 0);
for (int i = 0; i < gcmi.nItems; i++) {
- TCHAR* ptszText = TranslateTS(gcmi.Item[i].pszDesc);
+ wchar_t* ptszText = TranslateTS(gcmi.Item[i].pszDesc);
DWORD dwState = gcmi.Item[i].bDisabled ? MF_GRAYED : 0;
if (gcmi.Item[i].uType == MENU_NEWPOPUP) {
@@ -199,12 +199,12 @@ void DestroyGCMenu(HMENU *hMenu, int iIndex) }
}
-void ValidateFilename(TCHAR *filename)
+void ValidateFilename(wchar_t *filename)
{
- TCHAR *p1 = filename;
- TCHAR szForbidden[] = L"\\/:*?\"<>|";
+ wchar_t *p1 = filename;
+ wchar_t szForbidden[] = L"\\/:*?\"<>|";
while (*p1 != '\0') {
- if (_tcschr(szForbidden, *p1))
+ if (wcschr(szForbidden, *p1))
*p1 = '_';
p1 += 1;
}
diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index 7fdbf8f562..bf71ea9f90 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -27,10 +27,10 @@ static HKL hkl = NULL; struct MESSAGESUBDATA
{
time_t lastEnterTime;
- TCHAR szTabSave[20];
+ wchar_t szTabSave[20];
};
-static TCHAR szTrimString[] = L":;,.!?\'\"><()[]- \r\n";
+static wchar_t szTrimString[] = L":;,.!?\'\"><()[]- \r\n";
static LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
@@ -363,7 +363,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, SendMessage(GetParent(hwnd), GC_SWITCHTAB, 0, (int)wParam - (int)VK_NUMPAD1);
if (wParam == VK_TAB && !isCtrl && !isShift) { //tab-autocomplete
- TCHAR* pszText = NULL;
+ wchar_t* pszText = NULL;
LRESULT lResult = (LRESULT)SendMessage(hwnd, EM_GETSEL, 0, 0);
SendMessage(hwnd, WM_SETREDRAW, FALSE, 0);
@@ -376,7 +376,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, gtl.codepage = CP_ACP;
int iLen = SendMessage(hwnd, EM_GETTEXTLENGTHEX, (WPARAM)>l, 0);
if (iLen > 0) {
- pszText = (TCHAR *)mir_alloc(sizeof(TCHAR)*(iLen + 100));
+ pszText = (wchar_t *)mir_alloc(sizeof(wchar_t)*(iLen + 100));
GETTEXTEX gt = { 0 };
gt.cb = iLen + 99;
@@ -392,10 +392,10 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, if (dat->szTabSave[0] == '\0')
mir_tstrncpy(dat->szTabSave, pszText + start, end - start + 1);
- TCHAR *pszSelName = (TCHAR *)mir_alloc(sizeof(TCHAR)*(end - start + 1));
+ wchar_t *pszSelName = (wchar_t *)mir_alloc(sizeof(wchar_t)*(end - start + 1));
mir_tstrncpy(pszSelName, pszText + start, end - start + 1);
- TCHAR *pszName = pci->UM_FindUserAutoComplete(Parentsi->pUsers, dat->szTabSave, pszSelName);
+ wchar_t *pszName = pci->UM_FindUserAutoComplete(Parentsi->pUsers, dat->szTabSave, pszSelName);
if (pszName == NULL) {
pszName = dat->szTabSave;
SendMessage(hwnd, EM_SETSEL, start, end);
@@ -984,13 +984,13 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *si ti.uId = 1;
ti.rect = clientRect;
- TCHAR tszBuf[1024]; tszBuf[0] = 0;
+ wchar_t tszBuf[1024]; tszBuf[0] = 0;
USERINFO *ui = pci->SM_GetUserFromIndex(si->ptszID, si->pszModule, currentHovered);
if (ui) {
if (ProtoServiceExists(si->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT)) {
- TCHAR *p = (TCHAR*)CallProtoService(si->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)si->ptszID, (LPARAM)ui->pszUID);
+ wchar_t *p = (wchar_t*)CallProtoService(si->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)si->ptszID, (LPARAM)ui->pszUID);
if (p != NULL) {
- _tcsncpy_s(tszBuf, p, _TRUNCATE);
+ wcsncpy_s(tszBuf, p, _TRUNCATE);
mir_free(p);
}
}
@@ -1170,7 +1170,7 @@ static int RestoreWindowPosition(HWND hwnd, MCONTACT hContact, char * szModule, return 1;
}
-int GetTextPixelSize(TCHAR* pszText, HFONT hFont, BOOL bWidth)
+int GetTextPixelSize(wchar_t* pszText, HFONT hFont, BOOL bWidth)
{
if (!pszText || !hFont)
return 0;
@@ -1220,7 +1220,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar SendDlgItemMessage(hwndDlg, IDC_LOG, EM_AUTOURLDETECT, 1, 0);
int mask = (int)SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETEVENTMASK, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETEVENTMASK, 0, mask | ENM_LINK | ENM_MOUSEEVENTS);
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_LIMITTEXT, (WPARAM)sizeof(TCHAR) * 0x7FFFFFFF, 0);
+ SendDlgItemMessage(hwndDlg, IDC_LOG, EM_LIMITTEXT, (WPARAM)sizeof(wchar_t) * 0x7FFFFFFF, 0);
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETOLECALLBACK, 0, (LPARAM)& reOleCallback);
si->hwndStatus = CreateWindowEx(0, STATUSCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP | SBT_TOOLTIPS, 0, 0, 0, 0, hwndDlg, NULL, g_hInst, NULL);
@@ -1311,7 +1311,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case GC_UPDATETITLE:
{
- TCHAR szTemp[100];
+ wchar_t szTemp[100];
switch (si->iType) {
case GCW_CHATROOM:
mir_sntprintf(szTemp,
@@ -1334,7 +1334,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case GC_UPDATESTATUSBAR:
{
MODULEINFO *mi = pci->MM_FindModule(si->pszModule);
- TCHAR* ptszDispName = mi->ptszModDispName;
+ wchar_t* ptszDispName = mi->ptszModDispName;
int x = 12;
x += GetTextPixelSize(ptszDispName, (HFONT)SendMessage(si->hwndStatus, WM_GETFONT, 0, 0), TRUE);
x += GetSystemMetrics(SM_CXSMICON);
@@ -1603,7 +1603,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (!bFound) { // create a new tab
int insertat;
- TCHAR szTemp[30];
+ wchar_t szTemp[30];
mir_tstrncpy(szTemp, s1->ptszName, 21);
if (mir_tstrlen(s1->ptszName) > 20)
@@ -2170,7 +2170,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar POINT pt;
UINT uID = 0;
HMENU hMenu = 0;
- TCHAR pszWord[4096];
+ wchar_t pszWord[4096];
pt.x = (short)LOWORD(((ENLINK *)lParam)->lParam);
pt.y = (short)HIWORD(((ENLINK *)lParam)->lParam);
@@ -2199,7 +2199,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar tr.lpstrText = pszWord;
long iRes = SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (iRes > 0)
- for (size_t iLen = mir_tstrlen(pszWord) - 1; _tcschr(szTrimString, pszWord[iLen]); iLen--)
+ for (size_t iLen = mir_tstrlen(pszWord) - 1; wcschr(szTrimString, pszWord[iLen]); iLen--)
pszWord[iLen] = 0;
}
@@ -2271,7 +2271,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar TEXTRANGE tr;
tr.chrg = ((ENLINK *)lParam)->chrg;
- tr.lpstrText = (LPTSTR)mir_alloc(sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 1));
+ tr.lpstrText = (LPTSTR)mir_alloc(sizeof(wchar_t)*(tr.chrg.cpMax - tr.chrg.cpMin + 1));
SendMessage(((LPNMHDR)lParam)->hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (((ENLINK *)lParam)->msg == WM_RBUTTONDOWN) {
@@ -2298,8 +2298,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (!OpenClipboard(hwndDlg))
break;
EmptyClipboard();
- hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(tr.lpstrText) + 1));
- mir_tstrcpy((TCHAR*)GlobalLock(hData), tr.lpstrText);
+ hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(wchar_t)*(mir_tstrlen(tr.lpstrText) + 1));
+ mir_tstrcpy((wchar_t*)GlobalLock(hData), tr.lpstrText);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
CloseClipboard();
@@ -2330,7 +2330,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar int item = LOWORD(SendDlgItemMessage(hwndDlg, IDC_LIST, LB_ITEMFROMPOINT, 0, MAKELPARAM(p.x, p.y)));
USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item);
if (ui != NULL) {
- static TCHAR ptszBuf[1024];
+ static wchar_t ptszBuf[1024];
mir_sntprintf(ptszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s",
TranslateT("Nickname"), ui->pszNick,
TranslateT("Unique ID"), ui->pszUID,
@@ -2357,7 +2357,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar LRESULT lResult = (LRESULT)SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_GETSEL, 0, 0);
int start = LOWORD(lResult);
size_t dwNameLenMax = (mir_tstrlen(ui->pszUID) + 3);
- TCHAR* pszName = (TCHAR*)alloca(sizeof(TCHAR) * dwNameLenMax);
+ wchar_t* pszName = (wchar_t*)alloca(sizeof(wchar_t) * dwNameLenMax);
if (start == 0)
mir_sntprintf(pszName, dwNameLenMax, L"%s: ", ui->pszUID);
else
@@ -2446,8 +2446,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_HISTORY))) {
MODULEINFO *pInfo = pci->MM_FindModule(si->pszModule);
if (pInfo) {
- TCHAR szFile[MAX_PATH], szName[MAX_PATH], szFolder[MAX_PATH];
- _tcsncpy_s(szName, (pInfo->ptszModDispName ? pInfo->ptszModDispName : _A2T(si->pszModule)), _TRUNCATE);
+ wchar_t szFile[MAX_PATH], szName[MAX_PATH], szFolder[MAX_PATH];
+ wcsncpy_s(szName, (pInfo->ptszModDispName ? pInfo->ptszModDispName : _A2T(si->pszModule)), _TRUNCATE);
ValidateFilename(szName);
mir_sntprintf(szFolder, L"%s\\%s", g_Settings.pszLogDir, szName);
diff --git a/src/core/stdclist/src/clcfonts.cpp b/src/core/stdclist/src/clcfonts.cpp index 79150a51f4..74c09a7278 100644 --- a/src/core/stdclist/src/clcfonts.cpp +++ b/src/core/stdclist/src/clcfonts.cpp @@ -28,19 +28,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct
{
- const TCHAR *tszName;
+ const wchar_t *tszName;
int iMask;
}
static clistFontDescr[] =
{
- { LPGENT("Standard contacts"), FIDF_CLASSGENERAL },
- { LPGENT("Online contacts to whom you have a different visibility"), FIDF_CLASSGENERAL },
- { LPGENT("Offline contacts"), FIDF_CLASSGENERAL },
- { LPGENT("Contacts which are 'not on list'"), FIDF_CLASSGENERAL },
- { LPGENT("Groups"), FIDF_CLASSHEADER },
- { LPGENT("Group member counts"), FIDF_CLASSHEADER },
- { LPGENT("Dividers"), FIDF_CLASSSMALL },
- { LPGENT("Offline contacts to whom you have a different visibility"), FIDF_CLASSGENERAL }
+ { LPGENW("Standard contacts"), FIDF_CLASSGENERAL },
+ { LPGENW("Online contacts to whom you have a different visibility"), FIDF_CLASSGENERAL },
+ { LPGENW("Offline contacts"), FIDF_CLASSGENERAL },
+ { LPGENW("Contacts which are 'not on list'"), FIDF_CLASSGENERAL },
+ { LPGENW("Groups"), FIDF_CLASSHEADER },
+ { LPGENW("Group member counts"), FIDF_CLASSHEADER },
+ { LPGENW("Dividers"), FIDF_CLASSSMALL },
+ { LPGENW("Offline contacts to whom you have a different visibility"), FIDF_CLASSGENERAL }
};
static int FS_FontsChanged(WPARAM, LPARAM)
@@ -54,7 +54,7 @@ void RegisterCListFonts() FontIDT fontid = { sizeof(fontid) };
fontid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWREREGISTER | FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS;
strncpy(fontid.dbSettingsGroup, "CLC", sizeof(fontid.dbSettingsGroup));
- _tcsncpy(fontid.group, LPGENT("Contact list"), _countof(fontid.group));
+ wcsncpy(fontid.group, LPGENW("Contact list"), _countof(fontid.group));
HDC hdc = GetDC(NULL);
for (int i = 0; i < _countof(clistFontDescr); i++) {
@@ -62,7 +62,7 @@ void RegisterCListFonts() pcli->pfnGetFontSetting(i, &lf, &fontid.deffontsettings.colour);
lf.lfHeight = -MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
- _tcsncpy_s(fontid.deffontsettings.szFace, lf.lfFaceName, _TRUNCATE);
+ wcsncpy_s(fontid.deffontsettings.szFace, lf.lfFaceName, _TRUNCATE);
fontid.deffontsettings.charset = lf.lfCharSet;
fontid.deffontsettings.size = (char)lf.lfHeight;
fontid.deffontsettings.style = (lf.lfWeight >= FW_BOLD ? DBFONTF_BOLD : 0) | (lf.lfItalic ? DBFONTF_ITALIC : 0);
@@ -70,7 +70,7 @@ void RegisterCListFonts() fontid.flags &= ~FIDF_CLASSMASK;
fontid.flags |= clistFontDescr[i].iMask;
- _tcsncpy(fontid.name, clistFontDescr[i].tszName, _countof(fontid.name));
+ wcsncpy(fontid.name, clistFontDescr[i].tszName, _countof(fontid.name));
char idstr[10];
mir_snprintf(idstr, "Font%d", i);
@@ -87,25 +87,25 @@ void RegisterCListFonts() strncpy(colourid.dbSettingsGroup, "CLC", sizeof(colourid.dbSettingsGroup));
strncpy(colourid.setting, "BkColour", sizeof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Background"), _countof(colourid.name));
- _tcsncpy(colourid.group, LPGENT("Contact list"), _countof(colourid.group));
+ wcsncpy(colourid.name, LPGENW("Background"), _countof(colourid.name));
+ wcsncpy(colourid.group, LPGENW("Contact list"), _countof(colourid.group));
colourid.defcolour = CLCDEFAULT_BKCOLOUR;
ColourRegisterT(&colourid);
strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Selected text"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Selected text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR;
ColourRegisterT(&colourid);
strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Hottrack text"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Hottrack text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR;
ColourRegisterT(&colourid);
strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Quicksearch text"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Quicksearch text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR;
ColourRegisterT(&colourid);
diff --git a/src/core/stdclist/src/clcopts.cpp b/src/core/stdclist/src/clcopts.cpp index ef529785e9..53d42c65c3 100644 --- a/src/core/stdclist/src/clcopts.cpp +++ b/src/core/stdclist/src/clcopts.cpp @@ -54,36 +54,36 @@ static const checkBoxToStyleEx[] = struct CheckBoxValues_t
{
DWORD style;
- TCHAR* szDescr;
+ wchar_t* szDescr;
};
static const struct CheckBoxValues_t greyoutValues[] =
{
- { GREYF_UNFOCUS, LPGENT("Not focused") },
- { 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") }
+ { GREYF_UNFOCUS, LPGENW("Not focused") },
+ { 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 const struct CheckBoxValues_t offlineValues[] =
{
- { 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)
@@ -340,7 +340,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case WM_COMMAND:
if (LOWORD(wParam) == IDC_BROWSE) {
- TCHAR str[MAX_PATH], filter[512];
+ wchar_t str[MAX_PATH], filter[512];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
OPENFILENAME ofn = { 0 };
@@ -459,7 +459,7 @@ int ClcModernOptInit(WPARAM wParam, LPARAM) obj.hInstance = g_hInst;
obj.iSection = MODERNOPT_PAGE_SKINS;
obj.iType = MODERNOPT_TYPE_SUBSECTIONPAGE;
- obj.lptzSubsection = LPGENT("Contact list");
+ obj.lptzSubsection = LPGENW("Contact list");
obj.iBoldControls = iBoldControls;
obj.lpzHelpUrl = "http://wiki.miranda-ng.org/";
diff --git a/src/core/stdclist/src/clcpaint.cpp b/src/core/stdclist/src/clcpaint.cpp index 3360176522..cb679abd0e 100644 --- a/src/core/stdclist/src/clcpaint.cpp +++ b/src/core/stdclist/src/clcpaint.cpp @@ -316,7 +316,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) GetTextExtentPoint32(hdcMem, cc->szText, (int)mir_tstrlen(cc->szText), &textSize);
width = textSize.cx;
- TCHAR *ptszGroupCount = NULL;
+ wchar_t *ptszGroupCount = NULL;
if (cc->type == CLCIT_GROUP) {
ptszGroupCount = pcli->pfnGetGroupCountsText(dat, cc);
if (*ptszGroupCount) {
diff --git a/src/core/stdclist/src/cluiopts.cpp b/src/core/stdclist/src/cluiopts.cpp index 00f163105c..fdd473a268 100644 --- a/src/core/stdclist/src/cluiopts.cpp +++ b/src/core/stdclist/src/cluiopts.cpp @@ -170,7 +170,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L db_set_b(NULL, "CLUI", "ClientAreaDrag", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG));
db_set_b(NULL, "CList", "Min2Tray", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY));
{
- TCHAR title[256];
+ wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
db_set_ts(NULL, "CList", "TitleText", title);
SetWindowText(pcli->hwndContactList, title);
diff --git a/src/core/stdclist/src/contact.cpp b/src/core/stdclist/src/contact.cpp index 5e4e5634e2..359419faa3 100644 --- a/src/core/stdclist/src/contact.cpp +++ b/src/core/stdclist/src/contact.cpp @@ -24,37 +24,37 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-int g_bSortByStatus, g_bSortByProto; +int g_bSortByStatus, g_bSortByProto;
-const struct -{ - int status, order; -} -static statusModeOrder[] = { - { ID_STATUS_OFFLINE, 500 }, - { ID_STATUS_ONLINE, 10 }, - { ID_STATUS_AWAY, 200 }, - { ID_STATUS_DND, 110 }, - { ID_STATUS_NA, 450 }, - { ID_STATUS_OCCUPIED, 100 }, - { ID_STATUS_FREECHAT, 0 }, - { ID_STATUS_INVISIBLE, 20 }, - { ID_STATUS_ONTHEPHONE, 150 }, - { ID_STATUS_OUTTOLUNCH, 425 } }; +const struct
+{
+ int status, order;
+}
+static statusModeOrder[] = {
+ { ID_STATUS_OFFLINE, 500 },
+ { ID_STATUS_ONLINE, 10 },
+ { ID_STATUS_AWAY, 200 },
+ { ID_STATUS_DND, 110 },
+ { ID_STATUS_NA, 450 },
+ { ID_STATUS_OCCUPIED, 100 },
+ { ID_STATUS_FREECHAT, 0 },
+ { ID_STATUS_INVISIBLE, 20 },
+ { ID_STATUS_ONTHEPHONE, 150 },
+ { ID_STATUS_OUTTOLUNCH, 425 } };
-int GetStatusModeOrdering(int statusMode) -{ - int i; - for (i = 0; i < _countof(statusModeOrder); i++) - if (statusModeOrder[i].status == statusMode) - return statusModeOrder[i].order; - return 1000; -} +int GetStatusModeOrdering(int statusMode)
+{
+ int i;
+ for (i = 0; i < _countof(statusModeOrder); i++)
+ if (statusModeOrder[i].status == statusMode)
+ return statusModeOrder[i].order;
+ return 1000;
+}
int CompareContacts(const ClcContact* c1, const ClcContact* c2)
{
MCONTACT a = c1->hContact, b = c2->hContact;
- TCHAR namea[128], *nameb;
+ wchar_t namea[128], *nameb;
int statusa, statusb;
int rc;
@@ -88,7 +88,7 @@ int CompareContacts(const ClcContact* c1, const ClcContact* c2) }
nameb = pcli->pfnGetContactDisplayName(a, 0);
- _tcsncpy_s(namea, nameb, _TRUNCATE);
+ wcsncpy_s(namea, nameb, _TRUNCATE);
namea[ _countof(namea)-1 ] = 0;
nameb = pcli->pfnGetContactDisplayName(b, 0);
diff --git a/src/core/stdcrypt/src/stdafx.h b/src/core/stdcrypt/src/stdafx.h index c6d1bd40d8..a0634867ca 100644 --- a/src/core/stdcrypt/src/stdafx.h +++ b/src/core/stdcrypt/src/stdafx.h @@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stdemail/src/stdafx.h b/src/core/stdemail/src/stdafx.h index a4873dbf7f..fbb040c50b 100644 --- a/src/core/stdemail/src/stdafx.h +++ b/src/core/stdemail/src/stdafx.h @@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index a9f28f51d9..1886a29f1a 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -27,16 +27,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. HANDLE hDlgSucceeded, hDlgCanceled;
-TCHAR* PFTS_StringToTchar(int flags, const TCHAR* s);
-int PFTS_CompareWithTchar(PROTOFILETRANSFERSTATUS* ft, const TCHAR* s, TCHAR *r);
+wchar_t* PFTS_StringToTchar(int flags, const wchar_t* s);
+int PFTS_CompareWithTchar(PROTOFILETRANSFERSTATUS* ft, const wchar_t* s, wchar_t *r);
static HGENMENU hSRFileMenuItem;
-TCHAR* GetContactID(MCONTACT hContact)
+wchar_t* GetContactID(MCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1)
- if (TCHAR *theValue = db_get_tsa(hContact, szProto, "ChatRoomID"))
+ if (wchar_t *theValue = db_get_tsa(hContact, szProto, "ChatRoomID"))
return theValue;
return Contact_GetInfo(CNF_UNIQUEID, hContact, szProto);
@@ -60,7 +60,7 @@ static INT_PTR SendSpecificFiles(WPARAM hContact, LPARAM lParam) while (ppFiles[count] != NULL)
count++;
- fsd.ppFiles = (const TCHAR**)alloca((count + 1) * sizeof(void*));
+ fsd.ppFiles = (const wchar_t**)alloca((count + 1) * sizeof(void*));
for (int i = 0; i < count; i++)
fsd.ppFiles[i] = mir_a2t(ppFiles[i]);
fsd.ppFiles[count] = NULL;
@@ -75,13 +75,13 @@ static INT_PTR SendSpecificFilesT(WPARAM hContact, LPARAM lParam) {
FileSendData fsd;
fsd.hContact = hContact;
- fsd.ppFiles = (const TCHAR**)lParam;
+ fsd.ppFiles = (const wchar_t**)lParam;
return (INT_PTR)CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FILESEND), NULL, DlgProcSendFile, (LPARAM)&fsd);
}
static INT_PTR GetReceivedFilesFolder(WPARAM wParam, LPARAM lParam)
{
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
GetContactReceivedFilesDir(wParam, buf, MAX_PATH, TRUE);
char* dir = mir_t2a(buf);
mir_strncpy((char*)lParam, dir, MAX_PATH);
@@ -107,7 +107,7 @@ void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam) else {
SkinPlaySound("RecvFile");
- TCHAR szTooltip[256];
+ wchar_t szTooltip[256];
mir_sntprintf(szTooltip, TranslateT("File from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = szTooltip;
@@ -133,7 +133,7 @@ static int FileEventAdded(WPARAM wParam, LPARAM lParam) return 0;
}
-int SRFile_GetRegValue(HKEY hKeyBase, const TCHAR *szSubKey, const TCHAR *szValue, TCHAR *szOutput, int cbOutput)
+int SRFile_GetRegValue(HKEY hKeyBase, const wchar_t *szSubKey, const wchar_t *szValue, wchar_t *szOutput, int cbOutput)
{
HKEY hKey;
DWORD cbOut = cbOutput;
@@ -150,7 +150,7 @@ int SRFile_GetRegValue(HKEY hKeyBase, const TCHAR *szSubKey, const TCHAR *szValu return 1;
}
-void GetSensiblyFormattedSize(__int64 size, TCHAR *szOut, int cchOut, int unitsOverride, int appendUnits, int *unitsUsed)
+void GetSensiblyFormattedSize(__int64 size, wchar_t *szOut, int cchOut, int unitsOverride, int appendUnits, int *unitsUsed)
{
if (!unitsOverride) {
if (size < 1000) unitsOverride = UNITS_BYTES;
@@ -173,13 +173,13 @@ void GetSensiblyFormattedSize(__int64 size, TCHAR *szOut, int cchOut, int unitsO }
// Tripple redirection sucks but is needed to nullify the array pointer
-void FreeFilesMatrix(TCHAR ***files)
+void FreeFilesMatrix(wchar_t ***files)
{
if (*files == NULL)
return;
// Free each filename in the pointer array
- TCHAR **pFile = *files;
+ wchar_t **pFile = *files;
while (*pFile != NULL) {
mir_free(*pFile);
*pFile = NULL;
@@ -206,7 +206,7 @@ void CopyProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFE *dest = *src;
if (src->tszCurrentFile) dest->tszCurrentFile = PFTS_StringToTchar(src->flags, src->tszCurrentFile);
if (src->ptszFiles) {
- dest->ptszFiles = (TCHAR**)mir_alloc(sizeof(TCHAR*)*src->totalFiles);
+ dest->ptszFiles = (wchar_t**)mir_alloc(sizeof(wchar_t*)*src->totalFiles);
for (int i = 0; i < src->totalFiles; i++)
dest->ptszFiles[i] = PFTS_StringToTchar(src->flags, src->ptszFiles[i]);
}
@@ -227,7 +227,7 @@ void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANS }
if (src->ptszFiles) {
if (!dest->ptszFiles)
- dest->ptszFiles = (TCHAR**)mir_calloc(sizeof(TCHAR*)*src->totalFiles);
+ dest->ptszFiles = (wchar_t**)mir_calloc(sizeof(wchar_t*)*src->totalFiles);
for (int i = 0; i < src->totalFiles; i++)
if (!dest->ptszFiles[i] || !src->ptszFiles[i] || PFTS_CompareWithTchar(src, src->ptszFiles[i], dest->ptszFiles[i])) {
mir_free(dest->ptszFiles[i]);
@@ -336,7 +336,7 @@ INT_PTR FtMgrShowCommand(WPARAM, LPARAM) INT_PTR openContRecDir(WPARAM hContact, LPARAM)
{
- TCHAR szContRecDir[MAX_PATH];
+ wchar_t szContRecDir[MAX_PATH];
GetContactReceivedFilesDir(hContact, szContRecDir, _countof(szContRecDir), TRUE);
ShellExecute(0, L"open", szContRecDir, 0, 0, SW_SHOW);
return 0;
@@ -344,7 +344,7 @@ INT_PTR openContRecDir(WPARAM hContact, LPARAM) INT_PTR openRecDir(WPARAM, LPARAM)
{
- TCHAR szContRecDir[MAX_PATH];
+ wchar_t szContRecDir[MAX_PATH];
GetReceivedFilesDir(szContRecDir, _countof(szContRecDir));
ShellExecute(0, L"open", szContRecDir, 0, 0, SW_SHOW);
return 0;
@@ -373,9 +373,9 @@ static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam) if (bUnicode) {
pszFiles = (char**)alloca(pre->fileCount * sizeof(char*));
for (int i = 0; i < pre->fileCount; i++)
- pszFiles[i] = Utf8EncodeT(pre->files.t[i]);
+ pszFiles[i] = Utf8EncodeT(pre->files.w[i]);
- szDescr = Utf8EncodeT(pre->descr.t);
+ szDescr = Utf8EncodeT(pre->descr.w);
}
else {
pszFiles = pre->files.a;
diff --git a/src/core/stdfile/src/file.h b/src/core/stdfile/src/file.h index d279789ddd..a41d169fae 100644 --- a/src/core/stdfile/src/file.h +++ b/src/core/stdfile/src/file.h @@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct FileSendData
{
MCONTACT hContact;
- const TCHAR **ppFiles;
+ const wchar_t **ppFiles;
};
#define BYTESRECVEDHISTORYCOUNT 10 //the number of bytes recved is sampled once a second and the last 10 are used to get the transfer speed
@@ -51,7 +51,7 @@ struct FileDlgData MCONTACT hContact;
MEVENT hDbEvent;
HANDLE hNotifyEvent;
- TCHAR **files;
+ wchar_t **files;
int send;
int closeIfFileChooseCancelled;
int resumeBehaviour;
@@ -63,8 +63,8 @@ struct FileDlgData HANDLE hPreshutdownEvent;
DWORD dwTicks;
- TCHAR szSavePath[MAX_PATH];
- TCHAR szMsg[450], szFilenames[1024];
+ wchar_t szSavePath[MAX_PATH];
+ wchar_t szMsg[450], szFilenames[1024];
HICON hIcon, hIconFolder;
};
@@ -75,21 +75,21 @@ struct FileDlgData #define UNITS_MBPOINT2 4 // 1024*1024 <= size: "%.2f MB"
#define UNITS_GBPOINT3 5 // 1024*1024*1024 <= size: "%.3f GB"
-void GetSensiblyFormattedSize(__int64 size, TCHAR *szOut, int cchOut, int unitsOverride, int appendUnits, int *unitsUsed);
-void FreeFilesMatrix(TCHAR ***files); //loving that triple indirection
+void GetSensiblyFormattedSize(__int64 size, wchar_t *szOut, int cchOut, int unitsOverride, int appendUnits, int *unitsUsed);
+void FreeFilesMatrix(wchar_t ***files); //loving that triple indirection
void FreeProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *fts);
void CopyProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFERSTATUS *src);
void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFERSTATUS *src);
-int SRFile_GetRegValue(HKEY hKeyBase, const TCHAR *szSubKey, const TCHAR *szValue, TCHAR *szOutput, int cbOutput);
+int SRFile_GetRegValue(HKEY hKeyBase, const wchar_t *szSubKey, const wchar_t *szValue, wchar_t *szOutput, int cbOutput);
//filesenddlg.c
INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
//filerecv.c
INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-void RemoveInvalidFilenameChars(TCHAR *tszString);
-void RemoveInvalidPathChars(TCHAR *tszString);
-void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOOL substVars);
-void GetReceivedFilesDir(TCHAR *szDir, int cchDir);
-int BrowseForFolder(HWND hwnd, TCHAR *szPath);
+void RemoveInvalidFilenameChars(wchar_t *tszString);
+void RemoveInvalidPathChars(wchar_t *tszString);
+void GetContactReceivedFilesDir(MCONTACT hContact, wchar_t *szDir, int cchDir, BOOL substVars);
+void GetReceivedFilesDir(wchar_t *szDir, int cchDir);
+int BrowseForFolder(HWND hwnd, wchar_t *szPath);
//fileexistsdlg.c
struct TDlgProcFileExistsParam
{
@@ -117,6 +117,6 @@ HWND FtMgr_AddTransfer(FileDlgData *dat); void FreeFileDlgData(FileDlgData* dat);
-TCHAR *GetContactID(MCONTACT hContact);
+wchar_t *GetContactID(MCONTACT hContact);
extern HANDLE hDlgSucceeded, hDlgCanceled;
diff --git a/src/core/stdfile/src/fileexistsdlg.cpp b/src/core/stdfile/src/fileexistsdlg.cpp index a5243ee528..d0650fec8d 100644 --- a/src/core/stdfile/src/fileexistsdlg.cpp +++ b/src/core/stdfile/src/fileexistsdlg.cpp @@ -47,7 +47,7 @@ static void SetControlToUnixTime(HWND hwndDlg, UINT idCtrl, time_t unixTime) #ifndef CMF_EXTENDEDVERBS
#define CMF_EXTENDEDVERBS 0x00000100
#endif
-static void DoAnnoyingShellCommand(HWND hwnd, const TCHAR *szFilename, int cmd, POINT *ptCursor)
+static void DoAnnoyingShellCommand(HWND hwnd, const wchar_t *szFilename, int cmd, POINT *ptCursor)
{
IShellFolder *pDesktopFolder;
if (SHGetDesktopFolder(&pDesktopFolder) == NOERROR) {
@@ -132,7 +132,7 @@ static LRESULT CALLBACK IconCtrlSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, struct loadiconsstartinfo {
HWND hwndDlg;
- TCHAR *szFilename;
+ wchar_t *szFilename;
};
void __cdecl LoadIconsAndTypesThread(void* param)
@@ -141,13 +141,13 @@ void __cdecl LoadIconsAndTypesThread(void* param) SHFILEINFO fileInfo;
if (SHGetFileInfo(info->szFilename, 0, &fileInfo, sizeof(fileInfo), SHGFI_TYPENAME | SHGFI_ICON | SHGFI_LARGEICON)) {
- TCHAR szExtension[64], szIconFile[MAX_PATH];
+ wchar_t szExtension[64], szIconFile[MAX_PATH];
- TCHAR *pszFilename = _tcsrchr(info->szFilename, '\\');
+ wchar_t *pszFilename = wcsrchr(info->szFilename, '\\');
if (pszFilename == NULL)
pszFilename = info->szFilename;
- TCHAR *pszExtension = _tcsrchr(pszFilename, '.');
+ wchar_t *pszExtension = wcsrchr(pszFilename, '.');
if (pszExtension)
mir_tstrncpy(szExtension, pszExtension + 1, _countof(szExtension));
else {
@@ -164,11 +164,11 @@ void __cdecl LoadIconsAndTypesThread(void* param) 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];
+ wchar_t szTypeName[MAX_PATH];
if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, pszExtension, NULL, szTypeName, _countof(szTypeName))) {
mir_tstrcat(szTypeName, L"\\DefaultIcon");
if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, szTypeName, NULL, szIconFile, _countof(szIconFile))) {
- if (_tcsstr(szIconFile, L"%1"))
+ if (wcsstr(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';
}
@@ -176,10 +176,10 @@ void __cdecl LoadIconsAndTypesThread(void* param) }
if (szIconFile[0]) {
- TCHAR *pszComma = _tcsrchr(szIconFile, ',');
+ wchar_t *pszComma = wcsrchr(szIconFile, ',');
int iconIndex;
if (pszComma) {
- iconIndex = _ttoi(pszComma + 1);
+ iconIndex = _wtoi(pszComma + 1);
*pszComma = '\0';
}
else
@@ -201,7 +201,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- TCHAR szSize[64];
+ wchar_t szSize[64];
struct _stati64 statbuf;
struct TDlgProcFileExistsParam *dat = (struct TDlgProcFileExistsParam *)lParam;
@@ -219,7 +219,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM mir_subclassWindow(GetDlgItem(hwndDlg, IDC_EXISTINGICON), IconCtrlSubclassProc);
HWND hwndFocus = GetDlgItem(hwndDlg, IDC_RESUME);
- if (_tstati64(fts->tszCurrentFile, &statbuf) == 0) {
+ if (_wstat64(fts->tszCurrentFile, &statbuf) == 0) {
SetControlToUnixTime(hwndDlg, IDC_EXISTINGDATE, statbuf.st_mtime);
GetSensiblyFormattedSize(statbuf.st_size, szSize, _countof(szSize), 0, 1, NULL);
SetDlgItemText(hwndDlg, IDC_EXISTINGSIZE, szSize);
@@ -249,9 +249,9 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_OPENFOLDER:
{
- TCHAR szFile[MAX_PATH];
+ wchar_t szFile[MAX_PATH];
mir_tstrncpy(szFile, fts->tszCurrentFile, _countof(szFile));
- TCHAR *pszLastBackslash = _tcsrchr(szFile, '\\');
+ wchar_t *pszLastBackslash = wcsrchr(szFile, '\\');
if (pszLastBackslash)
*pszLastBackslash = '\0';
ShellExecute(hwndDlg, NULL, szFile, NULL, NULL, SW_SHOW);
@@ -280,14 +280,14 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_SAVEAS:
{
OPENFILENAME ofn = { 0 };
- TCHAR filter[512], *pfilter;
- TCHAR str[MAX_PATH];
+ wchar_t filter[512], *pfilter;
+ wchar_t str[MAX_PATH];
mir_tstrncpy(str, fts->tszCurrentFile, _countof(str));
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
- _tcsncpy(filter, TranslateT("All files"),_countof(filter)-1);
+ wcsncpy(filter, TranslateT("All files"),_countof(filter)-1);
mir_tstrcat(filter, L" (*)");
pfilter = filter + mir_tstrlen(filter) + 1;
mir_tstrcpy(pfilter, L"*");
diff --git a/src/core/stdfile/src/fileopts.cpp b/src/core/stdfile/src/fileopts.cpp index c608f7311a..30979c1294 100644 --- a/src/core/stdfile/src/fileopts.cpp +++ b/src/core/stdfile/src/fileopts.cpp @@ -30,10 +30,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define VSCAN_CA 4
struct virusscannerinfo {
- const TCHAR *szProductName;
- const TCHAR *szExeRegPath;
- const TCHAR *szExeRegValue;
- const TCHAR *szCommandLine;
+ const wchar_t *szProductName;
+ const wchar_t *szExeRegPath;
+ const wchar_t *szExeRegValue;
+ const wchar_t *szCommandLine;
} virusScanners[] = {
{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"},
@@ -62,7 +62,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L {
SHAutoComplete(GetDlgItem(hwndDlg, IDC_FILEDIR), SHACF_FILESYS_DIRS);
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
GetContactReceivedFilesDir(NULL, str, _countof(str), FALSE);
SetDlgItemText(hwndDlg, IDC_FILEDIR, str);
@@ -78,7 +78,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L CheckDlgButton(hwndDlg, IDC_WARNBEFOREOPENING, db_get_b(NULL, "SRFile", "WarnBeforeOpening", 1) ? BST_CHECKED : BST_UNCHECKED);
for (int i = 0; i < _countof(virusScanners); i++) {
- TCHAR szScanExe[MAX_PATH];
+ wchar_t szScanExe[MAX_PATH];
if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE, virusScanners[i].szExeRegPath, virusScanners[i].szExeRegValue, szScanExe, _countof(szScanExe))) {
int iItem = SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_ADDSTRING, 0, (LPARAM)virusScanners[i].szProductName);
SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_SETITEMDATA, iItem, i);
@@ -121,8 +121,8 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L break;
case M_SCANCMDLINESELCHANGE:
{
- TCHAR str[512];
- TCHAR szScanExe[MAX_PATH];
+ wchar_t str[512];
+ wchar_t szScanExe[MAX_PATH];
int iScanner = SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETCURSEL, 0, 0), 0);
if (iScanner >= _countof(virusScanners) || iScanner < 0) break;
str[0] = '\0';
@@ -140,7 +140,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case IDC_FILEDIRBROWSE:
{
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILEDIR, str, _countof(str));
if (BrowseForFolder(hwndDlg, str))
SetDlgItemText(hwndDlg, IDC_FILEDIR, str);
@@ -162,7 +162,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L break;
case IDC_SCANCMDLINEBROWSE:
- TCHAR str[MAX_PATH + 2];
+ wchar_t str[MAX_PATH + 2];
GetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str, _countof(str));
CMString tszFilter;
@@ -177,19 +177,19 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L ofn.lpstrFile = str;
ofn.nMaxFile = _countof(str) - 2;
if (str[0] == '"') {
- TCHAR *pszQuote = _tcschr(str + 1, '"');
+ wchar_t *pszQuote = wcschr(str + 1, '"');
if (pszQuote)
*pszQuote = 0;
- memmove(str, str + 1, (mir_tstrlen(str) * sizeof(TCHAR)));
+ memmove(str, str + 1, (mir_tstrlen(str) * sizeof(wchar_t)));
}
else {
- TCHAR *pszSpace = _tcschr(str, ' ');
+ wchar_t *pszSpace = wcschr(str, ' ');
if (pszSpace) *pszSpace = 0;
}
ofn.nMaxFileTitle = MAX_PATH;
if (!GetOpenFileName(&ofn)) break;
- if (_tcschr(str, ' ') != NULL) {
- memmove(str + 1, str, ((_countof(str) - 2) * sizeof(TCHAR)));
+ if (wcschr(str, ' ') != NULL) {
+ memmove(str + 1, str, ((_countof(str) - 2) * sizeof(wchar_t)));
str[0] = '"';
mir_tstrcat(str, L"\"");
}
@@ -202,7 +202,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- TCHAR str[512];
+ wchar_t str[512];
GetDlgItemText(hwndDlg, IDC_FILEDIR, str, _countof(str));
RemoveInvalidPathChars(str);
db_set_ts(NULL, "SRFile", "RecvFilesDirAdv", str);
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index 3c75d282c0..6df563406d 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -33,14 +33,14 @@ static BOOL CALLBACK ClipSiblingsChildEnumProc(HWND hwnd, LPARAM) return TRUE;
}
-static void GetLowestExistingDirName(const TCHAR *szTestDir, TCHAR *szExistingDir, int cchExistingDir)
+static void GetLowestExistingDirName(const wchar_t *szTestDir, wchar_t *szExistingDir, int cchExistingDir)
{
DWORD dwAttributes;
- TCHAR *pszLastBackslash;
+ wchar_t *pszLastBackslash;
mir_tstrncpy(szExistingDir, szTestDir, cchExistingDir);
while ((dwAttributes = GetFileAttributes(szExistingDir)) != INVALID_FILE_ATTRIBUTES && !(dwAttributes&FILE_ATTRIBUTE_DIRECTORY)) {
- pszLastBackslash = _tcsrchr(szExistingDir, '\\');
+ pszLastBackslash = wcsrchr(szExistingDir, '\\');
if (pszLastBackslash == NULL) { *szExistingDir = '\0'; break; }
*pszLastBackslash = '\0';
}
@@ -48,27 +48,27 @@ static void GetLowestExistingDirName(const TCHAR *szTestDir, TCHAR *szExistingDi GetCurrentDirectory(cchExistingDir, szExistingDir);
}
-static const TCHAR InvalidFilenameChars[] = L"\\/:*?\"<>|";
-void RemoveInvalidFilenameChars(TCHAR *tszString)
+static const wchar_t InvalidFilenameChars[] = L"\\/:*?\"<>|";
+void RemoveInvalidFilenameChars(wchar_t *tszString)
{
size_t i;
if (tszString) {
- for (i = _tcscspn(tszString, InvalidFilenameChars); tszString[i]; i+=_tcscspn(tszString+i+1, InvalidFilenameChars)+1)
- tszString[i] = _T('_');
+ for (i = wcscspn(tszString, InvalidFilenameChars); tszString[i]; i+=wcscspn(tszString+i+1, InvalidFilenameChars)+1)
+ tszString[i] = '_';
}
}
-static const TCHAR InvalidPathChars[] = L"*?\"<>|"; // "\/:" are excluded as they are allowed in file path
-void RemoveInvalidPathChars(TCHAR *tszString)
+static const wchar_t InvalidPathChars[] = L"*?\"<>|"; // "\/:" are excluded as they are allowed in file path
+void RemoveInvalidPathChars(wchar_t *tszString)
{
if (tszString)
- for (size_t i = _tcscspn(tszString, InvalidPathChars); tszString[i]; i += _tcscspn(tszString + i + 1, InvalidPathChars) + 1)
- tszString[i] = _T('_');
+ for (size_t i = wcscspn(tszString, InvalidPathChars); tszString[i]; i += wcscspn(tszString + i + 1, InvalidPathChars) + 1)
+ tszString[i] = '_';
}
static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData)
{
- TCHAR szDir[MAX_PATH];
+ wchar_t szDir[MAX_PATH];
switch (uMsg) {
case BFFM_INITIALIZED:
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData);
@@ -81,7 +81,7 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM p return 0;
}
-int BrowseForFolder(HWND hwnd, TCHAR *szPath)
+int BrowseForFolder(HWND hwnd, wchar_t *szPath)
{
BROWSEINFO bi = { 0 };
bi.hwndOwner = hwnd;
@@ -108,11 +108,11 @@ static REPLACEVARSARRAY sttVarsToReplace[] = { NULL, NULL }
};
-static void patchDir(TCHAR *str, size_t strSize)
+static void patchDir(wchar_t *str, size_t strSize)
{
- TCHAR *result = Utils_ReplaceVarsT(str, 0, sttVarsToReplace);
+ wchar_t *result = Utils_ReplaceVarsT(str, 0, sttVarsToReplace);
if (result) {
- _tcsncpy(str, result, strSize);
+ wcsncpy(str, result, strSize);
mir_free(result);
}
@@ -121,13 +121,13 @@ static void patchDir(TCHAR *str, size_t strSize) mir_tstrcpy(str + len, L"\\");
}
-void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOOL patchVars)
+void GetContactReceivedFilesDir(MCONTACT hContact, wchar_t *szDir, int cchDir, BOOL patchVars)
{
- TCHAR tszTemp[MAX_PATH];
+ wchar_t tszTemp[MAX_PATH];
ptrT tszRecvPath(db_get_tsa(NULL, "SRFile", "RecvFilesDirAdv"));
if (tszRecvPath)
- _tcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE);
+ wcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE);
else
mir_sntprintf(tszTemp, L"%%mydocuments%%\\%s\\%%userid%%", TranslateT("My received files"));
@@ -135,23 +135,23 @@ void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOO hContact = db_mc_tryMeta(hContact);
REPLACEVARSARRAY rvaVarsToReplace[4];
- rvaVarsToReplace[0].key.t = L"nick";
- rvaVarsToReplace[0].value.t = mir_tstrdup((TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0));
- rvaVarsToReplace[1].key.t = L"userid";
- rvaVarsToReplace[1].value.t = GetContactID(hContact);
- rvaVarsToReplace[2].key.t = L"proto";
- rvaVarsToReplace[2].value.t = mir_a2t(GetContactProto(hContact));
- rvaVarsToReplace[3].key.t = NULL;
- rvaVarsToReplace[3].value.t = NULL;
+ rvaVarsToReplace[0].key.w = L"nick";
+ rvaVarsToReplace[0].value.w = mir_tstrdup((wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0));
+ rvaVarsToReplace[1].key.w = L"userid";
+ rvaVarsToReplace[1].value.w = GetContactID(hContact);
+ rvaVarsToReplace[2].key.w = L"proto";
+ rvaVarsToReplace[2].value.w = mir_a2t(GetContactProto(hContact));
+ rvaVarsToReplace[3].key.w = NULL;
+ rvaVarsToReplace[3].value.w = NULL;
for (int i = 0; i < (_countof(rvaVarsToReplace) - 1); i++)
- RemoveInvalidFilenameChars(rvaVarsToReplace[i].value.t);
+ RemoveInvalidFilenameChars(rvaVarsToReplace[i].value.w);
- TCHAR *result = Utils_ReplaceVarsT(tszTemp, hContact, rvaVarsToReplace);
+ wchar_t *result = Utils_ReplaceVarsT(tszTemp, hContact, rvaVarsToReplace);
if (result) {
- _tcsncpy(tszTemp, result, _countof(tszTemp));
+ wcsncpy(tszTemp, result, _countof(tszTemp));
mir_free(result);
for (int i = 0; i < (_countof(rvaVarsToReplace) - 1); i++)
- mir_free(rvaVarsToReplace[i].value.t);
+ mir_free(rvaVarsToReplace[i].value.w);
}
}
@@ -161,13 +161,13 @@ void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOO mir_tstrncpy(szDir, tszTemp, cchDir);
}
-void GetReceivedFilesDir(TCHAR *szDir, int cchDir)
+void GetReceivedFilesDir(wchar_t *szDir, int cchDir)
{
- TCHAR tszTemp[MAX_PATH];
+ wchar_t tszTemp[MAX_PATH];
ptrT tszRecvPath(db_get_tsa(NULL, "SRFile", "RecvFilesDirAdv"));
if (tszRecvPath)
- _tcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE);
+ wcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE);
else
mir_sntprintf(tszTemp, L"%%mydocuments%%\\%s\\%%userid%%", TranslateT("My received files"));
@@ -184,7 +184,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- TCHAR szPath[450];
+ wchar_t szPath[450];
CLISTEVENT* cle = (CLISTEVENT*)lParam;
dat = (FileDlgData*)mir_calloc(sizeof(FileDlgData));
@@ -203,7 +203,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l Button_SetIcon_IcoLib(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGEN("View user's history"));
Button_SetIcon_IcoLib(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGEN("User menu"));
- TCHAR *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
SetDlgItemText(hwndDlg, IDC_FROM, contactName);
GetContactReceivedFilesDir(dat->hContact, szPath, _countof(szPath), TRUE);
SetDlgItemText(hwndDlg, IDC_FILEDIR, szPath);
@@ -243,7 +243,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l }
else DestroyWindow(hwndDlg);
- TCHAR datetimestr[64];
+ wchar_t datetimestr[64];
TimeZone_PrintTimeStamp(NULL, dbei.timestamp, L"t d", datetimestr, _countof(datetimestr), 0);
SetDlgItemText(hwndDlg, IDC_DATE, datetimestr);
@@ -292,7 +292,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l switch (LOWORD(wParam)) {
case IDC_FILEDIRBROWSE:
{
- TCHAR szDirName[MAX_PATH], szExistingDirName[MAX_PATH];
+ wchar_t szDirName[MAX_PATH], szExistingDirName[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILEDIR, szDirName, _countof(szDirName));
GetLowestExistingDirName(szDirName, szExistingDirName, _countof(szExistingDirName));
@@ -303,11 +303,11 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDOK:
{ //most recently used directories
- TCHAR szRecvDir[MAX_PATH], szDefaultRecvDir[MAX_PATH];
+ wchar_t szRecvDir[MAX_PATH], szDefaultRecvDir[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILEDIR, szRecvDir, _countof(szRecvDir));
RemoveInvalidPathChars(szRecvDir);
GetContactReceivedFilesDir(NULL, szDefaultRecvDir, _countof(szDefaultRecvDir), TRUE);
- if (_tcsnicmp(szRecvDir, szDefaultRecvDir, mir_tstrlen(szDefaultRecvDir))) {
+ if (wcsnicmp(szRecvDir, szDefaultRecvDir, mir_tstrlen(szDefaultRecvDir))) {
char idstr[32];
int i;
DBVARIANT dbv;
diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp index 318dcab932..7d1c780807 100644 --- a/src/core/stdfile/src/filesenddlg.cpp +++ b/src/core/stdfile/src/filesenddlg.cpp @@ -32,10 +32,10 @@ static void SetFileListAndSizeControls(HWND hwndDlg, FileDlgData *dat) int fileCount = 0, dirCount = 0, i;
__int64 totalSize = 0;
struct _stati64 statbuf;
- TCHAR str[64];
+ wchar_t str[64];
for (i = 0; dat->files[i]; i++) {
- if (_tstati64(dat->files[i], &statbuf) == 0) {
+ if (_wstat64(dat->files[i], &statbuf) == 0) {
if (statbuf.st_mode & _S_IFDIR)
dirCount++;
else
@@ -47,7 +47,7 @@ static void SetFileListAndSizeControls(HWND hwndDlg, FileDlgData *dat) GetSensiblyFormattedSize(totalSize, str, _countof(str), 0, 1, NULL);
SetDlgItemText(hwndDlg, IDC_TOTALSIZE, str);
if (i > 1) {
- TCHAR szFormat[32];
+ wchar_t szFormat[32];
if (fileCount && dirCount) {
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);
@@ -67,7 +67,7 @@ static void SetFileListAndSizeControls(HWND hwndDlg, FileDlgData *dat) EnableWindow(GetDlgItem(hwndDlg, IDOK), fileCount || dirCount);
}
-static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf)
+static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const wchar_t *buf)
{
// Make sure that the file matrix is empty (the user may select files several times)
FreeFilesMatrix(&dat->files);
@@ -79,7 +79,7 @@ static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf) // Check if the selection is a directory or a file
if (GetFileAttributes(buf) & FILE_ATTRIBUTE_DIRECTORY) {
- const TCHAR *pBuf;
+ const wchar_t *pBuf;
int nNumberOfFiles = 0;
int nTemp;
@@ -97,7 +97,7 @@ static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf) }
// Allocate memory for a pointer array
- if ((dat->files = (TCHAR**)mir_alloc((nNumberOfFiles + 1) * sizeof(TCHAR*))) == NULL)
+ if ((dat->files = (wchar_t**)mir_alloc((nNumberOfFiles + 1) * sizeof(wchar_t*))) == NULL)
return;
// Fill the array
@@ -106,10 +106,10 @@ static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf) while (*pBuf) {
// Allocate space for path+filename
size_t cbFileNameLen = mir_tstrlen(pBuf);
- dat->files[nTemp] = (TCHAR*)mir_alloc(sizeof(TCHAR)*(fileOffset + cbFileNameLen + 1));
+ dat->files[nTemp] = (wchar_t*)mir_alloc(sizeof(wchar_t)*(fileOffset + cbFileNameLen + 1));
// Add path to filename and copy into array
- memcpy(dat->files[nTemp], buf, (fileOffset - 1)*sizeof(TCHAR));
+ memcpy(dat->files[nTemp], buf, (fileOffset - 1)*sizeof(wchar_t));
dat->files[nTemp][fileOffset - 1] = '\\';
mir_tstrcpy(dat->files[nTemp] + fileOffset - (buf[fileOffset - 2] == '\\' ? 1 : 0), pBuf);
@@ -122,7 +122,7 @@ static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf) }
// ...the selection is a single file
else {
- if ((dat->files = (TCHAR **)mir_alloc(2 * sizeof(TCHAR*))) == NULL) // Leaks when aborted
+ if ((dat->files = (wchar_t **)mir_alloc(2 * sizeof(wchar_t*))) == NULL) // Leaks when aborted
return;
dat->files[0] = mir_tstrdup(buf);
@@ -139,16 +139,16 @@ void __cdecl ChooseFilesThread(void* param) HWND hwndDlg = (HWND)param;
FileDlgData *dat = (FileDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- TCHAR *buf = (TCHAR*)mir_alloc(sizeof(TCHAR) * 32767);
+ wchar_t *buf = (wchar_t*)mir_alloc(sizeof(wchar_t) * 32767);
if (buf == NULL) {
PostMessage(hwndDlg, M_FILECHOOSEDONE, 0, NULL);
return;
}
- TCHAR filter[128];
+ wchar_t filter[128];
mir_tstrcpy(filter, TranslateT("All files"));
mir_tstrcat(filter, L" (*)");
- TCHAR *pfilter = filter + mir_tstrlen(filter) + 1;
+ wchar_t *pfilter = filter + mir_tstrlen(filter) + 1;
mir_tstrcpy(pfilter, L"*");
pfilter = filter + mir_tstrlen(filter) + 1;
pfilter[0] = '\0';
@@ -228,14 +228,14 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (fsd->ppFiles != NULL && fsd->ppFiles[0] != NULL) {
int totalCount, i;
for (totalCount = 0; fsd->ppFiles[totalCount]; totalCount++);
- dat->files = (TCHAR**)mir_alloc(sizeof(TCHAR*)*(totalCount + 1)); // Leaks
+ dat->files = (wchar_t**)mir_alloc(sizeof(wchar_t*)*(totalCount + 1)); // Leaks
for (i = 0; i < totalCount; i++)
dat->files[i] = mir_tstrdup(fsd->ppFiles[i]);
dat->files[totalCount] = NULL;
SetFileListAndSizeControls(hwndDlg, dat);
}
- TCHAR *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
SetDlgItemText(hwndDlg, IDC_TO, contactName);
ptrT id(Contact_GetInfo(CNF_UNIQUEID, dat->hContact));
@@ -270,8 +270,8 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case M_FILECHOOSEDONE:
if (lParam != 0) {
- FilenameToFileList(hwndDlg, dat, (TCHAR*)lParam);
- mir_free((TCHAR*)lParam);
+ FilenameToFileList(hwndDlg, dat, (wchar_t*)lParam);
+ mir_free((wchar_t*)lParam);
dat->closeIfFileChooseCancelled = 0;
}
else if (dat->closeIfFileChooseCancelled)
diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index 036e75068e..7be203e9bb 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -37,12 +37,12 @@ static int CheckVirusScanned(HWND hwnd, FileDlgData *dat, int i) #define M_VIRUSSCANDONE (WM_USER+100) struct virusscanthreadstartinfo { - TCHAR *szFile; + wchar_t *szFile; int returnCode; HWND hwndReply; }; -TCHAR* PFTS_StringToTchar(int flags, const TCHAR* s) +wchar_t* PFTS_StringToTchar(int flags, const wchar_t* s) { if (flags & PFTS_UTF) return Utf8DecodeW((char*)s); @@ -51,10 +51,10 @@ TCHAR* PFTS_StringToTchar(int flags, const TCHAR* s) return mir_a2t((char*)s); } -int PFTS_CompareWithTchar(PROTOFILETRANSFERSTATUS *ft, const TCHAR *s, TCHAR *r) +int PFTS_CompareWithTchar(PROTOFILETRANSFERSTATUS *ft, const wchar_t *s, wchar_t *r) { if (ft->flags & PFTS_UTF) { - TCHAR *ts = Utf8DecodeW((char*)s); + wchar_t *ts = Utf8DecodeW((char*)s); int res = mir_tstrcmp(ts, r); mir_free(ts); return res; @@ -62,7 +62,7 @@ int PFTS_CompareWithTchar(PROTOFILETRANSFERSTATUS *ft, const TCHAR *s, TCHAR *r) if (ft->flags & PFTS_UNICODE) return mir_tstrcmp(s, r); - TCHAR *ts = mir_a2t((char*)s); + wchar_t *ts = mir_a2t((char*)s); int res = mir_tstrcmp(ts, r); mir_free(ts); return res; @@ -99,15 +99,15 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info) if (dbv.ptszVal[0]) { STARTUPINFO si = { 0 }; si.cb = sizeof(si); - TCHAR *pszReplace = _tcsstr(dbv.ptszVal, L"%f"); - TCHAR szCmdLine[768]; + wchar_t *pszReplace = wcsstr(dbv.ptszVal, L"%f"); + wchar_t 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, L"%s\"%s\"%s", dbv.ptszVal, info->szFile, pszReplace + 2); } else - _tcsncpy_s(szCmdLine, dbv.ptszVal, _TRUNCATE); + wcsncpy_s(szCmdLine, dbv.ptszVal, _TRUNCATE); PROCESS_INFORMATION pi; if (CreateProcess(NULL, szCmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { @@ -125,13 +125,13 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info) static void SetFilenameControls(HWND hwndDlg, FileDlgData *dat, PROTOFILETRANSFERSTATUS *fts) { - TCHAR msg[MAX_PATH]; - TCHAR *fnbuf = NULL, *fn = NULL; + wchar_t msg[MAX_PATH]; + wchar_t *fnbuf = NULL, *fn = NULL; SHFILEINFO shfi = { 0 }; if (fts->tszCurrentFile) { fnbuf = mir_tstrdup(fts->tszCurrentFile); - if ((fn = _tcsrchr(fnbuf, '\\')) == NULL) + if ((fn = wcsrchr(fnbuf, '\\')) == NULL) fn = fnbuf; else fn++; } @@ -166,7 +166,7 @@ static void SetFilenameControls(HWND hwndDlg, FileDlgData *dat, PROTOFILETRANSFE } enum { FTS_TEXT, FTS_PROGRESS, FTS_OPEN }; -static void SetFtStatus(HWND hwndDlg, TCHAR *text, int mode) +static void SetFtStatus(HWND hwndDlg, wchar_t *text, int mode) { SetDlgItemText(hwndDlg, IDC_STATUS, TranslateTS(text)); SetDlgItemText(hwndDlg, IDC_TRANSFERCOMPLETED, TranslateTS(text)); @@ -237,7 +237,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (db_mc_isMeta(dat->hContact)) dat->hContact = db_mc_getMostOnline(dat->hContact); dat->fs = (HANDLE)ProtoChainSend(dat->hContact, PSS_FILE, (WPARAM)dat->szMsg, (LPARAM)dat->files); - SetFtStatus(hwndDlg, LPGENT("Request sent, waiting for acceptance..."), FTS_TEXT); + SetFtStatus(hwndDlg, LPGENW("Request sent, waiting for acceptance..."), FTS_TEXT); SetOpenFileButtonStyle(GetDlgItem(hwndDlg, IDC_OPENFILE), 1); dat->waitingForAcceptance = 1; // hide "open" button since it may cause potential access violations... @@ -250,12 +250,12 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR dat->transferStatus.tszWorkingDir = mir_tstrdup(dat->szSavePath); if (db_get_b(dat->hContact, "CList", "NotOnList", 0)) dat->resumeBehaviour = FILERESUME_ASK; else dat->resumeBehaviour = db_get_b(NULL, "SRFile", "IfExists", FILERESUME_ASK); - SetFtStatus(hwndDlg, LPGENT("Waiting for connection..."), FTS_TEXT); + SetFtStatus(hwndDlg, LPGENW("Waiting for connection..."), FTS_TEXT); } /* check we actually got an fs handle back from the protocol */ if (!dat->fs) { - SetFtStatus(hwndDlg, LPGENT("Unable to initiate transfer."), FTS_TEXT); + SetFtStatus(hwndDlg, LPGENW("Unable to initiate transfer."), FTS_TEXT); dat->waitingForAcceptance = 0; } { @@ -301,7 +301,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR dat->bytesRecvedHistorySize++; { - TCHAR szSpeed[32], szTime[32], szDisplay[96]; + wchar_t szSpeed[32], szTime[32], szDisplay[96]; SYSTEMTIME st; ULARGE_INTEGER li; FILETIME ft; @@ -372,10 +372,10 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case IDC_OPENFOLDER: { - TCHAR *path = dat->transferStatus.tszWorkingDir; + wchar_t *path = dat->transferStatus.tszWorkingDir; if (!path || !path[0]) { - path = NEWTSTR_ALLOCA(dat->transferStatus.tszCurrentFile); - TCHAR *p = _tcsrchr(path, '\\'); if (p) *p = 0; + path = NEWWSTR_ALLOCA(dat->transferStatus.tszCurrentFile); + wchar_t *p = wcsrchr(path, '\\'); if (p) *p = 0; } if (path) ShellExecute(NULL, L"open", path, NULL, NULL, SW_SHOW); @@ -383,7 +383,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR break; case IDC_OPENFILE: - TCHAR **files; + wchar_t **files; if (dat->send) { if (dat->files == NULL) files = dat->transferStatus.ptszFiles; @@ -398,7 +398,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (files && *files) { int limit; - TCHAR *pszFilename, *pszNewFileName; + wchar_t *pszFilename, *pszNewFileName; if (dat->send) limit = dat->transferStatus.totalFiles; @@ -407,7 +407,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR // Loop over all transfered files and add them to the menu for (int i = 0; i < limit; i++) { - pszFilename = _tcsrchr(files[i], '\\'); + pszFilename = wcsrchr(files[i], '\\'); if (pszFilename == NULL) pszFilename = files[i]; else @@ -416,8 +416,8 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (pszFilename) { size_t cbFileNameLen = mir_tstrlen(pszFilename); - pszNewFileName = (TCHAR*)mir_alloc(cbFileNameLen * 2 * sizeof(TCHAR)); - TCHAR *p = pszNewFileName; + pszNewFileName = (wchar_t*)mir_alloc(cbFileNameLen * 2 * sizeof(wchar_t)); + wchar_t *p = pszNewFileName; for (size_t pszlen = 0; pszlen < cbFileNameLen; pszlen++) { *p++ = pszFilename[pszlen]; if (pszFilename[pszlen] == '&') @@ -438,10 +438,10 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR DestroyMenu(hMenu); if (ret == 1) { - TCHAR *path = dat->transferStatus.tszWorkingDir; + wchar_t *path = dat->transferStatus.tszWorkingDir; if (!path || !path[0]) { - path = NEWTSTR_ALLOCA(dat->transferStatus.tszCurrentFile); - TCHAR *p = _tcsrchr(path, '\\'); + path = NEWWSTR_ALLOCA(dat->transferStatus.tszCurrentFile); + wchar_t *p = wcsrchr(path, '\\'); if (p) *p = 0; } @@ -457,7 +457,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR EnableWindow(hwndDlg, TRUE); { PROTOFILERESUME *pfr = (PROTOFILERESUME*)lParam; - TCHAR *szOriginalFilename = (TCHAR*)wParam; + wchar_t *szOriginalFilename = (wchar_t*)wParam; char *szProto = GetContactProto(dat->hContact); switch (pfr->action) { @@ -476,15 +476,15 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case FILERESUME_RENAMEALL: pfr->action = FILERESUME_RENAME; { - TCHAR *pszExtension, *pszFilename; - if ((pszFilename = _tcsrchr(szOriginalFilename, '\\')) == NULL) pszFilename = szOriginalFilename; - if ((pszExtension = _tcsrchr(pszFilename + 1, '.')) == NULL) pszExtension = pszFilename + mir_tstrlen(pszFilename); - if (pfr->szFilename) mir_free((TCHAR*)pfr->szFilename); + wchar_t *pszExtension, *pszFilename; + if ((pszFilename = wcsrchr(szOriginalFilename, '\\')) == NULL) pszFilename = szOriginalFilename; + if ((pszExtension = wcsrchr(pszFilename + 1, '.')) == NULL) pszExtension = pszFilename + mir_tstrlen(pszFilename); + if (pfr->szFilename) mir_free((wchar_t*)pfr->szFilename); size_t size = (pszExtension - szOriginalFilename) + 21 + mir_tstrlen(pszExtension); - pfr->szFilename = (TCHAR*)mir_alloc(sizeof(TCHAR)*size); + pfr->szFilename = (wchar_t*)mir_alloc(sizeof(wchar_t)*size); for (int i = 1;; i++) { - mir_sntprintf((TCHAR*)pfr->szFilename, size, L"%.*s (%u)%s", pszExtension - szOriginalFilename, szOriginalFilename, i, pszExtension); - if (_taccess(pfr->szFilename, 0) != 0) + mir_sntprintf((wchar_t*)pfr->szFilename, size, L"%.*s (%u)%s", pszExtension - szOriginalFilename, szOriginalFilename, i, pszExtension); + if (_waccess(pfr->szFilename, 0) != 0) break; } } @@ -510,14 +510,14 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR } switch (ack->result) { - case ACKRESULT_SENTREQUEST: SetFtStatus(hwndDlg, LPGENT("Decision sent"), FTS_TEXT); break; - case ACKRESULT_CONNECTING: SetFtStatus(hwndDlg, LPGENT("Connecting..."), FTS_TEXT); break; - case ACKRESULT_CONNECTPROXY: SetFtStatus(hwndDlg, LPGENT("Connecting to proxy..."), FTS_TEXT); break; - case ACKRESULT_CONNECTED: SetFtStatus(hwndDlg, LPGENT("Connected"), FTS_TEXT); break; - case ACKRESULT_LISTENING: SetFtStatus(hwndDlg, LPGENT("Waiting for connection..."), FTS_TEXT); break; - case ACKRESULT_INITIALISING: SetFtStatus(hwndDlg, LPGENT("Initializing..."), FTS_TEXT); break; + case ACKRESULT_SENTREQUEST: SetFtStatus(hwndDlg, LPGENW("Decision sent"), FTS_TEXT); break; + case ACKRESULT_CONNECTING: SetFtStatus(hwndDlg, LPGENW("Connecting..."), FTS_TEXT); break; + case ACKRESULT_CONNECTPROXY: SetFtStatus(hwndDlg, LPGENW("Connecting to proxy..."), FTS_TEXT); break; + case ACKRESULT_CONNECTED: SetFtStatus(hwndDlg, LPGENW("Connected"), FTS_TEXT); break; + case ACKRESULT_LISTENING: SetFtStatus(hwndDlg, LPGENW("Waiting for connection..."), FTS_TEXT); break; + case ACKRESULT_INITIALISING: SetFtStatus(hwndDlg, LPGENW("Initializing..."), FTS_TEXT); break; case ACKRESULT_NEXTFILE: - SetFtStatus(hwndDlg, LPGENT("Moving to next file..."), FTS_TEXT); + SetFtStatus(hwndDlg, LPGENW("Moving to next file..."), FTS_TEXT); SetDlgItemTextA(hwndDlg, IDC_FILENAME, ""); if (dat->transferStatus.currentFileNumber == 1 && dat->transferStatus.totalFiles > 1 && !dat->send) SetOpenFileButtonStyle(GetDlgItem(hwndDlg, IDC_OPENFILE), 1); @@ -540,10 +540,10 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR { PROTOFILETRANSFERSTATUS *fts = &dat->transferStatus; SetFilenameControls(hwndDlg, dat, fts); - if (_taccess(fts->tszCurrentFile, 0)) + if (_waccess(fts->tszCurrentFile, 0)) break; - SetFtStatus(hwndDlg, LPGENT("File already exists"), FTS_TEXT); + SetFtStatus(hwndDlg, LPGENW("File already exists"), FTS_TEXT); if (dat->resumeBehaviour == FILERESUME_ASK) { TDlgProcFileExistsParam param = { hwndDlg, fts }; ShowWindow(hwndDlg, SW_SHOWNORMAL); @@ -563,7 +563,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case ACKRESULT_DATA: { PROTOFILETRANSFERSTATUS *fts = (PROTOFILETRANSFERSTATUS*)ack->lParam; - TCHAR str[64], str2[64], szSizeDone[32], szSizeTotal[32];//, *contactName; + wchar_t str[64], str2[64], szSizeDone[32], szSizeTotal[32];//, *contactName; if (dat->fileVirusScanned == NULL) dat->fileVirusScanned = (int*)mir_calloc(sizeof(int) * fts->totalFiles); @@ -571,7 +571,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR // This needs to be here - otherwise we get holes in the files array if (!dat->send) { if (dat->files == NULL) - dat->files = (TCHAR**)mir_calloc((fts->totalFiles + 1) * sizeof(TCHAR*)); + dat->files = (wchar_t**)mir_calloc((fts->totalFiles + 1) * sizeof(wchar_t*)); if (fts->currentFileNumber < fts->totalFiles && dat->files[fts->currentFileNumber] == NULL) dat->files[fts->currentFileNumber] = PFTS_StringToTchar(fts->flags, fts->tszCurrentFile); } @@ -587,7 +587,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR bool firstTime = false; if ((GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_ALLFILESPROGRESS), GWL_STYLE) & WS_VISIBLE) == 0) { - SetFtStatus(hwndDlg, (fts->flags & PFTS_SENDING) ? LPGENT("Sending...") : LPGENT("Receiving..."), FTS_PROGRESS); + SetFtStatus(hwndDlg, (fts->flags & PFTS_SENDING) ? LPGENW("Sending...") : LPGENW("Receiving..."), FTS_PROGRESS); SetFilenameControls(hwndDlg, dat, fts); firstTime = true; } @@ -626,18 +626,18 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (ack->result == ACKRESULT_DENIED) { dat->fs = NULL; /* protocol will free structure */ SkinPlaySound("FileDenied"); - SetFtStatus(hwndDlg, LPGENT("File transfer denied"), FTS_TEXT); + SetFtStatus(hwndDlg, LPGENW("File transfer denied"), FTS_TEXT); } else if (ack->result == ACKRESULT_FAILED) { dat->fs = NULL; /* protocol will free structure */ SkinPlaySound("FileFailed"); - SetFtStatus(hwndDlg, LPGENT("File transfer failed"), FTS_TEXT); + SetFtStatus(hwndDlg, LPGENW("File transfer failed"), FTS_TEXT); } else { SkinPlaySound("FileDone"); if (dat->send) { dat->fs = NULL; /* protocol will free structure */ - SetFtStatus(hwndDlg, LPGENT("Transfer completed."), FTS_TEXT); + SetFtStatus(hwndDlg, LPGENW("Transfer completed."), FTS_TEXT); DBEVENTINFO dbei = { 0 }; FillSendData(dat, dbei); @@ -649,8 +649,8 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR else { SetFtStatus(hwndDlg, (dat->transferStatus.totalFiles == 1) ? - LPGENT("Transfer completed, open file.") : - LPGENT("Transfer completed, open folder."), + LPGENW("Transfer completed, open file.") : + LPGENW("Transfer completed, open folder."), FTS_OPEN); int useScanner = db_get_b(NULL, "SRFile", "UseScanner", VIRUSSCAN_DISABLE); @@ -671,7 +671,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR vstsi->szFile = mir_tstrdup(dat->transferStatus.tszWorkingDir); vstsi->returnCode = -1; } - SetFtStatus(hwndDlg, LPGENT("Scanning for viruses..."), FTS_TEXT); + SetFtStatus(hwndDlg, LPGENW("Scanning for viruses..."), FTS_TEXT); if (vstsi) mir_forkthread((void(*)(void*))RunVirusScannerThread, vstsi); } @@ -705,7 +705,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR } if (done) { dat->fs = NULL; /* protocol will free structure */ - SetFtStatus(hwndDlg, LPGENT("Transfer and virus scan complete"), FTS_TEXT); + SetFtStatus(hwndDlg, LPGENW("Transfer and virus scan complete"), FTS_TEXT); } } break; diff --git a/src/core/stdfile/src/stdafx.h b/src/core/stdfile/src/stdafx.h index 4be0919b51..0bb8cc54f6 100644 --- a/src/core/stdfile/src/stdafx.h +++ b/src/core/stdfile/src/stdafx.h @@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stdhelp/src/about.cpp b/src/core/stdhelp/src/about.cpp index 7ef45cf054..5fca697ade 100644 --- a/src/core/stdhelp/src/about.cpp +++ b/src/core/stdhelp/src/about.cpp @@ -32,7 +32,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- { TCHAR filename[MAX_PATH], *productCopyright;
+ { wchar_t filename[MAX_PATH], *productCopyright;
DWORD unused;
DWORD verInfoSize;
UINT blockSize;
@@ -50,7 +50,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar char productVersion[56];
CallService(MS_SYSTEM_GETVERSIONTEXT, _countof(productVersion), (LPARAM)productVersion);
- TCHAR str[64];
+ wchar_t str[64];
mir_sntprintf(str, STR_VERSION_FORMAT, productVersion);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, str);
}
@@ -65,7 +65,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar char* pszMsgt = (char*)alloca(ResSize + 1);
memcpy(pszMsgt, pszMsg, ResSize); pszMsgt[ResSize] = 0;
- TCHAR *ptszMsg;
+ wchar_t *ptszMsg;
if (ResSize >=3 && pszMsgt[0] == '\xef' && pszMsgt[1] == '\xbb' && pszMsgt[2] == '\xbf')
ptszMsg = Utf8DecodeT(pszMsgt + 3);
else
diff --git a/src/core/stdhelp/src/help.cpp b/src/core/stdhelp/src/help.cpp index 25b53757ea..a72cce44af 100644 --- a/src/core/stdhelp/src/help.cpp +++ b/src/core/stdhelp/src/help.cpp @@ -74,7 +74,7 @@ int LoadHelpModule(void) CreateServiceFunction("Help/BugCommand", BugCommand);
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("&Help"), 2000090000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("&Help"), 2000090000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "8824ECA5-6942-46D7-9D07-1BA600E0D02E");
SET_UID(mi, 0xf3ebf1fa, 0x587c, 0x494d, 0xbd, 0x33, 0x7f, 0x88, 0xb3, 0x61, 0x1e, 0xd3);
diff --git a/src/core/stdhelp/src/stdafx.h b/src/core/stdhelp/src/stdafx.h index 04c94e8013..4d3797d0df 100644 --- a/src/core/stdhelp/src/stdafx.h +++ b/src/core/stdhelp/src/stdafx.h @@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stdidle/src/stdafx.h b/src/core/stdidle/src/stdafx.h index e85df5960c..69d89218cc 100644 --- a/src/core/stdidle/src/stdafx.h +++ b/src/core/stdidle/src/stdafx.h @@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
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<TCHAR> cmdList;
+ LIST<wchar_t> 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);
diff --git a/src/core/stdssl/src/netlibssl.cpp b/src/core/stdssl/src/netlibssl.cpp index d59c92c0ec..af0c2632e1 100644 --- a/src/core/stdssl/src/netlibssl.cpp +++ b/src/core/stdssl/src/netlibssl.cpp @@ -60,26 +60,26 @@ struct SslHandle static void ReportSslError(SECURITY_STATUS scRet, int line, bool = false)
{
- TCHAR szMsgBuf[256];
+ wchar_t szMsgBuf[256];
switch (scRet) {
case 0:
case ERROR_NOT_READY:
return;
case SEC_E_INVALID_TOKEN:
- _tcsncpy_s(szMsgBuf, TranslateT("Client cannot decode host message. Possible causes: host does not support SSL or requires not existing security package"), _TRUNCATE);
+ wcsncpy_s(szMsgBuf, TranslateT("Client cannot decode host message. Possible causes: host does not support SSL or requires not existing security package"), _TRUNCATE);
break;
case CERT_E_CN_NO_MATCH:
case SEC_E_WRONG_PRINCIPAL:
- _tcsncpy_s(szMsgBuf, TranslateT("Host we are connecting to is not the one certificate was issued for"), _TRUNCATE);
+ wcsncpy_s(szMsgBuf, TranslateT("Host we are connecting to is not the one certificate was issued for"), _TRUNCATE);
break;
default:
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, scRet, LANG_USER_DEFAULT, szMsgBuf, _countof(szMsgBuf), NULL);
}
- TCHAR szMsgBuf2[512];
+ wchar_t szMsgBuf2[512];
mir_sntprintf(szMsgBuf2, L"SSL connection failure (%x %u): %s", scRet, line, szMsgBuf);
char* szMsg = Utf8EncodeT(szMsgBuf2);
diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp index 6b4815309f..88acd91328 100644 --- a/src/core/stduihist/src/history.cpp +++ b/src/core/stduihist/src/history.cpp @@ -37,15 +37,15 @@ static HGENMENU hContactMenu = 0; /////////////////////////////////////////////////////////////////////////////////////////
// Fills the events list
-static void GetMessageDescription(DBEVENTINFO *dbei, TCHAR* buf, int cbBuf)
+static void GetMessageDescription(DBEVENTINFO *dbei, wchar_t* buf, int cbBuf)
{
- TCHAR *msg = DbGetEventTextT(dbei, CP_ACP);
- _tcsncpy(buf, msg ? msg : TranslateT("Invalid message"), cbBuf);
+ wchar_t *msg = DbGetEventTextT(dbei, CP_ACP);
+ wcsncpy(buf, msg ? msg : TranslateT("Invalid message"), cbBuf);
buf[ cbBuf-1 ] = 0;
mir_free(msg);
}
-static void GetUrlDescription(DBEVENTINFO *dbei, TCHAR* buf, int cbBuf)
+static void GetUrlDescription(DBEVENTINFO *dbei, wchar_t* buf, int cbBuf)
{
int len = dbei->cbBlob;
if (len >= cbBuf)
@@ -58,7 +58,7 @@ static void GetUrlDescription(DBEVENTINFO *dbei, TCHAR* buf, int cbBuf) mir_tstrcat(buf, L"\r\n");
}
-static void GetFileDescription(DBEVENTINFO *dbei, TCHAR* buf, int cbBuf)
+static void GetFileDescription(DBEVENTINFO *dbei, wchar_t* buf, int cbBuf)
{
int len = dbei->cbBlob - sizeof(DWORD);
if (len >= cbBuf)
@@ -71,7 +71,7 @@ static void GetFileDescription(DBEVENTINFO *dbei, TCHAR* buf, int cbBuf) mir_tstrcat(buf, L"\r\n");
}
-static void GetObjectDescription(DBEVENTINFO *dbei, TCHAR* str, int cbStr)
+static void GetObjectDescription(DBEVENTINFO *dbei, wchar_t* str, int cbStr)
{
switch(dbei->eventType) {
case EVENTTYPE_MESSAGE:
@@ -94,9 +94,9 @@ static void GetObjectDescription(DBEVENTINFO *dbei, TCHAR* str, int cbStr) *str = 0;
} }
-static void GetObjectSummary(DBEVENTINFO *dbei, TCHAR* str, int cbStr)
+static void GetObjectSummary(DBEVENTINFO *dbei, wchar_t* str, int cbStr)
{
- TCHAR* pszSrc, *pszTmp = NULL;
+ wchar_t* pszSrc, *pszTmp = NULL;
switch(dbei->eventType) {
case EVENTTYPE_MESSAGE:
@@ -125,7 +125,7 @@ static void GetObjectSummary(DBEVENTINFO *dbei, TCHAR* str, int cbStr) return;
}
- _tcsncpy(str, (const TCHAR*)pszSrc, cbStr);
+ wcsncpy(str, (const wchar_t*)pszSrc, cbStr);
str[cbStr-1] = 0;
mir_free(pszTmp);
}
@@ -161,7 +161,7 @@ static void FillHistoryThread(void* param) dbei.cbBlob = oldBlobSize;
db_event_get(hDbEvent, &dbei);
- TCHAR str[200], eventText[256], strdatetime[64];
+ wchar_t str[200], eventText[256], strdatetime[64];
GetObjectSummary(&dbei, str, _countof(str));
if (str[0]) {
TimeZone_PrintTimeStamp(NULL, dbei.timestamp, L"d t", strdatetime, _countof(strdatetime), 0);
@@ -206,7 +206,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP WindowList_Add(hWindowList, hwndDlg, hContact);
Utils_RestoreWindowPosition(hwndDlg, hContact, "History", "");
{
- TCHAR* contactName, str[200];
+ wchar_t* contactName, str[200];
contactName = pcli->pfnGetContactDisplayName(hContact, 0);
mir_sntprintf(str, TranslateT("History for %s"), contactName);
SetWindowText(hwndDlg, str);
@@ -278,7 +278,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP if ((int)dbei.cbBlob != -1) {
dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
if (db_event_get(hDbEvent, &dbei) == 0) {
- TCHAR str[8192];
+ wchar_t str[8192];
GetObjectDescription(&dbei, str, _countof(str));
if (str[0])
SetDlgItemText(hwndDlg, IDC_EDIT, str);
@@ -316,11 +316,11 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP dbei.cbBlob = oldBlobSize;
db_event_get(hDbEvent, &dbei);
- TCHAR str[1024];
+ wchar_t str[1024];
GetObjectDescription(&dbei, str, _countof(str));
if (str[0]) {
CharUpperBuff(str, (int)mir_tstrlen(str));
- if (_tcsstr(str, (const TCHAR*)lParam) != NULL) {
+ if (wcsstr(str, (const wchar_t*)lParam) != NULL) {
SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETCURSEL, index, 0);
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_LIST, LBN_SELCHANGE), 0);
break;
@@ -349,7 +349,7 @@ static INT_PTR CALLBACK DlgProcHistoryFind(HWND hwndDlg, UINT msg, WPARAM wParam return TRUE;
case IDOK://find Next
- TCHAR str[128];
+ wchar_t str[128];
HWND hwndParent = (HWND)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
GetDlgItemText(hwndDlg, IDC_FINDWHAT, str, _countof(str));
CharUpperBuff(str, (int)mir_tstrlen(str));
diff --git a/src/core/stduihist/src/stdafx.h b/src/core/stduihist/src/stdafx.h index 59f8cd87a8..084712b5f3 100644 --- a/src/core/stduihist/src/stdafx.h +++ b/src/core/stduihist/src/stdafx.h @@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp index 1fc523b3ea..a125be13ef 100644 --- a/src/core/stduserinfo/src/contactinfo.cpp +++ b/src/core/stduserinfo/src/contactinfo.cpp @@ -171,7 +171,7 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar return FALSE;
}
-static int IsOverEmail(HWND hwndDlg, TCHAR* szEmail, int cchEmail)
+static int IsOverEmail(HWND hwndDlg, wchar_t* szEmail, int cchEmail)
{
HWND hwndEmails = GetDlgItem(hwndDlg, IDC_EMAILS);
@@ -190,7 +190,7 @@ static int IsOverEmail(HWND hwndDlg, TCHAR* szEmail, int cchEmail) ListView_GetSubItemRect(hwndEmails, hti.iItem, 1, LVIR_LABEL, &rc);
- TCHAR szText[256]; szText[0] = 0;
+ wchar_t szText[256]; szText[0] = 0;
ListView_GetItemText(hwndEmails, hti.iItem, 1, szText, _countof(szText));
HDC hdc = GetDC(hwndEmails);
@@ -264,7 +264,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_EMAILS));
char idstr[33];
- TCHAR idstr2[33];
+ wchar_t idstr2[33];
DBVARIANT dbv;
LVITEM lvi;
@@ -400,7 +400,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ListView_GetSubItemRect(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, LVIR_LABEL, &rc);
if (nm->iSubItem == 1 && nm->nmcd.hdr.idFrom == IDC_EMAILS) {
HFONT hoFont;
- TCHAR szText[256] = { 0 };
+ wchar_t szText[256] = { 0 };
ListView_GetItemText(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, szText, _countof(szText));
hoFont = (HFONT)SelectObject(nm->nmcd.hdc, hEmailFont);
SetTextColor(nm->nmcd.hdc, RGB(0, 0, 255));
@@ -416,7 +416,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP else if (nm->iSubItem > 1 && nm->nmcd.lItemlParam != -1 && nm->nmcd.lItemlParam != -2) {
static int iconResources[3] = { SKINICON_OTHER_RENAME, SKINICON_OTHER_DELETE };
if (nm->iSubItem == 2 && nm->nmcd.hdr.idFrom == IDC_PHONES) {
- TCHAR szText[2];
+ wchar_t szText[2];
ListView_GetItemText(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, szText, _countof(szText));
if (szText[0]) hIcon = Skin_LoadIcon(SKINICON_OTHER_SMS);
}
@@ -436,9 +436,9 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
char *szIdTemplate = (nm->hdr.idFrom == IDC_PHONES) ? "MyPhone%d" : "Mye-mail%d";
- TCHAR szEmail[256];
+ wchar_t szEmail[256];
if (IsOverEmail(hwndDlg, szEmail, _countof(szEmail))) {
- TCHAR szExec[264];
+ wchar_t szExec[264];
mir_sntprintf(szExec, L"mailto:%s", szEmail);
ShellExecute(hwndDlg, L"open", szExec, NULL, NULL, SW_SHOW);
break;
diff --git a/src/core/stduserinfo/src/stdafx.h b/src/core/stduserinfo/src/stdafx.h index 9136d69408..4a07eca120 100644 --- a/src/core/stduserinfo/src/stdafx.h +++ b/src/core/stduserinfo/src/stdafx.h @@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <uxtheme.h>
diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp index 4b93ab8cd1..100ea132d8 100644 --- a/src/core/stduserinfo/src/stdinfo.cpp +++ b/src/core/stduserinfo/src/stdinfo.cpp @@ -44,7 +44,7 @@ static int Proto_GetContactInfoSetting(MCONTACT hContact, const char *szProto, c return CallProtoService(szProto, PS_GETINFOSETTING, hContact, (LPARAM)&cgs);
}
-static TCHAR* Proto_GetContactInfoSettingStr(bool proto_service, MCONTACT hContact, const char *szModule, const char *szSetting)
+static wchar_t* Proto_GetContactInfoSettingStr(bool proto_service, MCONTACT hContact, const char *szModule, const char *szSetting)
{
if (!proto_service)
return db_get_tsa(hContact, szModule, szSetting);
@@ -61,7 +61,7 @@ static TCHAR* Proto_GetContactInfoSettingStr(bool proto_service, MCONTACT hConta static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule, char *szSetting, int special)
{
char str[80], *pstr = NULL;
- TCHAR *ptstr = NULL;
+ wchar_t *ptstr = NULL;
char *szProto = GetContactProto(hContact);
bool proto_service = szProto && (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_INFOSETTINGSVC);
@@ -253,7 +253,7 @@ static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
case IDC_EMAIL:
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EMAIL))) {
- TCHAR szExec[264], szEmail[256];
+ wchar_t szExec[264], szEmail[256];
GetDlgItemText(hwndDlg, IDC_EMAIL, szEmail, _countof(szEmail));
mir_sntprintf(szExec, L"mailto:%s", szEmail);
ShellExecute(hwndDlg, L"open", szExec, NULL, NULL, SW_SHOW);
@@ -282,7 +282,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];
+ wchar_t szTime[80];
if (printDateTimeByContact(hContact, L"s", szTime, _countof(szTime), TZF_KNOWNONLY)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_LOCALTIME), FALSE);
SetDlgItemText(hwndDlg, IDC_LOCALTIME, TranslateT("<not specified>"));
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index 9e3d50ddda..0de846052e 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -46,7 +46,7 @@ struct DetailsPageData HWND hwnd;
HTREEITEM hItem;
int changed, hLangpack;
- TCHAR *ptszTitle, *ptszTab;
+ wchar_t *ptszTitle, *ptszTab;
};
struct DetailsData
@@ -60,24 +60,24 @@ struct DetailsData DetailsPageData *opd;
RECT rcDisplay, rcDisplayTab;
int updateAnimFrame;
- TCHAR szUpdating[64];
+ wchar_t szUpdating[64];
int *infosUpdated;
};
-TCHAR* getTitle(OPTIONSDIALOGPAGE *p)
+wchar_t* getTitle(OPTIONSDIALOGPAGE *p)
{
- return (p->flags & ODPF_DONTTRANSLATE) ? p->ptszTitle : TranslateTH(p->hLangpack, p->ptszTitle);
+ return (p->flags & ODPF_DONTTRANSLATE) ? p->pwszTitle : TranslateTH(p->hLangpack, p->pwszTitle);
}
-TCHAR* getTab(OPTIONSDIALOGPAGE *p)
+wchar_t* getTab(OPTIONSDIALOGPAGE *p)
{
- return (p->flags & ODPF_DONTTRANSLATE) ? p->ptszTab : TranslateTH(p->hLangpack, p->ptszTab);
+ return (p->flags & ODPF_DONTTRANSLATE) ? p->pwszTab : TranslateTH(p->hLangpack, p->pwszTab);
}
static int PageSortProc(OPTIONSDIALOGPAGE *item1, OPTIONSDIALOGPAGE *item2)
{
int res;
- TCHAR *s1 = getTitle(item1), *s2 = getTitle(item2);
+ wchar_t *s1 = getTitle(item1), *s2 = getTitle(item2);
if (!mir_tstrcmp(s1, TranslateT("Summary"))) return -1;
if (!mir_tstrcmp(s2, TranslateT("Summary"))) return 1;
if (res = mir_tstrcmp(s1, s2)) return res;
@@ -115,7 +115,7 @@ static INT_PTR ShowDetailsDialogCommand(WPARAM wParam, LPARAM) psh.hwndParent = NULL;
psh.nPages = opi.pageCount;
psh.pStartPage = 0;
- psh.pszCaption = (TCHAR*)wParam; //more abuses of structure: this is hContact
+ psh.pszCaption = (wchar_t*)wParam; //more abuses of structure: this is hContact
psh.ppsp = (PROPSHEETPAGE*)opi.odp; //blatent misuse of the structure, but what the hell
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_DETAILS), NULL, DlgProcDetails, (LPARAM)&psh);
@@ -147,12 +147,12 @@ static INT_PTR AddDetailsPage(WPARAM wParam, LPARAM lParam) dst->pszTemplate = ((DWORD_PTR)odp->pszTemplate & 0xFFFF0000) ? mir_strdup(odp->pszTemplate) : odp->pszTemplate;
if (odp->flags & ODPF_UNICODE) {
- dst->ptszTitle = (odp->ptszTitle == 0) ? NULL : mir_wstrdup(odp->ptszTitle);
- dst->ptszTab = (!(odp->flags & ODPF_USERINFOTAB) || !odp->ptszTab) ? NULL : mir_wstrdup(odp->ptszTab);
+ dst->pwszTitle = (odp->pwszTitle == 0) ? NULL : mir_wstrdup(odp->pwszTitle);
+ dst->pwszTab = (!(odp->flags & ODPF_USERINFOTAB) || !odp->pwszTab) ? NULL : mir_wstrdup(odp->pwszTab);
}
else {
- dst->ptszTitle = mir_a2t(odp->pszTitle);
- dst->ptszTab = (!(odp->flags & ODPF_USERINFOTAB) || !odp->pszTab) ? NULL : mir_a2t(odp->pszTab);
+ dst->pwszTitle = mir_a2t(odp->pszTitle);
+ dst->pwszTab = (!(odp->flags & ODPF_USERINFOTAB) || !odp->pszTab) ? NULL : mir_a2t(odp->pszTab);
}
dst->hLangpack = odp->hLangpack;
@@ -248,7 +248,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP WindowList_Add(hWindowList, hwndDlg, dat->hContact);
//////////////////////////////////////////////////////////////////////
- TCHAR *name, oldTitle[256], newTitle[256];
+ wchar_t *name, oldTitle[256], newTitle[256];
if (dat->hContact == NULL)
name = TranslateT("Owner");
else
@@ -269,7 +269,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP LPTSTR ptszLastTab;
DBVARIANT dbv;
if (!db_get_ts(NULL, "UserInfo", "LastTab", &dbv)) {
- ptszLastTab = NEWTSTR_ALLOCA(dbv.ptszVal);
+ ptszLastTab = NEWWSTR_ALLOCA(dbv.ptszVal);
db_free(&dbv);
}
else ptszLastTab = NULL;
@@ -289,8 +289,8 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP p.dlgParam = odp[i].dwInitParam;
p.hInst = odp[i].hInstance;
- p.ptszTitle = odp[i].ptszTitle;
- p.ptszTab = odp[i].ptszTab;
+ p.ptszTitle = odp[i].pwszTitle;
+ p.ptszTab = odp[i].pwszTab;
p.hLangpack = odp[i].hLangpack;
if (i && p.ptszTab && !mir_tstrcmp(dat->opd[i - 1].ptszTitle, p.ptszTitle)) {
@@ -354,7 +354,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP return TRUE;
case WM_TIMER:
- TCHAR str[128];
+ wchar_t str[128];
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)
@@ -580,7 +580,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
case WM_DESTROY:
- TCHAR name[128];
+ wchar_t name[128];
TVITEM tvi;
tvi.mask = TVIF_TEXT;
tvi.hItem = dat->opd[dat->currentPage].hItem;
diff --git a/src/core/stduseronline/src/stdafx.h b/src/core/stduseronline/src/stdafx.h index 10177ae864..2fda33718c 100644 --- a/src/core/stduseronline/src/stdafx.h +++ b/src/core/stduseronline/src/stdafx.h @@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp index 20ba0e68cf..6106fd64a4 100644 --- a/src/core/stduseronline/src/useronline.cpp +++ b/src/core/stduseronline/src/useronline.cpp @@ -57,7 +57,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) DWORD ticked = db_get_dw(NULL, "UserOnline", cws->szModule, GetTickCount());
// only play the sound (or show event) if this event happens at least 10 secs after the proto went from offline
if (GetTickCount() - ticked > (1000*10)) {
- TCHAR tooltip[256];
+ wchar_t tooltip[256];
mir_sntprintf(tooltip, TranslateT("%s is online"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = {};
diff --git a/src/mir_app/src/BaseExtraIcon.cpp b/src/mir_app/src/BaseExtraIcon.cpp index 2ff3beaf3f..1aa6b40057 100644 --- a/src/mir_app/src/BaseExtraIcon.cpp +++ b/src/mir_app/src/BaseExtraIcon.cpp @@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA. #include "extraicons.h"
-BaseExtraIcon::BaseExtraIcon(int id, const char *name, const TCHAR *description, const char *descIcon, MIRANDAHOOKPARAM OnClick, LPARAM param) :
+BaseExtraIcon::BaseExtraIcon(int id, const char *name, const wchar_t *description, const char *descIcon, MIRANDAHOOKPARAM OnClick, LPARAM param) :
ExtraIcon(name),
m_id(id),
m_OnClick(OnClick),
@@ -48,12 +48,12 @@ int BaseExtraIcon::getID() const return m_id;
}
-const TCHAR* BaseExtraIcon::getDescription() const
+const wchar_t* BaseExtraIcon::getDescription() const
{
return m_tszDescription;
}
-void BaseExtraIcon::setDescription(const TCHAR *desc)
+void BaseExtraIcon::setDescription(const wchar_t *desc)
{
m_tszDescription = mir_tstrdup(desc);
}
diff --git a/src/mir_app/src/CallbackExtraIcon.cpp b/src/mir_app/src/CallbackExtraIcon.cpp index bad538c5ab..ddf8fbffa7 100644 --- a/src/mir_app/src/CallbackExtraIcon.cpp +++ b/src/mir_app/src/CallbackExtraIcon.cpp @@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA. #include "extraicons.h"
-CallbackExtraIcon::CallbackExtraIcon(int _id, const char *_name, const TCHAR *_description, const char *_descIcon,
+CallbackExtraIcon::CallbackExtraIcon(int _id, const char *_name, const wchar_t *_description, const char *_descIcon,
MIRANDAHOOK _RebuildIcons, MIRANDAHOOK _ApplyIcon, MIRANDAHOOKPARAM _OnClick, LPARAM _param) :
BaseExtraIcon(_id, _name, _description, _descIcon, _OnClick, _param),
m_pfnRebuildIcons(_RebuildIcons), m_pfnApplyIcon(_ApplyIcon), m_needToRebuild(true)
diff --git a/src/mir_app/src/ExtraIcon.h b/src/mir_app/src/ExtraIcon.h index 3d00bf5a04..7b701c11c9 100644 --- a/src/mir_app/src/ExtraIcon.h +++ b/src/mir_app/src/ExtraIcon.h @@ -43,7 +43,7 @@ public: virtual void storeIcon(MCONTACT, void*) {};
virtual const char *getName() const;
- virtual const TCHAR *getDescription() const = 0;
+ virtual const wchar_t *getDescription() const = 0;
virtual const char *getDescIcon() const = 0;
virtual int getType() const = 0;
@@ -72,12 +72,12 @@ protected: class BaseExtraIcon : public ExtraIcon
{
public:
- BaseExtraIcon(int id, const char *name, const TCHAR *description, const char *descIcon, MIRANDAHOOKPARAM OnClick, LPARAM param);
+ BaseExtraIcon(int id, const char *name, const wchar_t *description, const char *descIcon, MIRANDAHOOKPARAM OnClick, LPARAM param);
virtual ~BaseExtraIcon();
virtual int getID() const;
- virtual const TCHAR *getDescription() const;
- virtual void setDescription(const TCHAR *desc);
+ virtual const wchar_t *getDescription() const;
+ virtual void setDescription(const wchar_t *desc);
virtual const char *getDescIcon() const;
virtual void setDescIcon(const char *icon);
virtual int getType() const =0;
@@ -101,7 +101,7 @@ protected: class CallbackExtraIcon : public BaseExtraIcon
{
public:
- CallbackExtraIcon(int id, const char *name, const TCHAR *description, const char *descIcon,
+ CallbackExtraIcon(int id, const char *name, const wchar_t *description, const char *descIcon,
MIRANDAHOOK RebuildIcons, MIRANDAHOOK ApplyIcon, MIRANDAHOOKPARAM OnClick, LPARAM param);
virtual ~CallbackExtraIcon();
@@ -126,7 +126,7 @@ private: class IcolibExtraIcon : public BaseExtraIcon
{
public:
- IcolibExtraIcon(int id, const char *name, const TCHAR *description, const char *descIcon, MIRANDAHOOKPARAM OnClick, LPARAM param);
+ IcolibExtraIcon(int id, const char *name, const wchar_t *description, const char *descIcon, MIRANDAHOOKPARAM OnClick, LPARAM param);
virtual ~IcolibExtraIcon();
virtual int getType() const;
@@ -158,7 +158,7 @@ public: virtual int setIcon(int id, MCONTACT hContact, HANDLE icon);
virtual int setIconByName(int id, MCONTACT hContact, const char *icon);
- virtual const TCHAR* getDescription() const;
+ virtual const wchar_t* getDescription() const;
virtual const char* getDescIcon() const;
virtual int getType() const;
diff --git a/src/mir_app/src/ExtraIconGroup.cpp b/src/mir_app/src/ExtraIconGroup.cpp index 5031889689..6ed364f50b 100644 --- a/src/mir_app/src/ExtraIconGroup.cpp +++ b/src/mir_app/src/ExtraIconGroup.cpp @@ -188,7 +188,7 @@ int ExtraIconGroup::internalSetIcon(int id, MCONTACT hContact, void *value, bool return ret;
}
-const TCHAR* ExtraIconGroup::getDescription() const
+const wchar_t* ExtraIconGroup::getDescription() const
{
return m_tszDescription;
}
diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp index 55653f7dbc..ef20702b7a 100644 --- a/src/mir_app/src/FontOptions.cpp +++ b/src/mir_app/src/FontOptions.cpp @@ -131,9 +131,9 @@ static void WriteLine(FILE *out, const char pszText[]) fputc('\n', out);
}
-static BOOL ExportSettings(HWND hwndDlg, const TCHAR *filename, OBJLIST<FontInternal>& flist, OBJLIST<ColourInternal>& clist, OBJLIST<EffectInternal>& elist)
+static BOOL ExportSettings(HWND hwndDlg, const wchar_t *filename, OBJLIST<FontInternal>& flist, OBJLIST<ColourInternal>& clist, OBJLIST<EffectInternal>& elist)
{
- FILE *out = _tfopen(filename, L"w");
+ FILE *out = _wfopen(filename, L"w");
if (out == NULL) {
MessageBox(hwndDlg, filename, TranslateT("Failed to create file"), MB_ICONWARNING | MB_OK);
return FALSE;
@@ -253,7 +253,7 @@ struct FSUIListItemData int effect_id;
};
-static BOOL sttFsuiBindColourIdToFonts(HWND hwndList, const TCHAR *name, const TCHAR *backgroundGroup, const TCHAR *backgroundName, int colourId)
+static BOOL sttFsuiBindColourIdToFonts(HWND hwndList, const wchar_t *name, const wchar_t *backgroundGroup, const wchar_t *backgroundName, int colourId)
{
BOOL res = FALSE;
for (int i = SendMessage(hwndList, LB_GETCOUNT, 0, 0); i--;) {
@@ -276,7 +276,7 @@ static BOOL sttFsuiBindColourIdToFonts(HWND hwndList, const TCHAR *name, const T return res;
}
-static bool sttFsuiBindEffectIdToFonts(HWND hwndList, const TCHAR *name, int effectId)
+static bool sttFsuiBindEffectIdToFonts(HWND hwndList, const wchar_t *name, int effectId)
{
for (int i = SendMessage(hwndList, LB_GETCOUNT, 0, 0); i--;) {
FSUIListItemData *itemData = (FSUIListItemData *)SendMessage(hwndList, LB_GETITEMDATA, i, 0);
@@ -293,10 +293,10 @@ static bool sttFsuiBindEffectIdToFonts(HWND hwndList, const TCHAR *name, int eff return false;
}
-static HTREEITEM sttFindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHAR *name)
+static HTREEITEM sttFindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const wchar_t *name)
{
TVITEM tvi = { 0 };
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
if (hItem)
tvi.hItem = TreeView_GetChild(hwndTree, hItem);
@@ -321,10 +321,10 @@ static HTREEITEM sttFindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TC return NULL;
}
-static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const TCHAR *groupName, int _hLang)
+static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const wchar_t *groupName, int _hLang)
{
- TCHAR itemName[1024];
- TCHAR* sectionName;
+ wchar_t itemName[1024];
+ wchar_t* sectionName;
int sectionLevel = 0;
HTREEITEM hSection = NULL;
@@ -333,11 +333,11 @@ static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const TCHAR *groupName, while (sectionName) {
// allow multi-level tree
- TCHAR* pItemName = sectionName;
+ wchar_t* pItemName = sectionName;
HTREEITEM hItem;
// one level deeper
- if (sectionName = _tcschr(sectionName, '/'))
+ if (sectionName = wcschr(sectionName, '/'))
*sectionName = 0;
pItemName = TranslateTH(_hLang, pItemName);
@@ -436,7 +436,7 @@ static void ShowEffectButton(HWND hwndDlg, BOOL bShow) ShowWindow(GetDlgItem(hwndDlg, IDC_EFFECT_STATIC), bShow ? SW_SHOW : SW_HIDE);
}
-TCHAR* ModernEffectNames[] = { LPGENT("<none>"), LPGENT("Shadow at left"), LPGENT("Shadow at right"), LPGENT("Outline"), LPGENT("Outline smooth"), LPGENT("Smooth bump"), LPGENT("Contour thin"), LPGENT("Contour heavy") };
+wchar_t* ModernEffectNames[] = { LPGENW("<none>"), LPGENW("Shadow at left"), LPGENW("Shadow at right"), LPGENW("Outline"), LPGENW("Outline smooth"), LPGENW("Smooth bump"), LPGENW("Contour thin"), LPGENW("Contour heavy") };
static INT_PTR CALLBACK ChooseEffectDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
@@ -600,7 +600,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, tvi.mask = TVIF_HANDLE | TVIF_PARAM;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_FONTGROUP), &tvi);
treeItem = (TreeItem *)tvi.lParam;
- TCHAR *group_buff = treeItem->groupName;
+ wchar_t *group_buff = treeItem->groupName;
sttFreeListItems(GetDlgItem(hwndDlg, IDC_FONTLIST));
SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_RESETCONTENT, 0, 0);
@@ -612,7 +612,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, for (int fontId = 0; fontId < font_id_list_w2.getCount(); fontId++) {
FontInternal &F = font_id_list_w2[fontId];
- if (!_tcsncmp(F.group, group_buff, 64)) {
+ if (!wcsncmp(F.group, group_buff, 64)) {
FSUIListItemData *itemData = (FSUIListItemData*)mir_alloc(sizeof(FSUIListItemData));
itemData->colour_id = -1;
itemData->effect_id = -1;
@@ -629,7 +629,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, for (int colourId = 0; colourId < colour_id_list_w2.getCount(); colourId++) {
ColourInternal &C = colour_id_list_w2[colourId];
- if (!_tcsncmp(C.group, group_buff, 64)) {
+ if (!wcsncmp(C.group, group_buff, 64)) {
if (!sttFsuiBindColourIdToFonts(GetDlgItem(hwndDlg, IDC_FONTLIST), C.name, C.group, C.name, colourId)) {
FSUIListItemData *itemData = (FSUIListItemData*)mir_alloc(sizeof(FSUIListItemData));
itemData->colour_id = colourId;
@@ -649,7 +649,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, for (int effectId = 0; effectId < effect_id_list_w2.getCount(); effectId++) {
EffectInternal& E = effect_id_list_w2[effectId];
- if (!_tcsncmp(E.group, group_buff, 64)) {
+ if (!wcsncmp(E.group, group_buff, 64)) {
if (!sttFsuiBindEffectIdToFonts(GetDlgItem(hwndDlg, IDC_FONTLIST), E.name, effectId)) {
FSUIListItemData *itemData = (FSUIListItemData*)mir_alloc(sizeof(FSUIListItemData));
itemData->effect_id = effectId;
@@ -689,7 +689,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, HFONT hFont = NULL, hoFont = NULL;
BOOL bIsFont = FALSE;
- TCHAR *itemName = NULL;
+ wchar_t *itemName = NULL;
if (itemData->font_id >= 0) {
int iItem = itemData->font_id;
bIsFont = TRUE;
@@ -728,7 +728,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, COLORREF clBack = (COLORREF)-1;
COLORREF clText = GetSysColor(COLOR_WINDOWTEXT);
BOOL bIsFont = FALSE;
- TCHAR *itemName = NULL;
+ wchar_t *itemName = NULL;
FSUIListItemData *itemData = (FSUIListItemData *)dis->itemData;
FONTEFFECT * pEffect = NULL;
@@ -960,7 +960,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, F1.value.size = (char)lf.lfHeight;
F1.value.style = (lf.lfWeight >= FW_BOLD ? DBFONTF_BOLD : 0) | (lf.lfItalic ? DBFONTF_ITALIC : 0) | (lf.lfUnderline ? DBFONTF_UNDERLINE : 0) | (lf.lfStrikeOut ? DBFONTF_STRIKEOUT : 0);
F1.value.charset = lf.lfCharSet;
- _tcsncpy_s(F1.value.szFace, lf.lfFaceName, _TRUNCATE);
+ wcsncpy_s(F1.value.szFace, lf.lfFaceName, _TRUNCATE);
MEASUREITEMSTRUCT mis = { 0 };
mis.CtlID = IDC_FONTLIST;
@@ -1074,7 +1074,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, case IDC_BTN_EXPORT:
{
- TCHAR fname_buff[MAX_PATH], filter[MAX_PATH];
+ wchar_t fname_buff[MAX_PATH], filter[MAX_PATH];
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 };
@@ -1298,7 +1298,7 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar pf->value.size = (char)lf.lfHeight;
pf->value.style = (lf.lfWeight >= FW_BOLD ? DBFONTF_BOLD : 0) | (lf.lfItalic ? DBFONTF_ITALIC : 0) | (lf.lfUnderline ? DBFONTF_UNDERLINE : 0) | (lf.lfStrikeOut ? DBFONTF_STRIKEOUT : 0);
pf->value.charset = lf.lfCharSet;
- _tcsncpy_s(pf->value.szFace, lf.lfFaceName, _TRUNCATE);
+ wcsncpy_s(pf->value.szFace, lf.lfFaceName, _TRUNCATE);
InvalidateRect(GetDlgItem(hwndDlg, IDC_PREVIEWHEADER), NULL, TRUE);
InvalidateRect(GetDlgItem(hwndDlg, IDC_PREVIEWGENERAL), NULL, TRUE);
@@ -1355,7 +1355,7 @@ int FontsModernOptInit(WPARAM wParam, LPARAM) obj.iSection = MODERNOPT_PAGE_SKINS;
obj.iType = MODERNOPT_TYPE_SUBSECTIONPAGE;
obj.iBoldControls = iBoldControls;
- obj.lptzSubsection = LPGENT("Fonts");
+ obj.lptzSubsection = LPGENW("Fonts");
obj.lpzClassicGroup = "Customize";
obj.lpzClassicPage = "Fonts";
obj.lpzHelpUrl = "http://wiki.miranda-ng.org/";
diff --git a/src/mir_app/src/FontService.cpp b/src/mir_app/src/FontService.cpp index 21790e4369..6e1d678965 100644 --- a/src/mir_app/src/FontService.cpp +++ b/src/mir_app/src/FontService.cpp @@ -97,19 +97,19 @@ int LoadFontserviceModule(void) // create generic fonts
FontIDT fontid = { sizeof(fontid) };
strncpy(fontid.dbSettingsGroup, "Fonts", sizeof(fontid.dbSettingsGroup));
- _tcsncpy_s(fontid.group, LPGENT("General"), _TRUNCATE);
+ wcsncpy_s(fontid.group, LPGENW("General"), _TRUNCATE);
- _tcsncpy_s(fontid.name, LPGENT("Headers"), _TRUNCATE);
+ wcsncpy_s(fontid.name, LPGENW("Headers"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSHEADER;
strncpy(fontid.prefix, "Header", _countof(fontid.prefix));
FontRegisterT(&fontid);
- _tcsncpy_s(fontid.name, LPGENT("Generic text"), _TRUNCATE);
+ wcsncpy_s(fontid.name, LPGENW("Generic text"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSGENERAL;
strncpy(fontid.prefix, "Generic", _countof(fontid.prefix));
FontRegisterT(&fontid);
- _tcsncpy_s(fontid.name, LPGENT("Small text"), _TRUNCATE);
+ wcsncpy_s(fontid.name, LPGENW("Small text"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSSMALL;
strncpy(fontid.prefix, "Small", _countof(fontid.prefix));
FontRegisterT(&fontid);
diff --git a/src/mir_app/src/FontService.h b/src/mir_app/src/FontService.h index d530c311d7..9a1ea0c9d0 100644 --- a/src/mir_app/src/FontService.h +++ b/src/mir_app/src/FontService.h @@ -31,7 +31,7 @@ struct FontInternal : public FontIDT FontSettingsT value;
int hLangpack;
- __inline TCHAR* getName() const { return TranslateTH(hLangpack, name); }
+ __inline wchar_t* getName() const { return TranslateTH(hLangpack, name); }
__inline bool isHeader() const
{
@@ -39,7 +39,7 @@ struct FontInternal : public FontIDT return true;
if ((flags & FIDF_CLASSMASK) == 0)
- if (_tcsstr(name, L"Incoming nick") || _tcsstr(name, L"Outgoing nick") || _tcsstr(name, L"Incoming timestamp") || _tcsstr(name, L"Outgoing timestamp"))
+ if (wcsstr(name, L"Incoming nick") || wcsstr(name, L"Outgoing nick") || wcsstr(name, L"Incoming timestamp") || wcsstr(name, L"Outgoing timestamp"))
return true;
return false;
}
@@ -47,7 +47,7 @@ struct FontInternal : public FontIDT struct ColourInternal : public ColourIDT
{
- __inline TCHAR* getName() const { return TranslateTH(hLangpack, name); }
+ __inline wchar_t* getName() const { return TranslateTH(hLangpack, name); }
COLORREF value;
int hLangpack;
@@ -55,7 +55,7 @@ struct ColourInternal : public ColourIDT struct EffectInternal : public EffectIDT
{
- __inline TCHAR* getName() const { return TranslateTH(hLangpack, name); }
+ __inline wchar_t* getName() const { return TranslateTH(hLangpack, name); }
int hLangpack;
};
@@ -66,7 +66,7 @@ struct EffectInternal : public EffectIDT typedef struct
{
char *paramName;
- TCHAR *groupName;
+ wchar_t *groupName;
}
TreeItem;
diff --git a/src/mir_app/src/IcoLib.h b/src/mir_app/src/IcoLib.h index 67e1ea779c..2d8932e406 100644 --- a/src/mir_app/src/IcoLib.h +++ b/src/mir_app/src/IcoLib.h @@ -37,7 +37,7 @@ struct SectionItem : public MZeroedObject struct IconSourceFile
{
int ref_count;
- TCHAR file[MAX_PATH];
+ wchar_t file[MAX_PATH];
};
struct IconSourceItemKey
@@ -78,7 +78,7 @@ struct IcolibItem : public MZeroedObject char* name;
SectionItem* section;
int orderID;
- TCHAR* description;
+ wchar_t* description;
IconSourceFile* default_file;
int default_indx;
int cx, cy;
@@ -88,12 +88,12 @@ struct IcolibItem : public MZeroedObject IconSourceItem* source_big;
IconSourceItem* default_icon;
- TCHAR* temp_file;
+ wchar_t* temp_file;
HICON temp_icon;
BOOL temp_reset;
__inline ~IcolibItem() { clear(); }
- __inline TCHAR* getDescr() const { return TranslateTH(hLangpack, description); }
+ __inline wchar_t* getDescr() const { return TranslateTH(hLangpack, description); }
void clear();
};
@@ -104,7 +104,7 @@ UINT _ExtractIconEx(LPCTSTR lpszFile, int iconIndex, int cxIcon, int cyIcon, HIC void __fastcall SafeDestroyIcon(HICON &icon);
-IconSourceItem* GetIconSourceItem(const TCHAR* file, int indx, int cxIcon, int cyIcon);
+IconSourceItem* GetIconSourceItem(const wchar_t* file, int indx, int cxIcon, int cyIcon);
IcolibItem* IcoLib_FindHIcon(HICON hIcon, bool &big);
IcolibItem* IcoLib_FindIcon(const char* pszIconName);
diff --git a/src/mir_app/src/IcolibExtraIcon.cpp b/src/mir_app/src/IcolibExtraIcon.cpp index 2ee93720e4..3ce8671e50 100644 --- a/src/mir_app/src/IcolibExtraIcon.cpp +++ b/src/mir_app/src/IcolibExtraIcon.cpp @@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. #include "IcoLib.h"
-IcolibExtraIcon::IcolibExtraIcon(int _id, const char *_name, const TCHAR *_description, const char *_descIcon,
+IcolibExtraIcon::IcolibExtraIcon(int _id, const char *_name, const wchar_t *_description, const char *_descIcon,
MIRANDAHOOKPARAM _OnClick, LPARAM _param) :
BaseExtraIcon(_id, _name, _description, _descIcon, _OnClick, _param)
{
diff --git a/src/mir_app/src/addcontact.cpp b/src/mir_app/src/addcontact.cpp index 34d314ef62..e9a729541f 100644 --- a/src/mir_app/src/addcontact.cpp +++ b/src/mir_app/src/addcontact.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-static TCHAR* sttDecodeString(DWORD dwFlags, MAllStrings &src)
+static wchar_t* sttDecodeString(DWORD dwFlags, MAllStrings &src)
{
if (dwFlags & PSR_UNICODE)
return mir_u2t(src.w);
@@ -77,7 +77,7 @@ public: }
MCONTACT hContact;
- TCHAR *szName = NULL, *tmpStr = NULL;
+ wchar_t *szName = NULL, *tmpStr = NULL;
if (m_acs.handleType == HANDLE_CONTACT)
szName = cli.pfnGetContactDisplayName(hContact = m_acs.hContact, 0);
else {
@@ -121,7 +121,7 @@ public: int groupSel = 0;
ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
- TCHAR *grpName;
+ wchar_t *grpName;
for (int groupId = 1; (grpName = Clist_GroupGetName(groupId, NULL)) != NULL; groupId++) {
int id = m_group.AddString(grpName, groupId);
if (!mir_tstrcmpi(tszGroup, grpName))
diff --git a/src/mir_app/src/button.cpp b/src/mir_app/src/button.cpp index d831d1b4d3..f687df9c8b 100644 --- a/src/mir_app/src/button.cpp +++ b/src/mir_app/src/button.cpp @@ -203,7 +203,7 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) HFONT hOldFont = (HFONT)SelectObject(hdcMem, ctl->hFont);
SIZE sz;
- TCHAR szText[MAX_PATH];
+ wchar_t szText[MAX_PATH];
GetWindowText(ctl->hwnd, szText, _countof(szText));
GetTextExtentPoint32(hdcMem, szText, (int)mir_tstrlen(szText), &sz);
int xOffset = (rcClient.right - rcClient.left - sz.cx)/2;
@@ -307,7 +307,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR case WM_SETTEXT:
bct->cHot = 0;
if (lParam != 0) {
- TCHAR *tmp = (TCHAR*)lParam;
+ wchar_t *tmp = (wchar_t*)lParam;
while (*tmp) {
if (*tmp == '&' && *(tmp+1)) {
bct->cHot = _tolower(*(tmp+1));
@@ -486,7 +486,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR ti.uFlags = TTF_IDISHWND|TTF_SUBCLASS;
ti.uId = (UINT_PTR)bct->hwnd;
if (lParam & BATF_UNICODE)
- ti.lpszText = mir_wstrdup(TranslateW((WCHAR*)wParam));
+ ti.lpszText = mir_wstrdup(TranslateTS((WCHAR*)wParam));
else
ti.lpszText = Langpack_PcharToTchar((char*)wParam);
if (bct->pAccPropServices) {
diff --git a/src/mir_app/src/chat.h b/src/mir_app/src/chat.h index 26bd0710de..7f493c3bcf 100644 --- a/src/mir_app/src/chat.h +++ b/src/mir_app/src/chat.h @@ -38,7 +38,7 @@ struct GCPTRS extern HGENMENU hJoinMenuItem, hLeaveMenuItem;
extern GlobalLogSettingsBase *g_Settings;
extern int g_cbSession, g_cbModuleInfo, g_iFontMode, g_iChatLang;
-extern TCHAR *g_szFontGroup;
+extern wchar_t *g_szFontGroup;
extern mir_cs cs;
extern char* pLogIconBmpBits[14];
@@ -47,17 +47,17 @@ extern size_t logIconBmpSize[14]; // log.c
void LoadMsgLogBitmaps(void);
void FreeMsgLogBitmaps(void);
-void ValidateFilename (TCHAR *filename);
-TCHAR* MakeTimeStamp(TCHAR *pszStamp, time_t time);
-TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime);
+void ValidateFilename (wchar_t *filename);
+wchar_t* MakeTimeStamp(wchar_t *pszStamp, time_t time);
+wchar_t* GetChatLogsFilename(SESSION_INFO *si, time_t tTime);
char* Log_CreateRtfHeader(MODULEINFO *mi);
char* Log_CreateRTF(LOGSTREAMDATA *streamData);
char* Log_SetStyle(int style);
// clist.c
-BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, TCHAR* fmt, ...);
-MCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType);
-MCONTACT FindRoom(const char *pszModule, const TCHAR *pszRoom);
+BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, wchar_t* fmt, ...);
+MCONTACT AddRoom(const char *pszModule, const wchar_t *pszRoom, const wchar_t *pszDisplayName, int iType);
+MCONTACT FindRoom(const char *pszModule, const wchar_t *pszRoom);
BOOL SetAllOffline(BOOL bHide, const char *pszModule);
BOOL SetOffline(MCONTACT hContact, BOOL bHide);
@@ -87,24 +87,24 @@ int LoadChatModule(void); void UnloadChatModule(void);
// tools.c
-int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors); -int GetTextPixelSize(TCHAR* pszText, HFONT hFont, BOOL bWidth);
-TCHAR *RemoveFormatting(const TCHAR* pszText);
+int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors);
+int GetTextPixelSize(wchar_t* pszText, HFONT hFont, BOOL bWidth);
+wchar_t *RemoveFormatting(const wchar_t* pszText);
BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight, int bManyFix);
int GetColorIndex(const char *pszModule, COLORREF cr);
void CheckColorsInModule(const char *pszModule);
int GetRichTextLength(HWND hwnd);
BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *pszText);
-UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText);
+UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, wchar_t* pszUID, wchar_t* pszWordText);
void DestroyGCMenu(HMENU *hMenu, int iIndex);
-BOOL DoEventHookAsync(HWND hwnd, const TCHAR *pszID, const char *pszModule, int iType, const TCHAR* pszUID, const TCHAR* pszText, INT_PTR dwItem);
-BOOL DoEventHook(const TCHAR *pszID, const char *pszModule, int iType, const TCHAR *pszUID, const TCHAR* pszText, INT_PTR dwItem);
+BOOL DoEventHookAsync(HWND hwnd, const wchar_t *pszID, const char *pszModule, int iType, const wchar_t* pszUID, const wchar_t* pszText, INT_PTR dwItem);
+BOOL DoEventHook(const wchar_t *pszID, const char *pszModule, int iType, const wchar_t *pszUID, const wchar_t* pszText, INT_PTR dwItem);
BOOL IsEventSupported(int eventType);
BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce);
BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce);
BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce);
-int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...);
+int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, wchar_t* pszRoomName, COLORREF crBkg, const wchar_t* fmt, ...);
-const TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2);
+const wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2);
#pragma comment(lib,"comctl32.lib")
diff --git a/src/mir_app/src/chat_clist.cpp b/src/mir_app/src/chat_clist.cpp index 1c47006d0b..755904e390 100644 --- a/src/mir_app/src/chat_clist.cpp +++ b/src/mir_app/src/chat_clist.cpp @@ -22,12 +22,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "chat.h"
-MCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType)
+MCONTACT AddRoom(const char *pszModule, const wchar_t *pszRoom, const wchar_t *pszDisplayName, int iType)
{
- TCHAR pszGroup[50]; *pszGroup = '\0';
+ wchar_t pszGroup[50]; *pszGroup = '\0';
ptrT groupName(db_get_tsa(NULL, CHAT_MODULE, "AddToGroup"));
if (groupName)
- _tcsncpy_s(pszGroup, groupName, _TRUNCATE);
+ wcsncpy_s(pszGroup, groupName, _TRUNCATE);
else
mir_tstrcpy(pszGroup, L"Chat rooms");
@@ -176,12 +176,12 @@ int PrebuildContactMenu(WPARAM hContact, LPARAM) if (db_get_w(hContact, szProto, "Status", 0) == ID_STATUS_OFFLINE) {
if (ProtoServiceExists(szProto, PS_JOINCHAT)) {
bEnabledJoin = true;
- Menu_ModifyItem(hJoinMenuItem, LPGENT("&Join chat"));
+ Menu_ModifyItem(hJoinMenuItem, LPGENW("&Join chat"));
}
}
else {
bEnabledJoin = true;
- Menu_ModifyItem(hJoinMenuItem, LPGENT("&Open chat window"));
+ Menu_ModifyItem(hJoinMenuItem, LPGENW("&Open chat window"));
}
}
bEnabledLeave = ProtoServiceExists(szProto, PS_LEAVECHAT) != 0;
@@ -198,9 +198,9 @@ INT_PTR PrebuildContactMenuSvc(WPARAM wParam, LPARAM lParam) return PrebuildContactMenu(wParam, lParam);
}
-BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, TCHAR* fmt, ...)
+BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, wchar_t* fmt, ...)
{
- TCHAR szBuf[4096];
+ wchar_t szBuf[4096];
if (!fmt || !fmt[0] || mir_tstrlen(fmt) > 2000)
return FALSE;
@@ -229,7 +229,7 @@ BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, TCHAR* fm return TRUE;
}
-MCONTACT FindRoom(const char *pszModule, const TCHAR *pszRoom)
+MCONTACT FindRoom(const char *pszModule, const wchar_t *pszRoom)
{
for (MCONTACT hContact = db_find_first(pszModule); hContact; hContact = db_find_next(hContact, pszModule)) {
if (!db_get_b(hContact, pszModule, "ChatRoom", 0))
diff --git a/src/mir_app/src/chat_log.cpp b/src/mir_app/src/chat_log.cpp index ac2a9ba75e..590ceb0f9d 100644 --- a/src/mir_app/src/chat_log.cpp +++ b/src/mir_app/src/chat_log.cpp @@ -104,11 +104,11 @@ static void Log_Append(char *&buffer, size_t &cbBufferEnd, size_t &cbBufferAlloc cbBufferEnd += charsDone;
}
-static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buffer, size_t &cbBufferEnd, size_t &cbBufferAlloced, const TCHAR *fmt, ...)
+static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buffer, size_t &cbBufferEnd, size_t &cbBufferAlloced, const wchar_t *fmt, ...)
{
va_list va;
int lineLen, textCharsCount = 0;
- TCHAR* line = (TCHAR*)alloca(8001 * sizeof(TCHAR));
+ wchar_t* line = (wchar_t*)alloca(8001 * sizeof(wchar_t));
va_start(va, fmt);
lineLen = mir_vsntprintf(line, 8000, fmt, va);
@@ -150,14 +150,14 @@ static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buff line += 2;
else if (line[1] != '\0' && line[2] != '\0') {
- TCHAR szTemp3[3], c = *line;
+ wchar_t szTemp3[3], c = *line;
int col;
szTemp3[0] = line[1];
szTemp3[1] = line[2];
szTemp3[2] = '\0';
line += 2;
- col = _ttoi(szTemp3);
+ col = _wtoi(szTemp3);
col += (OPTIONS_FONTCOUNT + 1);
mir_snprintf(szTemp, (c == 'c') ? "\\cf%u " : "\\highlight%u ", col);
}
@@ -222,8 +222,8 @@ static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buff static void AddEventToBuffer(char *&buffer, size_t &bufferEnd, size_t &bufferAlloced, LOGSTREAMDATA *streamData)
{
- TCHAR szTemp[512], szTemp2[512];
- TCHAR* pszNick = NULL;
+ wchar_t szTemp[512], szTemp2[512];
+ wchar_t* pszNick = NULL;
if (streamData->lin->ptszNick) {
if (g_Settings->bLogLimitNames && mir_tstrlen(streamData->lin->ptszNick) > 20) {
mir_tstrncpy(szTemp2, streamData->lin->ptszNick, 20);
@@ -234,7 +234,7 @@ static void AddEventToBuffer(char *&buffer, size_t &bufferEnd, size_t &bufferAll if (streamData->lin->ptszUserInfo)
mir_sntprintf(szTemp, L"%s (%s)", szTemp2, streamData->lin->ptszUserInfo);
else
- _tcsncpy_s(szTemp, szTemp2, _TRUNCATE);
+ wcsncpy_s(szTemp, szTemp2, _TRUNCATE);
pszNick = szTemp;
}
@@ -312,11 +312,11 @@ static void AddEventToBuffer(char *&buffer, size_t &bufferEnd, size_t &bufferAll }
}
-TCHAR* MakeTimeStamp(TCHAR *pszStamp, time_t time)
+wchar_t* MakeTimeStamp(wchar_t *pszStamp, time_t time)
{
- static TCHAR szTime[30];
- if (!_tcsftime(szTime, _countof(szTime)-1, pszStamp, localtime(&time)))
- _tcsncpy_s(szTime, TranslateT("<invalid>"), _TRUNCATE);
+ static wchar_t szTime[30];
+ if (!wcsftime(szTime, _countof(szTime)-1, pszStamp, localtime(&time)))
+ wcsncpy_s(szTime, TranslateT("<invalid>"), _TRUNCATE);
return szTime;
}
@@ -380,7 +380,7 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData) //insert timestamp
if (g_Settings->bShowTime) {
- TCHAR szTimeStamp[30], szOldTimeStamp[30];
+ wchar_t szTimeStamp[30], szOldTimeStamp[30];
mir_tstrncpy(szTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, lin->time), 30);
mir_tstrncpy(szOldTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, streamData->si->LastTime), 30);
@@ -393,11 +393,11 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData) // Insert the nick
if (lin->ptszNick && lin->iType == GC_EVENT_MESSAGE) {
- TCHAR pszTemp[300], *p1;
+ wchar_t pszTemp[300], *p1;
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, L"%n");
+ p1 = wcsstr(pszTemp, L"%n");
if (p1)
p1[1] = 's';
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index c2bc66db1a..0e3a3bf276 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -38,7 +38,7 @@ static void SetActiveSessionEx(SESSION_INFO *si) }
}
-static void SetActiveSession(const TCHAR *pszID, const char *pszModule)
+static void SetActiveSession(const wchar_t *pszID, const char *pszModule)
{
SESSION_INFO *si = chatApi.SM_FindSession(pszID, pszModule);
if (si)
@@ -60,7 +60,7 @@ static SESSION_INFO* GetActiveSession(void) // Keeps track of all sessions and its windows
//---------------------------------------------------
-static SESSION_INFO* SM_AddSession(const TCHAR *pszID, const char *pszModule)
+static SESSION_INFO* SM_AddSession(const wchar_t *pszID, const char *pszModule)
{
if (!pszID || !pszModule)
return NULL;
@@ -114,7 +114,7 @@ static void SM_FreeSession(SESSION_INFO *si) mir_free(si);
}
-static int SM_RemoveSession(const TCHAR *pszID, const char *pszModule, BOOL removeContact)
+static int SM_RemoveSession(const wchar_t *pszID, const char *pszModule, BOOL removeContact)
{
if (!pszModule)
return FALSE;
@@ -156,7 +156,7 @@ static int SM_RemoveSession(const TCHAR *pszID, const char *pszModule, BOOL remo return FALSE;
}
-static SESSION_INFO* SM_FindSession(const TCHAR *pszID, const char *pszModule)
+static SESSION_INFO* SM_FindSession(const wchar_t *pszID, const char *pszModule)
{
if (!pszID || !pszModule)
return NULL;
@@ -168,7 +168,7 @@ static SESSION_INFO* SM_FindSession(const TCHAR *pszID, const char *pszModule) return NULL;
}
-static BOOL SM_SetOffline(const TCHAR *pszID, const char *pszModule)
+static BOOL SM_SetOffline(const wchar_t *pszID, const char *pszModule)
{
if (!pszModule)
return FALSE;
@@ -190,7 +190,7 @@ static BOOL SM_SetOffline(const TCHAR *pszID, const char *pszModule) return TRUE;
}
-static BOOL SM_SetStatusEx(const TCHAR *pszID, const char *pszModule, const TCHAR* pszText, int flags)
+static BOOL SM_SetStatusEx(const wchar_t *pszID, const char *pszModule, const wchar_t* pszText, int flags)
{
if (!pszModule)
return FALSE;
@@ -248,7 +248,7 @@ static BOOL SM_AddEventToAllMatchingUID(GCEVENT *gce) return 0;
}
-static BOOL SM_AddEvent(const TCHAR *pszID, const char *pszModule, GCEVENT *gce, BOOL bIsHighlighted)
+static BOOL SM_AddEvent(const wchar_t *pszID, const char *pszModule, GCEVENT *gce, BOOL bIsHighlighted)
{
SESSION_INFO *p = SM_FindSession(pszID, pszModule);
if (p == NULL)
@@ -276,7 +276,7 @@ static BOOL SM_AddEvent(const TCHAR *pszID, const char *pszModule, GCEVENT *gce, return TRUE;
}
-static USERINFO* SM_AddUser(const TCHAR *pszID, const char *pszModule, const TCHAR *pszUID, const TCHAR *pszNick, WORD wStatus)
+static USERINFO* SM_AddUser(const wchar_t *pszID, const char *pszModule, const wchar_t *pszUID, const wchar_t *pszNick, WORD wStatus)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -289,7 +289,7 @@ static USERINFO* SM_AddUser(const TCHAR *pszID, const char *pszModule, const TCH return p;
}
-static BOOL SM_MoveUser(const TCHAR *pszID, const char *pszModule, const TCHAR *pszUID)
+static BOOL SM_MoveUser(const wchar_t *pszID, const char *pszModule, const wchar_t *pszUID)
{
if (!pszUID)
return FALSE;
@@ -302,7 +302,7 @@ static BOOL SM_MoveUser(const TCHAR *pszID, const char *pszModule, const TCHAR * return TRUE;
}
-static BOOL SM_RemoveUser(const TCHAR *pszID, const char *pszModule, const TCHAR *pszUID)
+static BOOL SM_RemoveUser(const wchar_t *pszID, const char *pszModule, const wchar_t *pszUID)
{
if (!pszModule || !pszUID)
return FALSE;
@@ -332,13 +332,13 @@ static BOOL SM_RemoveUser(const TCHAR *pszID, const char *pszModule, const TCHAR return 0;
}
-static USERINFO* SM_GetUserFromIndex(const TCHAR *pszID, const char *pszModule, int index)
+static USERINFO* SM_GetUserFromIndex(const wchar_t *pszID, const char *pszModule, int index)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
return (si == NULL) ? NULL : chatApi.UM_FindUserFromIndex(si->pUsers, index);
}
-STATUSINFO* SM_AddStatus(const TCHAR *pszID, const char *pszModule, const TCHAR *pszStatus)
+STATUSINFO* SM_AddStatus(const wchar_t *pszID, const char *pszModule, const wchar_t *pszStatus)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -352,7 +352,7 @@ STATUSINFO* SM_AddStatus(const TCHAR *pszID, const char *pszModule, const TCHAR return ti;
}
-static BOOL SM_GiveStatus(const TCHAR *pszID, const char *pszModule, const TCHAR *pszUID, const TCHAR *pszStatus)
+static BOOL SM_GiveStatus(const wchar_t *pszID, const char *pszModule, const wchar_t *pszUID, const wchar_t *pszStatus)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -367,7 +367,7 @@ static BOOL SM_GiveStatus(const TCHAR *pszID, const char *pszModule, const TCHAR return TRUE;
}
-static BOOL SM_SetContactStatus(const TCHAR *pszID, const char *pszModule, const TCHAR *pszUID, WORD wStatus)
+static BOOL SM_SetContactStatus(const wchar_t *pszID, const char *pszModule, const wchar_t *pszUID, WORD wStatus)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -382,7 +382,7 @@ static BOOL SM_SetContactStatus(const TCHAR *pszID, const char *pszModule, const return TRUE;
}
-static BOOL SM_TakeStatus(const TCHAR *pszID, const char *pszModule, const TCHAR *pszUID, const TCHAR *pszStatus)
+static BOOL SM_TakeStatus(const wchar_t *pszID, const char *pszModule, const wchar_t *pszUID, const wchar_t *pszStatus)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -397,7 +397,7 @@ static BOOL SM_TakeStatus(const TCHAR *pszID, const char *pszModule, const TCHAR return TRUE;
}
-static LRESULT SM_SendMessage(const TCHAR *pszID, const char *pszModule, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT SM_SendMessage(const wchar_t *pszID, const char *pszModule, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (pszModule == NULL)
return 0;
@@ -417,7 +417,7 @@ static LRESULT SM_SendMessage(const TCHAR *pszID, const char *pszModule, UINT ms return 0;
}
-static BOOL SM_PostMessage(const TCHAR *pszID, const char *pszModule, UINT msg, WPARAM wParam, LPARAM lParam)
+static BOOL SM_PostMessage(const wchar_t *pszID, const char *pszModule, UINT msg, WPARAM wParam, LPARAM lParam)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -444,7 +444,7 @@ static BOOL SM_BroadcastMessage(const char *pszModule, UINT msg, WPARAM wParam, return TRUE;
}
-static BOOL SM_SetStatus(const TCHAR *pszID, const char *pszModule, int wStatus)
+static BOOL SM_SetStatus(const wchar_t *pszID, const char *pszModule, int wStatus)
{
if (!pszModule)
return FALSE;
@@ -470,7 +470,7 @@ static BOOL SM_SetStatus(const TCHAR *pszID, const char *pszModule, int wStatus) return TRUE;
}
-static BOOL SM_SendUserMessage(const TCHAR *pszID, const char *pszModule, const TCHAR* pszText)
+static BOOL SM_SendUserMessage(const wchar_t *pszID, const char *pszModule, const wchar_t* pszText)
{
if (!pszModule || !pszText)
return FALSE;
@@ -487,7 +487,7 @@ static BOOL SM_SendUserMessage(const TCHAR *pszID, const char *pszModule, const return TRUE;
}
-static BOOL SM_ChangeUID(const TCHAR *pszID, const char *pszModule, const TCHAR *pszUID, const TCHAR* pszNewUID)
+static BOOL SM_ChangeUID(const wchar_t *pszID, const char *pszModule, const wchar_t *pszUID, const wchar_t* pszNewUID)
{
if (!pszModule)
return FALSE;
@@ -505,7 +505,7 @@ static BOOL SM_ChangeUID(const TCHAR *pszID, const char *pszModule, const TCHAR return TRUE;
}
-static BOOL SM_ChangeNick(const TCHAR *pszID, const char *pszModule, GCEVENT *gce)
+static BOOL SM_ChangeNick(const wchar_t *pszID, const char *pszModule, GCEVENT *gce)
{
if (!pszModule)
return FALSE;
@@ -556,7 +556,7 @@ static BOOL SM_RemoveAll(void) return TRUE;
}
-static void SM_AddCommand(const TCHAR *pszID, const char *pszModule, const char* lpNewCommand)
+static void SM_AddCommand(const wchar_t *pszID, const char *pszModule, const char* lpNewCommand)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -591,7 +591,7 @@ static void SM_AddCommand(const TCHAR *pszID, const char *pszModule, const char* }
}
-static char* SM_GetPrevCommand(const TCHAR *pszID, const char *pszModule) // get previous command. returns NULL if previous command does not exist. current command remains as it was.
+static char* SM_GetPrevCommand(const wchar_t *pszID, const char *pszModule) // get previous command. returns NULL if previous command does not exist. current command remains as it was.
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -610,7 +610,7 @@ static char* SM_GetPrevCommand(const TCHAR *pszID, const char *pszModule) // get return (pPrevCmd) ? pPrevCmd->lpCommand : NULL;
}
-static char* SM_GetNextCommand(const TCHAR *pszID, const char *pszModule) // get next command. returns NULL if next command does not exist. current command becomes NULL (a prev command after this one will get you the last command)
+static char* SM_GetNextCommand(const wchar_t *pszID, const char *pszModule) // get next command. returns NULL if next command does not exist. current command becomes NULL (a prev command after this one will get you the last command)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -787,7 +787,7 @@ static BOOL MM_RemoveAll(void) // per window nicklist that is available
//---------------------------------------------------
-static STATUSINFO* TM_AddStatus(STATUSINFO **ppStatusList, const TCHAR *pszStatus, int *iCount)
+static STATUSINFO* TM_AddStatus(STATUSINFO **ppStatusList, const wchar_t *pszStatus, int *iCount)
{
if (!ppStatusList || !pszStatus)
return NULL;
@@ -816,7 +816,7 @@ static STATUSINFO* TM_AddStatus(STATUSINFO **ppStatusList, const TCHAR *pszStatu return FALSE;
}
-static STATUSINFO* TM_FindStatus(STATUSINFO *pStatusList, const TCHAR *pszStatus)
+static STATUSINFO* TM_FindStatus(STATUSINFO *pStatusList, const wchar_t *pszStatus)
{
if (!pStatusList || !pszStatus)
return NULL;
@@ -828,7 +828,7 @@ static STATUSINFO* TM_FindStatus(STATUSINFO *pStatusList, const TCHAR *pszStatus return 0;
}
-static WORD TM_StringToWord(STATUSINFO *pStatusList, const TCHAR *pszStatus)
+static WORD TM_StringToWord(STATUSINFO *pStatusList, const wchar_t *pszStatus)
{
if (!pStatusList || !pszStatus)
return 0;
@@ -843,7 +843,7 @@ static WORD TM_StringToWord(STATUSINFO *pStatusList, const TCHAR *pszStatus) return 0;
}
-static TCHAR* TM_WordToString(STATUSINFO *pStatusList, WORD Status)
+static wchar_t* TM_WordToString(STATUSINFO *pStatusList, WORD Status)
{
if (!pStatusList)
return NULL;
@@ -882,7 +882,7 @@ static BOOL TM_RemoveAll(STATUSINFO **ppStatusList) // in a window nicklist
//---------------------------------------------------
-static int UM_CompareItem(USERINFO *u1, const TCHAR *pszNick, WORD wStatus)
+static int UM_CompareItem(USERINFO *u1, const wchar_t *pszNick, WORD wStatus)
{
WORD dw1 = u1->Status;
WORD dw2 = wStatus;
@@ -901,7 +901,7 @@ static int UM_CompareItem(USERINFO *u1, const TCHAR *pszNick, WORD wStatus) return mir_tstrcmpi(u1->pszNick, pszNick);
}
-static USERINFO* UM_SortUser(USERINFO **ppUserList, const TCHAR *pszUID)
+static USERINFO* UM_SortUser(USERINFO **ppUserList, const wchar_t *pszUID)
{
USERINFO *ui = *ppUserList, *pLast = NULL;
if (!ui || !pszUID)
@@ -947,7 +947,7 @@ static USERINFO* UM_SortUser(USERINFO **ppUserList, const TCHAR *pszUID) return node;
}
-USERINFO* UM_AddUser(STATUSINFO *pStatusList, USERINFO **ppUserList, const TCHAR *pszUID, const TCHAR *pszNick, WORD wStatus)
+USERINFO* UM_AddUser(STATUSINFO *pStatusList, USERINFO **ppUserList, const wchar_t *pszUID, const wchar_t *pszNick, WORD wStatus)
{
if (pStatusList == NULL || ppUserList == NULL || pszNick == NULL)
return NULL;
@@ -980,7 +980,7 @@ USERINFO* UM_AddUser(STATUSINFO *pStatusList, USERINFO **ppUserList, const TCHAR return node;
}
-static USERINFO* UM_FindUser(USERINFO *pUserList, const TCHAR *pszUID)
+static USERINFO* UM_FindUser(USERINFO *pUserList, const wchar_t *pszUID)
{
if (!pUserList || !pszUID)
return NULL;
@@ -1006,7 +1006,7 @@ static USERINFO* UM_FindUserFromIndex(USERINFO *pUserList, int index) return NULL;
}
-static USERINFO* UM_GiveStatus(USERINFO *pUserList, const TCHAR *pszUID, WORD status)
+static USERINFO* UM_GiveStatus(USERINFO *pUserList, const wchar_t *pszUID, WORD status)
{
USERINFO *ui = UM_FindUser(pUserList, pszUID);
if (ui == NULL)
@@ -1016,7 +1016,7 @@ static USERINFO* UM_GiveStatus(USERINFO *pUserList, const TCHAR *pszUID, WORD st return ui;
}
-static USERINFO* UM_SetContactStatus(USERINFO *pUserList, const TCHAR *pszUID, WORD status)
+static USERINFO* UM_SetContactStatus(USERINFO *pUserList, const wchar_t *pszUID, WORD status)
{
USERINFO *ui = UM_FindUser(pUserList, pszUID);
if (ui == NULL)
@@ -1026,7 +1026,7 @@ static USERINFO* UM_SetContactStatus(USERINFO *pUserList, const TCHAR *pszUID, W return ui;
}
-static BOOL UM_SetStatusEx(USERINFO *pUserList, const TCHAR* pszText, int flags)
+static BOOL UM_SetStatusEx(USERINFO *pUserList, const wchar_t* pszText, int flags)
{
int bOnlyMe = (flags & GC_SSE_ONLYLISTED) != 0, bSetStatus = (flags & GC_SSE_ONLINE) != 0;
char cDelimiter = (flags & GC_SSE_TABDELIMITED) ? '\t' : ' ';
@@ -1036,7 +1036,7 @@ static BOOL UM_SetStatusEx(USERINFO *pUserList, const TCHAR* pszText, int flags) ui->iStatusEx = 0;
if (pszText != NULL) {
- TCHAR *s = (TCHAR *)_tcsstr(pszText, ui->pszUID);
+ wchar_t *s = (wchar_t *)wcsstr(pszText, ui->pszUID);
if (s) {
ui->iStatusEx = 0;
if (s == pszText || s[-1] == cDelimiter) {
@@ -1050,7 +1050,7 @@ static BOOL UM_SetStatusEx(USERINFO *pUserList, const TCHAR* pszText, int flags) return TRUE;
}
-static USERINFO* UM_TakeStatus(USERINFO *pUserList, const TCHAR *pszUID, WORD status)
+static USERINFO* UM_TakeStatus(USERINFO *pUserList, const wchar_t *pszUID, WORD status)
{
USERINFO *ui = UM_FindUser(pUserList, pszUID);
if (ui == NULL)
@@ -1060,12 +1060,12 @@ static USERINFO* UM_TakeStatus(USERINFO *pUserList, const TCHAR *pszUID, WORD st return ui;
}
-static TCHAR* UM_FindUserAutoComplete(USERINFO *pUserList, const TCHAR* pszOriginal, const TCHAR* pszCurrent)
+static wchar_t* UM_FindUserAutoComplete(USERINFO *pUserList, const wchar_t* pszOriginal, const wchar_t* pszCurrent)
{
if (!pUserList || !pszOriginal || !pszCurrent)
return NULL;
- TCHAR *pszName = NULL;
+ wchar_t *pszName = NULL;
for (USERINFO *ui = pUserList; ui != NULL; ui = ui->next)
if (ui->pszNick && my_strstri(ui->pszNick, pszOriginal) == ui->pszNick)
if (mir_tstrcmpi(ui->pszNick, pszCurrent) > 0 && (!pszName || mir_tstrcmpi(ui->pszNick, pszName) < 0))
@@ -1074,7 +1074,7 @@ static TCHAR* UM_FindUserAutoComplete(USERINFO *pUserList, const TCHAR* pszOrigi return pszName;
}
-static BOOL UM_RemoveUser(USERINFO **ppUserList, const TCHAR *pszUID)
+static BOOL UM_RemoveUser(USERINFO **ppUserList, const wchar_t *pszUID)
{
if (!ppUserList || !pszUID)
return FALSE;
diff --git a/src/mir_app/src/chat_opts.cpp b/src/mir_app/src/chat_opts.cpp index 238cc43008..0acccfbd2c 100644 --- a/src/mir_app/src/chat_opts.cpp +++ b/src/mir_app/src/chat_opts.cpp @@ -28,7 +28,7 @@ extern SESSION_INFO g_TabSession; GlobalLogSettingsBase *g_Settings;
int g_cbSession, g_cbModuleInfo, g_iFontMode, g_iChatLang;
-TCHAR *g_szFontGroup;
+wchar_t *g_szFontGroup;
#define FONTF_BOLD 1
#define FONTF_ITALIC 2
@@ -47,26 +47,26 @@ static LOGFONT lfDefault; static FontOptionsList fontOptionsList[] =
{
- { LPGENT("Timestamp"), RGB(50, 50, 240), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Others nicknames"), RGB(0, 0, 192), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT("Your nickname"), RGB(0, 0, 192), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT("User has joined"), RGB(90, 160, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("User has left"), RGB(160, 160, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("User has disconnected"), RGB(160, 90, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("User kicked ..."), RGB(100, 100, 100), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("User is now known as ..."), RGB(90, 90, 160), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Notice from user"), RGB(160, 130, 60), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Incoming message"), RGB(90, 90, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Outgoing message"), RGB(90, 90, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("The topic is ..."), RGB(70, 70, 160), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Information messages"), RGB(130, 130, 195), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("User enables status for ..."), RGB(70, 150, 70), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { 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 },
+ { LPGENW("Timestamp"), RGB(50, 50, 240), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Others nicknames"), RGB(0, 0, 192), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW("Your nickname"), RGB(0, 0, 192), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW("User has joined"), RGB(90, 160, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("User has left"), RGB(160, 160, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("User has disconnected"), RGB(160, 90, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("User kicked ..."), RGB(100, 100, 100), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("User is now known as ..."), RGB(90, 90, 160), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Notice from user"), RGB(160, 130, 60), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Incoming message"), RGB(90, 90, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Outgoing message"), RGB(90, 90, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("The topic is ..."), RGB(70, 70, 160), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Information messages"), RGB(130, 130, 195), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("User enables status for ..."), RGB(70, 150, 70), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("User disables status for ..."), RGB(150, 70, 70), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Action message"), RGB(160, 90, 160), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Highlighted message"), RGB(180, 150, 80), 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 }
+ { LPGENW("Nick list members (online)"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Nick list members (away)"), RGB(170, 170, 170), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }
};
static void LoadColors()
@@ -124,7 +124,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour) if (tszFace == NULL)
mir_tstrcpy(lf->lfFaceName, FO.szDefFace);
else
- _tcsncpy_s(lf->lfFaceName, tszFace, _TRUNCATE);
+ wcsncpy_s(lf->lfFaceName, tszFace, _TRUNCATE);
}
}
@@ -136,13 +136,13 @@ void RegisterFonts(void) FontIDT fontid = { sizeof(fontid) };
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID | FIDF_NEEDRESTART;
- _tcsncpy_s(fontid.backgroundGroup, g_szFontGroup, _TRUNCATE);
- _tcsncpy_s(fontid.group, g_szFontGroup, _TRUNCATE);
+ wcsncpy_s(fontid.backgroundGroup, g_szFontGroup, _TRUNCATE);
+ wcsncpy_s(fontid.group, g_szFontGroup, _TRUNCATE);
for (int i = 0; i < _countof(fontOptionsList); i++, index++) {
FontOptionsList &FO = fontOptionsList[i];
strncpy_s(fontid.dbSettingsGroup, CHATFONT_MODULE, _TRUNCATE);
- _tcsncpy_s(fontid.name, FO.szDescr, _TRUNCATE);
+ wcsncpy_s(fontid.name, FO.szDescr, _TRUNCATE);
mir_snprintf(fontid.prefix, "Font%d", index);
fontid.order = index;
@@ -150,28 +150,28 @@ void RegisterFonts(void) switch (i) {
case 18:
case 19:
- _tcsncpy_s(fontid.backgroundName, LPGENT("Nick list background"), _TRUNCATE);
+ wcsncpy_s(fontid.backgroundName, LPGENW("Nick list background"), _TRUNCATE);
break;
case 17:
if (g_iFontMode == FONTMODE_SKIP)
continue;
if (g_iFontMode == FONTMODE_USE) {
- _tcsncpy_s(fontid.name, LPGENT("Message typing area"), _TRUNCATE);
- _tcsncpy_s(fontid.backgroundName, LPGENT("Message background"), _TRUNCATE);
+ wcsncpy_s(fontid.name, LPGENW("Message typing area"), _TRUNCATE);
+ wcsncpy_s(fontid.backgroundName, LPGENW("Message background"), _TRUNCATE);
FO.defColour = RGB(0, 0, 40);
break;
}
- _tcsncpy_s(fontid.name, LPGENT("Chat log symbols (Webdings)"), _TRUNCATE);
+ wcsncpy_s(fontid.name, LPGENW("Chat log symbols (Webdings)"), _TRUNCATE);
FO.szDefFace = L"Webdings";
FO.defColour = RGB(170, 170, 170);
FO.defCharset = SYMBOL_CHARSET;
// fall through
default:
- _tcsncpy_s(fontid.backgroundName, LPGENT("Group chat log background"), _TRUNCATE);
+ wcsncpy_s(fontid.backgroundName, LPGENW("Group chat log background"), _TRUNCATE);
break;
}
- _tcsncpy_s(fontid.deffontsettings.szFace, FO.szDefFace, _TRUNCATE);
+ wcsncpy_s(fontid.deffontsettings.szFace, FO.szDefFace, _TRUNCATE);
fontid.deffontsettings.charset = FO.defCharset;
fontid.deffontsettings.colour = FO.defColour;
fontid.deffontsettings.size = FO.defSize;
@@ -189,7 +189,7 @@ HICON LoadIconEx(char* pszIcoLibName, bool big) return IcoLib_GetIcon(szTemp, big);
}
-static void InitSetting(TCHAR** ppPointer, char* pszSetting, TCHAR* pszDefault)
+static void InitSetting(wchar_t** ppPointer, char* pszSetting, wchar_t* pszDefault)
{
DBVARIANT dbv;
if (!db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv)) {
@@ -292,7 +292,7 @@ void SetIndentSize() else g_Settings->LogTextIndent = 0;
}
-int GetTextPixelSize(TCHAR* pszText, HFONT hFont, BOOL bWidth)
+int GetTextPixelSize(wchar_t* pszText, HFONT hFont, BOOL bWidth)
{
if (!pszText || !hFont)
return 0;
diff --git a/src/mir_app/src/chat_rtf.cpp b/src/mir_app/src/chat_rtf.cpp index d4382834b0..e2cf0addef 100644 --- a/src/mir_app/src/chat_rtf.cpp +++ b/src/mir_app/src/chat_rtf.cpp @@ -28,31 +28,31 @@ 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[] = L" \\\n\r"; +static wchar_t tszRtfBreaks[] = L" \\\n\r"; static void CreateColorMap(CMString &Text, int iCount, COLORREF *pSrc, int *pDst) { - const TCHAR *pszText = Text; + const wchar_t *pszText = Text; int iIndex = 1; - static const TCHAR *lpszFmt = L"\\red%[^ \x5b\\]\\green%[^ \x5b\\]\\blue%[^ \x5b;];"; - TCHAR szRed[10], szGreen[10], szBlue[10]; + static const wchar_t *lpszFmt = L"\\red%[^ \x5b\\]\\green%[^ \x5b\\]\\blue%[^ \x5b;];"; + wchar_t szRed[10], szGreen[10], szBlue[10]; - const TCHAR *p1 = _tcsstr(pszText, L"\\colortbl"); + const wchar_t *p1 = wcsstr(pszText, L"\\colortbl"); if (!p1) return; - const TCHAR *pEnd = _tcschr(p1, '}'); + const wchar_t *pEnd = wcschr(p1, '}'); - const TCHAR *p2 = _tcsstr(p1, L"\\red"); + const wchar_t *p2 = wcsstr(p1, L"\\red"); for (int i = 0; i < iCount; i++) pDst[i] = -1; while (p2 && p2 < pEnd) { - if (_stscanf(p2, lpszFmt, &szRed, &szGreen, &szBlue) > 0) { + if (swscanf(p2, lpszFmt, &szRed, &szGreen, &szBlue) > 0) { for (int i = 0; i < iCount; i++) { - if (pSrc[i] == RGB(_ttoi(szRed), _ttoi(szGreen), _ttoi(szBlue))) + if (pSrc[i] == RGB(_wtoi(szRed), _wtoi(szGreen), _wtoi(szBlue))) pDst[i] = iIndex; } } @@ -60,7 +60,7 @@ static void CreateColorMap(CMString &Text, int iCount, COLORREF *pSrc, int *pDst p1 = p2; p1++; - p2 = _tcsstr(p1, L"\\red"); + p2 = wcsstr(p1, L"\\red"); } } @@ -96,7 +96,7 @@ int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors) CMString res; // iterate through all characters, if rtf control character found then take action - for (const TCHAR *p = pszText.GetString() + idx; *p;) { + for (const wchar_t *p = pszText.GetString() + idx; *p;) { switch (*p) { case '\\': if (p[1] == '\\' || p[1] == '{' || p[1] == '}') { // escaped characters @@ -108,79 +108,79 @@ int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors) p += 2; break; } - if (!_tcsncmp(p, L"\\cf", 3)) { // foreground color - int iCol = _ttoi(p + 3); + if (!wcsncmp(p, L"\\cf", 3)) { // foreground color + int iCol = _wtoi(p + 3); int iInd = GetRtfIndex(iCol, iNumColors, pIndex); bInsideColor = iInd > 0; } - else if (!_tcsncmp(p, L"\\highlight", 10)) { //background color - TCHAR szTemp[20]; - int iCol = _ttoi(p + 10); + else if (!wcsncmp(p, L"\\highlight", 10)) { //background color + wchar_t szTemp[20]; + int iCol = _wtoi(p + 10); mir_sntprintf(szTemp, L"%d", iCol); } - else if (!_tcsncmp(p, L"\\line", 5)) { // soft line break; + else if (!wcsncmp(p, L"\\line", 5)) { // soft line break; res.AppendChar('\n'); } - else if (!_tcsncmp(p, L"\\endash", 7)) { + else if (!wcsncmp(p, L"\\endash", 7)) { res.AppendChar(0x2013); } - else if (!_tcsncmp(p, L"\\emdash", 7)) { + else if (!wcsncmp(p, L"\\emdash", 7)) { res.AppendChar(0x2014); } - else if (!_tcsncmp(p, L"\\bullet", 7)) { + else if (!wcsncmp(p, L"\\bullet", 7)) { res.AppendChar(0x2022); } - else if (!_tcsncmp(p, L"\\ldblquote", 10)) { + else if (!wcsncmp(p, L"\\ldblquote", 10)) { res.AppendChar(0x201C); } - else if (!_tcsncmp(p, L"\\rdblquote", 10)) { + else if (!wcsncmp(p, L"\\rdblquote", 10)) { res.AppendChar(0x201D); } - else if (!_tcsncmp(p, L"\\lquote", 7)) { + else if (!wcsncmp(p, L"\\lquote", 7)) { res.AppendChar(0x2018); } - else if (!_tcsncmp(p, L"\\rquote", 7)) { + else if (!wcsncmp(p, L"\\rquote", 7)) { res.AppendChar(0x2019); } - else if (!_tcsncmp(p, L"\\b", 2)) { //bold + else if (!wcsncmp(p, L"\\b", 2)) { //bold res.Append((p[2] != '0') ? L"[b]" : L"[/b]"); } - else if (!_tcsncmp(p, L"\\i", 2)) { // italics + else if (!wcsncmp(p, L"\\i", 2)) { // italics res.Append((p[2] != '0') ? L"[i]" : L"[/i]"); } - else if (!_tcsncmp(p, L"\\strike", 7)) { // strike-out + else if (!wcsncmp(p, L"\\strike", 7)) { // strike-out res.Append((p[7] != '0') ? L"[s]" : L"[/s]"); } - else if (!_tcsncmp(p, L"\\ul", 3)) { // underlined - if (p[3] == 0 || _tcschr(tszRtfBreaks, p[3])) { + else if (!wcsncmp(p, L"\\ul", 3)) { // underlined + if (p[3] == 0 || wcschr(tszRtfBreaks, p[3])) { res.Append(L"[u]"); bInsideUl = true; } - else if (!_tcsnccmp(p + 3, L"none", 4)) { + else if (!wcsncmp(p + 3, L"none", 4)) { if (bInsideUl) res.Append(L"[/u]"); bInsideUl = false; } } - else if (!_tcsncmp(p, L"\\tab", 4)) { // tab + else if (!wcsncmp(p, L"\\tab", 4)) { // tab res.AppendChar('\t'); } else if (p[1] == '\'') { // special character if (p[2] != ' ' && p[2] != '\\') { - TCHAR tmp[10], *t = tmp; + wchar_t tmp[10], *t = tmp; *t++ = p[2]; if (p[3] != ' ' && p[3] != '\\') *t++ = p[3]; *t = 0; // convert string containing char in hex format to int. - TCHAR *stoppedHere; - res.AppendChar(_tcstol(tmp, &stoppedHere, 16)); + wchar_t *stoppedHere; + res.AppendChar(wcstol(tmp, &stoppedHere, 16)); } } p++; // skip initial slash - p += _tcscspn(p, tszRtfBreaks); + p += wcscspn(p, tszRtfBreaks); if (*p == ' ') p++; break; diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp index 3d50d2c559..6a00cde117 100644 --- a/src/mir_app/src/chat_svc.cpp +++ b/src/mir_app/src/chat_svc.cpp @@ -248,11 +248,11 @@ static INT_PTR Service_NewChat(WPARAM, LPARAM lParam) si->bBGSet = TRUE;
}
- TCHAR szTemp[256];
+ wchar_t szTemp[256];
if (si->iType == GCW_SERVER)
mir_sntprintf(szTemp, L"Server: %s", si->ptszName);
else
- _tcsncpy_s(szTemp, si->ptszName, _TRUNCATE);
+ wcsncpy_s(szTemp, si->ptszName, _TRUNCATE);
si->hContact = chatApi.AddRoom(gcw->pszModule, gcw->ptszID, szTemp, si->iType);
db_set_s(si->hContact, si->pszModule, "Topic", "");
db_unset(si->hContact, "CList", "StatusMsg");
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index 4f822f1779..3e18186f85 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -36,14 +36,14 @@ int GetRichTextLength(HWND hwnd) /////////////////////////////////////////////////////////////////////////////////////////
-TCHAR* RemoveFormatting(const TCHAR *pszWord)
+wchar_t* RemoveFormatting(const wchar_t *pszWord)
{
- static TCHAR szTemp[10000];
+ static wchar_t szTemp[10000];
if (pszWord == NULL)
return NULL;
- TCHAR *d = szTemp;
+ wchar_t *d = szTemp;
size_t cbLen = mir_tstrlen(pszWord);
if (cbLen > _countof(szTemp))
cbLen = _countof(szTemp)-1;
@@ -163,9 +163,9 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA return DefWindowProc(hWnd, message, wParam, lParam);
}
-int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char *pszProtoName, TCHAR*, COLORREF crBkg, const TCHAR *fmt, ...)
+int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char *pszProtoName, wchar_t*, COLORREF crBkg, const wchar_t *fmt, ...)
{
- static TCHAR szBuf[4 * 1024];
+ static wchar_t szBuf[4 * 1024];
if (!fmt || fmt[0] == 0 || mir_tstrlen(fmt) > 2000)
return 0;
@@ -400,18 +400,18 @@ void CheckColorsInModule(const char *pszModule) }
}
-const TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2)
+const wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2)
{
int i, j, k;
for (i = 0; s1[i]; i++)
- for (j = i, k = 0; _totlower(s1[j]) == _totlower(s2[k]); j++, k++)
+ for (j = i, k = 0; towlower(s1[j]) == towlower(s2[k]); j++, k++)
if (!s2[k + 1])
return s1 + i;
return NULL;
}
-static TCHAR szTrimString[] = L":,.!?;\'>)";
+static wchar_t szTrimString[] = L":,.!?;\'>)";
BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce)
{
@@ -421,7 +421,7 @@ BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce) if (gce->ptszText == NULL)
return FALSE;
- TCHAR *buf = RemoveFormatting(NEWTSTR_ALLOCA(gce->ptszText));
+ wchar_t *buf = RemoveFormatting(NEWWSTR_ALLOCA(gce->ptszText));
int iStart = 0;
CMString tszHighlightWords(g_Settings->pszHighlightWords);
@@ -439,7 +439,7 @@ BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce) tszToken = '*' + tszToken + '*';
// time to get the next/first word in the incoming text string
- for (const TCHAR *p = buf; *p != '\0'; p += _tcscspn(p, L" ")) {
+ for (const wchar_t *p = buf; *p != '\0'; p += wcscspn(p, L" ")) {
p += _tcsspn(p, L" ");
// compare the words, using wildcards
@@ -453,29 +453,29 @@ BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce) BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
{
- TCHAR szBuffer[4096];
- TCHAR szLine[4096];
- TCHAR p = '\0';
+ wchar_t szBuffer[4096];
+ wchar_t szLine[4096];
+ wchar_t p = '\0';
szBuffer[0] = '\0';
GetChatLogsFilename(si, gce->time);
BOOL bFileJustCreated = !PathFileExists(si->pszLogFileName);
- TCHAR tszFolder[MAX_PATH];
- _tcsncpy_s(tszFolder, si->pszLogFileName, _TRUNCATE);
+ wchar_t tszFolder[MAX_PATH];
+ wcsncpy_s(tszFolder, si->pszLogFileName, _TRUNCATE);
PathRemoveFileSpec(tszFolder);
if (!PathIsDirectory(tszFolder))
CreateDirectoryTreeT(tszFolder);
- TCHAR szTime[100];
+ wchar_t szTime[100];
mir_tstrncpy(szTime, chatApi.MakeTimeStamp(g_Settings->pszTimeStampLog, gce->time), 99);
- FILE *hFile = _tfopen(si->pszLogFileName, L"ab+");
+ FILE *hFile = _wfopen(si->pszLogFileName, L"ab+");
if (hFile == NULL)
return FALSE;
- TCHAR szTemp[512], szTemp2[512];
- TCHAR* pszNick = NULL;
+ wchar_t szTemp[512], szTemp2[512];
+ wchar_t* pszNick = NULL;
if (bFileJustCreated)
fputws((const wchar_t*)"\377\376", hFile); //UTF-16 LE BOM == FF FE
if (gce->ptszNick) {
@@ -488,7 +488,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) if (gce->ptszUserInfo)
mir_sntprintf(szTemp, L"%s (%s)", szTemp2, gce->ptszUserInfo);
else
- _tcsncpy_s(szTemp, szTemp2, _TRUNCATE);
+ wcsncpy_s(szTemp, szTemp2, _TRUNCATE);
pszNick = szTemp;
}
@@ -545,7 +545,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) break;
case GC_EVENT_INFORMATION:
p = '!';
- _tcsncpy_s(szBuffer, chatApi.RemoveFormatting(gce->ptszText), _TRUNCATE);
+ wcsncpy_s(szBuffer, chatApi.RemoveFormatting(gce->ptszText), _TRUNCATE);
break;
case GC_EVENT_ADDSTATUS:
p = '+';
@@ -565,7 +565,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) mir_sntprintf(szLine, L"%s %s\r\n", szTime, szBuffer);
if (szLine[0]) {
- _fputts(szLine, hFile);
+ fputws(szLine, hFile);
if (g_Settings->LoggingLimit > 0) {
fseek(hFile, 0, SEEK_END);
@@ -576,21 +576,21 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) if (dwSize > trimlimit) {
time_t now = time(0);
- TCHAR tszTimestamp[20];
- _tcsftime(tszTimestamp, 20, L"%Y%m%d-%H%M%S", _localtime32((__time32_t *)&now));
+ wchar_t tszTimestamp[20];
+ wcsftime(tszTimestamp, 20, L"%Y%m%d-%H%M%S", _localtime32((__time32_t *)&now));
tszTimestamp[19] = 0;
// max size reached, rotate the log
// move old logs to /archived sub folder just inside the log root folder.
// add a time stamp to the file name.
- TCHAR tszDrive[_MAX_DRIVE], tszDir[_MAX_DIR], tszName[_MAX_FNAME], tszExt[_MAX_EXT];
- _tsplitpath(si->pszLogFileName, tszDrive, tszDir, tszName, tszExt);
+ wchar_t tszDrive[_MAX_DRIVE], tszDir[_MAX_DIR], tszName[_MAX_FNAME], tszExt[_MAX_EXT];
+ _wsplitpath(si->pszLogFileName, tszDrive, tszDir, tszName, tszExt);
- TCHAR tszNewPath[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
+ wchar_t tszNewPath[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
mir_sntprintf(tszNewPath, L"%s%sarchived\\", tszDrive, tszDir);
CreateDirectoryTreeT(tszNewPath);
- TCHAR tszNewName[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
+ wchar_t tszNewName[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
mir_sntprintf(tszNewName, L"%s%s-%s%s", tszNewPath, tszName, tszTimestamp, tszExt);
fclose(hFile);
hFile = 0;
@@ -606,7 +606,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) return TRUE;
}
-BOOL DoEventHookAsync(HWND hwnd, const TCHAR *pszID, const char *pszModule, int iType, const TCHAR* pszUID, const TCHAR* pszText, INT_PTR dwItem)
+BOOL DoEventHookAsync(HWND hwnd, const wchar_t *pszID, const char *pszModule, int iType, const wchar_t* pszUID, const wchar_t* pszText, INT_PTR dwItem)
{
SESSION_INFO *si = chatApi.SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -626,7 +626,7 @@ BOOL DoEventHookAsync(HWND hwnd, const TCHAR *pszID, const char *pszModule, int return TRUE;
}
-BOOL DoEventHook(const TCHAR *pszID, const char *pszModule, int iType, const TCHAR *pszUID, const TCHAR* pszText, INT_PTR dwItem)
+BOOL DoEventHook(const wchar_t *pszID, const char *pszModule, int iType, const wchar_t *pszUID, const wchar_t* pszText, INT_PTR dwItem)
{
SESSION_INFO *si = chatApi.SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -676,75 +676,75 @@ BOOL IsEventSupported(int eventType) return FALSE;
}
-void ValidateFilename(TCHAR *filename)
+void ValidateFilename(wchar_t *filename)
{
- TCHAR *p1 = filename;
- TCHAR szForbidden[] = L"\\/:*?\"<>|";
+ wchar_t *p1 = filename;
+ wchar_t szForbidden[] = L"\\/:*?\"<>|";
while (*p1 != '\0') {
- if (_tcschr(szForbidden, *p1))
+ if (wcschr(szForbidden, *p1))
*p1 = '_';
p1 += 1;
}
}
-static TCHAR tszOldTimeStamp[30];
+static wchar_t tszOldTimeStamp[30];
-TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime)
+wchar_t* GetChatLogsFilename(SESSION_INFO *si, time_t tTime)
{
if (!tTime)
time(&tTime);
// check whether relevant parts of the timestamp have changed and
// we have to reparse the filename
- TCHAR *tszNow = chatApi.MakeTimeStamp(L"%a%d%m%Y", tTime); // once a day
+ wchar_t *tszNow = chatApi.MakeTimeStamp(L"%a%d%m%Y", tTime); // once a day
if (mir_tstrcmp(tszOldTimeStamp, tszNow)) {
- _tcsncpy_s(tszOldTimeStamp, tszNow, _TRUNCATE);
+ wcsncpy_s(tszOldTimeStamp, tszNow, _TRUNCATE);
*si->pszLogFileName = 0;
}
if (si->pszLogFileName[0] == 0) {
REPLACEVARSARRAY rva[11];
- rva[0].key.t = L"d";
- rva[0].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%#d", tTime));
+ rva[0].key.w = L"d";
+ rva[0].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%#d", tTime));
// day 01-31
- rva[1].key.t = L"dd";
- rva[1].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%d", tTime));
+ rva[1].key.w = L"dd";
+ rva[1].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%d", tTime));
// month 1-12
- rva[2].key.t = L"m";
- rva[2].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%#m", tTime));
+ rva[2].key.w = L"m";
+ rva[2].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%#m", tTime));
// month 01-12
- rva[3].key.t = L"mm";
- rva[3].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%m", tTime));
+ rva[3].key.w = L"mm";
+ rva[3].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%m", tTime));
// month text short
- rva[4].key.t = L"mon";
- rva[4].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%b", tTime));
+ rva[4].key.w = L"mon";
+ rva[4].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%b", tTime));
// month text
- rva[5].key.t = L"month";
- rva[5].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%B", tTime));
+ rva[5].key.w = L"month";
+ rva[5].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%B", tTime));
// year 01-99
- rva[6].key.t = L"yy";
- rva[6].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%y", tTime));
+ rva[6].key.w = L"yy";
+ rva[6].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%y", tTime));
// year 1901-9999
- rva[7].key.t = L"yyyy";
- rva[7].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%Y", tTime));
+ rva[7].key.w = L"yyyy";
+ rva[7].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%Y", tTime));
// weekday short
- rva[8].key.t = L"wday";
- rva[8].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%a", tTime));
+ rva[8].key.w = L"wday";
+ rva[8].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%a", tTime));
// weekday
- rva[9].key.t = L"weekday";
- rva[9].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%A", tTime));
+ rva[9].key.w = L"weekday";
+ rva[9].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%A", tTime));
// end of array
- rva[10].key.t = NULL;
- rva[10].value.t = NULL;
+ rva[10].key.w = NULL;
+ rva[10].value.w = NULL;
- TCHAR tszTemp[MAX_PATH], *ptszVarPath;
+ wchar_t tszTemp[MAX_PATH], *ptszVarPath;
if (g_Settings->pszLogDir[mir_tstrlen(g_Settings->pszLogDir) - 1] == '\\') {
mir_sntprintf(tszTemp, L"%s%s", g_Settings->pszLogDir, L"%userid%.log");
ptszVarPath = tszTemp;
}
else ptszVarPath = g_Settings->pszLogDir;
- TCHAR *tszParsedName = Utils_ReplaceVarsT(ptszVarPath, si->hContact, rva);
+ wchar_t *tszParsedName = Utils_ReplaceVarsT(ptszVarPath, si->hContact, rva);
if (chatApi.OnGetLogName)
chatApi.OnGetLogName(si, tszParsedName);
else
@@ -752,11 +752,11 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime) mir_free(tszParsedName);
for (int i = 0; i < _countof(rva); i++)
- mir_free(rva[i].value.t);
+ mir_free(rva[i].value.w);
- for (TCHAR *p = si->pszLogFileName + 2; *p; ++p)
+ for (wchar_t *p = si->pszLogFileName + 2; *p; ++p)
if (*p == ':' || *p == '*' || *p == '?' || *p == '"' || *p == '<' || *p == '>' || *p == '|')
- *p = _T('_');
+ *p = '_';
}
return si->pszLogFileName;
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index e4ef46e543..dbc1974660 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -781,8 +781,8 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)& nm);
}
else {
- TCHAR szNew[2];
- szNew[0] = (TCHAR)wParam;
+ wchar_t szNew[2];
+ szNew[0] = (wchar_t)wParam;
szNew[1] = '\0';
if (mir_tstrlen(dat->szQuickSearch) >= _countof(dat->szQuickSearch) - 1) {
MessageBeep(MB_OK);
@@ -1110,7 +1110,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (contacto->type == CLCIT_CONTACT) //dropee is a contact
CallService(MS_CLIST_CONTACTCHANGEGROUP, (WPARAM)contacto->hContact, contactn->groupId);
else if (contacto->type == CLCIT_GROUP) { //dropee is a group
- TCHAR szNewName[120];
+ wchar_t szNewName[120];
mir_sntprintf(szNewName, L"%s\\%s", Clist_GroupGetName(contactn->groupId, NULL), contacto->szText);
Clist_GroupRename(contacto->groupId, szNewName);
}
@@ -1149,7 +1149,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (!group->parent)
break;
if (contact->type == CLCIT_GROUP) { //dropee is a group
- TCHAR szNewName[120];
+ wchar_t szNewName[120];
mir_tstrncpy(szNewName, contact->szText, _countof(szNewName));
Clist_GroupRename(contact->groupId, szNewName);
}
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h index 4695cd9b58..3783f8ba2f 100644 --- a/src/mir_app/src/clc.h +++ b/src/mir_app/src/clc.h @@ -50,10 +50,10 @@ int fnFindItem(HWND hwnd, struct ClcData *dat, DWORD dwItem, ClcContact **contac int fnGetRowByIndex(struct ClcData *dat, int testindex, ClcContact **contact, ClcGroup **subgroup);
/* clcitems.c */
-ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
+ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const wchar_t *szName, DWORD flags, int groupId, int calcTotalMembers);
ClcGroup* fnRemoveItemFromGroup(HWND hwnd, ClcGroup *group, ClcContact *contact, int updateTotalCount);
-ClcContact* fnAddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText);
+ClcContact* fnAddInfoItemToGroup(ClcGroup *group, int flags, const wchar_t *pszText);
ClcContact* fnAddItemToGroup(ClcGroup *group, int iAboveItem);
ClcContact* fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact);
@@ -72,14 +72,14 @@ int fnGetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat); LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
/* clcutils.c */
-TCHAR* fnGetGroupCountsText(struct ClcData *dat, ClcContact *contact);
+wchar_t* fnGetGroupCountsText(struct ClcData *dat, ClcContact *contact);
int fnHitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **contact, ClcGroup **group, DWORD * flags);
void fnScrollTo(HWND hwnd, struct ClcData *dat, int desty, int noSmooth);
void fnEnsureVisible(HWND hwnd, struct ClcData *dat, int iItem, int partialOk);
void fnRecalcScrollBar(HWND hwnd, struct ClcData *dat);
void fnSetGroupExpand(HWND hwnd, struct ClcData *dat, ClcGroup *group, int newState);
void fnDoSelectionDefaultAction(HWND hwnd, struct ClcData *dat);
-int fnFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefixOk);
+int fnFindRowByText(HWND hwnd, struct ClcData *dat, const wchar_t *text, int prefixOk);
void fnEndRename(HWND hwnd, struct ClcData *dat, int save);
void fnDeleteFromContactList(HWND hwnd, struct ClcData *dat);
void fnBeginRenameSelection(HWND hwnd, struct ClcData *dat);
@@ -122,7 +122,7 @@ void RebuildMenuOrder(void); INT_PTR MenuProcessCommand(WPARAM wParam, LPARAM lParam);
/* clistsettings.c */
-TCHAR* fnGetContactDisplayName(MCONTACT hContact, int mode);
+wchar_t* fnGetContactDisplayName(MCONTACT hContact, int mode);
void fnGetDefaultFontSetting(int i, LOGFONT* lf, COLORREF * colour);
void fnInvalidateDisplayNameCacheEntry(MCONTACT hContact);
@@ -151,7 +151,7 @@ int fnGetContactIcon(MCONTACT hContact); int fnIconFromStatusMode(const char *szProto, int status, MCONTACT hContact);
int fnShowHide(WPARAM wParam, LPARAM lParam);
HICON fnGetIconFromStatusMode(MCONTACT hContact, const char *szProto, int status);
-TCHAR* fnGetStatusModeDescription(int wParam, int lParam);
+wchar_t* fnGetStatusModeDescription(int wParam, int lParam);
int fnGetWindowVisibleState(HWND hWnd, int iStepX, int iStepY);
/* clisttray.c */
@@ -164,17 +164,17 @@ int fnTrayIconAdd(HWND hwnd, const char *szProto, const char *szIconProto, in int fnTrayIconDestroy(HWND hwnd);
void fnTrayIconIconsChanged(void);
int fnTrayIconInit(HWND hwnd);
-TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto);
+wchar_t* fnTrayIconMakeTooltip(const wchar_t *szPrefix, const char *szProto);
int fnTrayIconPauseAutoHide(WPARAM wParam, LPARAM lParam);
INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam);
void fnTrayIconRemove(HWND hwnd, const char *szProto);
int fnTrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto);
void fnTrayIconSetToBase(char *szPreferredProto);
void fnTrayIconTaskbarCreated(HWND hwnd);
-int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPreferredProto, int isBase);
+int fnTrayIconUpdate(HICON hNewIcon, const wchar_t *szNewTip, const char *szPreferredProto, int isBase);
void fnTrayIconUpdateBase(const char *szChangedProto);
int fnTrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCount);
-void fnTrayIconUpdateWithImageList(int iImage, const TCHAR *szNewTip, char *szPreferredProto);
+void fnTrayIconUpdateWithImageList(int iImage, const wchar_t *szNewTip, char *szPreferredProto);
VOID CALLBACK fnTrayCycleTimerProc(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime);
diff --git a/src/mir_app/src/clcfiledrop.cpp b/src/mir_app/src/clcfiledrop.cpp index 382512016c..8739ae5b86 100644 --- a/src/mir_app/src/clcfiledrop.cpp +++ b/src/mir_app/src/clcfiledrop.cpp @@ -140,14 +140,14 @@ HRESULT CDropTarget::DragOver(DWORD /*grfKeyState*/, POINTL pt, DWORD * pdwEffec HRESULT CDropTarget::DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
{
HWND hwnd;
- TCHAR szWindowClass[64];
+ wchar_t szWindowClass[64];
POINT shortPt;
shortPt.x = pt.x;
shortPt.y = pt.y;
hwnd = WindowFromPoint(shortPt);
GetClassName(hwnd, szWindowClass, _countof(szWindowClass));
- if (!mir_tstrcmp(szWindowClass, _T(CLISTCONTROL_CLASS))) {
+ if (!mir_tstrcmp(szWindowClass, CLISTCONTROL_CLASSW)) {
hwndCurrentDrag = hwnd;
ClcData *dat = (ClcData *) GetWindowLongPtr(hwndCurrentDrag, 0);
originalSelection = dat->selection;
@@ -172,15 +172,15 @@ HRESULT CDropTarget::DragLeave(void) return S_OK;
}
-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;
HANDLE hFind;
- TCHAR szPath[MAX_PATH];
+ wchar_t szPath[MAX_PATH];
mir_tstrcpy(szPath, szFilename);
mir_tstrcat(szPath, L"\\*");
if (hFind = FindFirstFile(szPath, &fd)) {
@@ -218,8 +218,8 @@ HRESULT CDropTarget::Drop(IDataObject * pDataObj, DWORD /*fKeyState*/, POINTL pt ScreenToClient(hwndCurrentDrag, &shortPt);
MCONTACT hContact = HContactFromPoint(hwndCurrentDrag, dat, shortPt.x, shortPt.y, NULL);
if (hContact != NULL) {
- TCHAR **ppFiles = NULL;
- TCHAR szFilename[MAX_PATH];
+ wchar_t **ppFiles = NULL;
+ wchar_t szFilename[MAX_PATH];
int fileCount, totalCount = 0, i;
fileCount = DragQueryFile(hDrop, -1, NULL, 0);
diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp index c53da45fbe..f21811c4f6 100644 --- a/src/mir_app/src/clcitems.cpp +++ b/src/mir_app/src/clcitems.cpp @@ -38,16 +38,16 @@ ClcContact* fnAddItemToGroup(ClcGroup *group, int iAboveItem) return newItem; } -ClcGroup* fnAddGroup(HWND hwnd, ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers) +ClcGroup* fnAddGroup(HWND hwnd, ClcData *dat, const wchar_t *szName, DWORD flags, int groupId, int calcTotalMembers) { dat->bNeedsResort = true; if (!(GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_USEGROUPS)) return &dat->list; ClcGroup *group = &dat->list; - TCHAR *pNextField = NEWTSTR_ALLOCA(szName); + wchar_t *pNextField = NEWWSTR_ALLOCA(szName); do { - TCHAR *pBackslash = _tcschr(pNextField, '\\'), *pThisField = pNextField; + wchar_t *pBackslash = wcschr(pNextField, '\\'), *pThisField = pNextField; if (pBackslash == NULL) { pNextField = NULL; } @@ -137,7 +137,7 @@ void fnFreeGroup(ClcGroup *group) } static int iInfoItemUniqueHandle = 0; -ClcContact* fnAddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText) +ClcContact* fnAddInfoItemToGroup(ClcGroup *group, int flags, const wchar_t *pszText) { int i = 0; @@ -235,7 +235,7 @@ void fnAddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTo if (checkHideOffline && cli.pfnIsHiddenMode(dat, status)) { for (i = 1;; i++) { - TCHAR *szGroupName = Clist_GroupGetName(i, &groupFlags); + wchar_t *szGroupName = Clist_GroupGetName(i, &groupFlags); if (szGroupName == NULL) return; @@ -246,7 +246,7 @@ void fnAddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTo return; } for (i = 1;; i++) { - TCHAR *szGroupName = Clist_GroupGetName(i, &groupFlags); + wchar_t *szGroupName = Clist_GroupGetName(i, &groupFlags); if (szGroupName == NULL) return; @@ -254,7 +254,7 @@ void fnAddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTo break; size_t len = mir_tstrlen(szGroupName); - if (!_tcsncmp(szGroupName, tszGroup, len) && tszGroup[len] == '\\') + if (!wcsncmp(szGroupName, tszGroup, len) && tszGroup[len] == '\\') cli.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 1); } group = cli.pfnAddGroup(hwnd, dat, tszGroup, groupFlags, i, 1); @@ -323,7 +323,7 @@ void fnDeleteItemFromTree(HWND hwnd, MCONTACT hItem) ClcContact *cc = group->cl[i]; if (cc->type == CLCIT_GROUP) { size_t len = mir_tstrlen(cc->szText); - if (!_tcsncmp(cc->szText, dbv.ptszVal + nameOffset, len) && + if (!wcsncmp(cc->szText, dbv.ptszVal + nameOffset, len) && (dbv.ptszVal[nameOffset + len] == '\\' || dbv.ptszVal[nameOffset + len] == '\0')) { group->totalMembers--; if (dbv.ptszVal[nameOffset + len] == '\0') @@ -336,10 +336,10 @@ void fnDeleteItemFromTree(HWND hwnd, MCONTACT hItem) else cli.pfnRemoveItemFromGroup(hwnd, group, contact, 1); } -int fnGetContactHiddenStatus(MCONTACT hContact, char*, ClcData*)
-{
- return db_get_b(hContact, "CList", "Hidden", 0);
-}
+int fnGetContactHiddenStatus(MCONTACT hContact, char*, ClcData*) +{ + return db_get_b(hContact, "CList", "Hidden", 0); +} void fnRebuildEntireList(HWND hwnd, ClcData *dat) { @@ -353,7 +353,7 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat) for (int i = 1;; i++) { DWORD groupFlags; - TCHAR *szGroupName = Clist_GroupGetName(i, &groupFlags); + wchar_t *szGroupName = Clist_GroupGetName(i, &groupFlags); if (szGroupName == NULL) break; cli.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 0); @@ -378,11 +378,11 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat) group->totalMembers++; if (dat->bFilterSearch && dat->szQuickSearch[0] != '\0') { - TCHAR *name = cli.pfnGetContactDisplayName(hContact, 0); - TCHAR *lowered_name = CharLowerW(NEWTSTR_ALLOCA(name)); - TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch)); + wchar_t *name = cli.pfnGetContactDisplayName(hContact, 0); + wchar_t *lowered_name = CharLowerW(NEWWSTR_ALLOCA(name)); + wchar_t *lowered_search = CharLowerW(NEWWSTR_ALLOCA(dat->szQuickSearch)); - if (_tcsstr(lowered_name, lowered_search)) + if (wcsstr(lowered_name, lowered_search)) cli.pfnAddContactToGroup(dat, group, hContact); } else if (!(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) { diff --git a/src/mir_app/src/clcmsgs.cpp b/src/mir_app/src/clcmsgs.cpp index bd9bd1a4b7..8859699db4 100644 --- a/src/mir_app/src/clcmsgs.cpp +++ b/src/mir_app/src/clcmsgs.cpp @@ -43,7 +43,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar case CLM_ADDGROUP:
{
DWORD groupFlags;
- TCHAR *szName = Clist_GroupGetName(wParam, &groupFlags);
+ wchar_t *szName = Clist_GroupGetName(wParam, &groupFlags);
if (szName == NULL)
break;
cli.pfnAddGroup(hwnd, dat, szName, groupFlags, wParam, 0);
@@ -171,13 +171,13 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar return dat->groupIndent;
case CLM_GETISEARCHSTRING:
- mir_tstrcpy((TCHAR*)lParam, dat->szQuickSearch);
+ mir_tstrcpy((wchar_t*)lParam, dat->szQuickSearch);
return mir_tstrlen(dat->szQuickSearch);
case CLM_GETITEMTEXT:
if (!cli.pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
return 0;
- mir_tstrcpy((TCHAR*)lParam, contact->szText);
+ mir_tstrcpy((wchar_t*)lParam, contact->szText);
return mir_tstrlen(contact->szText);
case CLM_GETITEMTYPE:
@@ -398,7 +398,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar case CLM_SETITEMTEXT:
if (!cli.pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
break;
- mir_tstrncpy(contact->szText, (TCHAR*)lParam, _countof(contact->szText));
+ mir_tstrncpy(contact->szText, (wchar_t*)lParam, _countof(contact->szText));
cli.pfnSortCLC(hwnd, dat, 1);
cli.pfnInvalidateRect(hwnd, NULL, FALSE);
break;
diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp index fdeae935e2..a01f99e3d0 100644 --- a/src/mir_app/src/clcutils.cpp +++ b/src/mir_app/src/clcutils.cpp @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern HANDLE hHideInfoTipEvent;
-TCHAR* fnGetGroupCountsText(ClcData *dat, ClcContact *contact)
+wchar_t* fnGetGroupCountsText(ClcData *dat, ClcContact *contact)
{
if (contact->type != CLCIT_GROUP || !(dat->exStyle & CLS_EX_SHOWGROUPCOUNTS))
return L"";
@@ -62,7 +62,7 @@ TCHAR* fnGetGroupCountsText(ClcData *dat, ClcContact *contact) if (onlineCount == 0 && dat->exStyle & CLS_EX_HIDECOUNTSWHENEMPTY)
return L"";
- static TCHAR szName[32];
+ static wchar_t szName[32];
mir_sntprintf(szName, L"(%u/%u)", onlineCount, totalCount);
return szName;
}
@@ -171,7 +171,7 @@ int fnHitTest(HWND hwnd, ClcData *dat, int testx, int testy, ClcContact **contac GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_tstrlen(hitcontact->szText), &textSize);
int width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
- TCHAR *szCounts;
+ wchar_t *szCounts;
szCounts = cli.pfnGetGroupCountsText(dat, hitcontact);
if (szCounts[0]) {
GetTextExtentPoint32(hdc, L" ", 1, &textSize);
@@ -360,7 +360,7 @@ void fnDoSelectionDefaultAction(HWND hwnd, ClcData *dat) CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM)contact->hContact, 0);
}
-int fnFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk)
+int fnFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk)
{
ClcGroup *group = &dat->list;
size_t testlen = mir_tstrlen(text);
@@ -378,11 +378,11 @@ int fnFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk) if (cc->type != CLCIT_DIVIDER) {
bool show;
if (dat->bFilterSearch) {
- TCHAR *lowered_szText = CharLowerW(NEWTSTR_ALLOCA(cc->szText));
- TCHAR *lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
- show = _tcsstr(lowered_szText, lowered_text) != NULL;
+ wchar_t *lowered_szText = CharLowerW(NEWWSTR_ALLOCA(cc->szText));
+ wchar_t *lowered_text = CharLowerW(NEWWSTR_ALLOCA(text));
+ show = wcsstr(lowered_szText, lowered_text) != NULL;
}
- else show = ((prefixOk && !_tcsnicmp(text, cc->szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, cc->szText)));
+ else show = ((prefixOk && !wcsnicmp(text, cc->szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, cc->szText)));
if (show) {
ClcGroup *contactGroup = group;
@@ -412,15 +412,15 @@ void fnEndRename(HWND, ClcData *dat, int save) dat->hwndRenameEdit = NULL;
if (save) {
- TCHAR text[120]; text[0] = 0;
+ wchar_t text[120]; text[0] = 0;
GetWindowText(hwndEdit, text, _countof(text));
ClcContact *contact;
if (cli.pfnGetRowByIndex(dat, dat->selection, &contact, NULL) != -1) {
- if (mir_tstrcmp(contact->szText, text) && !_tcsstr(text, L"\\")) {
+ if (mir_tstrcmp(contact->szText, text) && !wcsstr(text, L"\\")) {
if (contact->type == CLCIT_GROUP) {
if (contact->group->parent && contact->group->parent->parent) {
- TCHAR szFullName[256];
+ wchar_t szFullName[256];
mir_sntprintf(szFullName, L"%s\\%s",
Clist_GroupGetName(contact->group->parent->groupId, NULL), text);
Clist_GroupRename(contact->groupId, szFullName);
@@ -430,7 +430,7 @@ void fnEndRename(HWND, ClcData *dat, int save) }
else if (contact->type == CLCIT_CONTACT) {
cli.pfnInvalidateDisplayNameCacheEntry(contact->hContact);
- TCHAR* otherName = cli.pfnGetContactDisplayName(contact->hContact, GCDNF_NOMYHANDLE);
+ wchar_t* otherName = cli.pfnGetContactDisplayName(contact->hContact, GCDNF_NOMYHANDLE);
if (!text[0] || !mir_tstrcmp(otherName, text))
db_unset(contact->hContact, "CList", "MyHandle");
else
diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp index 9d9607e7c8..ed68859386 100644 --- a/src/mir_app/src/clistcore.cpp +++ b/src/mir_app/src/clistcore.cpp @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. CLIST_INTERFACE cli = { 0 };
-static TCHAR szTip[MAX_TIP_SIZE+1];
+static wchar_t szTip[MAX_TIP_SIZE+1];
int LoadContactListModule2(void);
int LoadCLCModule(void);
diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp index 720c4d0001..2a5e5194ca 100644 --- a/src/mir_app/src/clistgroups.cpp +++ b/src/mir_app/src/clistgroups.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CGroupInternal
{
- CGroupInternal(int _id, const TCHAR *_name) :
+ CGroupInternal(int _id, const wchar_t *_name) :
groupId(_id),
groupName(mir_tstrdup(_name))
{}
@@ -37,7 +37,7 @@ struct CGroupInternal }
int groupId;
- TCHAR *groupName;
+ wchar_t *groupName;
void save()
{
@@ -79,16 +79,16 @@ static mir_cs csGroups; /////////////////////////////////////////////////////////////////////////////////////////
-static int GroupNameExists(const TCHAR *ptszGroupName, int skipGroup)
+static int GroupNameExists(const wchar_t *ptszGroupName, int skipGroup)
{
if (ptszGroupName == 0)
return 0;
- TCHAR str[256];
- _tcsncpy_s(str + 1, _countof(str) - 1, ptszGroupName, _TRUNCATE);
+ wchar_t str[256];
+ wcsncpy_s(str + 1, _countof(str) - 1, ptszGroupName, _TRUNCATE);
CGroupInternal *tmp = (CGroupInternal*)_alloca(sizeof(CGroupInternal));
- tmp->groupName = (TCHAR*)str;
+ tmp->groupName = (wchar_t*)str;
if (tmp = arByName.find(tmp))
return (skipGroup == tmp->groupId) ? 0 : tmp->groupId + 1;
return 0;
@@ -101,11 +101,11 @@ MIR_APP_DLL(MGROUP) Clist_GroupExists(LPCTSTR ptszGroupName) /////////////////////////////////////////////////////////////////////////////////////////
-static INT_PTR CreateGroupInternal(MGROUP hParent, const TCHAR *ptszName)
+static INT_PTR CreateGroupInternal(MGROUP hParent, const wchar_t *ptszName)
{
- TCHAR newBaseName[127], newName[128];
+ wchar_t newBaseName[127], newName[128];
- const TCHAR *grpName = ptszName ? ptszName : TranslateT("New group");
+ const wchar_t *grpName = ptszName ? ptszName : TranslateT("New group");
if (hParent) {
CGroupInternal *tmp = arByIds.find(hParent-1);
if (tmp == NULL)
@@ -113,7 +113,7 @@ static INT_PTR CreateGroupInternal(MGROUP hParent, const TCHAR *ptszName) mir_sntprintf(newBaseName, L"%s\\%s", tmp->groupName+1, grpName);
}
- else _tcsncpy_s(newBaseName, grpName, _TRUNCATE);
+ else wcsncpy_s(newBaseName, grpName, _TRUNCATE);
mir_tstrncpy(newName + 1, newBaseName, _countof(newName) - 1);
if (ptszName) {
@@ -150,8 +150,8 @@ MIR_APP_DLL(MGROUP) Clist_GroupCreate(MGROUP hParent, LPCTSTR ptszGroupName) if (ptszGroupName == NULL || ptszGroupName[0] == '\0' || ptszGroupName[0] == '\\')
return 0;
- TCHAR *tszName = NEWTSTR_ALLOCA(ptszGroupName);
- for (TCHAR *p = tszName; *p; p++) {
+ wchar_t *tszName = NEWWSTR_ALLOCA(ptszGroupName);
+ for (wchar_t *p = tszName; *p; p++) {
if (*p == '\\') {
*p = '\0';
CreateGroupInternal(hParent, tszName);
@@ -163,7 +163,7 @@ MIR_APP_DLL(MGROUP) Clist_GroupCreate(MGROUP hParent, LPCTSTR ptszGroupName) /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(TCHAR*) Clist_GroupGetName(MGROUP hGroup, DWORD *pdwFlags)
+MIR_APP_DLL(wchar_t*) Clist_GroupGetName(MGROUP hGroup, DWORD *pdwFlags)
{
CGroupInternal *p = arByIds.find(hGroup-1);
if (p == NULL)
@@ -184,7 +184,7 @@ MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup) return 1;
if (db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT)) {
- TCHAR szQuestion[256 + 100];
+ wchar_t szQuestion[256 + 100];
mir_sntprintf(szQuestion, TranslateT("Are you sure you want to delete group '%s'? This operation cannot be undone."), pGroup->groupName+1);
if (MessageBox(cli.hwndContactList, szQuestion, TranslateT("Delete group"), MB_YESNO | MB_ICONQUESTION) == IDNO)
return 1;
@@ -194,9 +194,9 @@ MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup) // must remove setting from all child contacts too
// children are demoted to the next group up, not deleted.
- TCHAR *szNewParent = NEWTSTR_ALLOCA(pGroup->groupName+1);
+ wchar_t *szNewParent = NEWWSTR_ALLOCA(pGroup->groupName+1);
{
- TCHAR *pszLastBackslash = _tcsrchr(szNewParent, '\\');
+ wchar_t *pszLastBackslash = wcsrchr(szNewParent, '\\');
if (pszLastBackslash)
pszLastBackslash[0] = '\0';
else
@@ -237,12 +237,12 @@ MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup) db_unset(NULL, "CListGroups", idstr);
// rename subgroups
- TCHAR szNewName[256];
+ wchar_t szNewName[256];
size_t len = mir_tstrlen(pGroup->groupName+1);
for (int i = 0; i < arByIds.getCount(); i++) {
CGroupInternal *p = arByIds[i];
- if (!_tcsncmp(pGroup->groupName+1, p->groupName+1, len) && p->groupName[len+1] == '\\' && _tcschr(p->groupName + len + 2, '\\') == NULL) {
+ if (!wcsncmp(pGroup->groupName+1, p->groupName+1, len) && p->groupName[len+1] == '\\' && wcschr(p->groupName + len + 2, '\\') == NULL) {
if (szNewParent[0])
mir_sntprintf(szNewName, L"%s\\%s", szNewParent, p->groupName + len + 2);
else
@@ -315,7 +315,7 @@ MIR_APP_DLL(int) Clist_GroupMoveBefore(MGROUP hGroup, MGROUP hGroupBefore) /////////////////////////////////////////////////////////////////////////////////////////
-static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move)
+static int RenameGroupWithMove(int groupId, const wchar_t *szName, int move)
{
if (GroupNameExists(szName, groupId)) {
MessageBox(NULL, TranslateT("You already have a group with that name. Please enter a unique name for the group."), TranslateT("Rename group"), MB_ICONERROR | MB_OK);
@@ -327,9 +327,9 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) return 0;
// do the change
- TCHAR *oldName = NEWTSTR_ALLOCA(pGroup->groupName+1);
+ wchar_t *oldName = NEWWSTR_ALLOCA(pGroup->groupName+1);
- TCHAR str[256];
+ wchar_t str[256];
str[0] = pGroup->groupName[0];
mir_tstrncpy(str + 1, szName, _countof(str) - 1);
@@ -352,8 +352,8 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) continue;
CGroupInternal *p = arByIds[i];
- if (!_tcsncmp(p->groupName+1, oldName, len) && p->groupName[len+1] == '\\' && _tcschr(p->groupName + len + 2, '\\') == NULL) {
- TCHAR szNewName[256];
+ if (!wcsncmp(p->groupName+1, oldName, len) && p->groupName[len+1] == '\\' && wcschr(p->groupName + len + 2, '\\') == NULL) {
+ wchar_t szNewName[256];
mir_sntprintf(szNewName, L"%s\\%s", szName, p->groupName + len + 2);
RenameGroupWithMove(i, szNewName, 0); // luckily, child groups will never need reordering
}
@@ -361,8 +361,8 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) // finally must make sure it's after any parent items
if (move) {
- _tcsncpy_s(str, szName, _TRUNCATE);
- TCHAR *pszLastBackslash = _tcsrchr(str, '\\');
+ wcsncpy_s(str, szName, _TRUNCATE);
+ wchar_t *pszLastBackslash = wcsrchr(str, '\\');
if (pszLastBackslash != NULL) {
*pszLastBackslash = '\0';
for (int i = 0; i < arByIds.getCount(); i++) {
@@ -377,12 +377,12 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) Clist_BroadcastAsync(CLM_AUTOREBUILD, 0, 0);
}
- const CLISTGROUPCHANGE grpChg = { sizeof(grpChg), oldName, (TCHAR*)szName };
+ const CLISTGROUPCHANGE grpChg = { sizeof(grpChg), oldName, (wchar_t*)szName };
NotifyEventHooks(hGroupChangeEvent, 0, (LPARAM)&grpChg);
return 0;
}
-MIR_APP_DLL(int) Clist_GroupRename(MGROUP hGroup, const TCHAR *ptszNewName)
+MIR_APP_DLL(int) Clist_GroupRename(MGROUP hGroup, const wchar_t *ptszNewName)
{
return 0 != RenameGroupWithMove(hGroup-1, ptszNewName, 1);
}
@@ -432,15 +432,15 @@ MIR_APP_DLL(HMENU) Clist_GroupBuildMenu() HMENU hRootMenu = CreateMenu();
for (int i = 0; i < arByIds.getCount(); i++) {
- const TCHAR *pNextField = arByIds[i]->groupName + 1;
+ const wchar_t *pNextField = arByIds[i]->groupName + 1;
HMENU hThisMenu = hRootMenu;
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
- TCHAR szThisField[128], szThisMenuItem[128];
+ wchar_t szThisField[128], szThisMenuItem[128];
do {
- const TCHAR *pBackslash = _tcschr(pNextField, '\\');
+ const wchar_t *pBackslash = wcschr(pNextField, '\\');
if (pBackslash == NULL) {
mir_tstrncpy(szThisField, pNextField, _countof(szThisField));
pNextField = NULL;
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index 1e39d397c6..894ef43e35 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -53,54 +53,54 @@ struct ProtoIconIndex OBJLIST<ProtoIconIndex> protoIconIndex(5);
-TCHAR* fnGetStatusModeDescription(int mode, int flags)
+wchar_t* fnGetStatusModeDescription(int mode, int flags)
{
- static TCHAR szMode[64];
- TCHAR* descr;
+ static wchar_t szMode[64];
+ wchar_t* descr;
int noPrefixReqd = 0;
switch (mode) {
case ID_STATUS_OFFLINE:
- descr = LPGENT("Offline");
+ descr = LPGENW("Offline");
noPrefixReqd = 1;
break;
case ID_STATUS_CONNECTING:
- descr = LPGENT("Connecting");
+ descr = LPGENW("Connecting");
noPrefixReqd = 1;
break;
case ID_STATUS_ONLINE:
- descr = LPGENT("Online");
+ descr = LPGENW("Online");
noPrefixReqd = 1;
break;
case ID_STATUS_AWAY:
- descr = LPGENT("Away");
+ descr = LPGENW("Away");
break;
case ID_STATUS_DND:
- descr = LPGENT("Do not disturb");
+ descr = LPGENW("Do not disturb");
break;
case ID_STATUS_NA:
- descr = LPGENT("Not available");
+ descr = LPGENW("Not available");
break;
case ID_STATUS_OCCUPIED:
- descr = LPGENT("Occupied");
+ descr = LPGENW("Occupied");
break;
case ID_STATUS_FREECHAT:
- descr = LPGENT("Free for chat");
+ descr = LPGENW("Free for chat");
break;
case ID_STATUS_INVISIBLE:
- descr = LPGENT("Invisible");
+ descr = LPGENW("Invisible");
break;
case ID_STATUS_OUTTOLUNCH:
- descr = LPGENT("Out to lunch");
+ descr = LPGENW("Out to lunch");
break;
case ID_STATUS_ONTHEPHONE:
- descr = LPGENT("On the phone");
+ descr = LPGENW("On the phone");
break;
case ID_STATUS_IDLE:
- descr = LPGENT("Idle");
+ descr = LPGENW("Idle");
break;
default:
if (IsStatusConnecting(mode)) {
- const TCHAR* connFmt = LPGENT("Connecting (attempt %d)");
+ const wchar_t* connFmt = LPGENW("Connecting (attempt %d)");
mir_sntprintf(szMode, (flags & GSMDF_UNTRANSLATED) ? connFmt : TranslateTS(connFmt), mode - ID_STATUS_CONNECTING + 1);
return szMode;
}
diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp index 1732c9943a..2130672307 100644 --- a/src/mir_app/src/clistsettings.cpp +++ b/src/mir_app/src/clistsettings.cpp @@ -100,7 +100,7 @@ void fnInvalidateDisplayNameCacheEntry(MCONTACT hContact) }
}
-TCHAR* fnGetContactDisplayName(MCONTACT hContact, int mode)
+wchar_t* fnGetContactDisplayName(MCONTACT hContact, int mode)
{
if (hContact == NULL)
return TranslateT("(Unknown contact)");
@@ -123,7 +123,7 @@ TCHAR* fnGetContactDisplayName(MCONTACT hContact, int mode) ProtoChainSend(hContact, PSS_GETINFO, SGIF_MINIMAL, 0);
- TCHAR *buffer = TranslateT("(Unknown contact)");
+ wchar_t *buffer = TranslateT("(Unknown contact)");
return (cacheEntry == NULL) ? mir_tstrdup(buffer) : buffer;
}
@@ -146,7 +146,7 @@ int ContactDeleted(WPARAM hContact, LPARAM) /////////////////////////////////////////////////////////////////////////////////////////
-static void Dbwcs2tstr(DBCONTACTWRITESETTING *cws, TCHAR* &pStr)
+static void Dbwcs2tstr(DBCONTACTWRITESETTING *cws, wchar_t* &pStr)
{
mir_free(pStr);
diff --git a/src/mir_app/src/clisttray.cpp b/src/mir_app/src/clisttray.cpp index abb54f5c9b..dd6ea4cc32 100644 --- a/src/mir_app/src/clisttray.cpp +++ b/src/mir_app/src/clisttray.cpp @@ -44,10 +44,10 @@ static bool hasTips() static bool fTrayInited;
-static TCHAR* sttGetXStatus(const char *szProto)
+static wchar_t* sttGetXStatus(const char *szProto)
{
if (CallProtoServiceInt(NULL, szProto, PS_GETSTATUS, 0, 0) > ID_STATUS_OFFLINE) {
- TCHAR tszStatus[512];
+ wchar_t tszStatus[512];
CUSTOM_STATUS cs = { sizeof(cs) };
cs.flags = CSSF_MASK_MESSAGE | CSSF_TCHAR;
cs.ptszMessage = tszStatus;
@@ -59,7 +59,7 @@ static TCHAR* sttGetXStatus(const char *szProto) }
static HICON lastTaskBarIcon;
-static void SetTaskBarIcon(const HICON hIcon, const TCHAR *szNewTip)
+static void SetTaskBarIcon(const HICON hIcon, const wchar_t *szNewTip)
{
if (pTaskbarInterface) {
pTaskbarInterface->SetOverlayIcon(cli.hwndContactList, hIcon, szNewTip);
@@ -67,12 +67,12 @@ static void SetTaskBarIcon(const HICON hIcon, const TCHAR *szNewTip) }
}
-TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto)
+wchar_t* fnTrayIconMakeTooltip(const wchar_t *szPrefix, const char *szProto)
{
initcheck NULL;
mir_cslock lck(trayLockCS);
- TCHAR *szSeparator = L"\n";
+ wchar_t *szSeparator = L"\n";
if (szProto == NULL) {
if (accounts.getCount() == 0)
@@ -85,7 +85,7 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto) if (szPrefix && szPrefix[0]) {
if (!db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT)) {
- _tcsncpy_s(cli.szTip, MAX_TIP_SIZE, szPrefix, _TRUNCATE);
+ wcsncpy_s(cli.szTip, MAX_TIP_SIZE, szPrefix, _TRUNCATE);
return cli.szTip;
}
tszTip.Append(szPrefix);
@@ -100,7 +100,7 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto) if (!cli.pfnGetProtocolVisibility(pa->szModuleName))
continue;
- TCHAR *szStatus = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL, pa->szModuleName, PS_GETSTATUS, 0, 0), 0);
+ wchar_t *szStatus = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL, pa->szModuleName, PS_GETSTATUS, 0, 0), 0);
if (!szStatus)
continue;
@@ -119,13 +119,13 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto) else tszTip.AppendFormat(L"%s %s", pa->tszAccountName, szStatus);
}
- _tcsncpy_s(cli.szTip, MAX_TIP_SIZE, tszTip, _TRUNCATE);
+ wcsncpy_s(cli.szTip, MAX_TIP_SIZE, tszTip, _TRUNCATE);
}
else {
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa != NULL) {
ptrT ProtoXStatus(sttGetXStatus(szProto));
- TCHAR *szStatus = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL, szProto, PS_GETSTATUS, 0, 0), 0);
+ wchar_t *szStatus = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL, szProto, PS_GETSTATUS, 0, 0), 0);
if (szPrefix && szPrefix[0]) {
if (db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT)) {
if (hasTips()) {
@@ -314,7 +314,7 @@ static VOID CALLBACK RefreshTimerProc(HWND, UINT, UINT_PTR, DWORD) cli.pfnTrayIconUpdateBase(accounts[i]->szModuleName);
}
-int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPreferredProto, int isBase)
+int fnTrayIconUpdate(HICON hNewIcon, const wchar_t *szNewTip, const char *szPreferredProto, int isBase)
{
initcheck - 1;
mir_cslock lck(trayLockCS);
@@ -426,7 +426,7 @@ int fnTrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto) goto LBL_Error;
}
-void fnTrayIconUpdateWithImageList(int iImage, const TCHAR *szNewTip, char *szPreferredProto)
+void fnTrayIconUpdateWithImageList(int iImage, const wchar_t *szNewTip, char *szPreferredProto)
{
HICON hIcon = ImageList_GetIcon(hCListImages, iImage, ILD_NORMAL);
cli.pfnTrayIconUpdate(hIcon, szNewTip, szPreferredProto, 0);
@@ -616,7 +616,7 @@ static void CALLBACK TrayToolTipTimerProc(HWND hwnd, UINT, UINT_PTR id, DWORD) POINT pt;
GetCursorPos(&pt);
if (abs(pt.x - tray_hover_pos.x) <= TOOLTIP_TOLERANCE && abs(pt.y - tray_hover_pos.y) <= TOOLTIP_TOLERANCE) {
- TCHAR* szTipCur = cli.szTip;
+ wchar_t* szTipCur = cli.szTip;
{
int n = s_LastHoverIconID - 100;
if (n >= 0 && n < cli.trayIconCount)
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 3ba4cbc915..717849c38e 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -89,10 +89,10 @@ static HGENMENU hRenameMenuItem; static int MenuItem_PreBuild(WPARAM, LPARAM)
{
- TCHAR cls[128];
+ wchar_t cls[128];
HWND hwndClist = GetFocus();
GetClassName(hwndClist, cls, _countof(cls));
- hwndClist = (!mir_tstrcmp(_T(CLISTCONTROL_CLASS), cls)) ? hwndClist : cli.hwndContactList;
+ hwndClist = (!mir_tstrcmp(CLISTCONTROL_CLASSW, cls)) ? hwndClist : cli.hwndContactList;
HANDLE hItem = (HANDLE)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
Menu_ShowItem(hRenameMenuItem, hItem != 0);
return 0;
@@ -100,11 +100,11 @@ static int MenuItem_PreBuild(WPARAM, LPARAM) static INT_PTR MenuItem_RenameContact(WPARAM, LPARAM)
{
- TCHAR cls[128];
+ wchar_t cls[128];
HWND hwndClist = GetFocus();
GetClassName(hwndClist, cls, _countof(cls));
// worst case scenario, the rename is sent to the main contact list
- hwndClist = (!mir_tstrcmp(_T(CLISTCONTROL_CLASS), cls)) ? hwndClist : cli.hwndContactList;
+ hwndClist = (!mir_tstrcmp(CLISTCONTROL_CLASSW, cls)) ? hwndClist : cli.hwndContactList;
HANDLE hItem = (HANDLE)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
if (hItem) {
SetFocus(hwndClist);
@@ -125,7 +125,7 @@ static INT_PTR CALLBACK AskForConfirmationDlgProc(HWND hWnd, UINT msg, WPARAM wP lf.lfWeight = FW_BOLD;
SendDlgItemMessage(hWnd, IDC_TOPLINE, WM_SETFONT, (WPARAM)CreateFontIndirect(&lf), 0);
- TCHAR szFormat[256], szFinal[256];
+ wchar_t szFormat[256], szFinal[256];
GetDlgItemText(hWnd, IDC_TOPLINE, szFormat, _countof(szFormat));
mir_sntprintf(szFinal, szFormat, cli.pfnGetContactDisplayName(lParam, 0));
SetDlgItemText(hWnd, IDC_TOPLINE, szFinal);
@@ -240,7 +240,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l int LoadCLUIModule(void)
{
DBVARIANT dbv;
- TCHAR titleText[256];
+ wchar_t titleText[256];
uMsgProcessProfile = RegisterWindowMessage(L"Miranda::ProcessProfile");
cli.pfnLoadCluiGlobalOpts();
@@ -259,7 +259,7 @@ int LoadCLUIModule(void) wndclass.cbWndExtra = sizeof(void *);
wndclass.hInstance = cli.hInst;
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
- wndclass.lpszClassName = _T(CLISTCONTROL_CLASS);
+ wndclass.lpszClassName = CLISTCONTROL_CLASSW;
RegisterClassEx(&wndclass);
memset(&wndclass, 0, sizeof(wndclass));
@@ -410,7 +410,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM static int noRecurse = 0;
if (msg == uMsgProcessProfile) {
- TCHAR profile[MAX_PATH];
+ wchar_t profile[MAX_PATH];
if (GlobalGetAtomName((ATOM)wParam, profile, _countof(profile))) {
int rc = mir_tstrcmpi(profile, VARST(L"%miranda_userdata%\\%miranda_profilename%.dat")) == 0;
ReplyMessage(rc);
@@ -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), L"",
+ cli.hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"",
WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN
| CLS_CONTACTLIST
| (db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
@@ -764,7 +764,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM NMCLISTCONTROL *nmc = (NMCLISTCONTROL*)lParam;
switch (((LPNMHDR)lParam)->code) {
case CLN_EXPANDED:
- Clist_GroupSetExpanded((MGROUP)nmc->hItem, nmc->action);
+ Clist_GroupSetExpanded(UINT_PTR(nmc->hItem), nmc->action);
return FALSE;
case CLN_DRAGGING:
@@ -992,7 +992,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM x += 2;
if (showOpts & 2) {
PROTOACCOUNT *pa;
- TCHAR tszName[64];
+ wchar_t tszName[64];
if ((pa = Proto_GetAccount(szProto)) != NULL)
mir_sntprintf(tszName, L"%s ", pa->tszAccountName);
else
@@ -1003,7 +1003,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM x += textSize.cx;
}
if (showOpts & 4) {
- TCHAR* szStatus = cli.pfnGetStatusModeDescription(status, 0);
+ wchar_t* szStatus = cli.pfnGetStatusModeDescription(status, 0);
if (!szStatus)
szStatus = L"";
GetTextExtentPoint32(dis->hDC, szStatus, (int)mir_tstrlen(szStatus), &textSize);
diff --git a/src/mir_app/src/cluiservices.cpp b/src/mir_app/src/cluiservices.cpp index 8163c22124..148a9bd5e7 100644 --- a/src/mir_app/src/cluiservices.cpp +++ b/src/mir_app/src/cluiservices.cpp @@ -30,9 +30,9 @@ EXTERN_C MIR_APP_DLL(void) Clist_GroupAdded(MGROUP hGroup) // CLC does this automatically unless it's a new group
HWND hwndFocus = GetFocus();
- TCHAR szFocusClass[64];
+ wchar_t szFocusClass[64];
GetClassName(hwndFocus, szFocusClass, _countof(szFocusClass));
- if (!mir_tstrcmp(szFocusClass, _T(CLISTCONTROL_CLASS))) {
+ if (!mir_tstrcmp(szFocusClass, CLISTCONTROL_CLASSW)) {
HANDLE hItem = (HANDLE)SendMessage(hwndFocus, CLM_FINDGROUP, hGroup, 0);
if (hItem)
SendMessage(hwndFocus, CLM_EDITLABEL, (WPARAM)hItem, 0);
@@ -111,7 +111,7 @@ void fnCluiProtocolStatusChanged(int, const char*) if (showOpts & 1)
x += g_IconWidth;
if (showOpts & 2) {
- TCHAR tszName[64];
+ wchar_t tszName[64];
PROTOACCOUNT *pa = Proto_GetAccount(cli.menuProtos[i].szProto);
if (pa)
mir_sntprintf(tszName, L"%s ", pa->tszAccountName);
@@ -125,7 +125,7 @@ void fnCluiProtocolStatusChanged(int, const char*) x += GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
if (showOpts & 4) {
- TCHAR* modeDescr = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL, cli.menuProtos[i].szProto, PS_GETSTATUS, 0, 0), 0);
+ wchar_t* modeDescr = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL, cli.menuProtos[i].szProto, PS_GETSTATUS, 0, 0), 0);
GetTextExtentPoint32(hdc, modeDescr, (int)mir_tstrlen(modeDescr), &textSize);
x += textSize.cx;
x += GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp index 5e6a6bc52b..07d319dd2d 100644 --- a/src/mir_app/src/contacts.cpp +++ b/src/mir_app/src/contacts.cpp @@ -25,17 +25,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
#define NAMEORDERCOUNT 9
-static TCHAR* nameOrderDescr[ NAMEORDERCOUNT ] =
+static wchar_t* nameOrderDescr[ NAMEORDERCOUNT ] =
{
- LPGENT("My custom name (not movable)"),
- LPGENT("Nick"),
- LPGENT("FirstName"),
- LPGENT("E-mail"),
- LPGENT("LastName"),
- LPGENT("Username"),
- LPGENT("FirstName LastName"),
- LPGENT("LastName FirstName"),
- LPGENT("'(Unknown contact)' (not movable)")
+ LPGENW("My custom name (not movable)"),
+ LPGENW("Nick"),
+ LPGENW("FirstName"),
+ LPGENW("E-mail"),
+ LPGENW("LastName"),
+ LPGENW("Username"),
+ LPGENW("FirstName LastName"),
+ LPGENW("LastName FirstName"),
+ LPGENW("'(Unknown contact)' (not movable)")
};
BYTE nameOrder[NAMEORDERCOUNT];
@@ -54,7 +54,7 @@ static int GetDatabaseString(MCONTACT hContact, const char *szProto, const char return db_get_ws(hContact, szProto, szSetting, dbv);
}
-static TCHAR* ProcessDatabaseValueDefault(MCONTACT hContact, const char *szProto, const char *szSetting)
+static wchar_t* ProcessDatabaseValueDefault(MCONTACT hContact, const char *szProto, const char *szSetting)
{
DBVARIANT dbv;
if (!GetDatabaseString(hContact, szProto, szSetting, &dbv)) {
@@ -71,21 +71,21 @@ static TCHAR* ProcessDatabaseValueDefault(MCONTACT hContact, const char *szProto if (db_get(hContact, szProto, szSetting, &dbv))
return NULL;
- TCHAR buf[40];
+ wchar_t buf[40];
switch (dbv.type) {
case DBVT_BYTE:
- return mir_tstrdup(_itot(dbv.bVal, buf, 10));
+ return mir_tstrdup(_itow(dbv.bVal, buf, 10));
case DBVT_WORD:
- return mir_tstrdup(_itot(dbv.wVal, buf, 10));
+ return mir_tstrdup(_itow(dbv.wVal, buf, 10));
case DBVT_DWORD:
- return mir_tstrdup(_itot(dbv.dVal, buf, 10));
+ return mir_tstrdup(_itow(dbv.dVal, buf, 10));
}
db_free(&dbv);
return NULL;
}
-MIR_APP_DLL(TCHAR*) Contact_GetInfo(int type, MCONTACT hContact, const char *szProto)
+MIR_APP_DLL(wchar_t*) Contact_GetInfo(int type, MCONTACT hContact, const char *szProto)
{
if (hContact == NULL && szProto == NULL)
return NULL;
@@ -96,7 +96,7 @@ MIR_APP_DLL(TCHAR*) Contact_GetInfo(int type, MCONTACT hContact, const char *szP return NULL;
char *uid;
- TCHAR *res;
+ wchar_t *res;
DBVARIANT dbv;
switch (type) {
case CNF_FIRSTNAME: return ProcessDatabaseValueDefault(hContact, szProto, "FirstName");
@@ -179,8 +179,8 @@ MIR_APP_DLL(TCHAR*) Contact_GetInfo(int type, MCONTACT hContact, const char *szP case CNF_UNIQUEID:
if (db_mc_isMeta(hContact)) {
- TCHAR buf[40];
- _itot(hContact, buf, 10);
+ wchar_t buf[40];
+ _itow(hContact, buf, 10);
return mir_tstrdup(buf);
}
diff --git a/src/mir_app/src/database.cpp b/src/mir_app/src/database.cpp index 6fa2ae5bf0..a0a9257b87 100644 --- a/src/mir_app/src/database.cpp +++ b/src/mir_app/src/database.cpp @@ -27,52 +27,52 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // contains the location of mirandaboot.ini
bool g_bDbCreated;
-TCHAR g_profileDir[MAX_PATH], g_profileName[MAX_PATH], g_shortProfileName[MAX_PATH];
-TCHAR* g_defaultProfile;
+wchar_t g_profileDir[MAX_PATH], g_profileName[MAX_PATH], g_shortProfileName[MAX_PATH];
+wchar_t* g_defaultProfile;
void EnsureCheckerLoaded(bool);
void LoadDatabaseServices();
-bool fileExist(const TCHAR *fname)
+bool fileExist(const wchar_t *fname)
{
if (*fname == 0)
return false;
- FILE *fp = _tfopen(fname, L"r+");
+ FILE *fp = _wfopen(fname, L"r+");
bool res = (fp != NULL);
if (fp) fclose(fp);
return res;
}
-static void fillProfileName(const TCHAR* ptszFileName)
+static void fillProfileName(const wchar_t* ptszFileName)
{
- const TCHAR* p = _tcsrchr(ptszFileName, '\\');
+ const wchar_t* p = wcsrchr(ptszFileName, '\\');
if (p == NULL)
p = ptszFileName;
else
p++;
- _tcsncpy_s(g_profileName, p, _TRUNCATE);
+ wcsncpy_s(g_profileName, p, _TRUNCATE);
- _tcsncpy_s(g_shortProfileName, p, _TRUNCATE);
- TCHAR *pos = _tcsrchr(g_shortProfileName, '.');
+ wcsncpy_s(g_shortProfileName, p, _TRUNCATE);
+ wchar_t *pos = wcsrchr(g_shortProfileName, '.');
if (mir_tstrcmpi(pos, L".dat") == 0)
*pos = 0;
}
-bool IsInsideRootDir(TCHAR* profiledir, bool exact)
+bool IsInsideRootDir(wchar_t* profiledir, bool exact)
{
VARST pfd(L"%miranda_path%");
if (exact)
return mir_tstrcmpi(profiledir, pfd) == 0;
- return _tcsnicmp(profiledir, pfd, mir_tstrlen(pfd)) == 0;
+ return wcsnicmp(profiledir, pfd, mir_tstrlen(pfd)) == 0;
}
// returns 1 if the profile path was returned, without trailing slash
-int getProfilePath(TCHAR *buf, size_t)
+int getProfilePath(wchar_t *buf, size_t)
{
- TCHAR profiledir[MAX_PATH];
+ wchar_t profiledir[MAX_PATH];
GetPrivateProfileString(L"Database", L"ProfileDir", L"", profiledir, _countof(profiledir), mirandabootini);
if (profiledir[0] == 0)
@@ -87,7 +87,7 @@ int getProfilePath(TCHAR *buf, size_t) }
// returns 1 if *.dat spec is matched
-int isValidProfileName(const TCHAR *name)
+int isValidProfileName(const wchar_t *name)
{
size_t len = mir_tstrlen(name) - 4;
return len > 0 && mir_tstrcmpi(&name[len], L".dat") == 0;
@@ -96,7 +96,7 @@ int isValidProfileName(const TCHAR *name) // returns 1 if the profile manager should be shown
static bool showProfileManager(void)
{
- TCHAR Mgr[32];
+ wchar_t Mgr[32];
// is control pressed?
if (GetAsyncKeyState(VK_CONTROL) & 0x8000)
return 1;
@@ -106,19 +106,19 @@ static bool showProfileManager(void) return (mir_tstrcmpi(Mgr, L"yes") == 0);
}
-bool shouldAutoCreate(TCHAR *szProfile)
+bool shouldAutoCreate(wchar_t *szProfile)
{
if (szProfile[0] == 0)
return false;
- TCHAR ac[32];
+ wchar_t ac[32];
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)
+static void getDefaultProfile(wchar_t *szProfile, size_t cch)
{
- TCHAR defaultProfile[MAX_PATH];
+ wchar_t defaultProfile[MAX_PATH];
GetPrivateProfileString(L"Database", L"DefaultProfile", L"", defaultProfile, _countof(defaultProfile), mirandabootini);
if (defaultProfile[0] == 0)
@@ -126,37 +126,37 @@ static void getDefaultProfile(TCHAR *szProfile, size_t cch) VARST res(defaultProfile);
if (res)
- mir_sntprintf(szProfile, cch, L"%s\\%s\\%s%s", g_profileDir, (TCHAR*)res, (TCHAR*)res, isValidProfileName(res) ? L"" : L".dat");
+ mir_sntprintf(szProfile, cch, L"%s\\%s\\%s%s", g_profileDir, (wchar_t*)res, (wchar_t*)res, isValidProfileName(res) ? L"" : L".dat");
else
szProfile[0] = 0;
}
// returns 1 if something that looks like a profile is there
-static void loadProfileByShortName(const TCHAR* src, TCHAR *szProfile, size_t cch)
+static void loadProfileByShortName(const wchar_t* src, wchar_t *szProfile, size_t cch)
{
- TCHAR buf[MAX_PATH];
- _tcsncpy_s(buf, src, _TRUNCATE);
+ wchar_t buf[MAX_PATH];
+ wcsncpy_s(buf, src, _TRUNCATE);
- TCHAR *p = _tcsrchr(buf, '\\'); if (p) ++p; else p = buf;
+ wchar_t *p = wcsrchr(buf, '\\'); if (p) ++p; else p = buf;
if (!isValidProfileName(buf) && *p)
mir_tstrcat(buf, L".dat");
- TCHAR profileName[MAX_PATH], newProfileDir[MAX_PATH];
- _tcsncpy_s(profileName, p, _TRUNCATE);
+ wchar_t profileName[MAX_PATH], newProfileDir[MAX_PATH];
+ wcsncpy_s(profileName, p, _TRUNCATE);
if (!isValidProfileName(profileName) && *p)
mir_tstrcat(profileName, L".dat");
- _tcsncpy_s(profileName, p, _TRUNCATE);
- p = _tcsrchr(profileName, '.'); if (p) *p = 0;
+ wcsncpy_s(profileName, p, _TRUNCATE);
+ p = wcsrchr(profileName, '.'); if (p) *p = 0;
mir_sntprintf(newProfileDir, cch, L"%s\\%s\\", g_profileDir, profileName);
PathToAbsoluteT(buf, szProfile, newProfileDir);
- if (_tcschr(buf, '\\')) {
- _tcsncpy_s(g_profileDir, szProfile, _TRUNCATE);
+ if (wcschr(buf, '\\')) {
+ wcsncpy_s(g_profileDir, szProfile, _TRUNCATE);
if (profileName[0]) {
- p = _tcsrchr(g_profileDir, '\\'); *p = 0;
- p = _tcsrchr(g_profileDir, '\\');
+ p = wcsrchr(g_profileDir, '\\'); *p = 0;
+ p = wcsrchr(g_profileDir, '\\');
if (p && mir_tstrcmpi(p + 1, profileName) == 0)
*p = 0;
}
@@ -164,14 +164,14 @@ static void loadProfileByShortName(const TCHAR* src, TCHAR *szProfile, size_t cc }
}
-void getProfileCmdLine(TCHAR *szProfile, size_t cch)
+void getProfileCmdLine(wchar_t *szProfile, size_t cch)
{
LPCTSTR ptszProfileName = CmdLine_GetOption(L"profile");
if (ptszProfileName != NULL)
loadProfileByShortName(ptszProfileName, szProfile, cch);
}
-void getProfileDefault(TCHAR *szProfile, size_t cch)
+void getProfileDefault(wchar_t *szProfile, size_t cch)
{
if (g_defaultProfile != NULL) {
loadProfileByShortName(g_defaultProfile, szProfile, cch);
@@ -180,35 +180,35 @@ void getProfileDefault(TCHAR *szProfile, size_t cch) }
// move profile from profile subdir
-static void moveProfileDirProfiles(TCHAR *profiledir, BOOL isRootDir = TRUE)
+static void moveProfileDirProfiles(wchar_t *profiledir, BOOL isRootDir = TRUE)
{
- TCHAR pfd[MAX_PATH];
+ wchar_t pfd[MAX_PATH];
if (isRootDir)
- _tcsncpy_s(pfd, VARST(L"%miranda_path%\\*.dat"), _TRUNCATE);
+ wcsncpy_s(pfd, VARST(L"%miranda_path%\\*.dat"), _TRUNCATE);
else
mir_sntprintf(pfd, L"%s\\*.dat", profiledir);
WIN32_FIND_DATA ffd;
HANDLE hFind = FindFirstFile(pfd, &ffd);
if (hFind != INVALID_HANDLE_VALUE) {
- TCHAR *c = _tcsrchr(pfd, '\\'); if (c) *c = 0;
+ wchar_t *c = wcsrchr(pfd, '\\'); if (c) *c = 0;
do {
- TCHAR path[MAX_PATH], path2[MAX_PATH];
- TCHAR* profile = mir_tstrdup(ffd.cFileName);
- c = _tcsrchr(profile, '.'); if (c) *c = 0;
+ wchar_t path[MAX_PATH], path2[MAX_PATH];
+ wchar_t* profile = mir_tstrdup(ffd.cFileName);
+ c = wcsrchr(profile, '.'); if (c) *c = 0;
mir_sntprintf(path, L"%s\\%s", pfd, ffd.cFileName);
mir_sntprintf(path2, L"%s\\%s", profiledir, profile);
CreateDirectoryTreeT(path2);
mir_sntprintf(path2, L"%s\\%s\\%s", profiledir, profile, ffd.cFileName);
- if (_taccess(path2, 0) == 0) {
- TCHAR buf[512];
+ if (_waccess(path2, 0) == 0) {
+ wchar_t 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, L"Miranda NG", MB_ICONERROR | MB_OK);
}
else if (MoveFile(path, path2) == 0) {
- TCHAR buf[512];
+ wchar_t 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);
@@ -223,7 +223,7 @@ static void moveProfileDirProfiles(TCHAR *profiledir, BOOL isRootDir = TRUE) }
// returns 1 if a single profile (full path) is found within the profile dir
-static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * noProfiles)
+static int getProfile1(wchar_t *szProfile, size_t cch, wchar_t *profiledir, BOOL * noProfiles)
{
int found = 0;
@@ -232,14 +232,14 @@ static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * n moveProfileDirProfiles(profiledir, FALSE);
bool bNoDefaultProfile = (*szProfile == 0);
- bool reqfd = !bNoDefaultProfile && (_taccess(szProfile, 0) == 0 || shouldAutoCreate(szProfile));
+ bool reqfd = !bNoDefaultProfile && (_waccess(szProfile, 0) == 0 || shouldAutoCreate(szProfile));
bool bShowProfileManager = showProfileManager();
if (reqfd)
found++;
if (bShowProfileManager || !reqfd) {
- TCHAR searchspec[MAX_PATH];
+ wchar_t searchspec[MAX_PATH];
mir_sntprintf(searchspec, L"%s\\*.*", profiledir);
WIN32_FIND_DATA ffd;
@@ -250,16 +250,16 @@ static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * n if (!(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || !mir_tstrcmp(ffd.cFileName, L".") || !mir_tstrcmp(ffd.cFileName, L".."))
continue;
- TCHAR newProfile[MAX_PATH];
+ wchar_t newProfile[MAX_PATH];
mir_sntprintf(newProfile, L"%s\\%s\\%s.dat", profiledir, ffd.cFileName, ffd.cFileName);
- if (_taccess(newProfile, 0) != 0)
+ if (_waccess(newProfile, 0) != 0)
continue;
switch (touchDatabase(newProfile, NULL)) {
case 0:
case EGROKPRF_OBSOLETE:
if (++found == 1 && bNoDefaultProfile)
- _tcsncpy_s(szProfile, cch, newProfile, _TRUNCATE);
+ wcsncpy_s(szProfile, cch, newProfile, _TRUNCATE);
break;
}
} while (FindNextFile(hFind, &ffd));
@@ -279,12 +279,12 @@ static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * n }
// returns 1 if a default profile should be selected instead of showing the manager.
-static int getProfileAutoRun(TCHAR *szProfile)
+static int getProfileAutoRun(wchar_t *szProfile)
{
if (*szProfile == 0)
return false;
- TCHAR Mgr[32];
+ wchar_t Mgr[32];
GetPrivateProfileString(L"Database", L"ShowProfileMgr", L"", Mgr, _countof(Mgr), mirandabootini);
if (mir_tstrcmpi(Mgr, L"never"))
return 0;
@@ -293,7 +293,7 @@ static int getProfileAutoRun(TCHAR *szProfile) }
// returns 1 if a profile was selected
-static int getProfile(TCHAR *szProfile, size_t cch)
+static int getProfile(wchar_t *szProfile, size_t cch)
{
getProfilePath(g_profileDir, _countof(g_profileDir));
if (IsInsideRootDir(g_profileDir, true))
@@ -307,7 +307,7 @@ static int getProfile(TCHAR *szProfile, size_t cch) if (IsInsideRootDir(g_profileDir, true)) {
MessageBox(NULL,
TranslateT("Profile cannot be placed into Miranda root folder.\nPlease move Miranda profile to some other location."),
- LPGENT("Miranda NG"), MB_ICONERROR | MB_OK);
+ LPGENW("Miranda NG"), MB_ICONERROR | MB_OK);
return 0;
}
@@ -334,14 +334,14 @@ LBL_Show: goto LBL_Show;
}
-// carefully converts a file name from TCHAR* to char*
-char* makeFileName(const TCHAR* tszOriginalName)
+// carefully converts a file name from wchar_t* to char*
+char* makeFileName(const wchar_t* tszOriginalName)
{
char *szResult = NULL;
char *szFileName = mir_t2a(tszOriginalName);
- TCHAR *tszFileName = mir_a2t(szFileName);
+ wchar_t *tszFileName = mir_a2t(szFileName);
if (mir_tstrcmp(tszOriginalName, tszFileName)) {
- TCHAR tszProfile[MAX_PATH];
+ wchar_t tszProfile[MAX_PATH];
if (GetShortPathName(tszOriginalName, tszProfile, MAX_PATH) != 0)
szResult = mir_t2a(tszProfile);
}
@@ -355,7 +355,7 @@ char* makeFileName(const TCHAR* tszOriginalName) return szResult;
}
-int touchDatabase(const TCHAR *tszProfile, DATABASELINK **dblink)
+int touchDatabase(const wchar_t *tszProfile, DATABASELINK **dblink)
{
for (int i = arDbPlugins.getCount() - 1; i >= 0; i--) {
DATABASELINK *p = arDbPlugins[i];
@@ -378,7 +378,7 @@ int touchDatabase(const TCHAR *tszProfile, DATABASELINK **dblink) }
// enumerate all plugins that had valid DatabasePluginInfo()
-int tryOpenDatabase(const TCHAR *tszProfile)
+int tryOpenDatabase(const wchar_t *tszProfile)
{
for (int i = arDbPlugins.getCount() - 1; i >= 0; i--) {
DATABASELINK *p = arDbPlugins[i];
@@ -417,9 +417,9 @@ int tryOpenDatabase(const TCHAR *tszProfile) }
// enumerate all plugins that had valid DatabasePluginInfo()
-static int tryCreateDatabase(const TCHAR *ptszProfile)
+static int tryCreateDatabase(const wchar_t *ptszProfile)
{
- TCHAR *tszProfile = NEWTSTR_ALLOCA(ptszProfile);
+ wchar_t *tszProfile = NEWWSTR_ALLOCA(ptszProfile);
CreatePathToFileT(tszProfile);
for (int i = 0; i < arDbPlugins.getCount(); i++) {
@@ -443,7 +443,7 @@ static int tryCreateDatabase(const TCHAR *ptszProfile) typedef struct
{
- TCHAR *profile;
+ wchar_t *profile;
UINT msg;
ATOM aPath;
int found;
@@ -451,7 +451,7 @@ typedef struct static BOOL CALLBACK EnumMirandaWindows(HWND hwnd, LPARAM lParam)
{
- TCHAR classname[256];
+ wchar_t classname[256];
ENUMMIRANDAWINDOW *x = (ENUMMIRANDAWINDOW *)lParam;
DWORD_PTR res = 0;
if (GetClassName(hwnd, classname, _countof(classname)) && mir_tstrcmp(L"Miranda", classname) == 0) {
@@ -463,7 +463,7 @@ static BOOL CALLBACK EnumMirandaWindows(HWND hwnd, LPARAM lParam) return TRUE;
}
-static int FindMirandaForProfile(TCHAR *szProfile)
+static int FindMirandaForProfile(wchar_t *szProfile)
{
ENUMMIRANDAWINDOW x = { 0 };
x.profile = szProfile;
@@ -474,14 +474,14 @@ static int FindMirandaForProfile(TCHAR *szProfile) return x.found;
}
-static TCHAR tszNoDrivers[] = LPGENT("Miranda is unable to open '%s' because you do not have any profile plugins installed.\nYou need to install dbx_mmap.dll");
-static TCHAR tszUnknownFormat[] = LPGENT("Miranda was unable to open '%s', it's in an unknown format.\nThis profile might also be damaged, please run DbChecker which should be installed.");
-static TCHAR tszProfileLocked[] = LPGENT("Miranda was unable to open '%s'\nIt's inaccessible or used by other application or Miranda instance");
-static TCHAR tszNoSuitableDriver[] = LPGENT("Miranda was unable to open '%s'\nThere is no suitable database driver installed");
+static wchar_t tszNoDrivers[] = LPGENW("Miranda is unable to open '%s' because you do not have any profile plugins installed.\nYou need to install dbx_mmap.dll");
+static wchar_t tszUnknownFormat[] = LPGENW("Miranda was unable to open '%s', it's in an unknown format.\nThis profile might also be damaged, please run DbChecker which should be installed.");
+static wchar_t tszProfileLocked[] = LPGENW("Miranda was unable to open '%s'\nIt's inaccessible or used by other application or Miranda instance");
+static wchar_t tszNoSuitableDriver[] = LPGENW("Miranda was unable to open '%s'\nThere is no suitable database driver installed");
int LoadDatabaseModule(void)
{
- TCHAR szProfile[MAX_PATH];
+ wchar_t szProfile[MAX_PATH];
PathToAbsoluteT(L".", szProfile);
_tchdir(szProfile);
szProfile[0] = 0;
@@ -492,7 +492,7 @@ int LoadDatabaseModule(void) if (!getProfile(szProfile, _countof(szProfile)))
return 1;
- TCHAR *ptszFileName = _tcsrchr(szProfile, '\\');
+ wchar_t *ptszFileName = wcsrchr(szProfile, '\\');
ptszFileName = (ptszFileName) ? ptszFileName + 1 : szProfile;
if (arDbPlugins.getCount() == 0) {
@@ -507,7 +507,7 @@ int LoadDatabaseModule(void) int rc;
do {
retry = false;
- if (_taccess(szProfile, 0) && shouldAutoCreate(szProfile))
+ if (_waccess(szProfile, 0) && shouldAutoCreate(szProfile))
rc = tryCreateDatabase(szProfile);
else
rc = tryOpenDatabase(szProfile);
diff --git a/src/mir_app/src/dbini.cpp b/src/mir_app/src/dbini.cpp index 855c624fce..77a42d8db6 100644 --- a/src/mir_app/src/dbini.cpp +++ b/src/mir_app/src/dbini.cpp @@ -33,18 +33,18 @@ static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg, UINT message, WPARAM wPa switch (message) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SetDlgItemText(hwndDlg, IDC_ININAME, (TCHAR*)lParam);
+ SetDlgItemText(hwndDlg, IDC_ININAME, (wchar_t*)lParam);
{
- TCHAR szSecurity[11];
- const TCHAR *pszSecurityInfo;
+ wchar_t szSecurity[11];
+ const wchar_t *pszSecurityInfo;
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.");
+ pszSecurityInfo = LPGENW("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, 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.");
+ pszSecurityInfo = LPGENW("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, L"none"))
- pszSecurityInfo = LPGENT("Security systems to prevent malicious changes have been disabled. You will receive no further warnings.");
+ pszSecurityInfo = LPGENW("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));
}
@@ -54,7 +54,7 @@ static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg, UINT message, WPARAM wPa switch (LOWORD(wParam)) {
case IDC_VIEWINI:
{
- TCHAR szPath[MAX_PATH];
+ wchar_t szPath[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_ININAME, szPath, _countof(szPath));
ShellExecute(hwndDlg, L"open", szPath, NULL, NULL, SW_SHOW);
}
@@ -90,7 +90,7 @@ static bool IsInSpaceSeparatedList(const char *szWord, const char *szList) }
struct warnSettingChangeInfo_t {
- TCHAR *szIniPath;
+ wchar_t *szIniPath;
char *szSection;
char *szSafeSections;
char *szUnsafeSections;
@@ -107,7 +107,7 @@ static INT_PTR CALLBACK WarnIniChangeDlgProc(HWND hwndDlg, UINT message, WPARAM case WM_INITDIALOG:
{
char szSettingName[256];
- const TCHAR *pszSecurityInfo;
+ const wchar_t *pszSecurityInfo;
warnInfo = (warnSettingChangeInfo_t*)lParam;
TranslateDialogDefault(hwndDlg);
SetDlgItemText(hwndDlg, IDC_ININAME, warnInfo->szIniPath);
@@ -117,11 +117,11 @@ static INT_PTR CALLBACK WarnIniChangeDlgProc(HWND hwndDlg, UINT message, WPARAM SetDlgItemTextA(hwndDlg, IDC_SETTINGNAME, szSettingName);
SetDlgItemTextA(hwndDlg, IDC_NEWVALUE, warnInfo->szValue);
if (IsInSpaceSeparatedList(warnInfo->szSection, warnInfo->szSafeSections))
- pszSecurityInfo = LPGENT("This change is known to be safe.");
+ pszSecurityInfo = LPGENW("This change is known to be safe.");
else if (IsInSpaceSeparatedList(warnInfo->szSection, warnInfo->szUnsafeSections))
- pszSecurityInfo = LPGENT("This change is known to be potentially hazardous.");
+ pszSecurityInfo = LPGENW("This change is known to be potentially hazardous.");
else
- pszSecurityInfo = LPGENT("This change is not known to be safe.");
+ pszSecurityInfo = LPGENW("This change is not known to be safe.");
SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateTS(pszSecurityInfo));
}
return TRUE;
@@ -144,13 +144,13 @@ static INT_PTR CALLBACK WarnIniChangeDlgProc(HWND hwndDlg, UINT message, WPARAM static INT_PTR CALLBACK IniImportDoneDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
- TCHAR szIniPath[MAX_PATH];
+ wchar_t szIniPath[MAX_PATH];
switch (message) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SetDlgItemText(hwndDlg, IDC_ININAME, (TCHAR*)lParam);
- SetDlgItemText(hwndDlg, IDC_NEWNAME, (TCHAR*)lParam);
+ SetDlgItemText(hwndDlg, IDC_ININAME, (wchar_t*)lParam);
+ SetDlgItemText(hwndDlg, IDC_NEWNAME, (wchar_t*)lParam);
return TRUE;
case WM_COMMAND:
@@ -173,7 +173,7 @@ static INT_PTR CALLBACK IniImportDoneDlgProc(HWND hwndDlg, UINT message, WPARAM EndDialog(hwndDlg, LOWORD(wParam));
break;
case IDC_MOVE:
- TCHAR szNewPath[MAX_PATH];
+ wchar_t szNewPath[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_NEWNAME, szNewPath, _countof(szNewPath));
MoveFile(szIniPath, szNewPath);
EndDialog(hwndDlg, LOWORD(wParam));
@@ -230,9 +230,9 @@ static int EnumSettingsForDeletion(const char *szSetting, LPARAM param) return 0;
}
-static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsafeSections, int secur, bool secFN)
+static void ProcessIniFile(wchar_t* szIniPath, char *szSafeSections, char *szUnsafeSections, int secur, bool secFN)
{
- FILE *fp = _tfopen(szIniPath, L"rt");
+ FILE *fp = _wfopen(szIniPath, L"rt");
if (fp == NULL)
return;
@@ -423,7 +423,7 @@ LBL_NewLine: }
break;
default:
- TCHAR buf[250];
+ wchar_t buf[250];
mir_sntprintf(buf, TranslateT("Invalid setting type for '%s'. The first character of every value must be b, w, d, l, s, e, u, g, h or n."), _A2T(szName));
MessageBox(NULL, buf, TranslateT("Install database settings"), MB_ICONWARNING | MB_OK);
break;
@@ -434,8 +434,8 @@ LBL_NewLine: static void DoAutoExec(void)
{
- TCHAR szUse[7], szIniPath[MAX_PATH], szFindPath[MAX_PATH];
- TCHAR buf[2048], szSecurity[11], szOverrideSecurityFilename[MAX_PATH], szOnCreateFilename[MAX_PATH];
+ wchar_t szUse[7], szIniPath[MAX_PATH], szFindPath[MAX_PATH];
+ wchar_t buf[2048], szSecurity[11], szOverrideSecurityFilename[MAX_PATH], szOnCreateFilename[MAX_PATH];
GetPrivateProfileString(L"AutoExec", L"Use", L"prompt", szUse, _countof(szUse), mirandabootini);
if (!mir_tstrcmpi(szUse, L"no")) return;
@@ -466,7 +466,7 @@ static void DoAutoExec(void) if (hFind == INVALID_HANDLE_VALUE)
return;
- TCHAR *str2 = _tcsrchr(szFindPath, '\\');
+ wchar_t *str2 = wcsrchr(szFindPath, '\\');
if (str2 == NULL)
szFindPath[0] = 0;
else
@@ -487,7 +487,7 @@ static void DoAutoExec(void) if (secFN)
DeleteFile(szIniPath);
else {
- TCHAR szOnCompletion[8];
+ wchar_t szOnCompletion[8];
GetPrivateProfileString(L"AutoExec", L"OnCompletion", L"recycle", szOnCompletion, _countof(szOnCompletion), mirandabootini);
if (!mir_tstrcmpi(szOnCompletion, L"delete"))
DeleteFile(szIniPath);
@@ -500,7 +500,7 @@ static void DoAutoExec(void) SHFileOperation(&shfo);
}
else if (!mir_tstrcmpi(szOnCompletion, L"rename")) {
- TCHAR szRenamePrefix[MAX_PATH], szNewPath[MAX_PATH];
+ wchar_t szRenamePrefix[MAX_PATH], szNewPath[MAX_PATH];
GetPrivateProfileString(L"AutoExec", L"RenamePrefix", L"done_", szRenamePrefix, _countof(szRenamePrefix), mirandabootini);
mir_tstrcpy(szNewPath, szFindPath);
mir_tstrcat(szNewPath, szRenamePrefix);
@@ -536,7 +536,7 @@ int InitIni(void) CreateServiceFunction("DB/Ini/ImportFile", ImportINI);
DoAutoExec();
- TCHAR szMirandaDir[MAX_PATH];
+ wchar_t szMirandaDir[MAX_PATH];
PathToAbsoluteT(L".", szMirandaDir);
hIniChangeNotification = FindFirstChangeNotification(szMirandaDir, 0, FILE_NOTIFY_CHANGE_FILE_NAME);
if (hIniChangeNotification != INVALID_HANDLE_VALUE) {
diff --git a/src/mir_app/src/dbintf.cpp b/src/mir_app/src/dbintf.cpp index 5a95326330..dca13b96f3 100644 --- a/src/mir_app/src/dbintf.cpp +++ b/src/mir_app/src/dbintf.cpp @@ -106,7 +106,7 @@ static INT_PTR srvRegisterPlugin(WPARAM, LPARAM lParam) static INT_PTR srvFindPlugin(WPARAM, LPARAM lParam)
{
for (int i = arDbPlugins.getCount() - 1; i >= 0; i--) {
- int error = arDbPlugins[i]->grokHeader((TCHAR*)lParam);
+ int error = arDbPlugins[i]->grokHeader((wchar_t*)lParam);
if (error == ERROR_SUCCESS || error == EGROKPRF_OBSOLETE)
return (INT_PTR)arDbPlugins[i];
}
diff --git a/src/mir_app/src/dbutils.cpp b/src/mir_app/src/dbutils.cpp index d7a958004f..8408eaf2b8 100644 --- a/src/mir_app/src/dbutils.cpp +++ b/src/mir_app/src/dbutils.cpp @@ -83,7 +83,7 @@ static INT_PTR DbEventTypeGet(WPARAM wParam, LPARAM lParam) /////////////////////////////////////////////////////////////////////////////////////////
-static TCHAR* getEventString(DBEVENTINFO *dbei, LPSTR &buf)
+static wchar_t* getEventString(DBEVENTINFO *dbei, LPSTR &buf)
{
LPSTR in = buf;
buf += mir_strlen(buf) + 1;
@@ -323,8 +323,8 @@ static INT_PTR GetProfileNameW(WPARAM wParam, LPARAM lParam) static INT_PTR SetDefaultProfile(WPARAM wParam, LPARAM)
{
- extern TCHAR* g_defaultProfile;
- replaceStrT(g_defaultProfile, (TCHAR*)wParam);
+ extern wchar_t* g_defaultProfile;
+ replaceStrT(g_defaultProfile, (wchar_t*)wParam);
return 0;
}
diff --git a/src/mir_app/src/descbutton.cpp b/src/mir_app/src/descbutton.cpp index 332a2f064f..c45e5fc226 100644 --- a/src/mir_app/src/descbutton.cpp +++ b/src/mir_app/src/descbutton.cpp @@ -43,8 +43,8 @@ struct MDescButtonCtrl HWND hwnd;
BOOL bSharedIcon;
HICON hIcon;
- TCHAR *lpzTitle;
- TCHAR *lpzDescription;
+ wchar_t *lpzTitle;
+ wchar_t *lpzDescription;
// UI info
BOOL bMouseInside;
diff --git a/src/mir_app/src/dll_sniffer.cpp b/src/mir_app/src/dll_sniffer.cpp index b68b3101d1..e32cbcce07 100644 --- a/src/mir_app/src/dll_sniffer.cpp +++ b/src/mir_app/src/dll_sniffer.cpp @@ -34,7 +34,7 @@ static IMAGE_SECTION_HEADER *getSectionByRVA(IMAGE_SECTION_HEADER *pISH, int nSe return NULL;
}
-MUUID* GetPluginInterfaces(const TCHAR* ptszFileName, bool& bIsPlugin)
+MUUID* GetPluginInterfaces(const wchar_t* ptszFileName, bool& bIsPlugin)
{
bIsPlugin = false;
diff --git a/src/mir_app/src/enterstring.cpp b/src/mir_app/src/enterstring.cpp index 09503a08d8..884166c7a9 100644 --- a/src/mir_app/src/enterstring.cpp +++ b/src/mir_app/src/enterstring.cpp @@ -68,7 +68,7 @@ static void ComboLoadRecentStrings(HWND hwndDlg, EnterStringFormParam *pForm) static void ComboAddRecentString(HWND hwndDlg, EnterStringFormParam *pForm)
{
- TCHAR *string = pForm->ptszResult;
+ wchar_t *string = pForm->ptszResult;
if (!string || !*string)
return;
@@ -141,7 +141,7 @@ static INT_PTR CALLBACK sttEnterStringDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa if (params->timeout > 0) {
SetTimer(hwndDlg, 1001, 1000, NULL);
- TCHAR buf[128];
+ wchar_t buf[128];
mir_sntprintf(buf, TranslateT("OK (%d)"), params->timeout);
SetDlgItemText(hwndDlg, IDOK, buf);
}
@@ -160,7 +160,7 @@ static INT_PTR CALLBACK sttEnterStringDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa break;
case 1001:
- TCHAR buf[128];
+ wchar_t buf[128];
mir_sntprintf(buf, TranslateT("OK (%d)"), --params->timeout);
SetDlgItemText(hwndDlg, IDOK, buf);
@@ -196,7 +196,7 @@ static INT_PTR CALLBACK sttEnterStringDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa TEXTRANGE tr;
tr.chrg = param->chrg;
- tr.lpstrText = (TCHAR *)mir_alloc(sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 2));
+ tr.lpstrText = (wchar_t *)mir_alloc(sizeof(wchar_t)*(tr.chrg.cpMax - tr.chrg.cpMin + 2));
SendMessage(param->nmhdr.hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
Utils_OpenUrlT(tr.lpstrText);
@@ -231,7 +231,7 @@ static INT_PTR CALLBACK sttEnterStringDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa case IDOK:
HWND hWnd = GetDlgItem(hwndDlg, params->idcControl);
int len = GetWindowTextLength(hWnd)+1;
- params->ptszResult = (LPTSTR)mir_alloc(sizeof(TCHAR)*len);
+ params->ptszResult = (LPTSTR)mir_alloc(sizeof(wchar_t)*len);
GetWindowText(hWnd, params->ptszResult, len);
if ((params->type == ESF_COMBO) && params->szDataPrefix && params->recentCount)
diff --git a/src/mir_app/src/extraicons.cpp b/src/mir_app/src/extraicons.cpp index 03efd88a84..6acbca19fc 100644 --- a/src/mir_app/src/extraicons.cpp +++ b/src/mir_app/src/extraicons.cpp @@ -395,7 +395,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterCallback(const char *name, const return 0;
ptrT tszDesc(mir_a2t(description));
- TCHAR *desc = TranslateTH(_hLang, tszDesc);
+ wchar_t *desc = TranslateTH(_hLang, tszDesc);
int id = registeredExtraIcons.getCount() + 1;
BaseExtraIcon *extra = new CallbackExtraIcon(id, name, desc, descIcon == NULL ? "" : descIcon, RebuildIcons, ApplyIcon, OnClick, onClickParam);
@@ -410,7 +410,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterIcolib(const char *name, const ch return 0;
ptrT tszDesc(mir_a2t(description));
- TCHAR *desc = TranslateTH(_hLang, tszDesc);
+ wchar_t *desc = TranslateTH(_hLang, tszDesc);
BaseExtraIcon *extra = GetExtraIconByName(name);
if (extra != NULL) {
diff --git a/src/mir_app/src/filter.cpp b/src/mir_app/src/filter.cpp index 1470314864..f6d685fca3 100644 --- a/src/mir_app/src/filter.cpp +++ b/src/mir_app/src/filter.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. CPageList filterStrings(1);
-void AddFilterString(const PageHash key, TCHAR *data)
+void AddFilterString(const PageHash key, wchar_t *data)
{
if (ContainsFilterString(key, data)) return;
@@ -44,7 +44,7 @@ void ClearFilterStrings() filterStrings.destroy();
}
-BOOL ContainsFilterString(const PageHash key, TCHAR *data)
+BOOL ContainsFilterString(const PageHash key, wchar_t *data)
{
CPageKeywords* values = filterStrings[key];
return (values) ? values->ContainsString(data) : FALSE;
@@ -53,7 +53,7 @@ BOOL ContainsFilterString(const PageHash key, TCHAR *data) void AddTreeViewNodes(HWND hWndDlg, PageHash key, HTREEITEM root)
{
if (root) {
- TCHAR title[2048] = {0};
+ wchar_t title[2048] = {0};
TVITEM item = {0};
item.mask = TVIF_TEXT;
@@ -77,12 +77,12 @@ void AddTreeViewNodes(HWND hWndDlg, PageHash key, HTREEITEM root) void AddDialogString(HWND hWndDlg, const PageHash key)
{
- TCHAR title[2048];
+ wchar_t title[2048];
GetWindowText(hWndDlg, title, _countof(title));
if (mir_tstrlen(title) > 0)
AddFilterString(key, title);
- TCHAR szClass[64];
+ wchar_t szClass[64];
GetClassName(hWndDlg, szClass, _countof(szClass));
if (mir_tstrcmpi(szClass, L"SysTreeView32") == 0) {
@@ -143,7 +143,7 @@ static BOOL CALLBACK GetDialogStringsCallback(HWND hWnd, LPARAM lParam) return TRUE;
}
-void GetDialogStrings(int enableKeywordFiltering, const PageHash key, TCHAR *pluginName, HWND hWnd, TCHAR *group, TCHAR *title, TCHAR *tab, TCHAR *name)
+void GetDialogStrings(int enableKeywordFiltering, const PageHash key, wchar_t *pluginName, HWND hWnd, wchar_t *group, wchar_t *title, wchar_t *tab, wchar_t *name)
{
AddFilterString(key, pluginName); //add the plugin name as keyword
if (group) AddFilterString(key, group);
diff --git a/src/mir_app/src/filter.h b/src/mir_app/src/filter.h index bb35912a40..3c20fcfc69 100644 --- a/src/mir_app/src/filter.h +++ b/src/mir_app/src/filter.h @@ -29,23 +29,23 @@ extern HANDLE hOptionsInitialize; typedef DWORD PageHash;
-void AddFilterString(const PageHash key, const TCHAR *data);
-BOOL ContainsFilterString(const PageHash key, TCHAR *data);
+void AddFilterString(const PageHash key, const wchar_t *data);
+BOOL ContainsFilterString(const PageHash key, wchar_t *data);
void ClearFilterStrings();
-void GetDialogStrings(int enableKeywordFiltering, const PageHash key, TCHAR *pluginName, HWND hWnd, TCHAR *group, TCHAR *title, TCHAR *tab, TCHAR *name);
+void GetDialogStrings(int enableKeywordFiltering, const PageHash key, wchar_t *pluginName, HWND hWnd, wchar_t *group, wchar_t *title, wchar_t *tab, wchar_t *name);
-_inline TCHAR *_tcslwr_locale(TCHAR *buf)
+_inline wchar_t *_tcslwr_locale(wchar_t *buf)
{
LCMapString(Langpack_GetDefaultLocale() , LCMAP_LOWERCASE, buf, (int)mir_tstrlen(buf), buf, (int)mir_tstrlen(buf));
return buf;
}
-typedef LIST<TCHAR> KeywordList;
+typedef LIST<wchar_t> KeywordList;
class CPageKeywords
{
PageHash _pageHashKey;
KeywordList _pageKeyWords;
- static int _KeyWordsSortFunc(const TCHAR* p1, const TCHAR* p2) { return mir_tstrcmp(p1, p2); };
+ static int _KeyWordsSortFunc(const wchar_t* p1, const wchar_t* p2) { return mir_tstrcmp(p1, p2); };
public:
CPageKeywords(PageHash pageHashKey) : _pageHashKey(pageHashKey), _pageKeyWords(1, _KeyWordsSortFunc) {};
@@ -55,19 +55,19 @@ public: mir_free(_pageKeyWords[j]);
};
- void AddKeyWord(TCHAR *ptKeyWord)
+ void AddKeyWord(wchar_t *ptKeyWord)
{
- TCHAR *plwrWord = _tcslwr_locale(mir_tstrdup(ptKeyWord));
+ wchar_t *plwrWord = _tcslwr_locale(mir_tstrdup(ptKeyWord));
if (_pageKeyWords.getIndex(plwrWord) == -1)
_pageKeyWords.insert(plwrWord);
else
mir_free(plwrWord);
};
- BOOL ContainsString(TCHAR *data)
+ BOOL ContainsString(wchar_t *data)
{
for (int i=0; i < _pageKeyWords.getCount(); i++)
- if (_tcsstr(_pageKeyWords[i], data))
+ if (wcsstr(_pageKeyWords[i], data))
return TRUE;
return FALSE;
}
diff --git a/src/mir_app/src/findadd.cpp b/src/mir_app/src/findadd.cpp index 0cad9fcd93..a6c1f98520 100644 --- a/src/mir_app/src/findadd.cpp +++ b/src/mir_app/src/findadd.cpp @@ -291,7 +291,7 @@ static void CheckSearchTypeRadioButton(HWND hwndDlg, int idControl) #define sttErrMsg TranslateT("You haven't filled in the search field. Please enter a search term and try again.") #define sttErrTitle TranslateT("Search") -static void SetListItemText(HWND hwndList, int idx, int col, TCHAR *szText) +static void SetListItemText(HWND hwndList, int idx, int col, wchar_t *szText) { if (szText == NULL || *szText == 0) szText = TranslateT("<not specified>"); @@ -299,7 +299,7 @@ static void SetListItemText(HWND hwndList, int idx, int col, TCHAR *szText) ListView_SetItemText(hwndList, idx, col, szText); } -static TCHAR* sttDecodeString(DWORD dwFlags, MAllStrings &src) +static wchar_t* sttDecodeString(DWORD dwFlags, MAllStrings &src) { if (dwFlags & PSR_UNICODE) return mir_u2t(src.w); @@ -326,7 +326,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat->iLastColumnSortIndex = 1; dat->bSortAscending = 1; SendDlgItemMessage(hwndDlg, IDC_MOREOPTIONS, BUTTONSETARROW, 1, 0); - SendDlgItemMessage(hwndDlg, IDOK, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Ctrl+Search add contact"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDOK, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Ctrl+Search add contact"), BATF_TCHAR); ListView_SetExtendedListViewStyle(hwndList, LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP); @@ -363,10 +363,10 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_STATUSBAR, SB_SETTEXT, 1 | SBT_OWNERDRAW, 0); SetStatusBarSearchInfo(GetDlgItem(hwndDlg, IDC_STATUSBAR), dat); - TCHAR *szProto = NULL; + wchar_t *szProto = NULL; ptrT tszLast(db_get_tsa(NULL, "FindAdd", "LastSearched")); if (tszLast) - szProto = NEWTSTR_ALLOCA(tszLast); + szProto = NEWWSTR_ALLOCA(tszLast); int i, index = 0, cbwidth = 0, netProtoCount = 0; for (i = 0; i < accounts.getCount(); i++) { @@ -687,7 +687,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (IsDlgButtonChecked(hwndDlg, IDC_BYCUSTOM)) BeginSearch(hwndDlg, dat, szProto, PS_SEARCHBYADVANCED, PF1_EXTSEARCHUI, dat->hwndTinySearch); else if (IsDlgButtonChecked(hwndDlg, IDC_BYPROTOID)) { - TCHAR str[256]; + wchar_t str[256]; GetDlgItemText(hwndDlg, IDC_PROTOID, str, _countof(str)); rtrimt(str); if (str[0] == 0) @@ -696,7 +696,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP BeginSearch(hwndDlg, dat, szProto, PS_BASICSEARCH, PF1_BASICSEARCH, str); } else if (IsDlgButtonChecked(hwndDlg, IDC_BYEMAIL)) { - TCHAR str[256]; + wchar_t str[256]; GetDlgItemText(hwndDlg, IDC_EMAIL, str, _countof(str)); rtrimt(str); if (str[0] == 0) @@ -705,7 +705,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP BeginSearch(hwndDlg, dat, szProto, PS_SEARCHBYEMAIL, PF1_SEARCHBYEMAIL, str); } else if (IsDlgButtonChecked(hwndDlg, IDC_BYNAME)) { - TCHAR nick[256], first[256], last[256]; + wchar_t nick[256], first[256], last[256]; PROTOSEARCHBYNAME psbn; GetDlgItemText(hwndDlg, IDC_NAMENICK, nick, _countof(nick)); GetDlgItemText(hwndDlg, IDC_NAMEFIRST, first, _countof(first)); @@ -758,7 +758,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP acs.psr = &lsr->psr; } else { - TCHAR str[256]; + wchar_t str[256]; GetDlgItemText(hwndDlg, IDC_PROTOID, str, _countof(str)); if (*rtrimt(str) == 0) break; @@ -766,7 +766,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP PROTOSEARCHRESULT psr = { 0 }; psr.cbSize = sizeof(psr); psr.flags = PSR_TCHAR; - psr.id.t = str; + psr.id.w = str; acs.psr = &psr; acs.szProto = (char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, @@ -864,11 +864,11 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP memcpy(&lsr->psr, psr, psr->cbSize); /* Next block is not needed but behavior will be kept */ - lsr->psr.id.t = sttDecodeString(psr->flags, psr->id); - lsr->psr.nick.t = sttDecodeString(psr->flags, psr->nick); - lsr->psr.firstName.t = sttDecodeString(psr->flags, psr->firstName); - lsr->psr.lastName.t = sttDecodeString(psr->flags, psr->lastName); - lsr->psr.email.t = sttDecodeString(psr->flags, psr->email); + lsr->psr.id.w = sttDecodeString(psr->flags, psr->id); + lsr->psr.nick.w = sttDecodeString(psr->flags, psr->nick); + lsr->psr.firstName.w = sttDecodeString(psr->flags, psr->firstName); + lsr->psr.lastName.w = sttDecodeString(psr->flags, psr->lastName); + lsr->psr.email.w = sttDecodeString(psr->flags, psr->email); lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_TCHAR; LVITEM lvi = { 0 }; @@ -904,11 +904,11 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat->bFlexSearchResult = FALSE; memcpy(&lsr->psr, psr, psr->cbSize); - lsr->psr.nick.t = sttDecodeString(psr->flags, psr->nick); - lsr->psr.firstName.t = sttDecodeString(psr->flags, psr->firstName); - lsr->psr.lastName.t = sttDecodeString(psr->flags, psr->lastName); - lsr->psr.email.t = sttDecodeString(psr->flags, psr->email); - lsr->psr.id.t = sttDecodeString(psr->flags, psr->id); + lsr->psr.nick.w = sttDecodeString(psr->flags, psr->nick); + lsr->psr.firstName.w = sttDecodeString(psr->flags, psr->firstName); + lsr->psr.lastName.w = sttDecodeString(psr->flags, psr->lastName); + lsr->psr.email.w = sttDecodeString(psr->flags, psr->email); + lsr->psr.id.w = sttDecodeString(psr->flags, psr->id); lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_TCHAR; LVITEM lvi = { 0 }; @@ -928,11 +928,11 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP } int iItem = ListView_InsertItem(hwndList, &lvi); - SetListItemText(hwndList, iItem, 1, lsr->psr.id.t); - SetListItemText(hwndList, iItem, 2, lsr->psr.nick.t); - SetListItemText(hwndList, iItem, 3, lsr->psr.firstName.t); - SetListItemText(hwndList, iItem, 4, lsr->psr.lastName.t); - SetListItemText(hwndList, iItem, 5, lsr->psr.email.t); + SetListItemText(hwndList, iItem, 1, lsr->psr.id.w); + SetListItemText(hwndList, iItem, 2, lsr->psr.nick.w); + SetListItemText(hwndList, iItem, 3, lsr->psr.firstName.w); + SetListItemText(hwndList, iItem, 4, lsr->psr.lastName.w); + SetListItemText(hwndList, iItem, 5, lsr->psr.email.w); SetStatusBarResultInfo(hwndDlg); } } @@ -944,7 +944,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_DESTROY: int len = SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETLBTEXTLEN, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0); - TCHAR *szProto = (TCHAR*)alloca(sizeof(TCHAR)*(len + 1)); + wchar_t *szProto = (wchar_t*)alloca(sizeof(wchar_t)*(len + 1)); if (szProto != NULL) { *szProto = '\0'; SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETLBTEXT, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), (LPARAM)szProto); diff --git a/src/mir_app/src/genmenu.h b/src/mir_app/src/genmenu.h index 2baed199d1..da3dc168c4 100644 --- a/src/mir_app/src/genmenu.h +++ b/src/mir_app/src/genmenu.h @@ -49,7 +49,7 @@ struct TMO_IntMenuItem int iconId; // icon index in the section's image list
TMO_MenuItem mi; // user-defined data
char* pszUniqName; // unique name
- TCHAR* ptszCustomName;
+ wchar_t* ptszCustomName;
HANDLE hIcolibItem; // handle of iconlib item
HBITMAP hBmp;
int originalPosition; // !!!!!!!!!!!!!!!!!!!!!!!!
@@ -72,7 +72,7 @@ struct TIntMenuObject : public MZeroedObject int id;
char *pszName;
- TCHAR *ptszDisplayName;
+ wchar_t *ptszDisplayName;
//ExecService
//LPARAM lParam;//owner data
diff --git a/src/mir_app/src/headerbar.cpp b/src/mir_app/src/headerbar.cpp index 1230ca922f..b8c8651ff2 100644 --- a/src/mir_app/src/headerbar.cpp +++ b/src/mir_app/src/headerbar.cpp @@ -132,10 +132,10 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit) PAINTSTRUCT ps;
int titleLength = GetWindowTextLength(hwndDlg) + 1;
- TCHAR *szTitle = (TCHAR *)mir_alloc(sizeof(TCHAR) * titleLength);
+ wchar_t *szTitle = (wchar_t *)mir_alloc(sizeof(wchar_t) * titleLength);
GetWindowText(hwndDlg, szTitle, titleLength);
- TCHAR *szSubTitle = _tcschr(szTitle, _T('\n'));
+ wchar_t *szSubTitle = wcschr(szTitle, '\n');
if (szSubTitle)
*szSubTitle++ = 0;
diff --git a/src/mir_app/src/hotkey_opts.cpp b/src/mir_app/src/hotkey_opts.cpp index cec2a06d5f..22e7443376 100644 --- a/src/mir_app/src/hotkey_opts.cpp +++ b/src/mir_app/src/hotkey_opts.cpp @@ -26,9 +26,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_hotkeys.h> #include "skin.h" -static TCHAR* sttHokeyVkToName(WORD vkKey) +static wchar_t* sttHokeyVkToName(WORD vkKey) { - static TCHAR buf[256] = { 0 }; + static wchar_t buf[256] = { 0 }; DWORD code = MapVirtualKey(vkKey, 0) << 16; switch (vkKey) { @@ -99,7 +99,7 @@ static TCHAR* sttHokeyVkToName(WORD vkKey) return buf; } -void HotkeyToName(TCHAR *buf, int size, BYTE shift, BYTE key) +void HotkeyToName(wchar_t *buf, int size, BYTE shift, BYTE key) { mir_sntprintf(buf, size, L"%s%s%s%s%s", (shift & HOTKEYF_CONTROL) ? TranslateT("Ctrl + ") : L"", @@ -124,7 +124,7 @@ static LRESULT CALLBACK sttHotkeyEditProc(HWND hwnd, UINT msg, WPARAM wParam, LP case HKM_SETHOTKEY: { - TCHAR buf[256] = { 0 }; + wchar_t buf[256] = { 0 }; data->key = (BYTE)LOWORD(wParam); data->shift = (BYTE)HIWORD(wParam); HotkeyToName(buf, _countof(buf), data->shift, data->key); @@ -151,11 +151,11 @@ static LRESULT CALLBACK sttHotkeyEditProc(HWND hwnd, UINT msg, WPARAM wParam, LP case WM_KEYUP: case WM_SYSKEYUP: { - TCHAR buf[256] = { 0 }; + wchar_t buf[256] = { 0 }; BYTE shift = 0; BYTE key = wParam; - TCHAR *name = sttHokeyVkToName(key); + wchar_t *name = sttHokeyVkToName(key); if (!*name || !bKeyDown) key = 0; @@ -206,7 +206,7 @@ enum { COL_NAME, COL_TYPE, COL_KEY, COL_RESET, COL_ADDREMOVE }; static void sttOptionsSetupItem(HWND hwndList, int idx, THotkeyItem *item) { - TCHAR buf[256]; + wchar_t buf[256]; LVITEM lvi = { 0 }; lvi.iItem = idx; @@ -261,7 +261,7 @@ static void sttOptionsDeleteHotkey(HWND hwndList, int idx, THotkeyItem *item) static int CALLBACK sttOptionsSortList(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort) { - TCHAR title1[256] = { 0 }, title2[256] = { 0 }; + wchar_t title1[256] = { 0 }, title2[256] = { 0 }; THotkeyItem *item1 = NULL, *item2 = NULL; LVITEM lvi = { 0 }; int res; @@ -447,7 +447,7 @@ static void sttOptionsStartEdit(HWND hwndDlg, HWND hwndHotkey) } } -static void sttOptionsDrawTextChunk(HDC hdc, TCHAR *text, RECT *rc) +static void sttOptionsDrawTextChunk(HDC hdc, wchar_t *text, RECT *rc) { DrawText(hdc, text, -1, rc, DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER | DT_WORD_ELLIPSIS); @@ -520,7 +520,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, { /* load group states */ int count = ListView_GetItemCount(hwndHotkey); - TCHAR buf[128]; + wchar_t buf[128]; LVITEM lvi = { 0 }; lvi.pszText = buf; lvi.cchTextMax = _countof(buf); @@ -891,7 +891,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); } else if (!item) { - TCHAR buf[256]; + wchar_t buf[256]; LVITEM lvi = { 0 }; lvi.mask = LVIF_TEXT; lvi.iItem = param->iItem; @@ -949,7 +949,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, case CDDS_SUBITEM | CDDS_ITEMPREPAINT: { THotkeyItem *item; - TCHAR buf[256]; + wchar_t buf[256]; LVITEM lvi = { 0 }; lvi.mask = LVIF_TEXT | LVIF_PARAM; lvi.iItem = param->nmcd.dwItemSpec; @@ -1008,7 +1008,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, KillTimer(hwndDlg, 1024); - TCHAR buf[128]; + wchar_t buf[128]; LVITEM lvi = { 0 }; lvi.pszText = buf; lvi.cchTextMax = _countof(buf); diff --git a/src/mir_app/src/hotkeys.cpp b/src/mir_app/src/hotkeys.cpp index 6d3946840d..9a1a844f89 100644 --- a/src/mir_app/src/hotkeys.cpp +++ b/src/mir_app/src/hotkeys.cpp @@ -250,7 +250,7 @@ static INT_PTR svcHotkeyUnregister(WPARAM, LPARAM lParam) static INT_PTR svcHotkeyCheck(WPARAM wParam, LPARAM lParam)
{
MSG *msg = (MSG *)wParam;
- TCHAR *pszSection = mir_a2t((char *)lParam);
+ wchar_t *pszSection = mir_a2t((char *)lParam);
if ((msg->message == WM_KEYDOWN) || (msg->message == WM_SYSKEYDOWN)) {
int i;
diff --git a/src/mir_app/src/icolib.cpp b/src/mir_app/src/icolib.cpp index ec21467e84..45c2e33b27 100644 --- a/src/mir_app/src/icolib.cpp +++ b/src/mir_app/src/icolib.cpp @@ -74,7 +74,7 @@ void __fastcall SafeDestroyIcon(HICON &hIcon) // Helper functions to manage Icon resources
-static IconSourceFile* IconSourceFile_Get(const TCHAR *file, bool isPath)
+static IconSourceFile* IconSourceFile_Get(const wchar_t *file, bool isPath)
{
if (!file)
return NULL;
@@ -83,7 +83,7 @@ static IconSourceFile* IconSourceFile_Get(const TCHAR *file, bool isPath) if (isPath)
PathToAbsoluteT(file, key.file); /// TODO: convert path to long - eliminate duplicate items
else
- _tcsncpy_s(key.file, file, _TRUNCATE);
+ wcsncpy_s(key.file, file, _TRUNCATE);
IconSourceFile *p = iconSourceFileList.find(&key);
if (p != NULL) {
@@ -92,10 +92,10 @@ static IconSourceFile* IconSourceFile_Get(const TCHAR *file, bool isPath) }
// store only needed number of chars
- size_t cbLen = _tcslen(key.file) + 1;
- p = (IconSourceFile*)mir_alloc(sizeof(int) + sizeof(TCHAR)*cbLen);
+ size_t cbLen = wcslen(key.file) + 1;
+ p = (IconSourceFile*)mir_alloc(sizeof(int) + sizeof(wchar_t)*cbLen);
p->ref_count = 1;
- _tcsncpy_s(p->file, cbLen, key.file, _TRUNCATE);
+ wcsncpy_s(p->file, cbLen, key.file, _TRUNCATE);
iconSourceFileList.insert(p);
return p;
}
@@ -311,7 +311,7 @@ int IconSourceItem::compare(const IconSourceItem *p1, const IconSourceItem *p2) return (p1->key.file > p2->key.file) ? 1 : -1;
}
-IconSourceItem* GetIconSourceItem(const TCHAR *file, int indx, int cxIcon, int cyIcon)
+IconSourceItem* GetIconSourceItem(const wchar_t *file, int indx, int cxIcon, int cyIcon)
{
if (!file)
return NULL;
@@ -330,20 +330,20 @@ IconSourceItem* GetIconSourceItem(const TCHAR *file, int indx, int cxIcon, int c return newItem;
}
-IconSourceItem* GetIconSourceItemFromPath(const TCHAR *path, int cxIcon, int cyIcon)
+IconSourceItem* GetIconSourceItemFromPath(const wchar_t *path, int cxIcon, int cyIcon)
{
if (!path)
return NULL;
- TCHAR file[MAX_PATH];
+ wchar_t file[MAX_PATH];
mir_tstrncpy(file, path, _countof(file));
- TCHAR *comma = _tcsrchr(file, ',');
+ wchar_t *comma = wcsrchr(file, ',');
int n;
if (!comma)
n = 0;
else {
- n = _ttoi(comma + 1);
+ n = _wtoi(comma + 1);
*comma = 0;
}
return GetIconSourceItem(file, n, cxIcon, cyIcon);
@@ -351,7 +351,7 @@ IconSourceItem* GetIconSourceItemFromPath(const TCHAR *path, int cxIcon, int cyI IconSourceItem* CreateStaticIconSourceItem(int cxIcon, int cyIcon)
{
- TCHAR tszName[100];
+ wchar_t tszName[100];
mir_sntprintf(tszName, L"*StaticIcon_%d", iStaticCount++);
IconSourceItemKey key = { IconSourceFile_Get(tszName, false), 0, cxIcon, cyIcon };
@@ -379,7 +379,7 @@ int IconSourceItem::release() /////////////////////////////////////////////////////////////////////////////////////////
// Service functions
-static SectionItem* IcoLib_AddSection(TCHAR *sectionName, BOOL create_new)
+static SectionItem* IcoLib_AddSection(wchar_t *sectionName, BOOL create_new)
{
if (!sectionName)
return NULL;
@@ -669,7 +669,7 @@ HICON IconItem_GetIcon(HANDLE hIcoLib, bool big) if (source == NULL) {
ptrT tszCustomPath(db_get_tsa(NULL, "SkinIcons", item->name));
if (tszCustomPath != NULL) {
- TCHAR tszFullPath[MAX_PATH];
+ wchar_t tszFullPath[MAX_PATH];
PathToAbsoluteT(tszCustomPath, tszFullPath);
int cx = item->cx ? item->cx : (big ? g_iIconX : g_iIconSX);
int cy = item->cy ? item->cy : (big ? g_iIconY : g_iIconSY);
diff --git a/src/mir_app/src/keyboard.cpp b/src/mir_app/src/keyboard.cpp index 576e239747..e71b72c9c9 100644 --- a/src/mir_app/src/keyboard.cpp +++ b/src/mir_app/src/keyboard.cpp @@ -54,35 +54,35 @@ int InitClistHotKeys(void) HOTKEYDESC shk = { sizeof(shk) };
shk.dwFlags = HKD_TCHAR;
- shk.ptszDescription = LPGENT("Show/Hide contact list");
+ shk.ptszDescription = LPGENW("Show/Hide contact list");
shk.pszName = "ShowHide";
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.ptszDescription = LPGENW("Read message");
shk.pszName = "ReadMessage";
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.ptszDescription = LPGENW("Open Options page");
shk.pszName = "ShowOptions";
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.ptszDescription = LPGENW("Open logging options");
shk.pszName = "ShowLogOptions";
shk.ptszSection = L"Main";
shk.pszService = "Netlib/Log/Win";
shk.DefHotKey = 0;
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENT("Open 'Find user' dialog");
+ shk.ptszDescription = LPGENW("Open 'Find user' dialog");
shk.pszName = "FindUsers";
shk.ptszSection = L"Main";
shk.pszService = "FindAdd/FindAddCommand";
diff --git a/src/mir_app/src/langpack.cpp b/src/mir_app/src/langpack.cpp index c418707a34..020bc0e46f 100644 --- a/src/mir_app/src/langpack.cpp +++ b/src/mir_app/src/langpack.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
#include "langpack.h"
-MIR_CORE_DLL(int) LoadLangPackDescr(const TCHAR *szLangPack, LANGPACK_INFO *lpInfo);
+MIR_CORE_DLL(int) LoadLangPackDescr(const wchar_t *szLangPack, LANGPACK_INFO *lpInfo);
BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam)
{
@@ -36,7 +36,7 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam) /* language folder */
ptrT langpack(db_get_tsa(NULL, "Langpack", "Current"));
- TCHAR tszFullPath[MAX_PATH];
+ wchar_t tszFullPath[MAX_PATH];
PathToAbsoluteT(L"\\Languages\\langpack_*.txt", tszFullPath);
BOOL fPackFound = FALSE;
diff --git a/src/mir_app/src/langpack.h b/src/mir_app/src/langpack.h index 1d9c226ce5..ddc1cb904d 100644 --- a/src/mir_app/src/langpack.h +++ b/src/mir_app/src/langpack.h @@ -42,13 +42,13 @@ static INT_PTR srvGetPluginLangpack(WPARAM wParam, LPARAM lParam); /* Langpack Info */
struct LANGPACK_INFO
{
- TCHAR tszLanguage[64];
+ wchar_t tszLanguage[64];
LCID Locale;
WORD codepage;
CMStringA szAuthors, szAuthorEmail, szLastModifiedUsing;
FILETIME ftFileDate;
- TCHAR tszFileName[MAX_PATH]; /* just the file name itself */
- TCHAR tszFullPath[MAX_PATH]; /* full path to the langpack */
+ wchar_t tszFileName[MAX_PATH]; /* just the file name itself */
+ wchar_t tszFullPath[MAX_PATH]; /* full path to the langpack */
BYTE flags; /* see LPIF_* flags */
};
diff --git a/src/mir_app/src/lpopts.cpp b/src/mir_app/src/lpopts.cpp index d34dc23152..6166ec692a 100644 --- a/src/mir_app/src/lpopts.cpp +++ b/src/mir_app/src/lpopts.cpp @@ -34,18 +34,18 @@ static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack) {
/* locale string */
if (!(pack->flags & LPF_NOLOCALE)) {
- TCHAR szLocaleName[256], szLanguageName[128], szContryName[128];
+ wchar_t szLocaleName[256], szLanguageName[128], szContryName[128];
if (!GetLocaleInfo(pack->Locale, WINVER >= _WIN32_WINNT_WIN7 ? LOCALE_SENGLISHLANGUAGENAME : LOCALE_SENGLANGUAGE, szLanguageName, _countof(szLanguageName)))
- szLanguageName[0] = _T('\0');
+ szLanguageName[0] = '\0';
if (!GetLocaleInfo(pack->Locale, WINVER >= _WIN32_WINNT_WIN7 ? LOCALE_SENGLISHCOUNTRYNAME : LOCALE_SENGCOUNTRY, szContryName, _countof(szContryName)))
- szContryName[0] = _T('\0');
+ szContryName[0] = '\0';
/* add some note if its incompatible */
if (szLanguageName[0] && szContryName[0]) {
mir_sntprintf(szLocaleName, L"%s (%s)", TranslateTS(szLanguageName), TranslateTS(szContryName));
if (!IsValidLocale(pack->Locale, LCID_INSTALLED)) {
- TCHAR *pszIncompat;
+ wchar_t *pszIncompat;
pszIncompat = TranslateT("(incompatible)");
szLocaleName[_countof(szLocaleName) - mir_tstrlen(pszIncompat) - 1] = 0;
mir_tstrcat(mir_tstrcat(szLocaleName, L" "), pszIncompat);
@@ -58,7 +58,7 @@ static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack) /* file date */
SYSTEMTIME stFileDate;
- TCHAR szDate[128]; szDate[0] = 0;
+ wchar_t szDate[128]; szDate[0] = 0;
if (FileTimeToSystemTime(&pack->ftFileDate, &stFileDate))
GetDateFormat(Langpack_GetDefaultLocale(), DATE_SHORTDATE, &stFileDate, NULL, szDate, _countof(szDate));
SetDlgItemText(hwndDlg, IDC_LANGDATE, szDate);
@@ -76,7 +76,7 @@ static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack, WPARAM wParam, LPARAM) *pack2 = *pack;
/* insert */
- TCHAR tszName[512];
+ wchar_t tszName[512];
mir_sntprintf(tszName, L"%s [%s]",
TranslateTS(pack->tszLanguage),
pack->flags & LPF_DEFAULT ? TranslateT("built-in") : pack->tszFileName);
@@ -160,7 +160,7 @@ INT_PTR CALLBACK DlgLangpackOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_NOTIFY:
if (LPNMHDR(lParam)->code == PSN_APPLY) {
- TCHAR tszPath[MAX_PATH]; tszPath[0] = 0;
+ wchar_t tszPath[MAX_PATH]; tszPath[0] = 0;
int idx = ComboBox_GetCurSel(hwndList);
int count = ComboBox_GetCount(hwndList);
for (int i = 0; i < count; i++) {
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index cfd1447b66..9d2109c4d3 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -153,7 +153,7 @@ static int RecursiveDeleteMenu(HMENU hMenu) struct MainMenuExecParam
{
char *szServiceName;
- TCHAR *szMenuName;
+ wchar_t *szMenuName;
TMO_IntMenuItem *pimi;
};
@@ -176,7 +176,7 @@ MIR_APP_DLL(HGENMENU) Menu_AddMainMenuItem(TMO_MenuItem *pmi) //we need just one parametr.
mmep->szServiceName = mir_strdup(pmi->pszService);
- mmep->szMenuName = pmi->name.t;
+ mmep->szMenuName = pmi->name.w;
TMO_IntMenuItem *pimi = Menu_AddItem(hMainMenuObject, pmi, mmep);
if (pimi == NULL)
@@ -190,7 +190,7 @@ MIR_APP_DLL(HGENMENU) Menu_AddMainMenuItem(TMO_MenuItem *pmi) if (pmi->pszService)
name = pmi->pszService;
else if (pmi->flags & CMIF_UNICODE) {
- name = mir_t2a(pmi->name.t);
+ name = mir_t2a(pmi->name.w);
needFree = true;
}
else name = pmi->name.a;
@@ -259,9 +259,9 @@ MIR_APP_DLL(HGENMENU) Menu_AddContactMenuItem(TMO_MenuItem *pmi, const char *psz mir_snprintf(buf, "%s/%s", pszProto, (pmi->pszService) ? pmi->pszService : "");
Menu_ConfigureItem(pimi, MCI_OPT_UNIQUENAME, buf);
}
- else if (pmi->name.t) {
+ else if (pmi->name.w) {
if (pmi->flags & CMIF_UNICODE)
- mir_snprintf(buf, "%s/NoService/%S", pszProto, pmi->name.t);
+ mir_snprintf(buf, "%s/NoService/%S", pszProto, pmi->name.w);
else
mir_snprintf(buf, "%s/NoService/%s", pszProto, pmi->name.a);
Menu_ConfigureItem(pimi, MCI_OPT_UNIQUENAME, buf);
@@ -381,7 +381,7 @@ MIR_APP_DLL(HGENMENU) Menu_AddStatusMenuItem(TMO_MenuItem *pmi, const char *pszP smep->hMenuItem = pimi;
char buf[MAX_PATH + 64];
- char *p = (pRoot) ? mir_t2a(pRoot->mi.name.t) : NULL;
+ char *p = (pRoot) ? mir_t2a(pRoot->mi.name.w) : NULL;
mir_snprintf(buf, "%s/%s", (p) ? p : "", pmi->pszService ? pmi->pszService : "");
mir_free(p);
@@ -467,13 +467,13 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) if (reset || check) {
TMO_IntMenuItem *timiParent = MO_GetIntMenuItem(pimi->mi.root);
if (timiParent) {
- LPTSTR ptszName = TranslateTH(pimi->mi.hLangpack, pimi->mi.hIcolibItem ? pimi->mi.name.t : LPGENT("Custom status"));
+ LPTSTR ptszName = TranslateTH(pimi->mi.hLangpack, pimi->mi.hIcolibItem ? pimi->mi.name.w : LPGENW("Custom status"));
timiParent = MO_GetIntMenuItem(pimi->mi.root);
MenuItemData it = {};
if (FindMenuHandleByGlobalID(hStatusMenu, timiParent, &it)) {
- TCHAR d[100];
+ wchar_t d[100];
GetMenuString(it.OwnerMenu, it.position, d, _countof(d), MF_BYPOSITION);
MENUITEMINFO mii = {};
@@ -517,7 +517,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) if (smep)
prot = smep->szProto;
else {
- char *prn = mir_u2a(pimi->mi.name.t);
+ char *prn = mir_u2a(pimi->mi.name.w);
prot = NEWSTR_ALLOCA(prn);
if (prn) mir_free(prn);
}
@@ -580,7 +580,7 @@ INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM) return 0;
TMO_IntMenuItem *root = (TMO_IntMenuItem*)pimi->mi.root;
- TCHAR buf[256], *ptszName;
+ wchar_t buf[256], *ptszName;
if (bIsLocked) {
pimi->mi.flags |= CMIF_CHECKED;
if (cli.bDisplayLocked) {
@@ -593,8 +593,8 @@ INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM) ptszName = acc->tszAccountName;
pimi->mi.flags &= ~CMIF_CHECKED;
}
- replaceStrT(pimi->mi.name.t, ptszName);
- replaceStrT(root->mi.name.t, ptszName);
+ replaceStrT(pimi->mi.name.w, ptszName);
+ replaceStrT(root->mi.name.w, ptszName);
if (cli.hwndStatus)
InvalidateRect(cli.hwndStatus, NULL, TRUE);
@@ -812,7 +812,7 @@ void RebuildMenuOrder(void) DWORD flags = pa->ppro->GetCaps(PFLAGNUM_2, 0) & ~pa->ppro->GetCaps(PFLAGNUM_5, 0);
HICON ic;
- TCHAR tbuf[256];
+ wchar_t tbuf[256];
// adding root
CMenuItem mi;
@@ -822,9 +822,9 @@ void RebuildMenuOrder(void) if (Proto_IsAccountLocked(pa) && cli.bDisplayLocked) {
mir_sntprintf(tbuf, TranslateT("%s (locked)"), pa->tszAccountName);
- mi.name.t = tbuf;
+ mi.name.w = tbuf;
}
- else mi.name.t = pa->tszAccountName;
+ else mi.name.w = pa->tszAccountName;
// owner data
StatusMenuExecParam *smep = (StatusMenuExecParam*)mir_calloc(sizeof(StatusMenuExecParam));
@@ -846,13 +846,13 @@ void RebuildMenuOrder(void) if ((mi.flags & CMIF_CHECKED) && cli.bDisplayLocked) {
mir_sntprintf(tbuf, TranslateT("%s (locked)"), pa->tszAccountName);
- mi.name.t = tbuf;
+ mi.name.w = tbuf;
}
- else mi.name.t = pa->tszAccountName;
+ else mi.name.w = pa->tszAccountName;
TMO_IntMenuItem *pimi = Menu_AddItem(hStatusMenuObject, &mi, smep);
smep->pimi = pimi;
- Menu_ModifyItem(pimi, mi.name.t, mi.hIcon, mi.flags);
+ Menu_ModifyItem(pimi, mi.name.w, mi.hIcon, mi.flags);
cli.menuProtos = (MenuProto*)mir_realloc(cli.menuProtos, sizeof(MenuProto)*(cli.menuProtoCount + 1));
memset(&(cli.menuProtos[cli.menuProtoCount]), 0, sizeof(MenuProto));
@@ -878,7 +878,7 @@ void RebuildMenuOrder(void) mi.flags |= CMIF_CHECKED;
mi.root = rootmenu;
mi.position = pos++;
- mi.name.t = cli.pfnGetStatusModeDescription(statusModeList[j], GSMDF_UNTRANSLATED);
+ mi.name.w = cli.pfnGetStatusModeDescription(statusModeList[j], GSMDF_UNTRANSLATED);
mi.hIcon = Skin_LoadProtoIcon(pa->szModuleName, statusModeList[j]);
// owner data
@@ -925,11 +925,11 @@ void RebuildMenuOrder(void) StatusMenuExecParam *smep = (StatusMenuExecParam*)mir_calloc(sizeof(StatusMenuExecParam));
smep->status = statusModeList[j];
{
- TCHAR buf[256], hotkeyName[100];
+ wchar_t buf[256], hotkeyName[100];
WORD hotKey = GetHotkeyValue(statusHotkeys[j]);
HotkeyToName(hotkeyName, _countof(hotkeyName), HIBYTE(hotKey), LOBYTE(hotKey));
mir_sntprintf(buf, L"%s\t%s", cli.pfnGetStatusModeDescription(statusModeList[j], 0), hotkeyName);
- mi.name.t = buf;
+ mi.name.w = buf;
hStatusMainMenuHandles[j] = Menu_AddItem(hStatusMenuObject, &mi, smep);
hStatusMainMenuHandles[j]->hotKey = hotKey;
@@ -955,7 +955,7 @@ static int sttRebuildHotkeys(WPARAM, LPARAM) if (hStatusMainMenuHandles[j] == NULL)
continue;
- TCHAR buf[256], hotkeyName[100];
+ wchar_t buf[256], hotkeyName[100];
WORD hotKey = GetHotkeyValue(statusHotkeys[j]);
HotkeyToName(hotkeyName, _countof(hotkeyName), HIBYTE(hotKey), LOBYTE(hotKey));
mir_sntprintf(buf, L"%s\t%s", cli.pfnGetStatusModeDescription(statusModeList[j], 0), hotkeyName);
diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp index 6245ae2a13..6d7ba2bc0f 100644 --- a/src/mir_app/src/menu_options.cpp +++ b/src/mir_app/src/menu_options.cpp @@ -62,7 +62,7 @@ class CGenMenuOptionsPage : public CDlgBase { int iInitMenuValue; - TCHAR idstr[100]; + wchar_t idstr[100]; void SaveTreeInternal(MenuItemOptData *pParent, HTREEITEM hRootItem, const char *szModule) { @@ -90,7 +90,7 @@ class CGenMenuOptionsPage : public CDlgBase bin2hex(&pimi->mi.uid, sizeof(pimi->mi.uid), menuItemName); int visible = tvi.iImage != 0; - TCHAR *ptszCustomName; + wchar_t *ptszCustomName; if (iod->name != NULL && iod->defname != NULL && mir_tstrcmp(iod->name, iod->defname) != 0) ptszCustomName = iod->name; else @@ -401,7 +401,7 @@ public: MenuItemOptData *PD = new MenuItemOptData(); PD->id = -1; - PD->name = mir_tstrdup(pimi->mi.name.t); + PD->name = mir_tstrdup(pimi->mi.name.w); PD->pos = pimi->mi.position; PD->pimi = pimi; @@ -437,7 +437,7 @@ public: m_menuItems.GetItem(&tvi); MenuItemOptData *iod = (MenuItemOptData *)tvi.lParam; - if (iod->name && _tcsstr(iod->name, STR_SEPARATOR)) + if (iod->name && wcsstr(iod->name, STR_SEPARATOR)) return; iod->name = mir_tstrdup(iod->defname); @@ -461,7 +461,7 @@ public: m_menuItems.GetItem(&tvi); MenuItemOptData *iod = (MenuItemOptData *)tvi.lParam; - if (iod->name && _tcsstr(iod->name, STR_SEPARATOR)) + if (iod->name && wcsstr(iod->name, STR_SEPARATOR)) return; iod->name = m_customName.GetText(); @@ -501,7 +501,7 @@ public: return; MenuItemOptData *iod = (MenuItemOptData *)tvi.lParam; - if (iod->name && _tcsstr(iod->name, STR_SEPARATOR)) + if (iod->name && wcsstr(iod->name, STR_SEPARATOR)) return; m_customName.SetText(iod->name); diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp index b03cec352a..91cb530e13 100644 --- a/src/mir_app/src/menu_utils.cpp +++ b/src/mir_app/src/menu_utils.cpp @@ -40,7 +40,7 @@ static void DumpMenuItem(TMO_IntMenuItem* pParent, int level = 0) temp[level] = 0;
for (TMO_IntMenuItem *pimi = pParent; pimi != NULL; pimi = pimi->next) {
- Netlib_Logf(NULL, "%sMenu item %08p [%08p]: %S", temp, pimi, pimi->mi.root, pimi->mi.name.t);
+ Netlib_Logf(NULL, "%sMenu item %08p [%08p]: %S", temp, pimi, pimi->mi.root, pimi->mi.name.w);
TMO_IntMenuItem *submenu = pimi->submenu.first;
if (submenu)
@@ -76,9 +76,9 @@ TIntMenuObject* GetMenuObjbyId(int id) LPTSTR GetMenuItemText(TMO_IntMenuItem *pimi)
{
if (pimi->mi.flags & CMIF_KEEPUNTRANSLATED)
- return pimi->mi.name.t;
+ return pimi->mi.name.w;
- return TranslateTH(pimi->mi.hLangpack, pimi->mi.name.t);
+ return TranslateTH(pimi->mi.hLangpack, pimi->mi.name.w);
}
///////////////////////////////////////////////////////////////////////////////
@@ -239,7 +239,7 @@ MIR_APP_DLL(HGENMENU) Menu_GetProtocolRoot(PROTO_INTERFACE *pThis) // create protocol root in the main menu
CMenuItem mi;
- mi.name.t = pThis->m_tszUserName;
+ mi.name.w = pThis->m_tszUserName;
mi.position = 500090000;
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.hIcolibItem = pThis->m_hProtoIcon;
@@ -331,7 +331,7 @@ MIR_APP_DLL(void) Menu_SetChecked(HGENMENU hMenuItem, bool bSet) /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(int) Menu_ModifyItem(HGENMENU hMenuItem, const TCHAR *ptszName, HANDLE hIcolib, int iFlags)
+MIR_APP_DLL(int) Menu_ModifyItem(HGENMENU hMenuItem, const wchar_t *ptszName, HANDLE hIcolib, int iFlags)
{
if (!bIsGenMenuInited)
return -1;
@@ -343,7 +343,7 @@ MIR_APP_DLL(int) Menu_ModifyItem(HGENMENU hMenuItem, const TCHAR *ptszName, HAND return -1;
if (ptszName != NULL)
- replaceStrT(pimi->mi.name.t, ptszName);
+ replaceStrT(pimi->mi.name.w, ptszName);
if (iFlags != -1) {
Menu_SetItemFlags(hMenuItem, true, iFlags);
@@ -666,8 +666,8 @@ static int GetNextObjectMenuItemId() static int FindRoot(TMO_IntMenuItem *pimi, void *param)
{
- if (pimi->mi.name.t != NULL)
- if (pimi->submenu.first && !mir_tstrcmp(pimi->mi.name.t, (TCHAR*)param))
+ if (pimi->mi.name.w != NULL)
+ if (pimi->submenu.first && !mir_tstrcmp(pimi->mi.name.w, (wchar_t*)param))
return TRUE;
return FALSE;
@@ -688,7 +688,7 @@ MIR_APP_DLL(HGENMENU) Menu_CreateRoot(int hMenuObject, LPCTSTR ptszName, int pos mi.flags = CMIF_TCHAR;
mi.hIcolibItem = hIcoLib;
mi.hLangpack = _hLang;
- mi.name.t = (TCHAR*)ptszName;
+ mi.name.w = (wchar_t*)ptszName;
mi.position = position;
return Menu_AddItem(hMenuObject, &mi, NULL);
}
@@ -718,9 +718,9 @@ MIR_APP_DLL(HGENMENU) Menu_AddItem(int hMenuObject, TMO_MenuItem *pmi, void *pUs p->pUserData = pUserData;
if (pmi->flags & CMIF_UNICODE)
- p->mi.name.t = mir_tstrdup(pmi->name.t);
+ p->mi.name.w = mir_tstrdup(pmi->name.w);
else
- p->mi.name.t = mir_a2u(pmi->name.a);
+ p->mi.name.w = mir_a2u(pmi->name.a);
if (pmi->hIcon != NULL && !bIconsDisabled) {
HANDLE hIcolibItem = IcoLib_IsManaged(pmi->hIcon);
@@ -861,9 +861,9 @@ static int sttReadOldItem(TMO_IntMenuItem *pmi, void *szModule) if (pmi->pszUniqName)
mir_snprintf(menuItemName, "{%s}", pmi->pszUniqName);
else if (pmi->mi.flags & CMIF_UNICODE)
- mir_snprintf(menuItemName, "{%s}", (char*)_T2A(pmi->mi.name.t));
+ mir_snprintf(menuItemName, "{%s}", (char*)_T2A(pmi->mi.name.w));
else
- mir_snprintf(menuItemName, "{%s}", pmi->mi.name.t);
+ mir_snprintf(menuItemName, "{%s}", pmi->mi.name.w);
// check if it visible
mir_snprintf(szSetting, "%s_visible", menuItemName);
@@ -873,9 +873,9 @@ static int sttReadOldItem(TMO_IntMenuItem *pmi, void *szModule) else
pmi->mi.flags |= CMIF_HIDDEN;
- // mi.name.t
+ // mi.name.w
mir_snprintf(szSetting, "%s_name", menuItemName);
- TCHAR *tszCustomName = db_get_tsa(NULL, (char*)szModule, szSetting);
+ wchar_t *tszCustomName = db_get_tsa(NULL, (char*)szModule, szSetting);
if (tszCustomName != NULL) {
mir_free(pmi->ptszCustomName);
pmi->ptszCustomName = tszCustomName;
@@ -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 : L"";
+ const wchar_t *ptszName = (pmi->ptszCustomName != NULL) ? pmi->ptszCustomName : L"";
char szRootUid[33];
if (pmi->mi.root == NULL)
@@ -993,17 +993,17 @@ int Menu_LoadFromDatabase(TMO_IntMenuItem *pimi, void *szModule) if (szValue == NULL)
return 0;
- TCHAR *ptszToken = szValue, *pDelim = _tcschr(szValue, ';');
+ wchar_t *ptszToken = szValue, *pDelim = wcschr(szValue, ';');
int bVisible = true, pos = 0;
- TCHAR tszCustomName[201]; tszCustomName[0] = 0;
+ wchar_t tszCustomName[201]; tszCustomName[0] = 0;
MUUID customRoot = {};
for (int i = 0; i < 4; i++) {
if (pDelim)
*pDelim = 0;
switch (i) {
- case 0: bVisible = _ttoi(ptszToken); break;
- case 1: pos = _ttoi(ptszToken); break;
+ case 0: bVisible = _wtoi(ptszToken); break;
+ case 1: pos = _wtoi(ptszToken); break;
case 2:
hex2binT(ptszToken, &customRoot, sizeof(customRoot));
if (customRoot == pimi->mi.uid) // prevent a loop
@@ -1012,9 +1012,9 @@ int Menu_LoadFromDatabase(TMO_IntMenuItem *pimi, void *szModule) }
ptszToken = pDelim + 1;
- if ((pDelim = _tcschr(ptszToken, ';')) == NULL) {
+ if ((pDelim = wcschr(ptszToken, ';')) == NULL) {
if (i == 2 && *ptszToken != 0)
- _tcsncpy_s(tszCustomName, ptszToken, _TRUNCATE);
+ wcsncpy_s(tszCustomName, ptszToken, _TRUNCATE);
break;
}
}
@@ -1118,7 +1118,7 @@ static HMENU BuildRecursiveMenu(HMENU hMenu, TMO_IntMenuItem *pRootMenu, WPARAM if (pmi->mi.flags & CMIF_DEFAULT)
mii.fState |= MFS_DEFAULT;
- mii.dwTypeData = (pmi->ptszCustomName) ? pmi->ptszCustomName : mi->name.t;
+ mii.dwTypeData = (pmi->ptszCustomName) ? pmi->ptszCustomName : mi->name.w;
// it's a submenu
if (pmi->submenu.first) {
@@ -1127,7 +1127,7 @@ static HMENU BuildRecursiveMenu(HMENU hMenu, TMO_IntMenuItem *pRootMenu, WPARAM #ifdef PUTPOSITIONSONMENU
if (GetKeyState(VK_CONTROL) & 0x8000) {
- TCHAR str[256];
+ wchar_t str[256];
mir_sntprintf(str, L"%s (%d, id %x)", mi->name.a, mi->position, mii.dwItemData);
mii.dwTypeData = str;
}
@@ -1141,7 +1141,7 @@ static HMENU BuildRecursiveMenu(HMENU hMenu, TMO_IntMenuItem *pRootMenu, WPARAM #ifdef PUTPOSITIONSONMENU
if (GetKeyState(VK_CONTROL) & 0x8000) {
- TCHAR str[256];
+ wchar_t str[256];
mir_sntprintf(str, L"%s (%d, id %x)", mi->name.a, mi->position, mii.dwItemData);
mii.dwTypeData = str;
}
@@ -1214,14 +1214,14 @@ int OnIconLibChanges(WPARAM, LPARAM) static int MO_RegisterIcon(TMO_IntMenuItem *pmi, void*)
{
- TCHAR *descr = GetMenuItemText(pmi);
+ wchar_t *descr = GetMenuItemText(pmi);
if (!descr || pmi->hIcolibItem != NULL || pmi->mi.uid == miid_last)
return FALSE;
HICON hIcon = ImageList_GetIcon(pmi->parent->m_hMenuIcons, pmi->iconId, 0);
- TCHAR sectionName[256];
- mir_sntprintf(sectionName, LPGENT("Menu icons") L"/%s", TranslateTS(pmi->parent->ptszDisplayName));
+ wchar_t sectionName[256];
+ mir_sntprintf(sectionName, LPGENW("Menu icons") L"/%s", TranslateTS(pmi->parent->ptszDisplayName));
char iconame[256], uname[100];
bin2hex(&pmi->mi.uid, sizeof(pmi->mi.uid), uname);
@@ -1229,13 +1229,13 @@ static int MO_RegisterIcon(TMO_IntMenuItem *pmi, void*) // remove '&'
if (descr) {
- descr = NEWTSTR_ALLOCA(descr);
+ descr = NEWWSTR_ALLOCA(descr);
- for (TCHAR *p = descr; *p; p++) {
- if ((p = _tcschr(p, '&')) == NULL)
+ for (wchar_t *p = descr; *p; p++) {
+ if ((p = wcschr(p, '&')) == NULL)
break;
- memmove(p, p + 1, sizeof(TCHAR)*(mir_tstrlen(p + 1) + 1));
+ memmove(p, p + 1, sizeof(wchar_t)*(mir_tstrlen(p + 1) + 1));
if (*p == '\0')
p++;
}
@@ -1243,9 +1243,9 @@ static int MO_RegisterIcon(TMO_IntMenuItem *pmi, void*) SKINICONDESC sid = { 0 };
sid.flags = SIDF_TCHAR;
- sid.section.t = sectionName;
+ sid.section.w = sectionName;
sid.pszName = iconame;
- sid.description.t = descr;
+ sid.description.w = descr;
sid.hDefaultIcon = hIcon;
pmi->hIcolibItem = IcoLib_AddIcon(&sid, 0);
@@ -1351,7 +1351,7 @@ void TIntMenuObject::freeItem(TMO_IntMenuItem *p) CallService(FreeService, (WPARAM)p, (LPARAM)p->pUserData);
p->signature = 0;
- mir_free(p->mi.name.t);
+ mir_free(p->mi.name.w);
mir_free(p->pszUniqName);
mir_free(p->ptszCustomName);
if (p->hBmp) DeleteObject(p->hBmp);
diff --git a/src/mir_app/src/meta_addto.cpp b/src/mir_app/src/meta_addto.cpp index e51af79104..19a59644f5 100644 --- a/src/mir_app/src/meta_addto.cpp +++ b/src/mir_app/src/meta_addto.cpp @@ -50,7 +50,7 @@ static int FillList(HWND list, BOOL sort) continue;
// get contact display name from clist
- TCHAR *swzContactDisplayName = cli.pfnGetContactDisplayName(hMetaUser, 0);
+ wchar_t *swzContactDisplayName = cli.pfnGetContactDisplayName(hMetaUser, 0);
// don't insert huge strings that we have to compare with later
if (mir_tstrlen(swzContactDisplayName) > 1023)
swzContactDisplayName[1024] = 0;
@@ -58,7 +58,7 @@ static int FillList(HWND list, BOOL sort) int pos = -1;
if (sort) {
for (pos = 0; pos < i; pos++) {
- TCHAR buff[1024];
+ wchar_t buff[1024];
SendMessage(list, LB_GETTEXT, pos, (LPARAM)buff);
if (mir_tstrcmp(buff, swzContactDisplayName) > 0)
break;
@@ -100,7 +100,7 @@ static int BuildList(HWND list, BOOL sort) * @return TRUE if the dialog processed the message, FALSE if it did not.
*/
-#define szConvMsg LPGEN("Either there is no metacontact in the database (in this case you should first convert a contact into one)\n\
+#define szConvMsg LPGENW("Either there is no metacontact in the database (in this case you should first convert a contact into one)\n\
or there is none that can host this contact.\n\
Another solution could be to convert this contact into a new metacontact.\n\nConvert this contact into a new metacontact?")
@@ -141,19 +141,19 @@ static INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wPa CheckDlgButton(hwndDlg, IDC_ONLYAVAIL, BST_CHECKED); // Initially checked; display all metacontacts is only an option
// Besides, we can check if there is at least one metacontact to add the contact to.
if (BuildList(GetDlgItem(hwndDlg, IDC_METALIST), FALSE) <= 0) {
- if (MessageBox(hwndDlg, TranslateT(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
+ if (MessageBox(hwndDlg, TranslateTS(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
Meta_Convert(lParam, 0);
DestroyWindow(hwndDlg);
return TRUE;
}
else {
// get contact display name from clist
- TCHAR *ptszCDN = cli.pfnGetContactDisplayName(lParam, 0);
+ wchar_t *ptszCDN = cli.pfnGetContactDisplayName(lParam, 0);
if (!ptszCDN)
ptszCDN = TranslateT("a contact");
// ... and set it to the Window title.
- TCHAR buf[256];
+ wchar_t buf[256];
mir_sntprintf(buf, TranslateT("Adding %s..."), ptszCDN);
SetWindowText(hwndDlg, buf);
}
@@ -187,7 +187,7 @@ static INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wPa case IDC_CHK_SRT:
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_METALIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_METALIST), GWL_STYLE) ^ LBS_SORT);
if (BuildList(GetDlgItem(hwndDlg, IDC_METALIST), IsDlgButtonChecked(hwndDlg, IDC_CHK_SRT) ? TRUE : FALSE) <= 0) {
- if (MessageBox(hwndDlg, TranslateT(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
+ if (MessageBox(hwndDlg, TranslateTS(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
Meta_Convert(lParam, 0);
DestroyWindow(hwndDlg);
return TRUE;
diff --git a/src/mir_app/src/meta_edit.cpp b/src/mir_app/src/meta_edit.cpp index 376c431a73..ecb690d268 100644 --- a/src/mir_app/src/meta_edit.cpp +++ b/src/mir_app/src/meta_edit.cpp @@ -42,7 +42,7 @@ static g_data; // global CHANGES structure static void FillContactList(HWND hList)
{
- TCHAR buff[256];
+ wchar_t buff[256];
SendMessage(hList, LVM_DELETEALLITEMS, 0, 0);
@@ -52,7 +52,7 @@ static void FillContactList(HWND hList) for (int i = 0; i < g_data.num_contacts; i++) {
LvItem.iItem = i;
- TCHAR *ptszCDN = cli.pfnGetContactDisplayName(g_data.hContact[i], 0);
+ wchar_t *ptszCDN = cli.pfnGetContactDisplayName(g_data.hContact[i], 0);
if (ptszCDN == NULL)
ptszCDN = TranslateT("(Unknown contact)");
@@ -71,19 +71,19 @@ static void FillContactList(HWND hList) if (!db_get(g_data.hContact[i], szProto, szField, &dbv)) {
switch (dbv.type) {
case DBVT_ASCIIZ:
- _tcsncpy_s(buff, _A2T(dbv.pszVal), _TRUNCATE);
+ wcsncpy_s(buff, _A2T(dbv.pszVal), _TRUNCATE);
break;
case DBVT_WCHAR:
- _tcsncpy_s(buff, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(buff, dbv.ptszVal, _TRUNCATE);
break;
case DBVT_BYTE:
- _itot(dbv.bVal, buff, 10);
+ _itow(dbv.bVal, buff, 10);
break;
case DBVT_WORD:
- _itot(dbv.wVal, buff, 10);
+ _itow(dbv.wVal, buff, 10);
break;
case DBVT_DWORD:
- _itot(dbv.dVal, buff, 10);
+ _itow(dbv.dVal, buff, 10);
break;
default:
buff[0] = 0;
@@ -96,7 +96,7 @@ static void FillContactList(HWND hList) SendMessage(hList, LVM_SETITEM, 0, (LPARAM)&LvItem); // Enter text to SubItems
LvItem.iSubItem = 2; // protocol
- _tcsncpy_s(buff, (pa == NULL) ? _A2T(szProto) : pa->tszAccountName, _TRUNCATE);
+ wcsncpy_s(buff, (pa == NULL) ? _A2T(szProto) : pa->tszAccountName, _TRUNCATE);
ListView_SetItem(hList, &LvItem);
}
else {
@@ -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, L"X", _TRUNCATE);
+ wcsncpy_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);
}
@@ -270,7 +270,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara case WMU_SETTITLE:
{
- TCHAR *ptszCDN = cli.pfnGetContactDisplayName(lParam, 0);
+ wchar_t *ptszCDN = cli.pfnGetContactDisplayName(lParam, 0);
if (ptszCDN == NULL)
ptszCDN = TranslateT("(Unknown contact)");
@@ -304,7 +304,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara switch (LOWORD(wParam)) {
case IDC_VALIDATE: // Apply changes, if there is still one contact attached to the metacontact.
if (g_data.num_contacts == 0) { // Otherwise, delete the metacontact.
- if (IDYES == MessageBox(hwndDlg, TranslateT(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
+ if (IDYES == MessageBox(hwndDlg, TranslateTS(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
Meta_Delete(g_data.hMeta, 0);
DestroyWindow(hwndDlg);
}
@@ -319,7 +319,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara case IDOK:
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_VALIDATE))) { // If there are changes that could be made,
if (g_data.num_contacts == 0) { // do the work that would have be done if the 'Apply' button was clicked.
- if (IDYES == MessageBox(hwndDlg, TranslateT(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
+ if (IDYES == MessageBox(hwndDlg, TranslateTS(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
Meta_Delete(g_data.hMeta, 0);
DestroyWindow(hwndDlg);
}
diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp index 54f41af521..2f7693ae90 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, L"X", _TRUNCATE);
+ wcsncpy_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);
@@ -207,7 +207,7 @@ INT_PTR Meta_Delete(WPARAM hContact, LPARAM bSkipQuestion) return 2;
if (cc->nSubs == 1) {
- if (IDYES == MessageBox(0, TranslateT(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1))
+ if (IDYES == MessageBox(0, TranslateTS(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1))
Meta_Delete(cc->contactID, 1);
return 0;
@@ -263,7 +263,7 @@ int Meta_ModifyMenu(WPARAM hMeta, LPARAM) Menu_ShowItem(hMenuDefault, false);
Menu_ShowItem(hMenuDelete, false);
- Menu_ModifyItem(hMenuDelete, LPGENT("Remove from metacontact"));
+ Menu_ModifyItem(hMenuDelete, LPGENW("Remove from metacontact"));
// show subcontact menu items
CMString tszNick;
@@ -311,7 +311,7 @@ int Meta_ModifyMenu(WPARAM hMeta, LPARAM) if (cc->IsSub()) {
Menu_ShowItem(hMenuDefault, true);
- Menu_ModifyItem(hMenuDelete, LPGENT("Remove from metacontact"));
+ Menu_ModifyItem(hMenuDelete, LPGENW("Remove from metacontact"));
Menu_ShowItem(hMenuDelete, true);
Menu_ShowItem(hMenuAdd, false);
@@ -342,9 +342,9 @@ INT_PTR Meta_OnOff(WPARAM, LPARAM) bool bToggled = !db_mc_isEnabled();
db_set_b(0, META_PROTO, "Enabled", bToggled);
if (bToggled)
- Menu_ModifyItem(hMenuOnOff, LPGENT("Toggle metacontacts off"), Meta_GetIconHandle(I_MENU));
+ Menu_ModifyItem(hMenuOnOff, LPGENW("Toggle metacontacts off"), Meta_GetIconHandle(I_MENU));
else
- Menu_ModifyItem(hMenuOnOff, LPGENT("Toggle metacontacts on"), Meta_GetIconHandle(I_MENUOFF));
+ Menu_ModifyItem(hMenuOnOff, LPGENW("Toggle metacontacts on"), Meta_GetIconHandle(I_MENUOFF));
db_mc_enable(bToggled);
Meta_HideMetaContacts(!bToggled);
@@ -427,7 +427,7 @@ void InitMenus() if (!db_mc_isEnabled()) {
// modify main menu item
- Menu_ModifyItem(hMenuOnOff, LPGENT("Toggle metacontacts on"), Meta_GetIconHandle(I_MENUOFF));
+ Menu_ModifyItem(hMenuOnOff, LPGENW("Toggle metacontacts on"), Meta_GetIconHandle(I_MENUOFF));
Meta_HideMetaContacts(true);
}
else {
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index 4961d73f12..99d31ad899 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, L"X", _TRUNCATE);
+ wcsncpy_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);
}
@@ -654,7 +654,7 @@ int Meta_ModulesLoaded(WPARAM, LPARAM) StatusIconData sid = { sizeof(sid) };
sid.szModule = META_PROTO;
sid.flags = MBF_TCHAR;
- sid.tszTooltip = LPGENT("Select metacontact");
+ sid.tszTooltip = LPGENW("Select metacontact");
sid.hIcon = Skin_LoadProtoIcon(META_PROTO, ID_STATUS_ONLINE);
Srmm_AddIcon(&sid);
return 0;
@@ -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, L"X", _TRUNCATE);
+ wcsncpy_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 99e307af66..ddf0937972 100644 --- a/src/mir_app/src/meta_utils.cpp +++ b/src/mir_app/src/meta_utils.cpp @@ -140,7 +140,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) // write status string
mir_snprintf(buffer, "StatusString%d", ccDest->nSubs);
- TCHAR *szStatus = cli.pfnGetStatusModeDescription(status, 0);
+ wchar_t *szStatus = cli.pfnGetStatusModeDescription(status, 0);
db_set_ts(hMeta, META_PROTO, buffer, szStatus);
// Write the link in the contact
@@ -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, L"X", _TRUNCATE);
+ wcsncpy_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);
@@ -438,7 +438,7 @@ int Meta_CopyContactNick(DBCachedContact *ccMeta, MCONTACT hContact) }
}
else if (options.clist_contact_name == CNNT_DISPLAYNAME) {
- TCHAR *name = cli.pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = cli.pfnGetContactDisplayName(hContact, 0);
if (name && mir_tstrcmp(name, TranslateT("(Unknown contact)")) != 0) {
db_set_ts(ccMeta->contactID, META_PROTO, "Nick", name);
return 0;
diff --git a/src/mir_app/src/metacontacts.h b/src/mir_app/src/metacontacts.h index e0a3210c2e..c47b419729 100644 --- a/src/mir_app/src/metacontacts.h +++ b/src/mir_app/src/metacontacts.h @@ -124,6 +124,6 @@ extern POINT menuMousePoint; #ifndef MS_CLUI_GETVERSION
#define MS_CLUI_GETVERSION "CLUI/GetVersion"
-#define szDelMsg LPGEN("You are going to remove all the contacts associated with this metacontact.\nThis will delete the metacontact.\n\nProceed anyway?")
+#define szDelMsg LPGENW("You are going to remove all the contacts associated with this metacontact.\nThis will delete the metacontact.\n\nProceed anyway?")
#endif
diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp index 12886122d8..f09b54e83c 100644 --- a/src/mir_app/src/miranda.cpp +++ b/src/mir_app/src/miranda.cpp @@ -179,7 +179,7 @@ INT_PTR CheckRestart() {
LPCTSTR tszPID = CmdLine_GetOption(L"restart");
if (tszPID) {
- HANDLE hProcess = OpenProcess(SYNCHRONIZE, FALSE, _ttol(tszPID));
+ HANDLE hProcess = OpenProcess(SYNCHRONIZE, FALSE, _wtol(tszPID));
if (hProcess) {
INT_PTR result = DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_WAITRESTART), NULL, WaitForProcessDlgProc, (LPARAM)hProcess);
CloseHandle(hProcess);
@@ -324,7 +324,7 @@ static INT_PTR OkToExit(WPARAM, LPARAM) static INT_PTR GetMirandaVersion(WPARAM, LPARAM)
{
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
GetModuleFileName(g_hInst, filename, _countof(filename));
DWORD unused, verInfoSize = GetFileVersionInfoSize(filename, &unused);
@@ -343,7 +343,7 @@ static INT_PTR GetMirandaVersion(WPARAM, LPARAM) static INT_PTR GetMirandaFileVersion(WPARAM, LPARAM lParam)
{
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
GetModuleFileName(g_hInst, filename, _countof(filename));
DWORD unused, verInfoSize = GetFileVersionInfoSize(filename, &unused);
@@ -364,7 +364,7 @@ static INT_PTR GetMirandaFileVersion(WPARAM, LPARAM lParam) static INT_PTR GetMirandaVersionText(WPARAM wParam, LPARAM lParam)
{
- TCHAR filename[MAX_PATH], *productVersion;
+ wchar_t filename[MAX_PATH], *productVersion;
GetModuleFileName(g_hInst, filename, _countof(filename));
DWORD unused, verInfoSize = GetFileVersionInfoSize(filename, &unused);
diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h index 0a46080262..c83fa8e4bf 100644 --- a/src/mir_app/src/miranda.h +++ b/src/mir_app/src/miranda.h @@ -64,7 +64,7 @@ void UninitIni(void); extern HINSTANCE g_hInst;
extern DWORD hMainThreadId;
extern HANDLE hOkToExitEvent, hModulesLoadedEvent, hevLoadModule, hevUnloadModule;
-extern TCHAR mirandabootini[MAX_PATH];
+extern wchar_t mirandabootini[MAX_PATH];
/**** newplugins.cpp *******************************************************************/
@@ -92,7 +92,7 @@ __forceinline char* Utf8DecodeA(const char* src) /**** options.cpp **********************************************************************/
-HTREEITEM FindNamedTreeItemAtRoot(HWND hwndTree, const TCHAR* name);
+HTREEITEM FindNamedTreeItemAtRoot(HWND hwndTree, const wchar_t* name);
/**** skinicons.cpp ********************************************************************/
@@ -137,7 +137,7 @@ extern LIST<PROTOCOLDESCRIPTOR> protos; INT_PTR ProtoCallService(LPCSTR szModule, const char *szService, WPARAM wParam, LPARAM lParam);
-PROTOACCOUNT* Proto_CreateAccount(const char *szModuleName, const char *szBaseProto, const TCHAR *tszAccountName);
+PROTOACCOUNT* Proto_CreateAccount(const char *szModuleName, const char *szBaseProto, const wchar_t *tszAccountName);
PROTOACCOUNT* __fastcall Proto_GetAccount(MCONTACT hContact);
@@ -160,7 +160,7 @@ INT_PTR stubChainRecv(WPARAM, LPARAM); /**** utils.cpp ************************************************************************/
-void HotkeyToName(TCHAR *buf, int size, BYTE shift, BYTE key);
+void HotkeyToName(wchar_t *buf, int size, BYTE shift, BYTE key);
WORD GetHotkeyValue(INT_PTR idHotkey);
HBITMAP ConvertIconToBitmap(HIMAGELIST hIml, int iconId);
diff --git a/src/mir_app/src/movetogroup.cpp b/src/mir_app/src/movetogroup.cpp index 59f34959ee..318be7e4d9 100644 --- a/src/mir_app/src/movetogroup.cpp +++ b/src/mir_app/src/movetogroup.cpp @@ -31,10 +31,10 @@ static LIST<HANDLE> lphGroupsItems(5); struct GroupItemSort
{
- TCHAR* name;
+ wchar_t* name;
int position;
- GroupItemSort(TCHAR* pname, int pos)
+ GroupItemSort(wchar_t* pname, int pos)
: name(mir_tstrdup(pname)), position(pos)
{
}
@@ -47,13 +47,13 @@ struct GroupItemSort }
};
-static TCHAR* PrepareGroupName(TCHAR* str)
+static wchar_t* PrepareGroupName(wchar_t* str)
{
- TCHAR* p = _tcschr(str, '&'), *d;
+ wchar_t* p = wcschr(str, '&'), *d;
if (p == NULL)
return mir_tstrdup(str);
- d = p = (TCHAR*)mir_alloc(sizeof(TCHAR)*(2 * mir_tstrlen(str) + 1));
+ d = p = (wchar_t*)mir_alloc(sizeof(wchar_t)*(2 * mir_tstrlen(str) + 1));
while (*str) {
if (*str == '&')
*d++ = '&';
@@ -64,12 +64,12 @@ static TCHAR* PrepareGroupName(TCHAR* str) return p;
}
-static void AddGroupItem(HGENMENU hRoot, TCHAR* name, int pos, WPARAM param, bool checked)
+static void AddGroupItem(HGENMENU hRoot, wchar_t* name, int pos, WPARAM param, bool checked)
{
CMenuItem mi;
mi.root = hRoot;
mi.position = pos;
- mi.name.t = PrepareGroupName(name);
+ mi.name.w = PrepareGroupName(name);
mi.flags = CMIF_SYSTEM | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
if (checked)
mi.flags |= CMIF_CHECKED;
@@ -78,7 +78,7 @@ static void AddGroupItem(HGENMENU hRoot, TCHAR* name, int pos, WPARAM param, boo Menu_ConfigureItem(result, MCI_OPT_EXECPARAM, param);
lphGroupsItems.insert((HANDLE*)result);
- mir_free(mi.name.t);
+ mir_free(mi.name.w);
}
// service
diff --git a/src/mir_app/src/netlib.h b/src/mir_app/src/netlib.h index f653de6f8f..0332a61a2a 100644 --- a/src/mir_app/src/netlib.h +++ b/src/mir_app/src/netlib.h @@ -283,9 +283,9 @@ void NetlibUPnPDestroy(void); //netlibsecurity.c
void NetlibSecurityInit(void);
void NetlibDestroySecurityProvider(HANDLE hSecurity);
-HANDLE NetlibInitSecurityProvider(const TCHAR* szProvider, const TCHAR* szPrincipal);
+HANDLE NetlibInitSecurityProvider(const wchar_t* szProvider, const wchar_t* szPrincipal);
HANDLE NetlibInitSecurityProvider(const char* szProvider, const char* szPrincipal);
-char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, const TCHAR* login, const TCHAR* psw,
+char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, const wchar_t* login, const wchar_t* psw,
bool http, unsigned& complete);
static __inline INT_PTR NLSend(NetlibConnection *nlc, const char *buf, int len, int flags) {
diff --git a/src/mir_app/src/netliblog.cpp b/src/mir_app/src/netliblog.cpp index b65e7f1d0a..7afeb86917 100644 --- a/src/mir_app/src/netliblog.cpp +++ b/src/mir_app/src/netliblog.cpp @@ -68,7 +68,7 @@ static void InitLog() if (mir_tstrlen(szBuf)) {
logOptions.tszUserFile = szBuf.get();
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
PathToAbsoluteT(VARST(szBuf), path);
logOptions.tszFile = path;
}
@@ -78,20 +78,20 @@ static void InitLog() }
if (logOptions.toFile)
- hLogger = mir_createLog("Netlib", LPGENT("Standard Netlib log"), logOptions.tszFile, 0);
+ hLogger = mir_createLog("Netlib", LPGENW("Standard Netlib log"), logOptions.tszFile, 0);
}
-static const TCHAR* szTimeFormats[] =
+static const wchar_t* szTimeFormats[] =
{
- LPGENT("No times"),
- LPGENT("Standard hh:mm:ss times"),
- LPGENT("Times in milliseconds"),
- LPGENT("Times in microseconds")
+ LPGENW("No times"),
+ LPGENW("Standard hh:mm:ss times"),
+ LPGENW("Times in milliseconds"),
+ LPGENW("Times in microseconds")
};
static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
switch (message) {
case WM_INITDIALOG:
@@ -147,7 +147,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa if ((HWND)lParam == GetFocus())
CheckDlgButton(hwndDlg, IDC_TOFILE, BST_CHECKED);
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetWindowText((HWND)lParam, path, _countof(path));
PathToAbsoluteT(VARST(path), path);
@@ -159,7 +159,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa case IDC_RUNATSTARTBROWSE:
GetWindowText(GetWindow((HWND)lParam, GW_HWNDPREV), str, _countof(str));
{
- TCHAR filter[200];
+ wchar_t filter[200];
mir_sntprintf(filter, L"%s (*)%c*%c", TranslateT("All files"), 0, 0);
OPENFILENAME ofn = { 0 };
@@ -182,8 +182,8 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa else if (!GetOpenFileName(&ofn))
return 1;
- if (LOWORD(wParam) == IDC_RUNATSTARTBROWSE && _tcschr(str, ' ') != NULL) {
- memmove(str + 1, str, ((_countof(str) - 2) * sizeof(TCHAR)));
+ if (LOWORD(wParam) == IDC_RUNATSTARTBROWSE && wcschr(str, ' ') != NULL) {
+ memmove(str + 1, str, ((_countof(str) - 2) * sizeof(wchar_t)));
str[0] = '"';
mir_tstrcat(str, L"\"");
}
diff --git a/src/mir_app/src/netlibopts.cpp b/src/mir_app/src/netlibopts.cpp index 1423761260..ffdde641fd 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("<mixed>"), L"SOCKS4", L"SOCKS5", L"HTTP", L"HTTPS", L"Internet Explorer"};
+static const wchar_t* szProxyTypes[] = {LPGENW("<mixed>"), 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)
@@ -338,7 +338,7 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, break;
case M_REFRESHENABLING:
- TCHAR str[80];
+ wchar_t str[80];
{
int selectedProxyType = SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_GETCURSEL, 0, 0), 0);
mir_sntprintf(str, TranslateT("(often %d)"), oftenProxyPorts[selectedProxyType]);
diff --git a/src/mir_app/src/netlibsecurity.cpp b/src/mir_app/src/netlibsecurity.cpp index 24d095ec00..981a2b4dcd 100644 --- a/src/mir_app/src/netlibsecurity.cpp +++ b/src/mir_app/src/netlibsecurity.cpp @@ -35,8 +35,8 @@ struct NtlmHandleType {
CtxtHandle hClientContext;
CredHandle hClientCredential;
- TCHAR* szProvider;
- TCHAR* szPrincipal;
+ wchar_t* szProvider;
+ wchar_t* szPrincipal;
unsigned cbMaxToken;
bool hasDomain;
};
@@ -73,7 +73,7 @@ static void ReportSecError(SECURITY_STATUS scRet, int line) NetlibLogf(NULL, "Security error 0x%x on line %u (%s)", scRet, line, szMsgBuf);
}
-HANDLE NetlibInitSecurityProvider(const TCHAR* szProvider, const TCHAR* szPrincipal)
+HANDLE NetlibInitSecurityProvider(const wchar_t* szProvider, const wchar_t* szPrincipal)
{
HANDLE hSecurity = NULL;
@@ -91,7 +91,7 @@ HANDLE NetlibInitSecurityProvider(const TCHAR* szProvider, const TCHAR* szPrinci PSecPkgInfo ntlmSecurityPackageInfo;
bool isGSSAPI = mir_tstrcmpi(szProvider, L"GSSAPI") == 0;
- const TCHAR *szProviderC = isGSSAPI ? L"Kerberos" : szProvider;
+ const wchar_t *szProviderC = isGSSAPI ? L"Kerberos" : szProvider;
SECURITY_STATUS sc = QuerySecurityPackageInfo((LPTSTR)szProviderC, &ntlmSecurityPackageInfo);
if (sc == SEC_E_OK) {
NtlmHandleType* hNtlm;
@@ -201,7 +201,7 @@ char* CompleteGssapi(HANDLE hSecurity, unsigned char *szChallenge, unsigned chls return mir_base64_encode(response, ressz);
}
-char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, const TCHAR* login, const TCHAR* psw, bool http, unsigned& complete)
+char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, const wchar_t* login, const wchar_t* psw, bool http, unsigned& complete)
{
if (hSecurity == NULL || ntlmCnt == 0)
return NULL;
@@ -215,7 +215,7 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, NtlmHandleType* hNtlm = (NtlmHandleType*)hSecurity;
if (mir_tstrcmpi(hNtlm->szProvider, L"Basic")) {
bool isGSSAPI = mir_tstrcmpi(hNtlm->szProvider, L"GSSAPI") == 0;
- TCHAR *szProvider = isGSSAPI ? (TCHAR*)L"Kerberos" : hNtlm->szProvider;
+ wchar_t *szProvider = isGSSAPI ? (wchar_t*)L"Kerberos" : hNtlm->szProvider;
bool hasChallenge = szChallenge != NULL && szChallenge[0] != '\0';
if (hasChallenge) {
unsigned tokenLen;
@@ -252,9 +252,9 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, if (domainLen) {
size_t newLoginLen = mir_tstrlen(login) + domainLen + 1;
- TCHAR *newLogin = (TCHAR*)alloca(newLoginLen * sizeof(TCHAR));
+ wchar_t *newLogin = (wchar_t*)alloca(newLoginLen * sizeof(wchar_t));
- _tcsncpy(newLogin, domainName, domainLen);
+ wcsncpy(newLogin, domainName, domainLen);
newLogin[domainLen] = '\\';
mir_tstrcpy(newLogin + domainLen + 1, login);
@@ -277,8 +277,8 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, NetlibLogf(NULL, "Security login requested, user: %S pssw: %s", login, psw ? "(exist)" : "(no psw)");
- const TCHAR* loginName = login;
- const TCHAR* domainName = _tcschr(login, '\\');
+ const wchar_t* loginName = login;
+ const wchar_t* domainName = wcschr(login, '\\');
size_t domainLen = 0;
size_t loginLen = mir_tstrlen(loginName);
if (domainName != NULL) {
@@ -287,7 +287,7 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, domainLen = domainName - login;
domainName = login;
}
- else if ((domainName = _tcschr(login, '@')) != NULL) {
+ else if ((domainName = wcschr(login, '@')) != NULL) {
loginName = login;
loginLen = domainName - login;
domainLen = mir_tstrlen(++domainName);
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index 6b187cc73f..1e1bb4c995 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -61,7 +61,7 @@ MUUID miid_ssl = MIID_SSL; static BOOL bModuleInitialized = FALSE;
-TCHAR mirandabootini[MAX_PATH];
+wchar_t mirandabootini[MAX_PATH];
static DWORD mirandaVersion;
static int sttFakeID = -100;
static HANDLE hPluginListHeap = NULL;
@@ -256,7 +256,7 @@ static int checkPI(BASIC_PLUGIN_INFO* bpi, PLUGININFOEX* pi) return TRUE;
}
-int checkAPI(TCHAR* plugin, BASIC_PLUGIN_INFO* bpi, DWORD dwMirVer, int checkTypeAPI)
+int checkAPI(wchar_t* plugin, BASIC_PLUGIN_INFO* bpi, DWORD dwMirVer, int checkTypeAPI)
{
HINSTANCE h = LoadLibrary(plugin);
if (h == NULL)
@@ -370,9 +370,9 @@ int Plugin_UnloadDyn(pluginEntry *p) }
// returns true if the given file is <anything>.dll exactly
-static int valid_library_name(TCHAR *name)
+static int valid_library_name(wchar_t *name)
{
- TCHAR *dot = _tcsrchr(name, '.');
+ wchar_t *dot = wcsrchr(name, '.');
if (dot != NULL && mir_tstrcmpi(dot + 1, L"dll") == 0)
if (dot[4] == 0)
return 1;
@@ -383,12 +383,12 @@ static int valid_library_name(TCHAR *name) void enumPlugins(SCAN_PLUGINS_CALLBACK cb, WPARAM wParam, LPARAM lParam)
{
// get miranda's exe path
- TCHAR exe[MAX_PATH];
+ wchar_t exe[MAX_PATH];
GetModuleFileName(NULL, exe, _countof(exe));
- TCHAR *p = _tcsrchr(exe, '\\'); if (p) *p = 0;
+ wchar_t *p = wcsrchr(exe, '\\'); if (p) *p = 0;
// create the search filter
- TCHAR search[MAX_PATH];
+ wchar_t search[MAX_PATH];
mir_sntprintf(search, L"%s\\Plugins\\*.dll", exe);
// FFFN will return filenames for things like dot dll+ or dot dllx
@@ -404,15 +404,15 @@ void enumPlugins(SCAN_PLUGINS_CALLBACK cb, WPARAM wParam, LPARAM lParam) FindClose(hFind);
}
-pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path)
+pluginEntry* OpenPlugin(wchar_t *tszFileName, wchar_t *dir, wchar_t *path)
{
pluginEntry *p = (pluginEntry*)HeapAlloc(hPluginListHeap, HEAP_NO_SERIALIZE | HEAP_ZERO_MEMORY, sizeof(pluginEntry));
- _tcsncpy_s(p->pluginname, tszFileName, _TRUNCATE);
+ wcsncpy_s(p->pluginname, tszFileName, _TRUNCATE);
// add it to the list anyway
pluginList.insert(p);
- TCHAR tszFullPath[MAX_PATH];
+ wchar_t tszFullPath[MAX_PATH];
mir_sntprintf(tszFullPath, L"%s\\%s\\%s", path, dir, tszFileName);
// map dll into the memory and check its exports
@@ -471,17 +471,17 @@ pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path) return p;
}
-void SetPluginOnWhiteList(const TCHAR* pluginname, int allow)
+void SetPluginOnWhiteList(const wchar_t* pluginname, int allow)
{
db_set_b(NULL, PLUGINDISABLELIST, _strlwr(_T2A(pluginname)), allow == 0);
}
// returns 1 if the plugin should be enabled within this profile, filename is always lower case
-int isPluginOnWhiteList(const TCHAR* pluginname)
+int isPluginOnWhiteList(const wchar_t* pluginname)
{
int rc = db_get_b(NULL, PLUGINDISABLELIST, _strlwr(_T2A(pluginname)), 0);
if (rc != 0 && askAboutIgnoredPlugins) {
- TCHAR buf[256];
+ wchar_t buf[256];
mir_sntprintf(buf, TranslateT("'%s' is disabled, re-enable?"), pluginname);
if (MessageBox(NULL, buf, TranslateT("Re-enable Miranda plugin?"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
SetPluginOnWhiteList(pluginname, 1);
@@ -494,9 +494,9 @@ int isPluginOnWhiteList(const TCHAR* pluginname) bool TryLoadPlugin(pluginEntry *p, bool bDynamic)
{
- TCHAR exe[MAX_PATH], tszFullPath[MAX_PATH];
+ wchar_t exe[MAX_PATH], tszFullPath[MAX_PATH];
GetModuleFileName(NULL, exe, _countof(exe));
- TCHAR* slice = _tcsrchr(exe, '\\');
+ wchar_t* slice = wcsrchr(exe, '\\');
if (slice)
*slice = 0;
@@ -557,13 +557,13 @@ bool TryLoadPlugin(pluginEntry *p, bool bDynamic) /////////////////////////////////////////////////////////////////////////////////////////
// Core plugins support
-static TCHAR tszCoreErr[] = LPGENT("Core plugin '%s' cannot be loaded or missing. Miranda will exit now");
+static wchar_t tszCoreErr[] = LPGENW("Core plugin '%s' cannot be loaded or missing. Miranda will exit now");
bool LoadCorePlugin(MuuidReplacement &mr)
{
- TCHAR exe[MAX_PATH], tszPlugName[MAX_PATH];
+ wchar_t exe[MAX_PATH], tszPlugName[MAX_PATH];
GetModuleFileName(NULL, exe, _countof(exe));
- TCHAR *p = _tcsrchr(exe, '\\'); if (p) *p = 0;
+ wchar_t *p = wcsrchr(exe, '\\'); if (p) *p = 0;
mir_sntprintf(tszPlugName, L"%s.dll", mr.stdplugname);
pluginEntry* pPlug = OpenPlugin(tszPlugName, L"Core", exe);
@@ -594,7 +594,7 @@ LBL_Error: /////////////////////////////////////////////////////////////////////////////////////////
// Contact list plugins support
-static bool loadClistModule(TCHAR* exe, pluginEntry *p)
+static bool loadClistModule(wchar_t* exe, pluginEntry *p)
{
BASIC_PLUGIN_INFO bpi;
if (checkAPI(exe, &bpi, mirandaVersion, CHECKAPI_CLIST)) {
@@ -614,9 +614,9 @@ static bool loadClistModule(TCHAR* exe, pluginEntry *p) return false;
}
-static pluginEntry* getCListModule(TCHAR *exe)
+static pluginEntry* getCListModule(wchar_t *exe)
{
- TCHAR tszFullPath[MAX_PATH];
+ wchar_t tszFullPath[MAX_PATH];
for (int i = 0; i < clistPlugins.getCount(); i++) {
pluginEntry *p = clistPlugins[i];
@@ -638,7 +638,7 @@ static pluginEntry* getCListModule(TCHAR *exe) return NULL;
}
-int UnloadPlugin(TCHAR* buf, int bufLen)
+int UnloadPlugin(wchar_t* buf, int bufLen)
{
for (int i = pluginList.getCount() - 1; i >= 0; i--) {
pluginEntry *p = pluginList[i];
@@ -689,7 +689,7 @@ int LoadDefaultServiceModePlugin() size_t cbLen = mir_tstrlen(param);
for (int i = 0; i < servicePlugins.getCount(); i++) {
pluginEntry *p = servicePlugins[i];
- if (!_tcsnicmp(p->pluginname, param, cbLen)) {
+ if (!wcsnicmp(p->pluginname, param, cbLen)) {
int res = LaunchServicePlugin(p);
if (res == SERVICE_ONLYDB) // load it later
serviceModePlugin = p;
@@ -772,9 +772,9 @@ void UnloadNewPlugins(void) int LoadNewPluginsModule(void)
{
// make full path to the plugin
- TCHAR exe[MAX_PATH], fullPath[MAX_PATH];
+ wchar_t exe[MAX_PATH], fullPath[MAX_PATH];
GetModuleFileName(NULL, exe, _countof(exe));
- TCHAR *slice = _tcsrchr(exe, '\\');
+ wchar_t *slice = wcsrchr(exe, '\\');
if (slice)
*slice = 0;
@@ -834,7 +834,7 @@ int LoadNewPluginsModule(void) // Plugins module initialization
// called before anything real is loaded, incl. database
-static BOOL scanPluginsDir(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM)
+static BOOL scanPluginsDir(WIN32_FIND_DATA *fd, wchar_t *path, WPARAM, LPARAM)
{
pluginEntry *p = OpenPlugin(fd->cFileName, L"Plugins", path);
if (!(p->pclass & PCLASS_FAILED)) {
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index 61d1d81b16..f26424a933 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -28,8 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define FILTER_TIMEOUT_TIMER 10012
-#define ALL_MODULES_FILTER LPGEN("<all modules>")
-#define CORE_MODULES_FILTER LPGEN("<core modules>")
+#define ALL_MODULES_FILTER LPGENW("<all modules>")
+#define CORE_MODULES_FILTER LPGENW("<core modules>")
int LangpackOptionsInit(WPARAM, LPARAM);
@@ -92,17 +92,17 @@ struct OptionsPageData : public MZeroedObject hLangpack = src->hLangpack;
if (src->flags & ODPF_UNICODE)
- ptszTitle = mir_tstrdup(src->ptszTitle);
+ ptszTitle = mir_tstrdup(src->pwszTitle);
else
ptszTitle = mir_a2t(src->pszTitle);
if (src->flags & ODPF_UNICODE)
- ptszGroup = mir_tstrdup(src->ptszGroup);
+ ptszGroup = mir_tstrdup(src->pwszGroup);
else
ptszGroup = mir_a2t(src->pszGroup);
if (src->flags & ODPF_UNICODE)
- ptszTab = mir_tstrdup(src->ptszTab);
+ ptszTab = mir_tstrdup(src->pwszTab);
else
ptszTab = mir_a2t(src->pszTab);
}
@@ -115,7 +115,7 @@ struct OptionsPageData : public MZeroedObject CDlgBase *pDialog;
int hLangpack;
- ptrT ptszTitle, ptszGroup, ptszTab;
+ ptrW ptszTitle, ptszGroup, ptszTab;
HTREEITEM hTreeItem;
int changed;
int height;
@@ -126,7 +126,7 @@ struct OptionsPageData : public MZeroedObject __forceinline HWND getHwnd() const { return pDialog->GetHwnd(); }
__forceinline HINSTANCE getInst() const { return pDialog->GetInst(); }
- __forceinline TCHAR* getString(TCHAR *ptszStr)
+ __forceinline wchar_t* getString(wchar_t *ptszStr)
{
if (flags & ODPF_DONTTRANSLATE)
return ptszStr;
@@ -146,7 +146,7 @@ struct OptionsDlgData : public MZeroedObject RECT rcDisplay;
RECT rcTab;
HFONT hBoldFont;
- TCHAR szFilterString[1024];
+ wchar_t szFilterString[1024];
HANDLE hPluginLoad, hPluginUnload;
OptionsPageData* getCurrent() const
@@ -154,9 +154,9 @@ struct OptionsDlgData : public MZeroedObject }
};
-HTREEITEM FindNamedTreeItemAtRoot(HWND hwndTree, const TCHAR* name)
+HTREEITEM FindNamedTreeItemAtRoot(HWND hwndTree, const wchar_t* name)
{
- TCHAR str[128];
+ wchar_t str[128];
TVITEM tvi;
tvi.mask = TVIF_TEXT;
tvi.pszText = str;
@@ -172,9 +172,9 @@ HTREEITEM FindNamedTreeItemAtRoot(HWND hwndTree, const TCHAR* name) return NULL;
}
-static HTREEITEM FindNamedTreeItemAtChildren(HWND hwndTree, HTREEITEM hItem, const TCHAR* name)
+static HTREEITEM FindNamedTreeItemAtChildren(HWND hwndTree, HTREEITEM hItem, const wchar_t* name)
{
- TCHAR str[128];
+ wchar_t str[128];
TVITEM tvi;
tvi.mask = TVIF_TEXT;
tvi.pszText = str;
@@ -192,7 +192,7 @@ static HTREEITEM FindNamedTreeItemAtChildren(HWND hwndTree, HTREEITEM hItem, con static BOOL CALLBACK BoldGroupTitlesEnumChildren(HWND hwnd, LPARAM lParam)
{
- TCHAR szClass[64];
+ wchar_t szClass[64];
GetClassName(hwnd, szClass, _countof(szClass));
if (!mir_tstrcmp(szClass, L"Button") && (GetWindowLongPtr(hwnd, GWL_STYLE) & 0x0F) == BS_GROUPBOX)
@@ -230,17 +230,17 @@ static void ThemeDialogBackground(HWND hwnd, BOOL tabbed) EnableThemeDialogTexture(hwnd, (tabbed ? ETDT_ENABLE : ETDT_DISABLE) | ETDT_USETABTEXTURE);
}
-static TCHAR* GetPluginName(HINSTANCE hInstance, TCHAR *buffer, int size)
+static wchar_t* GetPluginName(HINSTANCE hInstance, wchar_t *buffer, int size)
{
- TCHAR tszModuleName[MAX_PATH];
+ wchar_t tszModuleName[MAX_PATH];
GetModuleFileName(hInstance, tszModuleName, _countof(tszModuleName));
- TCHAR *dllName = _tcsrchr(tszModuleName, '\\');
+ wchar_t *dllName = wcsrchr(tszModuleName, '\\');
if (!dllName)
dllName = tszModuleName;
else
dllName++;
- _tcsncpy_s(buffer, size, dllName, _TRUNCATE);
+ wcsncpy_s(buffer, size, dllName, _TRUNCATE);
return buffer;
}
@@ -270,7 +270,7 @@ static void FindFilterStrings(int enableKeywordFiltering, int current, HWND hWnd DWORD key = GetPluginPageHash(page); // get the plugin page hash
- TCHAR pluginName[MAX_PATH];
+ wchar_t pluginName[MAX_PATH];
char *temp = GetPluginNameByInstance(page->getInst());
GetDialogStrings(enableKeywordFiltering, key, GetPluginName(page->getInst(), pluginName, _countof(pluginName)), hWnd, page->ptszGroup, page->ptszTitle, page->ptszTab, _A2T(temp));
@@ -278,7 +278,7 @@ static void FindFilterStrings(int enableKeywordFiltering, int current, HWND hWnd DestroyWindow(hWnd); // destroy the page, we're done with it
}
-static int MatchesFilter(const OptionsPageData *page, TCHAR *szFilterString)
+static int MatchesFilter(const OptionsPageData *page, wchar_t *szFilterString)
{
return ContainsFilterString(GetPluginPageHash(page), szFilterString);
}
@@ -297,7 +297,7 @@ static LRESULT CALLBACK OptionsFilterSubclassProc(HWND hWnd, UINT message, WPARA PAINTSTRUCT paint;
HDC hdc = (message == WM_PAINT) ? BeginPaint(hWnd, &paint) : (HDC)wParam;
- TCHAR buf[255];
+ wchar_t buf[255];
if (bSearchState == 1 && FilterLoadProgress < 100 && FilterLoadProgress > 0)
mir_sntprintf(buf, TranslateT("Loading... %d%%"), FilterLoadProgress);
else
@@ -481,9 +481,9 @@ static void FillFilterCombo(HWND hDlg, OptionsDlgData* dat) HINSTANCE *KnownInstances = (HINSTANCE*)alloca(sizeof(HINSTANCE)*dat->arOpd.getCount());
int countKnownInst = 0;
SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_RESETCONTENT, 0, 0);
- int index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_ADDSTRING, 0, (LPARAM)TranslateT(ALL_MODULES_FILTER));
+ int index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_ADDSTRING, 0, (LPARAM)ALL_MODULES_FILTER);
SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_SETITEMDATA, (WPARAM)index, 0);
- index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_ADDSTRING, 0, (LPARAM)TranslateT(CORE_MODULES_FILTER));
+ index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_ADDSTRING, 0, (LPARAM)CORE_MODULES_FILTER);
SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_SETITEMDATA, (WPARAM)index, (LPARAM)g_hInst);
for (int i = 0; i < dat->arOpd.getCount(); i++) {
@@ -504,11 +504,11 @@ static void FillFilterCombo(HWND hDlg, OptionsDlgData* dat) KnownInstances[countKnownInst] = inst;
countKnownInst++;
- TCHAR tszModuleName[MAX_PATH];
+ wchar_t tszModuleName[MAX_PATH];
GetModuleFileName(inst, tszModuleName, _countof(tszModuleName));
- TCHAR *dllName = mir_a2t(GetPluginNameByInstance(inst));
- if (!dllName) dllName = mir_tstrdup(_tcsrchr(tszModuleName, _T('\\')));
+ wchar_t *dllName = mir_a2t(GetPluginNameByInstance(inst));
+ if (!dllName) dllName = mir_tstrdup(wcsrchr(tszModuleName, '\\'));
if (!dllName) dllName = mir_tstrdup(tszModuleName);
if (dllName) {
index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_ADDSTRING, 0, (LPARAM)dllName);
@@ -527,33 +527,33 @@ static void RebuildPageTree(HWND hdlg, OptionsDlgData *dat) // if filter string is set to all modules then make the filter string empty (this will return all modules)
BOOL bRemoveFocusFromFilter = FALSE;
- if (mir_tstrcmp(dat->szFilterString, TranslateT(ALL_MODULES_FILTER)) == 0) {
+ if (mir_tstrcmp(dat->szFilterString, ALL_MODULES_FILTER) == 0) {
dat->szFilterString[0] = 0;
bRemoveFocusFromFilter = TRUE;
}
// if filter string is set to core modules replace it with the name of the executable (this will return all core modules)
- else if (mir_tstrcmp(dat->szFilterString, TranslateT(CORE_MODULES_FILTER)) == 0) {
+ else if (mir_tstrcmp(dat->szFilterString, CORE_MODULES_FILTER) == 0) {
// replace string with process name - that will show core settings
- TCHAR szFileName[300];
+ wchar_t szFileName[300];
GetModuleFileName(g_hInst, szFileName, _countof(szFileName));
- TCHAR *pos = _tcsrchr(szFileName, _T('\\'));
+ wchar_t *pos = wcsrchr(szFileName, '\\');
if (pos)
pos++;
else
pos = szFileName;
- _tcsncpy_s(dat->szFilterString, pos, _TRUNCATE);
+ wcsncpy_s(dat->szFilterString, pos, _TRUNCATE);
}
else {
int sel = SendDlgItemMessage(hdlg, IDC_KEYWORD_FILTER, (UINT)CB_GETCURSEL, 0, 0);
if (sel != -1) {
HINSTANCE hinst = (HINSTANCE)SendDlgItemMessage(hdlg, IDC_KEYWORD_FILTER, (UINT)CB_GETITEMDATA, sel, 0);
- TCHAR szFileName[300];
+ wchar_t szFileName[300];
GetModuleFileName(hinst, szFileName, _countof(szFileName));
- TCHAR *pos = _tcsrchr(szFileName, _T('\\'));
+ wchar_t *pos = wcsrchr(szFileName, '\\');
if (pos) pos++;
else pos = szFileName;
- _tcsncpy_s(dat->szFilterString, pos, _TRUNCATE);
+ wcsncpy_s(dat->szFilterString, pos, _TRUNCATE);
}
}
@@ -588,9 +588,9 @@ static void RebuildPageTree(HWND hdlg, OptionsDlgData *dat) continue;
opd = dat->arOpd[i];
- TCHAR *ptszGroup = TranslateTH(opd->hLangpack, opd->ptszGroup);
- TCHAR *ptszTitle = opd->getString(opd->ptszTitle), *useTitle;
- TCHAR *ptszTab = TranslateTH(opd->hLangpack, opd->ptszTab);
+ wchar_t *ptszGroup = TranslateTH(opd->hLangpack, opd->ptszGroup);
+ wchar_t *ptszTitle = opd->getString(opd->ptszTitle), *useTitle;
+ wchar_t *ptszTab = TranslateTH(opd->hLangpack, opd->ptszTab);
tvis.hParent = NULL;
useTitle = ptszTitle;
@@ -823,8 +823,8 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L else
dat->arOpd.insert(opd);
- if (!mir_tstrcmp(lastPage, odp->ptszTitle) && !mir_tstrcmp(lastGroup, odp->ptszGroup))
- if ((ood->pszTab == NULL && dat->currentPage == -1) || !mir_tstrcmp(lastTab, odp->ptszTab))
+ if (!mir_tstrcmp(lastPage, odp->pwszTitle) && !mir_tstrcmp(lastGroup, odp->pwszGroup))
+ if ((ood->pszTab == NULL && dat->currentPage == -1) || !mir_tstrcmp(lastTab, odp->pwszTab))
dat->currentPage = (int)i;
}
@@ -1147,7 +1147,7 @@ void OpenAccountOptions(PROTOACCOUNT *pa) if (opi.pageCount == 0)
return;
- TCHAR tszTitle[100];
+ wchar_t tszTitle[100];
mir_sntprintf(tszTitle, TranslateT("%s options"), pa->tszAccountName);
OPENOPTIONSDIALOG ood = { sizeof(ood) };
@@ -1254,29 +1254,29 @@ static INT_PTR AddOptionsPage(WPARAM wParam, LPARAM lParam) dst = opi->odp + opi->pageCount;
memcpy(dst, odp, sizeof(OPTIONSDIALOGPAGE));
- if (odp->ptszTitle != NULL) {
+ if (odp->pwszTitle != NULL) {
if (odp->flags & ODPF_UNICODE)
- dst->ptszTitle = mir_wstrdup(odp->ptszTitle);
+ dst->pwszTitle = mir_wstrdup(odp->pwszTitle);
else {
- dst->ptszTitle = mir_a2u(odp->pszTitle);
+ dst->pwszTitle = mir_a2u(odp->pszTitle);
dst->flags |= ODPF_UNICODE;
}
}
- if (odp->ptszGroup != NULL) {
+ if (odp->pwszGroup != NULL) {
if (odp->flags & ODPF_UNICODE)
- dst->ptszGroup = mir_wstrdup(odp->ptszGroup);
+ dst->pwszGroup = mir_wstrdup(odp->pwszGroup);
else {
- dst->ptszGroup = mir_a2t(odp->pszGroup);
+ dst->pwszGroup = mir_a2t(odp->pszGroup);
dst->flags |= ODPF_UNICODE;
}
}
- if (odp->ptszTab != NULL) {
+ if (odp->pwszTab != NULL) {
if (odp->flags & ODPF_UNICODE)
- dst->ptszTab = mir_wstrdup(odp->ptszTab);
+ dst->pwszTab = mir_wstrdup(odp->pwszTab);
else {
- dst->ptszTab = mir_a2t(odp->pszTab);
+ dst->pwszTab = mir_a2t(odp->pszTab);
dst->flags |= ODPF_UNICODE;
}
}
diff --git a/src/mir_app/src/options_ei.cpp b/src/mir_app/src/options_ei.cpp index ff8d2861c1..fb6f3778dd 100644 --- a/src/mir_app/src/options_ei.cpp +++ b/src/mir_app/src/options_ei.cpp @@ -131,7 +131,7 @@ class CExtraIconOptsDlg : public CDlgBase tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.iSelectedImage = tvis.item.iImage = img;
tvis.item.lParam = (LPARAM)ids;
- tvis.item.pszText = (TCHAR*)desc.c_str();
+ tvis.item.pszText = (wchar_t*)desc.c_str();
tvis.item.state = INDEXTOSTATEIMAGEMASK(selected ? 2 : 1);
return m_tree.InsertItem(&tvis);
}
diff --git a/src/mir_app/src/path.cpp b/src/mir_app/src/path.cpp index 96cc60358a..2dc0860a35 100644 --- a/src/mir_app/src/path.cpp +++ b/src/mir_app/src/path.cpp @@ -27,12 +27,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "../../../plugins/ExternalAPI/m_folders.h"
-extern TCHAR g_profileDir[MAX_PATH], g_shortProfileName[MAX_PATH];
+extern wchar_t g_profileDir[MAX_PATH], g_shortProfileName[MAX_PATH];
static HANDLE hAvatarFolder;
-static TCHAR tszAvatarRoot[MAX_PATH];
+static wchar_t tszAvatarRoot[MAX_PATH];
-TCHAR* GetContactID(MCONTACT hContact)
+wchar_t* GetContactID(MCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1)
@@ -51,7 +51,7 @@ static __forceinline int _xcsncmp(const char *s1, const char *s2, size_t n) { re static __forceinline size_t _xcslen(const char *s1) { return strlen(s1); }
static __forceinline char *_xcscpy(char *s1, const char *s2) { return strcpy(s1, s2); }
static __forceinline char *_xcsncpy(char *s1, const char *s2, size_t n) { return strncpy(s1, s2, n); }
-static __forceinline const char *_xstrselect(const char*, const char *s1, TCHAR*) { return s1; }
+static __forceinline const char *_xstrselect(const char*, const char *s1, wchar_t*) { return s1; }
static __forceinline char *_itox(char*, int a) { return itoa(a, (char *)mir_alloc(sizeof(char)*20), 10); }
static __forceinline char *mir_a2x(const char*, const char *s) { return mir_strdup(s); }
@@ -62,7 +62,7 @@ static __forceinline char *GetContactNickX(const char*, MCONTACT hContact) static __forceinline char *GetContactIDX(const char*, MCONTACT hContact)
{
- TCHAR *id = GetContactID(hContact);
+ wchar_t *id = GetContactID(hContact);
char* res = mir_t2a(id);
mir_free(id);
return res;
@@ -114,12 +114,12 @@ static __forceinline char *GetProfileNameX(const char*) static __forceinline char* GetPathVarX(const char*, int code)
{
- TCHAR szFullPath[MAX_PATH];
+ wchar_t szFullPath[MAX_PATH];
switch(code) {
case 1:
if (hAvatarFolder != NULL)
- _tcsncpy_s(szFullPath, tszAvatarRoot, _TRUNCATE);
+ wcsncpy_s(szFullPath, tszAvatarRoot, _TRUNCATE);
else
mir_sntprintf(szFullPath, L"%s\\%s\\AvatarCache", g_profileDir, g_shortProfileName);
break;
@@ -133,77 +133,77 @@ static __forceinline char* GetPathVarX(const char*, int code) return makeFileName(szFullPath);
}
-static __forceinline int _xcscmp(const TCHAR *s1, const TCHAR *s2) { return _tcscmp(s1, s2); }
-static __forceinline int _xcsncmp(const TCHAR *s1, const TCHAR *s2, size_t n) { return _tcsncmp(s1, s2, n); }
-static __forceinline size_t _xcslen(const TCHAR *s1) { return _tcslen(s1); }
-static __forceinline TCHAR* _xcscpy(TCHAR *s1, const TCHAR *s2) { return _tcscpy(s1, s2); }
-static __forceinline TCHAR* _xcsncpy(TCHAR *s1, const TCHAR *s2, size_t n) { return _tcsncpy(s1, s2, n); }
-static __forceinline const TCHAR* _xstrselect(const TCHAR*, const char*, const TCHAR *s2) { return s2; }
-static __forceinline TCHAR* _itox(TCHAR *, int a) { return _itot(a, (TCHAR *)mir_alloc(sizeof(TCHAR)*20), 10); }
-static __forceinline TCHAR* mir_a2x(const TCHAR *, const char *s) { return mir_a2t(s); }
+static __forceinline int _xcscmp(const wchar_t *s1, const wchar_t *s2) { return _tcscmp(s1, s2); }
+static __forceinline int _xcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n) { return wcsncmp(s1, s2, n); }
+static __forceinline size_t _xcslen(const wchar_t *s1) { return wcslen(s1); }
+static __forceinline wchar_t* _xcscpy(wchar_t *s1, const wchar_t *s2) { return wcscpy(s1, s2); }
+static __forceinline wchar_t* _xcsncpy(wchar_t *s1, const wchar_t *s2, size_t n) { return wcsncpy(s1, s2, n); }
+static __forceinline const wchar_t* _xstrselect(const wchar_t*, const char*, const wchar_t *s2) { return s2; }
+static __forceinline wchar_t* _itox(wchar_t *, int a) { return _itow(a, (wchar_t *)mir_alloc(sizeof(wchar_t)*20), 10); }
+static __forceinline wchar_t* mir_a2x(const wchar_t *, const char *s) { return mir_a2t(s); }
-static __forceinline TCHAR* GetContactNickX(const TCHAR*, MCONTACT hContact)
+static __forceinline wchar_t* GetContactNickX(const wchar_t*, MCONTACT hContact)
{
return mir_tstrdup(cli.pfnGetContactDisplayName(hContact, 0));
}
-static __forceinline TCHAR* GetContactIDX(const TCHAR*, MCONTACT hContact)
+static __forceinline wchar_t* GetContactIDX(const wchar_t*, MCONTACT hContact)
{
return GetContactID(hContact);
}
-static __forceinline TCHAR* GetEnvironmentVariableX(const TCHAR *variable)
+static __forceinline wchar_t* GetEnvironmentVariableX(const wchar_t *variable)
{
- TCHAR result[512];
+ wchar_t result[512];
if (GetEnvironmentVariable(variable, result, _countof(result)))
return mir_tstrdup(result);
return NULL;
}
-static __forceinline TCHAR* SHGetSpecialFolderPathX(int iCSIDL, TCHAR*)
+static __forceinline wchar_t* SHGetSpecialFolderPathX(int iCSIDL, wchar_t*)
{
- TCHAR result[512];
+ wchar_t result[512];
if (SHGetSpecialFolderPath(NULL, result, iCSIDL, FALSE))
return mir_tstrdup(result);
return NULL;
}
-static __forceinline TCHAR* GetProfileDirX(const TCHAR*)
+static __forceinline wchar_t* GetProfileDirX(const wchar_t*)
{
return mir_tstrdup(g_profileDir);
}
-static __forceinline TCHAR* GetModulePathX(const TCHAR*, HMODULE hModule)
+static __forceinline wchar_t* GetModulePathX(const wchar_t*, HMODULE hModule)
{
- TCHAR result[MAX_PATH];
+ wchar_t result[MAX_PATH];
GetModuleFileName(hModule, result, _countof(result));
- TCHAR* str = _tcsrchr(result, '\\');
+ wchar_t* str = wcsrchr(result, '\\');
if (str) *str = 0;
return mir_tstrdup(result);
}
-static __forceinline TCHAR* GetUserNameX(const TCHAR*)
+static __forceinline wchar_t* GetUserNameX(const wchar_t*)
{
- TCHAR result[128];
+ wchar_t result[128];
DWORD size = _countof(result);
if (GetUserName(result, &size))
return mir_tstrdup(result);
return NULL;
}
-static __forceinline TCHAR* GetProfileNameX(const TCHAR*)
+static __forceinline wchar_t* GetProfileNameX(const wchar_t*)
{
return mir_tstrdup(g_shortProfileName);
}
-static __forceinline TCHAR* GetPathVarX(const TCHAR*, int code)
+static __forceinline wchar_t* GetPathVarX(const wchar_t*, int code)
{
- TCHAR szFullPath[MAX_PATH];
+ wchar_t szFullPath[MAX_PATH];
switch(code) {
case 1:
if (hAvatarFolder != NULL)
- _tcsncpy_s(szFullPath, tszAvatarRoot, _TRUNCATE);
+ wcsncpy_s(szFullPath, tszAvatarRoot, _TRUNCATE);
else
mir_sntprintf(szFullPath, L"%s\\%s\\AvatarCache", g_profileDir, g_shortProfileName);
break;
@@ -366,9 +366,9 @@ static int OnFoldersChanged(WPARAM, LPARAM) {
mir_sntprintf(tszAvatarRoot, L"%s\\%s\\AvatarCache", g_profileDir, g_shortProfileName);
- TCHAR tmpVar[MAX_PATH];
+ wchar_t tmpVar[MAX_PATH];
if (!FoldersGetCustomPathT(hAvatarFolder, tmpVar, _countof(tmpVar), tszAvatarRoot))
- _tcsncpy_s(tszAvatarRoot, tmpVar, _TRUNCATE);
+ wcsncpy_s(tszAvatarRoot, tmpVar, _TRUNCATE);
return 0;
}
@@ -376,9 +376,9 @@ void InitPathVar() {
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];
+ wchar_t tmpVar[MAX_PATH];
if (!FoldersGetCustomPathT(hAvatarFolder, tmpVar, _countof(tmpVar), tszAvatarRoot))
- _tcsncpy_s(tszAvatarRoot, tmpVar, _TRUNCATE);
+ wcsncpy_s(tszAvatarRoot, tmpVar, _TRUNCATE);
HookEvent(ME_FOLDERS_PATH_CHANGED, OnFoldersChanged);
}
}
diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp index eda32700e3..757a0318c1 100644 --- a/src/mir_app/src/pluginopts.cpp +++ b/src/mir_app/src/pluginopts.cpp @@ -40,7 +40,7 @@ static UINT_PTR timerID; struct PluginListItemData
{
- TCHAR fileName[MAX_PATH];
+ wchar_t fileName[MAX_PATH];
HINSTANCE hInst;
int flags, stdPlugin;
char* author;
@@ -58,9 +58,9 @@ static int sttSortPlugins(const PluginListItemData *p1, const PluginListItemData static LIST<PluginListItemData> arPluginList(10, sttSortPlugins);
-static BOOL dialogListPlugins(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM lParam)
+static BOOL dialogListPlugins(WIN32_FIND_DATA *fd, wchar_t *path, WPARAM, LPARAM lParam)
{
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
mir_sntprintf(buf, L"%s\\Plugins\\%s", path, fd->cFileName);
HINSTANCE hInst = GetModuleHandle(buf);
@@ -85,7 +85,7 @@ static BOOL dialogListPlugins(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM l }
CharLower(fd->cFileName);
- _tcsncpy_s(dat->fileName, fd->cFileName, _TRUNCATE);
+ wcsncpy_s(dat->fileName, fd->cFileName, _TRUNCATE);
HWND hwndList = (HWND)lParam;
@@ -121,7 +121,7 @@ static BOOL dialogListPlugins(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM l else
memset(&dat->uuid, 0, sizeof(dat->uuid));
- TCHAR *shortNameT = mir_a2t(pi.pluginInfo->shortName);
+ wchar_t *shortNameT = mir_a2t(pi.pluginInfo->shortName);
// column 3: plugin short name
if (shortNameT) {
ListView_SetItemText(hwndList, iRow, 2, shortNameT);
@@ -183,9 +183,9 @@ static void RemoveAllItems(HWND hwnd) static bool LoadPluginDynamically(PluginListItemData *dat)
{
- TCHAR exe[MAX_PATH];
+ wchar_t exe[MAX_PATH];
GetModuleFileName(NULL, exe, _countof(exe));
- TCHAR *p = _tcsrchr(exe, '\\'); if (p) *p = 0;
+ wchar_t *p = wcsrchr(exe, '\\'); if (p) *p = 0;
pluginEntry* pPlug = OpenPlugin(dat->fileName, L"Plugins", exe);
if (pPlug->pclass & PCLASS_FAILED) {
@@ -230,7 +230,7 @@ static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LP for (int i = 0; i < arPluginList.getCount(); i++) {
PluginListItemData *p = arPluginList[i];
- if (!_tcsnicmp(szFilter, p->fileName, szFilter.GetLength())) {
+ if (!wcsnicmp(szFilter, p->fileName, szFilter.GetLength())) {
LVFINDINFO lvfi;
lvfi.flags = LVFI_PARAM;
lvfi.lParam = (LPARAM)p;
@@ -302,7 +302,7 @@ static int CALLBACK SortPlugins(WPARAM i1, LPARAM i2, LPARAM) return mir_tstrcmp(p1->fileName, p2->fileName);
}
-static TCHAR *latin2t(const char *p)
+static wchar_t *latin2t(const char *p)
{
if (p == NULL)
return mir_tstrdup(L"");
@@ -423,7 +423,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar if (ListView_GetItem(hwndList, &lvi)) {
PluginListItemData *dat = (PluginListItemData*)lvi.lParam;
- TCHAR buf[1024];
+ wchar_t buf[1024];
ListView_GetItemText(hwndList, hdr->iItem, 2, buf, _countof(buf));
SetDlgItemText(hwndDlg, IDC_PLUGININFOFRAME, sel ? buf : L"");
@@ -454,12 +454,12 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar if (hdr->hdr.code == PSN_APPLY) {
bool needRestart = false;
- TCHAR bufRestart[1024];
+ wchar_t bufRestart[1024];
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;) {
- TCHAR buf[1024];
+ wchar_t buf[1024];
ListView_GetItemText(hwndList, iRow, 1, buf, _countof(buf));
int iState = ListView_GetItemState(hwndList, iRow, LVIS_STATEIMAGEMASK);
SetPluginOnWhiteList(buf, (iState & 0x2000) ? 1 : 0);
diff --git a/src/mir_app/src/plugins.h b/src/mir_app/src/plugins.h index 44d7a18ddd..89f26a67f1 100644 --- a/src/mir_app/src/plugins.h +++ b/src/mir_app/src/plugins.h @@ -41,7 +41,7 @@ struct BASIC_PLUGIN_INFO struct pluginEntry
{
- TCHAR pluginname[64];
+ wchar_t pluginname[64];
unsigned int pclass; // PCLASS_*
int hLangpack;
BASIC_PLUGIN_INFO bpi;
@@ -54,30 +54,30 @@ int PluginOptionsInit(WPARAM, LPARAM); void LoadPluginOptions();
void UnloadPluginOptions();
-int isPluginOnWhiteList(const TCHAR* pluginname);
-void SetPluginOnWhiteList(const TCHAR* pluginname, int allow);
+int isPluginOnWhiteList(const wchar_t* pluginname);
+void SetPluginOnWhiteList(const wchar_t* pluginname, int allow);
int getDefaultPluginIdx(const MUUID& muuid);
bool hasMuuid(const BASIC_PLUGIN_INFO&, const MUUID&);
bool hasMuuid(const MUUID* pFirst, const MUUID&);
-int checkAPI(TCHAR* plugin, BASIC_PLUGIN_INFO* bpi, DWORD mirandaVersion, int checkTypeAPI);
+int checkAPI(wchar_t* plugin, BASIC_PLUGIN_INFO* bpi, DWORD mirandaVersion, int checkTypeAPI);
-pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path);
+pluginEntry* OpenPlugin(wchar_t *tszFileName, wchar_t *dir, wchar_t *path);
bool TryLoadPlugin(pluginEntry *p, bool bDynamic);
void Plugin_Uninit(pluginEntry *p);
int Plugin_UnloadDyn(pluginEntry *p);
-typedef BOOL (*SCAN_PLUGINS_CALLBACK) (WIN32_FIND_DATA * fd, TCHAR *path, WPARAM wParam, LPARAM lParam);
+typedef BOOL (*SCAN_PLUGINS_CALLBACK) (WIN32_FIND_DATA * fd, wchar_t *path, WPARAM wParam, LPARAM lParam);
void enumPlugins(SCAN_PLUGINS_CALLBACK cb, WPARAM wParam, LPARAM lParam);
struct MuuidReplacement
{
MUUID uuid; // default interface plugin
- TCHAR* stdplugname;
+ wchar_t* stdplugname;
pluginEntry* pImpl; // replacement plugin
};
bool LoadCorePlugin( MuuidReplacement& );
-MUUID* GetPluginInterfaces(const TCHAR* ptszFileName, bool& bIsPlugin);
\ No newline at end of file +MUUID* GetPluginInterfaces(const wchar_t* ptszFileName, bool& bIsPlugin);
diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp index 9ab844d821..38465b5165 100644 --- a/src/mir_app/src/profilemanager.cpp +++ b/src/mir_app/src/profilemanager.cpp @@ -35,17 +35,17 @@ void EnsureCheckerLoaded(bool); #define WM_INPUTCHANGED (WM_USER + 0x3000) #define WM_FOCUSTEXTBOX (WM_USER + 0x3001) -typedef BOOL (__cdecl *ENUMPROFILECALLBACK) (TCHAR *tszFullPath, TCHAR *profile, LPARAM lParam); +typedef BOOL (__cdecl *ENUMPROFILECALLBACK) (wchar_t *tszFullPath, wchar_t *profile, LPARAM lParam); void SetServiceModePlugin(pluginEntry *p); ///////////////////////////////////////////////////////////////////////////////////////// // Profile creator -static int findProfiles(TCHAR *szProfileDir, ENUMPROFILECALLBACK callback, LPARAM lParam) +static int findProfiles(wchar_t *szProfileDir, ENUMPROFILECALLBACK callback, LPARAM lParam) { // find in Miranda NG profile subfolders - TCHAR searchspec[MAX_PATH]; + wchar_t searchspec[MAX_PATH]; mir_sntprintf(searchspec, L"%s\\*.*", szProfileDir); WIN32_FIND_DATA ffd; @@ -56,9 +56,9 @@ static int findProfiles(TCHAR *szProfileDir, ENUMPROFILECALLBACK callback, LPARA do { // find all subfolders except "." and ".." if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && mir_tstrcmp(ffd.cFileName, L".") && mir_tstrcmp(ffd.cFileName, L"..")) { - TCHAR buf[MAX_PATH], profile[MAX_PATH]; + wchar_t buf[MAX_PATH], profile[MAX_PATH]; mir_sntprintf(buf, L"%s\\%s\\%s.dat", szProfileDir, ffd.cFileName, ffd.cFileName); - if (_taccess(buf, 0) == 0) { + if (_waccess(buf, 0) == 0) { 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(L".?/\\#' ", (TCHAR)wParam) != 0) + if (wcschr(L".?/\\#' ", (wchar_t)wParam) != 0) return 0; PostMessage(GetParent(edit), WM_INPUTCHANGED, 0, 0); } @@ -86,14 +86,14 @@ class CCreateProfileDlg : public CDlgBase CCtrlButton &m_btnOk; PROFILEMANAGERDATA *m_pd; - int CreateProfile(TCHAR *profile, DATABASELINK *link) + int CreateProfile(wchar_t *profile, DATABASELINK *link) { - TCHAR buf[256]; + wchar_t buf[256]; int err = 0; // check if the file already exists - TCHAR *file = _tcsrchr(profile, '\\'); + wchar_t *file = wcsrchr(profile, '\\'); if (file) file++; - if (_taccess(profile, 0) == 0) { + if (_waccess(profile, 0) == 0) { // file already exists! mir_sntprintf(buf, TranslateT("The profile '%s' already exists. Do you want to move it to the Recycle Bin?\n\nWARNING: The profile will be deleted if Recycle Bin is disabled.\nWARNING: A profile may contain confidential information and should be properly deleted."), @@ -165,13 +165,13 @@ public: mir_subclassWindow(m_profileName.GetHwnd(), ProfileNameValidate); // decide if there is a default profile name given in the INI and if it should be used - if (m_pd->noProfiles || (shouldAutoCreate(m_pd->ptszProfile) && _taccess(m_pd->ptszProfile, 0))) { - TCHAR *profile = _tcsrchr(m_pd->ptszProfile, '\\'); + if (m_pd->noProfiles || (shouldAutoCreate(m_pd->ptszProfile) && _waccess(m_pd->ptszProfile, 0))) { + wchar_t *profile = wcsrchr(m_pd->ptszProfile, '\\'); if (profile) ++profile; else profile = m_pd->ptszProfile; - TCHAR *p = _tcsrchr(profile, '.'); - TCHAR c = 0; + wchar_t *p = wcsrchr(profile, '.'); + wchar_t c = 0; if (p) { c = *p; *p = 0; } m_profileName.SetText(profile); @@ -239,24 +239,24 @@ class CChooseProfileDlg : public CDlgBase struct ProfileEnumData { - ProfileEnumData(CCtrlListView &_list, TCHAR *_profile) : + ProfileEnumData(CCtrlListView &_list, wchar_t *_profile) : list(_list), szProfile(_profile) {} CCtrlListView &list; - TCHAR* szProfile; + wchar_t* szProfile; }; - static BOOL EnumProfilesForList(TCHAR *tszFullPath, TCHAR *profile, LPARAM lParam) + static BOOL EnumProfilesForList(wchar_t *tszFullPath, wchar_t *profile, LPARAM lParam) { ProfileEnumData *ped = (ProfileEnumData*)lParam; CCtrlListView &list = ped->list; - TCHAR sizeBuf[64]; + wchar_t sizeBuf[64]; bool bFileLocked = true; - TCHAR *p = _tcsrchr(profile, '.'); + wchar_t *p = wcsrchr(profile, '.'); mir_tstrcpy(sizeBuf, L"0 KB"); if (p != NULL) *p = 0; @@ -266,7 +266,7 @@ class CChooseProfileDlg : public CDlgBase item.iItem = 0; struct _stat statbuf; - if (_tstat(tszFullPath, &statbuf) == 0) { + if (_wstat(tszFullPath, &statbuf) == 0) { if (statbuf.st_size > 1000000) { mir_sntprintf(sizeBuf, L"%.3lf", (double)statbuf.st_size / 1048576.0); mir_tstrcpy(sizeBuf + 5, L" MB"); @@ -314,7 +314,7 @@ class CChooseProfileDlg : public CDlgBase if (iItem < 0) return; - TCHAR profile[MAX_PATH], fullName[MAX_PATH]; + wchar_t profile[MAX_PATH], fullName[MAX_PATH]; LVITEM item = { 0 }; item.mask = LVIF_TEXT | LVIF_IMAGE; item.iItem = iItem; @@ -332,7 +332,7 @@ class CChooseProfileDlg : public CDlgBase if (iItem < 0) return; - TCHAR profile[MAX_PATH], profilef[MAX_PATH * 2]; + wchar_t profile[MAX_PATH], profilef[MAX_PATH * 2]; LVITEM item = { 0 }; item.mask = LVIF_TEXT; @@ -360,7 +360,7 @@ class CChooseProfileDlg : public CDlgBase { m_btnOk.Enable(m_profileList.GetSelectedCount() == 1); - TCHAR profile[MAX_PATH]; + wchar_t profile[MAX_PATH]; LVITEM item = { 0 }; item.mask = LVIF_TEXT | LVIF_IMAGE; item.iItem = m_profileList.GetNextItem(-1, LVNI_SELECTED | LVNI_ALL); @@ -386,12 +386,12 @@ class CChooseProfileDlg : public CDlgBase // profile is placed in "profile_name" subfolder - TCHAR tmpPath[MAX_PATH]; + wchar_t tmpPath[MAX_PATH]; mir_sntprintf(tmpPath, L"%s\\%s.dat", m_pd->ptszProfileDir, profile); - if (_taccess(tmpPath, 2)) + if (_waccess(tmpPath, 2)) 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); + wcsncpy_s(m_pd->ptszProfile, MAX_PATH, tmpPath, _TRUNCATE); } void ExecuteMenu(LPARAM lParam) @@ -521,12 +521,12 @@ public: void list_OnGetTip(CCtrlListView::TEventInfo *evt) { if (auto pTip = evt->nmlvit) { - TCHAR profilename[MAX_PATH], tszFullPath[MAX_PATH]; + wchar_t profilename[MAX_PATH], tszFullPath[MAX_PATH]; struct _stat statbuf; m_profileList.GetItemText(pTip->iItem, 0, profilename, _countof(profilename)); mir_sntprintf(tszFullPath, L"%s\\%s\\%s.dat", m_pd->ptszProfileDir, profilename, profilename); - _tstat(tszFullPath, &statbuf); - 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)))); + _wstat(tszFullPath, &statbuf); + mir_sntprintf(pTip->pszText, pTip->cchTextMax, L"%s\n%s: %s\n%s: %s", tszFullPath, TranslateT("Created"), rtrimt(NEWWSTR_ALLOCA(_wctime(&statbuf.st_ctime))), TranslateT("Modified"), rtrimt(NEWWSTR_ALLOCA(_wctime(&statbuf.st_mtime)))); } } @@ -591,8 +591,8 @@ public: { m_btnOk.OnClick = Callback(this, &CProfileManager::onOk); - m_tab.AddPage(LPGENT("My profiles"), NULL, new CChooseProfileDlg(m_btnOk, m_pd)); - m_tab.AddPage(LPGENT("New profile"), NULL, new CCreateProfileDlg(m_btnOk, m_pd)); + m_tab.AddPage(LPGENW("My profiles"), NULL, new CChooseProfileDlg(m_btnOk, m_pd)); + m_tab.AddPage(LPGENW("New profile"), NULL, new CCreateProfileDlg(m_btnOk, m_pd)); } virtual void OnInitDialog() diff --git a/src/mir_app/src/profilemanager.h b/src/mir_app/src/profilemanager.h index 63b521c1b3..5ec6e9fcd1 100644 --- a/src/mir_app/src/profilemanager.h +++ b/src/mir_app/src/profilemanager.h @@ -24,8 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct PROFILEMANAGERDATA
{
- TCHAR *ptszProfile; // in/out
- TCHAR *ptszProfileDir; // in/out
+ wchar_t *ptszProfile; // in/out
+ wchar_t *ptszProfileDir; // in/out
BOOL noProfiles; // in
BOOL bRun; // out
@@ -33,13 +33,13 @@ struct PROFILEMANAGERDATA DATABASELINK *dblink; // out
};
-char* makeFileName(const TCHAR *tszOriginalName);
-int touchDatabase(const TCHAR *tszProfile, DATABASELINK **pDblink);
+char* makeFileName(const wchar_t *tszOriginalName);
+int touchDatabase(const wchar_t *tszProfile, DATABASELINK **pDblink);
int getProfileManager(PROFILEMANAGERDATA *pd);
-int getProfilePath(TCHAR *buf, size_t cch);
-int isValidProfileName(const TCHAR *name);
-bool fileExist(const TCHAR *fname);
-bool shouldAutoCreate(TCHAR *szProfile);
+int getProfilePath(wchar_t *buf, size_t cch);
+int isValidProfileName(const wchar_t *name);
+bool fileExist(const wchar_t *fname);
+bool shouldAutoCreate(wchar_t *szProfile);
-extern TCHAR g_profileDir[MAX_PATH], g_profileName[MAX_PATH], g_shortProfileName[MAX_PATH];
+extern wchar_t g_profileDir[MAX_PATH], g_profileName[MAX_PATH], g_shortProfileName[MAX_PATH];
extern bool g_bDbCreated;
diff --git a/src/mir_app/src/proto_internal.cpp b/src/mir_app/src/proto_internal.cpp index cf885f54f3..d64e64bd97 100644 --- a/src/mir_app/src/proto_internal.cpp +++ b/src/mir_app/src/proto_internal.cpp @@ -24,15 +24,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-char** __fastcall Proto_FilesMatrixA(TCHAR **files);
+char** __fastcall Proto_FilesMatrixA(wchar_t **files);
-void FreeFilesMatrix(TCHAR ***files)
+void FreeFilesMatrix(wchar_t ***files)
{
if (*files == NULL)
return;
// Free each filename in the pointer array
- TCHAR **pFile = *files;
+ wchar_t **pFile = *files;
while (*pFile != NULL) {
mir_free(*pFile);
*pFile = NULL;
@@ -61,7 +61,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (int)ProtoCallService(m_szModuleName, PS_AUTHALLOW, (WPARAM)hDbEvent, 0);
}
- int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR *szReason)
+ int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t *szReason)
{
if (m_iVersion > 1)
return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, hDbEvent, (LPARAM)szReason);
@@ -75,7 +75,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (int)ProtoCallService(m_szModuleName, PSR_AUTH, 0, (LPARAM)&ccs);
}
- int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage)
+ int __cdecl AuthRequest(MCONTACT hContact, const wchar_t *szMessage)
{
CCSDATA ccs = { hContact, PSS_AUTHREQUEST, 0, (LPARAM)szMessage };
if (m_iVersion > 1)
@@ -87,7 +87,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return res;
}
- HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath)
+ HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath)
{
CCSDATA ccs = { hContact, PSS_FILEALLOW, (WPARAM)hTransfer, (LPARAM)szPath };
if (m_iVersion > 1)
@@ -105,7 +105,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (int)ProtoCallService(m_szModuleName, PSS_FILECANCEL, 0, (LPARAM)&ccs);
}
- int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason)
+ int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason)
{
CCSDATA ccs = { hContact, PSS_FILEDENY, (WPARAM)hTransfer, (LPARAM)szReason };
if (m_iVersion > 1)
@@ -117,16 +117,16 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return res;
}
- int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename)
+ int __cdecl FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
{
PROTOFILERESUME pfr = { *action, *szFilename };
if (m_iVersion > 1)
return (int)ProtoCallService(m_szModuleName, PS_FILERESUME, (WPARAM)hTransfer, (LPARAM)&pfr);
- pfr.szFilename = (TCHAR*)mir_t2a(pfr.szFilename);
+ pfr.szFilename = (wchar_t*)mir_t2a(pfr.szFilename);
int res = (int)ProtoCallService(m_szModuleName, PS_FILERESUME, (WPARAM)hTransfer, (LPARAM)&pfr);
- mir_free((TCHAR*)*szFilename);
- *action = pfr.action; *szFilename = (TCHAR*)pfr.szFilename;
+ mir_free((wchar_t*)*szFilename);
+ *action = pfr.action; *szFilename = (wchar_t*)pfr.szFilename;
return res;
}
@@ -147,7 +147,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return ProtoCallService(m_szModuleName, PSS_GETINFO, 0, (LPARAM)&ccs);
}
- HANDLE __cdecl SearchBasic(const TCHAR* id)
+ HANDLE __cdecl SearchBasic(const wchar_t* id)
{
if (m_iVersion > 1)
return (HANDLE)ProtoCallService(m_szModuleName, PS_BASICSEARCH, 0, (LPARAM)id);
@@ -155,19 +155,19 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (HANDLE)ProtoCallService(m_szModuleName, PS_BASICSEARCH, 0, _T2A(id));
}
- HANDLE __cdecl SearchByEmail(const TCHAR* email)
+ HANDLE __cdecl SearchByEmail(const wchar_t* email)
{
if (m_iVersion > 1)
return (HANDLE)ProtoCallService(m_szModuleName, PS_SEARCHBYEMAIL, 0, (LPARAM)email);
return (HANDLE)ProtoCallService(m_szModuleName, PS_SEARCHBYEMAIL, 0, _T2A(email));
}
- HANDLE __cdecl SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName)
+ HANDLE __cdecl SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName)
{
PROTOSEARCHBYNAME psn;
- psn.pszNick = (TCHAR*)mir_t2a(nick);
- psn.pszFirstName = (TCHAR*)mir_t2a(firstName);
- psn.pszLastName = (TCHAR*)mir_t2a(lastName);
+ psn.pszNick = (wchar_t*)mir_t2a(nick);
+ psn.pszFirstName = (wchar_t*)mir_t2a(firstName);
+ psn.pszLastName = (wchar_t*)mir_t2a(lastName);
HANDLE res = (HANDLE)ProtoCallService(m_szModuleName, PS_SEARCHBYNAME, 0, (LPARAM)&psn);
mir_free(psn.pszNick);
mir_free(psn.pszFirstName);
@@ -216,7 +216,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (int)ProtoCallService(m_szModuleName, PSS_CONTACTS, 0, (LPARAM)&ccs);
}
- HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
+ HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles)
{
CCSDATA ccs = { hContact, PSS_FILE, (WPARAM)szDescription, (LPARAM)ppszFiles };
@@ -226,7 +226,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE ccs.wParam = (WPARAM)mir_t2a(szDescription);
ccs.lParam = (LPARAM)Proto_FilesMatrixA(ppszFiles);
HANDLE res = (HANDLE)ProtoCallService(m_szModuleName, PSS_FILE, 0, (LPARAM)&ccs);
- if (res == 0) FreeFilesMatrix((TCHAR***)&ccs.lParam);
+ if (res == 0) FreeFilesMatrix((wchar_t***)&ccs.lParam);
mir_free((char*)ccs.wParam);
return res;
}
@@ -266,7 +266,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (int)ProtoCallService(m_szModuleName, PSR_AWAYMSG, 0, (LPARAM)&ccs);
}
- int __cdecl SetAwayMsg(int iStatus, const TCHAR *msg)
+ int __cdecl SetAwayMsg(int iStatus, const wchar_t *msg)
{
if (m_iVersion > 1)
return (int)ProtoCallService(m_szModuleName, PS_SETAWAYMSG, iStatus, (LPARAM)msg);
diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp index 096fdf0ed0..751af269c0 100644 --- a/src/mir_app/src/proto_opts.cpp +++ b/src/mir_app/src/proto_opts.cpp @@ -56,9 +56,9 @@ static HWND hAccMgr = NULL; extern HANDLE hAccListChanged;
-int UnloadPlugin(TCHAR* buf, int bufLen);
+int UnloadPlugin(wchar_t* buf, int bufLen);
-PROTOACCOUNT* Proto_CreateAccount(const char *szModuleName, const char *szBaseProto, const TCHAR *tszAccountName)
+PROTOACCOUNT* Proto_CreateAccount(const char *szModuleName, const char *szBaseProto, const wchar_t *tszAccountName)
{
PROTOACCOUNT *pa = (PROTOACCOUNT*)mir_calloc(sizeof(PROTOACCOUNT));
if (pa == NULL)
@@ -123,7 +123,7 @@ static bool OnCreateAccount(HWND hwndDlg) AccFormDlgParam* param = (AccFormDlgParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
PROTOACCOUNT *pa = param->pa;
- TCHAR tszAccName[256];
+ wchar_t tszAccName[256];
GetDlgItemText(hwndDlg, IDC_ACCNAME, tszAccName, _countof(tszAccName));
rtrimt(tszAccName);
if (tszAccName[0] == 0) {
@@ -142,13 +142,13 @@ static bool OnCreateAccount(HWND hwndDlg) if (param->action == PRAC_UPGRADED) {
BOOL oldProto = pa->bOldProto;
- TCHAR szPlugin[MAX_PATH];
+ wchar_t szPlugin[MAX_PATH];
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];
+ wchar_t szNewName[MAX_PATH];
mir_sntprintf(szNewName, L"%s~", szPlugin);
MoveFile(szPlugin, szNewName);
}
@@ -199,7 +199,7 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam if (param->action == PRAC_ADDED) // new account
SetWindowText(hwndDlg, TranslateT("Create new account"));
else {
- TCHAR str[200];
+ wchar_t str[200];
if (param->action == PRAC_CHANGED) { // update
EnableWindow(GetDlgItem(hwndDlg, IDC_PROTOTYPECOMBO), FALSE);
mir_sntprintf(str, L"%s: %s", TranslateT("Editing account"), param->pa->tszAccountName);
@@ -280,7 +280,7 @@ static LRESULT CALLBACK sttEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, case WM_KILLFOCUS:
int length = GetWindowTextLength(hwnd) + 1;
- TCHAR *str = (TCHAR*)mir_alloc(sizeof(TCHAR) * length);
+ wchar_t *str = (wchar_t*)mir_alloc(sizeof(wchar_t) * length);
GetWindowText(hwnd, str, length);
SendMessage(GetParent(GetParent(hwnd)), WM_COMMAND, MAKEWPARAM(GetWindowLongPtr(GetParent(hwnd), GWL_ID), LBN_MY_RENAME), (LPARAM)str);
DestroyWindow(hwnd);
@@ -605,7 +605,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM int length = SendDlgItemMessage(hwndDlg, IDC_ACCLIST, LB_GETTEXTLEN, lps->itemID, 0);
int size = max(length + 1, 256);
- TCHAR *text = (TCHAR *)_alloca(sizeof(TCHAR) * size);
+ wchar_t *text = (wchar_t *)_alloca(sizeof(wchar_t) * size);
SendDlgItemMessage(hwndDlg, IDC_ACCLIST, LB_GETTEXT, lps->itemID, (LPARAM)text);
SelectObject(lps->hDC, dat->hfntTitle);
@@ -770,7 +770,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM else {
DWORD dwStatus = CallProtoServiceInt(NULL, pa->szModuleName, PS_GETSTATUS, 0, 0);
if (dwStatus >= ID_STATUS_ONLINE) {
- TCHAR buf[200];
+ wchar_t buf[200];
mir_sntprintf(buf, TranslateT("Account %s is being disabled"), pa->tszAccountName);
if (IDNO == ::MessageBox(hwndDlg,
TranslateT("Account is online. Disable account?"),
@@ -795,7 +795,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM pa = (PROTOACCOUNT *)ListBox_GetItemData(hwndList, iItem);
if (pa) {
mir_free(pa->tszAccountName);
- pa->tszAccountName = (TCHAR*)lParam;
+ pa->tszAccountName = (wchar_t*)lParam;
WriteDbAccounts();
NotifyEventHooks(hAccListChanged, PRAC_CHANGED, (LPARAM)pa);
@@ -808,7 +808,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM RedrawWindow(hwndList, NULL, NULL, RDW_INVALIDATE);
}
- else mir_free((TCHAR*)lParam);
+ else mir_free((wchar_t*)lParam);
}
break;
@@ -830,7 +830,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM idx = ListBox_GetCurSel(hwndList);
if (idx != -1) {
pa = (PROTOACCOUNT*)ListBox_GetItemData(hwndList, idx);
- TCHAR buf[200];
+ wchar_t buf[200];
mir_sntprintf(buf, TranslateT("Account %s is being deleted"), pa->tszAccountName);
if (pa->bOldProto) {
MessageBox(hwndDlg, TranslateT("You need to disable plugin to delete this account"), buf, MB_ICONERROR | MB_OK);
diff --git a/src/mir_app/src/proto_ui.cpp b/src/mir_app/src/proto_ui.cpp index ed0ac48b16..38ee85161b 100644 --- a/src/mir_app/src/proto_ui.cpp +++ b/src/mir_app/src/proto_ui.cpp @@ -48,7 +48,7 @@ void CProtoIntDlgBase::CreateLink(CCtrlData& ctrl, char *szSetting, BYTE type, D ctrl.CreateDbLink(m_proto_interface->m_szModuleName, szSetting, type, iValue);
}
-void CProtoIntDlgBase::CreateLink(CCtrlData& ctrl, const char *szSetting, TCHAR *szValue)
+void CProtoIntDlgBase::CreateLink(CCtrlData& ctrl, const char *szSetting, wchar_t *szValue)
{
ctrl.CreateDbLink(m_proto_interface->m_szModuleName, szSetting, szValue);
}
@@ -57,7 +57,7 @@ void CProtoIntDlgBase::OnProtoRefresh(WPARAM, LPARAM) {} void CProtoIntDlgBase::OnProtoActivate(WPARAM, LPARAM) {}
void CProtoIntDlgBase::OnProtoCheckOnline(WPARAM, LPARAM) {}
-void CProtoIntDlgBase::SetStatusText(const TCHAR *statusText)
+void CProtoIntDlgBase::SetStatusText(const wchar_t *statusText)
{
if (m_hwndStatus)
SendMessage(m_hwndStatus, SB_SETTEXT, 0, (LPARAM)statusText);
@@ -86,8 +86,8 @@ INT_PTR CProtoIntDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) case WM_SETTEXT:
if (m_show_label && IsWindowUnicode(m_hwnd)) {
- TCHAR *szTitle = (TCHAR *)lParam;
- if (!_tcsstr(szTitle, m_proto_interface->m_tszUserName)) {
+ wchar_t *szTitle = (wchar_t *)lParam;
+ if (!wcsstr(szTitle, m_proto_interface->m_tszUserName)) {
UpdateProtoTitle(szTitle);
return TRUE;
}
@@ -122,13 +122,13 @@ INT_PTR CProtoIntDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) return CSuper::DlgProc(msg, wParam, lParam);
}
-void CProtoIntDlgBase::UpdateProtoTitle(const TCHAR *szText)
+void CProtoIntDlgBase::UpdateProtoTitle(const wchar_t *szText)
{
if (!m_show_label)
return;
int curLength;
- const TCHAR *curText;
+ const wchar_t *curText;
if (szText) {
curText = szText;
@@ -136,14 +136,14 @@ void CProtoIntDlgBase::UpdateProtoTitle(const TCHAR *szText) }
else {
curLength = GetWindowTextLength(m_hwnd) + 1;
- TCHAR *tmp = (TCHAR *)_alloca(curLength * sizeof(TCHAR));
+ wchar_t *tmp = (wchar_t *)_alloca(curLength * sizeof(wchar_t));
GetWindowText(m_hwnd, tmp, curLength);
curText = tmp;
}
- if (!_tcsstr(curText, m_proto_interface->m_tszUserName)) {
+ if (!wcsstr(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));
+ wchar_t *text = (wchar_t *)_alloca(length * sizeof(wchar_t));
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 3274381078..24af3b02c1 100644 --- a/src/mir_app/src/proto_utils.cpp +++ b/src/mir_app/src/proto_utils.cpp @@ -172,12 +172,12 @@ MIR_APP_DLL(LPCTSTR) ProtoGetAvatarExtension(int format) return L"";
}
-MIR_APP_DLL(int) ProtoGetAvatarFormat(const TCHAR *ptszFileName)
+MIR_APP_DLL(int) ProtoGetAvatarFormat(const wchar_t *ptszFileName)
{
if (ptszFileName == NULL)
return PA_FORMAT_UNKNOWN;
- const TCHAR *ptszExt = _tcsrchr(ptszFileName, '.');
+ const wchar_t *ptszExt = wcsrchr(ptszFileName, '.');
if (ptszExt == NULL)
return PA_FORMAT_UNKNOWN;
@@ -205,7 +205,7 @@ MIR_APP_DLL(int) ProtoGetAvatarFormat(const TCHAR *ptszFileName) return PA_FORMAT_UNKNOWN;
}
-MIR_APP_DLL(int) ProtoGetBufferFormat(const void *pBuffer, const TCHAR **ptszExtension)
+MIR_APP_DLL(int) ProtoGetBufferFormat(const void *pBuffer, const wchar_t **ptszExtension)
{
if (!memcmp(pBuffer, "\x89PNG", 4)) {
if (ptszExtension) *ptszExtension = L".png";
@@ -236,7 +236,7 @@ MIR_APP_DLL(int) ProtoGetBufferFormat(const void *pBuffer, const TCHAR **ptszExt return PA_FORMAT_UNKNOWN;
}
-MIR_APP_DLL(int) ProtoGetAvatarFileFormat(const TCHAR *ptszFileName)
+MIR_APP_DLL(int) ProtoGetAvatarFileFormat(const wchar_t *ptszFileName)
{
HANDLE hFile = CreateFile(ptszFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
@@ -268,7 +268,7 @@ int PROTO_INTERFACE::Authorize(MEVENT) return 1; // error
}
-int PROTO_INTERFACE::AuthDeny(MEVENT, const TCHAR*)
+int PROTO_INTERFACE::AuthDeny(MEVENT, const wchar_t*)
{
return 1; // error
}
@@ -278,12 +278,12 @@ int PROTO_INTERFACE::AuthRecv(MCONTACT, PROTORECVEVENT*) return 1; // error
}
-int PROTO_INTERFACE::AuthRequest(MCONTACT, const TCHAR*)
+int PROTO_INTERFACE::AuthRequest(MCONTACT, const wchar_t*)
{
return 1; // error
}
-HANDLE PROTO_INTERFACE::FileAllow(MCONTACT, HANDLE, const TCHAR*)
+HANDLE PROTO_INTERFACE::FileAllow(MCONTACT, HANDLE, const wchar_t*)
{
return NULL; // error
}
@@ -293,12 +293,12 @@ int PROTO_INTERFACE::FileCancel(MCONTACT, HANDLE) return 1; // error
}
-int PROTO_INTERFACE::FileDeny(MCONTACT, HANDLE, const TCHAR*)
+int PROTO_INTERFACE::FileDeny(MCONTACT, HANDLE, const wchar_t*)
{
return 1; // error
}
-int PROTO_INTERFACE::FileResume(HANDLE, int*, const TCHAR**)
+int PROTO_INTERFACE::FileResume(HANDLE, int*, const wchar_t**)
{
return 1; // error
}
@@ -313,17 +313,17 @@ int PROTO_INTERFACE::GetInfo(MCONTACT, int) return 1; // error
}
-HANDLE PROTO_INTERFACE::SearchBasic(const TCHAR*)
+HANDLE PROTO_INTERFACE::SearchBasic(const wchar_t*)
{
return NULL; // error
}
-HANDLE PROTO_INTERFACE::SearchByEmail(const TCHAR*)
+HANDLE PROTO_INTERFACE::SearchByEmail(const wchar_t*)
{
return NULL; // error
}
-HANDLE PROTO_INTERFACE::SearchByName(const TCHAR*, const TCHAR*, const TCHAR*)
+HANDLE PROTO_INTERFACE::SearchByName(const wchar_t*, const wchar_t*, const wchar_t*)
{
return NULL; // error
}
@@ -364,7 +364,7 @@ int PROTO_INTERFACE::SendContacts(MCONTACT, int, int, MCONTACT*) return 1; // error
}
-HANDLE PROTO_INTERFACE::SendFile(MCONTACT, const TCHAR*, TCHAR**)
+HANDLE PROTO_INTERFACE::SendFile(MCONTACT, const wchar_t*, wchar_t**)
{
return NULL; // error
}
@@ -399,7 +399,7 @@ int PROTO_INTERFACE::RecvAwayMsg(MCONTACT, int, PROTORECVEVENT*) return 1; // error
}
-int PROTO_INTERFACE::SetAwayMsg(int, const TCHAR*)
+int PROTO_INTERFACE::SetAwayMsg(int, const wchar_t*)
{
return 1; // error
}
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp index d162d38878..e06034833e 100644 --- a/src/mir_app/src/protocols.cpp +++ b/src/mir_app/src/protocols.cpp @@ -93,9 +93,9 @@ LIST<PROTOCOLDESCRIPTOR> filters(10, CompareProtos); //------------------------------------------------------------------------------------
-void FreeFilesMatrix(TCHAR ***files);
+void FreeFilesMatrix(wchar_t ***files);
-static PROTO_INTERFACE* defInitProto(const char* szModule, const TCHAR*)
+static PROTO_INTERFACE* defInitProto(const char* szModule, const wchar_t*)
{
return AddDefaultAccount(szModule);
}
@@ -244,7 +244,7 @@ static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam) void Proto_SetStatus(const char *szProto, unsigned status)
{
if (CallProtoServiceInt(NULL, szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) {
- ptrT tszAwayMsg((TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, status, (LPARAM)szProto));
+ ptrT tszAwayMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, status, (LPARAM)szProto));
CallProtoServiceInt(NULL, szProto, PS_SETAWAYMSG, status, tszAwayMsg);
}
CallProtoServiceInt(NULL, szProto, PS_SETSTATUS, status, 0);
@@ -382,22 +382,22 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char case 1: return (INT_PTR)ppi->AddToList(wParam, (PROTOSEARCHRESULT*)lParam);
case 2: return (INT_PTR)ppi->AddToListByEvent(LOWORD(wParam), HIWORD(wParam), (MEVENT)lParam);
case 3: return (INT_PTR)ppi->Authorize((MEVENT)wParam);
- case 4: return (INT_PTR)ppi->AuthDeny((MEVENT)wParam, (TCHAR*)lParam);
+ case 4: return (INT_PTR)ppi->AuthDeny((MEVENT)wParam, (wchar_t*)lParam);
case 5: return (INT_PTR)ppi->AuthRecv(hContact, (PROTORECVEVENT*)lParam);
- case 6: return (INT_PTR)ppi->AuthRequest(hContact, (TCHAR*)lParam);
- case 8: return (INT_PTR)ppi->FileAllow(hContact, (HANDLE)wParam, (TCHAR*)lParam);
+ case 6: return (INT_PTR)ppi->AuthRequest(hContact, (wchar_t*)lParam);
+ case 8: return (INT_PTR)ppi->FileAllow(hContact, (HANDLE)wParam, (wchar_t*)lParam);
case 9: return (INT_PTR)ppi->FileCancel(hContact, (HANDLE)wParam);
- case 10: return (INT_PTR)ppi->FileDeny(hContact, (HANDLE)wParam, (TCHAR*)lParam);
+ case 10: return (INT_PTR)ppi->FileDeny(hContact, (HANDLE)wParam, (wchar_t*)lParam);
case 11: {
PROTOFILERESUME *pfr = (PROTOFILERESUME*)lParam;
- return (INT_PTR)ppi->FileResume((HANDLE)wParam, &pfr->action, (const TCHAR**)&pfr->szFilename);
+ return (INT_PTR)ppi->FileResume((HANDLE)wParam, &pfr->action, (const wchar_t**)&pfr->szFilename);
}
case 12: return (INT_PTR)ppi->GetCaps(wParam, lParam);
case 13: return (INT_PTR)Proto_GetIcon(ppi, wParam);
case 14: return (INT_PTR)ppi->GetInfo(hContact, wParam);
- case 15: return (INT_PTR)ppi->SearchBasic((TCHAR*)lParam);
- case 16: return (INT_PTR)ppi->SearchByEmail((TCHAR*)lParam);
+ case 15: return (INT_PTR)ppi->SearchBasic((wchar_t*)lParam);
+ case 16: return (INT_PTR)ppi->SearchByEmail((wchar_t*)lParam);
case 17: {
PROTOSEARCHBYNAME* psbn = (PROTOSEARCHBYNAME*)lParam;
return (INT_PTR)ppi->SearchByName(psbn->pszNick, psbn->pszFirstName, psbn->pszLastName);
@@ -409,14 +409,14 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char case 22: return (INT_PTR)ppi->RecvMsg(hContact, (PROTORECVEVENT*)lParam);
case 23: return (INT_PTR)ppi->RecvUrl(hContact, (PROTORECVEVENT*)lParam);
case 24: return (INT_PTR)ppi->SendContacts(hContact, LOWORD(wParam), HIWORD(wParam), (MCONTACT*)lParam);
- case 25: return (INT_PTR)ppi->SendFile(hContact, (TCHAR*)wParam, (TCHAR**)lParam);
+ case 25: return (INT_PTR)ppi->SendFile(hContact, (wchar_t*)wParam, (wchar_t**)lParam);
case 26: return (INT_PTR)ppi->SendMsg(hContact, wParam, (const char*)lParam);
case 27: return (INT_PTR)ppi->SendUrl(hContact, wParam, (const char*)lParam);
case 28: return (INT_PTR)ppi->SetApparentMode(hContact, wParam);
case 29: return (INT_PTR)ppi->SetStatus(wParam);
case 30: return (INT_PTR)ppi->GetAwayMsg(hContact);
case 31: return (INT_PTR)ppi->RecvAwayMsg(hContact, wParam, (PROTORECVEVENT*)lParam);
- case 33: return (INT_PTR)ppi->SetAwayMsg(wParam, (TCHAR*)lParam);
+ case 33: return (INT_PTR)ppi->SetAwayMsg(wParam, (wchar_t*)lParam);
case 34: return (INT_PTR)ppi->UserIsTyping(wParam, lParam);
case 35: mir_strncpy((char*)lParam, ppi->m_szModuleName, wParam); return 0;
case 36:
diff --git a/src/mir_app/src/searchresults.cpp b/src/mir_app/src/searchresults.cpp index 3aa2455e7a..8db9de005d 100644 --- a/src/mir_app/src/searchresults.cpp +++ b/src/mir_app/src/searchresults.cpp @@ -54,7 +54,7 @@ void SaveColumnSizes(HWND hwndResults) db_set_b(NULL, "FindAdd", "SortAscending", (BYTE)dat->bSortAscending);
}
-static const TCHAR *szColumnNames[] = { NULL, NULL, L"Nick", L"First Name", L"Last Name", L"E-mail" };
+static const wchar_t *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)
{
@@ -139,19 +139,19 @@ int CALLBACK SearchResultsCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lPa case COLUMNID_PROTO:
return mir_strcmp(lsr1->szProto, lsr2->szProto)*sortMultiplier;
case COLUMNID_HANDLE:
- return mir_tstrcmpi(lsr1->psr.id.t, lsr2->psr.id.t)*sortMultiplier;
+ return mir_tstrcmpi(lsr1->psr.id.w, lsr2->psr.id.w)*sortMultiplier;
case COLUMNID_NICK:
- return mir_tstrcmpi(lsr1->psr.nick.t, lsr2->psr.nick.t)*sortMultiplier;
+ return mir_tstrcmpi(lsr1->psr.nick.w, lsr2->psr.nick.w)*sortMultiplier;
case COLUMNID_FIRST:
- return mir_tstrcmpi(lsr1->psr.firstName.t, lsr2->psr.firstName.t)*sortMultiplier;
+ return mir_tstrcmpi(lsr1->psr.firstName.w, lsr2->psr.firstName.w)*sortMultiplier;
case COLUMNID_LAST:
- return mir_tstrcmpi(lsr1->psr.lastName.t, lsr2->psr.lastName.t)*sortMultiplier;
+ return mir_tstrcmpi(lsr1->psr.lastName.w, lsr2->psr.lastName.w)*sortMultiplier;
case COLUMNID_EMAIL:
- return mir_tstrcmpi(lsr1->psr.email.t, lsr2->psr.email.t)*sortMultiplier;
+ return mir_tstrcmpi(lsr1->psr.email.w, lsr2->psr.email.w)*sortMultiplier;
}
}
else {
- TCHAR szText1[100], szText2[100];
+ wchar_t szText1[100], szText2[100];
ListView_GetItemText(hList, (int)lParam1, sortCol, szText1, _countof(szText1));
ListView_GetItemText(hList, (int)lParam2, sortCol, szText2, _countof(szText2));
return mir_tstrcmpi(szText1, szText2)*sortMultiplier;
@@ -167,11 +167,11 @@ void FreeSearchResults(HWND hwndResults) ListView_GetItem(hwndResults, &lvi);
ListSearchResult *lsr = (ListSearchResult*)lvi.lParam;
if (lsr == NULL) continue;
- mir_free(lsr->psr.id.t);
- mir_free(lsr->psr.email.t);
- mir_free(lsr->psr.nick.t);
- mir_free(lsr->psr.firstName.t);
- mir_free(lsr->psr.lastName.t);
+ mir_free(lsr->psr.id.w);
+ mir_free(lsr->psr.email.w);
+ mir_free(lsr->psr.nick.w);
+ mir_free(lsr->psr.firstName.w);
+ mir_free(lsr->psr.lastName.w);
mir_free(lsr);
}
ListView_DeleteAllItems(hwndResults);
@@ -181,9 +181,9 @@ void FreeSearchResults(HWND hwndResults) // on its own thread
static void BeginSearchFailed(void *arg)
{
- TCHAR buf[128];
+ wchar_t buf[128];
if (arg != NULL) {
- const TCHAR *protoName = (TCHAR*)arg;
+ const wchar_t *protoName = (wchar_t*)arg;
mir_sntprintf(buf,
TranslateT("Could not start a search on '%s', there was a problem - is %s connected?"),
protoName, protoName);
diff --git a/src/mir_app/src/services.cpp b/src/mir_app/src/services.cpp index 08eaadbbff..4453ce3c83 100644 --- a/src/mir_app/src/services.cpp +++ b/src/mir_app/src/services.cpp @@ -144,7 +144,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR int retval = 0;
ptrT tszGroup(db_get_tsa(NULL, settings_group, idstr));
if (tszGroup != NULL)
- _tcsncpy_s(lf->lfFaceName, tszGroup, _TRUNCATE);
+ wcsncpy_s(lf->lfFaceName, tszGroup, _TRUNCATE);
else
retval = 1;
@@ -200,7 +200,7 @@ int CreateFromFontSettings(FontSettingsT *fs, LOGFONT *lf) {
GetDefaultFontSetting(lf, 0);
- _tcsncpy_s(lf->lfFaceName, fs->szFace, _TRUNCATE);
+ wcsncpy_s(lf->lfFaceName, fs->szFace, _TRUNCATE);
lf->lfWidth = lf->lfEscapement = lf->lfOrientation = 0;
lf->lfWeight = fs->style & DBFONTF_BOLD ? FW_BOLD : FW_NORMAL;
@@ -232,7 +232,7 @@ void UpdateFontSettings(FontIDW *font_id, FontSettingsT *fontsettings) fontsettings->size = (char)lf.lfHeight;
fontsettings->charset = lf.lfCharSet;
fontsettings->colour = colour;
- _tcsncpy_s(fontsettings->szFace, lf.lfFaceName, _TRUNCATE);
+ wcsncpy_s(fontsettings->szFace, lf.lfFaceName, _TRUNCATE);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -292,7 +292,7 @@ static INT_PTR sttGetFontWorker(FontIDW *font_id, LOGFONT *lf) for (int i = 0; i < font_id_list.getCount(); i++) {
FontInternal& F = font_id_list[i];
- if (!_tcsncmp(F.name, font_id->name, _countof(F.name)) && !_tcsncmp(F.group, font_id->group, _countof(F.group))) {
+ if (!wcsncmp(F.name, font_id->name, _countof(F.name)) && !wcsncmp(F.group, font_id->group, _countof(F.group))) {
if (GetFontSettingFromDB(F.dbSettingsGroup, F.prefix, lf, &colour, F.flags) && (F.flags & FIDF_DEFAULTVALID)) {
CreateFromFontSettings(&F.deffontsettings, lf);
colour = F.deffontsettings.colour;
@@ -477,7 +477,7 @@ static INT_PTR sttGetEffectWorker(EffectIDW *effect_id, FONTEFFECT *effect) {
for (int i = 0; i < effect_id_list.getCount(); i++) {
EffectInternal& E = effect_id_list[i];
- if (!_tcsncmp(E.name, effect_id->name, _countof(E.name)) && !_tcsncmp(E.group, effect_id->group, _countof(E.group))) {
+ if (!wcsncmp(E.name, effect_id->name, _countof(E.name)) && !wcsncmp(E.group, effect_id->group, _countof(E.group))) {
FONTEFFECT temp;
UpdateEffectSettings(effect_id, &temp);
diff --git a/src/mir_app/src/skin.h b/src/mir_app/src/skin.h index 7ce5fbdc36..121169f8c3 100644 --- a/src/mir_app/src/skin.h +++ b/src/mir_app/src/skin.h @@ -38,7 +38,7 @@ struct THotkeyItem {
THotkeyType type;
char *pszService, *pszName; // pszName is valid _only_ for "root" hotkeys
- TCHAR *ptszSection, *ptszDescription;
+ wchar_t *ptszSection, *ptszDescription;
LPARAM lParam;
WORD DefHotkey, Hotkey;
bool Enabled;
@@ -56,8 +56,8 @@ struct THotkeyItem bool UnregisterHotkey; // valid only during WM_APP message in options UI, used to remove unregistered hotkeys from options
- __inline TCHAR* getSection() const { return TranslateTH(hLangpack, ptszSection); }
- __inline TCHAR* getDescr() const { return TranslateTH(hLangpack, ptszDescription); }
+ __inline wchar_t* getSection() const { return TranslateTH(hLangpack, ptszSection); }
+ __inline wchar_t* getDescr() const { return TranslateTH(hLangpack, ptszDescription); }
};
extern LIST<THotkeyItem> hotkeys;
diff --git a/src/mir_app/src/skin2opts.cpp b/src/mir_app/src/skin2opts.cpp index b8563f05ec..feb5795b0d 100644 --- a/src/mir_app/src/skin2opts.cpp +++ b/src/mir_app/src/skin2opts.cpp @@ -39,10 +39,10 @@ struct IcoLibOptsData /////////////////////////////////////////////////////////////////////////////////////////
-static HICON ExtractIconFromPath(const TCHAR *path, int cxIcon, int cyIcon)
+static HICON ExtractIconFromPath(const wchar_t *path, int cxIcon, int cyIcon)
{
- TCHAR *comma;
- TCHAR file[MAX_PATH], fileFull[MAX_PATH];
+ wchar_t *comma;
+ wchar_t file[MAX_PATH], fileFull[MAX_PATH];
int n;
HICON hIcon;
@@ -50,11 +50,11 @@ static HICON ExtractIconFromPath(const TCHAR *path, int cxIcon, int cyIcon) return (HICON)NULL;
mir_tstrncpy(file, path, _countof(file));
- comma = _tcsrchr(file, ',');
+ comma = wcsrchr(file, ',');
if (!comma)
n = 0;
else {
- n = _ttoi(comma + 1);
+ n = _wtoi(comma + 1);
*comma = 0;
}
PathToAbsoluteT(file, fileFull);
@@ -110,14 +110,14 @@ HICON IconItem_GetIcon_Preview(IcolibItem* item) /////////////////////////////////////////////////////////////////////////////////////////
// IcoLib GUI service routines
-static void __fastcall MySetCursor(TCHAR* nCursor)
+static void __fastcall MySetCursor(wchar_t* nCursor)
{
SetCursor(LoadCursor(NULL, nCursor));
}
-static void LoadSectionIcons(TCHAR *filename, SectionItem* sectionActive)
+static void LoadSectionIcons(wchar_t *filename, SectionItem* sectionActive)
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
mir_sntprintf(path, L"%s,", filename);
size_t suffIndx = mir_tstrlen(path);
@@ -127,7 +127,7 @@ static void LoadSectionIcons(TCHAR *filename, SectionItem* sectionActive) IcolibItem *item = iconList[indx];
if (item->default_file && item->section == sectionActive) {
- _itot(item->default_indx, path + suffIndx, 10);
+ _itow(item->default_indx, path + suffIndx, 10);
HICON hIcon = ExtractIconFromPath(path, item->cx, item->cy);
if (!hIcon)
continue;
@@ -142,7 +142,7 @@ static void LoadSectionIcons(TCHAR *filename, SectionItem* sectionActive) }
}
-void LoadSubIcons(HWND htv, TCHAR *filename, HTREEITEM hItem)
+void LoadSubIcons(HWND htv, wchar_t *filename, HTREEITEM hItem)
{
TVITEM tvi;
tvi.mask = TVIF_HANDLE | TVIF_PARAM;
@@ -220,10 +220,10 @@ static int OpenPopupMenu(HWND hwndDlg) return cmd;
}
-static TCHAR* OpenFileDlg(HWND hParent, const TCHAR* szFile, BOOL bAll)
+static wchar_t* OpenFileDlg(HWND hParent, const wchar_t* szFile, BOOL bAll)
{
OPENFILENAME ofn = { 0 };
- TCHAR filter[512], *pfilter, file[MAX_PATH * 2];
+ wchar_t filter[512], *pfilter, file[MAX_PATH * 2];
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hParent;
@@ -302,10 +302,10 @@ void DoIconsChanged(HWND hwndDlg) }
}
-static HTREEITEM FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHAR *name)
+static HTREEITEM FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const wchar_t *name)
{
TVITEM tvi = { 0 };
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
if (hItem)
tvi.hItem = TreeView_GetChild(hwndTree, hItem);
@@ -397,7 +397,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM HIMAGELIST hIml = ListView_GetImageList(hPreview, LVSIL_NORMAL);
ImageList_RemoveAll(hIml);
- TCHAR filename[MAX_PATH], caption[64];
+ wchar_t filename[MAX_PATH], caption[64];
GetDlgItemText(hwndDlg, IDC_ICONSET, filename, _countof(filename));
{
RECT rcPreview, rcGroup;
@@ -407,7 +407,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM //SetWindowPos(hPreview, 0, 0, 0, rcPreview.right-rcPreview.left, rcGroup.bottom-rcPreview.top, SWP_NOZORDER|SWP_NOMOVE);
}
- if (_taccess(filename, 0) != 0) {
+ if (_waccess(filename, 0) != 0) {
MySetCursor(IDC_ARROW);
break;
}
@@ -437,7 +437,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM switch (LOWORD(wParam)) {
case IDC_BROWSE:
{
- TCHAR str[MAX_PATH], *file;
+ wchar_t str[MAX_PATH], *file;
GetDlgItemText(hwndDlg, IDC_ICONSET, str, _countof(str));
if (!(file = OpenFileDlg(GetParent(hwndDlg), str, TRUE)))
break;
@@ -512,7 +512,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ImageList_EndDrag();
dragging = 0;
if (dropHiLite != -1) {
- TCHAR path[MAX_PATH], fullPath[MAX_PATH], filename[MAX_PATH];
+ wchar_t path[MAX_PATH], fullPath[MAX_PATH], filename[MAX_PATH];
LVITEM lvi;
GetDlgItemText(hwndDlg, IDC_ICONSET, fullPath, _countof(fullPath));
@@ -655,7 +655,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM {
HWND hwndTree = GetDlgItem(hwndDlg, IDC_CATEGORYLIST);
int indx;
- TCHAR itemName[1024];
+ wchar_t itemName[1024];
HTREEITEM hSection;
if (!hwndTree) break;
@@ -664,7 +664,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TreeView_DeleteAllItems(hwndTree);
for (indx = 0; indx < sectionList.getCount(); indx++) {
- TCHAR* sectionName;
+ wchar_t* sectionName;
int sectionLevel = 0;
hSection = NULL;
@@ -673,10 +673,10 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM while (sectionName) {
// allow multi-level tree
- TCHAR* pItemName = sectionName;
+ wchar_t* pItemName = sectionName;
HTREEITEM hItem;
- if (sectionName = _tcschr(sectionName, '/')) {
+ if (sectionName = wcschr(sectionName, '/')) {
// one level deeper
*sectionName = 0;
}
@@ -809,7 +809,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM IcolibItem *item = iconList[lvi.lParam];
SafeDestroyIcon(item->temp_icon);
- TCHAR *path = (TCHAR*)lParam;
+ wchar_t *path = (wchar_t*)lParam;
replaceStrT(item->temp_file, path);
item->temp_icon = (HICON)ExtractIconFromPath(path, item->cx, item->cy);
item->temp_reset = FALSE;
@@ -828,12 +828,12 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM break;
}
else if (LOWORD(wParam) == IDC_LOADICONS) {
- TCHAR filetmp[1] = { 0 };
- TCHAR *file;
+ wchar_t filetmp[1] = { 0 };
+ wchar_t *file;
if (file = OpenFileDlg(hwndDlg, filetmp, FALSE)) {
HWND htv = GetDlgItem(hwndDlg, IDC_CATEGORYLIST);
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
PathToRelativeT(file, filename);
mir_free(file);
@@ -932,7 +932,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (lvi.lParam < iconList.getCount()) {
IcolibItem *item = iconList[lvi.lParam];
if (item->temp_file)
- _tcsncpy_s(pInfoTip->pszText, pInfoTip->cchTextMax, item->temp_file, _TRUNCATE);
+ wcsncpy_s(pInfoTip->pszText, pInfoTip->cchTextMax, item->temp_file, _TRUNCATE);
else if (item->default_file)
mir_sntprintf(pInfoTip->pszText, pInfoTip->cchTextMax, L"%s, %d", item->default_file->file, item->default_indx);
}
diff --git a/src/mir_app/src/skinicons.cpp b/src/mir_app/src/skinicons.cpp index 858ccabc22..e50dba78e5 100644 --- a/src/mir_app/src/skinicons.cpp +++ b/src/mir_app/src/skinicons.cpp @@ -129,7 +129,7 @@ static HICON LoadSmallIconShared(HINSTANCE hInstance, LPCTSTR lpIconName) // load small icon (not shared) it IS NEED to be destroyed
static HICON LoadSmallIcon(HINSTANCE hInstance, LPCTSTR lpIconName)
{
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
if (GetModuleFileName(hInstance, filename, MAX_PATH) == 0)
return NULL;
@@ -273,35 +273,35 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) if (hIcon == NULL && (caps2 == 0 || (caps2 & statusIcons[statusIndx].pf2))) {
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa) {
- TCHAR szPath[MAX_PATH], szFullPath[MAX_PATH], *str;
+ wchar_t szPath[MAX_PATH], szFullPath[MAX_PATH], *str;
GetModuleFileName(NULL, szPath, _countof(szPath));
// Queried protocol isn't in list, adding
- TCHAR tszSection[MAX_PATH];
+ wchar_t tszSection[MAX_PATH];
mir_sntprintf(tszSection, _T(PROTOCOLS_PREFIX)L"/%s", pa->tszAccountName);
SKINICONDESC sid = { 0 };
- sid.section.t = tszSection;
+ sid.section.w = tszSection;
sid.flags = SIDF_ALL_TCHAR;
- str = _tcsrchr(szPath, '\\');
+ str = wcsrchr(szPath, '\\');
if (str != NULL)
*str = 0;
mir_sntprintf(szFullPath, L"%s\\Icons\\proto_%S.dll", szPath, pa->szProtoName);
if (GetFileAttributes(szFullPath) != INVALID_FILE_ATTRIBUTES)
- sid.defaultFile.t = szFullPath;
+ sid.defaultFile.w = szFullPath;
else {
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;
+ sid.defaultFile.w = szFullPath;
hIcon = NULL;
}
if (sid.defaultFile.a == NULL) {
if (str != NULL)
*str = '\\';
- sid.defaultFile.t = szPath;
+ sid.defaultFile.w = szPath;
}
}
@@ -317,7 +317,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) // format: core_%s%d
mir_snprintf(iconName, "%s%s%d", statusIconsFmt, szProto, i);
sid.pszName = iconName;
- sid.description.t = cli.pfnGetStatusModeDescription(statusIcons[i].id, 0);
+ sid.description.w = cli.pfnGetStatusModeDescription(statusIcons[i].id, 0);
sid.iDefaultIndex = statusIcons[i].resource_id;
IcoLib_AddIcon(&sid, 0);
}
@@ -379,12 +379,12 @@ MIR_APP_DLL(HICON) Skin_LoadIcon(int idx, bool big) int LoadSkinIcons(void)
{
- TCHAR modulePath[MAX_PATH];
+ wchar_t modulePath[MAX_PATH];
GetModuleFileName(g_hInst, modulePath, _countof(modulePath));
char iconName[MAX_PATH];
SKINICONDESC sid = { 0 };
- sid.defaultFile.t = modulePath;
+ sid.defaultFile.w = modulePath;
sid.flags = SIDF_PATH_TCHAR;
sid.pszName = iconName;
diff --git a/src/mir_app/src/sounds.cpp b/src/mir_app/src/sounds.cpp index abda0e43fd..acdf34d5b9 100644 --- a/src/mir_app/src/sounds.cpp +++ b/src/mir_app/src/sounds.cpp @@ -29,13 +29,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct SoundItem
{
char* name;
- TCHAR* ptszSection;
- TCHAR* ptszDescription;
- TCHAR* ptszTempFile;
+ wchar_t* ptszSection;
+ wchar_t* ptszDescription;
+ wchar_t* ptszTempFile;
int hLangpack;
- __inline TCHAR* getSection() const { return TranslateTH(hLangpack, ptszSection); }
- __inline TCHAR* getDescr() const { return TranslateTH(hLangpack, ptszDescription); }
+ __inline wchar_t* getSection() const { return TranslateTH(hLangpack, ptszSection); }
+ __inline wchar_t* getDescr() const { return TranslateTH(hLangpack, ptszDescription); }
__inline void clear(void)
{
@@ -83,7 +83,7 @@ static INT_PTR ServiceSkinAddNewSound(WPARAM wParam, LPARAM lParam) item->hLangpack = (int)wParam;
arSounds.insert(item);
- TCHAR* ptszDefaultFile;
+ wchar_t* ptszDefaultFile;
if (ssd->dwFlags & SSDF_UNICODE) {
item->ptszDescription = mir_tstrdup(ssd->ptszDescription);
item->ptszSection = mir_tstrdup((ssd->pszSection != NULL) ? ssd->ptszSection : L"Other");
@@ -109,7 +109,7 @@ static INT_PTR ServiceSkinAddNewSound(WPARAM wParam, LPARAM lParam) static int SkinPlaySoundDefault(WPARAM wParam, LPARAM lParam)
{
- TCHAR* pszFile = (TCHAR*) lParam;
+ wchar_t* pszFile = (wchar_t*) lParam;
if (pszFile && (db_get_b(NULL, "Skin", "UseSound", 0) || (int)wParam == 1))
PlaySound(pszFile, NULL, SND_ASYNC | SND_FILENAME | SND_NOSTOP);
@@ -118,11 +118,11 @@ static int SkinPlaySoundDefault(WPARAM wParam, LPARAM lParam) static INT_PTR ServiceSkinPlaySoundFile(WPARAM, LPARAM lParam)
{
- TCHAR *ptszFileName = (TCHAR*)lParam;
+ wchar_t *ptszFileName = (wchar_t*)lParam;
if (ptszFileName == NULL)
return 1;
- TCHAR tszFull[MAX_PATH];
+ wchar_t tszFull[MAX_PATH];
PathToAbsoluteT(ptszFileName, tszFull);
NotifyEventHooks(hPlayEvent, 0, (LPARAM)tszFull);
return 0;
@@ -266,7 +266,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM else {
DBVARIANT dbv;
if (!db_get_ts(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
- TCHAR szPathFull[MAX_PATH];
+ wchar_t szPathFull[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, szPathFull);
NotifyEventHooks(hPlayEvent, 1, (LPARAM)szPathFull);
db_free(&dbv);
@@ -290,9 +290,9 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SoundItem& snd = arSounds[tvi.lParam];
- TCHAR str[MAX_PATH], strFull[MAX_PATH], strdir[MAX_PATH], filter[MAX_PATH];
+ wchar_t str[MAX_PATH], strFull[MAX_PATH], strdir[MAX_PATH], filter[MAX_PATH];
if (snd.ptszTempFile)
- _tcsncpy_s(strFull, snd.ptszTempFile, _TRUNCATE);
+ wcsncpy_s(strFull, snd.ptszTempFile, _TRUNCATE);
else {
if (db_get_b(NULL, "SkinSoundsOff", snd.name, 0) == 0) {
DBVARIANT dbv;
@@ -301,7 +301,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM db_free(&dbv);
} } }
- _tcsncpy_s(strFull, (snd.ptszTempFile ? snd.ptszTempFile : L""), _TRUNCATE);
+ wcsncpy_s(strFull, (snd.ptszTempFile ? snd.ptszTempFile : L""), _TRUNCATE);
PathToAbsoluteT(strFull, strdir);
OPENFILENAME ofn;
@@ -315,7 +315,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ofn.hInstance = NULL;
ofn.lpstrFilter = filter;
- TCHAR* slash = _tcsrchr(strdir, '\\');
+ wchar_t* slash = wcsrchr(strdir, '\\');
if (slash) {
*slash = 0;
ofn.lpstrInitialDir = strdir;
@@ -387,7 +387,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (tvi.lParam == -1)
SendMessage(hwndDlg, DM_HIDEPANE, 0, 0);
else {
- TCHAR buf[256];
+ wchar_t buf[256];
mir_sntprintf(buf, L"%s: %s", arSounds[tvi.lParam].getSection(), arSounds[tvi.lParam].getDescr());
SetDlgItemText(hwndDlg, IDC_NAMEVAL, buf);
if (arSounds[tvi.lParam].ptszTempFile)
diff --git a/src/mir_app/src/srmm_statusicon.cpp b/src/mir_app/src/srmm_statusicon.cpp index e46a071c74..eeb76f9b13 100644 --- a/src/mir_app/src/srmm_statusicon.cpp +++ b/src/mir_app/src/srmm_statusicon.cpp @@ -42,7 +42,7 @@ struct StatusIconChild : public MZeroedObject MCONTACT hContact;
HICON hIcon, hIconDisabled;
int flags;
- TCHAR *tszTooltip;
+ wchar_t *tszTooltip;
};
struct StatusIconMain : public MZeroedObject
diff --git a/src/mir_app/src/xmlApi.cpp b/src/mir_app/src/xmlApi.cpp index ffa87f4f79..df2af6656a 100644 --- a/src/mir_app/src/xmlApi.cpp +++ b/src/mir_app/src/xmlApi.cpp @@ -182,8 +182,8 @@ MIR_APP_DLL(void) xmlAddAttr(HXML _n, LPCTSTR attrName, LPCTSTR attrValue) MIR_APP_DLL(void) xmlAddAttrInt(HXML _n, LPCTSTR attrName, int attrValue)
{
- TCHAR buf[40];
- _itot(attrValue, buf, 10);
+ wchar_t buf[40];
+ _itow(attrValue, buf, 10);
XMLNode(_n).addAttribute(attrName, buf);
}
diff --git a/src/mir_app/src/xmlParser.cpp b/src/mir_app/src/xmlParser.cpp index 9e79495845..9817e0fce5 100644 --- a/src/mir_app/src/xmlParser.cpp +++ b/src/mir_app/src/xmlParser.cpp @@ -1100,7 +1100,7 @@ XMLNode::XMLNode(XMLNodeData *pParent, XMLSTR lpszName, char isDeclaration) d->lpszNS = NULL; if (lpszName && pParent && pParent->lpszName && !pParent->isDeclaration) { - TCHAR* p = _tcschr(lpszName, ':'); + wchar_t* p = wcschr(lpszName, ':'); if (p) { *p = 0; d->lpszNS = d->lpszName; @@ -1197,7 +1197,7 @@ XMLAttribute *XMLNode::addAttribute_priv(int memoryIncrease, XMLSTR lpszName, XM pAttr->lpszValue = lpszValuev; d->nAttribute++; - TCHAR* p = _tcschr(lpszName, ':'); + wchar_t* p = wcschr(lpszName, ':'); if (p) if (!mir_tstrcmp(p+1, d->lpszNS) || (d->pParent && !mir_tstrcmp(p+1, d->pParent->lpszNS))) *p = 0; @@ -1541,7 +1541,7 @@ LBL_Error: #endif } else { - const TCHAR* p = _tcschr(lpszTemp, ':'); + const wchar_t* p = wcschr(lpszTemp, ':'); if (!p) goto LBL_Error; diff --git a/src/mir_app/src/xmlParser.h b/src/mir_app/src/xmlParser.h index aa9bf91a88..6433d00191 100644 --- a/src/mir_app/src/xmlParser.h +++ b/src/mir_app/src/xmlParser.h @@ -121,15 +121,11 @@ #undef _XMLWIDECHAR
#endif
-#ifdef _XMLWINDOWS
-#include <tchar.h>
-#else
#define XMLDLLENTRY
#ifndef XML_NO_WIDE_CHAR
#include <wchar.h> // to have 'wcsrtombs' for ANSI version
// to have 'mbsrtowcs' for WIDECHAR version
#endif
-#endif
// Some common types for char set portable code
#ifdef _XMLWIDECHAR
diff --git a/src/mir_core/src/bitmaps.cpp b/src/mir_core/src/bitmaps.cpp index c997a61a93..c7aab86736 100644 --- a/src/mir_core/src/bitmaps.cpp +++ b/src/mir_core/src/bitmaps.cpp @@ -25,11 +25,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_imgsrvc.h>
-MIR_CORE_DLL(HBITMAP) Bitmap_Load(const TCHAR *ptszFileName)
+MIR_CORE_DLL(HBITMAP) Bitmap_Load(const wchar_t *ptszFileName)
{
- TCHAR szFilename[MAX_PATH];
+ wchar_t szFilename[MAX_PATH];
if (!PathToAbsoluteT(ptszFileName, szFilename))
- _tcsncpy_s(szFilename, ptszFileName, _TRUNCATE);
+ wcsncpy_s(szFilename, ptszFileName, _TRUNCATE);
if (!ServiceExists(MS_IMG_LOAD))
return NULL;
@@ -37,7 +37,7 @@ MIR_CORE_DLL(HBITMAP) Bitmap_Load(const TCHAR *ptszFileName) return (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFilename, IMGL_TCHAR);
}
-MIR_CORE_DLL(void) Bitmap_GetFilter(TCHAR *dest, size_t destLen)
+MIR_CORE_DLL(void) Bitmap_GetFilter(wchar_t *dest, size_t destLen)
{
if (dest == NULL)
return;
diff --git a/src/mir_core/src/cmdline.cpp b/src/mir_core/src/cmdline.cpp index 4896cdf347..c90eb11767 100644 --- a/src/mir_core/src/cmdline.cpp +++ b/src/mir_core/src/cmdline.cpp @@ -59,8 +59,8 @@ 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, L" \t=:")) == NULL) { // no more text in string
+ wchar_t *pOptionName = p+1;
+ if ((p = wcspbrk(pOptionName, L" \t=:")) == NULL) { // no more text in string
arParams.insert(new CmdLineParam(pOptionName, L""));
break;
}
@@ -74,14 +74,14 @@ MIR_CORE_DLL(void) CmdLine_Parse(LPTSTR ptszCmdLine) // parameter with value
*p = 0;
arParams.insert(new CmdLineParam(pOptionName, ++p));
- if ((p = _tcspbrk(p, L" \t")) == NULL) // no more text in string
+ if ((p = wcspbrk(p, L" \t")) == NULL) // no more text in string
break;
p--; // the cycle will wipe this space automatically
}
}
-MIR_CORE_DLL(LPCTSTR) CmdLine_GetOption(const TCHAR* ptszParameter)
+MIR_CORE_DLL(LPCTSTR) CmdLine_GetOption(const wchar_t* ptszParameter)
{
CmdLineParam tmp(ptszParameter, 0);
int idx = arParams.getIndex(&tmp);
diff --git a/src/mir_core/src/hyperlink.cpp b/src/mir_core/src/hyperlink.cpp index cf4b9475f5..8c9390f4c7 100644 --- a/src/mir_core/src/hyperlink.cpp +++ b/src/mir_core/src/hyperlink.cpp @@ -157,7 +157,7 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA case WM_CREATE:
case HLK_MEASURETEXT:
- TCHAR szText[256];
+ wchar_t szText[256];
if (!GetWindowText(hwnd, szText, _countof(szText))) return 0;
lParam = (LPARAM)szText;
/* fall thru */
@@ -172,7 +172,7 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA if (dat->hEnableFont != NULL) hPrevFont = (HFONT)SelectObject(hdc, dat->hEnableFont);
if (dat->hEnableFont == NULL || hPrevFont != NULL) { /* select failed? */
SIZE textSize;
- if (GetTextExtentPoint32(hdc, (TCHAR*)lParam, (int)mir_tstrlen((TCHAR*)lParam), &textSize)) {
+ if (GetTextExtentPoint32(hdc, (wchar_t*)lParam, (int)mir_tstrlen((wchar_t*)lParam), &textSize)) {
if (GetClientRect(hwnd, &rc)) {
dat->rcText.top = 0;
dat->rcText.bottom = dat->rcText.top + textSize.cy;
diff --git a/src/mir_core/src/icons.cpp b/src/mir_core/src/icons.cpp index 4e6b613f51..9b2ee4a65c 100644 --- a/src/mir_core/src/icons.cpp +++ b/src/mir_core/src/icons.cpp @@ -25,11 +25,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconItem *pIcons, size_t iCount, char *prefix, int _hLang)
{
- TCHAR szFile[MAX_PATH];
+ wchar_t szFile[MAX_PATH];
GetModuleFileName(hInst, szFile, MAX_PATH);
SKINICONDESC sid = { 0 };
- sid.defaultFile.t = szFile;
+ sid.defaultFile.w = szFile;
sid.section.a = (char*)szSection;
sid.flags = SIDF_PATH_TCHAR;
@@ -48,14 +48,14 @@ MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconIte }
}
-MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const TCHAR *szSection, IconItemT *pIcons, size_t iCount, char *prefix, int _hLang)
+MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const wchar_t *szSection, IconItemT *pIcons, size_t iCount, char *prefix, int _hLang)
{
- TCHAR szFile[MAX_PATH];
+ wchar_t szFile[MAX_PATH];
GetModuleFileName(hInst, szFile, MAX_PATH);
SKINICONDESC sid = { 0 };
- sid.defaultFile.t = szFile;
- sid.section.t = (TCHAR*)szSection;
+ sid.defaultFile.w = szFile;
+ sid.section.w = (wchar_t*)szSection;
sid.flags = SIDF_ALL_TCHAR;
for (unsigned i = 0; i < iCount; i++) {
@@ -67,7 +67,7 @@ MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const TCHAR *szSection, IconI else sid.pszName = pIcons[i].szName;
sid.cx = sid.cy = pIcons[i].size;
- sid.description.t = pIcons[i].tszDescr;
+ sid.description.w = pIcons[i].tszDescr;
sid.iDefaultIndex = -pIcons[i].defIconID;
pIcons[i].hIcolib = IcoLib_AddIcon(&sid, _hLang);
}
diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp index 348719b1a0..757345cefe 100644 --- a/src/mir_core/src/langpack.cpp +++ b/src/mir_core/src/langpack.cpp @@ -49,7 +49,7 @@ struct LangPackEntry };
static LANGPACK_INFO langPack;
-static TCHAR g_tszRoot[MAX_PATH];
+static wchar_t g_tszRoot[MAX_PATH];
static LangPackEntry *g_pEntries;
static int g_entryCount, g_entriesAlloced;
@@ -215,15 +215,15 @@ static void LoadLangPackFile(FILE *fp, char *line) strlwr(line);
if (!memcmp(line + 1, "include", 7)) {
- TCHAR tszFileName[MAX_PATH];
- TCHAR *p = _tcsrchr(langPack.tszFullPath, '\\');
+ wchar_t tszFileName[MAX_PATH];
+ wchar_t *p = wcsrchr(langPack.tszFullPath, '\\');
if (p)
*p = 0;
mir_sntprintf(tszFileName, L"%s\\%S", langPack.tszFullPath, ltrim(line + 9));
if (p)
*p = '\\';
- FILE *fpNew = _tfopen(tszFileName, L"r");
+ FILE *fpNew = _wfopen(tszFileName, L"r");
if (fpNew) {
line[0] = 0;
fgets(line, LANGPACK_BUF_SIZE, fpNew);
@@ -364,25 +364,25 @@ static int LoadLangDescr(LANGPACK_INFO &lpinfo, FILE *fp, char *line, int &start MultiByteToWideChar(lpinfo.codepage, 0, szLanguage, -1, lpinfo.tszLanguage, _countof(lpinfo.tszLanguage));
if (!lpinfo.tszLanguage[0] && (lpinfo.Locale == 0) || !GetLocaleInfo(lpinfo.Locale, LOCALE_SENGLANGUAGE, lpinfo.tszLanguage, _countof(lpinfo.tszLanguage))) {
- TCHAR *p = _tcschr(lpinfo.tszFileName, '_');
- _tcsncpy_s(lpinfo.tszLanguage, ((p != NULL) ? (p + 1) : lpinfo.tszFileName), _TRUNCATE);
- p = _tcsrchr(lpinfo.tszLanguage, _T('.'));
+ wchar_t *p = wcschr(lpinfo.tszFileName, '_');
+ wcsncpy_s(lpinfo.tszLanguage, ((p != NULL) ? (p + 1) : lpinfo.tszFileName), _TRUNCATE);
+ p = wcsrchr(lpinfo.tszLanguage, '.');
if (p != NULL) *p = '\0';
}
return 0;
}
-MIR_CORE_DLL(int) LoadLangPack(const TCHAR *ptszLangPack)
+MIR_CORE_DLL(int) LoadLangPack(const wchar_t *ptszLangPack)
{
if (ptszLangPack == NULL || !mir_tstrcmpi(ptszLangPack, L""))
return 1;
// ensure that a lang's name is a full file name
- TCHAR tszFullPath[MAX_PATH];
+ wchar_t tszFullPath[MAX_PATH];
if (!PathIsAbsoluteT(ptszLangPack))
mir_sntprintf(tszFullPath, L"%s\\%s", g_tszRoot, ptszLangPack);
else
- _tcsncpy_s(tszFullPath, ptszLangPack, _TRUNCATE);
+ wcsncpy_s(tszFullPath, ptszLangPack, _TRUNCATE);
// this lang is already loaded? nothing to do then
if (!mir_tstrcmp(tszFullPath, langPack.tszFullPath))
@@ -398,12 +398,12 @@ MIR_CORE_DLL(int) LoadLangPack(const TCHAR *ptszLangPack) return 3;
// copy the full file name and extract a file name from it
- _tcsncpy_s(langPack.tszFullPath, tszFullPath, _TRUNCATE);
- TCHAR *p = _tcsrchr(langPack.tszFullPath, '\\');
- _tcsncpy_s(langPack.tszFileName, (p == NULL) ? tszFullPath : p + 1, _TRUNCATE);
+ wcsncpy_s(langPack.tszFullPath, tszFullPath, _TRUNCATE);
+ wchar_t *p = wcsrchr(langPack.tszFullPath, '\\');
+ wcsncpy_s(langPack.tszFileName, (p == NULL) ? tszFullPath : p + 1, _TRUNCATE);
CharLower(langPack.tszFileName);
- FILE *fp = _tfopen(tszFullPath, L"rt");
+ FILE *fp = _wfopen(tszFullPath, L"rt");
if (fp == NULL)
return 1;
@@ -425,17 +425,17 @@ MIR_CORE_DLL(int) LoadLangPack(const TCHAR *ptszLangPack) return 0;
}
-MIR_CORE_DLL(int) LoadLangPackDescr(const TCHAR *ptszLangPack, LANGPACK_INFO *lpInfo)
+MIR_CORE_DLL(int) LoadLangPackDescr(const wchar_t *ptszLangPack, LANGPACK_INFO *lpInfo)
{
if (lpInfo == NULL)
return 1;
- _tcsncpy_s(lpInfo->tszFullPath, ptszLangPack, _TRUNCATE);
- TCHAR *p = _tcsrchr(lpInfo->tszFullPath, '\\');
- _tcsncpy_s(lpInfo->tszFileName, (p == NULL) ? ptszLangPack : p+1, _TRUNCATE);
+ wcsncpy_s(lpInfo->tszFullPath, ptszLangPack, _TRUNCATE);
+ wchar_t *p = wcsrchr(lpInfo->tszFullPath, '\\');
+ wcsncpy_s(lpInfo->tszFileName, (p == NULL) ? ptszLangPack : p+1, _TRUNCATE);
CharLower(lpInfo->tszFileName);
- FILE *fp = _tfopen(ptszLangPack, L"rt");
+ FILE *fp = _wfopen(ptszLangPack, L"rt");
if (fp == NULL)
return 1;
@@ -494,16 +494,16 @@ MIR_CORE_DLL(int) Langpack_GetDefaultLocale() return (langPack.Locale == 0) ? LOCALE_USER_DEFAULT : langPack.Locale;
}
-MIR_CORE_DLL(TCHAR*) Langpack_PcharToTchar(const char *pszStr)
+MIR_CORE_DLL(wchar_t*) Langpack_PcharToTchar(const char *pszStr)
{
if (pszStr == NULL)
return NULL;
int len = (int)strlen(pszStr);
- TCHAR *result = (TCHAR*)alloca((len + 1)*sizeof(TCHAR));
+ wchar_t *result = (wchar_t*)alloca((len + 1)*sizeof(wchar_t));
MultiByteToWideChar(Langpack_GetDefaultCodePage(), 0, pszStr, -1, result, len);
result[len] = 0;
- return mir_wstrdup(TranslateW(result));
+ return mir_wstrdup(TranslateTS(result));
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -526,14 +526,14 @@ MIR_CORE_DLL(void) TranslateMenu_LP(HMENU hMenu, int _hLangpack) mii.cbSize = sizeof(mii);
for (int i = GetMenuItemCount(hMenu) - 1; i >= 0; i--) {
- TCHAR str[256];
+ wchar_t str[256];
mii.fMask = MIIM_TYPE | MIIM_SUBMENU;
- mii.dwTypeData = (TCHAR*)str;
+ mii.dwTypeData = (wchar_t*)str;
mii.cch = _countof(str);
GetMenuItemInfo(hMenu, i, TRUE, &mii);
if (mii.cch && mii.dwTypeData) {
- TCHAR *result = (TCHAR*)LangPackTranslateString(uuid, (const char*)mii.dwTypeData, TRUE);
+ wchar_t *result = (wchar_t*)LangPackTranslateString(uuid, (const char*)mii.dwTypeData, TRUE);
if (result != mii.dwTypeData) {
mii.dwTypeData = result;
mii.fMask = MIIM_TYPE;
@@ -548,10 +548,10 @@ MIR_CORE_DLL(void) TranslateMenu_LP(HMENU hMenu, int _hLangpack) static void TranslateWindow(MUUID *pUuid, HWND hwnd)
{
- TCHAR title[2048];
+ wchar_t title[2048];
GetWindowText(hwnd, title, _countof(title));
- TCHAR *result = (TCHAR*)LangPackTranslateString(pUuid, (const char*)title, TRUE);
+ wchar_t *result = (wchar_t*)LangPackTranslateString(pUuid, (const char*)title, TRUE);
if (result != title)
SetWindowText(hwnd, result);
}
@@ -561,7 +561,7 @@ static BOOL CALLBACK TranslateDialogEnumProc(HWND hwnd, LPARAM lParam) int _hLangpack = (int)lParam;
MUUID *uuid = Langpack_LookupUuid(_hLangpack);
- TCHAR szClass[32];
+ wchar_t szClass[32];
GetClassName(hwnd, szClass, _countof(szClass));
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);
@@ -633,11 +633,11 @@ void GetDefaultLang() {
// calculate the langpacks' root
PathToAbsoluteT(L"\\Languages", g_tszRoot);
- if (_taccess(g_tszRoot, 0) != 0) // directory Languages exists
+ if (_waccess(g_tszRoot, 0) != 0) // directory Languages exists
PathToAbsoluteT(L".", g_tszRoot);
// look into mirandaboot.ini
- TCHAR tszPath[MAX_PATH], tszLangName[256];
+ wchar_t tszPath[MAX_PATH], tszLangName[256];
PathToAbsoluteT(L"\\mirandaboot.ini", tszPath);
GetPrivateProfileString(L"Language", L"DefaultLanguage", L"", tszLangName, _countof(tszLangName), tszPath);
if (tszLangName[0]) {
@@ -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, L"langpack_%s.txt", _tcslwr(tszLangName));
+ mir_sntprintf(tszPath, L"langpack_%s.txt", wcslwr(tszLangName));
if (!LoadLangPack(tszPath)) {
db_set_ts(NULL, "Langpack", "Current", tszPath);
return;
@@ -691,10 +691,10 @@ MIR_CORE_DLL(void) mir_getLP(const PLUGININFOEX *pInfo, int *_hLang) /////////////////////////////////////////////////////////////////////////////////////////
-MIR_CORE_DLL(void) ReloadLangpack(TCHAR *pszStr)
+MIR_CORE_DLL(void) ReloadLangpack(wchar_t *pszStr)
{
if (pszStr == NULL)
- pszStr = NEWTSTR_ALLOCA(langPack.tszFileName);
+ pszStr = NEWWSTR_ALLOCA(langPack.tszFileName);
UnloadLangPackModule();
LoadLangPack(pszStr);
@@ -705,7 +705,7 @@ MIR_CORE_DLL(void) ReloadLangpack(TCHAR *pszStr) static INT_PTR srvReloadLangpack(WPARAM, LPARAM lParam)
{
- ReloadLangpack((TCHAR*)lParam);
+ ReloadLangpack((wchar_t*)lParam);
return 0;
}
diff --git a/src/mir_core/src/logger.cpp b/src/mir_core/src/logger.cpp index 27b9f58e18..3711d26fa6 100644 --- a/src/mir_core/src/logger.cpp +++ b/src/mir_core/src/logger.cpp @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct Logger
{
- Logger(const char* pszName, const TCHAR *ptszDescr, const TCHAR *ptszFilename, unsigned options) :
+ Logger(const char* pszName, const wchar_t *ptszDescr, const wchar_t *ptszFilename, unsigned options) :
m_name(mir_strdup(pszName)),
m_descr(mir_tstrdup(ptszDescr)),
m_fileName(mir_tstrdup(ptszFilename)),
@@ -93,7 +93,7 @@ void CheckLogs() ////////////////////////////////////////////////////////////////////////////////////////////////
-MIR_CORE_DLL(HANDLE) mir_createLog(const char* pszName, const TCHAR *ptszDescr, const TCHAR *ptszFile, unsigned options)
+MIR_CORE_DLL(HANDLE) mir_createLog(const char* pszName, const wchar_t *ptszDescr, const wchar_t *ptszFile, unsigned options)
{
if (ptszFile == NULL)
return NULL;
@@ -108,10 +108,10 @@ MIR_CORE_DLL(HANDLE) mir_createLog(const char* pszName, const TCHAR *ptszDescr, return &arLoggers[idx];
}
- FILE *fp = _tfopen(ptszFile, L"ab");
+ FILE *fp = _wfopen(ptszFile, L"ab");
if (fp == NULL) {
- TCHAR tszPath[MAX_PATH];
- _tcsncpy_s(tszPath, ptszFile, _TRUNCATE);
+ wchar_t tszPath[MAX_PATH];
+ wcsncpy_s(tszPath, ptszFile, _TRUNCATE);
CreatePathToFileT(tszPath);
}
else fclose(fp);
@@ -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, L"ab")) == NULL)
+ if ((p->m_out = _wfopen(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, L"ab")) == NULL)
+ if ((p->m_out = _wfopen(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, L"ab")) == NULL)
+ if ((p->m_out = _wfopen(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, L"ab")) == NULL)
+ if ((p->m_out = _wfopen(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 514aaa4306..055244596f 100644 --- a/src/mir_core/src/miranda.cpp +++ b/src/mir_core/src/miranda.cpp @@ -50,15 +50,15 @@ DWORD mir_tls = 0; static INT_PTR RestartMiranda(WPARAM wParam, LPARAM lParam)
{
- TCHAR mirandaPath[MAX_PATH], cmdLine[MAX_PATH];
+ wchar_t mirandaPath[MAX_PATH], cmdLine[MAX_PATH];
if (lParam)
- _tcsncpy_s(mirandaPath, (const TCHAR*)lParam, _TRUNCATE);
+ wcsncpy_s(mirandaPath, (const wchar_t*)lParam, _TRUNCATE);
else
GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath));
if (wParam) {
VARST profilename(L"%miranda_profilename%");
- mir_sntprintf(cmdLine, L"\"%s\" /restart:%d /profile=%s", mirandaPath, GetCurrentProcessId(), (TCHAR*)profilename);
+ mir_sntprintf(cmdLine, L"\"%s\" /restart:%d /profile=%s", mirandaPath, GetCurrentProcessId(), (wchar_t*)profilename);
}
else mir_sntprintf(cmdLine, L"\"%s\" /restart:%d", mirandaPath, GetCurrentProcessId());
diff --git a/src/mir_core/src/miranda.h b/src/mir_core/src/miranda.h index 8e03d253c6..b7fe4c7607 100644 --- a/src/mir_core/src/miranda.h +++ b/src/mir_core/src/miranda.h @@ -86,7 +86,7 @@ extern LIST<HINSTANCE__> pluginListAddr; // langpack.cpp
char* LangPackTranslateString(MUUID* pUuid, const char *szEnglish, const int W);
-TCHAR* LangPackTranslateStringT(int hLangpack, const TCHAR* tszEnglish);
+wchar_t* LangPackTranslateStringT(int hLangpack, const wchar_t* tszEnglish);
/////////////////////////////////////////////////////////////////////////////////////////
// threads.cpp
diff --git a/src/mir_core/src/openurl.cpp b/src/mir_core/src/openurl.cpp index 084bba84a7..d75baaa2a3 100644 --- a/src/mir_core/src/openurl.cpp +++ b/src/mir_core/src/openurl.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct TOpenUrlInfo
{
- TOpenUrlInfo(TCHAR *_url, int _bNew) :
+ TOpenUrlInfo(wchar_t *_url, int _bNew) :
szUrl(_url),
newWindow(_bNew)
{}
@@ -46,10 +46,10 @@ static void OpenURLThread(void *arg) tszUrl.Format(L"file:///%s", hUrlInfo->szUrl);
else {
int i;
- for (i = 0; _istalpha(hUrlInfo->szUrl[i]); i++);
+ for (i = 0; iswalpha(hUrlInfo->szUrl[i]); i++);
if (hUrlInfo->szUrl[i] == ':')
tszUrl = hUrlInfo->szUrl;
- else if (!_tcsnicmp(hUrlInfo->szUrl, L"ftp.", 4))
+ else if (!wcsnicmp(hUrlInfo->szUrl, L"ftp.", 4))
tszUrl.Format(L"ftp://%s", hUrlInfo->szUrl);
else
tszUrl.Format(L"http://%s", hUrlInfo->szUrl);
diff --git a/src/mir_core/src/timezones.cpp b/src/mir_core/src/timezones.cpp index 38281b123f..c832bd2d42 100644 --- a/src/mir_core/src/timezones.cpp +++ b/src/mir_core/src/timezones.cpp @@ -46,7 +46,7 @@ struct MIM_TIMEZONE unsigned hash;
int offset;
- TCHAR tszName[MIM_TZ_NAMELEN]; // windows name for the time zone
+ wchar_t tszName[MIM_TZ_NAMELEN]; // windows name for the time zone
wchar_t szDisplay[MIM_TZ_DISPLAYLEN]; // more descriptive display name (that's what usually appears in dialogs)
// every hour should be sufficient.
TIME_ZONE_INFORMATION tzi;
@@ -82,13 +82,13 @@ mir_time FileTimeToUnixTime(LPFILETIME pft) return (mir_time)(ll / 10000000);
}
-void FormatTime(const SYSTEMTIME *st, const TCHAR *szFormat, TCHAR *szDest, size_t cbDest)
+void FormatTime(const SYSTEMTIME *st, const wchar_t *szFormat, wchar_t *szDest, size_t cbDest)
{
if (szDest == NULL || cbDest == 0) return;
CMString tszTemp;
- for (const TCHAR* pFormat = szFormat; *pFormat; ++pFormat) {
+ for (const wchar_t* pFormat = szFormat; *pFormat; ++pFormat) {
DWORD fmt = 0;
bool date = false, iso = false;
switch (*pFormat) {
@@ -126,7 +126,7 @@ void FormatTime(const SYSTEMTIME *st, const TCHAR *szFormat, TCHAR *szDest, size continue;
}
- TCHAR dateTimeStr[64];
+ wchar_t dateTimeStr[64];
if (iso)
tszTemp.AppendFormat(L"%d-%02d-%02dT%02d:%02d:%02dZ", st->wYear, st->wMonth, st->wDay, st->wHour, st->wMinute, st->wSecond);
else if (date) {
@@ -139,7 +139,7 @@ void FormatTime(const SYSTEMTIME *st, const TCHAR *szFormat, TCHAR *szDest, size }
}
- _tcsncpy_s(szDest, cbDest, tszTemp, _TRUNCATE);
+ wcsncpy_s(szDest, cbDest, tszTemp, _TRUNCATE);
}
MIR_CORE_DLL(int) TimeZone_GetTimeZoneTime(HANDLE hTZ, SYSTEMTIME *st)
@@ -379,7 +379,7 @@ static const ListMessages* GetListMessages(HWND hWnd, DWORD dwFlags) return NULL;
if (!(dwFlags & (TZF_PLF_CB | TZF_PLF_LB))) {
- TCHAR tszClassName[128];
+ wchar_t tszClassName[128];
GetClassName(hWnd, tszClassName, _countof(tszClassName));
if (!mir_tstrcmpi(tszClassName, L"COMBOBOX"))
dwFlags |= TZF_PLF_CB;
@@ -475,7 +475,7 @@ MIR_CORE_DLL(DWORD) TimeZone_ToLocal(DWORD timeVal) MIR_CORE_DLL(char*) TimeZone_ToString(mir_time timeVal, const char *szFormat, char *szDest, size_t cchDest)
{
- TCHAR *szTemp = (TCHAR*)alloca(cchDest*sizeof(TCHAR));
+ wchar_t *szTemp = (wchar_t*)alloca(cchDest*sizeof(wchar_t));
TimeZone_PrintTimeStamp(NULL, timeVal, _A2T(szFormat), szTemp, cchDest, 0);
WideCharToMultiByte(CP_ACP, 0, szTemp, -1, szDest, (int)cchDest, NULL, NULL);
return szDest;
@@ -489,11 +489,11 @@ MIR_CORE_DLL(wchar_t*) TimeZone_ToStringW(mir_time timeVal, const wchar_t *wszFo ///////////////////////////////////////////////////////////////////////////////
-void GetLocalizedString(HKEY hSubKey, const TCHAR *szName, wchar_t *szBuf, DWORD cbLen)
+void GetLocalizedString(HKEY hSubKey, const wchar_t *szName, wchar_t *szBuf, DWORD cbLen)
{
DWORD dwLength = cbLen * sizeof(wchar_t);
RegQueryValueEx(hSubKey, szName, NULL, NULL, (unsigned char *)szBuf, &dwLength);
- szBuf[min(dwLength / sizeof(TCHAR), cbLen - 1)] = 0;
+ szBuf[min(dwLength / sizeof(wchar_t), cbLen - 1)] = 0;
}
void RecalculateTime(void)
@@ -506,8 +506,8 @@ void RecalculateTime(void) DYNAMIC_TIME_ZONE_INFORMATION dtzi;
if (pfnGetDynamicTimeZoneInformation && pfnGetDynamicTimeZoneInformation(&dtzi) != TIME_ZONE_ID_INVALID) {
- TCHAR *myTzKey = mir_u2t(dtzi.TimeZoneKeyName);
- _tcsncpy_s(myInfo.myTZ.tszName, myTzKey, _TRUNCATE);
+ wchar_t *myTzKey = mir_u2t(dtzi.TimeZoneKeyName);
+ wcsncpy_s(myInfo.myTZ.tszName, myTzKey, _TRUNCATE);
mir_free(myTzKey);
found = true;
}
@@ -519,7 +519,7 @@ void RecalculateTime(void) if (!found) {
if (!mir_wstrcmp(tz.tzi.StandardName, myInfo.myTZ.tzi.StandardName) || !mir_wstrcmp(tz.tzi.DaylightName, myInfo.myTZ.tzi.DaylightName)) {
- _tcsncpy_s(myInfo.myTZ.tszName, tz.tszName, _TRUNCATE);
+ wcsncpy_s(myInfo.myTZ.tszName, tz.tszName, _TRUNCATE);
found = true;
}
}
@@ -531,7 +531,7 @@ void InitTimeZones(void) REG_TZI_FORMAT tzi;
HKEY hKey;
- const TCHAR *tszKey = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones";
+ const wchar_t *tszKey = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones";
/*
* use GetDynamicTimeZoneInformation() on Vista+ - this will return a structure with
@@ -544,7 +544,7 @@ void InitTimeZones(void) if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, tszKey, 0, KEY_ENUMERATE_SUB_KEYS, &hKey)) {
DWORD dwIndex = 0;
HKEY hSubKey;
- TCHAR tszName[MIM_TZ_NAMELEN];
+ wchar_t tszName[MIM_TZ_NAMELEN];
DWORD dwSize = _countof(tszName);
while (ERROR_NO_MORE_ITEMS != RegEnumKeyEx(hKey, dwIndex++, tszName, &dwSize, NULL, NULL, 0, NULL)) {
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp index 0860e797f9..03065d06d2 100644 --- a/src/mir_core/src/ui_utils.cpp +++ b/src/mir_core/src/ui_utils.cpp @@ -84,7 +84,7 @@ void CDlgBase::NotifyChange(void) SendMessage(m_hwndParent, PSM_CHANGED, (WPARAM)m_hwnd, 0);
}
-void CDlgBase::SetCaption(const TCHAR *ptszCaption)
+void CDlgBase::SetCaption(const wchar_t *ptszCaption)
{
if (m_hwnd && ptszCaption)
SetWindowText(m_hwnd, ptszCaption);
@@ -310,7 +310,7 @@ void CCtrlCombo::OnApply() if (GetDataType() == DBVT_TCHAR) {
int len = GetWindowTextLength(m_hwnd) + 1;
- TCHAR *buf = (TCHAR *)_alloca(sizeof(TCHAR) * len);
+ wchar_t *buf = (wchar_t *)_alloca(sizeof(wchar_t) * len);
GetWindowText(m_hwnd, buf, len);
SaveText(buf);
}
@@ -327,7 +327,7 @@ void CCtrlCombo::OnReset() SetInt(LoadInt());
}
-int CCtrlCombo::AddString(const TCHAR *text, LPARAM data)
+int CCtrlCombo::AddString(const wchar_t *text, LPARAM data)
{
int iItem = SendMessage(m_hwnd, CB_ADDSTRING, 0, (LPARAM)text);
if (data)
@@ -347,7 +347,7 @@ void CCtrlCombo::DeleteString(int index) { SendMessage(m_hwnd, CB_DELETESTRING, index, 0);
}
-int CCtrlCombo::FindString(const TCHAR *str, int index, bool exact)
+int CCtrlCombo::FindString(const wchar_t *str, int index, bool exact)
{ return SendMessage(m_hwnd, exact?CB_FINDSTRINGEXACT:CB_FINDSTRING, index, (LPARAM)str);
}
@@ -371,22 +371,22 @@ LPARAM CCtrlCombo::GetItemData(int index) { return SendMessage(m_hwnd, CB_GETITEMDATA, index, 0);
}
-TCHAR* CCtrlCombo::GetItemText(int index)
+wchar_t* CCtrlCombo::GetItemText(int index)
{
- TCHAR *result = (TCHAR *)mir_alloc(sizeof(TCHAR) * (SendMessage(m_hwnd, CB_GETLBTEXTLEN, index, 0) + 1));
+ wchar_t *result = (wchar_t *)mir_alloc(sizeof(wchar_t) * (SendMessage(m_hwnd, CB_GETLBTEXTLEN, index, 0) + 1));
SendMessage(m_hwnd, CB_GETLBTEXT, index, (LPARAM)result);
return result;
}
-TCHAR* CCtrlCombo::GetItemText(int index, TCHAR *buf, int size)
+wchar_t* CCtrlCombo::GetItemText(int index, wchar_t *buf, int size)
{
- TCHAR *result = (TCHAR *)_alloca(sizeof(TCHAR) * (SendMessage(m_hwnd, CB_GETLBTEXTLEN, index, 0) + 1));
+ wchar_t *result = (wchar_t *)_alloca(sizeof(wchar_t) * (SendMessage(m_hwnd, CB_GETLBTEXTLEN, index, 0) + 1));
SendMessage(m_hwnd, CB_GETLBTEXT, index, (LPARAM)result);
mir_tstrncpy(buf, result, size);
return buf;
}
-int CCtrlCombo::InsertString(TCHAR *text, int pos, LPARAM data)
+int CCtrlCombo::InsertString(wchar_t *text, int pos, LPARAM data)
{
int iItem = SendMessage(m_hwnd, CB_INSERTSTRING, pos, (LPARAM)text);
SendMessage(m_hwnd, CB_SETITEMDATA, iItem, data);
@@ -397,7 +397,7 @@ void CCtrlCombo::ResetContent() { SendMessage(m_hwnd, CB_RESETCONTENT, 0, 0);
}
-int CCtrlCombo::SelectString(TCHAR *str)
+int CCtrlCombo::SelectString(wchar_t *str)
{ return SendMessage(m_hwnd, CB_SELECTSTRING, 0, (LPARAM)str);
}
@@ -430,7 +430,7 @@ BOOL CCtrlListBox::OnCommand(HWND, WORD, WORD idCode) return TRUE;
}
-int CCtrlListBox::AddString(TCHAR *text, LPARAM data)
+int CCtrlListBox::AddString(wchar_t *text, LPARAM data)
{
int iItem = SendMessage(m_hwnd, LB_ADDSTRING, 0, (LPARAM)text);
SendMessage(m_hwnd, LB_SETITEMDATA, iItem, data);
@@ -441,7 +441,7 @@ void CCtrlListBox::DeleteString(int index) { SendMessage(m_hwnd, LB_DELETESTRING, index, 0);
}
-int CCtrlListBox::FindString(TCHAR *str, int index, bool exact)
+int CCtrlListBox::FindString(wchar_t *str, int index, bool exact)
{ return SendMessage(m_hwnd, exact?LB_FINDSTRINGEXACT:LB_FINDSTRING, index, (LPARAM)str);
}
@@ -457,16 +457,16 @@ LPARAM CCtrlListBox::GetItemData(int index) { return SendMessage(m_hwnd, LB_GETITEMDATA, index, 0);
}
-TCHAR* CCtrlListBox::GetItemText(int index)
+wchar_t* CCtrlListBox::GetItemText(int index)
{
- TCHAR *result = (TCHAR *)mir_alloc(sizeof(TCHAR) * (SendMessage(m_hwnd, LB_GETTEXTLEN, index, 0) + 1));
+ wchar_t *result = (wchar_t *)mir_alloc(sizeof(wchar_t) * (SendMessage(m_hwnd, LB_GETTEXTLEN, index, 0) + 1));
SendMessage(m_hwnd, LB_GETTEXT, index, (LPARAM)result);
return result;
}
-TCHAR* CCtrlListBox::GetItemText(int index, TCHAR *buf, int size)
+wchar_t* CCtrlListBox::GetItemText(int index, wchar_t *buf, int size)
{
- TCHAR *result = (TCHAR *)_alloca(sizeof(TCHAR) * (SendMessage(m_hwnd, LB_GETTEXTLEN, index, 0) + 1));
+ wchar_t *result = (wchar_t *)_alloca(sizeof(wchar_t) * (SendMessage(m_hwnd, LB_GETTEXTLEN, index, 0) + 1));
SendMessage(m_hwnd, LB_GETTEXT, index, (LPARAM)result);
mir_tstrncpy(buf, result, size);
return buf;
@@ -495,7 +495,7 @@ int* CCtrlListBox::GetSelItems() return result;
}
-int CCtrlListBox::InsertString(TCHAR *text, int pos, LPARAM data)
+int CCtrlListBox::InsertString(wchar_t *text, int pos, LPARAM data)
{
int iItem = SendMessage(m_hwnd, CB_INSERTSTRING, pos, (LPARAM)text);
SendMessage(m_hwnd, CB_SETITEMDATA, iItem, data);
@@ -506,7 +506,7 @@ void CCtrlListBox::ResetContent() { SendMessage(m_hwnd, LB_RESETCONTENT, 0, 0);
}
-int CCtrlListBox::SelectString(TCHAR *str)
+int CCtrlListBox::SelectString(wchar_t *str)
{ return SendMessage(m_hwnd, LB_SELECTSTRING, 0, (LPARAM)str);
}
@@ -575,7 +575,7 @@ void CCtrlEdit::OnApply() if (GetDataType() == DBVT_TCHAR) {
int len = GetWindowTextLength(m_hwnd) + 1;
- TCHAR *buf = (TCHAR *)_alloca(sizeof(TCHAR) * len);
+ wchar_t *buf = (wchar_t *)_alloca(sizeof(wchar_t) * len);
GetWindowText(m_hwnd, buf, len);
SaveText(buf);
}
@@ -617,7 +617,7 @@ void CCtrlData::CreateDbLink(const char* szModuleName, const char* szSetting, BY m_dbLink = new CDbLink(szModuleName, szSetting, type, iValue);
}
-void CCtrlData::CreateDbLink(const char* szModuleName, const char* szSetting, TCHAR* szValue)
+void CCtrlData::CreateDbLink(const char* szModuleName, const char* szSetting, wchar_t* szValue)
{
m_dbLink = new CDbLink(szModuleName, szSetting, DBVT_TCHAR, szValue);
}
@@ -949,7 +949,7 @@ HIMAGELIST CCtrlListView::CreateImageList(int iImageList) return hIml;
}
-void CCtrlListView::AddColumn(int iSubItem, TCHAR *name, int cx)
+void CCtrlListView::AddColumn(int iSubItem, wchar_t *name, int cx)
{
LVCOLUMN lvc;
lvc.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
@@ -960,7 +960,7 @@ void CCtrlListView::AddColumn(int iSubItem, TCHAR *name, int cx) InsertColumn(iSubItem, &lvc);
}
-void CCtrlListView::AddGroup(int iGroupId, TCHAR *name)
+void CCtrlListView::AddGroup(int iGroupId, wchar_t *name)
{
LVGROUP lvg = { 0 };
lvg.cbSize = sizeof(lvg);
@@ -971,7 +971,7 @@ void CCtrlListView::AddGroup(int iGroupId, TCHAR *name) InsertGroup(-1, &lvg);
}
-int CCtrlListView::AddItem(TCHAR *text, int iIcon, LPARAM lParam, int iGroupId)
+int CCtrlListView::AddItem(wchar_t *text, int iIcon, LPARAM lParam, int iGroupId)
{
LVITEM lvi = { 0 };
lvi.mask = LVIF_PARAM | LVIF_TEXT | LVIF_IMAGE;
@@ -987,7 +987,7 @@ int CCtrlListView::AddItem(TCHAR *text, int iIcon, LPARAM lParam, int iGroupId) return InsertItem(&lvi);
}
-void CCtrlListView::SetItem(int iItem, int iSubItem, TCHAR *text, int iIcon)
+void CCtrlListView::SetItem(int iItem, int iSubItem, wchar_t *text, int iIcon)
{
LVITEM lvi = { 0 };
lvi.mask = LVIF_TEXT;
@@ -1300,7 +1300,7 @@ void CCtrlListView::SetItemPosition32(int iItem, int x, int y) void CCtrlListView::SetItemState(int i, UINT state, UINT mask)
{ ListView_SetItemState(m_hwnd, i, state, mask);
}
-void CCtrlListView::SetItemText(int i, int iSubItem, TCHAR *pszText)
+void CCtrlListView::SetItemText(int i, int iSubItem, wchar_t *pszText)
{ ListView_SetItemText(m_hwnd, i, iSubItem, pszText);
}
COLORREF CCtrlListView::SetOutlineColor(COLORREF color)
@@ -1391,7 +1391,7 @@ HTREEITEM CCtrlTreeView::MoveItemAbove(HTREEITEM hItem, HTREEITEM hInsertAfter, if (hItem == hInsertAfter)
return hItem;
- TCHAR name[128];
+ wchar_t name[128];
TVINSERTSTRUCT tvis = { 0 };
tvis.itemex.mask = (UINT)-1;
tvis.itemex.pszText = name;
@@ -1630,7 +1630,7 @@ void CCtrlTreeView::InvertCheck(HTREEITEM hItem) void CCtrlTreeView::TranslateItem(HTREEITEM hItem)
{
TVITEMEX tvi;
- TCHAR buf[128];
+ wchar_t buf[128];
GetItem(hItem, &tvi, buf, _countof(buf));
tvi.pszText = TranslateTS(tvi.pszText);
SetItem(&tvi);
@@ -1660,10 +1660,10 @@ void CCtrlTreeView::TranslateTree() }
}
-HTREEITEM CCtrlTreeView::FindNamedItem(HTREEITEM hItem, const TCHAR *name)
+HTREEITEM CCtrlTreeView::FindNamedItem(HTREEITEM hItem, const wchar_t *name)
{
TVITEMEX tvi = { 0 };
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
if (hItem)
tvi.hItem = GetChild(hItem);
@@ -1696,7 +1696,7 @@ void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi) GetItem(tvi);
}
-void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi, TCHAR *szText, int iTextLength)
+void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi, wchar_t *szText, int iTextLength)
{
memset(tvi, 0, sizeof(*tvi));
tvi->mask = TVIF_CHILDREN | TVIF_HANDLE | TVIF_IMAGE | TVIF_INTEGRAL | TVIF_PARAM | TVIF_SELECTEDIMAGE | TVIF_STATE | TVIF_TEXT;
@@ -2134,7 +2134,7 @@ LRESULT CCtrlPages::CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam) return CSuper::CustomWndProc(msg, wParam, lParam);
}
-void CCtrlPages::AddPage(TCHAR *ptszName, HICON hIcon, CDlgBase *pDlg)
+void CCtrlPages::AddPage(wchar_t *ptszName, HICON hIcon, CDlgBase *pDlg)
{
TPageInfo *info = new TPageInfo;
info->m_pDlg = pDlg;
@@ -2359,7 +2359,7 @@ LRESULT CCtrlBase::SendMsg(UINT Msg, WPARAM wParam, LPARAM lParam) return ::SendMessage(m_hwnd, Msg, wParam, lParam);
}
-void CCtrlBase::SetText(const TCHAR *text)
+void CCtrlBase::SetText(const wchar_t *text)
{
::SetWindowText(m_hwnd, text);
}
@@ -2371,15 +2371,15 @@ void CCtrlBase::SetTextA(const char *text) void CCtrlBase::SetInt(int value)
{
- TCHAR buf[32] = { 0 };
+ wchar_t buf[32] = { 0 };
mir_sntprintf(buf, L"%d", value);
SetWindowText(m_hwnd, buf);
}
-TCHAR* CCtrlBase::GetText()
+wchar_t* CCtrlBase::GetText()
{
int length = GetWindowTextLength(m_hwnd) + 1;
- TCHAR *result = (TCHAR *)mir_alloc(length * sizeof(TCHAR));
+ wchar_t *result = (wchar_t *)mir_alloc(length * sizeof(wchar_t));
GetWindowText(m_hwnd, result, length);
return result;
}
@@ -2392,7 +2392,7 @@ char* CCtrlBase::GetTextA() return result;
}
-TCHAR* CCtrlBase::GetText(TCHAR *buf, int size)
+wchar_t* CCtrlBase::GetText(wchar_t *buf, int size)
{
GetWindowText(m_hwnd, buf, size);
buf[size - 1] = 0;
@@ -2409,9 +2409,9 @@ char* CCtrlBase::GetTextA(char *buf, int size) int CCtrlBase::GetInt()
{
int length = GetWindowTextLength(m_hwnd) + 1;
- TCHAR *result = (TCHAR *)_alloca(length * sizeof(TCHAR));
+ wchar_t *result = (wchar_t *)_alloca(length * sizeof(wchar_t));
GetWindowText(m_hwnd, result, length);
- return _ttoi(result);
+ return _wtoi(result);
}
LRESULT CCtrlBase::CustomWndProc(UINT, WPARAM, LPARAM)
@@ -2464,7 +2464,7 @@ CDbLink::CDbLink(const char *szModule, const char *szSetting, BYTE type, DWORD i dbv.type = DBVT_DELETED;
}
-CDbLink::CDbLink(const char *szModule, const char *szSetting, BYTE type, TCHAR *szValue)
+CDbLink::CDbLink(const char *szModule, const char *szSetting, BYTE type, wchar_t *szValue)
: CDataLink(type)
{
m_szModule = mir_strdup(szModule);
@@ -2501,7 +2501,7 @@ void CDbLink::SaveInt(DWORD value) }
}
-TCHAR* CDbLink::LoadText()
+wchar_t* CDbLink::LoadText()
{
if (dbv.type != DBVT_DELETED) db_free(&dbv);
if (!db_get_ts(NULL, m_szModule, m_szSetting, &dbv)) {
@@ -2514,7 +2514,7 @@ TCHAR* CDbLink::LoadText() return m_szDefault;
}
-void CDbLink::SaveText(TCHAR *value)
+void CDbLink::SaveText(wchar_t *value)
{
db_set_ts(NULL, m_szModule, m_szSetting, value);
}
diff --git a/src/mir_core/src/utils.cpp b/src/mir_core/src/utils.cpp index f6bac7c121..da473a9a5b 100644 --- a/src/mir_core/src/utils.cpp +++ b/src/mir_core/src/utils.cpp @@ -62,7 +62,7 @@ MIR_CORE_DLL(WCHAR*) rtrimw(WCHAR *str) if (str == NULL)
return NULL;
- WCHAR *p = _tcschr(str, 0);
+ WCHAR *p = wcschr(str, 0);
while (--p >= str) {
switch (*p) {
case ' ': case '\t': case '\n': case '\r':
diff --git a/src/mir_core/src/winver.cpp b/src/mir_core/src/winver.cpp index cdda5b55cc..8484f8ef71 100644 --- a/src/mir_core/src/winver.cpp +++ b/src/mir_core/src/winver.cpp @@ -69,7 +69,7 @@ MIR_CORE_DLL(BOOL) IsFullScreen() // check foregroundwindow
HWND hWnd = GetForegroundWindow();
if (hWnd && hWnd != hWndDesktop && hWnd != hWndShell) {
- TCHAR tszClassName[128] = L"";
+ wchar_t tszClassName[128] = L"";
GetClassName(hWnd, tszClassName, _countof(tszClassName));
if (_tcscmp(tszClassName, L"WorkerW")) {
RECT rect, rectw, recti;
@@ -93,7 +93,7 @@ MIR_CORE_DLL(BOOL) IsWorkstationLocked(void) if (hDesk == NULL)
return true;
- TCHAR tszName[100];
+ wchar_t tszName[100];
DWORD cbName;
BOOL bLocked = (!GetUserObjectInformation(hDesk, UOI_NAME, tszName, _countof(tszName), &cbName) || mir_tstrcmpi(tszName, L"default") != 0);
CloseDesktop(hDesk);
@@ -198,7 +198,7 @@ MIR_CORE_DLL(BOOL) IsScreenSaverRunning(void) typedef BOOL(WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD);
typedef LPCSTR(WINAPI *WGV)(void);
-MIR_CORE_DLL(BOOL) GetOSDisplayString(TCHAR *buf, size_t bufSize)
+MIR_CORE_DLL(BOOL) GetOSDisplayString(wchar_t *buf, size_t bufSize)
{
if (buf == NULL || bufSize == 0)
return 0;
diff --git a/src/miranda32/src/miranda.cpp b/src/miranda32/src/miranda.cpp index d8c1b60ad2..165f9ff1ed 100644 --- a/src/miranda32/src/miranda.cpp +++ b/src/miranda32/src/miranda.cpp @@ -26,12 +26,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef int (WINAPI *pfnMain)(LPTSTR);
-int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR cmdLine, int)
+int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR cmdLine, int)
{
- TCHAR tszPath[MAX_PATH];
+ wchar_t tszPath[MAX_PATH];
GetModuleFileName(hInstance, tszPath, _countof(tszPath));
- TCHAR *p = _tcsrchr(tszPath, '\\');
+ wchar_t *p = wcsrchr(tszPath, '\\');
if (p == NULL)
return 4;
@@ -39,13 +39,13 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR cmdLine, int) p[1] = 0;
SetCurrentDirectory(tszPath);
- _tcsncat_s(tszPath, L"libs", _TRUNCATE);
- DWORD cbPath = (DWORD)_tcslen(tszPath);
+ wcsncat_s(tszPath, L"libs", _TRUNCATE);
+ DWORD cbPath = (DWORD)wcslen(tszPath);
DWORD cbSize = GetEnvironmentVariable(L"PATH", NULL, 0);
- TCHAR *ptszVal = new TCHAR[cbSize + MAX_PATH + 2];
- _tcscpy(ptszVal, tszPath);
- _tcscat(ptszVal, L";");
+ wchar_t *ptszVal = new wchar_t[cbSize + MAX_PATH + 2];
+ wcscpy(ptszVal, tszPath);
+ wcscat(ptszVal, L";");
GetEnvironmentVariable(L"PATH", ptszVal + cbPath + 1, cbSize);
SetEnvironmentVariable(L"PATH", ptszVal);
diff --git a/src/miranda32/src/stdafx.h b/src/miranda32/src/stdafx.h index 56433df124..030e0539b5 100644 --- a/src/miranda32/src/stdafx.h +++ b/src/miranda32/src/stdafx.h @@ -23,5 +23,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <windows.h>
-
-#include <tchar.h>
|