summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
commit6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch)
tree2e8bb660c908b54914abd562af8aafa4a486c846 /src/mir_core
parenta61c8728b379057fe7f0a0d86fe0b037598229dd (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/mir_core')
-rw-r--r--src/mir_core/src/bitmaps.cpp8
-rw-r--r--src/mir_core/src/cmdline.cpp8
-rw-r--r--src/mir_core/src/hyperlink.cpp4
-rw-r--r--src/mir_core/src/icons.cpp14
-rw-r--r--src/mir_core/src/langpack.cpp68
-rw-r--r--src/mir_core/src/logger.cpp18
-rw-r--r--src/mir_core/src/miranda.cpp6
-rw-r--r--src/mir_core/src/miranda.h2
-rw-r--r--src/mir_core/src/openurl.cpp6
-rw-r--r--src/mir_core/src/timezones.cpp28
-rw-r--r--src/mir_core/src/ui_utils.cpp82
-rw-r--r--src/mir_core/src/utils.cpp2
-rw-r--r--src/mir_core/src/winver.cpp6
13 files changed, 126 insertions, 126 deletions
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;