diff options
Diffstat (limited to 'plugins')
1030 files changed, 11380 insertions, 11425 deletions
diff --git a/plugins/AVS/src/acc.cpp b/plugins/AVS/src/acc.cpp index 6fc63c6838..96935ace4f 100644 --- a/plugins/AVS/src/acc.cpp +++ b/plugins/AVS/src/acc.cpp @@ -43,7 +43,7 @@ typedef struct COLORREF bkgColor;
COLORREF avatarBorderColor;
int avatarRoundCornerRadius;
- TCHAR noAvatarText[128];
+ wchar_t noAvatarText[128];
BOOL respectHidden;
BOOL resizeIfSmaller;
BOOL fAero;
@@ -347,7 +347,7 @@ static void NotifyAvatarChange(HWND hwnd) SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&pshn);
}
-static void DrawText(HDC hdc, HFONT hFont, const RECT &rc, const TCHAR *text)
+static void DrawText(HDC hdc, HFONT hFont, const RECT &rc, const wchar_t *text)
{
HGDIOBJ oldFont = SelectObject(hdc, hFont);
@@ -469,7 +469,7 @@ static LRESULT CALLBACK ACCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP return TRUE;
case AVATAR_SETNOAVATARTEXT:
- mir_tstrncpy(data->noAvatarText, TranslateTS((TCHAR*)lParam), _countof(data->noAvatarText));
+ mir_tstrncpy(data->noAvatarText, TranslateTS((wchar_t*)lParam), _countof(data->noAvatarText));
Invalidate(hwnd);
return TRUE;
diff --git a/plugins/AVS/src/acc.h b/plugins/AVS/src/acc.h index 356a09dea3..9917156385 100644 --- a/plugins/AVS/src/acc.h +++ b/plugins/AVS/src/acc.h @@ -21,8 +21,8 @@ Boston, MA 02111-1307, USA. #ifndef __ACC_H__
# define __ACC_H__
-static INT_PTR avSetAvatar(MCONTACT hContact, TCHAR *tszPath);
-INT_PTR avSetMyAvatar(char *szProto, TCHAR *tszPath);
+static INT_PTR avSetAvatar(MCONTACT hContact, wchar_t *tszPath);
+INT_PTR avSetMyAvatar(char *szProto, wchar_t *tszPath);
int LoadACC();
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index 5c0d9fcef4..c4702ae89c 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -129,7 +129,7 @@ void NotifyMetaAware(MCONTACT hContact, CacheNode *node, AVATARCACHEENTRY *ace) cacn.cbSize = sizeof(CONTACTAVATARCHANGEDNOTIFICATION);
cacn.hContact = hContact;
cacn.format = node->pa_format;
- _tcsncpy_s(cacn.filename, node->szFilename, _TRUNCATE);
+ wcsncpy_s(cacn.filename, node->szFilename, _TRUNCATE);
// Get hash
char *szProto = GetContactProto(hContact);
@@ -137,12 +137,12 @@ void NotifyMetaAware(MCONTACT hContact, CacheNode *node, AVATARCACHEENTRY *ace) DBVARIANT dbv = { 0 };
if (!db_get_s(hContact, szProto, "AvatarHash", &dbv)) {
if (dbv.type == DBVT_TCHAR)
- _tcsncpy_s(cacn.hash, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(cacn.hash, dbv.ptszVal, _TRUNCATE);
else if (dbv.type == DBVT_ASCIIZ)
- _tcsncpy_s(cacn.hash, _A2T(dbv.pszVal), _TRUNCATE);
+ wcsncpy_s(cacn.hash, _A2T(dbv.pszVal), _TRUNCATE);
else if (dbv.type == DBVT_BLOB) {
ptrA szHash(mir_base64_encode(dbv.pbVal, dbv.cpbVal));
- _tcsncpy_s(cacn.hash, _A2T(szHash), _TRUNCATE);
+ wcsncpy_s(cacn.hash, _A2T(szHash), _TRUNCATE);
}
db_free(&dbv);
}
diff --git a/plugins/AVS/src/image_utils.cpp b/plugins/AVS/src/image_utils.cpp index c478f8bd3e..61c548c96b 100644 --- a/plugins/AVS/src/image_utils.cpp +++ b/plugins/AVS/src/image_utils.cpp @@ -159,7 +159,7 @@ void SetHIMETRICtoDP(HDC hdc, SIZE* sz) sz->cy = pt.y;
}
-HBITMAP BmpFilterLoadBitmap(BOOL *bIsTransparent, const TCHAR *ptszFilename)
+HBITMAP BmpFilterLoadBitmap(BOOL *bIsTransparent, const wchar_t *ptszFilename)
{
if (fei == NULL)
return 0;
@@ -203,14 +203,14 @@ static HWND hwndClui = 0; // PNG and BMP will be saved as 32bit images, jpg as 24bit with default quality (75)
// returns 1 on success, 0 on failure
-int BmpFilterSaveBitmap(HBITMAP hBmp, const TCHAR *ptszFile, int flags)
+int BmpFilterSaveBitmap(HBITMAP hBmp, const wchar_t *ptszFile, int flags)
{
if (fei == NULL)
return -1;
- TCHAR tszFilename[MAX_PATH];
+ wchar_t tszFilename[MAX_PATH];
if (!PathToAbsoluteT(ptszFile, tszFilename))
- _tcsncpy_s(tszFilename, ptszFile, _TRUNCATE);
+ wcsncpy_s(tszFilename, ptszFile, _TRUNCATE);
if (mir_tstrlen(tszFilename) <= 4)
return -1;
@@ -551,7 +551,7 @@ BOOL MakeTransparentBkg(MCONTACT hContact, HBITMAP *hBitmap) /////////////////////////////////////////////////////////////////////////////////////////
// Other utils
-int SaveAvatar(const char *protocol, const TCHAR *tszFileName)
+int SaveAvatar(const char *protocol, const wchar_t *tszFileName)
{
INT_PTR result = CallProtoService(protocol, PS_SETMYAVATAR, 0, (LPARAM)tszFileName);
if (result == CALLSERVICE_NOTFOUND)
diff --git a/plugins/AVS/src/image_utils.h b/plugins/AVS/src/image_utils.h index b61f05b883..cf4529321e 100644 --- a/plugins/AVS/src/image_utils.h +++ b/plugins/AVS/src/image_utils.h @@ -1,8 +1,8 @@ #ifndef __IMAGE_UTILS_H__
# define __IMAGE_UTILS_H__
-HBITMAP BmpFilterLoadBitmap(BOOL *bIsTransparent, const TCHAR *ptszFilename);
-int BmpFilterSaveBitmap(HBITMAP hBmp, const TCHAR *ptszFile, int flags);
+HBITMAP BmpFilterLoadBitmap(BOOL *bIsTransparent, const wchar_t *ptszFilename);
+int BmpFilterSaveBitmap(HBITMAP hBmp, const wchar_t *ptszFile, int flags);
HBITMAP CopyBitmapTo32(HBITMAP hBitmap);
@@ -11,6 +11,6 @@ BOOL MakeTransparentBkg(MCONTACT hContact, HBITMAP *hBitmap); HBITMAP MakeGrayscale(HBITMAP hBitmap);
DWORD GetImgHash(HBITMAP hBitmap);
-int SaveAvatar(const char* protocol, const TCHAR* tszFileName);
+int SaveAvatar(const char* protocol, const wchar_t* tszFileName);
#endif // __IMAGE_UTILS_H__
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index 8a9bc4170a..516d6a204b 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -32,7 +32,7 @@ bool g_shutDown = false; int hLangpack;
-TCHAR g_szDataPath[MAX_PATH]; // user datae path (read at startup only)
+wchar_t g_szDataPath[MAX_PATH]; // user datae path (read at startup only)
BOOL g_AvatarHistoryAvail = FALSE;
HWND hwndSetMyAvatar = 0;
@@ -144,7 +144,7 @@ static void LoadProtoInfo(PROTOCOLDESCRIPTOR *proto) char protoName[MAX_PATH];
mir_snprintf(protoName, "Global avatar for %s accounts", proto->szName);
- TCHAR protoNameTmp[MAX_PATH];
+ wchar_t protoNameTmp[MAX_PATH];
mir_sntprintf(protoNameTmp, TranslateT("Global avatar for %s accounts"), _A2T(proto->szName));
protoPicCacheEntry *pce = new protoPicCacheEntry;
if (CreateAvatarInCache(0, pce, protoName) != 1)
@@ -322,7 +322,7 @@ void InternalDrawAvatar(AVATARDRAWREQUEST *r, HBITMAP hbm, LONG bmWidth, LONG bm static int ModulesLoaded(WPARAM, LPARAM)
{
- TCHAR szEventName[100];
+ wchar_t szEventName[100];
mir_sntprintf(szEventName, L"avs_loaderthread_%d", GetCurrentThreadId());
hLoaderEvent = CreateEvent(NULL, TRUE, FALSE, szEventName);
@@ -381,8 +381,8 @@ static int LoadAvatarModule() InitServices();
InitPolls();
- _tcsncpy_s(g_szDataPath, _countof(g_szDataPath), VARST(L"%miranda_userdata%\\"), _TRUNCATE);
- _tcslwr(g_szDataPath);
+ wcsncpy_s(g_szDataPath, _countof(g_szDataPath), VARST(L"%miranda_userdata%\\"), _TRUNCATE);
+ wcslwr(g_szDataPath);
return 0;
}
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index 2a438acebe..7254543bb3 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -99,7 +99,7 @@ static void RemoveProtoPic(const char *szProto) static void SetProtoPic(char *szProto) { - TCHAR FileName[MAX_PATH], filter[256]; + wchar_t FileName[MAX_PATH], filter[256]; Bitmap_GetFilter(filter, _countof(filter)); OPENFILENAME ofn = { 0 }; @@ -116,10 +116,10 @@ static void SetProtoPic(char *szProto) if (!GetOpenFileName(&ofn)) return; - if (_taccess(FileName, 4) == -1) + if (_waccess(FileName, 4) == -1) return; - TCHAR szNewPath[MAX_PATH]; + wchar_t szNewPath[MAX_PATH]; PathToRelativeT(FileName, szNewPath, g_szDataPath); db_set_ts(NULL, PPICT_MODULE, szProto, szNewPath); @@ -387,7 +387,7 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar DBVARIANT dbv; if (!db_get_ts(NULL, PPICT_MODULE, g_selectedProto, &dbv)) { if (!PathIsAbsoluteT(VARST(dbv.ptszVal))) { - TCHAR szFinalPath[MAX_PATH]; + wchar_t szFinalPath[MAX_PATH]; mir_sntprintf(szFinalPath, L"%%miranda_path%%\\%s", dbv.ptszVal); SetDlgItemText(hwndDlg, IDC_PROTOAVATARNAME, szFinalPath); } @@ -488,7 +488,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA TranslateDialogDefault(hwndDlg); if (hContact) { - TCHAR szTitle[512]; + wchar_t szTitle[512]; mir_sntprintf(szTitle, TranslateT("Set avatar options for %s"), pcli->pfnGetContactDisplayName(hContact, 0)); SetWindowText(hwndDlg, szTitle); } @@ -660,7 +660,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA case DM_SETAVATARNAME: { - TCHAR szFinalName[MAX_PATH]; + wchar_t szFinalName[MAX_PATH]; DBVARIANT dbv = { 0 }; BYTE is_locked = db_get_b(hContact, "ContactPhoto", "Locked", 0); @@ -744,7 +744,7 @@ static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wPa HWND protopic = GetDlgItem(hwndDlg, IDC_PROTOPIC); SendMessage(protopic, AVATAR_SETCONTACT, 0, (LPARAM)hContact); SendMessage(protopic, AVATAR_SETAVATARBORDERCOLOR, 0, (LPARAM)GetSysColor(COLOR_BTNSHADOW)); - SendMessage(protopic, AVATAR_SETNOAVATARTEXT, 0, (LPARAM)LPGENT("Contact has no avatar")); + SendMessage(protopic, AVATAR_SETNOAVATARTEXT, 0, (LPARAM)LPGENW("Contact has no avatar")); SendMessage(protopic, AVATAR_RESPECTHIDDEN, 0, (LPARAM)FALSE); SendMessage(protopic, AVATAR_SETRESIZEIFSMALLER, 0, (LPARAM)FALSE); } @@ -986,7 +986,7 @@ static INT_PTR CALLBACK DlgProcAvatarProtoInfo(HWND hwndDlg, UINT msg, WPARAM wP { HWND protopic = GetDlgItem(hwndDlg, IDC_PROTOPIC); SendMessage(protopic, AVATAR_SETAVATARBORDERCOLOR, 0, (LPARAM)GetSysColor(COLOR_BTNSHADOW)); - SendMessage(protopic, AVATAR_SETNOAVATARTEXT, 0, (LPARAM)LPGENT("No avatar")); + SendMessage(protopic, AVATAR_SETNOAVATARTEXT, 0, (LPARAM)LPGENW("No avatar")); SendMessage(protopic, AVATAR_SETRESIZEIFSMALLER, 0, (LPARAM)FALSE); HWND hwndList = GetDlgItem(hwndDlg, IDC_PROTOCOLS); @@ -1082,7 +1082,7 @@ static INT_PTR CALLBACK DlgProcAvatarProtoInfo(HWND hwndDlg, UINT msg, WPARAM wP char description[256]; CallProtoService(proto, PS_GETNAME, _countof(description), (LPARAM)description); - TCHAR *descr = mir_a2t(description); + wchar_t *descr = mir_a2t(description); if (MessageBox(hwndDlg, TranslateT("Are you sure you want to remove your avatar?"), descr, MB_YESNO) == IDYES) avSetMyAvatar(proto, L""); mir_free(descr); diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp index a713a71935..226bb12278 100644 --- a/plugins/AVS/src/poll.cpp +++ b/plugins/AVS/src/poll.cpp @@ -44,7 +44,7 @@ static void RequestThread(void *vParam); extern HANDLE hShutdownEvent;
extern int DeleteAvatar(MCONTACT hContact);
-extern void MakePathRelative(MCONTACT hContact, TCHAR *path);
+extern void MakePathRelative(MCONTACT hContact, wchar_t *path);
int Proto_GetDelayAfterFail(const char *proto);
BOOL Proto_IsFetchingWhenProtoNotVisibleAllowed(const char *proto);
BOOL Proto_IsFetchingWhenContactOfflineAllowed(const char *proto);
diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp index 058f377e99..79a21f3b8a 100644 --- a/plugins/AVS/src/services.cpp +++ b/plugins/AVS/src/services.cpp @@ -115,10 +115,10 @@ UINT_PTR CALLBACK OpenFileSubclass(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP return FALSE;
}
-static INT_PTR avSetAvatar(MCONTACT hContact, TCHAR *tszPath)
+static INT_PTR avSetAvatar(MCONTACT hContact, wchar_t *tszPath)
{
- TCHAR FileName[MAX_PATH];
- TCHAR *szFinalName;
+ wchar_t FileName[MAX_PATH];
+ wchar_t *szFinalName;
BYTE locking_request;
if (hContact == NULL || fei == NULL)
@@ -127,7 +127,7 @@ static INT_PTR avSetAvatar(MCONTACT hContact, TCHAR *tszPath) int is_locked = db_get_b(hContact, "ContactPhoto", "Locked", 0);
if (tszPath == NULL) {
- TCHAR filter[256];
+ wchar_t filter[256];
Bitmap_GetFilter(filter, _countof(filter));
OPENFILENAME ofn = { 0 };
@@ -155,11 +155,11 @@ static INT_PTR avSetAvatar(MCONTACT hContact, TCHAR *tszPath) else szFinalName = tszPath;
// filename is now set, check it and perform all needed action
- if (_taccess(szFinalName, 4) == -1)
+ if (_waccess(szFinalName, 4) == -1)
return 0;
// file exists...
- TCHAR szBackupName[MAX_PATH];
+ wchar_t szBackupName[MAX_PATH];
PathToRelativeT(szFinalName, szBackupName, g_szDataPath);
db_set_ts(hContact, "ContactPhoto", "Backup", szBackupName);
@@ -179,7 +179,7 @@ INT_PTR SetAvatar(WPARAM wParam, LPARAM lParam) INT_PTR SetAvatarW(WPARAM wParam, LPARAM lParam)
{
- return avSetAvatar(wParam, (TCHAR*)lParam);
+ return avSetAvatar(wParam, (wchar_t*)lParam);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -333,12 +333,12 @@ static UINT_PTR CALLBACK SetMyAvatarHookProc(HWND hwnd, UINT msg, WPARAM, LPARAM struct SaveProtocolData
{
DWORD max_size;
- TCHAR image_file_name[MAX_PATH];
+ wchar_t image_file_name[MAX_PATH];
BOOL saved;
BOOL need_smaller_size;
int width;
int height;
- TCHAR temp_file[MAX_PATH];
+ wchar_t temp_file[MAX_PATH];
HBITMAP hBmpProto;
};
@@ -369,7 +369,7 @@ void SaveImage(SaveProtocolData &d, char *protocol, int format) else d.saved = TRUE;
}
-static int SetProtoMyAvatar(char *protocol, HBITMAP hBmp, TCHAR *originalFilename, int originalFormat, BOOL square, BOOL grow)
+static int SetProtoMyAvatar(char *protocol, HBITMAP hBmp, wchar_t *originalFilename, int originalFormat, BOOL square, BOOL grow)
{
if (!ProtoServiceExists(protocol, PS_SETMYAVATAR))
return -1;
@@ -491,10 +491,10 @@ static int SetProtoMyAvatar(char *protocol, HBITMAP hBmp, TCHAR *originalFilenam return ret;
}
-static int InternalSetMyAvatar(char *protocol, TCHAR *szFinalName, SetMyAvatarHookData &data, BOOL allAcceptXML, BOOL allAcceptSWF)
+static int InternalSetMyAvatar(char *protocol, wchar_t *szFinalName, SetMyAvatarHookData &data, BOOL allAcceptXML, BOOL allAcceptSWF)
{
int format = ProtoGetAvatarFormat(szFinalName);
- if (format == PA_FORMAT_UNKNOWN || _taccess(szFinalName, 4) == -1)
+ if (format == PA_FORMAT_UNKNOWN || _waccess(szFinalName, 4) == -1)
return -3;
// file exists...
@@ -547,14 +547,14 @@ static int InternalSetMyAvatar(char *protocol, TCHAR *szFinalName, SetMyAvatarHo db_set_b(NULL, AVS_MODULE, "GlobalUserAvatarNotConsistent", 1);
else {
// Copy avatar file to store as global one
- TCHAR globalFile[1024];
+ wchar_t globalFile[1024];
BOOL saved = TRUE;
if (FoldersGetCustomPathT(hGlobalAvatarFolder, globalFile, _countof(globalFile), L"")) {
mir_sntprintf(globalFile, L"%s%s", g_szDataPath, L"GlobalAvatar");
CreateDirectory(globalFile, NULL);
}
- TCHAR *ext = _tcsrchr(szFinalName, _T('.')); // Can't be NULL here
+ wchar_t *ext = wcsrchr(szFinalName, '.'); // Can't be NULL here
if (format == PA_FORMAT_XML || format == PA_FORMAT_SWF) {
mir_sntprintf(globalFile, L"%s\\my_global_avatar%s", globalFile, ext);
CopyFile(szFinalName, globalFile, FALSE);
@@ -588,7 +588,7 @@ static int InternalSetMyAvatar(char *protocol, TCHAR *szFinalName, SetMyAvatarHo }
if (saved) {
- TCHAR relFile[1024];
+ wchar_t relFile[1024];
if (PathToRelativeT(globalFile, relFile, g_szDataPath))
db_set_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", relFile);
else
@@ -608,10 +608,10 @@ static int InternalSetMyAvatar(char *protocol, TCHAR *szFinalName, SetMyAvatarHo return ret;
}
-INT_PTR avSetMyAvatar(char* protocol, TCHAR* tszPath)
+INT_PTR avSetMyAvatar(char* protocol, wchar_t* tszPath)
{
- TCHAR FileName[MAX_PATH];
- TCHAR *szFinalName = NULL;
+ wchar_t FileName[MAX_PATH];
+ wchar_t *szFinalName = NULL;
BOOL allAcceptXML;
BOOL allAcceptSWF;
@@ -664,7 +664,7 @@ INT_PTR avSetMyAvatar(char* protocol, TCHAR* tszPath) CMString filter;
FilterGetStrings(filter, allAcceptXML, allAcceptSWF);
- TCHAR inipath[1024];
+ wchar_t inipath[1024];
FoldersGetCustomPathT(hMyAvatarsFolder, inipath, _countof(inipath), L".");
OPENFILENAME ofn = { 0 };
@@ -683,11 +683,11 @@ INT_PTR avSetMyAvatar(char* protocol, TCHAR* tszPath) ofn.lpstrDefExt = L"";
ofn.hInstance = g_hInst;
- TCHAR title[256];
+ wchar_t title[256];
if (protocol == NULL)
mir_sntprintf(title, TranslateT("Set my avatar"));
else {
- TCHAR* prototmp = mir_a2t(protocol);
+ wchar_t* prototmp = mir_a2t(protocol);
mir_sntprintf(title, TranslateT("Set my avatar for %s"), prototmp);
mir_free(prototmp);
}
@@ -698,7 +698,7 @@ INT_PTR avSetMyAvatar(char* protocol, TCHAR* tszPath) szFinalName = FileName;
}
- else szFinalName = (TCHAR*)tszPath;
+ else szFinalName = (wchar_t*)tszPath;
// filename is now set, check it and perform all needed action
if (szFinalName[0] == '\0')
@@ -714,7 +714,7 @@ static INT_PTR SetMyAvatar(WPARAM wParam, LPARAM lParam) static INT_PTR SetMyAvatarW(WPARAM wParam, LPARAM lParam)
{
- return avSetMyAvatar((char*)wParam, (TCHAR*)lParam);
+ return avSetMyAvatar((char*)wParam, (wchar_t*)lParam);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/AVS/src/stdafx.h b/plugins/AVS/src/stdafx.h index adf9f0db73..0a5beda25a 100644 --- a/plugins/AVS/src/stdafx.h +++ b/plugins/AVS/src/stdafx.h @@ -85,7 +85,7 @@ struct protoPicCacheEntry : public avatarCacheEntry, public MZeroedObject void clear();
char* szProtoname;
- TCHAR* tszAccName;
+ wchar_t* tszAccName;
};
extern OBJLIST<protoPicCacheEntry> g_ProtoPictures, g_MyAvatars;
@@ -109,7 +109,7 @@ extern FI_INTERFACE *fei; void mir_sleep(int time);
extern bool g_shutDown;
-extern TCHAR g_szDataPath[]; // user datae path (read at startup only)
+extern wchar_t g_szDataPath[]; // user datae path (read at startup only)
extern BOOL g_AvatarHistoryAvail;
extern HWND hwndSetMyAvatar;
@@ -120,11 +120,11 @@ extern HANDLE hGlobalAvatarFolder; extern HANDLE hLoaderEvent, hShutdownEvent;
extern HANDLE hEventChanged, hEventContactAvatarChanged, hMyAvatarChanged;
-int GetFileHash(TCHAR* filename);
-DWORD GetFileSize(TCHAR *szFilename);
+int GetFileHash(wchar_t* filename);
+DWORD GetFileSize(wchar_t *szFilename);
void MakePathRelative(MCONTACT hContact);
-void MakePathRelative(MCONTACT hContact, TCHAR *dest);
-void MyPathToAbsolute(const TCHAR *ptszPath, TCHAR *ptszDest);
+void MakePathRelative(MCONTACT hContact, wchar_t *dest);
+void MyPathToAbsolute(const wchar_t *ptszPath, wchar_t *ptszDest);
HBITMAP LoadPNG(struct avatarCacheEntry *ace, char *szFilename);
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index 4e7603c396..c46fff6a58 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -28,7 +28,7 @@ void mir_sleep(int time) /////////////////////////////////////////////////////////////////////////////////////////
// substitutes variables and passes our own data path as base
-void MyPathToAbsolute(const TCHAR *ptszPath, TCHAR *ptszDest)
+void MyPathToAbsolute(const wchar_t *ptszPath, wchar_t *ptszDest)
{
PathToAbsoluteT(VARST(ptszPath), ptszDest, g_szDataPath);
}
@@ -37,9 +37,9 @@ void MyPathToAbsolute(const TCHAR *ptszPath, TCHAR *ptszDest) // convert the avatar image path to a relative one...
// given: contact handle, path to image
-void MakePathRelative(MCONTACT hContact, TCHAR *path)
+void MakePathRelative(MCONTACT hContact, wchar_t *path)
{
- TCHAR szFinalPath[MAX_PATH];
+ wchar_t szFinalPath[MAX_PATH];
szFinalPath[0] = '\0';
size_t result = PathToRelativeT(path, szFinalPath, g_szDataPath);
@@ -68,7 +68,7 @@ void MakePathRelative(MCONTACT hContact) int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto)
{
ptrT tszValue;
- TCHAR tszFilename[MAX_PATH]; tszFilename[0] = 0;
+ wchar_t tszFilename[MAX_PATH]; tszFilename[0] = 0;
ace->hbmPic = 0;
ace->dwFlags = 0;
@@ -139,8 +139,8 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) if (mir_tstrlen(tszFilename) < 4)
return -1;
- _tcsncpy_s(tszFilename, VARST(tszFilename), _TRUNCATE);
- if (_taccess(tszFilename, 4) == -1)
+ wcsncpy_s(tszFilename, VARST(tszFilename), _TRUNCATE);
+ if (_waccess(tszFilename, 4) == -1)
return -2;
BOOL isTransparentImage = 0;
@@ -149,7 +149,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) ace->bmHeight = 0;
ace->bmWidth = 0;
ace->lpDIBSection = NULL;
- _tcsncpy(ace->szFilename, tszFilename, MAX_PATH);
+ wcsncpy(ace->szFilename, tszFilename, MAX_PATH);
ace->szFilename[MAX_PATH - 1] = 0;
if (ace->hbmPic == 0)
return -1;
@@ -230,7 +230,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) #define TOPBIT (1 << (WIDTH - 1)) /* MSB */
#define WIDTH 32
-int GetFileHash(TCHAR* filename)
+int GetFileHash(wchar_t* filename)
{
HANDLE hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
if (hFile == INVALID_HANDLE_VALUE)
@@ -435,7 +435,7 @@ void DeleteGlobalUserAvatar() if (db_get_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv))
return;
- TCHAR szFilename[MAX_PATH];
+ wchar_t szFilename[MAX_PATH];
MyPathToAbsolute(dbv.ptszVal, szFilename);
db_free(&dbv);
@@ -457,8 +457,8 @@ void SetIgnoreNotify(char *protocol, BOOL ignore) ///////////////////////////////////////////////////////////////////////////////////////////////////////
-DWORD GetFileSize(TCHAR *szFilename)
+DWORD GetFileSize(wchar_t *szFilename)
{
struct _stat info;
- return (_tstat(szFilename, &info) == -1) ? 0 : info.st_size;
+ return (_wstat(szFilename, &info) == -1) ? 0 : info.st_size;
}
diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp index 85a990612d..424976f0b0 100644 --- a/plugins/AddContactPlus/src/addcontact.cpp +++ b/plugins/AddContactPlus/src/addcontact.cpp @@ -61,7 +61,7 @@ void AddContactDlgOpts(HWND hdlg, const char* szProto, BOOL bAuthOptsOnly = FALS char* szUniqueId = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDTEXT, 0);
if (szUniqueId) {
size_t cbLen = mir_strlen(szUniqueId) + 2;
- TCHAR* pszUniqueId = (TCHAR*)mir_alloc(cbLen * sizeof(TCHAR));
+ wchar_t* pszUniqueId = (wchar_t*)mir_alloc(cbLen * sizeof(wchar_t));
mir_sntprintf(pszUniqueId, cbLen, L"%S:", szUniqueId);
SetDlgItemText(hdlg, IDC_IDLABEL, pszUniqueId);
mir_free(pszUniqueId);
@@ -169,7 +169,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) HookEventMessage(ME_SKIN2_ICONSCHANGED, hdlg, DM_ADDCONTACT_CHANGEICONS);
HookEventMessage(ME_PROTO_ACCLISTCHANGED, hdlg, DM_ADDCONTACT_CHANGEACCLIST);
{
- TCHAR *szGroup;
+ wchar_t *szGroup;
for (int i = 1; (szGroup = Clist_GroupGetName(i, NULL)) != NULL; i++) {
int id = SendDlgItemMessage(hdlg, IDC_GROUP, CB_ADDSTRING, 0, (LPARAM)szGroup);
SendDlgItemMessage(hdlg, IDC_GROUP, CB_SETITEMDATA, (WPARAM)id, (LPARAM)i);
@@ -195,7 +195,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) switch (LOWORD(wparam)) {
case IDC_USERID:
if (HIWORD(wparam) == EN_CHANGE) {
- TCHAR szUserId[256];
+ wchar_t szUserId[256];
if (GetDlgItemText(hdlg, IDC_USERID, szUserId, _countof(szUserId))) {
if (!IsWindowEnabled(GetDlgItem(hdlg, IDOK)))
EnableWindow(GetDlgItem(hdlg, IDOK), TRUE);
@@ -233,12 +233,12 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) case IDOK:
{
- TCHAR szUserId[256];
+ wchar_t szUserId[256];
GetDlgItemText(hdlg, IDC_USERID, szUserId, _countof(szUserId));
if (*rtrimt(szUserId) == 0 ||
- (strstr(acs->proto, "GG") && _tcstoul(szUserId, NULL, 10) > INT_MAX) || // Gadu-Gadu protocol
- ((CallProtoService(acs->proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_NUMERICUSERID) && !_tcstoul(szUserId, NULL, 10)))
+ (strstr(acs->proto, "GG") && wcstoul(szUserId, NULL, 10) > INT_MAX) || // Gadu-Gadu protocol
+ ((CallProtoService(acs->proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_NUMERICUSERID) && !wcstoul(szUserId, NULL, 10)))
{
MessageBox(NULL,
TranslateT("The contact cannot be added to your contact list. Please make sure the contact ID is entered correctly."),
@@ -248,7 +248,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) PROTOSEARCHRESULT *psr;
if (strstr(acs->proto, "TLEN")) { // Tlen protocol
- if (_tcschr(szUserId, '@') == NULL) {
+ if (wcschr(szUserId, '@') == NULL) {
MessageBox(NULL,
TranslateT("The contact cannot be added to your contact list. Please make sure the contact ID is entered correctly."),
TranslateT("Add contact"), MB_OK | MB_ICONWARNING | MB_SETFOREGROUND | MB_TOPMOST);
@@ -264,7 +264,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) }
psr->flags = PSR_TCHAR;
- psr->id.t = mir_tstrdup(szUserId);
+ psr->id.w = mir_tstrdup(szUserId);
acs->psr = psr;
MCONTACT hContact = (MCONTACT)CallProtoService(acs->proto, PS_ADDTOLIST, IsDlgButtonChecked(hdlg, IDC_ADDTEMP) ? PALF_TEMPORARY : 0, (LPARAM)acs->psr);
@@ -275,7 +275,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) break;
}
- TCHAR szHandle[256];
+ wchar_t szHandle[256];
if (GetDlgItemText(hdlg, IDC_MYHANDLE, szHandle, _countof(szHandle)))
db_set_ts(hContact, "CList", "MyHandle", szHandle);
@@ -296,7 +296,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) if (flags & PF4_NOCUSTOMAUTH)
ProtoChainSend(hContact, PSS_AUTHREQUEST, 0, 0);
else {
- TCHAR tszReason[512];
+ wchar_t tszReason[512];
GetDlgItemText(hdlg, IDC_AUTHREQ, tszReason, _countof(tszReason));
ProtoChainSend(hContact, PSS_AUTHREQUEST, 0, (LPARAM)tszReason);
}
@@ -339,10 +339,10 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) if (acs) {
db_set_s(NULL, "AddContact", "LastProto", acs->proto);
if (acs->psr) {
- mir_free(acs->psr->nick.t);
- mir_free(acs->psr->firstName.t);
- mir_free(acs->psr->lastName.t);
- mir_free(acs->psr->email.t);
+ mir_free(acs->psr->nick.w);
+ mir_free(acs->psr->firstName.w);
+ mir_free(acs->psr->lastName.w);
+ mir_free(acs->psr->email.w);
mir_free(acs->psr);
}
delete acs;
diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp index fe3cb37dbe..2e9191ba85 100644 --- a/plugins/AddContactPlus/src/main.cpp +++ b/plugins/AddContactPlus/src/main.cpp @@ -97,7 +97,7 @@ static int OnAccListChanged(WPARAM, LPARAM) mi.position = 500020001;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = icon.hIcolib;
- mi.name.t = LPGENT("&Add contact...");
+ mi.name.w = LPGENW("&Add contact...");
mi.pszService = MS_ADDCONTACTPLUS_SHOW;
hMainMenuItem = Menu_AddMainMenuItem(&mi);
}
@@ -129,8 +129,8 @@ static int OnModulesLoaded(WPARAM, LPARAM) HOTKEYDESC hkd = { sizeof(hkd) };
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "AddContactPlus_OpenDialog";
- hkd.ptszDescription = LPGENT("Open add contact dialog");
- hkd.ptszSection = LPGENT("Main");
+ hkd.ptszDescription = LPGENW("Open add contact dialog");
+ hkd.ptszSection = LPGENW("Main");
hkd.pszService = MS_ADDCONTACTPLUS_SHOW;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, 'C') | HKF_MIRANDA_LOCAL;
Hotkey_Register(&hkd);
diff --git a/plugins/Alarms/src/alarm_win.cpp b/plugins/Alarms/src/alarm_win.cpp index d211b0c43b..f39333767d 100644 --- a/plugins/Alarms/src/alarm_win.cpp +++ b/plugins/Alarms/src/alarm_win.cpp @@ -266,16 +266,16 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar #define AddItem(x) \
mii.wID++; \
- mii.dwTypeData = TranslateT(x); \
+ mii.dwTypeData = TranslateW(x); \
mii.cch = ( UINT )mir_tstrlen(mii.dwTypeData); \
InsertMenuItem(hMenu, mii.wID, FALSE, &mii);
- AddItem(LPGEN("5 mins"));
- AddItem(LPGEN("15 mins"));
- AddItem(LPGEN("30 mins"));
- AddItem(LPGEN("1 hour"));
- AddItem(LPGEN("1 day"));
- AddItem(LPGEN("1 week"));
+ AddItem(LPGENW("5 mins"));
+ AddItem(LPGENW("15 mins"));
+ AddItem(LPGENW("30 mins"));
+ AddItem(LPGENW("1 hour"));
+ AddItem(LPGENW("1 day"));
+ AddItem(LPGENW("1 week"));
TPMPARAMS tpmp = { 0 };
tpmp.cbSize = sizeof(tpmp);
@@ -350,31 +350,31 @@ int ReloadFonts(WPARAM, LPARAM) int AlarmWinModulesLoaded(WPARAM, LPARAM)
{
title_font_id.cbSize = sizeof(FontIDT);
- mir_tstrcpy(title_font_id.group, LPGENT("Alarms"));
- mir_tstrcpy(title_font_id.name, LPGENT("Title"));
+ mir_tstrcpy(title_font_id.group, LPGENW("Alarms"));
+ mir_tstrcpy(title_font_id.name, LPGENW("Title"));
mir_strcpy(title_font_id.dbSettingsGroup, MODULE);
mir_strcpy(title_font_id.prefix, "FontTitle");
- mir_tstrcpy(title_font_id.backgroundGroup, LPGENT("Alarms"));
- mir_tstrcpy(title_font_id.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(title_font_id.backgroundGroup, LPGENW("Alarms"));
+ mir_tstrcpy(title_font_id.backgroundName, LPGENW("Background"));
title_font_id.flags = 0;
title_font_id.order = 0;
FontRegisterT(&title_font_id);
window_font_id.cbSize = sizeof(FontIDT);
- mir_tstrcpy(window_font_id.group, LPGENT("Alarms"));
- mir_tstrcpy(window_font_id.name, LPGENT("Window"));
+ mir_tstrcpy(window_font_id.group, LPGENW("Alarms"));
+ mir_tstrcpy(window_font_id.name, LPGENW("Window"));
mir_strcpy(window_font_id.dbSettingsGroup, MODULE);
mir_strcpy(window_font_id.prefix, "FontWindow");
- mir_tstrcpy(window_font_id.backgroundGroup, LPGENT("Alarms"));
- mir_tstrcpy(window_font_id.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(window_font_id.backgroundGroup, LPGENW("Alarms"));
+ mir_tstrcpy(window_font_id.backgroundName, LPGENW("Background"));
window_font_id.flags = 0;
window_font_id.order = 1;
FontRegisterT(&window_font_id);
bk_colour_id.cbSize = sizeof(ColourIDT);
mir_strcpy(bk_colour_id.dbSettingsGroup, MODULE);
- mir_tstrcpy(bk_colour_id.group, LPGENT("Alarms"));
- mir_tstrcpy(bk_colour_id.name, LPGENT("Background"));
+ mir_tstrcpy(bk_colour_id.group, LPGENW("Alarms"));
+ mir_tstrcpy(bk_colour_id.name, LPGENW("Background"));
mir_strcpy(bk_colour_id.setting, "BkColour");
bk_colour_id.defcolour = GetSysColor(COLOR_3DFACE);
bk_colour_id.flags = 0;
diff --git a/plugins/Alarms/src/alarms.cpp b/plugins/Alarms/src/alarms.cpp index facf4c926a..e5b80405c2 100644 --- a/plugins/Alarms/src/alarms.cpp +++ b/plugins/Alarms/src/alarms.cpp @@ -17,7 +17,7 @@ There is no warranty. #define WMP_PAUSE 32808
#define WMP_NEXT 0x497B
-TCHAR szGamePrefix[] = COMMANDPREFIX;
+wchar_t szGamePrefix[] = COMMANDPREFIX;
CLIST_INTERFACE *pcli;
HINSTANCE hInst;
@@ -65,10 +65,10 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA return DefWindowProc(hWnd, message, wParam, lParam);
}
-void ShowPopup(MCONTACT hContact, const TCHAR *msg)
+void ShowPopup(MCONTACT hContact, const wchar_t *msg)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- TCHAR *lpzContactName = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *lpzContactName = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact; //Be sure to use a GOOD handle, since this will not be checked.
diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp index 941f69cb2c..a010c5b19d 100644 --- a/plugins/Alarms/src/frame.cpp +++ b/plugins/Alarms/src/frame.cpp @@ -138,7 +138,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar GetTextExtentPoint32(dis->hDC,alarm.szTitle,(int)mir_tstrlen(alarm.szTitle),&textSize);
- TCHAR buff[100];
+ wchar_t buff[100];
if (min >= 60)
mir_sntprintf(buff, TranslateT("%dh %dm"), min / 60, min % 60);
else
@@ -148,12 +148,12 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (textSize.cx > (dis->rcItem.right - dis->rcItem.left) - (GetSystemMetrics(SM_CXSMICON) + 4) - timeSize.cx - 2 - 4) {
// need elipsis
- TCHAR titlebuff[512];
+ wchar_t titlebuff[512];
size_t len = mir_tstrlen(alarm.szTitle);
if (len > 511) len = 511;
while(len > 0 && textSize.cx > (dis->rcItem.right - dis->rcItem.left) - (GetSystemMetrics(SM_CXSMICON) + 4) - timeSize.cx - 2 - 4) {
len--;
- _tcsncpy(titlebuff, alarm.szTitle, len);
+ wcsncpy(titlebuff, alarm.szTitle, len);
titlebuff[len] = 0;
mir_tstrcat(titlebuff, L"...");
GetTextExtentPoint32(dis->hDC,titlebuff,(int)mir_tstrlen(titlebuff),&textSize);
@@ -453,7 +453,7 @@ void FixMainMenu() Menu_EnableItem(hMenuShowReminders, false);
else
Menu_ModifyItem(hMenuShowReminders,
- ReminderFrameVisible() ? LPGENT("Hide reminders") : LPGENT("Show reminders"), INVALID_HANDLE_VALUE, 0);
+ ReminderFrameVisible() ? LPGENW("Hide reminders") : LPGENW("Show reminders"), INVALID_HANDLE_VALUE, 0);
}
}
@@ -542,7 +542,7 @@ int CreateFrame() CreateServiceFunction(MODULE "/ShowHideReminders", ShowHideMenuFunc);
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Alarms"), 0);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Alarms"), 0);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "8A3C1906-4809-4EE8-A32A-858003A2AAA7");
SET_UID(mi, 0x27556ea9, 0xfa19, 0x4c2e, 0xb0, 0xc9, 0x48, 0x2, 0x5c, 0x17, 0xba, 0x5);
diff --git a/plugins/Alarms/src/options.cpp b/plugins/Alarms/src/options.cpp index 847f377ec5..d92f7a6685 100644 --- a/plugins/Alarms/src/options.cpp +++ b/plugins/Alarms/src/options.cpp @@ -26,7 +26,7 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
ALARM *add_edit_alarm = (ALARM *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
SYSTEMTIME temp_time;
- TCHAR buff[MAX_PATH];
+ wchar_t buff[MAX_PATH];
BOOL bChecked;
switch (msg) {
@@ -43,7 +43,7 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_DAY, CB_SETCURSEL, 0, 0);
for (int i = 1; i <= 31; i++)
- SendDlgItemMessage(hwndDlg, IDC_DAYNUM, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)_itot(i, buff, 10));
+ SendDlgItemMessage(hwndDlg, IDC_DAYNUM, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)_itow(i, buff, 10));
SendDlgItemMessage(hwndDlg, IDC_DAYNUM, CB_SETCURSEL, 0, 0);
@@ -576,7 +576,7 @@ void AddMenuItem() CMenuItem mi;
if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Alarms"), mi.position);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Alarms"), mi.position);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "24F03563-01BE-4118-8297-E94375A783E7");
}
diff --git a/plugins/Alarms/src/stdafx.h b/plugins/Alarms/src/stdafx.h index ade5b17c78..c9d5be5729 100644 --- a/plugins/Alarms/src/stdafx.h +++ b/plugins/Alarms/src/stdafx.h @@ -35,14 +35,14 @@ extern HANDLE hTopToolbarButton; typedef struct ALARM_tag {
unsigned short id;
- TCHAR *szTitle;
- TCHAR *szDesc;
+ wchar_t *szTitle;
+ wchar_t *szDesc;
Occurrence occurrence;
BOOL snoozer;
SYSTEMTIME time;
unsigned short action;
- TCHAR *szCommand;
- TCHAR *szCommandParams;
+ wchar_t *szCommand;
+ wchar_t *szCommandParams;
BYTE sound_num;
int flags;
} ALARM;
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index 59d85c22be..7713166680 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -32,14 +32,14 @@ static HANDLE hServiceAddFile, hServiceRemoveFile, hServiceAddUrl, hServiceRemov typedef struct
{
char *pszClassName; // class name as used in registry and db
- TCHAR *pszDescription;
+ wchar_t *pszDescription;
HINSTANCE hInstance; // allowed to be NULL for miranda32.exe
WORD nIconResID;
char *pszService;
WORD flags; // set of FTDF_* and UTDF_* flags
char *pszFileExt; // file type: NULL for url type
char *pszMimeType; // file type: allowed to be NULL
- TCHAR *pszVerbDesc; // file type: allowed to be NULL
+ wchar_t *pszVerbDesc; // file type: allowed to be NULL
} ASSOCDATA;
static ASSOCDATA *pAssocList; // protected by csAssocList
@@ -58,7 +58,7 @@ static BOOL IsAssocEnabled(const ASSOCDATA *assoc) static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled)
{
char szSetting[MAXMODULELABELLENGTH];
- TCHAR szDLL[MAX_PATH], szBuf[MAX_PATH];
+ wchar_t szDLL[MAX_PATH], szBuf[MAX_PATH];
mir_snprintf(szSetting, "enabled_%s", assoc->pszClassName);
db_set_b(NULL, "AssocMgr", szSetting, (BYTE)fEnabled);
// dll name for uninstall
@@ -87,7 +87,7 @@ void CleanupAssocEnabledSettings(void) DBVARIANT dbv;
int i;
HANDLE hFile;
- TCHAR szDLL[MAX_PATH];
+ wchar_t szDLL[MAX_PATH];
char szSetting[MAXMODULELABELLENGTH];
// delete old enabled_* settings if associated plugin no longer present
@@ -264,9 +264,9 @@ static int ReplaceImageListAssocIcon(HIMAGELIST himl, const ASSOCDATA *assoc, in // the return value does not need to be freed
// this function assumes it has got the csAssocList mutex
-static TCHAR* GetAssocTypeDesc(const ASSOCDATA *assoc)
+static wchar_t* GetAssocTypeDesc(const ASSOCDATA *assoc)
{
- static TCHAR szDesc[32];
+ static wchar_t szDesc[32];
if (assoc->pszFileExt == NULL)
mir_sntprintf(szDesc, L"%hs:", assoc->pszClassName);
else
@@ -283,7 +283,7 @@ static BOOL IsAssocRegistered(const ASSOCDATA *assoc) fUseMainCmdLine = (assoc->pszService == NULL);
// class
- TCHAR *pszRunCmd = MakeRunCommand(fUseMainCmdLine, !fUseMainCmdLine);
+ wchar_t *pszRunCmd = MakeRunCommand(fUseMainCmdLine, !fUseMainCmdLine);
if (pszRunCmd != NULL)
fSuccess = IsRegClass(assoc->pszClassName, pszRunCmd);
mir_free(pszRunCmd); // does NULL check
@@ -299,7 +299,7 @@ static BOOL IsAssocRegistered(const ASSOCDATA *assoc) static BOOL EnsureAssocRegistered(const ASSOCDATA *assoc)
{
BOOL fSuccess = FALSE, fIsUrl, fUseMainCmdLine;
- TCHAR *pszIconLoc, *pszRunCmd, *pszDdeCmd, *pszAppFileName;
+ wchar_t *pszIconLoc, *pszRunCmd, *pszDdeCmd, *pszAppFileName;
fIsUrl = (assoc->pszFileExt == NULL);
fUseMainCmdLine = (assoc->pszService == NULL);
@@ -344,13 +344,13 @@ static BOOL EnsureAssocRegistered(const ASSOCDATA *assoc) static BOOL UnregisterAssoc(const ASSOCDATA *assoc)
{
BOOL fIsUrl, fUseMainCmdLine;
- TCHAR *pszAppFileName;
+ wchar_t *pszAppFileName;
fIsUrl = (assoc->pszFileExt == NULL);
fUseMainCmdLine = (assoc->pszService == NULL);
// class might have been registered by another instance
- TCHAR *pszRunCmd = MakeRunCommand(fUseMainCmdLine, !fUseMainCmdLine);
+ wchar_t *pszRunCmd = MakeRunCommand(fUseMainCmdLine, !fUseMainCmdLine);
if (pszRunCmd != NULL && !IsRegClass(assoc->pszClassName, pszRunCmd)) {
mir_free(pszRunCmd);
return TRUE; // succeed anyway
@@ -393,7 +393,7 @@ typedef struct // ownership of pszClassName, pszFileExt, pszVerbDesc and pszMimeType is transfered
// to the storage list on success
-static BOOL AddNewAssocItem_Worker(char *pszClassName, const TYPEDESCHEAD *tdh, char *pszFileExt, TCHAR *pszVerbDesc, char *pszMimeType)
+static BOOL AddNewAssocItem_Worker(char *pszClassName, const TYPEDESCHEAD *tdh, char *pszFileExt, wchar_t *pszVerbDesc, char *pszMimeType)
{
ASSOCDATA *pAssocListBuf, *assoc;
@@ -486,7 +486,7 @@ static INT_PTR ServiceAddNewFileType(WPARAM, LPARAM lParam) char *pszFileExt = mir_strdup(ftd->pszFileExt);
char *pszClassName = MakeFileClassName(ftd->pszFileExt);
if (pszFileExt != NULL && pszClassName != NULL) {
- TCHAR *pszVerbDesc = s2t(ftd->ptszVerbDesc, ftd->flags&FTDF_UNICODE, TRUE); // does NULL check
+ wchar_t *pszVerbDesc = s2t(ftd->ptszVerbDesc, ftd->flags&FTDF_UNICODE, TRUE); // does NULL check
char *pszMimeType = mir_strdup(ftd->pszMimeType); // does NULL check
if (AddNewAssocItem_Worker(pszClassName, (TYPEDESCHEAD*)ftd, pszFileExt, pszVerbDesc, pszMimeType))
// no need to free pszClassName, pszFileExt, pszVerbDesc and pszMimeType,
@@ -546,7 +546,7 @@ static INT_PTR ServiceRemoveUrlType(WPARAM, LPARAM lParam) /************************* Open Handler ***************************/
-static BOOL InvokeHandler_Worker(const char *pszClassName, const TCHAR *pszParam, INT_PTR *res)
+static BOOL InvokeHandler_Worker(const char *pszClassName, const wchar_t *pszParam, INT_PTR *res)
{
void *pvParam;
char *pszService;
@@ -578,13 +578,13 @@ static BOOL InvokeHandler_Worker(const char *pszClassName, const TCHAR *pszParam return TRUE;
}
-INT_PTR InvokeFileHandler(const TCHAR *pszFileName)
+INT_PTR InvokeFileHandler(const wchar_t *pszFileName)
{
char *pszClassName, *pszFileExt;
INT_PTR res = CALLSERVICE_NOTFOUND;
// find extension
- TCHAR *p = (TCHAR*)_tcsrchr(pszFileName, _T('.'));
+ wchar_t *p = (wchar_t*)wcsrchr(pszFileName, '.');
if (p != NULL) {
pszFileExt = t2a(p);
if (pszFileExt != NULL) {
@@ -603,7 +603,7 @@ INT_PTR InvokeFileHandler(const TCHAR *pszFileName) return res;
}
-INT_PTR InvokeUrlHandler(const TCHAR *pszUrl)
+INT_PTR InvokeUrlHandler(const wchar_t *pszUrl)
{
char *pszClassName, *pszProtoPrefix, *p;
INT_PTR res = CALLSERVICE_NOTFOUND;
@@ -611,7 +611,7 @@ INT_PTR InvokeUrlHandler(const TCHAR *pszUrl) // find prefix
pszProtoPrefix = t2a(pszUrl);
if (pszProtoPrefix != NULL) {
- p = strchr(pszProtoPrefix, _T(':'));
+ p = strchr(pszProtoPrefix, ':');
if (p != NULL) {
*(++p) = 0; // remove trailing :
// class name
@@ -743,7 +743,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara CheckDlgButton(hwndDlg, IDC_ONLYWHILERUNNING, (BOOL)db_get_b(NULL, "AssocMgr", "OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
// autostart
- TCHAR *pszRunCmd = MakeRunCommand(TRUE, TRUE);
+ wchar_t *pszRunCmd = MakeRunCommand(TRUE, TRUE);
if (pszRunCmd != NULL) {
CheckDlgButton(hwndDlg, IDC_AUTOSTART, IsRegRunEntry(L"MirandaNG", pszRunCmd) ? BST_CHECKED : BST_UNCHECKED);
mir_free(pszRunCmd);
@@ -892,7 +892,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara PostMessage(hwndDlg, M_REFRESH_ICONS, 0, 0);
// autostart
- TCHAR *pszRunCmd = MakeRunCommand(TRUE, TRUE);
+ wchar_t *pszRunCmd = MakeRunCommand(TRUE, TRUE);
fRegFailed = FALSE;
if (pszRunCmd != NULL) {
fEnabled = IsDlgButtonChecked(hwndDlg, IDC_AUTOSTART);
@@ -953,7 +953,7 @@ void InitAssocList(void) // register open-with app
{
- TCHAR *pszAppFileName, *pszIconLoc, *pszRunCmd;
+ wchar_t *pszAppFileName, *pszIconLoc, *pszRunCmd;
pszIconLoc = MakeIconLocation(NULL, 0);
// miranda32.exe
@@ -1025,7 +1025,7 @@ void UninitAssocList(void) // unregister open-with app
if (fOnlyWhileRunning) {
- TCHAR *pszAppFileName;
+ wchar_t *pszAppFileName;
// miranda32.exe
pszAppFileName = MakeAppFileName(TRUE);
if (pszAppFileName != NULL)
diff --git a/plugins/AssocMgr/src/assoclist.h b/plugins/AssocMgr/src/assoclist.h index 5e8806b828..fafbbdf097 100644 --- a/plugins/AssocMgr/src/assoclist.h +++ b/plugins/AssocMgr/src/assoclist.h @@ -26,8 +26,8 @@ void CleanupMimeTypeAddedSettings(void); /* Assoc List Utils */
BOOL IsRegisteredAssocItem(const char *pszClassName);
/* Open Handler */
-INT_PTR InvokeFileHandler(const TCHAR *pszFileName);
-INT_PTR InvokeUrlHandler(const TCHAR *pszUrl);
+INT_PTR InvokeFileHandler(const wchar_t *pszFileName);
+INT_PTR InvokeUrlHandler(const wchar_t *pszUrl);
/* Misc */
void InitAssocList(void);
void UninitAssocList(void);
diff --git a/plugins/AssocMgr/src/dde.cpp b/plugins/AssocMgr/src/dde.cpp index 35fd6a9e28..aca64350e7 100644 --- a/plugins/AssocMgr/src/dde.cpp +++ b/plugins/AssocMgr/src/dde.cpp @@ -32,7 +32,7 @@ static HANDLE hHookModulesLoaded, hHookPreShutdown; // pszFilePath needs to be allocated using mir_alloc()
static void __stdcall FileActionAsync(void *param)
{
- TCHAR *pszFilePath = (TCHAR*)param;
+ wchar_t *pszFilePath = (wchar_t*)param;
/* invoke main handler */
switch (InvokeFileHandler(pszFilePath)) { /* pszFilePath is always a long path name */
case 0: /* success */ break;
@@ -48,7 +48,7 @@ static void __stdcall FileActionAsync(void *param) // pszUrl needs to be allocated using mir_alloc()
static void __stdcall UrlActionAsync(void *param)
{
- TCHAR *pszUrl = (TCHAR*)param;
+ wchar_t *pszUrl = (wchar_t*)param;
/* invoke main handler */
switch (InvokeUrlHandler(pszUrl)) {
case 0: /* success */ break;
@@ -68,16 +68,16 @@ static void __stdcall UrlActionAsync(void *param) // returned pointer points into a substring of ppszString
// returns an empty string if the string does not have enough arguments
-static TCHAR* GetExecuteParam(TCHAR **ppszString)
+static wchar_t* GetExecuteParam(wchar_t **ppszString)
{
- bool fQuoted = (**ppszString == _T('"'));
- TCHAR *pszParam = *ppszString;
+ bool fQuoted = (**ppszString == '"');
+ wchar_t *pszParam = *ppszString;
if (fQuoted)
pszParam++;
- TCHAR *p = _tcschr(pszParam, (TCHAR)(fQuoted ? _T('"') : _T(',')));
+ wchar_t *p = wcschr(pszParam, (wchar_t)(fQuoted ? '"' : ','));
if (p != NULL) {
*(p++) = 0;
- if (fQuoted && *p == _T(',')) p++;
+ if (fQuoted && *p == ',') p++;
}
else p = &pszParam[mir_tstrlen(pszParam)];
*ppszString = p;
@@ -108,10 +108,10 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd, UINT msg, WPARAM wParam, LPA if (UnpackDDElParam(msg, lParam, NULL, (PUINT_PTR)&hCommand)) {
/* ANSI execute command can't happen for shell */
if (IsWindowUnicode((HWND)wParam)) {
- TCHAR *pszCommand = (TCHAR*)GlobalLock(hCommand);
+ wchar_t *pszCommand = (wchar_t*)GlobalLock(hCommand);
if (pszCommand != NULL) {
- TCHAR *pszAction = GetExecuteParam(&pszCommand);
- TCHAR *pszArg = GetExecuteParam(&pszCommand);
+ wchar_t *pszAction = GetExecuteParam(&pszCommand);
+ wchar_t *pszArg = GetExecuteParam(&pszCommand);
if (pszArg != NULL) {
/* we are inside miranda here, we make it async so the shell does
* not timeout regardless what the plugins try to do. */
@@ -161,14 +161,14 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd, UINT msg, WPARAM wParam, LPA }
// CloseHandle() the return value
-static HANDLE StartupMainProcess(TCHAR *pszDatabasePath)
+static HANDLE StartupMainProcess(wchar_t *pszDatabasePath)
{
- TCHAR *p, szPath[MAX_PATH];
+ wchar_t *p, szPath[MAX_PATH];
/* we are inside RunDll32 here */
if (!GetModuleFileName(hInst, szPath, _countof(szPath))) return NULL;
- p = _tcsrchr(szPath, _T('\\'));
- if (p != NULL) { *p = 0; p = _tcsrchr(szPath, _T('\\')); }
+ p = wcsrchr(szPath, '\\');
+ if (p != NULL) { *p = 0; p = wcsrchr(szPath, '\\'); }
if (p == NULL) return NULL;
mir_tstrcpy(++p, L"miranda32.exe");
@@ -187,7 +187,7 @@ extern "C" { #endif
// entry point for RunDll32, this is also WaitForDDEW
- __declspec(dllexport) void CALLBACK WaitForDDE(HWND, HINSTANCE, TCHAR *pszCmdLine, int)
+ __declspec(dllexport) void CALLBACK WaitForDDE(HWND, HINSTANCE, wchar_t *pszCmdLine, int)
{
HANDLE pHandles[2];
DWORD dwTick;
diff --git a/plugins/AssocMgr/src/main.cpp b/plugins/AssocMgr/src/main.cpp index 516a933cec..4f0c116c36 100644 --- a/plugins/AssocMgr/src/main.cpp +++ b/plugins/AssocMgr/src/main.cpp @@ -45,13 +45,13 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) return TRUE;
}
-static void InstallFile(const TCHAR *pszFileName,const TCHAR *pszDestSubDir)
+static void InstallFile(const wchar_t *pszFileName,const wchar_t *pszDestSubDir)
{
- TCHAR szFileFrom[MAX_PATH+1],szFileTo[MAX_PATH+1];
+ wchar_t szFileFrom[MAX_PATH+1],szFileTo[MAX_PATH+1];
if (!GetModuleFileName(hInst, szFileFrom, _countof(szFileFrom) - (int)mir_tstrlen(pszFileName)))
return;
- TCHAR *p = _tcsrchr(szFileFrom,_T('\\'));
+ wchar_t *p = wcsrchr(szFileFrom,'\\');
if (p != NULL)
*(++p) = 0;
mir_tstrcat(szFileFrom,pszFileName); /* buffer safe */
@@ -63,7 +63,7 @@ static void InstallFile(const TCHAR *pszFileName,const TCHAR *pszDestSubDir) if (!GetModuleFileName(NULL, szFileTo, _countof(szFileTo)-(int)mir_tstrlen(pszDestSubDir)-(int)mir_tstrlen(pszFileName)))
return;
- p = _tcsrchr(szFileTo,_T('\\'));
+ p = wcsrchr(szFileTo,'\\');
if (p)
*(++p)=0;
mir_tstrcat(szFileTo,pszDestSubDir); /* buffer safe */
diff --git a/plugins/AssocMgr/src/reg.cpp b/plugins/AssocMgr/src/reg.cpp index 6822fdbddc..3f079b7810 100644 --- a/plugins/AssocMgr/src/reg.cpp +++ b/plugins/AssocMgr/src/reg.cpp @@ -29,7 +29,7 @@ extern HINSTANCE hInst; static __inline LONG regchk(LONG res, const char *pszFunc, const void *pszInfo, BOOL fInfoUnicode, const char *pszFile, unsigned int nLine)
{
if (res != ERROR_SUCCESS && res != ERROR_FILE_NOT_FOUND && res != ERROR_NO_MORE_ITEMS) {
- TCHAR szMsg[1024], *pszInfo2;
+ wchar_t szMsg[1024], *pszInfo2;
char *pszErr;
pszErr = GetWinErrorDescription(res);
pszInfo2 = s2t(pszInfo, fInfoUnicode, FALSE); /* does NULL check */
@@ -123,13 +123,13 @@ static BOOL IsFileClassName(char *pszClassName, char **ppszFileExt) }
// mir_free() the return value
-TCHAR *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile)
+wchar_t *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile)
{
- TCHAR szDbFile[MAX_PATH], szExe[MAX_PATH], *pszFmt;
+ wchar_t szDbFile[MAX_PATH], szExe[MAX_PATH], *pszFmt;
if (fFixedDbProfile) {
if ( CallService(MS_DB_GETPROFILENAMET, _countof(szDbFile), (LPARAM)szDbFile))
return NULL;
- TCHAR *p = _tcsrchr(szDbFile, '.');
+ wchar_t *p = wcsrchr(szDbFile, '.');
if (p)
*p = 0;
}
@@ -148,31 +148,31 @@ TCHAR *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile) GetShortPathName(szExe, szExe, _countof(szExe));
/* surround by quotes if failed */
size_t len = mir_tstrlen(szExe);
- if ( _tcschr(szExe,_T(' ')) != NULL && (len+2) < _countof(szExe)) {
- memmove(szExe, szExe+1, (len+1)*sizeof(TCHAR));
- szExe[len+2] = szExe[0] = _T('\"');
+ if ( wcschr(szExe,' ') != NULL && (len+2) < _countof(szExe)) {
+ memmove(szExe, szExe+1, (len+1)*sizeof(wchar_t));
+ szExe[len+2] = szExe[0] = '\"';
szExe[len+3] = 0;
}
}
- TCHAR tszBuffer[1024];
+ wchar_t tszBuffer[1024];
mir_sntprintf(tszBuffer, pszFmt, szExe, szDbFile);
return mir_tstrdup(tszBuffer);
}
-static BOOL IsValidRunCommand(const TCHAR *pszRunCmd)
+static BOOL IsValidRunCommand(const wchar_t *pszRunCmd)
{
- TCHAR *buf,*pexe,*pargs;
- TCHAR szFullExe[MAX_PATH],*pszFilePart;
- buf=mir_tstrcpy((TCHAR*)_alloca((mir_tstrlen(pszRunCmd)+1)*sizeof(TCHAR)),pszRunCmd);
+ wchar_t *buf,*pexe,*pargs;
+ wchar_t szFullExe[MAX_PATH],*pszFilePart;
+ buf=mir_tstrcpy((wchar_t*)_alloca((mir_tstrlen(pszRunCmd)+1)*sizeof(wchar_t)),pszRunCmd);
/* split into executable path and arguments */
- if (buf[0]==_T('\"')) {
- pargs=_tcschr(&buf[1],_T('\"'));
+ if (buf[0]=='\"') {
+ pargs=wcschr(&buf[1],'\"');
if (pargs!=NULL) *(pargs++)=0;
pexe=&buf[1];
- if (*pargs==_T(' ')) ++pargs;
+ if (*pargs==' ') ++pargs;
} else {
- pargs=_tcschr(buf,_T(' '));
+ pargs=wcschr(buf,' ');
if (pargs!=NULL) *pargs=0;
pexe=buf;
}
@@ -180,12 +180,12 @@ static BOOL IsValidRunCommand(const TCHAR *pszRunCmd) if (pszFilePart!=NULL)
if (!mir_tstrcmpi(pszFilePart,L"rundll32.exe") || !mir_tstrcmpi(pszFilePart,L"rundll.exe")) {
/* split into dll path and arguments */
- if (pargs[0]==_T('\"')) {
+ if (pargs[0]=='\"') {
++pargs;
- pexe=_tcschr(&pargs[1],_T('\"'));
+ pexe=wcschr(&pargs[1],'\"');
if (pexe!=NULL) *pexe=0;
} else {
- pexe=_tcschr(pargs,_T(','));
+ pexe=wcschr(pargs,',');
if (pexe!=NULL) *pexe=0;
}
return SearchPath(NULL,pargs,L".dll",0,NULL,NULL)!=0;
@@ -196,12 +196,12 @@ static BOOL IsValidRunCommand(const TCHAR *pszRunCmd) }
// mir_free() the return value
-TCHAR *MakeIconLocation(HMODULE hModule,WORD nIconResID)
+wchar_t *MakeIconLocation(HMODULE hModule,WORD nIconResID)
{
- TCHAR szModule[MAX_PATH],*pszIconLoc=NULL;
+ wchar_t szModule[MAX_PATH],*pszIconLoc=NULL;
int cch;
if ((cch=GetModuleFileName(hModule,szModule,_countof(szModule))) != 0) {
- pszIconLoc=(TCHAR*)mir_alloc((cch+=8)*sizeof(TCHAR));
+ pszIconLoc=(wchar_t*)mir_alloc((cch+=8)*sizeof(wchar_t));
if (pszIconLoc!=NULL)
mir_sntprintf(pszIconLoc, cch, L"%s,%i", szModule, -(int)nIconResID); /* id may be 0, buffer safe */
}
@@ -209,11 +209,11 @@ TCHAR *MakeIconLocation(HMODULE hModule,WORD nIconResID) }
// mir_free() the return value
-TCHAR *MakeAppFileName(BOOL fMirExe)
+wchar_t *MakeAppFileName(BOOL fMirExe)
{
- TCHAR szExe[MAX_PATH],*psz;
+ wchar_t szExe[MAX_PATH],*psz;
if (GetModuleFileName(fMirExe?NULL:hInst,szExe,_countof(szExe))) {
- psz=_tcsrchr(szExe,_T('\\'));
+ psz=wcsrchr(szExe,'\\');
if (psz!=NULL) ++psz;
else psz=szExe;
return mir_tstrdup(psz);
@@ -223,15 +223,15 @@ TCHAR *MakeAppFileName(BOOL fMirExe) /************************* Helpers ********************************/
-static LONG DeleteRegSubTree(HKEY hKey,const TCHAR *pszSubKey)
+static LONG DeleteRegSubTree(HKEY hKey,const wchar_t *pszSubKey)
{
LONG res;
DWORD nMaxSubKeyLen,cchSubKey;
- TCHAR *pszSubKeyBuf;
+ wchar_t *pszSubKeyBuf;
HKEY hSubKey;
if ((res=RegOpenKeyEx(hKey,pszSubKey,0,KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS|DELETE,&hSubKey))==ERROR_SUCCESS) {
if ((res=RegQueryInfoKey(hSubKey,NULL,NULL,NULL,NULL,&nMaxSubKeyLen,NULL,NULL,NULL,NULL,NULL,NULL))==ERROR_SUCCESS) {
- pszSubKeyBuf=(TCHAR*)mir_alloc((nMaxSubKeyLen+1)*sizeof(TCHAR));
+ pszSubKeyBuf=(wchar_t*)mir_alloc((nMaxSubKeyLen+1)*sizeof(wchar_t));
if (pszSubKeyBuf==NULL) res=ERROR_NOT_ENOUGH_MEMORY;
while(!res) {
cchSubKey=nMaxSubKeyLen+1;
@@ -248,42 +248,42 @@ static LONG DeleteRegSubTree(HKEY hKey,const TCHAR *pszSubKey) }
// hMainKey must have been opened with KEY_CREATE_SUB_KEY access right
-static LONG SetRegSubKeyStrDefValue(HKEY hMainKey,const TCHAR *pszSubKey,const TCHAR *pszVal)
+static LONG SetRegSubKeyStrDefValue(HKEY hMainKey,const wchar_t *pszSubKey,const wchar_t *pszVal)
{
HKEY hSubKey;
LONG res=RegCreateKeyEx(hMainKey,pszSubKey,0,NULL,0,KEY_SET_VALUE|KEY_QUERY_VALUE,NULL,&hSubKey,NULL);
if (!res) {
- res=RegSetValueEx(hSubKey,NULL,0,REG_SZ,(BYTE*)pszVal,(int)(mir_tstrlen(pszVal)+1)*sizeof(TCHAR));
+ res=RegSetValueEx(hSubKey,NULL,0,REG_SZ,(BYTE*)pszVal,(int)(mir_tstrlen(pszVal)+1)*sizeof(wchar_t));
RegCloseKey(hSubKey);
}
return res;
}
// hKey must have been opened with KEY_SET_VALUE access right
-static void SetRegStrPrefixValue(HKEY hKey,const TCHAR *pszValPrefix,const TCHAR *pszVal)
+static void SetRegStrPrefixValue(HKEY hKey,const wchar_t *pszValPrefix,const wchar_t *pszVal)
{
- size_t dwSize = (mir_tstrlen(pszVal)+mir_tstrlen(pszValPrefix)+1)*sizeof(TCHAR);
- TCHAR *pszStr = (TCHAR*)_alloca(dwSize);
+ size_t dwSize = (mir_tstrlen(pszVal)+mir_tstrlen(pszValPrefix)+1)*sizeof(wchar_t);
+ wchar_t *pszStr = (wchar_t*)_alloca(dwSize);
mir_tstrcat(mir_tstrcpy(pszStr, pszValPrefix), pszVal); /* buffer safe */
RegSetValueEx(hKey, NULL, 0, REG_SZ, (BYTE*)pszStr, (int)dwSize);
}
// hKey must have been opened with KEY_QUERY_VALUE access right
// mir_free() the return value
-static TCHAR *GetRegStrValue(HKEY hKey,const TCHAR *pszValName)
+static wchar_t *GetRegStrValue(HKEY hKey,const wchar_t *pszValName)
{
- TCHAR *pszVal,*pszVal2;
+ wchar_t *pszVal,*pszVal2;
DWORD dwSize,dwType;
/* get size */
- if (!RegQueryValueEx(hKey,pszValName,NULL,NULL,NULL,&dwSize) && dwSize>sizeof(TCHAR)) {
- pszVal=(TCHAR*)mir_alloc(dwSize+sizeof(TCHAR));
+ if (!RegQueryValueEx(hKey,pszValName,NULL,NULL,NULL,&dwSize) && dwSize>sizeof(wchar_t)) {
+ pszVal=(wchar_t*)mir_alloc(dwSize+sizeof(wchar_t));
if (pszVal!=NULL) {
/* get value */
if (!RegQueryValueEx(hKey,pszValName,NULL,&dwType,(BYTE*)pszVal,&dwSize)) {
- pszVal[dwSize/sizeof(TCHAR)]=0;
+ pszVal[dwSize/sizeof(wchar_t)]=0;
if (dwType==REG_EXPAND_SZ) {
dwSize=MAX_PATH;
- pszVal2=(TCHAR*)mir_alloc(dwSize*sizeof(TCHAR));
+ pszVal2=(wchar_t*)mir_alloc(dwSize*sizeof(wchar_t));
if (ExpandEnvironmentStrings(pszVal,pszVal2,dwSize)) {
mir_free(pszVal);
return pszVal2;
@@ -299,10 +299,10 @@ static TCHAR *GetRegStrValue(HKEY hKey,const TCHAR *pszValName) }
// hKey must have been opened with KEY_QUERY_VALUE access right
-static BOOL IsRegStrValue(HKEY hKey,const TCHAR *pszValName,const TCHAR *pszCmpVal)
+static BOOL IsRegStrValue(HKEY hKey,const wchar_t *pszValName,const wchar_t *pszCmpVal)
{
BOOL fSame=FALSE;
- TCHAR *pszVal=GetRegStrValue(hKey,pszValName);
+ wchar_t *pszVal=GetRegStrValue(hKey,pszValName);
if (pszVal!=NULL) {
fSame=!mir_tstrcmp(pszVal,pszCmpVal);
mir_free(pszVal);
@@ -311,11 +311,11 @@ static BOOL IsRegStrValue(HKEY hKey,const TCHAR *pszValName,const TCHAR *pszCmpV }
// hKey must have been opened with KEY_QUERY_VALUE access right
-static BOOL IsRegStrValueA(HKEY hKey,const TCHAR *pszValName,const char *pszCmpVal)
+static BOOL IsRegStrValueA(HKEY hKey,const wchar_t *pszValName,const char *pszCmpVal)
{
BOOL fSame=FALSE;
char *pszValA;
- TCHAR *pszVal=GetRegStrValue(hKey,pszValName);
+ wchar_t *pszVal=GetRegStrValue(hKey,pszValName);
if (pszVal!=NULL) {
pszValA=t2a(pszVal);
if (pszValA!=NULL)
@@ -373,7 +373,7 @@ static void BackupRegTree_Worker(HKEY hKey,const char *pszSubKey,struct BackupRe DWORD index,cchName,dwType,cbData;
BYTE *pData;
char *pszName;
- register TCHAR *ptszName;
+ register wchar_t *ptszName;
DWORD nDbPrefixLen;
if ((res=RegOpenKeyExA(hKey,pszSubKey,0,KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS,&hKey))==ERROR_SUCCESS) {
if ((res=RegQueryInfoKey(hKey,NULL,NULL,NULL,NULL,&nMaxSubKeyLen,NULL,NULL,&nMaxValNameLen,&nMaxValSize,NULL,NULL))==ERROR_SUCCESS) {
@@ -472,7 +472,7 @@ static LONG RestoreRegTree(HKEY hKey,const char *pszSubKey,const char *pszDbPref /* key hierachy */
pkeys=mir_strcpy((char*)_alloca(mir_strlen(pszSuffix)+1),pszSuffix);
pnext=pkeys;
- while((pnext=strchr(pnext+1,_T('\\')))!=NULL) pslash=pnext;
+ while((pnext=strchr(pnext+1,'\\'))!=NULL) pslash=pnext;
if (pslash!=NULL) {
/* create subkey */
*(pslash++)=0;
@@ -581,7 +581,7 @@ void CleanupRegTreeBackupSettings(void) // pszIconLoc, pszVerbDesc and pszDdeCmd are allowed to be NULL
// call GetLastError() on error to get more error details
-BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const TCHAR *pszIconLoc,const TCHAR *pszAppName,const TCHAR *pszRunCmd,const TCHAR *pszDdeCmd,const TCHAR *pszDdeApp,const TCHAR *pszDdeTopic,const TCHAR *pszVerbDesc,BOOL fBrowserAutoOpen,BOOL fUrlProto,BOOL fIsShortcut)
+BOOL AddRegClass(const char *pszClassName,const wchar_t *pszTypeDescription,const wchar_t *pszIconLoc,const wchar_t *pszAppName,const wchar_t *pszRunCmd,const wchar_t *pszDdeCmd,const wchar_t *pszDdeApp,const wchar_t *pszDdeTopic,const wchar_t *pszVerbDesc,BOOL fBrowserAutoOpen,BOOL fUrlProto,BOOL fIsShortcut)
{
LONG res;
HKEY hRootKey,hClassKey,hShellKey,hVerbKey,hDdeKey;
@@ -601,7 +601,7 @@ BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const if (fUrlProto) BackupRegTree(hRootKey,pszClassName,"bak_");
/* type description */
if (fUrlProto) SetRegStrPrefixValue(hClassKey,L"URL:",pszTypeDescription);
- else RegSetValueEx(hClassKey,NULL,0,REG_SZ,(BYTE*)pszTypeDescription,(int)(mir_tstrlen(pszTypeDescription)+1)*sizeof(TCHAR));
+ else RegSetValueEx(hClassKey,NULL,0,REG_SZ,(BYTE*)pszTypeDescription,(int)(mir_tstrlen(pszTypeDescription)+1)*sizeof(wchar_t));
/* default icon */
if (pszIconLoc!=NULL) SetRegSubKeyStrDefValue(hClassKey,L"DefaultIcon",pszIconLoc);
/* url protocol */
@@ -624,21 +624,21 @@ BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const /* shell */
if ((res=RegCreateKeyEx(hClassKey,L"shell",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hShellKey,NULL))==ERROR_SUCCESS) {
/* default verb (when empty "open" is used) */
- RegSetValueEx(hShellKey,NULL,0,REG_SZ,(BYTE*)L"open",5*sizeof(TCHAR));
+ RegSetValueEx(hShellKey,NULL,0,REG_SZ,(BYTE*)L"open",5*sizeof(wchar_t));
/* verb */
if ((res=RegCreateKeyEx(hShellKey,L"open",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE,NULL,&hVerbKey,NULL))==ERROR_SUCCESS) {
/* verb description */
if (pszVerbDesc==NULL) RegDeleteValue(hVerbKey,NULL);
- else RegSetValueEx(hVerbKey,NULL,0,REG_SZ,(BYTE*)pszVerbDesc,(int)(mir_tstrlen(pszVerbDesc)+1)*sizeof(TCHAR));
+ else RegSetValueEx(hVerbKey,NULL,0,REG_SZ,(BYTE*)pszVerbDesc,(int)(mir_tstrlen(pszVerbDesc)+1)*sizeof(wchar_t));
/* friendly appname (mui string) */
- RegSetValueEx(hVerbKey,L"FriendlyAppName",0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(TCHAR));
+ RegSetValueEx(hVerbKey,L"FriendlyAppName",0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(wchar_t));
/* command */
SetRegSubKeyStrDefValue(hVerbKey,L"command",pszRunCmd);
/* ddeexec */
if (pszDdeCmd!=NULL) {
if (!RegCreateKeyEx(hVerbKey,L"ddeexec",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE,NULL,&hDdeKey,NULL)) {
/* command */
- RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(int)(mir_tstrlen(pszDdeCmd)+1)*sizeof(TCHAR));
+ RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(int)(mir_tstrlen(pszDdeCmd)+1)*sizeof(wchar_t));
/* application */
SetRegSubKeyStrDefValue(hDdeKey,L"application",pszDdeApp);
/* topic */
@@ -679,7 +679,7 @@ BOOL RemoveRegClass(const char *pszClassName) {
LONG res;
HKEY hRootKey,hClassKey,hShellKey,hVerbKey;
- TCHAR *ptszClassName,*ptszPrevRunCmd;
+ wchar_t *ptszClassName,*ptszPrevRunCmd;
/* try to open interactive user's classes key */
if (RegOpenKeyEx(HKEY_CURRENT_USER,L"Software\\Classes",0,DELETE,&hRootKey))
@@ -729,7 +729,7 @@ BOOL RemoveRegClass(const char *pszClassName) * registered and thus be overwritten by multiple applications.
*/
-BOOL IsRegClass(const char *pszClassName,const TCHAR *pszRunCmd)
+BOOL IsRegClass(const char *pszClassName,const wchar_t *pszRunCmd)
{
BOOL fSuccess=FALSE;
HKEY hClassKey,hShellKey,hVerbKey,hCmdKey;
@@ -766,7 +766,7 @@ HICON LoadRegClassSmallIcon(const char *pszClassName) {
HICON hIcon=NULL;
HKEY hClassKey,hIconKey;
- TCHAR *pszIconLoc,*p;
+ wchar_t *pszIconLoc,*p;
/* using the merged view classes key for reading */
/* class */
@@ -776,10 +776,10 @@ HICON LoadRegClassSmallIcon(const char *pszClassName) /* extract icon */
pszIconLoc=GetRegStrValue(hIconKey,NULL);
if (pszIconLoc!=NULL) {
- p=_tcsrchr(pszIconLoc,_T(','));
+ p=wcsrchr(pszIconLoc,',');
if (p!=NULL) {
*(p++)=0;
- ExtractIconEx(pszIconLoc,_ttoi(p),NULL,&hIcon,1);
+ ExtractIconEx(pszIconLoc,_wtoi(p),NULL,&hIcon,1);
}
mir_free(pszIconLoc);
}
@@ -822,7 +822,7 @@ BOOL AddRegFileExt(const char *pszFileExt,const char *pszClassName,const char *p /* remove any no-open flag */
RegDeleteValue(hExtKey,L"NoOpen");
/* open with progids */
- TCHAR *pszPrevClass=GetRegStrValue(hExtKey,NULL);
+ wchar_t *pszPrevClass=GetRegStrValue(hExtKey,NULL);
if (pszPrevClass!=NULL && !IsRegStrValueA(hExtKey,NULL,pszClassName))
if (!RegCreateKeyEx(hExtKey,L"OpenWithProgids",0,NULL,0,KEY_SET_VALUE,NULL,&hOpenWithKey,NULL)) {
/* previous class (backup) */
@@ -835,7 +835,7 @@ BOOL AddRegFileExt(const char *pszFileExt,const char *pszClassName,const char *p /* mime type e.g. "application/x-icq" */
if (pszMimeType!=NULL) RegSetValueExA(hExtKey, "Content Type", 0, REG_SZ, (BYTE*)pszMimeType, (int)mir_strlen(pszMimeType)+1);
/* perceived type e.g. text (WinXP+) */
- if (fIsText) RegSetValueEx(hExtKey,L"PerceivedType",0,REG_SZ,(BYTE*)L"text",5*sizeof(TCHAR));
+ if (fIsText) RegSetValueEx(hExtKey,L"PerceivedType",0,REG_SZ,(BYTE*)L"text",5*sizeof(wchar_t));
RegCloseKey(hExtKey);
}
@@ -848,7 +848,7 @@ void RemoveRegFileExt(const char *pszFileExt,const char *pszClassName) {
HKEY hRootKey,hExtKey,hSubKey;
DWORD nOpenWithCount;
- TCHAR *pszPrevClassName=NULL;
+ wchar_t *pszPrevClassName=NULL;
BOOL fRestored=FALSE;
/* try to open interactive user's classes key */
@@ -980,7 +980,7 @@ void RemoveRegMimeType(const char *pszMimeType,const char *pszFileExt) */
// pszDdeCmd is allowed to be NULL
-void AddRegOpenWith(const TCHAR *pszAppFileName,BOOL fAllowOpenWith,const TCHAR *pszAppName,const TCHAR *pszIconLoc,const TCHAR *pszRunCmd,const TCHAR *pszDdeCmd,const TCHAR *pszDdeApp,const TCHAR *pszDdeTopic)
+void AddRegOpenWith(const wchar_t *pszAppFileName,BOOL fAllowOpenWith,const wchar_t *pszAppName,const wchar_t *pszIconLoc,const wchar_t *pszRunCmd,const wchar_t *pszDdeCmd,const wchar_t *pszDdeApp,const wchar_t *pszDdeTopic)
{
HKEY hRootKey,hAppsKey,hExeKey,hShellKey,hVerbKey,hDdeKey;
@@ -993,7 +993,7 @@ void AddRegOpenWith(const TCHAR *pszAppFileName,BOOL fAllowOpenWith,const TCHAR /* filename */
if (!RegCreateKeyEx(hAppsKey,pszAppFileName,0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hExeKey,NULL)) {
/* appname */
- RegSetValueEx(hExeKey,NULL,0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(TCHAR));
+ RegSetValueEx(hExeKey,NULL,0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(wchar_t));
/* no open-with flag */
if (fAllowOpenWith) RegDeleteValue(hExeKey,L"NoOpenWith");
else RegSetValueEx(hExeKey,L"NoOpenWith",0,REG_SZ,NULL,0);
@@ -1002,18 +1002,18 @@ void AddRegOpenWith(const TCHAR *pszAppFileName,BOOL fAllowOpenWith,const TCHAR /* shell */
if (!RegCreateKeyEx(hExeKey,L"shell",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hShellKey,NULL)) {
/* default verb (when empty "open" is used) */
- RegSetValueEx(hShellKey,NULL,0,REG_SZ,(BYTE*)L"open",5*sizeof(TCHAR));
+ RegSetValueEx(hShellKey,NULL,0,REG_SZ,(BYTE*)L"open",5*sizeof(wchar_t));
/* verb */
if (!RegCreateKeyEx(hShellKey,L"open",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hVerbKey,NULL)) {
/* friendly appname (mui string) */
- RegSetValueEx(hVerbKey,L"FriendlyAppName",0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(TCHAR));
+ RegSetValueEx(hVerbKey,L"FriendlyAppName",0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(wchar_t));
/* command */
SetRegSubKeyStrDefValue(hVerbKey,L"command",pszRunCmd);
/* ddeexec */
if (pszDdeCmd!=NULL)
if (!RegCreateKeyEx(hVerbKey,L"ddeexec",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hDdeKey,NULL)) {
/* command */
- RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(int)(mir_tstrlen(pszDdeCmd)+1)*sizeof(TCHAR));
+ RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(int)(mir_tstrlen(pszDdeCmd)+1)*sizeof(wchar_t));
/* application */
SetRegSubKeyStrDefValue(hDdeKey,L"application",pszDdeApp);
/* topic */
@@ -1033,7 +1033,7 @@ void AddRegOpenWith(const TCHAR *pszAppFileName,BOOL fAllowOpenWith,const TCHAR RegCloseKey(hRootKey);
}
-void RemoveRegOpenWith(const TCHAR *pszAppFileName)
+void RemoveRegOpenWith(const wchar_t *pszAppFileName)
{
HKEY hRootKey,hAppsKey,hExeKey,hShellKey,hVerbKey,hDdeKey;
@@ -1084,7 +1084,7 @@ void RemoveRegOpenWith(const TCHAR *pszAppFileName) * Tell the "Open With..." dialog we support a given file extension.
*/
-void AddRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileExt,const TCHAR *pszFileDesc)
+void AddRegOpenWithExtEntry(const wchar_t *pszAppFileName,const char *pszFileExt,const wchar_t *pszFileDesc)
{
HKEY hRootKey,hAppsKey,hExeKey,hTypesKey;
@@ -1098,10 +1098,10 @@ void AddRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileExt,c if (!RegOpenKeyEx(hAppsKey,pszAppFileName,0,KEY_CREATE_SUB_KEY,&hExeKey)) {
/* supported types */
if (!RegCreateKeyEx(hExeKey,L"SupportedTypes",0,NULL,0,KEY_SET_VALUE,NULL,&hTypesKey,NULL)) {
- TCHAR *ptszFileExt;
+ wchar_t *ptszFileExt;
ptszFileExt=a2t(pszFileExt);
if (ptszFileExt!=NULL)
- RegSetValueEx(hTypesKey,ptszFileExt,0,REG_SZ,(BYTE*)pszFileDesc,(int)(mir_tstrlen(pszFileDesc)+1)*sizeof(TCHAR));
+ RegSetValueEx(hTypesKey,ptszFileExt,0,REG_SZ,(BYTE*)pszFileDesc,(int)(mir_tstrlen(pszFileDesc)+1)*sizeof(wchar_t));
mir_free(ptszFileExt); /* does NULL check */
RegCloseKey(hTypesKey);
}
@@ -1114,7 +1114,7 @@ void AddRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileExt,c RegCloseKey(hRootKey);
}
-void RemoveRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileExt)
+void RemoveRegOpenWithExtEntry(const wchar_t *pszAppFileName,const char *pszFileExt)
{
HKEY hRootKey,hAppsKey,hExeKey,hTypesKey;
@@ -1146,7 +1146,7 @@ void RemoveRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileEx * Add Miranda to the autostart list in the registry.
*/
-BOOL AddRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd)
+BOOL AddRegRunEntry(const wchar_t *pszAppName,const wchar_t *pszRunCmd)
{
BOOL fSuccess=FALSE;
HKEY hRunKey;
@@ -1154,13 +1154,13 @@ BOOL AddRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd) /* run */
if (!RegCreateKeyEx(HKEY_CURRENT_USER,L"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,NULL,0,KEY_SET_VALUE,NULL,&hRunKey,NULL)) {
/* appname */
- fSuccess=!RegSetValueEx(hRunKey,pszAppName,0,REG_SZ,(BYTE*)pszRunCmd,(int)(mir_tstrlen(pszRunCmd)+1)*sizeof(TCHAR));
+ fSuccess=!RegSetValueEx(hRunKey,pszAppName,0,REG_SZ,(BYTE*)pszRunCmd,(int)(mir_tstrlen(pszRunCmd)+1)*sizeof(wchar_t));
RegCloseKey(hRunKey);
}
return fSuccess;
}
-BOOL RemoveRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd)
+BOOL RemoveRegRunEntry(const wchar_t *pszAppName,const wchar_t *pszRunCmd)
{
HKEY hRunKey;
@@ -1179,7 +1179,7 @@ BOOL RemoveRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd) * Check if the autostart item belongs to the current instance of Miranda.
*/
-BOOL IsRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd)
+BOOL IsRegRunEntry(const wchar_t *pszAppName,const wchar_t *pszRunCmd)
{
BOOL fState=FALSE;
HKEY hRunKey;
diff --git a/plugins/AssocMgr/src/reg.h b/plugins/AssocMgr/src/reg.h index f593221b8e..69e3810ecd 100644 --- a/plugins/AssocMgr/src/reg.h +++ b/plugins/AssocMgr/src/reg.h @@ -22,9 +22,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* Backup to DB */
void CleanupRegTreeBackupSettings(void);
/* Class */
-BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const TCHAR *pszIconLoc,const TCHAR *pszAppName,const TCHAR *pszRunCmd,const TCHAR *pszDdeCmd,const TCHAR *pszDdeApp,const TCHAR *pszDdeTopic,const TCHAR *pszVerbDesc,BOOL fBrowserAutoOpen,BOOL fUrlProto,BOOL fIsShortcut);
+BOOL AddRegClass(const char *pszClassName,const wchar_t *pszTypeDescription,const wchar_t *pszIconLoc,const wchar_t *pszAppName,const wchar_t *pszRunCmd,const wchar_t *pszDdeCmd,const wchar_t *pszDdeApp,const wchar_t *pszDdeTopic,const wchar_t *pszVerbDesc,BOOL fBrowserAutoOpen,BOOL fUrlProto,BOOL fIsShortcut);
BOOL RemoveRegClass(const char *pszClassName);
-BOOL IsRegClass(const char *pszClassName,const TCHAR *pszRunCmd);
+BOOL IsRegClass(const char *pszClassName,const wchar_t *pszRunCmd);
HICON LoadRegClassSmallIcon(const char *pszClassName);
/* Extension */
BOOL AddRegFileExt(const char *pszFileExt,const char *pszClassName,const char *pszMimeType,BOOL fIsText);
@@ -34,18 +34,18 @@ BOOL IsRegFileExt(const char *pszFileExt,const char *pszClassName); BOOL AddRegMimeType(const char *pszMimeType,const char *pszFileExt);
void RemoveRegMimeType(const char *pszMimeType,const char *pszFileExt);
/* Open-With App */
-void AddRegOpenWith(const TCHAR *pszAppFileName,BOOL fAllowOpenWith,const TCHAR *pszAppName,const TCHAR *pszIconLoc,const TCHAR *pszRunCmd,const TCHAR *pszDdeCmd,const TCHAR *pszDdeApp,const TCHAR *pszDdeTopic);
-void RemoveRegOpenWith(const TCHAR *pszAppFileName);
-void AddRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileExt,const TCHAR *pszFileDesc);
-void RemoveRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileExt);
+void AddRegOpenWith(const wchar_t *pszAppFileName,BOOL fAllowOpenWith,const wchar_t *pszAppName,const wchar_t *pszIconLoc,const wchar_t *pszRunCmd,const wchar_t *pszDdeCmd,const wchar_t *pszDdeApp,const wchar_t *pszDdeTopic);
+void RemoveRegOpenWith(const wchar_t *pszAppFileName);
+void AddRegOpenWithExtEntry(const wchar_t *pszAppFileName,const char *pszFileExt,const wchar_t *pszFileDesc);
+void RemoveRegOpenWithExtEntry(const wchar_t *pszAppFileName,const char *pszFileExt);
/* Autostart */
-BOOL AddRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd);
-BOOL RemoveRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd);
-BOOL IsRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd);
+BOOL AddRegRunEntry(const wchar_t *pszAppName,const wchar_t *pszRunCmd);
+BOOL RemoveRegRunEntry(const wchar_t *pszAppName,const wchar_t *pszRunCmd);
+BOOL IsRegRunEntry(const wchar_t *pszAppName,const wchar_t *pszRunCmd);
/* Strings */
char *MakeFileClassName(const char *pszFileExt);
char *MakeUrlClassName(const char *pszUrl);
-TCHAR *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile);
-TCHAR *MakeIconLocation(HMODULE hModule,WORD nIconResID);
-TCHAR *MakeAppFileName(BOOL fMirExe);
\ No newline at end of file +wchar_t *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile);
+wchar_t *MakeIconLocation(HMODULE hModule,WORD nIconResID);
+wchar_t *MakeAppFileName(BOOL fMirExe);
diff --git a/plugins/AssocMgr/src/test.cpp b/plugins/AssocMgr/src/test.cpp index 0980a3cd2d..f0d60e6276 100644 --- a/plugins/AssocMgr/src/test.cpp +++ b/plugins/AssocMgr/src/test.cpp @@ -36,7 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern HINSTANCE hInst;
/* a copy of those in m_assocmgr.h, as we did not #include those helpers */
-__inline static int AssocMgr_AddNewFileTypeT(const char *ext, const char *mime, const TCHAR *desc, const TCHAR *verb, HINSTANCE hinst, UINT iconid, const char *service, DWORD flags)
+__inline static int AssocMgr_AddNewFileTypeT(const char *ext, const char *mime, const wchar_t *desc, const wchar_t *verb, HINSTANCE hinst, UINT iconid, const char *service, DWORD flags)
{
FILETYPEDESC ftd;
ftd.cbSize = sizeof(FILETYPEDESC);
@@ -117,7 +117,7 @@ static int ServiceParseAimLink(WPARAM, LPARAM lParam) acs.psr = &psr;
memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
psr.cbSize = sizeof(PROTOSEARCHRESULT);
- psr.nick.t = sn;
+ psr.nick.w = sn;
CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
}
return 0;
@@ -311,7 +311,7 @@ static void MessageIcqUser(ICQFILEINFO *info) static int IcqOpenFile(WPARAM wParam, LPARAM lParam)
{
- TCHAR *pszFile = (TCHAR*)lParam; /* TCHAR is specified on AssocMgr_AddNewFileTypeT() */
+ wchar_t *pszFile = (wchar_t*)lParam; /* wchar_t is specified on AssocMgr_AddNewFileTypeT() */
FILE *fp;
ICQFILEINFO info;
char line[4096], *sep;
@@ -331,7 +331,7 @@ static int IcqOpenFile(WPARAM wParam, LPARAM lParam) LastName=
*/
if (pszFile == NULL) return 1; /* sanity check */
- fp = _tfopen(pszFile, L"rt");
+ fp = _wfopen(pszFile, L"rt");
if (fp == NULL) return 1; /* open failed */
info.type = 0;
while (!feof(fp)) {
@@ -438,7 +438,7 @@ static int ServiceParseYmsgrLink(WPARAM wParam, LPARAM lParam) acs.psr = &psr;
memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
psr.cbSize = sizeof(PROTOSEARCHRESULT);
- psr.nick.t = id;
+ psr.nick.w = id;
CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
}
return 0;
@@ -553,8 +553,8 @@ static int ServiceParseMsnimLink(WPARAM wParam, LPARAM lParam) acs.psr = &psr;
memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
psr.cbSize = sizeof(PROTOSEARCHRESULT);
- psr.nick.t = email;
- psr.email.t = email;
+ psr.nick.w = email;
+ psr.email.w = email;
CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
}
return 0;
@@ -749,7 +749,7 @@ static int ServiceParseXmppURI(WPARAM wParam, LPARAM lParam) acs.psr = &psr;
memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
psr.cbSize = sizeof(PROTOSEARCHRESULT);
- psr.nick.t = jid;
+ psr.nick.w = jid;
CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
}
return 0;
diff --git a/plugins/AssocMgr/src/utils.cpp b/plugins/AssocMgr/src/utils.cpp index 7f8ec8fbf2..494dd298c5 100644 --- a/plugins/AssocMgr/src/utils.cpp +++ b/plugins/AssocMgr/src/utils.cpp @@ -65,7 +65,7 @@ char* u2a(const WCHAR *pszUnicode,BOOL fMirCp) }
// mir_free() the return value
-TCHAR* s2t(const void *pszStr,DWORD fUnicode,BOOL fMirCp)
+wchar_t* s2t(const void *pszStr,DWORD fUnicode,BOOL fMirCp)
{
if(fUnicode) return mir_wstrdup((WCHAR*)pszStr);
@@ -74,7 +74,7 @@ TCHAR* s2t(const void *pszStr,DWORD fUnicode,BOOL fMirCp) }
// mir_free() the return value
-void* t2s(const TCHAR *pszStr,DWORD fUnicode,BOOL fMirCp)
+void* t2s(const wchar_t *pszStr,DWORD fUnicode,BOOL fMirCp)
{
if (!fUnicode) return (void*)u2a(pszStr,fMirCp);
diff --git a/plugins/AssocMgr/src/utils.h b/plugins/AssocMgr/src/utils.h index e795450cc5..3db6bf09e6 100644 --- a/plugins/AssocMgr/src/utils.h +++ b/plugins/AssocMgr/src/utils.h @@ -22,8 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* String Conv */
WCHAR* a2u(const char *pszAnsi,BOOL fMirCp);
char* u2a(const WCHAR *pszUnicode,BOOL fMirCp);
-TCHAR* s2t(const void *pszStr,DWORD fUnicode,BOOL fMirCp);
-void* t2s(const TCHAR *pszStr,DWORD fUnicode,BOOL fMirCp);
+wchar_t* s2t(const void *pszStr,DWORD fUnicode,BOOL fMirCp);
+void* t2s(const wchar_t *pszStr,DWORD fUnicode,BOOL fMirCp);
#define t2a(s) u2a(s,FALSE)
#define a2t(s) a2u(s,FALSE)
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp index 08e9f96cb1..e5eef4db77 100644 --- a/plugins/AuthState/src/main.cpp +++ b/plugins/AuthState/src/main.cpp @@ -143,9 +143,9 @@ int onPrebuildContactMenu(WPARAM hContact, LPARAM) return 0;
if (db_get_b((MCONTACT)hContact, "AuthState", "ShowIcons", 1))
- Menu_ModifyItem(hUserMenu, LPGENT("Disable AuthState icons"));
+ Menu_ModifyItem(hUserMenu, LPGENW("Disable AuthState icons"));
else
- Menu_ModifyItem(hUserMenu, LPGENT("Enable AuthState icons"));
+ Menu_ModifyItem(hUserMenu, LPGENW("Enable AuthState icons"));
Menu_ShowItem(hUserMenu, db_get_b((MCONTACT)hContact, proto, "Auth", 0) || db_get_b((MCONTACT)hContact, proto, "Grant", 0) || !db_get_dw((MCONTACT)hContact, proto, "ServerId", 0));
return 0;
@@ -181,7 +181,7 @@ extern "C" int __declspec(dllexport) Load(void) SET_UID(mi, 0xc5a784ea, 0x8b07, 0x4b95, 0xa2, 0xb2, 0x84, 0x9d, 0x87, 0x43, 0x7e, 0xda);
mi.position = -1999901005;
mi.flags = CMIF_TCHAR;
- mi.name.t = LPGENT("Enable AuthState icons");
+ mi.name.w = LPGENW("Enable AuthState icons");
mi.pszService = "AuthState/MenuItem";
hUserMenu = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/AutoRun/src/main.cpp b/plugins/AutoRun/src/main.cpp index 8d0a3109eb..7781742096 100644 --- a/plugins/AutoRun/src/main.cpp +++ b/plugins/AutoRun/src/main.cpp @@ -24,13 +24,13 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) return TRUE;
}
-void GetProfilePath(TCHAR *res, size_t resLen)
+void GetProfilePath(wchar_t *res, size_t resLen)
{
- TCHAR dbname[MAX_PATH], exename[MAX_PATH];
+ wchar_t dbname[MAX_PATH], exename[MAX_PATH];
CallService(MS_DB_GETPROFILENAMET, _countof(dbname), (LPARAM)dbname);
GetModuleFileName(NULL, exename, _countof(exename));
- TCHAR *p = _tcsrchr(dbname, '.');
+ wchar_t *p = wcsrchr(dbname, '.');
if (p) *p = 0;
mir_sntprintf(res, resLen, L"\"%s\" \"/profile:%s\"", exename, dbname);
@@ -43,9 +43,9 @@ static void SetAutorun(BOOL autorun) switch (autorun) {
case TRUE:
if ( RegCreateKeyEx(ROOT_KEY, SUB_KEY, 0, NULL, 0, KEY_CREATE_SUB_KEY|KEY_SET_VALUE,NULL,&hKey,&dw) == ERROR_SUCCESS) {
- TCHAR result[MAX_PATH];
+ wchar_t result[MAX_PATH];
GetProfilePath(result, _countof(result));
- RegSetValueEx(hKey, L"MirandaNG", 0, REG_SZ, (BYTE*)result, sizeof(TCHAR)*(DWORD)mir_tstrlen(result));
+ RegSetValueEx(hKey, L"MirandaNG", 0, REG_SZ, (BYTE*)result, sizeof(wchar_t)*(DWORD)mir_tstrlen(result));
RegCloseKey(hKey);
}
break;
@@ -64,7 +64,7 @@ static BOOL CmpCurrentAndRegistry() if ( RegOpenKeyEx(ROOT_KEY, SUB_KEY, 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
return FALSE;
- TCHAR result[MAX_PATH], dbpath[MAX_PATH];
+ wchar_t result[MAX_PATH], dbpath[MAX_PATH];
DWORD dwBufLen = MAX_PATH;
if ( RegQueryValueEx(hKey, L"MirandaNG", NULL, NULL, (LPBYTE)dbpath, &dwBufLen) != ERROR_SUCCESS)
return FALSE;
diff --git a/plugins/AutoShutdown/src/cpuusage.cpp b/plugins/AutoShutdown/src/cpuusage.cpp index 7ca145d875..d5cfa13b05 100644 --- a/plugins/AutoShutdown/src/cpuusage.cpp +++ b/plugins/AutoShutdown/src/cpuusage.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define Li2Double(x) ((double)((x).HighPart)*4.294967296E9+(double)((x).LowPart))
-static BOOL WinNT_PerfStatsSwitch(TCHAR *pszServiceName, BOOL fDisable)
+static BOOL WinNT_PerfStatsSwitch(wchar_t *pszServiceName, BOOL fDisable)
{
HKEY hKeyServices, hKeyService, hKeyPerf;
DWORD dwData, dwDataSize;
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index 0f76cb66fa..972102796f 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -327,7 +327,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP dat->flags |= FWPDF_PAUSEDSHOWN;
}
else {
- TCHAR szOutput[256];
+ wchar_t szOutput[256];
if (dat->fTimeFlags&SDWTF_ST_TIME)
GetFormatedDateTime(szOutput, _countof(szOutput), dat->settingLastTime, TRUE);
else GetFormatedCountdown(szOutput, _countof(szOutput), dat->countdown);
@@ -414,7 +414,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP HDC hdc;
SIZE size;
HFONT hFontPrev = NULL;
- TCHAR szOutput[256];
+ wchar_t szOutput[256];
dat->flags &= ~FWPDF_TIMEISCLIPPED;
if (GetWindowText(dat->hwndTime, szOutput, _countof(szOutput)))
if (GetClientRect(dat->hwndTime, &rc)) {
@@ -464,7 +464,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP else if ((HWND)wParam == dat->hwndIcon)
ttdi->lpszText = TranslateT("Automatic shutdown");
else {
- TCHAR szTime[_countof(ttdi->szText)];
+ wchar_t szTime[_countof(ttdi->szText)];
if (dat->fTimeFlags&SDWTF_ST_TIME)
GetFormatedDateTime(szTime, _countof(szTime), dat->settingLastTime, FALSE);
else GetFormatedCountdown(szTime, _countof(szTime), dat->countdown);
@@ -556,9 +556,9 @@ static int FrameModulesLoaded(WPARAM, LPARAM) LOGFONT lf;
/* built-in font module is not available before this hook */
COLORREF clr = GetDefaultColor(FRAMEELEMENT_TEXT);
- FontService_RegisterFont("AutoShutdown", "CountdownFont", LPGENT("Automatic shutdown"), LPGENT("Countdown on frame"), LPGENT("Automatic shutdown"), LPGENT("Background"), 0, FALSE, GetDefaultFont(&lf), clr);
+ FontService_RegisterFont("AutoShutdown", "CountdownFont", LPGENW("Automatic shutdown"), LPGENW("Countdown on frame"), LPGENW("Automatic shutdown"), LPGENW("Background"), 0, FALSE, GetDefaultFont(&lf), clr);
clr = GetDefaultColor(FRAMEELEMENT_BKGRND);
- FontService_RegisterColor("AutoShutdown", "BkgColor", LPGENT("Automatic shutdown"), LPGENT("Background"), clr);
+ FontService_RegisterColor("AutoShutdown", "BkgColor", LPGENW("Automatic shutdown"), LPGENW("Background"), clr);
if (!IsThemeActive()) {
/* progressbar color can only be changed with classic theme */
clr = GetDefaultColor(FRAMEELEMENT_BAR);
diff --git a/plugins/AutoShutdown/src/options.cpp b/plugins/AutoShutdown/src/options.cpp index 9dc562eed4..358f3e04af 100644 --- a/plugins/AutoShutdown/src/options.cpp +++ b/plugins/AutoShutdown/src/options.cpp @@ -110,9 +110,9 @@ static int ShutdownOptInit(WPARAM wParam, LPARAM) odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SHUTDOWN);
odp.position = 900000002;
- odp.ptszGroup = LPGENT("Events"); /* autotranslated */
- odp.ptszTitle = LPGENT("Automatic shutdown"); /* autotranslated */
- odp.ptszTab = LPGENT("Automatic shutdown"); /* autotranslated, can be made a tab */
+ odp.pwszGroup = LPGENW("Events"); /* autotranslated */
+ odp.pwszTitle = LPGENW("Automatic shutdown"); /* autotranslated */
+ odp.pwszTab = LPGENW("Automatic shutdown"); /* autotranslated, can be made a tab */
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = ShutdownOptDlgProc;
Options_AddPage(wParam, &odp);
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index 594c008a54..33a4e647c4 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -30,7 +30,7 @@ static HWND hwndSettingsDlg; extern HINSTANCE hInst;
const DWORD unitValues[] = { 1,60,60 * 60,60 * 60 * 24,60 * 60 * 24 * 7,60 * 60 * 24 * 31 };
-const TCHAR *unitNames[] = { LPGENT("Second(s)"), LPGENT("Minute(s)"), LPGENT("Hour(s)"), LPGENT("Day(s)"), LPGENT("Week(s)"), LPGENT("Month(s)") };
+const wchar_t *unitNames[] = { LPGENW("Second(s)"), LPGENW("Minute(s)"), LPGENW("Hour(s)"), LPGENW("Day(s)"), LPGENW("Week(s)"), LPGENW("Month(s)") };
/************************* Dialog *************************************/
@@ -47,7 +47,7 @@ static BOOL CALLBACK DisplayCpuUsageProc(BYTE nCpuUsage, LPARAM lParam) if (!IsWindow((HWND)lParam))
return FALSE; /* stop poll thread */
- TCHAR str[64];
+ wchar_t str[64];
mir_sntprintf(str, TranslateT("(current: %u%%)"), nCpuUsage);
SetWindowText((HWND)lParam, str);
return TRUE;
@@ -152,7 +152,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L SendMessage(hwndCombo, CB_INITSTORAGE, SDSDT_MAX, SDSDT_MAX * 32);
for (BYTE shutdownType = 1; shutdownType <= SDSDT_MAX; ++shutdownType)
if (ServiceIsTypeEnabled(shutdownType, 0)) {
- TCHAR *pszText = (TCHAR*)ServiceGetTypeDescription(shutdownType, GSTDF_TCHAR); /* never fails */
+ wchar_t *pszText = (wchar_t*)ServiceGetTypeDescription(shutdownType, GSTDF_TCHAR); /* never fails */
int index = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)pszText);
if (index != LB_ERR) {
SendMessage(hwndCombo, CB_SETITEMDATA, index, (LPARAM)shutdownType);
@@ -241,7 +241,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case M_UPDATE_SHUTDOWNDESC: /* lParam=(LPARAM)(HWND)hwndCombo */
{
BYTE shutdownType = (BYTE)SendMessage((HWND)lParam, CB_GETITEMDATA, SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0), 0);
- SetDlgItemText(hwndDlg, IDC_TEXT_SHUTDOWNTYPE, (TCHAR*)ServiceGetTypeDescription(shutdownType, GSTDF_LONGDESC | GSTDF_TCHAR));
+ SetDlgItemText(hwndDlg, IDC_TEXT_SHUTDOWNTYPE, (wchar_t*)ServiceGetTypeDescription(shutdownType, GSTDF_LONGDESC | GSTDF_TCHAR));
}
return TRUE;
@@ -352,7 +352,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L {
HWND hwndEdit = GetDlgItem(hwndDlg, IDC_EDIT_MESSAGE);
int len = GetWindowTextLength(hwndEdit) + 1;
- TCHAR *pszText = (TCHAR*)mir_alloc(len*sizeof(TCHAR));
+ wchar_t *pszText = (wchar_t*)mir_alloc(len*sizeof(wchar_t));
if (pszText != NULL && GetWindowText(hwndEdit, pszText, len + 1)) {
TrimString(pszText);
db_set_ts(NULL, "AutoShutdown", "Message", pszText);
@@ -453,23 +453,23 @@ void SetShutdownMenuItem(bool fActive) mi.position = 2001090000;
if (fActive) {
mi.hIcolibItem = iconList[1].hIcolib;
- mi.name.t = LPGENT("Stop automatic &shutdown");
+ mi.name.w = LPGENW("Stop automatic &shutdown");
}
else {
mi.hIcolibItem = iconList[2].hIcolib;
- mi.name.t = LPGENT("Automatic &shutdown...");
+ mi.name.w = LPGENW("Automatic &shutdown...");
}
mi.pszService = "AutoShutdown/MenuCommand";
mi.flags = CMIF_TCHAR;
if (hMainMenuItem != NULL)
- Menu_ModifyItem(hMainMenuItem, mi.name.t, mi.hIcolibItem);
+ Menu_ModifyItem(hMainMenuItem, mi.name.w, mi.hIcolibItem);
else
hMainMenuItem = Menu_AddMainMenuItem(&mi);
/* tray menu */
mi.position = 899999;
if (hTrayMenuItem != NULL)
- Menu_ModifyItem(hTrayMenuItem, mi.name.t, mi.hIcolibItem);
+ Menu_ModifyItem(hTrayMenuItem, mi.name.w, mi.hIcolibItem);
else
hTrayMenuItem = Menu_AddTrayMenuItem(&mi);
}
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index 7a6dafb468..b77aab3558 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -30,20 +30,20 @@ static HANDLE hEventOkToShutdown,hEventShutdown; /************************* Utils **************************************/
-TCHAR *desc[] =
+wchar_t *desc[] =
{
- LPGENT("Miranda NG is going to be automatically closed in %u second(s)."),
- LPGENT("All Miranda NG protocols are going to be set to offline in %u second(s)."),
- LPGENT("You will be logged off automatically in %u second(s)."),
- LPGENT("The computer will automatically be restarted in %u second(s)."),
- LPGENT("The computer will automatically be set to standby mode in %u second(s)."),
- LPGENT("The computer will automatically be set to hibernate mode in %u second(s)."),
- LPGENT("The workstation will automatically get locked in %u second(s)."),
- LPGENT("All dial-up connections will be closed in %u second(s)."),
- LPGENT("The computer will automatically be shut down in %u second(s).")
+ LPGENW("Miranda NG is going to be automatically closed in %u second(s)."),
+ LPGENW("All Miranda NG protocols are going to be set to offline in %u second(s)."),
+ LPGENW("You will be logged off automatically in %u second(s)."),
+ LPGENW("The computer will automatically be restarted in %u second(s)."),
+ LPGENW("The computer will automatically be set to standby mode in %u second(s)."),
+ LPGENW("The computer will automatically be set to hibernate mode in %u second(s)."),
+ LPGENW("The workstation will automatically get locked in %u second(s)."),
+ LPGENW("All dial-up connections will be closed in %u second(s)."),
+ LPGENW("The computer will automatically be shut down in %u second(s).")
};
-static BOOL WinNT_SetPrivilege(TCHAR *pszPrivName, BOOL bEnable)
+static BOOL WinNT_SetPrivilege(wchar_t *pszPrivName, BOOL bEnable)
{
BOOL bReturn = FALSE;
HANDLE hToken;
@@ -383,7 +383,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case M_UPDATE_COUNTDOWN: /* lParam=(WORD)countdown */
{
- TCHAR szText[256];
+ wchar_t szText[256];
mir_sntprintf(szText, TranslateTS(desc[shutdownType - 1]), lParam);
SetDlgItemText(hwndDlg, IDC_TEXT_HEADER, szText);
/* countdown finished */
@@ -451,24 +451,24 @@ INT_PTR ServiceIsTypeEnabled(WPARAM wParam, LPARAM) return IsShutdownTypeEnabled((BYTE)wParam); /* does shutdownType range check */
}
-const TCHAR *apszShort[] = {
- LPGENT("Close Miranda NG"),LPGENT("Set Miranda NG offline"),LPGENT("Log off user"),
- LPGENT("Restart computer"),LPGENT("Shutdown computer"),LPGENT("Standby mode"),LPGENT("Hibernate mode"),
- LPGENT("Lock workstation"),LPGENT("Hang up dial-up connections"),LPGENT("Close Miranda NG"),
- LPGENT("Set Miranda NG offline"),LPGENT("Log off user"),LPGENT("Restart computer"),LPGENT("Shutdown computer"),
- LPGENT("Standby mode"),LPGENT("Hibernate mode"),LPGENT("Lock workstation"),LPGENT("Hang up dial-up connections")
+const wchar_t *apszShort[] = {
+ LPGENW("Close Miranda NG"),LPGENW("Set Miranda NG offline"),LPGENW("Log off user"),
+ LPGENW("Restart computer"),LPGENW("Shutdown computer"),LPGENW("Standby mode"),LPGENW("Hibernate mode"),
+ LPGENW("Lock workstation"),LPGENW("Hang up dial-up connections"),LPGENW("Close Miranda NG"),
+ LPGENW("Set Miranda NG offline"),LPGENW("Log off user"),LPGENW("Restart computer"),LPGENW("Shutdown computer"),
+ LPGENW("Standby mode"),LPGENW("Hibernate mode"),LPGENW("Lock workstation"),LPGENW("Hang up dial-up connections")
};
-const TCHAR *apszLong[] = {
- LPGENT("Sets all Miranda NG protocols to offline and closes Miranda NG."),
- LPGENT("Sets all Miranda NG protocols to offline."),
- LPGENT("Logs the current Windows user off so that another user can log in."),
- LPGENT("Shuts down Windows and then restarts Windows."),
- LPGENT("Closes all running programs and shuts down Windows to a point at which it is safe to turn off the power."),
- LPGENT("Saves the current Windows session in memory and sets the system to suspend mode."),
- LPGENT("Saves the current Windows session on hard drive, so that the power can be turned off."),
- LPGENT("Locks the computer. To unlock the computer, you must log in."),
- LPGENT("Sets all protocols to offline and closes all RAS connections.")
+const wchar_t *apszLong[] = {
+ LPGENW("Sets all Miranda NG protocols to offline and closes Miranda NG."),
+ LPGENW("Sets all Miranda NG protocols to offline."),
+ LPGENW("Logs the current Windows user off so that another user can log in."),
+ LPGENW("Shuts down Windows and then restarts Windows."),
+ LPGENW("Closes all running programs and shuts down Windows to a point at which it is safe to turn off the power."),
+ LPGENW("Saves the current Windows session in memory and sets the system to suspend mode."),
+ LPGENW("Saves the current Windows session on hard drive, so that the power can be turned off."),
+ LPGENW("Locks the computer. To unlock the computer, you must log in."),
+ LPGENW("Sets all protocols to offline and closes all RAS connections.")
};
INT_PTR ServiceGetTypeDescription(WPARAM wParam, LPARAM lParam)
@@ -476,7 +476,7 @@ INT_PTR ServiceGetTypeDescription(WPARAM wParam, LPARAM lParam) /* shutdownType range check */
if (!wParam || (BYTE)wParam > SDSDT_MAX) return 0;
/* select description */
- TCHAR *pszDesc = (TCHAR*)((lParam&GSTDF_LONGDESC) ? apszLong : apszShort)[wParam - 1];
+ wchar_t *pszDesc = (wchar_t*)((lParam&GSTDF_LONGDESC) ? apszLong : apszShort)[wParam - 1];
if (!(lParam&GSTDF_UNTRANSLATED)) pszDesc = TranslateTS(pszDesc);
/* convert as needed */
if (!(lParam&GSTDF_UNICODE)) {
@@ -496,7 +496,7 @@ void InitShutdownSvc(void) {
/* Shutdown Dialog */
hwndShutdownDlg = NULL;
- SkinAddNewSoundExT("AutoShutdown_Countdown", LPGENT("Alerts"), LPGENT("Automatic shutdown countdown"));
+ SkinAddNewSoundExT("AutoShutdown_Countdown", LPGENW("Alerts"), LPGENW("Automatic shutdown countdown"));
/* Events */
hEventOkToShutdown = CreateHookableEvent(ME_AUTOSHUTDOWN_OKTOSHUTDOWN);
diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp index 4433831a03..ffe41e4a0a 100644 --- a/plugins/AutoShutdown/src/utils.cpp +++ b/plugins/AutoShutdown/src/utils.cpp @@ -47,9 +47,9 @@ char* u2a(const WCHAR *pszUnicode) return psz;
}
-void TrimString(TCHAR *pszStr)
+void TrimString(wchar_t *pszStr)
{
- TCHAR *psz, szChars[] = L" \r\n\t";
+ wchar_t *psz, szChars[] = L" \r\n\t";
for (int i = 0; i < _countof(szChars); ++i) {
/* trim end */
psz = &pszStr[mir_tstrlen(pszStr) - 1];
@@ -60,7 +60,7 @@ void TrimString(TCHAR *pszStr) /* trim beginning */
for (psz = pszStr; (*psz && *psz == szChars[i]); psz = CharNext(psz))
;
- memmove(pszStr, psz, (mir_tstrlen(psz) + 1)*sizeof(TCHAR));
+ memmove(pszStr, psz, (mir_tstrlen(psz) + 1)*sizeof(wchar_t));
}
}
@@ -158,7 +158,7 @@ BOOL TimeStampToSystemTime(time_t timestamp, SYSTEMTIME *st) return TRUE;
}
-BOOL GetFormatedCountdown(TCHAR *pszOut, int nSize, time_t countdown)
+BOOL GetFormatedCountdown(wchar_t *pszOut, int nSize, time_t countdown)
{
static BOOL fInited = FALSE;
static int (WINAPI *pfnGetDurationFormat)(LCID, DWORD, const SYSTEMTIME*, double, WCHAR*, WCHAR*, int);
@@ -183,7 +183,7 @@ BOOL GetFormatedCountdown(TCHAR *pszOut, int nSize, time_t countdown) return StrFromTimeInterval(pszOut, nSize, (countdown > (MAXDWORD / 1000)) ? MAXDWORD : (countdown * 1000), 10) != 0;
}
-BOOL GetFormatedDateTime(TCHAR *pszOut, int nSize, time_t timestamp, BOOL fShowDateEvenToday)
+BOOL GetFormatedDateTime(wchar_t *pszOut, int nSize, time_t timestamp, BOOL fShowDateEvenToday)
{
SYSTEMTIME st, stNow;
LCID locale = Langpack_GetDefaultLocale();
@@ -194,7 +194,7 @@ BOOL GetFormatedDateTime(TCHAR *pszOut, int nSize, time_t timestamp, BOOL fShowD return GetTimeFormat(locale, ((st.wSecond == 0) ? TIME_NOSECONDS : 0) | TIME_FORCE24HOURFORMAT, &st, NULL, pszOut, nSize) != 0;
/* show both date and time */
{
- TCHAR szDate[128], szTime[128];
+ wchar_t szDate[128], szTime[128];
if (!GetTimeFormat(locale, ((st.wSecond == 0) ? TIME_NOSECONDS : 0) | TIME_FORCE24HOURFORMAT, &st, NULL, szTime, _countof(szTime)))
return FALSE;
if (!GetDateFormat(locale, DATE_SHORTDATE, &st, NULL, szDate, _countof(szDate)))
@@ -212,8 +212,8 @@ void AddHotkey() hkd.cbSize = sizeof(hkd);
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "AutoShutdown_Toggle";
- hkd.ptszDescription = LPGENT("Toggle automatic shutdown");
- hkd.ptszSection = LPGENT("Main");
+ hkd.ptszDescription = LPGENW("Toggle automatic shutdown");
+ hkd.ptszSection = LPGENW("Main");
hkd.pszService = "AutoShutdown/MenuCommand";
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, 'T') | HKF_MIRANDA_LOCAL;
hkd.lParam = FALSE;
diff --git a/plugins/AutoShutdown/src/utils.h b/plugins/AutoShutdown/src/utils.h index 02edb32dda..d3ccaabae7 100644 --- a/plugins/AutoShutdown/src/utils.h +++ b/plugins/AutoShutdown/src/utils.h @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* String */
WCHAR *a2u(const char *pszAnsi);
char *u2a(const WCHAR *pszUnicode);
-void TrimString(TCHAR *pszStr);
+void TrimString(wchar_t *pszStr);
/* Error Output */
void ShowInfoMessage(BYTE flags,const char *pszTitle,const char *pszTextFmt,...);
@@ -31,8 +31,8 @@ char* GetWinErrorDescription(DWORD dwLastError); /* Time */
BOOL SystemTimeToTimeStamp(SYSTEMTIME *st,time_t *timestamp);
BOOL TimeStampToSystemTime(time_t timestamp,SYSTEMTIME *st);
-BOOL GetFormatedCountdown(TCHAR *pszOut,int nSize,time_t countdown);
-BOOL GetFormatedDateTime(TCHAR *pszOut,int nSize,time_t timestamp,BOOL fShowDateEvenToday);
+BOOL GetFormatedCountdown(wchar_t *pszOut,int nSize,time_t countdown);
+BOOL GetFormatedDateTime(wchar_t *pszOut,int nSize,time_t timestamp,BOOL fShowDateEvenToday);
/* Skin */
void AddHotkey();
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index efb456a82a..65a69c73f9 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -63,7 +63,7 @@ static void __inline ShutdownAndStopWatcher(void) /************************* Msg Shutdown *******************************/
// ppBlob might get reallocated, must have been allocated using mir_alloc()
-static TCHAR* GetMessageText(BYTE **ppBlob, DWORD *pcbBlob)
+static wchar_t* GetMessageText(BYTE **ppBlob, DWORD *pcbBlob)
{
(*ppBlob)[*pcbBlob] = 0;
size_t cb = mir_strlen((char*)*ppBlob);
@@ -102,8 +102,8 @@ static int MsgEventAdded(WPARAM, LPARAM hDbEvent) DBVARIANT dbv;
if (!db_get_ts(NULL, "AutoShutdown", "Message", &dbv)) {
TrimString(dbv.ptszVal);
- TCHAR *pszMsg = GetMessageText(&dbe.pBlob, &dbe.cbBlob);
- if (pszMsg != NULL && _tcsstr(pszMsg, dbv.ptszVal) != NULL)
+ wchar_t *pszMsg = GetMessageText(&dbe.pBlob, &dbe.cbBlob);
+ if (pszMsg != NULL && wcsstr(pszMsg, dbv.ptszVal) != NULL)
ShutdownAndStopWatcher(); /* msg with specified text recvd */
mir_free(dbv.ptszVal); /* does NULL check */
}
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index 481fea0fac..623d4a8c0e 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -23,7 +23,7 @@ Avatar History Plugin HGENMENU hMenu = NULL;
void __cdecl AvatarDialogThread(void *param);
static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
-int ShowSaveDialog(HWND hwnd, TCHAR* fn,MCONTACT hContact = NULL);
+int ShowSaveDialog(HWND hwnd, wchar_t* fn,MCONTACT hContact = NULL);
bool ProtocolEnabled(const char *proto);
int FillAvatarListFromDB(HWND list, MCONTACT hContact);
@@ -31,15 +31,15 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact); int FillAvatarListFromFiles(HWND list, MCONTACT hContact);
int CleanupAvatarPic(HWND hwnd);
bool UpdateAvatarPic(HWND hwnd);
-TCHAR * GetContactFolder(TCHAR *fn, MCONTACT hContact);
-BOOL ResolveShortcut(TCHAR *shortcut, TCHAR *file);
+wchar_t * GetContactFolder(wchar_t *fn, MCONTACT hContact);
+BOOL ResolveShortcut(wchar_t *shortcut, wchar_t *file);
static INT_PTR ShowDialogSvc(WPARAM wParam, LPARAM lParam);
struct AvatarDialogData
{
MCONTACT hContact;
- TCHAR fn[MAX_PATH];
+ wchar_t fn[MAX_PATH];
HWND parent;
};
@@ -61,8 +61,8 @@ public: }
MEVENT hDbEvent;
- TCHAR *filename;
- TCHAR *filelink;
+ wchar_t *filename;
+ wchar_t *filelink;
};
int OpenAvatarDialog(MCONTACT hContact, char* fn)
@@ -80,7 +80,7 @@ int OpenAvatarDialog(MCONTACT hContact, char* fn) avdlg->hContact = hContact;
if (fn == NULL)
{
- avdlg->fn[0] = _T('\0');
+ avdlg->fn[0] = '\0';
}
else
{
@@ -133,9 +133,9 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l else
FillAvatarListFromFiles(hwndList, data->hContact);
- TCHAR *displayName = pcli->pfnGetContactDisplayName(data->hContact, 0);
+ wchar_t *displayName = pcli->pfnGetContactDisplayName(data->hContact, 0);
if (displayName) {
- TCHAR title[MAX_PATH];
+ wchar_t title[MAX_PATH];
mir_sntprintf(title, TranslateT("Avatar History for %s"), displayName);
SetWindowText(hwnd, title);
}
@@ -317,7 +317,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l case IDC_OPENFOLDER:
if (HIWORD(wParam) == BN_CLICKED && opts.log_per_contact_folders) {
- TCHAR avfolder[MAX_PATH];
+ wchar_t avfolder[MAX_PATH];
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
GetContactFolder(avfolder, hContact);
ShellExecute(NULL, db_get_b(NULL, MODULE_NAME, "OpenFolderMethod", 0) ? L"explore" : L"open", avfolder, NULL, NULL, SW_SHOWNORMAL);
@@ -352,16 +352,16 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l }
-int AddFileToList(TCHAR *path,TCHAR *lnk,TCHAR *filename, HWND list)
+int AddFileToList(wchar_t *path,wchar_t *lnk,wchar_t *filename, HWND list)
{
// Add to list
ListEntry *le = new ListEntry();
le->filename = mir_tstrdup(path);
le->filelink = mir_tstrdup(lnk);
- TCHAR *p = _tcschr(filename, _T('.'));
+ wchar_t *p = wcschr(filename, '.');
if (p != NULL)
- p[0] = _T('\0');
+ p[0] = '\0';
int max_pos = SendMessage(list, LB_ADDSTRING, 0, (LPARAM)filename);
SendMessage(list, LB_SETITEMDATA, max_pos, (LPARAM)le);
return max_pos;
@@ -370,7 +370,7 @@ int AddFileToList(TCHAR *path,TCHAR *lnk,TCHAR *filename, HWND list) int FillAvatarListFromFiles(HWND list, MCONTACT hContact)
{
int max_pos = 0;
- TCHAR dir[MAX_PATH], path[MAX_PATH];
+ wchar_t dir[MAX_PATH], path[MAX_PATH];
WIN32_FIND_DATA finddata;
GetContactFolder(dir, hContact);
@@ -397,7 +397,7 @@ int FillAvatarListFromFiles(HWND list, MCONTACT hContact) int FillAvatarListFromFolder(HWND list, MCONTACT hContact)
{
int max_pos = 0;
- TCHAR dir[MAX_PATH], path[MAX_PATH];
+ wchar_t dir[MAX_PATH], path[MAX_PATH];
WIN32_FIND_DATA finddata;
GetContactFolder(dir, hContact);
@@ -411,7 +411,7 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact) {
if (finddata.cFileName[0] != '.')
{
- TCHAR lnk[MAX_PATH];
+ wchar_t lnk[MAX_PATH];
mir_sntprintf(lnk, L"%s\\%s", dir, finddata.cFileName);
if (ResolveShortcut(lnk, path))
max_pos = AddFileToList(path,lnk,finddata.cFileName,list);
@@ -435,11 +435,11 @@ int FillAvatarListFromDB(HWND list, MCONTACT hContact) if (dbei.eventType != EVENTTYPE_AVATAR_CHANGE) continue;
// Get time
- TCHAR date[64];
+ wchar_t date[64];
TimeZone_ToStringT(dbei.timestamp, L"d s", date, _countof(date));
// Get file in disk
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
ptrT tszStoredPath(mir_utf8decodeT((char*)dbei.pBlob));
PathToAbsoluteT(tszStoredPath, path);
@@ -514,7 +514,7 @@ void InitMenuItem() CMenuItem mi;
SET_UID(mi,0x2fb5c7eb, 0xa606, 0x4145, 0x9e, 0x86, 0x73, 0x88, 0x73, 0x1d, 0xe7, 0x5c);
- mi.name.t = LPGENT("View Avatar History");
+ mi.name.w = LPGENW("View Avatar History");
mi.flags = CMIF_TCHAR;
mi.position = 1000090010;
mi.hIcolibItem = createDefaultOverlayedIcon(FALSE);
@@ -530,9 +530,9 @@ static INT_PTR ShowDialogSvc(WPARAM wParam, LPARAM lParam) }
-int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact)
+int ShowSaveDialog(HWND hwnd, wchar_t* fn, MCONTACT hContact)
{
- TCHAR filter[MAX_PATH], file[MAX_PATH];
+ wchar_t filter[MAX_PATH], file[MAX_PATH];
Bitmap_GetFilter(filter, _countof(filter));
OPENFILENAME ofn = { 0 };
@@ -543,11 +543,11 @@ int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact) ofn.lpstrFilter = filter;
ofn.nFilterIndex = 1;
- _tcsncpy_s(file, (_tcsrchr(fn, '\\') + 1), _TRUNCATE);
+ wcsncpy_s(file, (wcsrchr(fn, '\\') + 1), _TRUNCATE);
ofn.lpstrFile = file;
- TCHAR *displayName = pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR title[MAX_PATH];
+ wchar_t *displayName = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t title[MAX_PATH];
if (displayName)
{
mir_sntprintf(title, TranslateT("Save Avatar for %s"), displayName);
@@ -559,7 +559,7 @@ int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact) }
ofn.nMaxFile = MAX_PATH;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_DONTADDTORECENT;
- ofn.lpstrDefExt = _tcsrchr(fn, '.')+1;
+ ofn.lpstrDefExt = wcsrchr(fn, '.')+1;
DBVARIANT dbvInitDir = {0};
if (!db_get_ts(hContact,MODULE_NAME,"SavedAvatarFolder",&dbvInitDir))
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index 3f833d86f0..46547ae455 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -30,16 +30,16 @@ DWORD mirVer; HANDLE hFolder = NULL;
-TCHAR profilePath[MAX_PATH]; // database profile path (read at startup only)
-TCHAR basedir[MAX_PATH];
+wchar_t profilePath[MAX_PATH]; // database profile path (read at startup only)
+wchar_t basedir[MAX_PATH];
int hLangpack = 0;
MWindowList hAvatarWindowsList = NULL;
int OptInit(WPARAM wParam,LPARAM lParam);
-TCHAR* GetHistoryFolder(TCHAR *fn);
-TCHAR* GetProtocolFolder(TCHAR *fn, char *proto);
-TCHAR* GetOldStyleAvatarName(TCHAR *fn, MCONTACT hContact);
+wchar_t* GetHistoryFolder(wchar_t *fn);
+wchar_t* GetProtocolFolder(wchar_t *fn, char *proto);
+wchar_t* GetOldStyleAvatarName(wchar_t *fn, MCONTACT hContact);
void InitMenuItem();
@@ -75,9 +75,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) static INT_PTR GetCachedAvatar(WPARAM wParam, LPARAM lParam)
{
- TCHAR hash[128];
+ wchar_t hash[128];
- _tcsncpy_s(hash, (TCHAR*)lParam, _TRUNCATE);
+ wcsncpy_s(hash, (wchar_t*)lParam, _TRUNCATE);
ConvertToFilename(hash, _countof(hash));
return (INT_PTR)GetCachedAvatar((char*)wParam, hash);
}
@@ -145,7 +145,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) SkinPlaySound("avatar_changed");
db_set_ts(hContact, "AvatarHistory", "AvatarHash", avatar->hash);
- TCHAR history_filename[MAX_PATH] = L"";
+ wchar_t history_filename[MAX_PATH] = L"";
if (ContactEnabled(hContact, "LogToDisk", AVH_DEF_LOGTODISK)) {
if (!opts.log_store_as_hash) {
@@ -158,7 +158,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) MCONTACT hMetaContact = db_mc_getMeta(hContact);
if (hMetaContact && ContactEnabled(hMetaContact, "LogToDisk", AVH_DEF_LOGTOHISTORY)) {
- TCHAR filename[MAX_PATH] = L"";
+ wchar_t filename[MAX_PATH] = L"";
GetOldStyleAvatarName(filename, hMetaContact);
if (CopyImageFile(avatar->filename, filename))
@@ -170,12 +170,12 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) }
else {
// See if we already have the avatar
- TCHAR hash[128];
+ wchar_t hash[128];
- _tcsncpy_s(hash, avatar->hash, _TRUNCATE);
+ wcsncpy_s(hash, avatar->hash, _TRUNCATE);
ConvertToFilename(hash, _countof(hash));
- TCHAR *file = GetCachedAvatar(proto, hash);
+ wchar_t *file = GetCachedAvatar(proto, hash);
if (file != NULL) {
mir_tstrncpy(history_filename, file, _countof(history_filename));
@@ -210,7 +210,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) ShowPopup(hContact, NULL, opts.popup_changed);
if (ContactEnabled(hContact, "LogToHistory", AVH_DEF_LOGTOHISTORY)) {
- TCHAR rel_path[MAX_PATH];
+ wchar_t rel_path[MAX_PATH];
PathToRelativeT(history_filename, rel_path);
T2Utf blob(rel_path);
@@ -346,8 +346,8 @@ extern "C" __declspec(dllexport) int Load(void) if (CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)profilePath) != 0)
mir_tstrcpy(profilePath, L"."); // Failed, use current dir
- SkinAddNewSoundExT("avatar_changed",LPGENT("Avatar History"),LPGENT("Contact changed avatar"));
- SkinAddNewSoundExT("avatar_removed",LPGENT("Avatar History"),LPGENT("Contact removed avatar"));
+ SkinAddNewSoundExT("avatar_changed",LPGENW("Avatar History"),LPGENW("Contact changed avatar"));
+ SkinAddNewSoundExT("avatar_removed",LPGENW("Avatar History"),LPGENW("Contact removed avatar"));
hAvatarWindowsList = WindowList_Create();
diff --git a/plugins/AvatarHistory/src/options.cpp b/plugins/AvatarHistory/src/options.cpp index 5a30baeacf..976c9174cd 100644 --- a/plugins/AvatarHistory/src/options.cpp +++ b/plugins/AvatarHistory/src/options.cpp @@ -148,16 +148,16 @@ int OptInit(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("History"); // group to put your item under
- odp.ptszTitle = LPGENT("Avatar"); // name of the item
+ odp.pwszGroup = LPGENW("History"); // group to put your item under
+ odp.pwszTitle = LPGENW("Avatar"); // name of the item
odp.pfnDlgProc = OptionsDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &odp);
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- odp.ptszGroup = LPGENT("Popups");
- odp.ptszTitle = LPGENT("Avatar Change");
+ odp.pwszGroup = LPGENW("Popups");
+ odp.pwszTitle = LPGENW("Avatar Change");
odp.pfnDlgProc = PopupsDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPS);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
diff --git a/plugins/AvatarHistory/src/popup.cpp b/plugins/AvatarHistory/src/popup.cpp index b0ad399afb..2c7bbeef11 100644 --- a/plugins/AvatarHistory/src/popup.cpp +++ b/plugins/AvatarHistory/src/popup.cpp @@ -55,25 +55,25 @@ void DeInitPopups() // Show an error popup
-void ShowErrPopup(const TCHAR *description, const TCHAR *title)
+void ShowErrPopup(const wchar_t *description, const wchar_t *title)
{
ShowPopupEx(NULL, title == NULL ? _T(MODULE_NAME) L" Error" : title, description,
NULL, POPUP_TYPE_ERROR, NULL);
}
-void ShowTestPopup(MCONTACT hContact,const TCHAR *title, const TCHAR *description, const Options *op)
+void ShowTestPopup(MCONTACT hContact,const wchar_t *title, const wchar_t *description, const Options *op)
{
ShowPopupEx(hContact, title, description, NULL, POPUP_TYPE_TEST, op);
}
-void ShowPopup(MCONTACT hContact, const TCHAR *title, const TCHAR *description)
+void ShowPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *description)
{
ShowPopupEx(hContact, title, description, (void*)hContact, POPUP_TYPE_NORMAL, &opts);
}
-void ShowDebugPopup(MCONTACT hContact, const TCHAR *title, const TCHAR *description)
+void ShowDebugPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *description)
{
if (db_get_b(NULL,MODULE_NAME,"Debug",0))
{
@@ -89,7 +89,7 @@ typedef struct PopupDataType;
// Show an popup
-void ShowPopupEx(MCONTACT hContact, const TCHAR *title, const TCHAR *description,
+void ShowPopupEx(MCONTACT hContact, const wchar_t *title, const wchar_t *description,
void *plugin_data, int type, const Options *op)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT))
@@ -107,7 +107,7 @@ void ShowPopupEx(MCONTACT hContact, const TCHAR *title, const TCHAR *description if (title != NULL)
mir_tstrncpy(ppd.lptzContactName, title, _countof(ppd.lptzContactName));
else if (hContact != NULL)
- mir_tstrncpy(ppd.lptzContactName, (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0),
+ mir_tstrncpy(ppd.lptzContactName, (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0),
_countof(ppd.lptzContactName));
if (description != NULL)
@@ -174,7 +174,7 @@ void ShowPopupEx(MCONTACT hContact, const TCHAR *title, const TCHAR *description }
else
{
- MessageBox(NULL, description, title ? title : (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0),
+ MessageBox(NULL, description, title ? title : (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0),
MB_OK);
}
diff --git a/plugins/AvatarHistory/src/popup.h b/plugins/AvatarHistory/src/popup.h index edc08e5bcb..bc12bfc544 100644 --- a/plugins/AvatarHistory/src/popup.h +++ b/plugins/AvatarHistory/src/popup.h @@ -29,9 +29,9 @@ struct Options { // Popup
BOOL popup_show_changed;
- TCHAR popup_changed[1024];
+ wchar_t popup_changed[1024];
BOOL popup_show_removed;
- TCHAR popup_removed[1024];
+ wchar_t popup_removed[1024];
WORD popup_delay_type;
WORD popup_timeout;
BYTE popup_use_win_colors;
@@ -54,16 +54,16 @@ void DeInitPopups(); #define POPUP_TYPE_ERROR 2
// Show an popup
-void ShowPopup(MCONTACT hContact, const TCHAR *title, const TCHAR *description);
-void ShowDebugPopup(MCONTACT hContact, const TCHAR *title, const TCHAR *description);
+void ShowPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *description);
+void ShowDebugPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *description);
// Show an test
-void ShowTestPopup(MCONTACT hContact,const TCHAR *title, const TCHAR *description, const Options *op);
+void ShowTestPopup(MCONTACT hContact,const wchar_t *title, const wchar_t *description, const Options *op);
// Show an error popup
void ShowErrPopup(const char *description, const char *title = NULL);
-void ShowPopupEx(MCONTACT hContact, const TCHAR *title, const TCHAR *description,
+void ShowPopupEx(MCONTACT hContact, const wchar_t *title, const wchar_t *description,
void *plugin_data, int type, const Options *op);
diff --git a/plugins/AvatarHistory/src/stdafx.h b/plugins/AvatarHistory/src/stdafx.h index 0c1301278b..42752e9625 100644 --- a/plugins/AvatarHistory/src/stdafx.h +++ b/plugins/AvatarHistory/src/stdafx.h @@ -37,7 +37,7 @@ extern DWORD mirVer; extern MWindowList hAvatarWindowsList;
extern Options opts;
extern HANDLE hFolder;
-extern TCHAR basedir[];
+extern wchar_t basedir[];
#define MODULE_NAME "AvatarHistory"
@@ -51,8 +51,8 @@ extern TCHAR basedir[]; #define AVH_DEF_DEFPOPUPS 0
#define AVH_DEF_SHOWMENU 1
-#define DEFAULT_TEMPLATE_REMOVED LPGENT("removed his/her avatar")
-#define DEFAULT_TEMPLATE_CHANGED LPGENT("changed his/her avatar")
+#define DEFAULT_TEMPLATE_REMOVED LPGENW("removed his/her avatar")
+#define DEFAULT_TEMPLATE_CHANGED LPGENW("changed his/her avatar")
void LoadOptions();
@@ -69,14 +69,14 @@ int OpenAvatarDialog(MCONTACT hContact, char* fn); // utils
-TCHAR* GetCachedAvatar(char *proto, TCHAR *hash);
+wchar_t* GetCachedAvatar(char *proto, wchar_t *hash);
bool ProtocolEnabled(const char *proto);
bool ContactEnabled(MCONTACT hContact, char *setting, int def);
-BOOL CopyImageFile(TCHAR *old_file, TCHAR *new_file);
-void ConvertToFilename(TCHAR *str, size_t size);
+BOOL CopyImageFile(wchar_t *old_file, wchar_t *new_file);
+void ConvertToFilename(wchar_t *str, size_t size);
-void CreateOldStyleShortcut(MCONTACT hContact, TCHAR *history_filename);
-BOOL CreateShortcut(TCHAR *file, TCHAR *shortcut);
+void CreateOldStyleShortcut(MCONTACT hContact, wchar_t *history_filename);
+BOOL CreateShortcut(wchar_t *file, wchar_t *shortcut);
#define POPUP_ACTION_DONOTHING 0
#define POPUP_ACTION_CLOSEPOPUP 1
diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp index c062534c32..07ef4f9e97 100644 --- a/plugins/AvatarHistory/src/utils.cpp +++ b/plugins/AvatarHistory/src/utils.cpp @@ -59,7 +59,7 @@ BOOL IsUnicodeAscii(const WCHAR * pBuffer, int nSize) return TRUE;
}
-void ConvertToFilename(TCHAR *str, size_t size)
+void ConvertToFilename(wchar_t *str, size_t size)
{
for(size_t i = 0; i < size && str[i] != '\0'; i++) {
switch(str[i]) {
@@ -77,10 +77,10 @@ void ConvertToFilename(TCHAR *str, size_t size) }
}
-TCHAR* GetExtension(TCHAR *file)
+wchar_t* GetExtension(wchar_t *file)
{
if (file == NULL) return L"";
- TCHAR *ext = _tcsrchr(file, _T('.'));
+ wchar_t *ext = wcsrchr(file, '.');
if (ext != NULL)
ext++;
else
@@ -89,7 +89,7 @@ TCHAR* GetExtension(TCHAR *file) return ext;
}
-TCHAR* GetHistoryFolder(TCHAR *fn)
+wchar_t* GetHistoryFolder(wchar_t *fn)
{
if (fn == NULL) return NULL;
FoldersGetCustomPathT(hFolder, fn, MAX_PATH, basedir);
@@ -97,7 +97,7 @@ TCHAR* GetHistoryFolder(TCHAR *fn) return fn;
}
-TCHAR* GetProtocolFolder(TCHAR *fn, char *proto)
+wchar_t* GetProtocolFolder(wchar_t *fn, char *proto)
{
GetHistoryFolder(fn);
@@ -109,20 +109,20 @@ TCHAR* GetProtocolFolder(TCHAR *fn, char *proto) return fn;
}
-TCHAR* GetContactFolder(TCHAR *fn, MCONTACT hContact)
+wchar_t* GetContactFolder(wchar_t *fn, MCONTACT hContact)
{
char *proto = GetContactProto(hContact);
GetProtocolFolder(fn, proto);
- TCHAR uin[MAX_PATH];
+ wchar_t uin[MAX_PATH];
ptrT id(Contact_GetInfo(CNF_UNIQUEID, hContact, proto));
- _tcsncpy_s(uin, (id == NULL) ? TranslateT("Unknown UIN") : id, _TRUNCATE);
+ wcsncpy_s(uin, (id == NULL) ? TranslateT("Unknown UIN") : id, _TRUNCATE);
ConvertToFilename(uin, MAX_PATH); //added so that weather id's like "yw/CI0000" work
mir_sntprintf(fn, MAX_PATH, L"%s\\%s", fn, uin);
CreateDirectoryTreeT(fn);
#ifdef DBGPOPUPS
- TCHAR log[1024];
+ wchar_t log[1024];
mir_sntprintf(log, L"Path: %s\nProto: %S\nUIN: %s", fn, proto, uin);
ShowPopup(hContact, L"AVH Debug: GetContactFolder", log);
#endif
@@ -130,7 +130,7 @@ TCHAR* GetContactFolder(TCHAR *fn, MCONTACT hContact) return fn;
}
-TCHAR* GetOldStyleAvatarName(TCHAR *fn, MCONTACT hContact)
+wchar_t* GetOldStyleAvatarName(wchar_t *fn, MCONTACT hContact)
{
GetContactFolder(fn, hContact);
@@ -144,9 +144,9 @@ TCHAR* GetOldStyleAvatarName(TCHAR *fn, MCONTACT hContact) return fn;
}
-void CreateOldStyleShortcut(MCONTACT hContact, TCHAR *history_filename)
+void CreateOldStyleShortcut(MCONTACT hContact, wchar_t *history_filename)
{
- TCHAR shortcut[MAX_PATH] = L"";
+ wchar_t shortcut[MAX_PATH] = L"";
GetOldStyleAvatarName(shortcut, hContact);
@@ -163,18 +163,18 @@ void CreateOldStyleShortcut(MCONTACT hContact, TCHAR *history_filename) }
}
-BOOL CopyImageFile(TCHAR *old_file, TCHAR *new_file)
+BOOL CopyImageFile(wchar_t *old_file, wchar_t *new_file)
{
- TCHAR *ext = GetExtension(old_file);
+ wchar_t *ext = GetExtension(old_file);
mir_sntprintf(new_file, MAX_PATH, L"%s.%s", new_file, ext);
return !CopyFile(old_file, new_file, TRUE);
}
-TCHAR * GetCachedAvatar(char *proto, TCHAR *hash)
+wchar_t * GetCachedAvatar(char *proto, wchar_t *hash)
{
- TCHAR *ret = NULL;
- TCHAR file[1024] = L"";
- TCHAR search[1024] = L"";
+ wchar_t *ret = NULL;
+ wchar_t file[1024] = L"";
+ wchar_t search[1024] = L"";
if (opts.log_keep_same_folder)
GetHistoryFolder(file);
else
@@ -207,7 +207,7 @@ TCHAR * GetCachedAvatar(char *proto, TCHAR *hash) return ret;
}
-BOOL CreateShortcut(TCHAR *file, TCHAR *shortcut)
+BOOL CreateShortcut(wchar_t *file, wchar_t *shortcut)
{
IShellLink *psl = NULL;
HRESULT hr = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **) &psl);
@@ -227,7 +227,7 @@ BOOL CreateShortcut(TCHAR *file, TCHAR *shortcut) return SUCCEEDED(hr);
}
-BOOL ResolveShortcut(TCHAR *shortcut, TCHAR *file)
+BOOL ResolveShortcut(wchar_t *shortcut, wchar_t *file)
{
IShellLink* psl = NULL;
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index 442c1cfe36..acef282daf 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -58,7 +58,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) }
#define MAXCHAN 5
-static TCHAR CurrBassPath[MAX_PATH], tmp[MAX_PATH];
+static wchar_t CurrBassPath[MAX_PATH], tmp[MAX_PATH];
static int sndNSnd = 0, sndLimSnd;
static HSTREAM sndSSnd[MAXCHAN] = { 0 };
@@ -76,7 +76,7 @@ HANDLE hBASSFolder = NULL, hPlaySound = NULL; static int OnPlaySnd(WPARAM wParam, LPARAM lParam)
{
- TCHAR* ptszFile = (TCHAR*)lParam;
+ wchar_t* ptszFile = (wchar_t*)lParam;
SYSTEMTIME systime;
BOOL doPlay = TRUE;
@@ -139,7 +139,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara SendDlgItemMessage(hwndDlg, IDC_MAXCHANNEL, CB_RESETCONTENT, 0, 0);
for (int i = 1; i <= MAXCHAN; i++)
- SendDlgItemMessage(hwndDlg, IDC_MAXCHANNEL, CB_ADDSTRING, 0, (LPARAM)_itot(i, tmp, 10));
+ SendDlgItemMessage(hwndDlg, IDC_MAXCHANNEL, CB_ADDSTRING, 0, (LPARAM)_itow(i, tmp, 10));
SendDlgItemMessage(hwndDlg, IDC_MAXCHANNEL, CB_SETCURSEL, sndLimSnd - 1, 0);
@@ -425,7 +425,7 @@ int ReloadColors(WPARAM, LPARAM) ColourIDT colourid = { 0 };
colourid.cbSize = sizeof(colourid);
mir_tstrcpy(colourid.group, _T(ModuleName));
- mir_tstrcpy(colourid.name, LPGENT("Frame background"));
+ mir_tstrcpy(colourid.name, LPGENW("Frame background"));
clBack = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, 0);
if (hBkgBrush)
@@ -486,7 +486,7 @@ void DeleteFrame() CallService(MS_CLIST_FRAMES_REMOVEFRAME, (WPARAM)frame_id, 0);
}
-void LoadBassLibrary(const TCHAR *ptszPath)
+void LoadBassLibrary(const wchar_t *ptszPath)
{
hBass = LoadLibrary(ptszPath);
diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp index 512c21ee8c..91150ad439 100644 --- a/plugins/BasicHistory/src/BasicHistory.cpp +++ b/plugins/BasicHistory/src/BasicHistory.cpp @@ -146,7 +146,7 @@ void InitTaskMenuItems() mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.pszService = MS_HISTORY_EXECUTE_TASK;
mi.root = hTaskMainMenu;
- mi.name.t = (TCHAR*)taskIt->taskName.c_str();
+ mi.name.w = (wchar_t*)taskIt->taskName.c_str();
HGENMENU menu = Menu_AddMainMenuItem(&mi);
Menu_ConfigureItem(menu, MCI_OPT_EXECPARAM, pos++);
taskMenus.push_back(menu);
@@ -205,14 +205,14 @@ int ModulesLoaded(WPARAM, LPARAM) {
InitMenuItems();
- TCHAR ftpExe[MAX_PATH];
+ wchar_t ftpExe[MAX_PATH];
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PROGRAM_FILES, NULL, SHGFP_TYPE_CURRENT, ftpExe))) {
- _tcscat_s(ftpExe, L"\\WinSCP\\WinSCP.exe");
+ wcscat_s(ftpExe, L"\\WinSCP\\WinSCP.exe");
DWORD atr = GetFileAttributes(ftpExe);
if (atr == INVALID_FILE_ATTRIBUTES || atr & FILE_ATTRIBUTE_DIRECTORY) {
#ifdef _WIN64
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PROGRAM_FILESX86, NULL, SHGFP_TYPE_CURRENT, ftpExe))) {
- _tcscat_s(ftpExe, L"\\WinSCP\\WinSCP.exe");
+ wcscat_s(ftpExe, L"\\WinSCP\\WinSCP.exe");
atr = GetFileAttributes(ftpExe);
if (!(atr == INVALID_FILE_ATTRIBUTES || atr & FILE_ATTRIBUTE_DIRECTORY))
Options::instance->ftpExePathDef = ftpExe;
@@ -222,8 +222,8 @@ int ModulesLoaded(WPARAM, LPARAM) else Options::instance->ftpExePathDef = ftpExe;
}
- TCHAR *log = L"%miranda_logpath%\\BasicHistory\\ftplog.txt";
- TCHAR *logAbsolute = Utils_ReplaceVarsT(log);
+ wchar_t *log = L"%miranda_logpath%\\BasicHistory\\ftplog.txt";
+ wchar_t *logAbsolute = Utils_ReplaceVarsT(log);
Options::instance->ftpLogPath = logAbsolute;
mir_free(logAbsolute);
Options::instance->Load();
diff --git a/plugins/BasicHistory/src/BinaryExport.h b/plugins/BasicHistory/src/BinaryExport.h index 94d92c5f1d..917e27787f 100644 --- a/plugins/BasicHistory/src/BinaryExport.h +++ b/plugins/BasicHistory/src/BinaryExport.h @@ -25,7 +25,7 @@ class BinaryExport : public IImport
{
public:
- virtual const TCHAR* GetExt()
+ virtual const wchar_t* GetExt()
{
return L"bin";
}
diff --git a/plugins/BasicHistory/src/DatExport.cpp b/plugins/BasicHistory/src/DatExport.cpp index 336adcd3e7..92975b61ff 100644 --- a/plugins/BasicHistory/src/DatExport.cpp +++ b/plugins/BasicHistory/src/DatExport.cpp @@ -152,7 +152,7 @@ bool DatExport::GetEventList(std::vector<IImport::ExternalMessage>& eventList) DBEVENTINFO info = {0};
info.cbSize = sizeof(DBEVENTINFO);
info.szModule = GetContactProto(hContact);
- TCHAR _str[MAXSELECTSTR + 8]; // for safety reason
+ wchar_t _str[MAXSELECTSTR + 8]; // for safety reason
std::multimap<DWORD, IImport::ExternalMessage> sortedEvents;
while(dataSize > 0) {
messageHeader.cbSize = 0;
diff --git a/plugins/BasicHistory/src/DatExport.h b/plugins/BasicHistory/src/DatExport.h index efe071c0ac..81fbdf61a0 100644 --- a/plugins/BasicHistory/src/DatExport.h +++ b/plugins/BasicHistory/src/DatExport.h @@ -25,7 +25,7 @@ class DatExport : public IImport
{
public:
- virtual const TCHAR* GetExt()
+ virtual const wchar_t* GetExt()
{
return L"dat";
}
diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index c2ced6267e..eab014339e 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -300,7 +300,7 @@ void HistoryEventList::RefreshEventList() }
}
-bool HistoryEventList::SearchInContact(MCONTACT hContact, TCHAR *strFind, ComparatorInterface* compFun)
+bool HistoryEventList::SearchInContact(MCONTACT hContact, wchar_t *strFind, ComparatorInterface* compFun)
{
InitFilters();
@@ -327,7 +327,7 @@ bool HistoryEventList::SearchInContact(MCONTACT hContact, TCHAR *strFind, Compar EventIndex ei;
EventData ed;
- TCHAR str[MAXSELECTSTR + 8]; // for safety reason
+ wchar_t str[MAXSELECTSTR + 8]; // for safety reason
for (std::list<EventTempIndex>::iterator itL = tempList.begin(); itL != tempList.end(); ++itL) {
ei.isExternal = itL->isExternal;
ei.hEvent = itL->hEvent;
@@ -343,27 +343,27 @@ bool HistoryEventList::SearchInContact(MCONTACT hContact, TCHAR *strFind, Compar void HistoryEventList::InitNames()
{
- TCHAR str[200];
+ wchar_t str[200];
if (m_hContact) {
- _tcscpy_s(m_contactName, pcli->pfnGetContactDisplayName(m_hContact, 0));
+ wcscpy_s(m_contactName, pcli->pfnGetContactDisplayName(m_hContact, 0));
mir_sntprintf(str, TranslateT("History for %s"), m_contactName);
}
else {
- _tcscpy_s(m_contactName, TranslateT("System"));
+ wcscpy_s(m_contactName, TranslateT("System"));
mir_sntprintf(str, TranslateT("History"));
}
if (m_isWnd)
SetWindowText(m_hWnd, str);
- _tcscpy_s(m_myName, GetMyName().c_str());
+ wcscpy_s(m_myName, GetMyName().c_str());
}
void HistoryEventList::AddGroup(const EventIndex& ev)
{
EventData data;
GetEventData(ev, data);
- TCHAR eventText[256];
+ wchar_t eventText[256];
int i;
eventText[0] = 0;
TimeZone_PrintTimeStamp(NULL, data.timestamp, L"d t", eventText, 64, 0);
@@ -374,7 +374,7 @@ void HistoryEventList::AddGroup(const EventIndex& ev) else
user = m_contactName;
GetEventMessage(ev, eventText, 256);
- for (i = 0; eventText[i] != 0 && eventText[i] != _T('\r') && eventText[i] != _T('\n'); ++i);
+ for (i = 0; eventText[i] != 0 && eventText[i] != '\r' && eventText[i] != '\n'; ++i);
eventText[i] = 0;
if (i > Options::instance->groupMessageLen) {
eventText[Options::instance->groupMessageLen - 3] = '.';
@@ -446,15 +446,15 @@ std::wstring HistoryEventList::GetContactId() return ::GetContactId(m_hContact);
}
-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_s(buf, cbBuf, msg ? msg : TranslateT("Invalid Message"), _TRUNCATE);
+ wchar_t *msg = DbGetEventTextT(dbei, CP_ACP);
+ wcsncpy_s(buf, cbBuf, msg ? msg : TranslateT("Invalid Message"), _TRUNCATE);
buf[cbBuf - 1] = 0;
mir_free(msg);
}
-void HistoryEventList::GetObjectDescription(DBEVENTINFO *dbei, TCHAR* str, int cbStr)
+void HistoryEventList::GetObjectDescription(DBEVENTINFO *dbei, wchar_t* str, int cbStr)
{
GetMessageDescription(dbei, str, cbStr);
}
@@ -599,7 +599,7 @@ void HistoryEventList::AddImporter(MCONTACT hContact, IImport::ImportType type, {
mir_cslock lck(csEventList);
- TCHAR buf[32];
+ wchar_t buf[32];
mir_sntprintf(buf, L"%016llx", (unsigned long long int)hContact);
ImportDiscData data;
data.file = m_contactFileDir + buf;
@@ -610,7 +610,7 @@ void HistoryEventList::AddImporter(MCONTACT hContact, IImport::ImportType type, void HistoryEventList::Init()
{
- TCHAR temp[MAX_PATH];
+ wchar_t temp[MAX_PATH];
temp[0] = 0;
GetTempPath(MAX_PATH, temp);
m_contactFileDir = temp;
diff --git a/plugins/BasicHistory/src/EventList.h b/plugins/BasicHistory/src/EventList.h index 8f4f65089a..52c70e64c1 100644 --- a/plugins/BasicHistory/src/EventList.h +++ b/plugins/BasicHistory/src/EventList.h @@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. class ComparatorInterface
{
public:
- virtual bool Compare(const bool isMe, const std::wstring& message, TCHAR *strFind) = 0;
+ virtual bool Compare(const bool isMe, const std::wstring& message, wchar_t *strFind) = 0;
};
class HistoryEventList
@@ -84,8 +84,8 @@ private: void ImportMessages(const std::vector<IImport::ExternalMessage>& messages);
protected:
- TCHAR m_contactName[256];
- TCHAR m_myName[256];
+ wchar_t m_contactName[256];
+ wchar_t m_myName[256];
bool m_isWnd;
bool m_isFlat;
int m_deltaTime;
@@ -117,7 +117,7 @@ public: int GetFilterNr();
std::wstring GetFilterName();
void RefreshEventList();
- bool SearchInContact(MCONTACT hContact, TCHAR *strFind, ComparatorInterface* compFun);
+ bool SearchInContact(MCONTACT hContact, wchar_t *strFind, ComparatorInterface* compFun);
std::wstring GetContactName();
std::wstring GetMyName();
std::wstring GetProtocolName();
@@ -129,18 +129,18 @@ public: static int GetContactMessageNumber(MCONTACT hContact);
static bool IsImportedHistory(MCONTACT hContact);
static void DeleteImporter(MCONTACT hContact);
- static void GetObjectDescription( DBEVENTINFO *dbei, TCHAR* str, int cbStr );
+ static void GetObjectDescription( DBEVENTINFO *dbei, wchar_t* str, int cbStr );
bool GetEventData(const EventIndex& ev, EventData& data);
void GetExtEventDBei(const EventIndex& ev);
HICON GetEventCoreIcon(const EventIndex& ev);
- void GetEventMessage(const EventIndex& ev, TCHAR* message) // must be allocated with MAXSELECTSTR len
+ void GetEventMessage(const EventIndex& ev, wchar_t* message) // must be allocated with MAXSELECTSTR len
{
if (!ev.isExternal)
GetObjectDescription(&m_dbei, message, MAXSELECTSTR);
else
- _tcscpy_s(message, MAXSELECTSTR, m_importedMessages[ev.exIdx].message.c_str());
+ wcscpy_s(message, MAXSELECTSTR, m_importedMessages[ev.exIdx].message.c_str());
}
- void GetEventMessage(const EventIndex& ev, TCHAR* message, int strLen)
+ void GetEventMessage(const EventIndex& ev, wchar_t* message, int strLen)
{
if (!ev.isExternal)
GetObjectDescription(&m_dbei, message, strLen);
@@ -149,12 +149,12 @@ public: std::wstring& meg = m_importedMessages[ev.exIdx].message;
if ((int)meg.size() >= strLen)
{
- memcpy_s(message, strLen * sizeof(TCHAR), meg.c_str(), (strLen - 1) * sizeof(TCHAR));
+ memcpy_s(message, strLen * sizeof(wchar_t), meg.c_str(), (strLen - 1) * sizeof(wchar_t));
message[strLen - 1] = 0;
}
else
{
- _tcscpy_s(message, strLen, meg.c_str());
+ wcscpy_s(message, strLen, meg.c_str());
}
}
}
diff --git a/plugins/BasicHistory/src/ExportManager.cpp b/plugins/BasicHistory/src/ExportManager.cpp index d783fde17f..c2168d861c 100644 --- a/plugins/BasicHistory/src/ExportManager.cpp +++ b/plugins/BasicHistory/src/ExportManager.cpp @@ -33,23 +33,23 @@ ExportManager::ExportManager(HWND hwnd, MCONTACT hContact, int filter) : {
}
-std::wstring GetFile(const TCHAR* ext, HWND hwnd, bool open)
+std::wstring GetFile(const wchar_t* ext, HWND hwnd, bool open)
{
- TCHAR filter[512];
+ wchar_t filter[512];
std::locale loc;
- TCHAR extUpper[32];
+ wchar_t extUpper[32];
- _tcscpy_s(extUpper, ext);
+ wcscpy_s(extUpper, ext);
extUpper[0] = std::toupper(ext[0], loc);
mir_sntprintf(filter, TranslateT("%s Files (*.%s)"), extUpper, ext);
size_t len = mir_tstrlen(filter) + 1;
mir_sntprintf(filter + len, _countof(filter) - len, L"*.%s", ext);
len += mir_tstrlen(filter + len);
filter[++len] = 0;
- TCHAR stzFilePath[1024];
- _tcscpy_s(stzFilePath, TranslateT("History"));
- _tcscat_s(stzFilePath, L".");
- _tcscat_s(stzFilePath, ext);
+ wchar_t stzFilePath[1024];
+ wcscpy_s(stzFilePath, TranslateT("History"));
+ wcscat_s(stzFilePath, L".");
+ wcscat_s(stzFilePath, ext);
len = mir_tstrlen(stzFilePath) + 1;
stzFilePath[len] = 0;
OPENFILENAME ofn = {0};
@@ -75,7 +75,7 @@ std::wstring GetFile(const TCHAR* ext, HWND hwnd, bool open) return L"";
}
-std::wstring ReplaceExt(const std::wstring& file, const TCHAR* ext)
+std::wstring ReplaceExt(const std::wstring& file, const wchar_t* ext)
{
size_t pos = file.find(L"<ext>");
if (pos < file.length()) {
@@ -178,7 +178,7 @@ bool ExportManager::Export(IExport::ExportType type) return true;
}
-const TCHAR* ExportManager::GetExt(IImport::ImportType type)
+const wchar_t* ExportManager::GetExt(IImport::ImportType type)
{
IImport *imp = NULL;
switch(type) {
@@ -192,7 +192,7 @@ const TCHAR* ExportManager::GetExt(IImport::ImportType type) return L"";
}
- const TCHAR *ext = imp->GetExt();
+ const wchar_t *ext = imp->GetExt();
delete imp;
return ext;
}
@@ -294,7 +294,7 @@ void ExportManager::AddGroup(bool isMe, const std::wstring &time, const std::wst return;
m_exp->WriteGroup(isMe, time, user, eventText);
- TCHAR str[MAXSELECTSTR + 8]; // for safety reason
+ wchar_t str[MAXSELECTSTR + 8]; // for safety reason
str[0] = 0;
bool isFirst = true;
bool lastMe = false;
@@ -312,8 +312,8 @@ void ExportManager::AddGroup(bool isMe, const std::wstring &time, const std::wst if (GetEventData(hDbEvent, data)) {
lastMe = data.isMe;
- TCHAR* formatDate = Options::instance->messagesShowSec ? L"d s" : L"d t";
- TCHAR* longFormatDate = Options::instance->messagesShowSec ? L"d s" : L"d t";
+ wchar_t* formatDate = Options::instance->messagesShowSec ? L"d s" : L"d t";
+ wchar_t* longFormatDate = Options::instance->messagesShowSec ? L"d s" : L"d t";
if (!Options::instance->messagesShowDate) {
if (isFirst) {
isFirst = false;
diff --git a/plugins/BasicHistory/src/ExportManager.h b/plugins/BasicHistory/src/ExportManager.h index 1cefb47463..73cd4ca1b7 100644 --- a/plugins/BasicHistory/src/ExportManager.h +++ b/plugins/BasicHistory/src/ExportManager.h @@ -55,6 +55,6 @@ public: void DeleteExportedEvents();
int Import(IImport::ImportType type, const std::vector<MCONTACT> &contacts);
bool Import(IImport::ImportType type, std::vector<IImport::ExternalMessage> &eventList, std::wstring *err = NULL, bool *differentContact = NULL, std::vector<MCONTACT> *contacts = NULL);
- static const TCHAR* GetExt(IImport::ImportType type);
+ static const wchar_t* GetExt(IImport::ImportType type);
};
diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index ecfe7e8e2b..499488c6e4 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -388,7 +388,7 @@ INT_PTR HistoryWindow::DeleteAllUserHistory(WPARAM hContact, LPARAM) }
}
- TCHAR *message = TranslateT("This operation will PERMANENTLY REMOVE all history for this contact.\nAre you sure you want to do this?");
+ wchar_t *message = TranslateT("This operation will PERMANENTLY REMOVE all history for this contact.\nAre you sure you want to do this?");
if (MessageBox(hWnd, message, TranslateT("Are You sure?"), MB_OKCANCEL | MB_ICONERROR) != IDOK)
return FALSE;
@@ -427,7 +427,7 @@ bool HistoryWindow::IsInList(HWND hWnd) void ClickLink(HWND hwnd, ENLINK *penLink)
{
- TCHAR buf[1024];
+ wchar_t buf[1024];
if (penLink->msg != WM_LBUTTONUP)
return;
@@ -566,14 +566,14 @@ INT_PTR CALLBACK HistoryWindow::DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wP if (HIWORD(wParam) == BN_CLICKED) {
if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SHOWHIDE)) & BST_CHECKED) {
SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)historyWindow->minusIco);
- SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Hide Contacts"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Hide Contacts"), BATF_TCHAR);
historyWindow->isContactList = true;
ShowWindow(GetDlgItem(hwndDlg, IDC_LIST_CONTACTS), SW_SHOW);
ShowWindow(historyWindow->splitterYhWnd, SW_SHOW);
}
else {
SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)historyWindow->plusIco);
- SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Show Contacts"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show Contacts"), BATF_TCHAR);
historyWindow->isContactList = false;
ShowWindow(GetDlgItem(hwndDlg, IDC_LIST_CONTACTS), SW_HIDE);
ShowWindow(historyWindow->splitterYhWnd, SW_HIDE);
@@ -728,7 +728,7 @@ INT_PTR CALLBACK HistoryWindow::DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wP TEXTRANGE tr;
tr.chrg.cpMin = iStart;
tr.chrg.cpMax = iEnd;
- tr.lpstrText = new TCHAR[iEnd - iStart + 1];
+ tr.lpstrText = new wchar_t[iEnd - iStart + 1];
SendMessage(historyWindow->editWindow, EM_GETTEXTRANGE, 0, (LPARAM)& tr);
historyWindow->FormatQuote(quote, historyWindow->currentGroup[start], tr.lpstrText);
delete[] tr.lpstrText;
@@ -988,13 +988,13 @@ void HistoryWindow::Initialise() SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BUTTONSETASFLATBTN, TRUE, 0);
if (m_hContact == NULL || Options::instance->showContacts) {
SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)minusIco);
- SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Hide Contacts"), BATF_TCHAR);
+ SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Hide Contacts"), BATF_TCHAR);
Button_SetCheck(GetDlgItem(m_hWnd, IDC_SHOWHIDE), BST_CHECKED);
isContactList = true;
}
else {
SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)plusIco);
- SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Show Contacts"), BATF_TCHAR);
+ SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show Contacts"), BATF_TCHAR);
Button_SetCheck(GetDlgItem(m_hWnd, IDC_SHOWHIDE), BST_UNCHECKED);
ShowWindow(GetDlgItem(m_hWnd, IDC_LIST_CONTACTS), SW_HIDE);
ShowWindow(splitterYhWnd, SW_HIDE);
@@ -1226,21 +1226,21 @@ void HistoryWindow::FillHistoryThread(void* param) void HistoryWindow::AddGroup(bool, const std::wstring &time, const std::wstring &user, const std::wstring &eventText, int ico)
{
- TCHAR msg[256];
+ wchar_t msg[256];
msg[0] = 0;
if (Options::instance->groupShowTime)
- _tcscpy_s(msg, time.c_str());
+ wcscpy_s(msg, time.c_str());
if (Options::instance->groupShowName) {
if (msg[0] != 0)
- _tcscat_s(msg, L" ");
- _tcscat_s(msg, user.c_str());
+ wcscat_s(msg, L" ");
+ wcscat_s(msg, user.c_str());
}
if (Options::instance->groupShowMessage) {
if (msg[0] != 0)
- _tcscat_s(msg, L" ");
- _tcscat_s(msg, eventText.c_str());
+ wcscat_s(msg, L" ");
+ wcscat_s(msg, eventText.c_str());
}
LVITEM item = { 0 };
@@ -1295,8 +1295,8 @@ void HistoryWindow::SelectEventGroup(int sel) if (sel < 0 || sel >= (int)m_eventList.size())
return;
- TCHAR _str[MAXSELECTSTR + 8]; // for safety reason
- TCHAR *str = _str + sizeof(int) / sizeof(TCHAR);
+ wchar_t _str[MAXSELECTSTR + 8]; // for safety reason
+ wchar_t *str = _str + sizeof(int) / sizeof(wchar_t);
BSTR pStr = str;
unsigned int *strLen = (unsigned int*)_str;
str[0] = 0;
@@ -1339,9 +1339,9 @@ void HistoryWindow::SelectEventGroup(int sel) lastMe = data.isMe;
backColor = Options::instance->GetColor(lastMe ? Options::OutBackground : Options::InBackground);
if (Options::instance->messagesShowEvents) {
- str[0] = _T('>');
+ str[0] = '>';
str[1] = 0;
- *strLen = 1 * sizeof(TCHAR);
+ *strLen = 1 * sizeof(wchar_t);
TextSelection->SetStart(MAXLONG);
TextSelection->GetFont(&TextFont);
TextFont->SetBackColor(backColor);
@@ -1360,7 +1360,7 @@ void HistoryWindow::SelectEventGroup(int sel) ImageDataObject::InsertIcon(RichEditOle, ico, backColor, 16, 16);
}
- TCHAR* formatDate = Options::instance->messagesShowSec ? (isUser ? L"d s " : L"d s\n") : (isUser ? L"d t " : L"d t\n");
+ wchar_t* formatDate = Options::instance->messagesShowSec ? (isUser ? L"d s " : L"d s\n") : (isUser ? L"d t " : L"d t\n");
if (!Options::instance->messagesShowDate) {
if (isFirst) {
isFirst = false;
@@ -1378,7 +1378,7 @@ void HistoryWindow::SelectEventGroup(int sel) }
TimeZone_PrintTimeStamp(NULL, data.timestamp, formatDate, str, MAXSELECTSTR, 0);
- *strLen = (unsigned int)mir_tstrlen(str) * sizeof(TCHAR);
+ *strLen = (unsigned int)mir_tstrlen(str) * sizeof(wchar_t);
TextSelection->SetStart(MAXLONG);
TextSelection->GetFont(&TextFont);
SetFontFromOptions(TextFont, caps, lastMe ? Options::OutTimestamp : Options::InTimestamp);
@@ -1388,7 +1388,7 @@ void HistoryWindow::SelectEventGroup(int sel) if (isUser) {
mir_sntprintf(str, MAXSELECTSTR, L"%s\n", (lastMe) ? m_myName : m_contactName);
- *strLen = (unsigned int)mir_tstrlen(str) * sizeof(TCHAR);
+ *strLen = (unsigned int)mir_tstrlen(str) * sizeof(wchar_t);
TextSelection->SetStart(MAXLONG);
TextSelection->GetFont(&TextFont);
SetFontFromOptions(TextFont, caps, lastMe ? Options::OutName : Options::InName);
@@ -1401,9 +1401,9 @@ void HistoryWindow::SelectEventGroup(int sel) size_t i = strStl.length();
if (i + 1 >= MAXSELECTSTR)
continue;
- str[i++] = _T('\n');
+ str[i++] = '\n';
str[i] = 0;
- *strLen = (unsigned int)i * sizeof(TCHAR);
+ *strLen = (unsigned int)i * sizeof(wchar_t);
TextSelection->SetStart(MAXLONG);
TextSelection->GetFont(&TextFont);
SetFontFromOptions(TextFont, caps, lastMe ? Options::OutMessages : Options::InMessages);
@@ -1944,7 +1944,7 @@ void HistoryWindow::Delete(int what) if (toDelete == 0)
return;
- TCHAR message[256];
+ wchar_t message[256];
mir_sntprintf(message, TranslateT("Number of history items to delete: %d.\nAre you sure you want to do this?"), toDelete);
if (MessageBox(m_hWnd, message, TranslateT("Are You sure?"), MB_OKCANCEL | MB_ICONERROR) != IDOK)
return;
@@ -1960,7 +1960,7 @@ void HistoryWindow::Delete(int what) rebuild = (start == 0 && end == currentGroup.size());
if (areImpMessages) {
- TCHAR *ptszMsg = TranslateT("Do you want to delete all imported messages for this contact?\nNote that next scheduler task import this messages again.");
+ wchar_t *ptszMsg = TranslateT("Do you want to delete all imported messages for this contact?\nNote that next scheduler task import this messages again.");
if (MessageBox(m_hWnd, ptszMsg, TranslateT("Are You sure?"), MB_YESNO | MB_ICONERROR) == IDYES) {
HistoryEventList::DeleteImporter(m_hContact);
rebuild = true;
@@ -2030,7 +2030,7 @@ void HistoryWindow::FormatQuote(std::wstring "e, const MessageData &md, cons quote += m_myName;
else
quote += m_contactName;
- TCHAR str[32];
+ wchar_t str[32];
TimeZone_PrintTimeStamp(NULL, md.timestamp, L"d t", str, 32, 0);
quote += L", ";
quote += str;
@@ -2046,7 +2046,7 @@ void HistoryWindow::FormatQuote(std::wstring "e, const MessageData &md, cons }
f = nf + 1;
- if (msg[nf] == _T('\r') && f < (int)msg.length() && msg[f] == _T('\n'))
+ if (msg[nf] == '\r' && f < (int)msg.length() && msg[f] == '\n')
++f;
}
else if (msg.length() - f > 0) {
diff --git a/plugins/BasicHistory/src/IExport.h b/plugins/BasicHistory/src/IExport.h index d024a084e4..b9edc83d02 100644 --- a/plugins/BasicHistory/src/IExport.h +++ b/plugins/BasicHistory/src/IExport.h @@ -36,7 +36,7 @@ public: stream = str;
}
- virtual const TCHAR* GetExt() = 0;
+ virtual const wchar_t* GetExt() = 0;
virtual void WriteHeader(const std::wstring &fileName, const std::wstring &filterName, const std::wstring &myName, const std::wstring &myId, const std::wstring &name1, const std::wstring &proto1, const std::wstring &id1, const std::string& baseProto1, const std::wstring& encoding) = 0;
virtual void WriteFooter() = 0;
virtual void WriteGroup(bool isMe, const std::wstring &time, const std::wstring &user, const std::wstring &eventText) = 0;
diff --git a/plugins/BasicHistory/src/IImport.h b/plugins/BasicHistory/src/IImport.h index 84a65c15f2..6752bf9eef 100644 --- a/plugins/BasicHistory/src/IImport.h +++ b/plugins/BasicHistory/src/IImport.h @@ -42,7 +42,7 @@ public: stream = str;
}
- virtual const TCHAR* GetExt() = 0;
+ virtual const wchar_t* GetExt() = 0;
virtual int IsContactInFile(const std::vector<MCONTACT>& contacts) = 0;
virtual bool GetEventList(std::vector<ExternalMessage>& eventList) = 0;
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index d464b4299c..262b46e47c 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -31,22 +31,22 @@ Options *Options::instance; struct EventNamesType
{
int id;
- TCHAR* name;
+ wchar_t* name;
}
EventNames[] =
{
- EVENTTYPE_MESSAGE, LPGENT("Message"),
- EVENTTYPE_FILE, LPGENT("File transfer"),
- EVENTTYPE_URL, LPGENT("Link"),
- EVENTTYPE_AUTHREQUEST, LPGENT("Authorization request"),
- EVENTTYPE_ADDED, LPGENT("You were added"),
- EVENTTYPE_CONTACTS, LPGENT("Contacts received"),
- ICQEVENTTYPE_SMS, LPGENT("SMS message")
+ EVENTTYPE_MESSAGE, LPGENW("Message"),
+ EVENTTYPE_FILE, LPGENW("File transfer"),
+ EVENTTYPE_URL, LPGENW("Link"),
+ EVENTTYPE_AUTHREQUEST, LPGENW("Authorization request"),
+ EVENTTYPE_ADDED, LPGENW("You were added"),
+ EVENTTYPE_CONTACTS, LPGENW("Contacts received"),
+ ICQEVENTTYPE_SMS, LPGENW("SMS message")
};
struct TCpTable {
UINT cpId;
- TCHAR *cpName;
+ wchar_t *cpName;
}
cpTable[] = {
{ CP_UTF8, L"UTF-8" },
@@ -123,34 +123,34 @@ int Options::InitOptions(WPARAM wParam, LPARAM) odp.position = 100000000;
odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszTitle = LPGENT("History");
+ odp.pwszTitle = LPGENW("History");
- odp.ptszTab = LPGENT("Group list");
+ odp.pwszTab = LPGENW("Group list");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GROUPLIST);
odp.pfnDlgProc = Options::DlgProcOptsGroupList;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Messages");
+ odp.pwszTab = LPGENW("Messages");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MESSAGES);
odp.pfnDlgProc = Options::DlgProcOptsMessages;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Searching");
+ odp.pwszTab = LPGENW("Searching");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SEARCHING);
odp.pfnDlgProc = Options::DlgProcOptsSearching;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Export");
+ odp.pwszTab = LPGENW("Export");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_EXPORT);
odp.pfnDlgProc = Options::DlgProcOptsExport;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Scheduler");
+ odp.pwszTab = LPGENW("Scheduler");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SCHEDULER);
odp.pfnDlgProc = Options::DlgProcOptsScheduler;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Advanced");
+ odp.pwszTab = LPGENW("Advanced");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MAIN);
odp.pfnDlgProc = Options::DlgProcOptsMain;
Options_AddPage(wParam, &odp);
@@ -158,69 +158,69 @@ int Options::InitOptions(WPARAM wParam, LPARAM) }
struct FontOptionsList {
- TCHAR* szDescr;
+ wchar_t* szDescr;
COLORREF defColour;
- TCHAR* szDefFace;
+ wchar_t* szDefFace;
BYTE defStyle;
char defSize;
- TCHAR* szBackgroundName;
+ wchar_t* szBackgroundName;
DWORD flags;
};
struct ColorOptionsList {
- TCHAR* tszName;
+ wchar_t* tszName;
COLORREF def;
};
struct HotkeyOptionsList {
const char *pszName;
- const TCHAR *ptszDescription;
- const TCHAR *ptszSection;
+ const wchar_t *ptszDescription;
+ const wchar_t *ptszSection;
const char *pszService;
WORD DefHotKey;
LPARAM lParam;
};
static FontOptionsList g_FontOptionsList[] = {
- {LPGENT(">> Outgoing timestamp"), RGB(0, 0, 0), L"MS Shell Dlg 2", DBFONTF_BOLD, -11, LPGENT("Outgoing background"), FIDF_ALLOWEFFECTS},
- {LPGENT("<< Incoming timestamp"), RGB(0, 0, 0), L"MS Shell Dlg 2", DBFONTF_BOLD, -11, LPGENT("Incoming background"), FIDF_ALLOWEFFECTS},
- {LPGENT(">> Outgoing name"), RGB(100,100,100), L"MS Shell Dlg 2", DBFONTF_BOLD, -11, LPGENT("Outgoing background"), FIDF_ALLOWEFFECTS},
- {LPGENT("<< Incoming name"), RGB(90,160,90), L"MS Shell Dlg 2", DBFONTF_BOLD, -11, LPGENT("Incoming background"), FIDF_ALLOWEFFECTS},
- {LPGENT(">> Outgoing messages"), RGB(0, 0, 0), L"MS Shell Dlg 2", 0, -11, LPGENT("Outgoing background"), FIDF_ALLOWEFFECTS},
- {LPGENT("<< Incoming messages"), RGB(0, 0, 0), L"MS Shell Dlg 2", 0, -11, LPGENT("Incoming background"), FIDF_ALLOWEFFECTS},
- {LPGENT("Group list"), RGB(0, 0, 0), L"MS Shell Dlg 2", 0, -11, LPGENT("Group list background"), FIDF_DISABLESTYLES},
- {LPGENT("Find window"), RGB(0, 0, 0), L"MS Shell Dlg 2", 0, -11, LPGENT("Find window background"), FIDF_DISABLESTYLES},
+ {LPGENW(">> Outgoing timestamp"), RGB(0, 0, 0), L"MS Shell Dlg 2", DBFONTF_BOLD, -11, LPGENW("Outgoing background"), FIDF_ALLOWEFFECTS},
+ {LPGENW("<< Incoming timestamp"), RGB(0, 0, 0), L"MS Shell Dlg 2", DBFONTF_BOLD, -11, LPGENW("Incoming background"), FIDF_ALLOWEFFECTS},
+ {LPGENW(">> Outgoing name"), RGB(100,100,100), L"MS Shell Dlg 2", DBFONTF_BOLD, -11, LPGENW("Outgoing background"), FIDF_ALLOWEFFECTS},
+ {LPGENW("<< Incoming name"), RGB(90,160,90), L"MS Shell Dlg 2", DBFONTF_BOLD, -11, LPGENW("Incoming background"), FIDF_ALLOWEFFECTS},
+ {LPGENW(">> Outgoing messages"), RGB(0, 0, 0), L"MS Shell Dlg 2", 0, -11, LPGENW("Outgoing background"), FIDF_ALLOWEFFECTS},
+ {LPGENW("<< Incoming messages"), RGB(0, 0, 0), L"MS Shell Dlg 2", 0, -11, LPGENW("Incoming background"), FIDF_ALLOWEFFECTS},
+ {LPGENW("Group list"), RGB(0, 0, 0), L"MS Shell Dlg 2", 0, -11, LPGENW("Group list background"), FIDF_DISABLESTYLES},
+ {LPGENW("Find window"), RGB(0, 0, 0), L"MS Shell Dlg 2", 0, -11, LPGENW("Find window background"), FIDF_DISABLESTYLES},
};
static ColorOptionsList g_ColorOptionsList[] = {
- LPGENT("Outgoing background"), RGB(245,245,255),
- LPGENT("Incoming background"), RGB(245,255,245),
- LPGENT("Group list background"), GetSysColor(COLOR_3DFACE),
- LPGENT("Window background"), GetSysColor(COLOR_3DFACE),
- LPGENT("Contact list background"), GetSysColor(COLOR_3DFACE),
- LPGENT("Find window background"), GetSysColor(COLOR_WINDOW),
+ LPGENW("Outgoing background"), RGB(245,245,255),
+ LPGENW("Incoming background"), RGB(245,255,245),
+ LPGENW("Group list background"), GetSysColor(COLOR_3DFACE),
+ LPGENW("Window background"), GetSysColor(COLOR_3DFACE),
+ LPGENW("Contact list background"), GetSysColor(COLOR_3DFACE),
+ LPGENW("Find window background"), GetSysColor(COLOR_WINDOW),
};
static HotkeyOptionsList g_HotkeyOptionsList[] = {
- { "basichistory_hot_showall", LPGENT("Open global history"), LPGENT("History"), MS_HISTORY_SHOWCONTACTHISTORY, HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'H') | HKF_MIRANDA_LOCAL, 0 },
- { "basichistory_hot_find", LPGENT("Find"), LPGENT("History"), 0, HOTKEYCODE(HOTKEYF_CONTROL, 'F'), HISTORY_HK_FIND },
- { "basichistory_hot_findnext", LPGENT("Find Next"), LPGENT("History"), 0, VK_F3, HISTORY_HK_FINDNEXT },
- { "basichistory_hot_findprev", LPGENT("Find Previous"), LPGENT("History"), 0, VK_F2, HISTORY_HK_FINDPREV },
- { "basichistory_hot_matchcase", LPGENT("Switch Match Case"), LPGENT("History"), 0, 0, HISTORY_HK_MATCHCASE },
- { "basichistory_hot_matchwhole", LPGENT("Switch Match Whole Word"), LPGENT("History"), 0, 0, HISTORY_HK_MATCHWHOLE },
- { "basichistory_hot_showcontacts", LPGENT("Show/Hide Contacts"), LPGENT("History"), 0, 0, HISTORY_HK_SHOWCONTACTS },
- { "basichistory_hot_onlyin", LPGENT("Switch Only Incoming Messages"), LPGENT("History"), 0, 0, HISTORY_HK_ONLYIN },
- { "basichistory_hot_onlyout", LPGENT("Switch Only Outgoing Messages"), LPGENT("History"), 0, 0, HISTORY_HK_ONLYOUT },
- { "basichistory_hot_onlygroup", LPGENT("Switch Only Selected Group"), LPGENT("History"), 0, 0, HISTORY_HK_ONLYGROUP },
- { "basichistory_hot_allcontacts", LPGENT("Switch All Contacts"), LPGENT("History"), 0, 0, HISTORY_HK_ALLCONTACTS },
- { "basichistory_hot_delete", LPGENT("Delete"), LPGENT("History"), 0, VK_DELETE, HISTORY_HK_DELETE },
- { "basichistory_hot_exrhtml", LPGENT("Export To Rich Html"), LPGENT("History"), 0, 0, HISTORY_HK_EXRHTML },
- { "basichistory_hot_exphtml", LPGENT("Export To Plain Html"), LPGENT("History"), 0, 0, HISTORY_HK_EXPHTML },
- { "basichistory_hot_extxt", LPGENT("Export To Txt"), LPGENT("History"), 0, 0, HISTORY_HK_EXTXT },
- { "basichistory_hot_exbin", LPGENT("Export To Binary"), LPGENT("History"), 0, 0, HISTORY_HK_EXBIN },
- { "basichistory_hot_impbin", LPGENT("Import From Binary"), LPGENT("History"), 0, 0, HISTORY_HK_IMPBIN },
- { "basichistory_hot_exdat", LPGENT("Export To Dat (mContacts)"), LPGENT("History"), 0, 0, HISTORY_HK_EXDAT },
- { "basichistory_hot_impdat", LPGENT("Import From Dat (mContacts)"), LPGENT("History"), 0, 0, HISTORY_HK_IMPDAT },
+ { "basichistory_hot_showall", LPGENW("Open global history"), LPGENW("History"), MS_HISTORY_SHOWCONTACTHISTORY, HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'H') | HKF_MIRANDA_LOCAL, 0 },
+ { "basichistory_hot_find", LPGENW("Find"), LPGENW("History"), 0, HOTKEYCODE(HOTKEYF_CONTROL, 'F'), HISTORY_HK_FIND },
+ { "basichistory_hot_findnext", LPGENW("Find Next"), LPGENW("History"), 0, VK_F3, HISTORY_HK_FINDNEXT },
+ { "basichistory_hot_findprev", LPGENW("Find Previous"), LPGENW("History"), 0, VK_F2, HISTORY_HK_FINDPREV },
+ { "basichistory_hot_matchcase", LPGENW("Switch Match Case"), LPGENW("History"), 0, 0, HISTORY_HK_MATCHCASE },
+ { "basichistory_hot_matchwhole", LPGENW("Switch Match Whole Word"), LPGENW("History"), 0, 0, HISTORY_HK_MATCHWHOLE },
+ { "basichistory_hot_showcontacts", LPGENW("Show/Hide Contacts"), LPGENW("History"), 0, 0, HISTORY_HK_SHOWCONTACTS },
+ { "basichistory_hot_onlyin", LPGENW("Switch Only Incoming Messages"), LPGENW("History"), 0, 0, HISTORY_HK_ONLYIN },
+ { "basichistory_hot_onlyout", LPGENW("Switch Only Outgoing Messages"), LPGENW("History"), 0, 0, HISTORY_HK_ONLYOUT },
+ { "basichistory_hot_onlygroup", LPGENW("Switch Only Selected Group"), LPGENW("History"), 0, 0, HISTORY_HK_ONLYGROUP },
+ { "basichistory_hot_allcontacts", LPGENW("Switch All Contacts"), LPGENW("History"), 0, 0, HISTORY_HK_ALLCONTACTS },
+ { "basichistory_hot_delete", LPGENW("Delete"), LPGENW("History"), 0, VK_DELETE, HISTORY_HK_DELETE },
+ { "basichistory_hot_exrhtml", LPGENW("Export To Rich Html"), LPGENW("History"), 0, 0, HISTORY_HK_EXRHTML },
+ { "basichistory_hot_exphtml", LPGENW("Export To Plain Html"), LPGENW("History"), 0, 0, HISTORY_HK_EXPHTML },
+ { "basichistory_hot_extxt", LPGENW("Export To Txt"), LPGENW("History"), 0, 0, HISTORY_HK_EXTXT },
+ { "basichistory_hot_exbin", LPGENW("Export To Binary"), LPGENW("History"), 0, 0, HISTORY_HK_EXBIN },
+ { "basichistory_hot_impbin", LPGENW("Import From Binary"), LPGENW("History"), 0, 0, HISTORY_HK_IMPBIN },
+ { "basichistory_hot_exdat", LPGENW("Export To Dat (mContacts)"), LPGENW("History"), 0, 0, HISTORY_HK_EXDAT },
+ { "basichistory_hot_impdat", LPGENW("Import From Dat (mContacts)"), LPGENW("History"), 0, 0, HISTORY_HK_IMPDAT },
};
const int g_fontsSize = _countof(g_FontOptionsList);
@@ -238,26 +238,26 @@ void Options::Load(void) cid.cbSize = sizeof(ColourIDT);
hid.cbSize = sizeof(HOTKEYDESC);
strncpy_s(fid.dbSettingsGroup, "BasicHistory_Fonts", _TRUNCATE);
- _tcsncpy_s(fid.backgroundGroup, L"History", _TRUNCATE);
- _tcsncpy_s(fid.group, LPGENT("History"), _TRUNCATE);
+ wcsncpy_s(fid.backgroundGroup, L"History", _TRUNCATE);
+ wcsncpy_s(fid.group, LPGENW("History"), _TRUNCATE);
for (int i = 0; i < g_fontsSize; ++i) {
fid.order = i;
- _tcsncpy_s(fid.deffontsettings.szFace, g_FontOptionsList[i].szDefFace, _TRUNCATE);
+ wcsncpy_s(fid.deffontsettings.szFace, g_FontOptionsList[i].szDefFace, _TRUNCATE);
fid.deffontsettings.size = g_FontOptionsList[i].defSize;
fid.deffontsettings.colour = g_FontOptionsList[i].defColour;
fid.deffontsettings.style = g_FontOptionsList[i].defStyle;
fid.deffontsettings.charset = DEFAULT_CHARSET;
mir_snprintf(fid.prefix, _countof(fid.prefix), "Font%d", i);
- _tcsncpy_s(fid.name, g_FontOptionsList[i].szDescr, _TRUNCATE);
- _tcsncpy_s(fid.backgroundName, g_FontOptionsList[i].szBackgroundName, _TRUNCATE);
+ wcsncpy_s(fid.name, g_FontOptionsList[i].szDescr, _TRUNCATE);
+ wcsncpy_s(fid.backgroundName, g_FontOptionsList[i].szBackgroundName, _TRUNCATE);
fid.flags = FIDF_DEFAULTVALID | FIDF_CLASSGENERAL | g_FontOptionsList[i].flags;
FontRegisterT(&fid);
}
strncpy_s(cid.dbSettingsGroup, "BasicHistory_Fonts", _TRUNCATE);
- _tcsncpy_s(cid.group, LPGENT("History"), _TRUNCATE);
+ wcsncpy_s(cid.group, LPGENW("History"), _TRUNCATE);
for (int i = 0; i < g_colorsSize; ++i) {
- _tcsncpy_s(cid.name, g_ColorOptionsList[i].tszName, _TRUNCATE);
+ wcsncpy_s(cid.name, g_ColorOptionsList[i].tszName, _TRUNCATE);
mir_snprintf(cid.setting, _countof(cid.setting), "Color%d", i);
cid.order = i;
cid.defcolour = g_ColorOptionsList[i].def;
@@ -410,8 +410,8 @@ COLORREF Options::GetFont(Fonts fontId, PLOGFONT font) {
FontIDT fid = {0};
fid.cbSize = sizeof(FontIDT);
- _tcsncpy_s(fid.group, LPGENT("History"), _TRUNCATE);
- _tcsncpy_s(fid.name, g_FontOptionsList[fontId].szDescr, _TRUNCATE);
+ wcsncpy_s(fid.group, LPGENW("History"), _TRUNCATE);
+ wcsncpy_s(fid.name, g_FontOptionsList[fontId].szDescr, _TRUNCATE);
return (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)font);
}
@@ -419,8 +419,8 @@ COLORREF Options::GetColor(Colors colorId) {
ColourIDT cid = {0};
cid.cbSize = sizeof(ColourIDT);
- _tcsncpy_s(cid.group, LPGENT("History"), _TRUNCATE);
- _tcsncpy_s(cid.name, g_ColorOptionsList[colorId].tszName, _TRUNCATE);
+ wcsncpy_s(cid.group, LPGENW("History"), _TRUNCATE);
+ wcsncpy_s(cid.name, g_ColorOptionsList[colorId].tszName, _TRUNCATE);
return (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, NULL);
}
@@ -721,7 +721,7 @@ void SetEventCB(HWND hwndCB, int eventId) selCpIdx = i;
if (selCpIdx == -1) {
- TCHAR buf[24];
+ wchar_t buf[24];
mir_sntprintf(buf, L"%d", eventId);
ComboBox_SetText(hwndCB, buf);
}
@@ -732,10 +732,10 @@ int GetEventCB(HWND hwndCB, bool errorReport, int &eventId) {
int selCpIdx = ComboBox_GetCurSel(hwndCB);
if (selCpIdx < 0) {
- TCHAR text[24];
+ wchar_t text[24];
ComboBox_GetText(hwndCB, text, 24);
- TCHAR * stopOn = NULL;
- long cp = _tcstol(text, &stopOn, 10);
+ wchar_t * stopOn = NULL;
+ long cp = wcstol(text, &stopOn, 10);
if (errorReport && (stopOn == text || *stopOn != '\0' || cp < 0)) {
MessageBox(GetParent(hwndCB), TranslateT("Invalid event number"), TranslateT("Error"), MB_OK | MB_ICONERROR);
SetFocus(hwndCB);
@@ -776,7 +776,7 @@ void ReloadEventLB(HWND hwndLB, const FilterOptions &sel) selCpIdx = i;
if (selCpIdx == -1) {
- TCHAR buf[24];
+ wchar_t buf[24];
mir_sntprintf(buf, L"%d", *it);
ListBox_AddString(hwndLB, buf);
}
@@ -786,7 +786,7 @@ void ReloadEventLB(HWND hwndLB, const FilterOptions &sel) bool CheckFile(HWND hwndEdit)
{
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
Edit_GetText(hwndEdit, buf, MAX_PATH);
DWORD atr = GetFileAttributes(buf);
if (atr == INVALID_FILE_ATTRIBUTES || atr & FILE_ATTRIBUTE_DIRECTORY) {
@@ -798,27 +798,27 @@ bool CheckFile(HWND hwndEdit) return true;
}
-bool OpenFileDlg(HWND hwndDlg, HWND hwndEdit, const TCHAR* defName, const TCHAR* ext, const TCHAR* title, bool open)
+bool OpenFileDlg(HWND hwndDlg, HWND hwndEdit, const wchar_t* defName, const wchar_t* ext, const wchar_t* title, bool open)
{
- TCHAR filter[1024];
+ wchar_t filter[1024];
std::locale loc;
- TCHAR extUpper[32];
- _tcscpy_s(extUpper, ext);
+ wchar_t extUpper[32];
+ wcscpy_s(extUpper, ext);
extUpper[0] = std::toupper(ext[0], loc);
mir_sntprintf(filter, TranslateT("%s Files (*.%s)"), extUpper, ext);
size_t len = mir_tstrlen(filter) + 1;
mir_sntprintf(filter + len, _countof(filter) - len, L"*.%s", ext);
len += mir_tstrlen(filter + len) + 1;
- _tcscpy_s(filter + len, 1024 - len, TranslateT("All Files (*.*)"));
+ wcscpy_s(filter + len, 1024 - len, TranslateT("All Files (*.*)"));
len += mir_tstrlen(filter + len) + 1;
- _tcscpy_s(filter + len, 1024 - len, L"*.*");
+ wcscpy_s(filter + len, 1024 - len, L"*.*");
len += mir_tstrlen(filter + len) + 1;
filter[len] = 0;
- TCHAR stzFilePath[1024];
+ wchar_t stzFilePath[1024];
Edit_GetText(hwndEdit, stzFilePath, 1023);
if (stzFilePath[0] == 0) {
- _tcscpy_s(stzFilePath, defName);
+ wcscpy_s(stzFilePath, defName);
len = mir_tstrlen(stzFilePath) + 1;
stzFilePath[len] = 0;
}
@@ -911,7 +911,7 @@ INT_PTR CALLBACK Options::DlgProcOptsMain(HWND hwndDlg, UINT msg, WPARAM wParam, switch(LOWORD(wParam)) {
case IDC_ADD_FILTER:
{
- TCHAR name[24];
+ wchar_t name[24];
Edit_GetText(nameFilter, name, 24);
if (name[0] == 0) {
MessageBox(hwndDlg, TranslateT("Enter filter name"), TranslateT("Error"), MB_ICONERROR);
@@ -1079,7 +1079,7 @@ INT_PTR CALLBACK Options::DlgProcOptsMain(HWND hwndDlg, UINT msg, WPARAM wParam, case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
HWND ftp = GetDlgItem(hwndDlg, IDC_WINSCP);
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
Edit_GetText(ftp, buf, MAX_PATH);
if (buf[0] != 0 && !CheckFile(ftp)) {
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -1282,7 +1282,7 @@ void InitCodepageCB(HWND hwndCB, unsigned int codepage, const std::wstring& name }
if (selCpIdx == -1) {
- TCHAR buf[300];
+ wchar_t buf[300];
mir_sntprintf(buf, L"%d;%s", codepage, name.c_str());
ComboBox_SetText(hwndCB, buf);
}
@@ -1295,18 +1295,18 @@ unsigned int GetCodepageCB(HWND hwndCB, bool errorReport, unsigned int, const st {
int selCpIdx = ComboBox_GetCurSel(hwndCB);
if (selCpIdx < 0) {
- TCHAR text[128];
+ wchar_t text[128];
ComboBox_GetText(hwndCB, text, 128);
std::wstring str = text;
name = L"";
- size_t pos = str.find_first_of(_T(';'));
+ size_t pos = str.find_first_of(';');
if (pos < str.length()) {
text[pos] = 0;
name = str.substr(pos + 1);
}
- TCHAR * stopOn = NULL;
- long cp = _tcstol(text, &stopOn, 10);
+ wchar_t * stopOn = NULL;
+ long cp = wcstol(text, &stopOn, 10);
if ((pos >= str.length() || name.empty() || stopOn == text || *stopOn != '\0' || cp < 0 || cp > 0xffff)) {
if (errorReport) {
MessageBox(GetParent(hwndCB), TranslateT("You've entered invalid codepage. Select codepage from combo box or enter correct number."), TranslateT("Invalid codepage"), MB_OK | MB_ICONERROR);
@@ -1399,7 +1399,7 @@ INT_PTR CALLBACK Options::DlgProcOptsExport(HWND hwndDlg, UINT msg, WPARAM wPara return TRUE;
}
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
Edit_GetText(GetDlgItem(hwndDlg, IDC_HTML2EXTCSSFILE), buf, MAX_PATH);
instance->extCssHtml2 = buf;
}
@@ -1696,9 +1696,9 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam, Edit_LimitText(deltaTime, 4);
SetDlgItemInt(hwndDlg, IDC_TRIGER_DELTA_TIME, to->deltaTime, FALSE);
- TCHAR timeFormat[10];
+ wchar_t timeFormat[10];
if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SSHORTTIME, timeFormat, 10) == 0) {
- TCHAR sep = _T(':');
+ wchar_t sep = ':';
if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STIME, timeFormat, 10) > 0)
sep = timeFormat[0];
mir_sntprintf(timeFormat, L"HH%cmm", sep);
@@ -1747,7 +1747,7 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam, BOOL isOK = FALSE;
toCp.eventDeltaTime = GetDlgItemInt(hwndDlg, IDC_EVENT_TIME, &isOK, TRUE);
if (!isOK) {
- TCHAR tszBuf[256];
+ wchar_t tszBuf[256];
mir_sntprintf(tszBuf, TranslateT("Invalid '%s' value."), TranslateT("Events older than"));
MessageBox(hwndDlg, tszBuf, TranslateT("Error"), MB_ICONERROR);
break;
@@ -1778,7 +1778,7 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam, toCp.dayOfMonth = GetDlgItemInt(hwndDlg, IDC_TRIGER_DAY, &isOK, FALSE);
if (!isOK) {
if (toCp.trigerType == TaskOptions::Monthly) {
- TCHAR tszBuf[256];
+ wchar_t tszBuf[256];
mir_sntprintf(tszBuf, TranslateT("Invalid '%s' value."), TranslateT("Day"));
MessageBox(hwndDlg, tszBuf, TranslateT("Error"), MB_ICONERROR);
break;
@@ -1788,7 +1788,7 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam, toCp.deltaTime = GetDlgItemInt(hwndDlg, IDC_TRIGER_DELTA_TIME, &isOK, FALSE);
if (!isOK) {
if (toCp.trigerType == TaskOptions::DeltaMin || toCp.trigerType == TaskOptions::DeltaHour) {
- TCHAR tszBuf[256];
+ wchar_t tszBuf[256];
mir_sntprintf(tszBuf, TranslateT("Invalid '%s' value."), TranslateT("Delta time"));
MessageBox(hwndDlg, tszBuf, TranslateT("Error"), MB_ICONERROR);
break;
@@ -1802,9 +1802,9 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam, to->taskName = L"";
if (!IsValidTask(toCp, top->tasks, &err, &errDescr)) {
to->taskName = lastName;
- TCHAR tszBuf[256];
+ wchar_t tszBuf[256];
if (err.empty())
- _tcscpy_s(tszBuf, TranslateT("Some value is invalid"));
+ wcscpy_s(tszBuf, TranslateT("Some value is invalid"));
else if (errDescr.empty())
mir_sntprintf(tszBuf, TranslateT("Invalid '%s' value."), err.c_str());
else
@@ -1868,9 +1868,9 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam, ShowWindow(GetDlgItem(hwndDlg, IDC_IMPORT_TYPE), showImport);
std::wstring str;
- TCHAR* compressText = TranslateT("Compress output files");
- TCHAR* uploadText = TranslateT("Upload to FTP (WinSCP requred)");
- TCHAR* typeText = TranslateT("Export to");
+ wchar_t* compressText = TranslateT("Compress output files");
+ wchar_t* uploadText = TranslateT("Upload to FTP (WinSCP requred)");
+ wchar_t* typeText = TranslateT("Export to");
if (showFilter == SW_HIDE) {
str = TranslateT("** Use <ext> to insert extension, <contact> to insert contact name");
compressText = TranslateT("Input files are compressed");
diff --git a/plugins/BasicHistory/src/Options.h b/plugins/BasicHistory/src/Options.h index e74c81ff33..097eec73f7 100644 --- a/plugins/BasicHistory/src/Options.h +++ b/plugins/BasicHistory/src/Options.h @@ -114,7 +114,7 @@ struct TaskOptions dayOfMonth = 1;
deltaTime = 24;
orderNr = 0;
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, buf)))
{
filePath = buf;
diff --git a/plugins/BasicHistory/src/PlainHtmlExport.cpp b/plugins/BasicHistory/src/PlainHtmlExport.cpp index c98386a056..52bf4fadd7 100644 --- a/plugins/BasicHistory/src/PlainHtmlExport.cpp +++ b/plugins/BasicHistory/src/PlainHtmlExport.cpp @@ -73,7 +73,7 @@ void PlainHtmlExport::WriteFooter() void PlainHtmlExport::WriteGroup(bool, const std::wstring &time, const std::wstring&, const std::wstring&)
{
- TCHAR buf[256];
+ wchar_t buf[256];
EXP_FILE << L"<div class=mes id=session>\n";
mir_sntprintf(buf, TranslateT("Conversation started at %s"), time.c_str());
EXP_FILE << L"<div class=text>" << buf << L"</div>\n";
@@ -82,8 +82,8 @@ void PlainHtmlExport::WriteGroup(bool, const std::wstring &time, const std::wstr void PlainHtmlExport::WriteMessage(bool isMe, const std::wstring &longDate, const std::wstring &shortDate, const std::wstring &user, const std::wstring &message, const DBEVENTINFO&)
{
- TCHAR *id = isMe ? L"out" : L"inc";
- TCHAR* ev = (isMe ? L"1" : L"0");
+ wchar_t *id = isMe ? L"out" : L"inc";
+ wchar_t* ev = (isMe ? L"1" : L"0");
bool isUrl = false;
std::wstring mes = UrlHighlightHtml(MakeTextHtmled(message), isUrl);
if (isUrl)
diff --git a/plugins/BasicHistory/src/PlainHtmlExport.h b/plugins/BasicHistory/src/PlainHtmlExport.h index 122e82d808..985e75d410 100644 --- a/plugins/BasicHistory/src/PlainHtmlExport.h +++ b/plugins/BasicHistory/src/PlainHtmlExport.h @@ -22,7 +22,7 @@ class PlainHtmlExport : public IExport
{
public:
- virtual const TCHAR* GetExt()
+ virtual const wchar_t* GetExt()
{
return L"html";
}
diff --git a/plugins/BasicHistory/src/RichHtmlExport.cpp b/plugins/BasicHistory/src/RichHtmlExport.cpp index 5b030b5721..45bc07ee5b 100644 --- a/plugins/BasicHistory/src/RichHtmlExport.cpp +++ b/plugins/BasicHistory/src/RichHtmlExport.cpp @@ -39,19 +39,19 @@ std::wstring MakeTextHtmled(const std::wstring& message, std::queue<std::pair<si while((find = message.find_first_of(search, start)) < message.length()) {
ret += message.substr(start, find - start);
switch(message[find]) {
- case _T('&'):
+ case '&':
ret += L"&";
break;
- case _T('<'):
+ case '<':
ret += L"<";
break;
- case _T('>'):
+ case '>':
ret += L">";
break;
- case _T('\t'):
+ case '\t':
ret += L" ";
break;
- case _T('\n'):
+ case '\n':
ret += L"<br>";
break;
}
@@ -257,8 +257,8 @@ void IcoSave(const std::wstring &fileName, HICON hicon) bool DeleteDirectory(LPCTSTR lpszDir, bool noRecycleBin = true)
{
size_t len = mir_tstrlen(lpszDir);
- TCHAR *pszFrom = new TCHAR[len+2];
- _tcscpy_s(pszFrom, len+2, lpszDir);
+ wchar_t *pszFrom = new wchar_t[len+2];
+ wcscpy_s(pszFrom, len+2, lpszDir);
pszFrom[len] = 0;
pszFrom[len+1] = 0;
@@ -365,8 +365,8 @@ void RichHtmlExport::WriteFooter() void RichHtmlExport::WriteGroup(bool isMe, const std::wstring &time, const std::wstring&, const std::wstring &eventText)
{
- TCHAR *id = isMe ? L"out" : L"inc";
- TCHAR* ev = (isMe ? L"1" : L"0");
+ wchar_t *id = isMe ? L"out" : L"inc";
+ wchar_t* ev = (isMe ? L"1" : L"0");
if (groupId > 0)
EXP_FILE << L"</div>\n";
@@ -383,9 +383,9 @@ void RichHtmlExport::WriteGroup(bool isMe, const std::wstring &time, const std:: void RichHtmlExport::WriteMessage(bool isMe, const std::wstring &longDate, const std::wstring &shortDate, const std::wstring &user, const std::wstring &message, const DBEVENTINFO&)
{
- TCHAR *id = isMe ? L"out" : L"inc";
- TCHAR* ev = (isMe ? L"1" : L"0");
- TCHAR* ev1 = ev;
+ wchar_t *id = isMe ? L"out" : L"inc";
+ wchar_t* ev = (isMe ? L"1" : L"0");
+ wchar_t* ev1 = ev;
bool isUrl = false;
std::wstring mes = ReplaceSmileys(isMe, message, isUrl);
if (isUrl)
@@ -405,8 +405,8 @@ std::wstring RichHtmlExport::ReplaceSmileys(bool isMe, const std::wstring &msg, if (!Options::instance->exportHtml2UseSmileys || !g_SmileyAddAvail)
return UrlHighlightHtml(MakeTextHtmled(msg), isUrl);
- TCHAR* msgbuf = new TCHAR[msg.length() + 1];
- memcpy_s(msgbuf, (msg.length() + 1) * sizeof(TCHAR), msg.c_str(), (msg.length() + 1) * sizeof(TCHAR));
+ wchar_t* msgbuf = new wchar_t[msg.length() + 1];
+ memcpy_s(msgbuf, (msg.length() + 1) * sizeof(wchar_t), msg.c_str(), (msg.length() + 1) * sizeof(wchar_t));
SMADD_BATCHPARSE2 sp = {0};
SMADD_BATCHPARSERES *spr;
sp.cbSize = sizeof(sp);
diff --git a/plugins/BasicHistory/src/RichHtmlExport.h b/plugins/BasicHistory/src/RichHtmlExport.h index e1f31fc15c..6bdcd6e842 100644 --- a/plugins/BasicHistory/src/RichHtmlExport.h +++ b/plugins/BasicHistory/src/RichHtmlExport.h @@ -29,7 +29,7 @@ private: std::unordered_set<std::wstring> smileys;
std::wstring ReplaceSmileys(bool isMe, const std::wstring &msg, bool &isUrl);
public:
- virtual const TCHAR* GetExt()
+ virtual const wchar_t* GetExt()
{
return L"html";
}
diff --git a/plugins/BasicHistory/src/Scheduler.cpp b/plugins/BasicHistory/src/Scheduler.cpp index 2185cb8212..01176f8b8e 100644 --- a/plugins/BasicHistory/src/Scheduler.cpp +++ b/plugins/BasicHistory/src/Scheduler.cpp @@ -44,13 +44,13 @@ void StartThread(bool init); void StopThread();
bool GetNextExportTime(bool init, time_t now);
bool ExecuteCurrentTask(time_t now);
-void GetZipFileTime(const TCHAR *file, uLong *dt);
-std::wstring ReplaceExt(const std::wstring& file, const TCHAR* ext);
+void GetZipFileTime(const wchar_t *file, uLong *dt);
+std::wstring ReplaceExt(const std::wstring& file, const wchar_t* ext);
bool ZipFiles(const std::wstring& dir, std::wstring zipFilePath, const std::string& password);
bool UnzipFiles(const std::wstring& dir, std::wstring& zipFilePath, const std::string& password);
bool FtpFiles(const std::wstring& dir, const std::wstring& filePath, const std::wstring& ftpName);
bool FtpGetFiles(const std::wstring& dir, const std::list<std::wstring>& files, const std::wstring& ftpName);
-void CreatePath(const TCHAR *szDir);
+void CreatePath(const wchar_t *szDir);
void DoError(const TaskOptions& to, const std::wstring error);
static HANDLE hPopupClass;
@@ -169,7 +169,7 @@ bool IsValidTask(TaskOptions& to, std::list<TaskOptions>* top, std::wstring* err *errDescr = TranslateT("To create session open WinSCP, click New Session, enter data and save with specific name. Remember if FTP server using password you should save it in WinSCP.");
return false;
}
- if (to.useFtp && (to.filePath.find(_T('\\')) < to.filePath.length() || to.filePath.find(_T(':')) < to.filePath.length() || to.filePath[0] != L'/')) {
+ if (to.useFtp && (to.filePath.find('\\') < to.filePath.length() || to.filePath.find(':') < to.filePath.length() || to.filePath[0] != L'/')) {
if (err != NULL)
*err = TranslateT("Path to file");
if (errDescr != NULL)
@@ -232,9 +232,9 @@ bool DoTask(TaskOptions& to) std::wstring err;
std::wstring errDescr;
if (!IsValidTask(to, NULL, &err, &errDescr)) {
- TCHAR msg[256];
+ wchar_t msg[256];
if (err.empty())
- _tcscpy_s(msg, TranslateT("Some value is invalid"));
+ wcscpy_s(msg, TranslateT("Some value is invalid"));
else if (errDescr.empty())
mir_sntprintf(msg, TranslateT("Invalid '%s' value."), err.c_str());
else
@@ -280,14 +280,14 @@ bool DoTask(TaskOptions& to) std::vector<MCONTACT> contacts;
if (to.useFtp || to.compress) {
std::map<std::wstring, bool> existingContacts;
- TCHAR temp[MAX_PATH];
+ wchar_t temp[MAX_PATH];
temp[0] = 0;
GetTempPath(MAX_PATH, temp);
dir = temp;
dir += GetName(filePath);
dir = GetFileName(dir, L"", existingContacts, true);
dir = ReplaceExt(dir, L"");
- size_t pos = dir.find_last_of(_T('.'));
+ size_t pos = dir.find_last_of('.');
if (pos < dir.length())
dir = dir.substr(0, pos);
@@ -295,7 +295,7 @@ bool DoTask(TaskOptions& to) CreateDirectory(dir.c_str(), NULL);
}
- const TCHAR* ext = ExportManager::GetExt(to.importType);
+ const wchar_t* ext = ExportManager::GetExt(to.importType);
if (to.isSystem) {
std::wstring n = GetFileName(filePath, mExp.GetContactName(), existingContacts1, true);
n = ReplaceExt(n, ext);
@@ -394,7 +394,7 @@ bool DoTask(TaskOptions& to) if (!errorStr.empty())
errorStr += L"\n";
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Incorrect file format: %s."), GetName(*it).c_str());
errorStr += msg;
}
@@ -402,7 +402,7 @@ bool DoTask(TaskOptions& to) if (!errorStr.empty())
errorStr += L"\n";
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Unknown contact in file: %s."), GetName(*it).c_str());
errorStr += msg;
@@ -434,14 +434,14 @@ bool DoTask(TaskOptions& to) }
else {
filePath = GetName(filePath);
- TCHAR temp[MAX_PATH];
+ wchar_t temp[MAX_PATH];
temp[0] = 0;
GetTempPath(MAX_PATH, temp);
dir = temp;
dir += filePath;
dir = GetFileName(dir, L"", existingContacts, true);
dir = ReplaceExt(dir, L"");
- size_t pos = dir.find_last_of(_T('.'));
+ size_t pos = dir.find_last_of('.');
if (pos < dir.length())
dir = dir.substr(0, pos);
@@ -458,7 +458,7 @@ bool DoTask(TaskOptions& to) if (!errorStr.empty())
errorStr += L"\n";
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str());
errorStr += msg;
@@ -480,7 +480,7 @@ bool DoTask(TaskOptions& to) if (!errorStr.empty())
errorStr += L"\n";
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str());
errorStr += msg;
break;
@@ -507,7 +507,7 @@ bool DoTask(TaskOptions& to) }
else {
zipFilePath = GetName(zipFilePath);
- TCHAR temp[MAX_PATH];
+ wchar_t temp[MAX_PATH];
temp[0] = 0;
GetTempPath(MAX_PATH, temp);
zipDir = temp;
@@ -567,7 +567,7 @@ std::wstring GetFileName(const std::wstring &baseName, std::wstring contactName, if (!baseName1.empty()) {
std::wstring name = baseName1;
int i = 0;
- TCHAR buf[32];
+ wchar_t buf[32];
std::map<std::wstring, bool>::iterator it = existingContacts.find(name);
while(it != existingContacts.end()) {
_itot_s(++i, buf, 10);
@@ -583,7 +583,7 @@ std::wstring GetFileName(const std::wstring &baseName, std::wstring contactName, pos = str.find(L"<date>");
if (pos < str.length()) {
- TCHAR time[256];
+ wchar_t time[256];
SYSTEMTIME st;
GetLocalTime(&st);
mir_sntprintf(time, L"%d-%02d-%02d %02d%02d", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute);
@@ -793,7 +793,7 @@ bool GetNextExportTime(bool init, time_t now) static void CALLBACK DoTaskFinishInMainAPCFunc(ULONG_PTR dwParam)
{
- TCHAR *item = (TCHAR*) dwParam;
+ wchar_t *item = (wchar_t*) dwParam;
MessageBox(NULL, item, TranslateT("Task finished"), MB_OK | MB_ICONINFORMATION);
delete[] item;
}
@@ -841,7 +841,7 @@ bool ExecuteCurrentTask(time_t now) if (to.showMBAfterExecute) {
size_t size = to.taskName.size() + 1024;
- TCHAR *name = new TCHAR[size];
+ wchar_t *name = new wchar_t[size];
if (error)
mir_sntprintf(name, size, TranslateT("Task '%s' execution failed"), to.taskName.c_str());
else
@@ -854,7 +854,7 @@ bool ExecuteCurrentTask(time_t now) return GetNextExportTime(false, now);
}
-void GetZipFileTime(const TCHAR *file, uLong *dt)
+void GetZipFileTime(const wchar_t *file, uLong *dt)
{
FILETIME ftLocal;
WIN32_FIND_DATA ff32;
@@ -868,7 +868,7 @@ void GetZipFileTime(const TCHAR *file, uLong *dt) /* calculate the CRC32 of a file,
because to encrypt a file, we need known the CRC32 of the file before */
-bool GetFileCrc(const TCHAR *filenameinzip, unsigned char *buf, unsigned long, unsigned long *result_crc)
+bool GetFileCrc(const wchar_t *filenameinzip, unsigned char *buf, unsigned long, unsigned long *result_crc)
{
unsigned long calculate_crc = 0;
bool error = true;
@@ -1128,7 +1128,7 @@ bool FtpFiles(const std::wstring& dir, const std::wstring& filePath, const std:: CreateDirectory(GetDirectoryName(log).c_str(), NULL);
DeleteFile(log.c_str());
- TCHAR cmdLine[MAX_PATH];
+ wchar_t cmdLine[MAX_PATH];
mir_sntprintf(cmdLine, L"\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc", Options::instance->ftpExePath.c_str(), log.c_str());
STARTUPINFO startupInfo = { 0 };
@@ -1219,7 +1219,7 @@ bool FtpGetFiles(const std::wstring& dir, const std::list<std::wstring>& files, std::wstring &log = Options::instance->ftpLogPath;
CreateDirectory(GetDirectoryName(log).c_str(), NULL);
DeleteFile(log.c_str());
- TCHAR cmdLine[MAX_PATH];
+ wchar_t cmdLine[MAX_PATH];
mir_sntprintf(cmdLine, L"\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc", Options::instance->ftpExePath.c_str(), log.c_str());
STARTUPINFO startupInfo = { 0 };
PROCESS_INFORMATION processInfo;
@@ -1243,18 +1243,18 @@ bool FtpGetFiles(const std::wstring& dir, const std::list<std::wstring>& files, return true;
}
-void CreatePath(const TCHAR *szDir)
+void CreatePath(const wchar_t *szDir)
{
if (!szDir) return;
DWORD dwAttributes;
- TCHAR *pszLastBackslash, szTestDir[MAX_PATH];
+ wchar_t *pszLastBackslash, szTestDir[MAX_PATH];
mir_tstrncpy(szTestDir, szDir, _countof(szTestDir));
if ((dwAttributes = GetFileAttributes(szTestDir)) != INVALID_FILE_ATTRIBUTES && (dwAttributes & FILE_ATTRIBUTE_DIRECTORY))
return;
- pszLastBackslash = _tcsrchr(szTestDir, '\\');
+ pszLastBackslash = wcsrchr(szTestDir, '\\');
if (pszLastBackslash == NULL)
return;
@@ -1282,7 +1282,7 @@ INT_PTR ExecuteTaskService(WPARAM wParam, LPARAM) void DoError(const TaskOptions& to, const std::wstring _error)
{
- TCHAR msg[256];
+ wchar_t msg[256];
mir_sntprintf(msg, TranslateT("Task '%s' execution failed:"), to.taskName.c_str());
if (Options::instance->schedulerHistoryAlerts) {
std::wstring error = msg;
@@ -1312,8 +1312,8 @@ void DoError(const TaskOptions& to, const std::wstring _error) else if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
POPUPDATAT ppd = { 0 };
ppd.lchIcon = Skin_LoadIcon(SKINICON_OTHER_HISTORY);
- _tcscpy_s(ppd.lptzContactName, msg);
- _tcscpy_s(ppd.lptzText, _error.c_str());
+ wcscpy_s(ppd.lptzContactName, msg);
+ wcscpy_s(ppd.lptzText, _error.c_str());
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, 0);
}
}
diff --git a/plugins/BasicHistory/src/Searcher.cpp b/plugins/BasicHistory/src/Searcher.cpp index bac7c8f37c..a3c8b4f093 100644 --- a/plugins/BasicHistory/src/Searcher.cpp +++ b/plugins/BasicHistory/src/Searcher.cpp @@ -61,12 +61,12 @@ void Searcher::ClearFind() }
}
-inline TCHAR mytoupper(TCHAR a, std::locale* loc)
+inline wchar_t mytoupper(wchar_t a, std::locale* loc)
{
- return std::toupper<TCHAR>(a, *loc);
+ return std::toupper<wchar_t>(a, *loc);
}
-bool Searcher::CompareStr(std::wstring str, TCHAR *strFind)
+bool Searcher::CompareStr(std::wstring str, wchar_t *strFind)
{
std::locale loc;
if (!matchCase)
@@ -89,7 +89,7 @@ bool Searcher::CompareStr(std::wstring str, TCHAR *strFind) void Searcher::Find()
{
FINDTEXTEX ft;
- TCHAR str[128];
+ wchar_t str[128];
int curSel = 0;
bool isStart = false;
bool finished = false;
@@ -104,7 +104,7 @@ void Searcher::Find() GetWindowText(context->findWindow, str, _countof(str));
if (!str[0]) {
- TCHAR buf[256];
+ wchar_t buf[256];
mir_sntprintf(buf, TranslateT("\"%s\" not found"), str);
MessageBox(context->m_hWnd, buf, TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
return;
@@ -297,20 +297,20 @@ void Searcher::Find() SendMessage(context->editWindow,EM_SETOPTIONS,ECOOP_AND,~ECO_NOHIDESEL);
lastFindSelection = -1;
if (isStart) {
- TCHAR buf[256];
+ wchar_t buf[256];
GetWindowText(context->findWindow, str, _countof(str));
mir_sntprintf(buf, TranslateT("\"%s\" not found"), str);
MessageBox(context->m_hWnd, buf, TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
}
- else MessageBox(context->m_hWnd, TranslateTS(onlyGroup ? LPGENT("You have reached the end of the group.") : LPGENT("You have reached the end of the history.")), TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
+ else MessageBox(context->m_hWnd, TranslateTS(onlyGroup ? LPGENW("You have reached the end of the group.") : LPGENW("You have reached the end of the history.")), TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
}
-bool Searcher::IsInSel(int sel, TCHAR *strFind)
+bool Searcher::IsInSel(int sel, wchar_t *strFind)
{
if (sel < 0 || sel >= (int)context->m_eventList.size())
return false;
- TCHAR str[MAXSELECTSTR + 8]; // for safety reason
+ wchar_t str[MAXSELECTSTR + 8]; // for safety reason
HistoryEventList::EventData data;
for (std::deque<HistoryEventList::EventIndex>::iterator it = context->m_eventList[sel].begin(); it != context->m_eventList[sel].end(); ++it) {
HistoryEventList::EventIndex hDbEvent = *it;
@@ -328,7 +328,7 @@ bool Searcher::IsInSel(int sel, TCHAR *strFind) return false;
}
-bool Searcher::Compare(const bool isMe, const std::wstring& message, TCHAR *strFind)
+bool Searcher::Compare(const bool isMe, const std::wstring& message, wchar_t *strFind)
{
if (onlyIn && isMe || onlyOut && !isMe)
return false;
diff --git a/plugins/BasicHistory/src/Searcher.h b/plugins/BasicHistory/src/Searcher.h index a3229da1f5..1a76274221 100644 --- a/plugins/BasicHistory/src/Searcher.h +++ b/plugins/BasicHistory/src/Searcher.h @@ -31,11 +31,11 @@ private: bool isFindContactChanged;
bool findBack, matchCase, matchWholeWords, onlyIn, onlyOut, onlyGroup, allUsers, searchForInLG, searchForInMes;
- bool CompareStr(std::wstring str, TCHAR *strFind);
- bool IsInSel(int sel, TCHAR *strFind);
+ bool CompareStr(std::wstring str, wchar_t *strFind);
+ bool IsInSel(int sel, wchar_t *strFind);
public:
Searcher();
- virtual bool Compare(const bool isMe, const std::wstring& message, TCHAR *strFind);
+ virtual bool Compare(const bool isMe, const std::wstring& message, wchar_t *strFind);
void Find();
void ChangeFindDirection(bool isBack);
void ClearFind();
diff --git a/plugins/BasicHistory/src/TxtExport.cpp b/plugins/BasicHistory/src/TxtExport.cpp index b2f9ddc5c9..89df71c8b3 100644 --- a/plugins/BasicHistory/src/TxtExport.cpp +++ b/plugins/BasicHistory/src/TxtExport.cpp @@ -26,7 +26,7 @@ TxtExport::~TxtExport() void TxtExport::WriteHeader(const std::wstring&, const std::wstring &filterName, const std::wstring &myName, const std::wstring &myId, const std::wstring &name1, const std::wstring &proto1, const std::wstring &id1, const std::string&, const std::wstring&)
{
- TCHAR* start = TranslateT("###");
+ wchar_t* start = TranslateT("###");
EXP_FILE << start << "\n" << start << L" " << TranslateT("History Log") << L"\n";
EXP_FILE << start << L" " << myName;
if (proto1.length() || myId.length())
diff --git a/plugins/BasicHistory/src/TxtExport.h b/plugins/BasicHistory/src/TxtExport.h index 3147d9024d..6c47a1d50e 100644 --- a/plugins/BasicHistory/src/TxtExport.h +++ b/plugins/BasicHistory/src/TxtExport.h @@ -23,7 +23,7 @@ class TxtExport : public IExport
{
public:
- virtual const TCHAR* GetExt()
+ virtual const wchar_t* GetExt()
{
return L"txt";
}
diff --git a/plugins/Boltun/src/Engine/Mind.cpp b/plugins/Boltun/src/Engine/Mind.cpp index f9a46df967..120dbc85ef 100644 --- a/plugins/Boltun/src/Engine/Mind.cpp +++ b/plugins/Boltun/src/Engine/Mind.cpp @@ -22,8 +22,8 @@ using namespace std;
-typedef vector<tstring> string_vec;
-typedef multimap<tstring, tstring> string_mmap;
+typedef vector<wstring> string_vec;
+typedef multimap<wstring, wstring> string_mmap;
Mind::Mind()
{
@@ -58,51 +58,51 @@ Mind& Mind::operator= (const Mind& mind) return *this;
}
-inline void format(tstring& s)
+inline void format(wstring& s)
{
int pos = (int)s.length() - 1;
- if (s[pos] == _T('\r'))
+ if (s[pos] == '\r')
s.resize(pos);
}
-void toLowerStr(TCHAR* ch)
+void toLowerStr(wchar_t* ch)
{
CharLower(ch);
}
-vector<tstring> Mind::Parse(tstring s)
+vector<wstring> Mind::Parse(wstring s)
{
int len = (int)s.length() - 1;
- vector <tstring> res;
- while (len != -1 && _istspace(s[len]))
+ vector <wstring> res;
+ while (len != -1 && iswspace(s[len]))
len--;
if (len < 0)
return res;
s.resize(len);
int it = 0;
while (it != len) {
- while (it != len && _istspace(s[it]))
+ while (it != len && iswspace(s[it]))
it++;
if (it == len)
break;
int start = it;
- while (it != len && !_istspace(s[it]))
+ while (it != len && !iswspace(s[it]))
it++;
res.push_back(s.substr(start, it - start));
}
return res;
}
-void Mind::Load(tstring filename)
+void Mind::Load(wstring filename)
{
- basic_ifstream<TCHAR, char_traits<TCHAR> > file;
+ basic_ifstream<wchar_t, char_traits<wchar_t> > file;
locale ulocale(locale(), new MyCodeCvt);
file.imbue(ulocale);
file.open(filename.c_str(), ios_base::in | ios_base::binary);
- tstring s1, st;
- TCHAR *c, *co = NULL;
+ wstring s1, st;
+ wchar_t *c, *co = NULL;
size_t count;
int error = 0;
int line = 1;
@@ -128,10 +128,10 @@ void Mind::Load(tstring filename) format(st);
count = st.length();
- c = co = new TCHAR[count + 1];
+ c = co = new wchar_t[count + 1];
mir_tstrcpy(c, st.c_str());
size_t pos = 0;
- while (pos < count && _istspace(*c)) {
+ while (pos < count && iswspace(*c)) {
++pos;
++c;
}
@@ -245,9 +245,9 @@ void Mind::Load(tstring filename) toLowerStr(c);
{
std::transform(s1.begin(), s1.end(), s1.begin(), ::tolower);
- vector<tstring> strs = Parse(s1);
+ vector<wstring> strs = Parse(s1);
data->raliases.insert(make_pair(s1, strs));
- for (vector<tstring>::const_iterator it = strs.begin(); it != strs.end(); ++it)
+ for (vector<wstring>::const_iterator it = strs.begin(); it != strs.end(); ++it)
data->aliases.insert(make_pair(*it, s1));
}
break;
@@ -281,9 +281,9 @@ void Mind::Load(tstring filename) }
}
-void Mind::Save(tstring filename) const
+void Mind::Save(wstring filename) const
{
- basic_ofstream<TCHAR, char_traits<TCHAR> > file;
+ basic_ofstream<wchar_t, char_traits<wchar_t> > file;
locale ulocale(locale(), new MyCodeCvt);
file.imbue(ulocale);
@@ -291,61 +291,61 @@ void Mind::Save(tstring filename) const file.open(filename.c_str(), ios_base::out | ios_base::binary);
if (fileTypeMark)
- file << TCHAR(65279);
+ file << wchar_t(65279);
for (string_mmap::iterator it = data->study.begin(); it != data->study.end(); ++it) {
- file << (*it).first << _T('\r') << endl;
- file << (*it).second << _T('\r') << endl;
+ file << (*it).first << '\r' << endl;
+ file << (*it).second << '\r' << endl;
}
- for (multimap<WordsList, tstring>::iterator it = data->keywords.begin(); it != data->keywords.end(); ++it) {
- file << L" (" << (tstring)(*it).first << L")" << _T('\r') << endl;
- file << (*it).second << _T('\r') << endl;
+ for (multimap<WordsList, wstring>::iterator it = data->keywords.begin(); it != data->keywords.end(); ++it) {
+ file << L" (" << (wstring)(*it).first << L")" << '\r' << endl;
+ file << (*it).second << '\r' << endl;
}
- for (multimap<WordsList, tstring>::iterator it = data->qkeywords.begin(); it != data->qkeywords.end(); ++it) {
- file << L" (" << (tstring)(*it).first << L")" << _T('\r') << endl;
- file << (*it).second << _T('\r') << endl;
+ for (multimap<WordsList, wstring>::iterator it = data->qkeywords.begin(); it != data->qkeywords.end(); ++it) {
+ file << L" (" << (wstring)(*it).first << L")" << '\r' << endl;
+ file << (*it).second << '\r' << endl;
}
- for (multimap<WordsList, tstring>::iterator it = data->specialEscapes.begin(); it != data->specialEscapes.end(); ++it) {
- file << L" {" << (tstring)(*it).first << L"}" << _T('\r') << endl;
- file << (*it).second << _T('\r') << endl;
+ for (multimap<WordsList, wstring>::iterator it = data->specialEscapes.begin(); it != data->specialEscapes.end(); ++it) {
+ file << L" {" << (wstring)(*it).first << L"}" << '\r' << endl;
+ file << (*it).second << '\r' << endl;
}
- for (multimap<WordsList, tstring>::iterator it = data->qspecialEscapes.begin(); it != data->qspecialEscapes.end(); ++it) {
- file << L" {" << (tstring)(*it).first << L"}" << _T('\r') << endl;
- file << (*it).second << _T('\r') << endl;
+ for (multimap<WordsList, wstring>::iterator it = data->qspecialEscapes.begin(); it != data->qspecialEscapes.end(); ++it) {
+ file << L" {" << (wstring)(*it).first << L"}" << '\r' << endl;
+ file << (*it).second << '\r' << endl;
}
for (string_mmap::iterator it = data->widelyUsed.begin(); it != data->widelyUsed.end(); ++it) {
- file << L" [" << (*it).first << L"]" << _T('\r') << endl;
- file << (*it).second << _T('\r') << endl;
+ file << L" [" << (*it).first << L"]" << '\r' << endl;
+ file << (*it).second << '\r' << endl;
}
- for (set<tstring>::iterator it = data->question.begin(); it != data->question.end(); ++it) {
- file << L" <QUESTION>" << _T('\r') << endl;
- file << (*it) << _T('\r') << endl;
+ for (set<wstring>::iterator it = data->question.begin(); it != data->question.end(); ++it) {
+ file << L" <QUESTION>" << '\r' << endl;
+ file << (*it) << '\r' << endl;
}
- for (set<tstring>::iterator it = data->special.begin(); it != data->special.end(); ++it) {
- file << L" <IGNORED>" << _T('\r') << endl;
- file << (*it) << _T('\r') << endl;
+ for (set<wstring>::iterator it = data->special.begin(); it != data->special.end(); ++it) {
+ file << L" <IGNORED>" << '\r' << endl;
+ file << (*it) << '\r' << endl;
}
for (string_vec::iterator it = data->escape.begin(); it != data->escape.end(); ++it) {
- file << L" <ESCAPE>" << _T('\r') << endl;
- file << (*it) << _T('\r') << endl;
+ file << L" <ESCAPE>" << '\r' << endl;
+ file << (*it) << '\r' << endl;
}
for (string_vec::iterator it = data->initial.begin(); it != data->initial.end(); ++it) {
- file << L" <INITIAL>" << _T('\r') << endl;
- file << (*it) << _T('\r') << endl;
+ file << L" <INITIAL>" << '\r' << endl;
+ file << (*it) << '\r' << endl;
}
for (string_vec::iterator it = data->failure.begin(); it != data->failure.end(); ++it) {
- file << L" <FAILURE>" << _T('\r') << endl;
- file << (*it) << _T('\r') << endl;
+ file << L" <FAILURE>" << '\r' << endl;
+ file << (*it) << '\r' << endl;
}
for (string_vec::iterator it = data->repeats.begin(); it != data->repeats.end(); ++it) {
- file << L" <REPEAT>" << _T('\r') << endl;
- file << (*it) << _T('\r') << endl;
+ file << L" <REPEAT>" << '\r' << endl;
+ file << (*it) << '\r' << endl;
}
- for (map<tstring, vector<tstring>>::const_iterator it = data->raliases.begin(); it != data->raliases.end(); ++it) {
- tstring s;
- const vector<tstring>& v = (*it).second;
+ for (map<wstring, vector<wstring>>::const_iterator it = data->raliases.begin(); it != data->raliases.end(); ++it) {
+ wstring s;
+ const vector<wstring>& v = (*it).second;
bool first = true;
- for (vector<tstring>::const_iterator it1 = v.begin(); it1 != v.end(); ++it1) {
+ for (vector<wstring>::const_iterator it1 = v.begin(); it1 != v.end(); ++it1) {
if (first) {
first = false;
s = *it1;
@@ -354,17 +354,17 @@ void Mind::Save(tstring filename) const s += L" " + *it1;
}
}
- file << _T('@') << (*it).first << _T('\r') << endl;
- file << s << _T('\r') << endl;
+ file << '@' << (*it).first << '\r' << endl;
+ file << s << '\r' << endl;
}
}
-void Mind::LoadSmiles(tstring filename)
+void Mind::LoadSmiles(wstring filename)
{
- basic_ifstream<TCHAR, char_traits<TCHAR> > file;
+ basic_ifstream<wchar_t, char_traits<wchar_t> > file;
file.open(filename.c_str());
data->smiles.clear();
- tstring s;
+ wstring s;
unsigned int l = 0;
while (!file.eof()) {
getline(file, s);
@@ -378,14 +378,14 @@ void Mind::LoadSmiles(tstring filename) void Mind::LoadSmiles(void *smiles, size_t size)
{
data->smiles.clear();
- TCHAR* buf = (TCHAR*)smiles;
+ wchar_t* buf = (wchar_t*)smiles;
unsigned l = 0;
- TCHAR* end = buf + size;
+ wchar_t* end = buf + size;
while (buf != end) {
- TCHAR *lend = buf;
- while (lend != end && *lend != _T('\r'))
+ wchar_t *lend = buf;
+ while (lend != end && *lend != '\r')
lend++;
- tstring s(buf, lend - buf);
+ wstring s(buf, lend - buf);
if ((unsigned)(lend - buf) > l)
l = (int)s.length();
data->smiles.insert(s);
diff --git a/plugins/Boltun/src/Engine/Mind.h b/plugins/Boltun/src/Engine/Mind.h index d11eb6cd78..2b93c5fdcb 100644 --- a/plugins/Boltun/src/Engine/Mind.h +++ b/plugins/Boltun/src/Engine/Mind.h @@ -31,22 +31,22 @@ class Mind; typedef struct
{
friend class Mind;
- std::vector<std::tstring> initial;
- std::set<std::tstring> question;
- std::set<std::tstring> special;
- std::vector<std::tstring> escape;
- std::vector<std::tstring> failure;
- std::vector<std::tstring> repeats;
+ std::vector<std::wstring> initial;
+ std::set<std::wstring> question;
+ std::set<std::wstring> special;
+ std::vector<std::wstring> escape;
+ std::vector<std::wstring> failure;
+ std::vector<std::wstring> repeats;
unsigned int maxSmileLen;
- std::set<std::tstring> smiles;
- std::multimap<WordsList, std::tstring> keywords;
- std::multimap<WordsList, std::tstring> qkeywords;
- std::multimap<std::tstring, std::tstring> widelyUsed;
- std::multimap<WordsList, std::tstring> specialEscapes;
- std::multimap<WordsList, std::tstring> qspecialEscapes;
- std::multimap<std::tstring, std::tstring> study;
- std::map<std::tstring, std::tstring> aliases;
- std::map<std::tstring, std::vector<std::tstring>> raliases;
+ std::set<std::wstring> smiles;
+ std::multimap<WordsList, std::wstring> keywords;
+ std::multimap<WordsList, std::wstring> qkeywords;
+ std::multimap<std::wstring, std::wstring> widelyUsed;
+ std::multimap<WordsList, std::wstring> specialEscapes;
+ std::multimap<WordsList, std::wstring> qspecialEscapes;
+ std::multimap<std::wstring, std::wstring> study;
+ std::map<std::wstring, std::wstring> aliases;
+ std::map<std::wstring, std::vector<std::wstring>> raliases;
private:
int referenceCount;
} MindData;
@@ -57,7 +57,7 @@ private: MindData *data;
bool fileTypeMark;
- std::vector<std::tstring> Parse(std::tstring s);
+ std::vector<std::wstring> Parse(std::wstring s);
public:
Mind();
~Mind();
@@ -75,9 +75,9 @@ public: };
const MindData *GetData() const;
- void Load(std::tstring filename);
- void Save(std::tstring filename) const;
- void LoadSmiles(std::tstring filename);
+ void Load(std::wstring filename);
+ void Save(std::wstring filename) const;
+ void LoadSmiles(std::wstring filename);
void LoadSmiles(void* smiles, size_t size);
};
diff --git a/plugins/Boltun/src/Engine/TalkEngine.cpp b/plugins/Boltun/src/Engine/TalkEngine.cpp index c5cc859bb3..0f53403003 100644 --- a/plugins/Boltun/src/Engine/TalkEngine.cpp +++ b/plugins/Boltun/src/Engine/TalkEngine.cpp @@ -33,12 +33,12 @@ //#define EXCLUDE_SPECIAL_WORDS
#ifdef DEBUG_SHOW_VARIANTS
-extern void AddBotMessage(tstring s);
+extern void AddBotMessage(wstring s);
#endif
using namespace std;
-void TalkBot::UpdateStartChar(tstring &str)
+void TalkBot::UpdateStartChar(wstring &str)
{
if (!makeLowercase)
return;
@@ -46,21 +46,21 @@ void TalkBot::UpdateStartChar(tstring &str) size_t l = str.length();
if (l) {
// Answers starting with ' ' must remain unchanged.
- if (str[0] == _T(' ')) {
+ if (str[0] == ' ') {
str = str.substr(1);
return;
}
- TCHAR *strl = NEWTSTR_ALLOCA(str.c_str()), *stru = NEWTSTR_ALLOCA(str.c_str());
+ wchar_t *strl = NEWWSTR_ALLOCA(str.c_str()), *stru = NEWWSTR_ALLOCA(str.c_str());
CharLower(strl);
CharUpper(stru);
for (size_t i = 0; i < l; i++) {
- TCHAR cl = strl[i];
- TCHAR cu = stru[i];
+ wchar_t cl = strl[i];
+ wchar_t cu = stru[i];
if (i != l - 1) {
// Do not react to BLONDE ANSWERS
- TCHAR ncl = strl[i+1];
- TCHAR ncu = stru[i+1];
+ wchar_t ncl = strl[i+1];
+ wchar_t ncu = stru[i+1];
if (ncl != ncu && str[i+1] == ncu)
break;
}
@@ -84,27 +84,27 @@ TalkBot::~TalkBot() delete contactDatas;
}
-tstring TalkBot::GetInitMessage(MCONTACT contact)
+wstring TalkBot::GetInitMessage(MCONTACT contact)
{
ContactData* d = contactDatas->GetData(contact);
- tstring s = d->initial.GetString();
+ wstring s = d->initial.GetString();
contactDatas->PutData(contact);
return s;
}
-tstring TalkBot::ReplaceAliases(const tstring &message)
+wstring TalkBot::ReplaceAliases(const wstring &message)
{
- const TCHAR dividers[] = L" \t\n\r,./?\\|;:'\"~!#^&*()_-+=[{]}—\1";
- tstring sentence = message;
- tstring result;
- map<size_t, tstring> sm;
+ const wchar_t dividers[] = L" \t\n\r,./?\\|;:'\"~!#^&*()_-+=[{]}—\1";
+ wstring sentence = message;
+ wstring result;
+ map<size_t, wstring> sm;
//Find smiles
for (size_t i = 0; i < sentence.length() - 1; i++) {
unsigned max = (int)(sentence.length() - i);
if (max > mind.GetData()->maxSmileLen)
max = mind.GetData()->maxSmileLen;
for (unsigned j = max; j > 0; j--) {
- tstring item = sentence.substr(i, j);
+ wstring item = sentence.substr(i, j);
if (mind.GetData()->smiles.find(item) != mind.GetData()->smiles.end()) {
sm[i] = item;
sentence.replace(i, j, L"\1");
@@ -116,10 +116,10 @@ tstring TalkBot::ReplaceAliases(const tstring &message) bool hadQuestionSigns = false;
int it = 0;
while (it != len) {
- while (it != len && _tcschr(dividers, sentence[it])) {
- if (sentence[it] == _T('?'))
+ while (it != len && wcschr(dividers, sentence[it])) {
+ if (sentence[it] == '?')
hadQuestionSigns = true;
- map<size_t, tstring>::iterator smit;
+ map<size_t, wstring>::iterator smit;
if (sentence[it] == '\1') {
smit = sm.find(it);
result.append((*smit).second);
@@ -132,17 +132,17 @@ tstring TalkBot::ReplaceAliases(const tstring &message) break;
int start = it;
while (true) {
- while (it != len && !_tcschr(dividers, sentence[it]))
+ while (it != len && !wcschr(dividers, sentence[it]))
it++;
- if (it == len || sentence[it] != _T('-'))
+ if (it == len || sentence[it] != '-')
break;
//If we have-a-word-with-minus, we shouldn't split it
- if (_tcschr(dividers, sentence[it + 1]))
+ if (wcschr(dividers, sentence[it + 1]))
break;
it += 2;
}
- tstring str = sentence.substr(start, it - start);
- map<tstring, tstring>::const_iterator al = mind.GetData()->aliases.find(str);
+ wstring str = sentence.substr(start, it - start);
+ map<wstring, wstring>::const_iterator al = mind.GetData()->aliases.find(str);
if (al != mind.GetData()->aliases.end())
result.append((*al).second);
else
@@ -151,9 +151,9 @@ tstring TalkBot::ReplaceAliases(const tstring &message) return result;
}
-tstring TalkBot::AllReplies(const tstring &incomingMessage, ContactData *contactData, Level &maxValue, std::multimap<Level, tstring> &mm)
+wstring TalkBot::AllReplies(const wstring &incomingMessage, ContactData *contactData, Level &maxValue, std::multimap<Level, wstring> &mm)
{
- tstring res;
+ wstring res;
//Part 1
if (FindExact(contactData, incomingMessage, mind.GetData()->widelyUsed, res)) //widelyUsed
{
@@ -170,7 +170,7 @@ tstring TalkBot::AllReplies(const tstring &incomingMessage, ContactData *contact maxValue = LOOKSLIKE;
}
//Part 3
- vector<tstring> sentences;
+ vector<wstring> sentences;
SplitSectences(incomingMessage, sentences);
ValueChooser<> ch(sentences, true); //Using random order of sentences.
while ((res = ch.GetString()) != L"") {
@@ -197,7 +197,7 @@ tstring TalkBot::AllReplies(const tstring &incomingMessage, ContactData *contact maxValue = LOOKSLIKE;
}
//Part 6
- vector<tstring> keywords, otherwords;
+ vector<wstring> keywords, otherwords;
bool isQuestion;
SplitAndSortWords(res, keywords, otherwords, isQuestion);
//Part 7, 8
@@ -258,12 +258,12 @@ tstring TalkBot::AllReplies(const tstring &incomingMessage, ContactData *contact maxValue = FAIL;
}
}
- return tstring();
+ return wstring();
}
-TalkBot::MessageInfo* TalkBot::Reply(MCONTACT contact, tstring incomingMessage, bool saveChoice)
+TalkBot::MessageInfo* TalkBot::Reply(MCONTACT contact, wstring incomingMessage, bool saveChoice)
{
- TCHAR* str = new TCHAR[incomingMessage.length() + 1];
+ wchar_t* str = new wchar_t[incomingMessage.length() + 1];
mir_tstrcpy(str, incomingMessage.c_str());
CharLower(str);
incomingMessage = str;
@@ -274,8 +274,8 @@ TalkBot::MessageInfo* TalkBot::Reply(MCONTACT contact, tstring incomingMessage, MessageInfo *info;
//only 2-3 repeats
if (contactData->repeatCount < 2 || contactData->repeatCount == 2 && (rand() % 2)) {
- const vector<tstring>& v = mind.GetData()->repeats;
- tstring res = v[rand() % v.size()];
+ const vector<wstring>& v = mind.GetData()->repeats;
+ wstring res = v[rand() % v.size()];
#ifdef DEBUG_PREFIXES
info = new MessageInfo(incomingMessage, L"(repeat_norm) " + res);
#else
@@ -294,10 +294,10 @@ TalkBot::MessageInfo* TalkBot::Reply(MCONTACT contact, tstring incomingMessage, return info;
}
- multimap<Level, tstring> mm;
+ multimap<Level, wstring> mm;
Level maxValue = NOTHING;
- tstring res = AllReplies(incomingMessage, contactData, maxValue, mm);
+ wstring res = AllReplies(incomingMessage, contactData, maxValue, mm);
if (!res.empty()) {
UpdateStartChar(res);
#ifdef DEBUG_PREFIXES
@@ -328,7 +328,7 @@ TalkBot::MessageInfo* TalkBot::Reply(MCONTACT contact, tstring incomingMessage, }
//Also does Part 12
- tstring final = ChooseResult(contactData, maxValue, mm);
+ wstring final = ChooseResult(contactData, maxValue, mm);
MessageInfo *info = new MessageInfo(incomingMessage, final);
UpdateStartChar(final);
if (saveChoice)
@@ -337,14 +337,14 @@ TalkBot::MessageInfo* TalkBot::Reply(MCONTACT contact, tstring incomingMessage, return info;
}
-bool TalkBot::FindExact(ContactData *contactData, const tstring &incomingMessage,
- const multimap<tstring, tstring>& map, tstring& res)
+bool TalkBot::FindExact(ContactData *contactData, const wstring &incomingMessage,
+ const multimap<wstring, wstring> &map, wstring &res)
{
int max = (int)map.count(incomingMessage);
if (!max) {
- TCHAR c = incomingMessage[incomingMessage.length() - 1];
- if (c != _T('?') && c != _T('.') && c != _T('!'))
- return FindExact(contactData, incomingMessage + _T('.'), map, res);
+ wchar_t c = incomingMessage[incomingMessage.length() - 1];
+ if (c != '?' && c != '.' && c != '!')
+ return FindExact(contactData, incomingMessage + L'.', map, res);
return false;
}
pair<mm_cit, mm_cit> range = map.equal_range(incomingMessage);
@@ -372,7 +372,7 @@ void TalkBot::RecordAnswer(ContactData *contactData, const TalkBot::MessageInfo& contactData->lastMessage = info.Question;
}
-bool TalkBot::FindAny(ValueChooser<> &ch, tstring& res)
+bool TalkBot::FindAny(ValueChooser<> &ch, wstring& res)
{
if (!ch.GetContainer().size())
return false;
@@ -380,23 +380,23 @@ bool TalkBot::FindAny(ValueChooser<> &ch, tstring& res) return true;
}
-void TalkBot::SplitSectences(const tstring &incomingMessage, vector<tstring>& vec)
+void TalkBot::SplitSectences(const wstring &incomingMessage, vector<wstring>& vec)
{
//FIXME: (THINK ABOUT IT:-))these chars not always mark the end of sentence.
- const TCHAR symbols[] = L".?!";
+ const wchar_t symbols[] = L".?!";
int it = 0, len = (int)incomingMessage.length();
while (it != len) {
- while (it != len && _istspace(incomingMessage[it]))
+ while (it != len && iswspace(incomingMessage[it]))
it++;
int start = it;
while (it != len) {
- if (_tcschr(symbols, incomingMessage[it++])) {
+ if (wcschr(symbols, incomingMessage[it++])) {
//Test for a :-! smile
- if (it > 2 && incomingMessage[it - 1] == _T('!')
- && incomingMessage[it - 2] == _T('-')
- && incomingMessage[it - 3] == _T(':'))
+ if (it > 2 && incomingMessage[it - 1] == '!'
+ && incomingMessage[it - 2] == '-'
+ && incomingMessage[it - 3] == ':')
continue;
- while (it != len && _tcschr(symbols, incomingMessage[it]))
+ while (it != len && wcschr(symbols, incomingMessage[it]))
it++;
break;
}
@@ -406,9 +406,9 @@ void TalkBot::SplitSectences(const tstring &incomingMessage, vector<tstring>& ve }
#ifdef _DEBUG
-tstring LevelToStr(TalkBot::Level target)
+wstring LevelToStr(TalkBot::Level target)
{
- tstring lev;
+ wstring lev;
switch (target) {
case TalkBot::BEST: lev = L"BEST(0)"; break;
case TalkBot::LOOKSLIKE: lev = L"LOOKSLIKE(1)"; break;
@@ -420,41 +420,41 @@ tstring LevelToStr(TalkBot::Level target) }
#endif
-tstring TalkBot::ChooseResult(ContactData *contactData, Level maxValue, const multimap<Level, tstring> &mm)
+wstring TalkBot::ChooseResult(ContactData *contactData, Level maxValue, const multimap<Level, wstring> &mm)
{
#ifdef DEBUG_SHOW_VARIANTS
AddBotMessage(L">>Availabe:");
- for (multimap<Level, tstring>::iterator it = mm.begin(); it != mm.end(); it++)
+ for (multimap<Level, wstring>::iterator it = mm.begin(); it != mm.end(); it++)
AddBotMessage(LevelToStr((*it).first) + L": " + (*it).second);
AddBotMessage(L">>Result:");
#endif
if (maxValue == NOTHING)
return L"";
Level target = maxValue;
- typedef multimap<Level, tstring>::const_iterator lt_cit;
+ typedef multimap<Level, wstring>::const_iterator lt_cit;
pair<lt_cit, lt_cit> range = mm.equal_range(target);
for (lt_cit it = range.first; it != range.second; ++it)
contactData->chooser.AddChoice((*it).second);
#ifdef DEBUG_SHOW_LEVEL
- tstring lev = LevelToStr(target);
+ wstring lev = LevelToStr(target);
return lev + L": " + contactData->chooser.Choose();
#else
return contactData->chooser.Choose();
#endif
}
-void TalkBot::FindByKeywords(ContactData *contactData, const vector<tstring> &keywords, tstring& res/*, tstring& ures*/,
+void TalkBot::FindByKeywords(ContactData *contactData, const vector<wstring> &keywords, wstring& res/*, wstring& ures*/,
bool isQuestion)
{
if (keywords.size() == 0)
return;
- const multimap<WordsList, tstring> &keys = isQuestion ? mind.GetData()->qkeywords :
+ const multimap<WordsList, wstring> &keys = isQuestion ? mind.GetData()->qkeywords :
mind.GetData()->keywords;
- for (multimap<WordsList, tstring>::const_iterator it = keys.begin(); it != keys.end(); ++it) {
+ for (multimap<WordsList, wstring>::const_iterator it = keys.begin(); it != keys.end(); ++it) {
float prio;
if ((*it).first.MatchesAll(keywords/*, strict*/, prio))
#ifdef DEBUG_SHOW_SOLUTION_REASON
- contactData->chooser.AddChoice((tstring)(*it).first + L": - " + (*it).second, prio);
+ contactData->chooser.AddChoice((wstring)(*it).first + L": - " + (*it).second, prio);
#else
contactData->chooser.AddChoice((*it).second, prio);
#endif
@@ -462,16 +462,16 @@ void TalkBot::FindByKeywords(ContactData *contactData, const vector<tstring> &ke res = contactData->chooser.Choose();
}
-bool TalkBot::FindByOthers(ContactData *contactData, const vector<tstring> &otherwords, tstring& res, bool isQuestion)
+bool TalkBot::FindByOthers(ContactData *contactData, const vector<wstring> &otherwords, wstring& res, bool isQuestion)
{
- //vector<tstring> results;
- const multimap<WordsList, tstring> &specs = isQuestion ? mind.GetData()->qspecialEscapes :
+ //vector<wstring> results;
+ const multimap<WordsList, wstring> &specs = isQuestion ? mind.GetData()->qspecialEscapes :
mind.GetData()->specialEscapes;
- for (multimap<WordsList, tstring>::const_iterator it = specs.begin();
+ for (multimap<WordsList, wstring>::const_iterator it = specs.begin();
it != specs.end(); ++it)
if ((*it).first.MatchesAny(otherwords)) {
#ifdef DEBUG_SHOW_SOLUTION_REASON
- contactData->chooser.AddChoice((tstring)(*it).first + L": - " + (*it).second);
+ contactData->chooser.AddChoice((wstring)(*it).first + L": - " + (*it).second);
#else
contactData->chooser.AddChoice((*it).second);
#endif
@@ -487,20 +487,20 @@ const Mind& TalkBot::GetMind() const return mind;
}
-void TalkBot::SplitAndSortWords(tstring sentence, vector<tstring>& keywords,
- vector<tstring>& otherwords, bool& isQuestion)
+void TalkBot::SplitAndSortWords(wstring sentence, vector<wstring>& keywords,
+ vector<wstring>& otherwords, bool& isQuestion)
{
- const TCHAR dividers[] = L" \t\n\r,./?\\|;:'\"~!#^&*()_-+=[{]}—";
+ const wchar_t dividers[] = L" \t\n\r,./?\\|;:'\"~!#^&*()_-+=[{]}—";
int len = (int)sentence.length();
- vector<tstring> words;
- map<size_t, tstring> sm;
+ vector<wstring> words;
+ map<size_t, wstring> sm;
//Find smiles
for (size_t i = 0; i < sentence.length() - 1; i++) {
unsigned max = (int)(sentence.length() - i);
if (max > mind.GetData()->maxSmileLen)
max = mind.GetData()->maxSmileLen;
for (unsigned j = max; j > 0; j--) {
- tstring item = sentence.substr(i, j);
+ wstring item = sentence.substr(i, j);
if (mind.GetData()->smiles.find(item)
!= mind.GetData()->smiles.end()) {
sm[i] = item;
@@ -512,11 +512,11 @@ void TalkBot::SplitAndSortWords(tstring sentence, vector<tstring>& keywords, len = (int)sentence.length();
bool hadQuestionSigns = false;
for (int it = 0; it != len;) {
- while (it != len && _tcschr(dividers, sentence[it])) {
- if (sentence[it] == _T('?'))
+ while (it != len && wcschr(dividers, sentence[it])) {
+ if (sentence[it] == '?')
hadQuestionSigns = true;
- map<size_t, tstring>::iterator smit;
- if (_istspace(sentence[it]) && (smit = sm.find(it)) != sm.end())
+ map<size_t, wstring>::iterator smit;
+ if (iswspace(sentence[it]) && (smit = sm.find(it)) != sm.end())
words.push_back((*smit).second);
it++;
}
@@ -526,20 +526,20 @@ void TalkBot::SplitAndSortWords(tstring sentence, vector<tstring>& keywords, hadQuestionSigns = false;
int start = it;
while (true) {
- while (it != len && !_tcschr(dividers, sentence[it]))
+ while (it != len && !wcschr(dividers, sentence[it]))
it++;
- if (it == len || sentence[it] != _T('-'))
+ if (it == len || sentence[it] != '-')
break;
// If we have-a-word-with-minus, we shouldn't split it
- if (_tcschr(dividers, sentence[it + 1]))
+ if (wcschr(dividers, sentence[it + 1]))
break;
it += 2;
}
- tstring str = sentence.substr(start, it - start);
+ wstring str = sentence.substr(start, it - start);
words.push_back(str);
}
isQuestion = hadQuestionSigns;
- for (vector<tstring>::iterator it = words.begin(); it != words.end(); ++it) {
+ for (vector<wstring>::iterator it = words.begin(); it != words.end(); ++it) {
if (!isQuestion)
if (mind.GetData()->question.find(*it) != mind.GetData()->question.end())
isQuestion = true;
diff --git a/plugins/Boltun/src/Engine/TalkEngine.h b/plugins/Boltun/src/Engine/TalkEngine.h index c18f3df1c1..7e0539c9e6 100644 --- a/plugins/Boltun/src/Engine/TalkEngine.h +++ b/plugins/Boltun/src/Engine/TalkEngine.h @@ -34,14 +34,14 @@ public: struct MessageInfo
{
private:
- std::tstring Question;
- MessageInfo(std::tstring q, std::tstring a)
+ std::wstring Question;
+ MessageInfo(std::wstring q, std::wstring a)
:Question(q), Answer(a)
{
}
public:
- std::tstring Answer;
- MessageInfo(std::tstring q)
+ std::wstring Answer;
+ MessageInfo(std::wstring q)
:Question(q)
{
}
@@ -52,17 +52,17 @@ private: {
BEST, LOOKSLIKE/*, LOOKSLIKE2*/, BAD, FAIL, NOTHING
} Level;
- friend std::tstring LevelToStr(TalkBot::Level target);
+ friend std::wstring LevelToStr(TalkBot::Level target);
struct ContactData
{
ValueChooser<> initial;
- //ValueChooser<std::set<std::tstring> > question;
- //ValueChooser<std::set<std::tstring> > special;
+ //ValueChooser<std::set<std::wstring> > question;
+ //ValueChooser<std::set<std::wstring> > special;
ValueChooser<> escape;
ValueChooser<> failure;
UnRecentChooser chooser;
- std::tstring lastMessage;
+ std::wstring lastMessage;
long long lastMessageTime;
int repeatCount;
inline ContactData(const Mind& mind)
@@ -81,22 +81,22 @@ private: bool beSilent;
bool makeLowercase;
bool understandAlways;
- void UpdateStartChar(std::tstring &str);
- typedef std::multimap<std::tstring, std::tstring>::const_iterator mm_cit;
- bool FindExact(ContactData *contactData, const std::tstring &incomingMessage, const std::multimap<std::tstring, std::tstring> &map, std::tstring &res);
- bool FindAny(ValueChooser<> &ch, std::tstring &res);
- void FindByKeywords(ContactData *contactData, const std::vector<std::tstring> &keywords, std::tstring &res/*, std::tstring& ures*/, bool isQuestion);
- bool FindByOthers(ContactData *contactData, const std::vector<std::tstring> &otherwords, std::tstring &res, bool isQuestion);
- std::tstring AllReplies(const std::tstring &incomingMessage, ContactData *contactData, Level &maxValue, std::multimap<Level, std::tstring> &mm);
- std::tstring ReplaceAliases(const std::tstring &message);
- std::tstring ChooseResult(ContactData *contactData, Level maxValue, const std::multimap<Level, std::tstring> &mm);
+ void UpdateStartChar(std::wstring &str);
+ typedef std::multimap<std::wstring, std::wstring>::const_iterator mm_cit;
+ bool FindExact(ContactData *contactData, const std::wstring &incomingMessage, const std::multimap<std::wstring, std::wstring> &map, std::wstring &res);
+ bool FindAny(ValueChooser<> &ch, std::wstring &res);
+ void FindByKeywords(ContactData *contactData, const std::vector<std::wstring> &keywords, std::wstring &res/*, std::wstring& ures*/, bool isQuestion);
+ bool FindByOthers(ContactData *contactData, const std::vector<std::wstring> &otherwords, std::wstring &res, bool isQuestion);
+ std::wstring AllReplies(const std::wstring &incomingMessage, ContactData *contactData, Level &maxValue, std::multimap<Level, std::wstring> &mm);
+ std::wstring ReplaceAliases(const std::wstring &message);
+ std::wstring ChooseResult(ContactData *contactData, Level maxValue, const std::multimap<Level, std::wstring> &mm);
void RecordAnswer(ContactData *contactData, const TalkBot::MessageInfo &info);
#ifdef _DEBUG
public:
#endif
- void SplitSectences(const std::tstring &incomingMessage, std::vector<std::tstring> &vec);
- void SplitAndSortWords(std::tstring sentence, std::vector<std::tstring> &keywords,
- std::vector<std::tstring>& otherwords, bool& isQuestion);
+ void SplitSectences(const std::wstring &incomingMessage, std::vector<std::wstring> &vec);
+ void SplitAndSortWords(std::wstring sentence, std::vector<std::wstring> &keywords,
+ std::vector<std::wstring>& otherwords, bool& isQuestion);
public:
TalkBot(const Mind& goodMind);
~TalkBot();
@@ -105,8 +105,8 @@ public: void SetLowercase(const bool isLowercase);
void SetUnderstandAlways(const bool understandAlways);
//const MindData *GetData();
- std::tstring GetInitMessage(MCONTACT contact);
- MessageInfo* Reply(MCONTACT contact, const std::tstring incomingMessage, bool saveChoice);
+ std::wstring GetInitMessage(MCONTACT contact);
+ MessageInfo* Reply(MCONTACT contact, const std::wstring incomingMessage, bool saveChoice);
void AnswerGiven(MCONTACT contact, const MessageInfo &info);
};
diff --git a/plugins/Boltun/src/Engine/UnrecentChooser.cpp b/plugins/Boltun/src/Engine/UnrecentChooser.cpp index b0b5e1460e..761adf10c4 100644 --- a/plugins/Boltun/src/Engine/UnrecentChooser.cpp +++ b/plugins/Boltun/src/Engine/UnrecentChooser.cpp @@ -27,7 +27,7 @@ UnRecentChooser::UnRecentChooser() {
}
-void UnRecentChooser::AddChoice(tstring value, float prio)
+void UnRecentChooser::AddChoice(wstring value, float prio)
{
if (items.count(value) != 0)
{
@@ -49,9 +49,9 @@ void UnRecentChooser::AddChoice(tstring value, float prio) }
}
-tstring UnRecentChooser::Choose()
+wstring UnRecentChooser::Choose()
{
- tstring res;
+ wstring res;
//Find answer
if (newItemsPrio != -1)
{
@@ -78,12 +78,12 @@ tstring UnRecentChooser::Choose() return res;
}
-void UnRecentChooser::SaveChoice(tstring choice)
+void UnRecentChooser::SaveChoice(wstring choice)
{
//Add answer
if (items.find(choice) != items.end())
{
- for (vector<tstring>::iterator it = itemsList.begin(); it != itemsList.end(); ++it)
+ for (vector<wstring>::iterator it = itemsList.begin(); it != itemsList.end(); ++it)
if (*it == choice)
{
itemsList.erase(it);
diff --git a/plugins/Boltun/src/Engine/UnrecentChooser.h b/plugins/Boltun/src/Engine/UnrecentChooser.h index 72245773de..ff82faf628 100644 --- a/plugins/Boltun/src/Engine/UnrecentChooser.h +++ b/plugins/Boltun/src/Engine/UnrecentChooser.h @@ -23,20 +23,20 @@ class UnRecentChooser
{
- std::map<std::tstring, size_t> items;
- std::vector<std::tstring> itemsList;
- std::vector<std::tstring> newItems;
+ std::map<std::wstring, size_t> items;
+ std::vector<std::wstring> itemsList;
+ std::vector<std::wstring> newItems;
float newItemsPrio, maxOldPrio;
- std::map<size_t, std::tstring> oldItems;
- std::map<std::tstring, float> oldPrios;
+ std::map<size_t, std::wstring> oldItems;
+ std::map<std::wstring, float> oldPrios;
size_t last;
int minimum;
static const size_t maxItems = 100;
public:
UnRecentChooser();
- void AddChoice(std::tstring value, float prio = 1.0);
- std::tstring Choose();
- void SaveChoice(std::tstring choice);
+ void AddChoice(std::wstring value, float prio = 1.0);
+ std::wstring Choose();
+ void SaveChoice(std::wstring choice);
};
#endif /* UnRecentChooserH */
\ No newline at end of file diff --git a/plugins/Boltun/src/Engine/ValueChooser.h b/plugins/Boltun/src/Engine/ValueChooser.h index f82ceecbea..b65db2acea 100644 --- a/plugins/Boltun/src/Engine/ValueChooser.h +++ b/plugins/Boltun/src/Engine/ValueChooser.h @@ -21,7 +21,7 @@ #ifndef StringChooserH
#define StringChooserH
-template<class container = std::vector<std::tstring> >
+template<class container = std::vector<std::wstring> >
class ValueChooser
{
private:
diff --git a/plugins/Boltun/src/Engine/WordsList.cpp b/plugins/Boltun/src/Engine/WordsList.cpp index b111cc3414..1efbdebc20 100644 --- a/plugins/Boltun/src/Engine/WordsList.cpp +++ b/plugins/Boltun/src/Engine/WordsList.cpp @@ -22,17 +22,17 @@ using namespace std;
-WordsList::WordsList(const tstring &data/*, bool allowUnstrict*/)
+WordsList::WordsList(const wstring &data/*, bool allowUnstrict*/)
{
Parse(data/*, allowUnstrict*/);
}
-WordsList::operator tstring() const
+WordsList::operator wstring() const
{
- tstring res;
+ wstring res;
//if (unstrict)
// res = L"~";
- set<tstring>::const_iterator it = words.begin();
+ set<wstring>::const_iterator it = words.begin();
if (!words.empty())
while (true)
{
@@ -47,16 +47,16 @@ WordsList::operator tstring() const return res;
}
-WordsList& WordsList::operator= (const tstring& s)
+WordsList& WordsList::operator= (const wstring& s)
{
Parse(s);
return *this;
};
-void WordsList::Parse(tstring s/*, bool allowUnstrict*/)
+void WordsList::Parse(wstring s/*, bool allowUnstrict*/)
{
isQuestion = false;
- /*if (allowUnstrict && s.length() && s[0] == _T('~'))
+ /*if (allowUnstrict && s.length() && s[0] == '~')
{
s = s.substr(1, s.npos);
unstrict = true;
@@ -64,7 +64,7 @@ void WordsList::Parse(tstring s/*, bool allowUnstrict*/) else
unstrict = false;*/
int len = (int)s.length() - 1;
- while (len != -1 && _istspace(s[len]))
+ while (len != -1 && iswspace(s[len]))
len--;
if (len < 0)
return;
@@ -77,22 +77,22 @@ void WordsList::Parse(tstring s/*, bool allowUnstrict*/) int it = 0;
while (it != len)
{
- while (it != len && _istspace(s[it]))
+ while (it != len && iswspace(s[it]))
it++;
if (it == len)
break;
int start = it;
- while (it != len && !_istspace(s[it]))
+ while (it != len && !iswspace(s[it]))
it++;
words.insert(s.substr(start, it - start));
}
}
-bool WordsList::MatchesAll(const vector<tstring>& s/*, bool& WasStrict*/, float& priority) const
+bool WordsList::MatchesAll(const vector<wstring>& s/*, bool& WasStrict*/, float& priority) const
{
- std::set<tstring> temp;
+ std::set<wstring> temp;
//WasStrict = true;
- for (vector<tstring>::const_iterator it = s.begin(); it != s.end(); ++it)
+ for (vector<wstring>::const_iterator it = s.begin(); it != s.end(); ++it)
{
/* if (words.find(*it) == words.end())
if (unstrict)
@@ -112,27 +112,27 @@ bool WordsList::MatchesAll(const vector<tstring>& s/*, bool& WasStrict*/, float& return temp.size() == words.size();
}
-bool WordsList::MatchesAny(const vector<tstring>& s) const
+bool WordsList::MatchesAny(const vector<wstring>& s) const
{
- for (vector<tstring>::const_iterator it = s.begin(); it != s.end(); ++it)
+ for (vector<wstring>::const_iterator it = s.begin(); it != s.end(); ++it)
if (words.find(*it) != words.end())
return true;
return false;
}
-vector<tstring> WordsList::ConsistsOf(const set<tstring>& list) const
+vector<wstring> WordsList::ConsistsOf(const set<wstring>& list) const
{
- vector<tstring> res;
- for (set<tstring>::const_iterator it = words.begin(); it != words.end(); ++it)
+ vector<wstring> res;
+ for (set<wstring>::const_iterator it = words.begin(); it != words.end(); ++it)
if (list.find(*it) == list.end())
res.push_back(*it);
return res;
}
-vector<tstring> WordsList::DoesntIncludeAny(const set<tstring>& list) const
+vector<wstring> WordsList::DoesntIncludeAny(const set<wstring>& list) const
{
- vector<tstring> res;
- for (set<tstring>::const_iterator it = words.begin(); it != words.end(); ++it)
+ vector<wstring> res;
+ for (set<wstring>::const_iterator it = words.begin(); it != words.end(); ++it)
if (list.find(*it) != list.end())
res.push_back(*it);
return res;
@@ -140,17 +140,17 @@ vector<tstring> WordsList::DoesntIncludeAny(const set<tstring>& list) const bool WordsList::operator<(const WordsList& value) const
{
- return (tstring)*this < (tstring)value;
+ return (wstring)*this < (wstring)value;
}
bool WordsList::operator!=(const WordsList& value) const
{
- return (tstring)*this != (tstring)value;
+ return (wstring)*this != (wstring)value;
}
bool WordsList::operator==(const WordsList& value) const
{
- return (tstring)*this == (tstring)value;
+ return (wstring)*this == (wstring)value;
}
size_t WordsList::Size() const
diff --git a/plugins/Boltun/src/Engine/WordsList.h b/plugins/Boltun/src/Engine/WordsList.h index 4cac8cd969..dfda3b6c91 100644 --- a/plugins/Boltun/src/Engine/WordsList.h +++ b/plugins/Boltun/src/Engine/WordsList.h @@ -24,21 +24,21 @@ class WordsList
{
WordsList();
- void Parse(std::tstring s/*, bool allowUnstrict = false*/);
+ void Parse(std::wstring s/*, bool allowUnstrict = false*/);
//bool unstrict;
#ifdef _DEBUG
public:
#endif
- std::set<std::tstring> words;
+ std::set<std::wstring> words;
bool isQuestion;
public:
- WordsList(const std::tstring &data/*, bool allowUnstrict = false*/);
- operator std::tstring() const;
- bool MatchesAll(const std::vector<std::tstring>& s/*, bool& WasStrict*/, float& priority) const;
- bool MatchesAny(const std::vector<std::tstring>& s) const;
- std::vector<std::tstring> ConsistsOf(const std::set<std::tstring>& list) const;
- std::vector<std::tstring> DoesntIncludeAny(const std::set<std::tstring>& list) const;
- WordsList& operator= (const std::tstring& s);
+ WordsList(const std::wstring &data/*, bool allowUnstrict = false*/);
+ operator std::wstring() const;
+ bool MatchesAll(const std::vector<std::wstring>& s/*, bool& WasStrict*/, float& priority) const;
+ bool MatchesAny(const std::vector<std::wstring>& s) const;
+ std::vector<std::wstring> ConsistsOf(const std::set<std::wstring>& list) const;
+ std::vector<std::wstring> DoesntIncludeAny(const std::set<std::wstring>& list) const;
+ WordsList& operator= (const std::wstring& s);
bool operator<(const WordsList& value) const;
bool operator==(const WordsList& value) const;
bool operator!=(const WordsList& value) const;
diff --git a/plugins/Boltun/src/actionQueue.cpp b/plugins/Boltun/src/actionQueue.cpp index 3d7d322bf9..b7656873cd 100644 --- a/plugins/Boltun/src/actionQueue.cpp +++ b/plugins/Boltun/src/actionQueue.cpp @@ -115,7 +115,7 @@ static void StartTyping(MCONTACT hContact, const TalkBot::MessageInfo*) void DoAnswer(MCONTACT hContact, const TalkBot::MessageInfo *info, bool sticky = false)
{
- if (info->Answer[0] == _T('\0'))
+ if (info->Answer[0] == '\0')
return;
int waitTime, thinkTime = 0;
int defWaitTime = Config.AnswerPauseTime * 1000;
@@ -191,12 +191,12 @@ void DoAnswer(MCONTACT hContact, const TalkBot::MessageInfo *info, bool sticky = UpdateTimer();
}
-void AnswerToContact(MCONTACT hContact, const TCHAR* messageToAnswer)
+void AnswerToContact(MCONTACT hContact, const wchar_t* messageToAnswer)
{
if (Config.TalkWarnContacts && db_get_b(hContact, BOLTUN_KEY,
DB_CONTACT_WARNED, FALSE) == FALSE)
{
- DoAnswer(hContact, new TalkBot::MessageInfo((const TCHAR*)Config.WarnText), true);
+ DoAnswer(hContact, new TalkBot::MessageInfo((const wchar_t*)Config.WarnText), true);
db_set_b(hContact, BOLTUN_KEY, DB_CONTACT_WARNED, TRUE);
}
else
diff --git a/plugins/Boltun/src/actionQueue.h b/plugins/Boltun/src/actionQueue.h index 492bdcb24e..953b9a08f3 100644 --- a/plugins/Boltun/src/actionQueue.h +++ b/plugins/Boltun/src/actionQueue.h @@ -21,7 +21,7 @@ #ifndef ACTIONQUEUE_H
#define ACTIONQUEUE_H
-void AnswerToContact(MCONTACT hContact, const TCHAR* messageToAnswer);
+void AnswerToContact(MCONTACT hContact, const wchar_t* messageToAnswer);
void StartChatting(MCONTACT hContact);
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index 8fb65dd806..100c18b144 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -30,7 +30,7 @@ TalkBot* bot = NULL; HINSTANCE hInst;
BOOL blInit = FALSE;
UINT pTimer = 0;
-TCHAR tszPath[MAX_PATH];
+wchar_t tszPath[MAX_PATH];
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -63,13 +63,13 @@ void UpdateEngine() }
}
-TCHAR* GetFullName(const TCHAR *filename)
+wchar_t* GetFullName(const wchar_t *filename)
{
size_t flen = mir_tstrlen(filename);
- TCHAR* fullname = const_cast<TCHAR*>(filename);
- if (!_tcschr(filename, _T(':'))) {
+ wchar_t* fullname = const_cast<wchar_t*>(filename);
+ if (!wcschr(filename, ':')) {
size_t plen = mir_tstrlen(tszPath);
- fullname = new TCHAR[plen + flen + 1];
+ fullname = new wchar_t[plen + flen + 1];
fullname[0] = NULL;
mir_tstrcat(fullname, tszPath);
mir_tstrcat(fullname, filename);
@@ -77,9 +77,9 @@ TCHAR* GetFullName(const TCHAR *filename) return fullname;
}
-static bool LoadMind(const TCHAR* filename, int &line)
+static bool LoadMind(const wchar_t* filename, int &line)
{
- TCHAR* fullname = GetFullName(filename);
+ wchar_t* fullname = GetFullName(filename);
HCURSOR newCur = LoadCursor(NULL, MAKEINTRESOURCE(IDC_WAIT));
HCURSOR oldCur = SetCursor(newCur);
#ifdef DEBUG_LOAD_TIME
@@ -157,7 +157,7 @@ static bool LoadMind(const TCHAR* filename, int &line) return true;
}
-/*static bool SaveMind(const TCHAR* filename)
+/*static bool SaveMind(const wchar_t* filename)
{
if (!bot)
return false;
@@ -220,7 +220,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDbEvent) egt.codepage = CP_ACP;
egt.datatype = DBVT_TCHAR;
egt.dbei = &dbei;
- TCHAR* s = (TCHAR*)(void*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&egt);
+ wchar_t* s = (wchar_t*)(void*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&egt);
free(dbei.pBlob);
if (Config.MarkAsRead)
db_event_markRead(hContact, hDbEvent);
@@ -307,7 +307,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR Config.AnswerThinkTime = GetDlgItemInt(hwndDlg, IDC_THINKTIME, &bTranslated, FALSE);
if (!bTranslated)
Config.AnswerThinkTime = 4;
- TCHAR c[MAX_WARN_TEXT];
+ wchar_t c[MAX_WARN_TEXT];
bTranslated = GetDlgItemText(hwndDlg, IDC_WARNTXT, c, _countof(c));
if (bTranslated)
Config.WarnText = c;
@@ -359,8 +359,8 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP case IDC_BTNPATH:
{
const size_t fileNameSize = 5000;
- TCHAR *filename = new TCHAR[fileNameSize];
- TCHAR *fullname = GetFullName(Config.MindFileName);
+ wchar_t *filename = new wchar_t[fileNameSize];
+ wchar_t *fullname = GetFullName(Config.MindFileName);
mir_tstrcpy(filename, fullname);
if (fullname != Config.MindFileName)
delete[] fullname;
@@ -369,8 +369,8 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = GetParent(hwndDlg);
- TCHAR *mind = TranslateTS(MIND_FILE_DESC);
- TCHAR *anyfile = TranslateTS(ALL_FILES_DESC);
+ wchar_t *mind = TranslateTS(MIND_FILE_DESC);
+ wchar_t *anyfile = TranslateTS(ALL_FILES_DESC);
CMString filt(FORMAT, MIND_DIALOG_FILTER, mind, anyfile);
filt.Replace('\1', '\0');
@@ -384,12 +384,12 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP break;
}
- TCHAR *origf = filename;
- TCHAR *f = filename;
- TCHAR *p = tszPath;
+ wchar_t *origf = filename;
+ wchar_t *f = filename;
+ wchar_t *p = tszPath;
while (*p && *f) {
- TCHAR p1 = (TCHAR)CharLower((TCHAR*)(long)*p++);
- TCHAR f1 = (TCHAR)CharLower((TCHAR*)(long)*f++);
+ wchar_t p1 = (wchar_t)CharLower((wchar_t*)(long)*p++);
+ wchar_t f1 = (wchar_t)CharLower((wchar_t*)(long)*f++);
if (p1 != f1)
break;
}
@@ -402,11 +402,11 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP case IDC_BTNRELOAD:
{
- const TCHAR *c = Config.MindFileName;
+ const wchar_t *c = Config.MindFileName;
int line;
bTranslated = blInit = LoadMind(c, line);
if (!bTranslated) {
- TCHAR message[5000];
+ wchar_t message[5000];
mir_sntprintf(message, TranslateTS(FAILED_TO_LOAD_BASE), line, c);
MessageBox(NULL, message, TranslateTS(BOLTUN_ERROR), MB_ICONERROR | MB_TASKMODAL | MB_OK);
}
@@ -431,7 +431,7 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP Config.EngineMakeLowerCase = IsDlgButtonChecked(hwndDlg, IDC_ENGINE_LOWERCASE) == BST_CHECKED ? TRUE : FALSE;
Config.EngineUnderstandAlways = IsDlgButtonChecked(hwndDlg, IDC_ENGINE_UNDERSTAND_ALWAYS) == BST_CHECKED ? TRUE : FALSE;
UpdateEngine();
- TCHAR c[MAX_MIND_FILE];
+ wchar_t c[MAX_MIND_FILE];
bTranslated = GetDlgItemText(hwndDlg, IDC_MINDFILE, c, _countof(c));
if (bTranslated)
Config.MindFileName = c;
@@ -536,7 +536,7 @@ extern "C" int __declspec(dllexport) Load(void) mir_getLP(&pluginInfo);
GetModuleFileName(hInst, tszPath, _countof(tszPath));
- *(_tcsrchr(tszPath, _T('\\')) + 1) = _T('\0');
+ *(wcsrchr(tszPath, '\\') + 1) = '\0';
/*initialize miranda hooks and services on options dialog*/
HookEvent(ME_OPT_INITIALISE, MessageOptInit);
@@ -574,8 +574,8 @@ extern "C" int __declspec(dllexport) Load(void) int line;
blInit = LoadMind(Config.MindFileName, line);
if (!blInit) {
- TCHAR path[2000];
- mir_sntprintf(path, TranslateTS(FAILED_TO_LOAD_BASE), line, (const TCHAR*)Config.MindFileName);
+ wchar_t path[2000];
+ mir_sntprintf(path, TranslateTS(FAILED_TO_LOAD_BASE), line, (const wchar_t*)Config.MindFileName);
MessageBox(NULL, path, TranslateTS(BOLTUN_ERROR), MB_ICONERROR | MB_TASKMODAL | MB_OK);
}
return 0;
@@ -592,9 +592,9 @@ extern "C" int __declspec(dllexport) Unload(void) //It seems that it's now a Boltun problem.
//So in case of saving error we will remain silent
#if 0
- TCHAR path[MAX_PATH];
- mir_sntprintf(path, TranslateTS(FAILED_TO_SAVE_BASE), (const TCHAR*)Config.MindFileName);
- TCHAR* err = TranslateTS(BOLTUN_ERROR);
+ wchar_t path[MAX_PATH];
+ mir_sntprintf(path, TranslateTS(FAILED_TO_SAVE_BASE), (const wchar_t*)Config.MindFileName);
+ wchar_t* err = TranslateTS(BOLTUN_ERROR);
MessageBox(NULL, path, err, MB_ICONERROR | MB_TASKMODAL | MB_OK); */
#endif
}
diff --git a/plugins/Boltun/src/config.cpp b/plugins/Boltun/src/config.cpp index 27aefdf329..dd821a886b 100644 --- a/plugins/Boltun/src/config.cpp +++ b/plugins/Boltun/src/config.cpp @@ -36,31 +36,31 @@ #define DB_ENGINE_LOWERCASE "MakeLowerCase"
#define DB_ENGINE_UNDERSTAND_ALWAYS "UnderstandAlways"
-inline TCHAR* GetString(char* key, const TCHAR* def)
+inline wchar_t* GetString(char* key, const wchar_t* def)
{
DBVARIANT dbv;
- TCHAR* val;
+ wchar_t* val;
if (!db_get_ts(NULL, BOLTUN_KEY, key, &dbv))
{
size_t len = mir_wstrlen(dbv.ptszVal) + 1;
- val = new TCHAR[len];
- _tcscpy_s(val, len, dbv.ptszVal);
+ val = new wchar_t[len];
+ wcscpy_s(val, len, dbv.ptszVal);
db_free(&dbv);
}
else
{
size_t len = mir_wstrlen(def) + 1;
- val = new TCHAR[len];
- _tcscpy_s(val, len, def);
+ val = new wchar_t[len];
+ wcscpy_s(val, len, def);
}
return val;
}
-inline const TCHAR* SetString(char* key, const TCHAR* value)
+inline const wchar_t* SetString(char* key, const wchar_t* value)
{
size_t len = mir_tstrlen(value) + 1;
- TCHAR* val = new TCHAR[len];
- _tcscpy_s(val, len, value);
+ wchar_t* val = new wchar_t[len];
+ wcscpy_s(val, len, value);
db_set_ts(NULL, BOLTUN_KEY, key, val);
return val;
}
@@ -80,9 +80,9 @@ inline const TCHAR* SetString(char* key, const TCHAR* value) return value; }
#define BUILDSTRETTERS(x, str, def) \
- const TCHAR* BoltunConfig::Get##x() { \
+ const wchar_t* BoltunConfig::Get##x() { \
return GetString(str, def); } \
- const TCHAR* BoltunConfig::Set##x(const TCHAR* value) { \
+ const wchar_t* BoltunConfig::Set##x(const wchar_t* value) { \
return SetString(str, value); }
#define BUILDINIT(x) \
diff --git a/plugins/Boltun/src/config.h b/plugins/Boltun/src/config.h index 3cee967d4f..73587fe3e3 100644 --- a/plugins/Boltun/src/config.h +++ b/plugins/Boltun/src/config.h @@ -133,8 +133,8 @@ class BoltunConfig BUILDDEFETTERS(AnswerThinkTime, int);
BUILDDEFETTERS(PauseDepends, bool);
BUILDDEFETTERS(PauseRandom, bool);
- BUILDDEFETTERS(WarnText, TCHAR*);
- BUILDDEFETTERS(MindFileName, TCHAR*);
+ BUILDDEFETTERS(WarnText, wchar_t*);
+ BUILDDEFETTERS(MindFileName, wchar_t*);
BUILDDEFETTERS(EngineStaySilent, bool);
BUILDDEFETTERS(EngineMakeLowerCase, bool);
BUILDDEFETTERS(EngineUnderstandAlways, bool);
@@ -151,8 +151,8 @@ public: Property<int, BoltunConfig> AnswerThinkTime;
Property<bool, BoltunConfig> PauseDepends;
Property<bool, BoltunConfig> PauseRandom;
- PtrProperty<TCHAR, BoltunConfig> WarnText;
- PtrProperty<TCHAR, BoltunConfig> MindFileName;
+ PtrProperty<wchar_t, BoltunConfig> WarnText;
+ PtrProperty<wchar_t, BoltunConfig> MindFileName;
Property<bool, BoltunConfig> EngineStaySilent;
Property<bool, BoltunConfig> EngineMakeLowerCase;
Property<bool, BoltunConfig> EngineUnderstandAlways;
diff --git a/plugins/Boltun/src/stdafx.h b/plugins/Boltun/src/stdafx.h index 77b9614042..a4a084bdf2 100644 --- a/plugins/Boltun/src/stdafx.h +++ b/plugins/Boltun/src/stdafx.h @@ -74,20 +74,20 @@ //Plugin name
#define BOLTUN_NAME "Boltun"
-#define MIND_FILE_DESC LPGENT("Mind Files")
-#define ALL_FILES_DESC LPGENT("All Files")
+#define MIND_FILE_DESC LPGENW("Mind Files")
+#define ALL_FILES_DESC LPGENW("All Files")
//UI strings
#define BOLTUN_AUTO_CHAT LPGEN("Boltun/Auto Chat")
#define BOLTUN_NOT_TO_CHAT LPGEN("Boltun/Not to Chat")
#define BOLTUN_START_CHATTING LPGEN("Boltun/Start Chatting")
-#define DEFAULT_WARN_TEXT LPGENT("Hello. I'm Boltun! I'll talk to you, while my owner is away. Please write without mistakes!")
+#define DEFAULT_WARN_TEXT LPGENW("Hello. I'm Boltun! I'll talk to you, while my owner is away. Please write without mistakes!")
// Error messages
-#define BOLTUN_ERROR LPGENT("Boltun Error")
-#define FAILED_TO_LOAD_BASE LPGENT("Failed to load base of remarks. Error at line %d of %s. (Or few lines before).")
-#define FAILED_TO_SAVE_BASE LPGENT("Failed to save base of remarks to %s")
+#define BOLTUN_ERROR LPGENW("Boltun Error")
+#define FAILED_TO_LOAD_BASE LPGENW("Failed to load base of remarks. Error at line %d of %s. (Or few lines before).")
+#define FAILED_TO_SAVE_BASE LPGENW("Failed to save base of remarks to %s")
//Settings tab names
#define TAB_GENERAL LPGEN("General Settings")
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index 6a8600b4d1..bd725b6e8b 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -35,7 +35,7 @@ HKL oldLangID, oldLayout; int protoCount, hLangpack;
PROTOACCOUNT **proto;
unsigned *oldStatus;
-TCHAR **oldStatusMsg;
+wchar_t **oldStatusMsg;
BYTE g_bOldSetting;
PFNDwmIsCompositionEnabled dwmIsCompositionEnabled;
@@ -171,7 +171,7 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM) if ((g_dwMirandaPID == dwWndPID) && hWnd != g_hDlgPass && IsWindowVisible(hWnd))
{
- TCHAR szTemp[32];
+ wchar_t szTemp[32];
GetClassName(hWnd, szTemp, 32);
if (mir_tstrcmp(szTemp, L"MirandaThumbsWnd") == 0) // hide floating contacts
@@ -194,12 +194,12 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM) return true;
}
-TCHAR* GetDefStatusMsg(unsigned uStatus, const char* szProto)
+wchar_t* GetDefStatusMsg(unsigned uStatus, const char* szProto)
{
- return (TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, uStatus, (LPARAM)szProto);
+ return (wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, uStatus, (LPARAM)szProto);
}
-void SetStatus(const char* szProto, unsigned status, TCHAR *tszAwayMsg)
+void SetStatus(const char* szProto, unsigned status, wchar_t *tszAwayMsg)
{
if (tszAwayMsg && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND)
CallProtoService(szProto, PS_SETAWAYMSG, status, (LPARAM)tszAwayMsg);
@@ -207,7 +207,7 @@ void SetStatus(const char* szProto, unsigned status, TCHAR *tszAwayMsg) CallProtoService(szProto, PS_SETSTATUS, status, 0);
}
-static int ChangeAllProtoStatuses(unsigned statusMode, TCHAR *msg)
+static int ChangeAllProtoStatuses(unsigned statusMode, wchar_t *msg)
{
for (int i = 0; i < protoCount; i++)
{
@@ -221,7 +221,7 @@ static int ChangeAllProtoStatuses(unsigned statusMode, TCHAR *msg) if (g_wMask & OPT_SETONLINEBACK){ // need to save old statuses & status messages
oldStatus[i] = status;
if (ProtoServiceExists(proto[i]->szModuleName, PS_GETMYAWAYMSG))
- oldStatusMsg[i] = (TCHAR*)CallProtoService(proto[i]->szModuleName, PS_GETMYAWAYMSG, 0, SGMA_TCHAR);
+ oldStatusMsg[i] = (wchar_t*)CallProtoService(proto[i]->szModuleName, PS_GETMYAWAYMSG, 0, SGMA_TCHAR);
else
oldStatusMsg[i] = GetDefStatusMsg(status, proto[i]->szModuleName);
}
@@ -254,11 +254,11 @@ static void CreateTrayIcon(bool create) NOTIFYICONDATA nim;
DBVARIANT dbVar;
if (!db_get_ts(NULL, MOD_NAME, "ToolTipText", &dbVar)) {
- _tcsncpy_s(nim.szTip, dbVar.ptszVal, _TRUNCATE);
+ wcsncpy_s(nim.szTip, dbVar.ptszVal, _TRUNCATE);
db_free(&dbVar);
}
else
- _tcsncpy_s(nim.szTip, L"Miranda NG", _TRUNCATE);
+ wcsncpy_s(nim.szTip, L"Miranda NG", _TRUNCATE);
nim.cbSize = sizeof(nim);
nim.hWnd = g_hListenWindow;
@@ -321,7 +321,7 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara DBVARIANT dbVar;
if (g_wMask & OPT_USEDEFMSG || db_get_ts(NULL, MOD_NAME, "statmsg", &dbVar))
{
- TCHAR *ptszDefMsg = GetDefStatusMsg(uMode, 0);
+ wchar_t *ptszDefMsg = GetDefStatusMsg(uMode, 0);
ChangeAllProtoStatuses(uMode, ptszDefMsg);
mir_free(ptszDefMsg);
}
@@ -329,7 +329,7 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara {
if (ServiceExists(MS_VARS_FORMATSTRING))
{
- TCHAR *ptszParsed = variables_parse(dbVar.ptszVal, 0, 0);
+ wchar_t *ptszParsed = variables_parse(dbVar.ptszVal, 0, 0);
ChangeAllProtoStatuses(uMode, ptszParsed);
mir_free(ptszParsed);
}
@@ -395,7 +395,7 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara while (pCurWnd != NULL)
{
HWND_ITEM *pNextWnd = pCurWnd->next;
- TCHAR szTemp[32];
+ wchar_t szTemp[32];
GetClassName(pCurWnd->hWnd, szTemp, 32);
if (IsWindow(pCurWnd->hWnd) && mir_tstrcmp(szTemp, L"SysShadow") != 0) // precaution
@@ -458,9 +458,9 @@ INT_PTR BossKeyHideMiranda(WPARAM, LPARAM) // for service :) return 0;
}
-static TCHAR *HokeyVkToName(WORD vkKey)
+static wchar_t *HokeyVkToName(WORD vkKey)
{
- static TCHAR buf[32] = { 0 };
+ static wchar_t buf[32] = { 0 };
DWORD code = MapVirtualKey(vkKey, 0) << 16;
switch (vkKey)
@@ -495,13 +495,13 @@ static TCHAR *HokeyVkToName(WORD vkKey) return buf;
}
-static TCHAR *GetBossKeyText(void)
+static wchar_t *GetBossKeyText(void)
{
WORD wHotKey = db_get_w(NULL, "SkinHotKeys", "Hide/Show Miranda", HOTKEYCODE(HOTKEYF_CONTROL, VK_F12));
BYTE key = LOBYTE(wHotKey);
BYTE shift = HIBYTE(wHotKey);
- static TCHAR buf[128] = { 0 };
+ static wchar_t buf[128] = { 0 };
mir_sntprintf(buf, L"%s%s%s%s%s",
(shift & HOTKEYF_CONTROL) ? L"Ctrl + " : L"",
@@ -521,7 +521,7 @@ static IconItem iconList[] = static int GenMenuInit(WPARAM, LPARAM) // Modify menu item text before to show the main menu
{
if (g_hMenuItem) {
- TCHAR buf[128];
+ wchar_t buf[128];
mir_sntprintf(buf, L"%s [%s]", TranslateT("Hide"), GetBossKeyText());
Menu_ModifyItem(g_hMenuItem, buf);
}
@@ -535,7 +535,7 @@ void BossKeyMenuItemInit(void) // Add menu item mi.flags = CMIF_TCHAR;
mi.position = 2000100000;
mi.hIcolibItem = IcoLib_GetIcon("hidemim");
- mi.name.t = LPGENT("Hide");
+ mi.name.w = LPGENW("Hide");
mi.pszService = MS_BOSSKEY_HIDE;
g_hMenuItem = Menu_AddMainMenuItem(&mi);
@@ -590,7 +590,7 @@ static int TabsrmmButtonsInit(WPARAM, LPARAM) bbd.cbSize = sizeof(BBButton);
bbd.pszModuleName = MOD_NAME;
bbd.dwDefPos = 5000;
- bbd.ptszTooltip = LPGENT("Hide Miranda NG");
+ bbd.ptszTooltip = LPGENW("Hide Miranda NG");
bbd.bbbFlags = BBBF_ISRSIDEBUTTON | BBBF_CANBEHIDDEN;
bbd.hIcon = iconList[0].hIcolib;
CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
@@ -598,7 +598,7 @@ static int TabsrmmButtonsInit(WPARAM, LPARAM) return 0;
}
-static TCHAR *VariablesBossKey(ARGUMENTSINFO *ai) {
+static wchar_t *VariablesBossKey(ARGUMENTSINFO *ai) {
if (ai->cbSize < sizeof(ARGUMENTSINFO)) return NULL;
if (ai->argc != 1) return NULL;
@@ -615,7 +615,7 @@ static int EnumProtos(WPARAM, LPARAM) delete[] oldStatusMsg;
oldStatus = new unsigned[protoCount];
- oldStatusMsg = new TCHAR*[protoCount];
+ oldStatusMsg = new wchar_t*[protoCount];
for (int i = 0; i < protoCount; i++)
{
oldStatus[i] = 0;
diff --git a/plugins/BossKeyPlus/src/Options.cpp b/plugins/BossKeyPlus/src/Options.cpp index fc37629d20..fab96b3e27 100644 --- a/plugins/BossKeyPlus/src/Options.cpp +++ b/plugins/BossKeyPlus/src/Options.cpp @@ -79,7 +79,7 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam // status msg, if needed
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_MAINOPT_STATMSG))) { // meaning we should save it
- TCHAR tszMsg[1025];
+ wchar_t tszMsg[1025];
GetDlgItemText(hwndDlg, IDC_MAINOPT_STATMSG, tszMsg, _countof(tszMsg));
if (tszMsg[0] != 0)
db_set_ts(NULL, MOD_NAME, "statmsg", tszMsg);
@@ -115,7 +115,7 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam BYTE bSelection = (BYTE)SendDlgItemMessage(hwndDlg, IDC_MAINOPT_CHGSTS, CB_GETCURSEL, 0, 0);
WORD wMode = STATUS_ARR_TO_ID[bSelection];
if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_USEDEFMSG) == BST_CHECKED) {
- TCHAR *ptszDefMsg = GetDefStatusMsg(wMode, 0);
+ wchar_t *ptszDefMsg = GetDefStatusMsg(wMode, 0);
SetDlgItemText(hwndDlg, IDC_MAINOPT_STATMSG, ptszDefMsg);
if (ptszDefMsg)
mir_free(ptszDefMsg);
@@ -221,8 +221,8 @@ INT_PTR CALLBACK AdvOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) g_fOptionsOpen = true;
minutes = db_get_b(NULL, MOD_NAME, "time", 10);
- TCHAR szMinutes[4] = { 0 };
- _itot(minutes, szMinutes, 10);
+ wchar_t szMinutes[4] = { 0 };
+ _itow(minutes, szMinutes, 10);
SendDlgItemMessage(hwndDlg, IDC_MAINOPT_TIME, EM_LIMITTEXT, 2, 0);
SendDlgItemMessage(hwndDlg, IDC_MAINOPT_SPIN_TIME, UDM_SETRANGE32, 1, (LPARAM)99);
SetDlgItemText(hwndDlg, IDC_MAINOPT_TIME, szMinutes);
@@ -257,9 +257,9 @@ INT_PTR CALLBACK AdvOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) else if (g_hMenuItem != 0)
BossKeyMenuItemUnInit();
- TCHAR szMinutes[4] = { 0 };
+ wchar_t szMinutes[4] = { 0 };
GetDlgItemText(hwndDlg, IDC_MAINOPT_TIME, szMinutes, _countof(szMinutes));
- minutes = _ttoi(szMinutes);
+ minutes = _wtoi(szMinutes);
if (minutes < 1) minutes = 1;
db_set_b(NULL, MOD_NAME, "time", minutes);
db_set_w(NULL, MOD_NAME, "optsmaskadv", wMaskAdv);
@@ -323,15 +323,15 @@ int OptsDlgInit(WPARAM wParam, LPARAM) optDi.pfnDlgProc = MainOptDlg;
optDi.pszTemplate = MAKEINTRESOURCEA(IDD_OPTDIALOGMAIN);
optDi.hInstance = g_hInstance;
- optDi.ptszTitle = LPGENT("BossKey");
- optDi.ptszGroup = LPGENT("Events");
- optDi.ptszTab = LPGENT("Main");
+ optDi.pwszTitle = LPGENW("BossKey");
+ optDi.pwszGroup = LPGENW("Events");
+ optDi.pwszTab = LPGENW("Main");
optDi.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &optDi);
optDi.pfnDlgProc = AdvOptDlg;
optDi.pszTemplate = MAKEINTRESOURCEA(IDD_OPTDIALOGADV);
- optDi.ptszTab = LPGENT("Advanced");
+ optDi.pwszTab = LPGENW("Advanced");
Options_AddPage(wParam, &optDi);
return 0;
}
diff --git a/plugins/BossKeyPlus/src/stdafx.h b/plugins/BossKeyPlus/src/stdafx.h index 067b56a694..ea08079f22 100644 --- a/plugins/BossKeyPlus/src/stdafx.h +++ b/plugins/BossKeyPlus/src/stdafx.h @@ -88,10 +88,10 @@ int OptsDlgInit(WPARAM wParam, LPARAM lParam); INT_PTR BossKeyHideMiranda(WPARAM wParam, LPARAM lParam);
void BossKeyMenuItemInit(void);
void BossKeyMenuItemUnInit(void);
-static TCHAR *GetBossKeyText(void);
+static wchar_t *GetBossKeyText(void);
void InitIdleTimer(void);
void UninitIdleTimer(void);
-TCHAR* GetDefStatusMsg(unsigned uMode, const char* szProto);
+wchar_t* GetDefStatusMsg(unsigned uMode, const char* szProto);
// I never really liked STL's vector... hmm this is nicer anyway, more flexible
typedef struct HWND_ITEM_TYPE
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 0b5bbc73e8..cc3b479be4 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -253,7 +253,7 @@ bool isContactGoneFor(MCONTACT hContact, int days) return (daysSinceOnline >= days && (daysSinceMessage == -1 || daysSinceMessage >= days));
}
-void ReturnNotify(MCONTACT hContact, TCHAR *message)
+void ReturnNotify(MCONTACT hContact, wchar_t *message)
{
if (db_get_b(hContact, "CList", "NotOnList", 0) == 1 || db_get_b(hContact, "CList", "Hidden", 0) == 1)
return;
@@ -265,8 +265,8 @@ void ReturnNotify(MCONTACT hContact, TCHAR *message) POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
ppd.lchIcon = hIcon;
- _tcsncpy(ppd.lptzContactName, (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
- _tcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
+ wcsncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
ppd.colorText = options.iPopupColorFore;
@@ -284,15 +284,15 @@ void ReturnNotify(MCONTACT hContact, TCHAR *message) cle.pszService = "BuddyExpectator/actionReturned";
cle.flags = CLEF_TCHAR;
- TCHAR* nick = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR tmpMsg[512];
+ wchar_t* nick = (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t tmpMsg[512];
mir_sntprintf(tmpMsg, L"%s %s", nick, message);
cle.ptszTooltip = tmpMsg;
pcli->pfnAddEvent(&cle);
}
}
-void GoneNotify(MCONTACT hContact, TCHAR *message)
+void GoneNotify(MCONTACT hContact, wchar_t *message)
{
if (db_get_b(hContact, "CList", "NotOnList", 0) == 1 || db_get_b(hContact, "CList", "Hidden", 0) == 1)
return;
@@ -302,8 +302,8 @@ void GoneNotify(MCONTACT hContact, TCHAR *message) POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
ppd.lchIcon = hIcon;
- _tcsncpy(ppd.lptzContactName, (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
- _tcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
+ wcsncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
ppd.colorText = options.iPopupColorFore;
@@ -321,8 +321,8 @@ void GoneNotify(MCONTACT hContact, TCHAR *message) cle.hIcon = hIcon;
cle.pszService = "BuddyExpectator/actionStillAbsent";
- TCHAR* nick = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR tmpMsg[512];
+ wchar_t* nick = (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t tmpMsg[512];
mir_sntprintf(tmpMsg, L"%s %s", nick, message);
cle.ptszTooltip = tmpMsg;
cle.flags = CLEF_TCHAR;
@@ -435,9 +435,9 @@ int onPrebuildContactMenu(WPARAM hContact, LPARAM) return 0;
if (db_get_b(hContact, MODULE_NAME, "MissYou", 0))
- Menu_ModifyItem(hContactMenu, LPGENT("Disable Miss You"), iconList[1].hIcolib);
+ Menu_ModifyItem(hContactMenu, LPGENW("Disable Miss You"), iconList[1].hIcolib);
else
- Menu_ModifyItem(hContactMenu, LPGENT("Enable Miss You"), iconList[2].hIcolib);
+ Menu_ModifyItem(hContactMenu, LPGENW("Enable Miss You"), iconList[2].hIcolib);
Menu_ShowItem(hContactMenu, !db_get_b(hContact, proto, "ChatRoom", 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND));
return 0;
@@ -485,8 +485,8 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) ppd.lchContact = hContact;
ppd.lchIcon = IcoLib_GetIcon("enabled_icon");
- _tcsncpy(ppd.lptzContactName, (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
- _tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
+ wcsncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
ppd.colorText = options.iPopupColorFore;
@@ -517,17 +517,17 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) unsigned int AbsencePeriod = db_get_dw(hContact, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
if (isContactGoneFor(hContact, AbsencePeriod)) {
- TCHAR* message = TranslateT("has returned after a long absence.");
- TCHAR tmpBuf[251] = { 0 };
+ wchar_t* message = TranslateT("has returned after a long absence.");
+ wchar_t tmpBuf[251] = { 0 };
time_t tmpTime = getLastSeen(hContact);
if (tmpTime != -1) {
- _tcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
+ wcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
else {
tmpTime = getLastInputMsg(hContact);
if (tmpTime != -1) {
- _tcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
+ wcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
}
@@ -551,13 +551,13 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) db_set_b(hContact, MODULE_NAME, "StillAbsentNotified", 1);
SkinPlaySound("buddyExpectatorStillAbsent");
- TCHAR* message = TranslateT("has not returned after a long absence.");
+ wchar_t* message = TranslateT("has not returned after a long absence.");
time_t tmpTime;
- TCHAR tmpBuf[251] = { 0 };
+ wchar_t tmpBuf[251] = { 0 };
tmpTime = getLastSeen(hContact);
if (tmpTime != -1)
{
- _tcsftime(tmpBuf, 250, TranslateT("has not returned after being absent since %#x"), gmtime(&tmpTime));
+ wcsftime(tmpBuf, 250, TranslateT("has not returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
else
@@ -565,7 +565,7 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) tmpTime = getLastInputMsg(hContact);
if (tmpTime != -1)
{
- _tcsftime(tmpBuf, 250, TranslateT("has not returned after being absent since %#x"), gmtime(&tmpTime));
+ wcsftime(tmpBuf, 250, TranslateT("has not returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
}
@@ -593,10 +593,10 @@ int ModulesLoaded(WPARAM, LPARAM) HookEvent(ME_USERINFO_INITIALISE, UserinfoInit);
// add sounds support
- SkinAddNewSoundExT("buddyExpectatorReturn", LPGENT("BuddyExpectator"), LPGENT("Contact returned"));
- SkinAddNewSoundExT("buddyExpectatorStillAbsent", LPGENT("BuddyExpectator"), LPGENT("Contact still absent"));
- SkinAddNewSoundExT("buddyExpectatorMissYou", LPGENT("BuddyExpectator"), LPGENT("Miss you event"));
- SkinAddNewSoundExT("buddyExpectatorHide", LPGENT("BuddyExpectator"), LPGENT("Hide contact event"));
+ SkinAddNewSoundExT("buddyExpectatorReturn", LPGENW("BuddyExpectator"), LPGENW("Contact returned"));
+ SkinAddNewSoundExT("buddyExpectatorStillAbsent", LPGENW("BuddyExpectator"), LPGENW("Contact still absent"));
+ SkinAddNewSoundExT("buddyExpectatorMissYou", LPGENW("BuddyExpectator"), LPGENW("Miss you event"));
+ SkinAddNewSoundExT("buddyExpectatorHide", LPGENW("BuddyExpectator"), LPGENW("Hide contact event"));
timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours
@@ -612,7 +612,7 @@ int ModulesLoaded(WPARAM, LPARAM) mi.flags = CMIF_TCHAR;
mi.hIcolibItem = iconList[2].hIcolib;
mi.position = 200000;
- mi.name.t = LPGENT("Enable Miss You");
+ mi.name.w = LPGENW("Enable Miss You");
mi.pszService = "BuddyExpectator/actionMissYouClick";
hContactMenu = Menu_AddContactMenuItem(&mi);
}
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index 107eae10f4..b0be57b26e 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -325,10 +325,10 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP ppd.lchContact = NULL;
ppd.lchIcon = hIcon;
- _tcsncpy(ppd.lptzContactName, TranslateT("Contact name"), MAX_CONTACTNAME);
- TCHAR szPreviewText[250];
+ wcsncpy(ppd.lptzContactName, TranslateT("Contact name"), MAX_CONTACTNAME);
+ wchar_t szPreviewText[250];
mir_sntprintf(szPreviewText, TranslateT("has returned after being absent since %d days"), rand() % 30);
- _tcsncpy(ppd.lptzText, szPreviewText, MAX_SECONDLINE);
+ wcsncpy(ppd.lptzText, szPreviewText, MAX_SECONDLINE);
// Get current popups colors options
if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP))
@@ -346,7 +346,7 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NO_HISTORY);
- _tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
+ wcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
ppd.lchIcon = IcoLib_GetIcon("enabled_icon");
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NO_HISTORY);
@@ -433,15 +433,15 @@ static int OptionsInit(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("Contacts");
+ odp.pwszGroup = LPGENW("Contacts");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSPANEL);
- odp.ptszTitle = LPGENT("Buddy Expectator");
+ odp.pwszTitle = LPGENW("Buddy Expectator");
odp.pfnDlgProc = OptionsFrameProc;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &odp);
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- odp.ptszGroup = LPGENT("Popups");
+ odp.pwszGroup = LPGENW("Popups");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPPANEL);
odp.pfnDlgProc = PopupOptionsFrameProc;
Options_AddPage(wParam, &odp);
@@ -456,12 +456,12 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar case WM_INITDIALOG:
{
time_t tmpTime;
- TCHAR tmpBuf[51] = { 0 };
+ wchar_t tmpBuf[51] = { 0 };
tmpTime = getLastSeen((MCONTACT)lparam);
if (tmpTime == -1)
SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, TranslateT("not detected"));
else {
- _tcsftime(tmpBuf, 50, L"%#x, %#X", gmtime(&tmpTime));
+ wcsftime(tmpBuf, 50, L"%#x, %#X", gmtime(&tmpTime));
SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, tmpBuf);
}
@@ -469,7 +469,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar if (tmpTime == -1)
SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, TranslateT("not found"));
else {
- _tcsftime(tmpBuf, 50, L"%#x, %#X", gmtime(&tmpTime));
+ wcsftime(tmpBuf, 50, L"%#x, %#X", gmtime(&tmpTime));
SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, tmpBuf);
}
@@ -532,7 +532,7 @@ int UserinfoInit(WPARAM wparam, LPARAM lparam) uip.hInstance = hInst;
uip.pszTemplate = MAKEINTRESOURCEA(IDD_USERINFO);
uip.flags = ODPF_TCHAR;
- uip.ptszTitle = LPGENT("Buddy Expectator");
+ uip.pwszTitle = LPGENW("Buddy Expectator");
uip.pfnDlgProc = UserinfoDlgProc;
UserInfo_AddPage(wparam, &uip);
}
diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp index becca80478..d17340cfb0 100644 --- a/plugins/BuddyPounce/src/dialog.cpp +++ b/plugins/BuddyPounce/src/dialog.cpp @@ -15,7 +15,7 @@ void populateContacts(MCONTACT BPhContact, HWND hwnd2CB) for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *szProto = GetContactProto(hContact);
if (szProto && (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) {
- TCHAR name[300];
+ wchar_t name[300];
mir_sntprintf(name, L"%s (%s)", pcli->pfnGetContactDisplayName(hContact, 0), _A2T(szProto));
int index = SendMessage(hwnd2CB, CB_ADDSTRING, 0, (LPARAM)name);
SendMessage(hwnd2CB, CB_SETITEMDATA, index, hContact);
@@ -27,7 +27,7 @@ void populateContacts(MCONTACT BPhContact, HWND hwnd2CB) void saveLastSetting(MCONTACT hContact, HWND hwnd)
{
- TCHAR number[8];//, string[1024];//for sending file name
+ wchar_t number[8];//, string[1024];//for sending file name
switch (db_get_b(hContact, modname, "LastSetting", 2)) { // nothing to do
case 0: // Send If My Status Is...
break;
@@ -38,18 +38,18 @@ void saveLastSetting(MCONTACT hContact, HWND hwnd) break;
case 3: // Reuse Pounce
GetDlgItemText(hwnd, IDC_SETTINGNUMBER, number, _countof(number));
- db_set_b(hContact, modname, "Reuse", (BYTE)_ttoi(number));
+ db_set_b(hContact, modname, "Reuse", (BYTE)_wtoi(number));
break;
case 4: // Give Up delay
GetDlgItemText(hwnd, IDC_SETTINGNUMBER, number, _countof(number));
- db_set_b(hContact, modname, "GiveUpDays", (BYTE)_ttoi(number));
+ db_set_b(hContact, modname, "GiveUpDays", (BYTE)_wtoi(number));
{
- db_set_dw(hContact, modname, "GiveUpDate", (DWORD)(_ttoi(number)*SECONDSINADAY));
+ db_set_dw(hContact, modname, "GiveUpDate", (DWORD)(_wtoi(number)*SECONDSINADAY));
}
break;
case 5: // confirm window
GetDlgItemText(hwnd, IDC_SETTINGNUMBER, number, _countof(number));
- db_set_w(hContact, modname, "ConfirmTimeout", (WORD)_ttoi(number));
+ db_set_w(hContact, modname, "ConfirmTimeout", (WORD)_wtoi(number));
break;
}
}
@@ -88,7 +88,7 @@ INT_PTR CALLBACK StatusModesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l case IDOK:
case IDCANCEL:
windowInfo *wi = (windowInfo *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- TCHAR type[32];
+ wchar_t type[32];
GetDlgItemText(hwnd, IDC_CHECK1, type, _countof(type));
WORD flag = (IsDlgButtonChecked(hwnd, IDC_CHECK1))
@@ -192,7 +192,7 @@ void deletePounce(MCONTACT hContact) INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- TCHAR msg[1024];
+ wchar_t msg[1024];
switch(uMsg) {
case WM_INITDIALOG:
@@ -222,7 +222,7 @@ INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, L {
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)) + 1;
if (length>1) {
- TCHAR *text = (TCHAR*)_alloca(length*sizeof(TCHAR));
+ wchar_t *text = (wchar_t*)_alloca(length*sizeof(wchar_t));
GetDlgItemText(hwnd, IDC_MESSAGE, text, length);
db_set_ts(hContact, modname, "PounceMsg", text);
}
@@ -242,7 +242,7 @@ INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, L INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
windowInfo *wi = (windowInfo *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- TCHAR msg[1024];
+ wchar_t msg[1024];
switch(uMsg) {
case WM_INITDIALOG:
@@ -283,7 +283,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM MCONTACT hContact = (MCONTACT)SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_GETITEMDATA, SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_GETCURSEL, 0, 0), 0);
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE))+1;
if (length>1) {
- TCHAR *text = (TCHAR*)mir_alloc(length*sizeof(TCHAR));
+ wchar_t *text = (wchar_t*)mir_alloc(length*sizeof(wchar_t));
if (!text) {
msg(TranslateT("Couldn't allocate enough memory"), L"");
break;
@@ -329,7 +329,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM case IDC_SETTINGS:
if (HIWORD(wParam) == LBN_SELCHANGE) {
int item = SendDlgItemMessage(hwnd, IDC_SETTINGS, LB_GETCURSEL, 0, 0);
- TCHAR temp[5];
+ wchar_t temp[5];
saveLastSetting(wi->hContact, hwnd);
hideAll(hwnd);
switch (item) {
@@ -344,7 +344,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Reuse this message? (0 to use it once)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Times"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itot(db_get_b(wi->hContact, modname, "Reuse", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_b(wi->hContact, modname, "Reuse", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
@@ -353,7 +353,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Give up after... (0 to not give up)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Days"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itot(db_get_b(wi->hContact, modname, "GiveUpDays", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_b(wi->hContact, modname, "GiveUpDays", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
@@ -362,7 +362,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Show confirmation window? (0 to not Show)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Seconds to wait before sending"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itot(db_get_w(wi->hContact, modname, "ConfirmTimeout", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_w(wi->hContact, modname, "ConfirmTimeout", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
@@ -377,7 +377,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- TCHAR msg[1024];
+ wchar_t msg[1024];
switch(uMsg) {
case WM_INITDIALOG:
@@ -409,7 +409,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, MCONTACT hContact = ((windowInfo *)GetWindowLongPtr(hwnd, GWLP_USERDATA))->hContact;
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE))+1;
if (length > 1) {
- TCHAR *text = (TCHAR*)mir_alloc(length*sizeof(TCHAR));
+ wchar_t *text = (wchar_t*)mir_alloc(length*sizeof(wchar_t));
if (!text) {
msg(TranslateT("Couldn't allocate enough memory"), L"");
break;
@@ -448,7 +448,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, if (HIWORD(wParam) == LBN_SELCHANGE) {
windowInfo *wi = (windowInfo *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
int item = SendDlgItemMessage(hwnd, IDC_SETTINGS, LB_GETCURSEL, 0, 0);
- TCHAR temp[5];
+ wchar_t temp[5];
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
saveLastSetting(wi->hContact, hwnd);
hideAll(hwnd);
@@ -464,7 +464,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Reuse this message? (0 to use it once)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Times"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itot(db_get_b(wi->hContact, modname, "Reuse", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_b(wi->hContact, modname, "Reuse", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
@@ -473,7 +473,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Give up after... (0 to not give up)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Days"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itot(db_get_b(wi->hContact, modname, "GiveUpDays", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_b(wi->hContact, modname, "GiveUpDays", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
@@ -482,7 +482,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Show confirmation window? (0 to not Show)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Seconds to wait before sending"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itot(db_get_w(wi->hContact, modname, "ConfirmTimeout", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_w(wi->hContact, modname, "ConfirmTimeout", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
@@ -523,7 +523,7 @@ INT_PTR CALLBACK SendPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP case WM_TIMER:
{
- TCHAR message[1024];
+ wchar_t message[1024];
mir_sntprintf(message, TranslateT("Pounce being sent to %s in %d seconds"), pcli->pfnGetContactDisplayName(spdps->hContact, 0), spdps->timer);
SetDlgItemText(hwnd, LBL_CONTACT, message);
}
@@ -580,7 +580,7 @@ INT_PTR CALLBACK PounceSentDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP switch(LOWORD(wParam)) {
case IDOK:
{
- TCHAR text[2048];
+ wchar_t text[2048];
GetDlgItemText(hwnd, IDOK, text, _countof(text));
if (!mir_tstrcmp(text, TranslateT("Retry"))) {
GetDlgItemText(hwnd, IDC_MESSAGE, text, _countof(text));
@@ -599,7 +599,7 @@ INT_PTR CALLBACK PounceSentDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP void CreateMessageAcknowlegedWindow(MCONTACT hContact, int SentSuccess)
{
HWND hwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONFIRMSEND), 0, PounceSentDlgProc, hContact);
- TCHAR msg[256];
+ wchar_t msg[256];
if (SentSuccess) {
mir_sntprintf(msg, TranslateT("Message successfully sent to %s"), pcli->pfnGetContactDisplayName(hContact, 0));
SetDlgItemText(hwnd, IDOK, TranslateT("OK"));
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index 3d15dc36be..0d112acef5 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -98,8 +98,8 @@ int BuddyPounceOptInit(WPARAM wParam, LPARAM) odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.ptszGroup = LPGENT("Message sessions");
- odp.ptszTitle = LPGENT("Buddy Pounce");
+ odp.pwszGroup = LPGENW("Message sessions");
+ odp.pwszTitle = LPGENW("Buddy Pounce");
odp.pfnDlgProc = BuddyPounceOptionsDlgProc;
Options_AddPage(wParam, &odp);
return 0;
@@ -142,7 +142,7 @@ int CheckDate(MCONTACT hContact) return 0;
}
-void SendPounce(TCHAR *text, MCONTACT hContact)
+void SendPounce(wchar_t *text, MCONTACT hContact)
{
if (HANDLE hSendId = (HANDLE)ProtoChainSend(hContact, PSS_MESSAGE, 0, T2Utf(text)))
WindowList_Add(hWindowList, (HWND)hSendId, hContact);
@@ -169,7 +169,7 @@ int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) if (CheckDate(hContact)) {
if (db_get_w(hContact, modname, "ConfirmTimeout", 0)) {
SendPounceDlgProcStruct *spdps = (SendPounceDlgProcStruct *)mir_alloc(sizeof(SendPounceDlgProcStruct));
- TCHAR *message = mir_tstrdup(dbv.ptszVal); // will get free()ed in the send confirm window proc
+ wchar_t *message = mir_tstrdup(dbv.ptszVal); // will get free()ed in the send confirm window proc
spdps->hContact = hContact;
spdps->message = message;
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONFIRMSEND), 0, SendPounceDlgProc, (LPARAM)spdps);
@@ -198,7 +198,7 @@ INT_PTR BuddyPounceMenuCommand(WPARAM hContact, LPARAM) INT_PTR AddSimpleMessage(WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = wParam;
- TCHAR* message = (TCHAR*)lParam;
+ wchar_t* message = (wchar_t*)lParam;
db_set_ws(hContact, modname, "PounceMsg", message);
db_set_w(hContact, modname, "SendIfMyStatusIsFLAG", (WORD)db_get_w(NULL, modname, "SendIfMyStatusIsFLAG",1));
db_set_w(hContact, modname, "SendIfTheirStatusIsFLAG", (WORD)db_get_w(NULL, modname, "SendIfTheirStatusIsFLAG",1));
@@ -211,11 +211,11 @@ INT_PTR AddSimpleMessage(WPARAM wParam, LPARAM lParam) INT_PTR AddToPounce(WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = wParam;
- TCHAR* message = (TCHAR*)lParam;
+ wchar_t* message = (wchar_t*)lParam;
DBVARIANT dbv;
if (!db_get_ts(hContact, modname, "PounceMsg",&dbv))
{
- TCHAR* newPounce = (TCHAR*)mir_alloc(mir_tstrlen(dbv.ptszVal) + mir_tstrlen(message) + 1);
+ wchar_t* newPounce = (wchar_t*)mir_alloc(mir_tstrlen(dbv.ptszVal) + mir_tstrlen(message) + 1);
if (!newPounce) return 1;
mir_tstrcpy(newPounce, dbv.ptszVal);
mir_tstrcat(newPounce, message);
diff --git a/plugins/BuddyPounce/src/stdafx.h b/plugins/BuddyPounce/src/stdafx.h index 5174042431..1187a52a6f 100644 --- a/plugins/BuddyPounce/src/stdafx.h +++ b/plugins/BuddyPounce/src/stdafx.h @@ -56,7 +56,7 @@ struct SendPounceDlgProcStruct {
MCONTACT hContact;
int timer;
- TCHAR *message;
+ wchar_t *message;
};
extern HINSTANCE hInst;
@@ -66,7 +66,7 @@ extern HINSTANCE hInst; //=======================================================
// main.c
-void SendPounce(TCHAR* text, MCONTACT hContact);
+void SendPounce(wchar_t* text, MCONTACT hContact);
//dialog.c
INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index 19ea7e1558..77a43eff9f 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -84,9 +84,9 @@ static int OnInitOptions(WPARAM wparam, LPARAM) odp.position = 955000000; odp.hInstance = g_hInst; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); - odp.pszTitle = MODULENAME; + odp.pwszTitle = MODULENAME; odp.pfnDlgProc = CSOptionsProc; - odp.pszGroup = LPGEN("Status"); + odp.pwszGroup = L"Status"; odp.flags = ODPF_BOLDGROUPS; Options_AddPage(wparam, &odp); return 0; @@ -124,20 +124,20 @@ extern "C" __declspec(dllexport) int Load() InitCommonControlsEx(&icc); // init icons - TCHAR tszFile[MAX_PATH]; + wchar_t tszFile[MAX_PATH]; GetModuleFileName(g_hInst, tszFile, MAX_PATH); SKINICONDESC sid = { 0 }; - sid.defaultFile.t = tszFile; + sid.defaultFile.w = tszFile; sid.flags = SIDF_ALL_TCHAR; - sid.section.t = _T(MODULENAME); + sid.section.w = MODULENAME; for (int i = 0; i < _countof(forms); i++) { char szSettingName[64]; mir_snprintf(szSettingName, "%s_%s", MODNAME, forms[i].pszIconIcoLib); sid.pszName = szSettingName; - sid.description.t = forms[i].ptszDescr; + sid.description.w = forms[i].ptszDescr; sid.iDefaultIndex = -forms[i].iconNoIcoLib; forms[i].hIcoLibItem = IcoLib_AddIcon(&sid); } @@ -161,13 +161,13 @@ extern "C" __declspec(dllexport) int Unload() // ====[ FUN ]================================================================ -void RegisterHotkeys(char buf[200], TCHAR* accName, int Number) +void RegisterHotkeys(char buf[200], wchar_t* accName, int Number) { HOTKEYDESC hotkey = { sizeof(hotkey) }; hotkey.dwFlags = HKD_TCHAR; hotkey.pszName = buf; hotkey.ptszDescription = accName; - hotkey.ptszSection = LPGENT("Custom Status List"); + hotkey.ptszSection = LPGENW("Custom Status List"); hotkey.pszService = buf; hotkey.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, '0' + Number); Hotkey_Register(&hotkey); @@ -240,7 +240,7 @@ void addProtoStatusMenuItem(char *protoName) CMenuItem mi; mi.flags = CMIF_TCHAR; mi.hIcolibItem = forms[0].hIcoLibItem; - mi.name.t = _T(MODULENAME); + mi.name.w = MODULENAME; mi.position = 2000040000; mi.pszService = buf; mi.root = hRoot; @@ -388,15 +388,15 @@ void CSWindow::toggleEmptyListMessage() BOOL CSWindow::itemPassedFilter(ListItem< StatusItem >* li) { - TCHAR filter[MAX_PATH]; + wchar_t filter[MAX_PATH]; GetDlgItemText(m_handle, IDC_FILTER_FIELD, filter, _countof(filter)); if (mir_tstrlen(filter)) { - TCHAR title[EXTRASTATUS_TITLE_LIMIT], message[EXTRASTATUS_MESSAGE_LIMIT]; + wchar_t title[EXTRASTATUS_TITLE_LIMIT], message[EXTRASTATUS_MESSAGE_LIMIT]; mir_tstrcpy(title, li->m_item->m_tszTitle); mir_tstrcpy(message, li->m_item->m_tszMessage); - if (strpos(_tcslwr(title), _tcslwr(filter)) == -1) - if (strpos(_tcslwr(message), _tcslwr(filter)) == -1) + if (strpos(wcslwr(title), wcslwr(filter)) == -1) + if (strpos(wcslwr(message), wcslwr(filter)) == -1) return FALSE; } @@ -415,7 +415,7 @@ void CSWindow::toggleFilter() SetFocus(hFilter); else { - TCHAR filterText[255]; + wchar_t filterText[255]; GetDlgItemText(m_handle, IDC_FILTER_FIELD, filterText, _countof(filterText)); if (filterText[0] != 0) SetDlgItemText(m_handle, IDC_FILTER_FIELD, TEXT("")); @@ -484,7 +484,7 @@ void CSAMWindow::setCombo() db_free(&dbv); WPARAM iStatus; - TCHAR tszName[100]; + wchar_t tszName[100]; CUSTOM_STATUS cs = { sizeof(cs) }; cs.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR; cs.ptszName = tszName; @@ -528,13 +528,13 @@ void CSAMWindow::checkFieldLimit(WORD action, WORD item) if (action == EN_CHANGE) { - TCHAR* ptszInputText = (TCHAR*)mir_alloc((limit + 8) * sizeof(TCHAR)); + wchar_t* ptszInputText = (wchar_t*)mir_alloc((limit + 8) * sizeof(wchar_t)); GetDlgItemText(m_handle, item, ptszInputText, limit + 8); if (mir_tstrlen(ptszInputText) > limit) { - TCHAR tszPopupTip[MAX_PATH]; + wchar_t tszPopupTip[MAX_PATH]; EDITBALLOONTIP ebt = { 0 }; ebt.cbStruct = sizeof(ebt); ebt.pszTitle = TranslateT("Warning"); @@ -543,7 +543,7 @@ void CSAMWindow::checkFieldLimit(WORD action, WORD item) ebt.ttiIcon = TTI_WARNING; SendDlgItemMessage(m_handle, item, EM_SHOWBALLOONTIP, 0, (LPARAM)&ebt); - TCHAR* ptszOutputText = (TCHAR*)mir_alloc((limit + 1) * sizeof(TCHAR)); + wchar_t* ptszOutputText = (wchar_t*)mir_alloc((limit + 1) * sizeof(wchar_t)); GetDlgItemText(m_handle, item, ptszOutputText, limit + 1); SetDlgItemText(m_handle, item, ptszOutputText); mir_free(ptszOutputText); @@ -562,7 +562,7 @@ void CSAMWindow::checkItemValidity() if (m_item->m_iIcon != cbi.iImage) m_item->m_iIcon = cbi.iImage, m_bChanged = TRUE; - TCHAR tszInputMessage[EXTRASTATUS_MESSAGE_LIMIT]; + wchar_t tszInputMessage[EXTRASTATUS_MESSAGE_LIMIT]; GetDlgItemText(m_handle, IDC_MESSAGE, tszInputMessage, _countof(tszInputMessage)); @@ -571,7 +571,7 @@ void CSAMWindow::checkItemValidity() return; WPARAM i = SendMessage(m_hCombo, CB_GETCURSEL, 0, 0) + 1; - TCHAR tszTitle[100]; + wchar_t tszTitle[100]; CUSTOM_STATUS cs = { sizeof(cs) }; cs.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR; @@ -827,7 +827,7 @@ INT_PTR CALLBACK CSWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpa csw->toggleButtons(); csw->toggleEmptyListMessage(); csw->loadWindowPosition(); - SetWindowText(hwnd, TranslateT(MODULENAME)); + SetWindowText(hwnd, MODULENAME); return TRUE; case WM_COMMAND: @@ -852,7 +852,7 @@ INT_PTR CALLBACK CSWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpa case IDC_REMOVE: if (getByte("ConfirmDeletion", DEFAULT_PLUGIN_CONFIRM_ITEMS_DELETION)) - if (MessageBox(hwnd, TranslateT("Do you really want to delete selected item?"), TranslateT(MODULENAME), MB_YESNO | MB_DEFBUTTON2 | MB_ICONQUESTION) == IDNO) + if (MessageBox(hwnd, TranslateT("Do you really want to delete selected item?"), TranslateTS(MODULENAME), MB_YESNO | MB_DEFBUTTON2 | MB_ICONQUESTION) == IDNO) break; csw->m_itemslist->m_list->remove(csw->m_listview->getPositionInList()); @@ -893,7 +893,7 @@ INT_PTR CALLBACK CSWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpa else { result = MessageBox(hwnd, TranslateT("Do you want old database entries to be deleted after Import?"), - TranslateT(MODULENAME), MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_ICONQUESTION); + TranslateTS(MODULENAME), MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_ICONQUESTION); if (result == IDCANCEL) break; } diff --git a/plugins/CSList/src/stdafx.h b/plugins/CSList/src/stdafx.h index ddea917d2f..a99e42fe2d 100644 --- a/plugins/CSList/src/stdafx.h +++ b/plugins/CSList/src/stdafx.h @@ -54,8 +54,8 @@ // ====[ BASIC DEFINITIONS ]==================================================
-#define MODULENAME LPGEN("Custom Status List")
-#define MODNAME "CSList"
+#define MODULENAME LPGENW("Custom Status List")
+#define MODNAME "CSList"
// ====[ LIMITS ]=============================================================
@@ -103,8 +103,8 @@ typedef void(__cdecl *pForAllProtosFunc)(char*, void *); struct StatusItem // list item structure
{
int m_iIcon;
- TCHAR m_tszTitle[EXTRASTATUS_TITLE_LIMIT];
- TCHAR m_tszMessage[EXTRASTATUS_MESSAGE_LIMIT];
+ wchar_t m_tszTitle[EXTRASTATUS_TITLE_LIMIT];
+ wchar_t m_tszMessage[EXTRASTATUS_MESSAGE_LIMIT];
BOOL m_bFavourite;
StatusItem()
@@ -130,25 +130,25 @@ struct StatusItem // list item structure static struct CSForm { // icons + buttons
int idc;
- TCHAR* ptszTitle;
- TCHAR* ptszDescr;
+ wchar_t* ptszTitle;
+ wchar_t* ptszDescr;
char * pszIconIcoLib;
int iconNoIcoLib;
HANDLE hIcoLibItem;
} forms[] = {
- { -1, LPGENT("Main Menu"), LPGENT("Main Icon"), "icon", IDI_CSLIST },
- { IDC_ADD, LPGENT("Add new item"), LPGENT("Add"), "add", IDI_ADD },
- { IDC_MODIFY, LPGENT("Modify selected item"), LPGENT("Modify"), "modify", IDI_MODIFY },
- { IDC_REMOVE, LPGENT("Delete selected item"), LPGENT("Remove"), "remove", IDI_REMOVE },
- { IDC_FAVOURITE, LPGENT("Set/unset current item as favorite"), LPGENT("Favorite"), "favourite", IDI_FAVOURITE },
- { IDC_UNDO, LPGENT("Undo changes"), LPGENT("Undo changes"), "undo", IDI_UNDO },
- { IDC_IMPORT, LPGENT("Import statuses from database"), LPGENT("Import"), "import", IDI_IMPORT },
- { IDC_FILTER, LPGENT("Filter list"), LPGENT("Filter"), "filter", IDI_FILTER },
- { IDCLOSE, LPGENT("Close without changing custom status"), LPGENT("No change"), "nochng", IDI_CLOSE },
- { IDC_CANCEL, LPGENT("Clear custom status (reset to None) and close"), LPGENT("Clear"), "clear", IDI_UNSET },
- { IDOK, LPGENT("Set custom status to selected one and close"), LPGENT("Set"), "apply", IDI_APPLY }
+ { -1, LPGENW("Main Menu"), LPGENW("Main Icon"), "icon", IDI_CSLIST },
+ { IDC_ADD, LPGENW("Add new item"), LPGENW("Add"), "add", IDI_ADD },
+ { IDC_MODIFY, LPGENW("Modify selected item"), LPGENW("Modify"), "modify", IDI_MODIFY },
+ { IDC_REMOVE, LPGENW("Delete selected item"), LPGENW("Remove"), "remove", IDI_REMOVE },
+ { IDC_FAVOURITE, LPGENW("Set/unset current item as favorite"), LPGENW("Favorite"), "favourite", IDI_FAVOURITE },
+ { IDC_UNDO, LPGENW("Undo changes"), LPGENW("Undo changes"), "undo", IDI_UNDO },
+ { IDC_IMPORT, LPGENW("Import statuses from database"), LPGENW("Import"), "import", IDI_IMPORT },
+ { IDC_FILTER, LPGENW("Filter list"), LPGENW("Filter"), "filter", IDI_FILTER },
+ { IDCLOSE, LPGENW("Close without changing custom status"), LPGENW("No change"), "nochng", IDI_CLOSE },
+ { IDC_CANCEL, LPGENW("Clear custom status (reset to None) and close"), LPGENW("Clear"), "clear", IDI_UNSET },
+ { IDOK, LPGENW("Set custom status to selected one and close"), LPGENW("Set"), "apply", IDI_APPLY }
};
// ====[ MY BITCHY LIST IMPLEMENTATION x)) ]==================================
@@ -343,7 +343,7 @@ struct CSWindow HIMAGELIST m_icons;
int m_statusCount;
BOOL m_bSomethingChanged;
- TCHAR* m_filterString;
+ wchar_t* m_filterString;
char * m_protoName;
CSWindow(char *protoName);
@@ -395,7 +395,7 @@ void addProtoStatusMenuItem(char *protoName); // other functions
void IitIcoLib();
-void RegisterHotkeys(char buf[200], TCHAR* accName, int Number);
+void RegisterHotkeys(char buf[200], wchar_t* accName, int Number);
void SetStatus(WORD code, StatusItem* item, char *protoName);
// ====[ PROCEDURES ]=========================================================
diff --git a/plugins/CSList/src/strpos.h b/plugins/CSList/src/strpos.h index 210bfddf0a..9ba847a395 100644 --- a/plugins/CSList/src/strpos.h +++ b/plugins/CSList/src/strpos.h @@ -32,9 +32,9 @@ */
-# ifndef TCHAR
-# define TCHAR wchar_t
-# endif /* TCHAR */
+# ifndef wchar_t
+# define wchar_t wchar_t
+# endif /* wchar_t */
# define STRING wchar_t *
@@ -46,7 +46,7 @@ int strpos( STRING haystack, STRING needle ) int position;
#ifdef DEBUG_VERBOSE
- TCHAR lpBuf[1024];
+ wchar_t lpBuf[1024];
#endif /* def DEBUG_VERBOSE */
pDest = (STRING) wcsstr( haystack, needle );
diff --git a/plugins/ChangeKeyboardLayout/src/hook_events.cpp b/plugins/ChangeKeyboardLayout/src/hook_events.cpp index 35584b5d04..c0d2b34140 100644 --- a/plugins/ChangeKeyboardLayout/src/hook_events.cpp +++ b/plugins/ChangeKeyboardLayout/src/hook_events.cpp @@ -8,13 +8,13 @@ INT_PTR APIChangeLayout(WPARAM wParam, LPARAM) INT_PTR APIGetLayoutOfText(WPARAM, LPARAM lParam)
{
- LPTSTR ptszInText = (TCHAR*)lParam;
+ LPTSTR ptszInText = (wchar_t*)lParam;
return (INT_PTR)GetLayoutOfText(ptszInText);
}
INT_PTR APIChangeTextLayout(WPARAM wParam, LPARAM lParam)
{
- LPTSTR ptszInText = (TCHAR*)wParam;
+ LPTSTR ptszInText = (wchar_t*)wParam;
CKLLayouts *ckllFromToLay = (CKLLayouts*)lParam;
return (INT_PTR)ChangeTextLayout(ptszInText, ckllFromToLay->hklFrom, ckllFromToLay->hklTo, ckllFromToLay->bTwoWay);
diff --git a/plugins/ChangeKeyboardLayout/src/options.cpp b/plugins/ChangeKeyboardLayout/src/options.cpp index b6f9310819..1f1a5af025 100644 --- a/plugins/ChangeKeyboardLayout/src/options.cpp +++ b/plugins/ChangeKeyboardLayout/src/options.cpp @@ -201,7 +201,7 @@ INT_PTR CALLBACK DlgMainProcOptions(HWND hWnd, UINT uiMessage, WPARAM wParam, LP WriteMainOptions();
- ptszFormLay = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
+ ptszFormLay = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
GetDlgItemText(hWnd, IDC_EDIT_SET, ptszFormLay, MaxTextSize);
i = SendDlgItemMessage(hWnd, IDC_COMBO_LANG, CB_GETCURSEL, 0, 0);
ptszMemLay = ptszLayStrings[i];
@@ -350,12 +350,12 @@ INT_PTR CALLBACK DlgPopupsProcOptions(HWND hWnd, UINT uiMessage, WPARAM wParam, case IDC_BUTTON_PREVIEW:
if ((HIWORD(wParam) == BN_CLICKED )) {
- ptszPopupPreviewText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
+ ptszPopupPreviewText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
POPUPDATAT_V2 pdtData = { 0 };
pdtData.cbSize = sizeof(pdtData);
- _tcsncpy(pdtData.lptzContactName, TranslateT(ModuleName), MAX_CONTACTNAME);
- _tcsncpy(pdtData.lptzText, L"Ghbdtn? rfr ltkf&", MAX_SECONDLINE);
+ wcsncpy(pdtData.lptzContactName, TranslateT(ModuleName), MAX_CONTACTNAME);
+ wcsncpy(pdtData.lptzText, L"Ghbdtn? rfr ltkf&", MAX_SECONDLINE);
switch(poOptionsTemp.bColourType) {
case PPC_POPUP:
diff --git a/plugins/ChangeKeyboardLayout/src/text_operations.cpp b/plugins/ChangeKeyboardLayout/src/text_operations.cpp index d66dd38e70..ed1cdf4460 100644 --- a/plugins/ChangeKeyboardLayout/src/text_operations.cpp +++ b/plugins/ChangeKeyboardLayout/src/text_operations.cpp @@ -14,7 +14,7 @@ static DWORD CALLBACK EditStreamOutRtf(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG c {
EditStreamData *esd = (EditStreamData*)dwCookie;
esd->cbBuff += cb;
- esd->pbBuff = (PBYTE)realloc(esd->pbBuff, esd->cbBuff + sizeof(TCHAR));
+ esd->pbBuff = (PBYTE)realloc(esd->pbBuff, esd->cbBuff + sizeof(wchar_t));
memcpy(esd->pbBuff + esd->iCurrent, pbBuff, cb);
esd->iCurrent += cb;
esd->pbBuff[esd->iCurrent] = 0;
@@ -28,8 +28,8 @@ LPTSTR GeTStringFromStreamData(EditStreamData *esd) {
DWORD i, k;
- LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
- LPTSTR ptszTemp = (TCHAR*)esd->pbBuff;
+ LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
+ LPTSTR ptszTemp = (wchar_t*)esd->pbBuff;
for (i = k = 0; i < mir_tstrlen(ptszTemp); i++) {
if ((ptszTemp[i] == 0x0A) || (ptszTemp[i] == 0x2028))
@@ -52,8 +52,8 @@ BOOL CopyTextToClipboard(LPTSTR ptszText) return FALSE;
EmptyClipboard();
- HGLOBAL hCopy = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(ptszText) + 1)*sizeof(TCHAR));
- mir_tstrcpy((TCHAR*)GlobalLock(hCopy), ptszText);
+ HGLOBAL hCopy = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(ptszText) + 1)*sizeof(wchar_t));
+ mir_tstrcpy((wchar_t*)GlobalLock(hCopy), ptszText);
GlobalUnlock(hCopy);
SetClipboardData(CF_UNICODETEXT, hCopy);
CloseClipboard();
@@ -69,8 +69,8 @@ LPSTR GetNameOfLayout(HKL hklLayout) LPTSTR GetShortNameOfLayout(HKL hklLayout)
{
- TCHAR szLI[20];
- LPTSTR ptszLiShort = (LPTSTR)mir_alloc(3*sizeof(TCHAR));
+ wchar_t szLI[20];
+ LPTSTR ptszLiShort = (LPTSTR)mir_alloc(3*sizeof(wchar_t));
DWORD dwLcid = MAKELCID(LOWORD(hklLayout), 0);
GetLocaleInfo(dwLcid, LOCALE_SISO639LANGNAME, szLI, 10);
ptszLiShort[0] = toupper(szLI[0]);
@@ -92,8 +92,8 @@ LPTSTR GenerateLayoutString(HKL hklLayout) {
BYTE bState[256] = {0};
- LPTSTR ptszLayStr = (LPTSTR)mir_alloc(100 * sizeof(TCHAR));
- LPTSTR ptszTemp = (LPTSTR)mir_alloc(3 * sizeof(TCHAR));
+ LPTSTR ptszLayStr = (LPTSTR)mir_alloc(100 * sizeof(wchar_t));
+ LPTSTR ptszTemp = (LPTSTR)mir_alloc(3 * sizeof(wchar_t));
ptszTemp[0] = 0;
DWORD i;
@@ -138,7 +138,7 @@ LPTSTR GetLayoutString(HKL hklLayout) LPTSTR ChangeTextCase(LPCTSTR ptszInText)
{
- LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
+ LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
mir_tstrcpy(ptszOutText, ptszInText);
for (DWORD i = 0; i < mir_tstrlen(ptszInText); i++) {
@@ -151,7 +151,7 @@ LPTSTR ChangeTextCase(LPCTSTR ptszInText) LPTSTR ChangeTextLayout(LPCTSTR ptszInText, HKL hklCurLay, HKL hklToLay, BOOL TwoWay)
{
- LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
+ LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
mir_tstrcpy(ptszOutText, ptszInText);
if (hklCurLay == NULL || hklToLay == NULL)
@@ -189,7 +189,7 @@ HKL GetLayoutOfText(LPCTSTR ptszInText) DWORD dwMaxSymbols = 0, dwTemp = 0;
for (DWORD j = 0; j < mir_tstrlen(ptszInText); j++)
- if (_tcschr(ptszKeybBuff, ptszInText[j]) != NULL)
+ if (wcschr(ptszKeybBuff, ptszInText[j]) != NULL)
++dwMaxSymbols;
for (DWORD i = 1; i < bLayNum; i++) {
@@ -197,7 +197,7 @@ HKL GetLayoutOfText(LPCTSTR ptszInText) DWORD dwCountSymbols = 0;
for (DWORD j = 0; j<mir_tstrlen(ptszInText); j++)
- if (_tcschr(ptszKeybBuff, ptszInText[j]) != NULL)
+ if (wcschr(ptszKeybBuff, ptszInText[j]) != NULL)
++dwCountSymbols;
if (dwCountSymbols == dwMaxSymbols)
@@ -240,7 +240,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) if (ServiceExists(MS_HPP_EG_EVENT)) {
// Òî æå ñàìîå äëÿ History++
ieEvent.hwnd = hTextWnd;
- ptszInText = (TCHAR*)CallService(MS_HPP_EG_EVENT, 0, (LPARAM)&ieEvent);
+ ptszInText = (wchar_t*)CallService(MS_HPP_EG_EVENT, 0, (LPARAM)&ieEvent);
if (!IsBadStringPtr(ptszInText, MaxTextSize))
WindowType = WTYPE_HistoryPP;
@@ -250,17 +250,17 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) // Èçâðàùåííîå îïðåäåëåíèå õýíäëà IEView
ieEvent.hwnd = GetParent(GetParent(hTextWnd));
- ptszInText = (TCHAR*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&ieEvent);
+ ptszInText = (wchar_t*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&ieEvent);
if (!IsBadStringPtr(ptszInText, MaxTextSize))
WindowType = WTYPE_IEView;
}
if (WindowType == WTYPE_Unknown) {
- ptrT ptszTemp((LPTSTR)mir_alloc(255 * sizeof(TCHAR)));
+ ptrT ptszTemp((LPTSTR)mir_alloc(255 * sizeof(wchar_t)));
i = GetClassName(hTextWnd, ptszTemp, 255);
ptszTemp[i] = 0;
- if (_tcsstr(CharUpper(ptszTemp), L"RICHEDIT") != NULL) {
+ if (wcsstr(CharUpper(ptszTemp), L"RICHEDIT") != NULL) {
WindowType = WTYPE_RichEdit;
SendMessage(hTextWnd, EM_EXGETSEL, 0, (LPARAM)&crSelection);
}
@@ -297,11 +297,11 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) }
}
if (WindowType == WTYPE_Edit) {
- ptrT ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR)));
- ptszInText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
+ ptrT ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)));
+ ptszInText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
iRes = GetWindowText(hTextWnd, ptszTemp, MaxTextSize);
if (!IsBadStringPtr(ptszInText, MaxTextSize) && (iRes > 0)) {
- _tcsncpy(ptszInText, &ptszTemp[crSelection.cpMin], crSelection.cpMax - crSelection.cpMin);
+ wcsncpy(ptszInText, &ptszTemp[crSelection.cpMin], crSelection.cpMax - crSelection.cpMin);
ptszInText[crSelection.cpMax - crSelection.cpMin] = 0;
}
else {
@@ -334,7 +334,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) }
}
if (WindowType == WTYPE_Edit) {
- ptszInText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
+ ptszInText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
iRes = GetWindowText(hTextWnd, ptszInText, MaxTextSize);
if (!IsBadStringPtr(ptszInText, MaxTextSize) && (iRes > 0)) {
@@ -350,8 +350,8 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) }
// Ïîëó÷àåì òåêóùåå ñëîâî
if (CurrentWord) {
- for (dwStartWord = crSelection.cpMin; (dwStartWord > 0) && (_tcschr(ptszSeparators, ptszInText[dwStartWord - 1]) == NULL); dwStartWord--);
- for (dwEndWord = crSelection.cpMin; (dwEndWord < (mir_tstrlen(ptszInText))) && (_tcschr(ptszSeparators, ptszInText[dwEndWord]) == NULL); dwEndWord++);
+ for (dwStartWord = crSelection.cpMin; (dwStartWord > 0) && (wcschr(ptszSeparators, ptszInText[dwStartWord - 1]) == NULL); dwStartWord--);
+ for (dwEndWord = crSelection.cpMin; (dwEndWord < (mir_tstrlen(ptszInText))) && (wcschr(ptszSeparators, ptszInText[dwEndWord]) == NULL); dwEndWord++);
crTemp.cpMin = dwStartWord;
crTemp.cpMax = dwEndWord;
@@ -374,8 +374,8 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) }
if (WindowType == WTYPE_Edit) {
- ptrT ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR)));
- _tcsncpy(ptszTemp, &ptszInText[crTemp.cpMin], crTemp.cpMax - crTemp.cpMin);
+ ptrT ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)));
+ wcsncpy(ptszTemp, &ptszInText[crTemp.cpMin], crTemp.cpMax - crTemp.cpMin);
ptszTemp[crTemp.cpMax - crTemp.cpMin] = 0;
mir_tstrcpy(ptszInText, ptszTemp);
@@ -403,7 +403,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) // Ëîã Èåâüþ è ÕèñòîðèÏÏ â ðåæèìå ýìóëÿöèè Èåâüþ è ïîëÿ òîëüêî äëÿ ÷òåíèÿ.
if (WindowType != WTYPE_Unknown && !IsBadStringPtr(ptszInText, MaxTextSize))
if (WindowIsReadOnly) {
- ptrT ptszMBox((LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR)));
+ ptrT ptszMBox((LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)));
ptszMBox[0] = 0;
if (TextOperation == TOT_Layout) {
@@ -445,13 +445,13 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) //-------------------------------Ïîêàæåì ïîïàïû------------------------------------------
if (moOptions.ShowPopup) {
- LPTSTR ptszPopupText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
+ LPTSTR ptszPopupText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
mir_tstrcpy(ptszPopupText, ptszMBox);
POPUPDATAT_V2 pdtData = { 0 };
pdtData.cbSize = sizeof(pdtData);
- _tcsncpy(pdtData.lptzContactName, TranslateT(ModuleName), MAX_CONTACTNAME);
- _tcsncpy(pdtData.lptzText, ptszPopupText, MAX_SECONDLINE);
+ wcsncpy(pdtData.lptzContactName, TranslateT(ModuleName), MAX_CONTACTNAME);
+ wcsncpy(pdtData.lptzText, ptszPopupText, MAX_SECONDLINE);
switch (poOptions.bColourType) {
case PPC_POPUP:
@@ -510,7 +510,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) SendMessage(hTextWnd, EM_EXSETSEL, 0, (LPARAM)&crSelection);
}
else {
- ptrT ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR)));
+ ptrT ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)));
GetWindowText(hTextWnd, ptszTemp, MaxTextSize);
for (i = crTemp.cpMin; i < crTemp.cpMax; i++)
ptszTemp[i] = ptszOutText[i - crTemp.cpMin];
diff --git a/plugins/ClientChangeNotify/src/CString.cpp b/plugins/ClientChangeNotify/src/CString.cpp index 8cb1208896..21449ee8e6 100644 --- a/plugins/ClientChangeNotify/src/CString.cpp +++ b/plugins/ClientChangeNotify/src/CString.cpp @@ -268,7 +268,7 @@ TString<T>& TString<T>::operator = (const T *pStr) return *this;
}
-template class TString<TCHAR>;
+template class TString<wchar_t>;
template class TString<char>;
template class TString<WCHAR>;
@@ -278,13 +278,13 @@ CString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, return CString(p == NULL ? szDefaultValue : p);
}
-TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue)
+TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue)
{
ptrT p( db_get_tsa(hContact, szModule, szSetting));
return TCString(p == NULL ? szDefaultValue : p);
}
-TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue)
+TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue)
{ // also converts numeric values to a string
DBVARIANT dbv = {0};
int iRes = db_get_ws(hContact, szModule, szSetting, &dbv);
diff --git a/plugins/ClientChangeNotify/src/CString.h b/plugins/ClientChangeNotify/src/CString.h index 9218a6459d..decedaaac7 100644 --- a/plugins/ClientChangeNotify/src/CString.h +++ b/plugins/ClientChangeNotify/src/CString.h @@ -20,7 +20,6 @@ #pragma once
#include <windows.h>
-#include <tchar.h>
#include <crtdbg.h>
#ifdef CHARARRAY_CONVERT
#include "TMyArray.h"
@@ -97,7 +96,7 @@ private: };
-typedef TString<TCHAR> TCString;
+typedef TString<wchar_t> TCString;
typedef TString<char> CString;
typedef TString<WCHAR> WCString;
@@ -164,9 +163,9 @@ __inline CHARARRAY WCHAR2UTF8(WCString Str) #undef db_get_s
CString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const char *szDefaultValue);
-TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue);
+TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue);
int db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
-TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue); // also converts numeric values to a string
+TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue); // also converts numeric values to a string
// various string helpers. their return values are valid only while the class is visible
class UTF8Encode
diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index dfd08a712c..86cc7fdee5 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -149,11 +149,11 @@ void ShowPopup(SHOWPOPUP_DATA *sd) {
TCString PopupText;
if (sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_SHOWPREVCLIENT)) {
- mir_sntprintf(PopupText.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("changed client to %s (was %s)"), (const TCHAR*)sd->MirVer, (const TCHAR*)sd->OldMirVer);
+ mir_sntprintf(PopupText.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("changed client to %s (was %s)"), (const wchar_t*)sd->MirVer, (const wchar_t*)sd->OldMirVer);
PopupText.ReleaseBuffer();
}
else {
- mir_sntprintf(PopupText.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("changed client to %s"), (const TCHAR*)sd->MirVer);
+ mir_sntprintf(PopupText.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("changed client to %s"), (const wchar_t*)sd->MirVer);
PopupText.ReleaseBuffer();
}
@@ -168,8 +168,8 @@ void ShowPopup(SHOWPOPUP_DATA *sd) ppd.lchIcon = Skin_LoadProtoIcon(szProto, db_get_w(sd->hContact, szProto, "Status", ID_STATUS_OFFLINE));
pdata->hIcon = NULL;
}
- _tcsncpy(ppd.lptzContactName, (TCHAR*)pcli->pfnGetContactDisplayName(sd->hContact, 0), _countof(ppd.lptzContactName) - 1);
- _tcsncpy(ppd.lptzText, PopupText, _countof(ppd.lptzText) - 1);
+ wcsncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(sd->hContact, 0), _countof(ppd.lptzContactName) - 1);
+ wcsncpy(ppd.lptzText, PopupText, _countof(ppd.lptzText) - 1);
ppd.colorBack = (sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_DEFBGCOLOUR) ? 0 : sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_BGCOLOUR));
ppd.colorText = (sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_DEFTEXTCOLOUR) ? 0 : sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_TEXTCOLOUR));
ppd.PluginWindowProc = PopupWndProc;
@@ -244,7 +244,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) }
}
}
- if (sd.MirVer == (const TCHAR*)sd.OldMirVer) {
+ if (sd.MirVer == (const wchar_t*)sd.OldMirVer) {
_ASSERT(hContact);
return 0;
}
@@ -257,7 +257,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) if (hContact) {
TCString ClientName;
if (PopupOptPage.GetValue(IDC_POPUPOPTDLG_SHOWPREVCLIENT) && sd.OldMirVer.GetLen()) {
- mir_sntprintf(ClientName.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("%s (was %s)"), (const TCHAR*)sd.MirVer, (const TCHAR*)sd.OldMirVer);
+ mir_sntprintf(ClientName.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("%s (was %s)"), (const wchar_t*)sd.MirVer, (const wchar_t*)sd.OldMirVer);
ClientName.ReleaseBuffer();
}
else ClientName = sd.MirVer;
@@ -277,9 +277,9 @@ static int PrebuildMainMenu(WPARAM, LPARAM) // we have to use ME_CLIST_PREBUILDMAINMENU instead of updating menu items only on settings change, because "popup_enabled" and "popup_disabled" icons are not always available yet in ModulesLoaded
if (bPopupExists) {
if (g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY))
- Menu_ModifyItem(g_hTogglePopupsMenuItem, LPGENT("Disable c&lient change notification"), IcoLib_GetIcon("popup_enabled"));
+ Menu_ModifyItem(g_hTogglePopupsMenuItem, LPGENW("Disable c&lient change notification"), IcoLib_GetIcon("popup_enabled"));
else
- Menu_ModifyItem(g_hTogglePopupsMenuItem, LPGENT("Enable c&lient change notification"), IcoLib_GetIcon("popup_disabled"));
+ Menu_ModifyItem(g_hTogglePopupsMenuItem, LPGENW("Enable c&lient change notification"), IcoLib_GetIcon("popup_disabled"));
}
return 0;
}
@@ -330,12 +330,12 @@ int MirandaLoaded(WPARAM, LPARAM) CMenuItem mi;
SET_UID(mi, 0xfabb9181, 0xdb92, 0x43f4, 0x86, 0x40, 0xca, 0xb6, 0x4c, 0x93, 0x34, 0x27);
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Popups"), 0);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 0);
mi.flags = CMIF_TCHAR;
if (g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY))
- mi.name.t = LPGENT("Disable c&lient change notification");
+ mi.name.w = LPGENW("Disable c&lient change notification");
else
- mi.name.t = LPGENT("Enable c&lient change notification");
+ mi.name.w = LPGENW("Enable c&lient change notification");
mi.pszService = MS_CCN_TOGGLEPOPUPS;
g_hTogglePopupsMenuItem = Menu_AddMainMenuItem(&mi);
diff --git a/plugins/ClientChangeNotify/src/Misc.h b/plugins/ClientChangeNotify/src/Misc.h index d490677750..7d1b1eb238 100644 --- a/plugins/ClientChangeNotify/src/Misc.h +++ b/plugins/ClientChangeNotify/src/Misc.h @@ -20,7 +20,7 @@ #include "stdafx.h"
extern BOOL bPopupExists;
-__inline void ShowMsg(TCHAR *FirstLine, TCHAR *SecondLine = L"", bool IsErrorMsg = false, int Timeout = 0)
+__inline void ShowMsg(wchar_t *FirstLine, wchar_t *SecondLine = L"", bool IsErrorMsg = false, int Timeout = 0)
{
if (bPopupExists)
{
@@ -43,7 +43,7 @@ __inline void ShowLog(TCString &LogFilePath) INT_PTR Result = (INT_PTR)ShellExecute(NULL, L"open", LogFilePath, NULL, NULL, SW_SHOW);
if (Result <= 32) // Error
{
- TCHAR szError[64];
+ wchar_t szError[64];
mir_sntprintf(szError, TranslateT("Error #%d"), Result);
ShowMsg(szError, TranslateT("Can't open log file ") + LogFilePath, true);
}
@@ -52,10 +52,10 @@ __inline void ShowLog(TCString &LogFilePath) __inline void RecompileRegexps(TCString IgnoreSubstrings)
{
FreePcreCompileData();
- TCHAR *p = _tcstok(IgnoreSubstrings, L";");
+ wchar_t *p = wcstok(IgnoreSubstrings, L";");
while (p)
{
CompileRegexp(p, p[0] != '/');
- p = _tcstok(NULL, L";");
+ p = wcstok(NULL, L";");
}
}
diff --git a/plugins/ClientChangeNotify/src/OptDlg.cpp b/plugins/ClientChangeNotify/src/OptDlg.cpp index 4aefc4c519..9ec69fe61c 100644 --- a/plugins/ClientChangeNotify/src/OptDlg.cpp +++ b/plugins/ClientChangeNotify/src/OptDlg.cpp @@ -58,17 +58,17 @@ void EnablePopupOptDlgControls() static struct
{
- TCHAR *Text;
+ wchar_t *Text;
int Action;
}
PopupActions[] =
{
- LPGENT("Open message window"), PCA_OPENMESSAGEWND,
- LPGENT("Close popup"), PCA_CLOSEPOPUP,
- LPGENT("Open contact details window"), PCA_OPENDETAILS,
- LPGENT("Open contact menu"), PCA_OPENMENU,
- LPGENT("Open contact history"), PCA_OPENHISTORY,
- LPGENT("Do nothing"), PCA_DONOTHING
+ LPGENW("Open message window"), PCA_OPENMESSAGEWND,
+ LPGENW("Close popup"), PCA_CLOSEPOPUP,
+ LPGENW("Open contact details window"), PCA_OPENDETAILS,
+ LPGENW("Open contact menu"), PCA_OPENMENU,
+ LPGENW("Open contact history"), PCA_OPENHISTORY,
+ LPGENW("Do nothing"), PCA_DONOTHING
};
INT_PTR CALLBACK PopupOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -163,11 +163,11 @@ int OptionsDlgInit(WPARAM wParam, LPARAM) if (bPopupExists) {
OPTIONSDIALOGPAGE optDi = { sizeof(optDi) };
optDi.position = 920000000;
- optDi.ptszTitle = LPGENT("ClientChangeNotify");
+ optDi.pwszTitle = LPGENW("ClientChangeNotify");
optDi.pfnDlgProc = PopupOptDlg;
optDi.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPOPTDLG);
optDi.hInstance = g_hInstance;
- optDi.ptszGroup = LPGENT("Popups");
+ optDi.pwszGroup = LPGENW("Popups");
optDi.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &optDi);
}
diff --git a/plugins/ClientChangeNotify/src/Options.cpp b/plugins/ClientChangeNotify/src/Options.cpp index aea2556676..62463ea611 100644 --- a/plugins/ClientChangeNotify/src/Options.cpp +++ b/plugins/ClientChangeNotify/src/Options.cpp @@ -286,7 +286,7 @@ int TreeReadEnum(const char *szSetting, LPARAM lParam) pItem.Title = db_get_s(NULL, pData->sModule, *pData->sDBSettingPrefix + szSetting, L"");
pItem.User_Str1 = (pData->TreeCtrl->User_Str1_DBName == NULL) ? NULL :
db_get_s(NULL, pData->sModule,
- *pData->sDBSettingPrefix + pData->TreeCtrl->sDBSetting + pData->TreeCtrl->User_Str1_DBName + (szSetting + Len), (TCHAR*)NULL);
+ *pData->sDBSettingPrefix + pData->TreeCtrl->sDBSetting + pData->TreeCtrl->User_Str1_DBName + (szSetting + Len), (wchar_t*)NULL);
}
}
return 0;
@@ -722,7 +722,7 @@ void COptItem_ListCtrl::MemToWnd(HWND hWnd) SendMessage(hListView, LB_RESETCONTENT, 0, 0);
for (int i = 0; i < m_value.GetSize(); i++)
- SendMessage(hListView, LB_INSERTSTRING, -1, (LPARAM)(TCHAR*)m_value[i].Text);
+ SendMessage(hListView, LB_INSERTSTRING, -1, (LPARAM)(wchar_t*)m_value[i].Text);
SendMessage(hListView, WM_SETREDRAW, true, 0);
COptItem::MemToWnd(hWnd);
@@ -794,7 +794,7 @@ void COptItem_ListCtrl::ModifyItem(HWND hWnd, int ID, CListItem &Item) int TopIndex = SendMessage(hListView, LB_GETTOPINDEX, 0, 0);
int Res = SendMessage(hListView, LB_DELETESTRING, ID, 0);
_ASSERT(Res != LB_ERR);
- Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(TCHAR*)(Item.Text));
+ Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(wchar_t*)(Item.Text));
_ASSERT(Res != LB_ERR && Res != LB_ERRSPACE);
SendMessage(hListView, LB_SETCURSEL, CurSel, 0);
SendMessage(hListView, LB_SETTOPINDEX, TopIndex, 0);
@@ -808,7 +808,7 @@ CListItem* COptItem_ListCtrl::InsertItem(HWND hWnd, int ID, CListItem &Item) // ID is position at which to insert the item; -1 = add to the end of the list
{
HWND hListView = GetDlgItem(hWnd, m_dlgItemID);
- int Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(TCHAR*)(Item.Text)); // LB_INSERTSTRING doesn't sort the lists even with LBS_SORT style
+ int Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(wchar_t*)(Item.Text)); // LB_INSERTSTRING doesn't sort the lists even with LBS_SORT style
_ASSERT(Res != LB_ERR && Res != LB_ERRSPACE);
int i = m_value.AddElem(Item);
m_bModified = true;
diff --git a/plugins/ClientChangeNotify/src/Options.h b/plugins/ClientChangeNotify/src/Options.h index b22a0b902b..aac3e9d1c0 100644 --- a/plugins/ClientChangeNotify/src/Options.h +++ b/plugins/ClientChangeNotify/src/Options.h @@ -92,7 +92,7 @@ class COptItem_Edit : public COptItem {
public:
COptItem_Edit() {}
- COptItem_Edit(int m_dlgItemID, char *szDBSetting, int nMaxLen, TCHAR *szDefValue, int lParam = 0, bool m_bReadOnly = false)
+ COptItem_Edit(int m_dlgItemID, char *szDBSetting, int nMaxLen, wchar_t *szDefValue, int lParam = 0, bool m_bReadOnly = false)
: COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue)
{}
@@ -323,7 +323,7 @@ class COptItem_StrDBSetting : public COptItem {
public:
COptItem_StrDBSetting() {}
- COptItem_StrDBSetting(int m_dlgItemID, char *szDBSetting, int nMaxLen, TCHAR *szDefValue, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue) {}
+ COptItem_StrDBSetting(int m_dlgItemID, char *szDBSetting, int nMaxLen, wchar_t *szDefValue, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue) {}
void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { sValue = GetStrDBVal(sModule, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetStrDBVal(sModule, sValue, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { COptItem::WndToMem(hWnd); }
diff --git a/plugins/ClientChangeNotify/src/pcre.cpp b/plugins/ClientChangeNotify/src/pcre.cpp index 259e9facdb..c7954f265f 100644 --- a/plugins/ClientChangeNotify/src/pcre.cpp +++ b/plugins/ClientChangeNotify/src/pcre.cpp @@ -71,8 +71,8 @@ TCString CompileRegexp(TCString Regexp, int bAddAsUsualSubstring, int ID) {
TCString OrigRegexp = Regexp;
Regexp = Regexp.Right(Regexp.GetLen() - 1);
- TCHAR *pRegexpEnd = (TCHAR*)Regexp + Regexp.GetLen();
- TCHAR *p = _tcsrchr(Regexp.GetBuffer(), '/');
+ wchar_t *pRegexpEnd = (wchar_t*)Regexp + Regexp.GetLen();
+ wchar_t *p = wcsrchr(Regexp.GetBuffer(), '/');
if (!p)
{
Regexp = OrigRegexp;
@@ -126,7 +126,7 @@ TCString CompileRegexp(TCString Regexp, int bAddAsUsualSubstring, int ID) PcreCompileData[NewID].pExtra = pcre16_study(PcreCompileData[NewID].pPcre, 0, &Err);
}
else {
- // Result += LogMessage(TranslateT("Syntax error in regexp\n%s\nat offset %d: %s."), (TCHAR*)Regexp, ErrOffs, (TCHAR*)ANSI2TCHAR(Err)) + L"\n\n";
+ // Result += LogMessage(TranslateT("Syntax error in regexp\n%s\nat offset %d: %s."), (wchar_t*)Regexp, ErrOffs, (wchar_t*)ANSI2TCHAR(Err)) + L"\n\n";
PcreCompileData[NewID].Pattern = Regexp;
}
}
@@ -165,7 +165,7 @@ int PcreCheck(TCString Str, int StartingID) }
} else
{
- if (_tcsstr(Str.ToLower(), PcreCompileData[I].Pattern.ToLower()))
+ if (wcsstr(Str.ToLower(), PcreCompileData[I].Pattern.ToLower()))
{
return PcreCompileData[I].ID;
}
diff --git a/plugins/Clist_blind/src/clcopts.cpp b/plugins/Clist_blind/src/clcopts.cpp index 36a6dad54c..3a60f5c8cf 100644 --- a/plugins/Clist_blind/src/clcopts.cpp +++ b/plugins/Clist_blind/src/clcopts.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-TCHAR* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setting, TCHAR* out, size_t len, TCHAR *def);
+wchar_t* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setting, wchar_t* out, size_t len, wchar_t *def);
#define DBFONTF_BOLD 1
#define DBFONTF_ITALIC 2
@@ -55,34 +55,34 @@ 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)
@@ -118,7 +118,7 @@ static DWORD MakeCheckBoxTreeFlags(HWND hwndTree) static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR tmp[1024];
+ wchar_t tmp[1024];
switch (msg) {
case WM_INITDIALOG:
diff --git a/plugins/Clist_blind/src/clcpaint.cpp b/plugins/Clist_blind/src/clcpaint.cpp index 2371b69626..0c9824e4eb 100644 --- a/plugins/Clist_blind/src/clcpaint.cpp +++ b/plugins/Clist_blind/src/clcpaint.cpp @@ -269,7 +269,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) int hottrack = dat->exStyle & CLS_EX_TRACKSELECT && cc->type != CLCIT_DIVIDER && dat->iHotTrack == index;
SIZE textSize, countsSize = { 0 }, spaceSize = { 0 };
int width, checkboxWidth;
- TCHAR *szCounts = NULL;
+ wchar_t *szCounts = NULL;
// alternating grey
if (style & CLS_GREYALTERNATE && index & 1) {
@@ -414,7 +414,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) }
}
else {
- TCHAR *szText = cc->szText;
+ wchar_t *szText = cc->szText;
RECT rc;
rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace;
rc.top = y + ((dat->rowHeight - fontHeight) >> 1);
@@ -424,7 +424,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) }
if (selected) {
if (cc->type != CLCIT_DIVIDER) {
- TCHAR *szText = cc->szText;
+ wchar_t *szText = cc->szText;
RECT rc;
int qlen = (int)mir_tstrlen(dat->szQuickSearch);
SetTextColor(hdcMem, dat->quickSearchColour);
diff --git a/plugins/Clist_blind/src/cluiopts.cpp b/plugins/Clist_blind/src/cluiopts.cpp index 4490d55ee2..bccb11eca6 100644 --- a/plugins/Clist_blind/src/cluiopts.cpp +++ b/plugins/Clist_blind/src/cluiopts.cpp @@ -167,7 +167,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/plugins/Clist_blind/src/contact.cpp b/plugins/Clist_blind/src/contact.cpp index f93b16b71f..3adbd0c4da 100644 --- a/plugins/Clist_blind/src/contact.cpp +++ b/plugins/Clist_blind/src/contact.cpp @@ -83,9 +83,9 @@ int CompareContacts(const ClcContact* c1, const ClcContact* c2) return 2 * (statusa == ID_STATUS_OFFLINE) - 1;
}
- TCHAR namea[128];
- TCHAR *nameb = pcli->pfnGetContactDisplayName(a, 0);
- _tcsncpy_s(namea, nameb, _TRUNCATE);
+ wchar_t namea[128];
+ wchar_t *nameb = pcli->pfnGetContactDisplayName(a, 0);
+ wcsncpy_s(namea, nameb, _TRUNCATE);
namea[ _countof(namea)-1 ] = 0;
nameb = pcli->pfnGetContactDisplayName(b, 0);
diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp index 2bc79bdbed..30ccfa6c0c 100644 --- a/plugins/Clist_blind/src/init.cpp +++ b/plugins/Clist_blind/src/init.cpp @@ -176,11 +176,11 @@ extern "C" int __declspec(dllexport) Unload(void) /////////////////////////////////////////////////////////////////////////////////////////
-TCHAR* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setting, TCHAR* out, size_t len, TCHAR *def)
+wchar_t* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setting, wchar_t* out, size_t len, wchar_t *def)
{
DBVARIANT dbv;
- out[0] = _T('\0');
+ out[0] = '\0';
if (!db_get_ts(hContact, module, setting, &dbv)) {
if (dbv.type == DBVT_ASCIIZ)
@@ -206,13 +206,13 @@ TCHAR* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setti typedef struct
{
- TCHAR *text;
+ wchar_t *text;
size_t allocated;
size_t used;
} StringHelper;
-int CopyData(StringHelper *str, const TCHAR *text, size_t len)
+int CopyData(StringHelper *str, const wchar_t *text, size_t len)
{
size_t totalSize;
@@ -228,7 +228,7 @@ int CopyData(StringHelper *str, const TCHAR *text, size_t len) totalSize += DATA_BLOCK - (totalSize % DATA_BLOCK);
if (str->text != NULL) {
- TCHAR *tmp = (TCHAR *)mir_realloc(str->text, sizeof(TCHAR) * totalSize);
+ wchar_t *tmp = (wchar_t *)mir_realloc(str->text, sizeof(wchar_t) * totalSize);
if (tmp == NULL) {
mir_free(str->text);
@@ -238,7 +238,7 @@ int CopyData(StringHelper *str, const TCHAR *text, size_t len) str->text = tmp;
}
else {
- str->text = (TCHAR *)mir_alloc(sizeof(TCHAR) * totalSize);
+ str->text = (wchar_t *)mir_alloc(sizeof(wchar_t) * totalSize);
if (str->text == NULL) {
return -2;
@@ -248,7 +248,7 @@ int CopyData(StringHelper *str, const TCHAR *text, size_t len) str->allocated = totalSize;
}
- memmove(&str->text[str->used], text, sizeof(TCHAR) * len);
+ memmove(&str->text[str->used], text, sizeof(wchar_t) * len);
str->used += len;
str->text[str->used] = '\0';
@@ -256,9 +256,9 @@ int CopyData(StringHelper *str, const TCHAR *text, size_t len) }
-TCHAR * ParseText(const TCHAR *text,
- const TCHAR **variables, size_t variablesSize,
- const TCHAR **data, size_t dataSize)
+wchar_t * ParseText(const wchar_t *text,
+ const wchar_t **variables, size_t variablesSize,
+ const wchar_t **data, size_t dataSize)
{
size_t length = mir_tstrlen(text);
size_t nextPos = 0;
@@ -267,13 +267,13 @@ TCHAR * ParseText(const TCHAR *text, // length - 1 because a % in last char will be a % and point
for (i = 0; i < length - 1; i++) {
- if (text[i] == _T('%')) {
+ if (text[i] == '%') {
BOOL found = FALSE;
if (CopyData(&ret, &text[nextPos], i - nextPos))
return NULL;
- if (text[i + 1] == _T('%')) {
+ if (text[i + 1] == '%') {
if (CopyData(&ret, L"%", 1))
return NULL;
@@ -289,7 +289,7 @@ TCHAR * ParseText(const TCHAR *text, for (j = 0; j < size; j++) {
size_t vlen = mir_tstrlen(variables[j]);
- if (_tcsnicmp(&text[i], variables[j], vlen) == 0) {
+ if (wcsnicmp(&text[i], variables[j], vlen) == 0) {
if (CopyData(&ret, data[j], mir_tstrlen(data[j])))
return NULL;
@@ -407,18 +407,18 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L return coreCli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
-TCHAR status_name[128];
-TCHAR* GetStatusName(struct ClcContact *item)
+wchar_t status_name[128];
+wchar_t* GetStatusName(struct ClcContact *item)
{
int status;
- status_name[0] = _T('\0');
+ status_name[0] = '\0';
if (item->hContact == NULL || item->proto == NULL)
return status_name;
// Get XStatusName
MyDBGetContactSettingTString(item->hContact, item->proto, "XStatusName", status_name, _countof(status_name), NULL);
- if (status_name[0] != _T('\0'))
+ if (status_name[0] != '\0')
return status_name;
// Get status name
@@ -429,16 +429,16 @@ TCHAR* GetStatusName(struct ClcContact *item) }
-TCHAR status_message[256];
-TCHAR* GetStatusMessage(struct ClcContact *item)
+wchar_t status_message[256];
+wchar_t* GetStatusMessage(struct ClcContact *item)
{
- status_message[0] = _T('\0');
+ status_message[0] = '\0';
if (item->hContact == NULL || item->proto == NULL)
return status_message;
// Get XStatusMsg
MyDBGetContactSettingTString(item->hContact, item->proto, "XStatusMsg", status_message, _countof(status_message), NULL);
- if (status_message[0] != _T('\0'))
+ if (status_message[0] != '\0')
return status_message;
// Get status message
@@ -448,8 +448,8 @@ TCHAR* GetStatusMessage(struct ClcContact *item) }
-TCHAR proto_name[128];
-TCHAR* GetProtoName(struct ClcContact *item)
+wchar_t proto_name[128];
+wchar_t* GetProtoName(struct ClcContact *item)
{
#ifdef UNICODE
char description[128];
@@ -480,12 +480,12 @@ TCHAR* GetProtoName(struct ClcContact *item) void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig)
{
ClcData *dat = (ClcData*)tmp_dat;
- TCHAR tmp[1024];
- TCHAR count[128];
- TCHAR template_contact[1024];
- TCHAR template_group[1024];
- TCHAR template_divider[1024];
- TCHAR template_info[1024];
+ wchar_t tmp[1024];
+ wchar_t count[128];
+ wchar_t template_contact[1024];
+ wchar_t template_group[1024];
+ wchar_t template_divider[1024];
+ wchar_t template_info[1024];
int selection = dat->selection;
BOOL has_focus = (GetFocus() == dat->hwnd_list || GetFocus() == hwnd);
@@ -509,7 +509,7 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig) ClcGroup *group = &dat->list;
group->scanIndex = 0;
- TCHAR *text = tmp;
+ wchar_t *text = tmp;
size_t size = _countof(tmp);
while (true) {
if (group->scanIndex == group->cl.getCount()) {
@@ -522,17 +522,17 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig) }
ClcContact *item = group->cl[group->scanIndex];
- text[0] = _T('\0');
+ text[0] = '\0';
switch (item->type) {
case CLCIT_GROUP:
{
- TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, item);
- const TCHAR *t[] = {
+ wchar_t *szCounts = pcli->pfnGetGroupCountsText(dat, item);
+ const wchar_t *t[] = {
L"%name%",
L"%count%",
L"%mode%"
};
- const TCHAR *v[] = {
+ const wchar_t *v[] = {
item->szText,
count,
item->group->expanded ? TranslateT("Expanded") : TranslateT("Collapsed")
@@ -541,9 +541,9 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig) if (szCounts[0] != '\0')
mir_sntprintf(count, L"%s ", szCounts);
else
- count[0] = _T('\0');
+ count[0] = '\0';
- TCHAR *txt = ParseText(template_group, t, _countof(t), v, _countof(v));
+ wchar_t *txt = ParseText(template_group, t, _countof(t), v, _countof(v));
if (txt != NULL)
mir_tstrncpy(text, txt, size);
mir_free(txt);
@@ -552,20 +552,20 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig) case CLCIT_CONTACT:
{
- const TCHAR *t[] = {
+ const wchar_t *t[] = {
L"%name%",
L"%status%",
L"%protocol%",
L"%status_message%"
};
- const TCHAR *v[] = {
+ const wchar_t *v[] = {
item->szText,
GetStatusName(item),
GetProtoName(item),
GetStatusMessage(item)
};
- TCHAR *txt = ParseText(template_contact, t, _countof(t), v, _countof(v));
+ wchar_t *txt = ParseText(template_contact, t, _countof(t), v, _countof(v));
if (txt != NULL)
mir_tstrncpy(text, txt, size);
mir_free(txt);
@@ -585,8 +585,8 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig) if (item->type == CLCIT_GROUP && item->group->expanded) {
group = item->group;
- text[0] = _T(' ');
- text[1] = _T(' ');
+ text[0] = ' ';
+ text[1] = ' ';
text += 2;
size -= 2;
group->scanIndex = 0;
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp index 94b4ad3170..38d402c835 100644 --- a/plugins/Clist_modern/src/cluiframes.cpp +++ b/plugins/Clist_modern/src/cluiframes.cpp @@ -1504,7 +1504,7 @@ static int CLUIFramesLoadMainMenu() mi.hIcolibItem = F.TitleBar.hicon;
mi.flags = CMIF_SYSTEM | CMIF_TCHAR;
mi.position = separator++;
- mi.name.t = F.TitleBar.tbname ? F.TitleBar.tbname : F.name;
+ mi.name.w = F.TitleBar.tbname ? F.TitleBar.tbname : F.name;
mi.pszService = 0;
g_frameMenus.insert(F.MenuHandles.MainMenuItem = Menu_AddMainMenuItem(&mi));
CLUIFramesCreateMenuForFrame(F.id, F.MenuHandles.MainMenuItem, separator, true);
@@ -1565,7 +1565,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM) g_pfwFrames[g_nFramesCount].dwFlags = clfrm->Flags;
if (clfrm->name == NULL || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->wname) : mir_strlen(clfrm->name)) == 0) {
- g_pfwFrames[g_nFramesCount].name = (LPTSTR)mir_alloc(255 * sizeof(TCHAR));
+ g_pfwFrames[g_nFramesCount].name = (LPTSTR)mir_alloc(255 * sizeof(wchar_t));
GetClassName(g_pfwFrames[g_nFramesCount].hWnd, g_pfwFrames[g_nFramesCount].name, 255);
}
else g_pfwFrames[g_nFramesCount].name = (clfrm->Flags & F_UNICODE) ? mir_u2t(clfrm->wname) : mir_a2t(clfrm->name);
@@ -2730,7 +2730,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam int pos;
//tbinfo
{
- TCHAR TBcapt[255];
+ wchar_t TBcapt[255];
pos = id2pos(Frameid);
if (pos != -1) {
int oldflags;
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp index 60358a3851..9eb5a578f8 100644 --- a/plugins/Clist_modern/src/modern_aniavatars.cpp +++ b/plugins/Clist_modern/src/modern_aniavatars.cpp @@ -28,8 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define IMMEDIATE_DRAW (!s_bSeparateWindow)
-void GDIPlus_ExtractAnimatedGIF(TCHAR *szName, int width, int height, HBITMAP &pBmp, int* &pframesDelay, int &pframesCount, SIZE &sizeAvatar);
-BOOL GDIPlus_IsAnimatedGif(TCHAR *szName);
+void GDIPlus_ExtractAnimatedGIF(wchar_t *szName, int width, int height, HBITMAP &pBmp, int* &pframesDelay, int &pframesCount, SIZE &sizeAvatar);
+BOOL GDIPlus_IsAnimatedGif(wchar_t *szName);
/* Next is module */
#define ANIAVAWINDOWCLASS L"MirandaModernAniAvatar"
@@ -43,7 +43,7 @@ BOOL GDIPlus_IsAnimatedGif(TCHAR *szName); //messages
enum {
AAM_FIRST = WM_USER,
- AAM_SETAVATAR, //sync WPARAM: TCHAR * filename, LPARAM: SIZE * size, RESULT: actual size
+ AAM_SETAVATAR, //sync WPARAM: wchar_t * filename, LPARAM: SIZE * size, RESULT: actual size
AAM_SETPOSITION, //async LPARAM: pointer to set pos info - the handler will empty it, RESULT: 0
AAM_REDRAW, //async
AAM_STOP, //async stops animation, timer, hide window - prepeare for deleting
@@ -73,7 +73,7 @@ struct ANIAVA_OBJECT : public MZeroedObject struct ANIAVA_INFO
{
DWORD dwAvatarUniqId;
- TCHAR *tcsFilename;
+ wchar_t *tcsFilename;
int nRefCount;
int nStripTop;
int nFrameCount;
@@ -229,11 +229,11 @@ static void CALLBACK _AniAva_SyncCallerUserAPCProc(DWORD_PTR dwParam) static INT_PTR _AniAva_CreateAvatarWindowSync_Worker(WPARAM tszName, LPARAM)
{
HWND hwnd = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_NOPARENTNOTIFY, ANIAVAWINDOWCLASS,
- (TCHAR*)tszName, WS_POPUP, 0, 0, 1, 1, pcli->hwndContactList, NULL, pcli->hInst, NULL);
+ (wchar_t*)tszName, WS_POPUP, 0, 0, 1, 1, pcli->hwndContactList, NULL, pcli->hInst, NULL);
return (INT_PTR)hwnd;
}
-static HWND _AniAva_CreateAvatarWindowSync(TCHAR *szFileName)
+static HWND _AniAva_CreateAvatarWindowSync(wchar_t *szFileName)
{
if (s_AnimationThreadHandle == 0 || s_AnimationThreadID == 0)
return NULL;
@@ -340,7 +340,7 @@ static void _AniAva_RealRemoveAvatar(DWORD UniqueID) }
}
-static int _AniAva_LoadAvatarFromImage(TCHAR * szFileName, int width, int height, ANIAVATARIMAGEINFO *pRetAII)
+static int _AniAva_LoadAvatarFromImage(wchar_t * szFileName, int width, int height, ANIAVATARIMAGEINFO *pRetAII)
{
ANIAVA_INFO aai = { 0 };
aai.tcsFilename = szFileName;
@@ -774,7 +774,7 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR //=======================================================================================
// adds avatars to be displayed
-int AniAva_AddAvatar(MCONTACT hContact, TCHAR * szFilename, int width, int heigth)
+int AniAva_AddAvatar(MCONTACT hContact, wchar_t * szFilename, int width, int heigth)
{
aacheck 0;
if (!GDIPlus_IsAnimatedGif(szFilename))
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index 326722ab11..95e2a7f196 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -36,7 +36,7 @@ typedef BOOL(*ExecuteOnAllContactsFuncPtr) (ClcContact *contact, BOOL subcontact ///////////////////////////////////////////////////////////////////////////////////////// // Module static declarations -static int CopySkipUnprintableChars(TCHAR *to, TCHAR * buf, DWORD size); +static int CopySkipUnprintableChars(wchar_t *to, wchar_t * buf, DWORD size); static BOOL ExecuteOnAllContacts(ClcData *dat, ExecuteOnAllContactsFuncPtr func, void *param); static BOOL ExecuteOnAllContactsOfGroup(ClcGroup *group, ExecuteOnAllContactsFuncPtr func, void *param); @@ -71,7 +71,7 @@ void Cache_GetText(ClcData *dat, ClcContact *contact) } } -void CSmileyString::AddListeningToIcon(ClcData *dat, TCHAR *szText) +void CSmileyString::AddListeningToIcon(ClcData *dat, wchar_t *szText) { iMaxSmileyHeight = 0; DestroySmileyList(); @@ -170,7 +170,7 @@ void CSmileyString::DestroySmileyList() ///////////////////////////////////////////////////////////////////////////////////////// // Parsing of text for smiley // -void CSmileyString::ReplaceSmileys(ClcData *dat, ClcCacheEntry *pdnce, TCHAR * szText, BOOL replace_smileys) +void CSmileyString::ReplaceSmileys(ClcData *dat, ClcCacheEntry *pdnce, wchar_t * szText, BOOL replace_smileys) { int last_pos = 0; iMaxSmileyHeight = 0; @@ -270,7 +270,7 @@ void CSmileyString::ReplaceSmileys(ClcData *dat, ClcCacheEntry *pdnce, TCHAR * s // Getting Status name // returns -1 for XStatus, 1 for Status // -int GetStatusName(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus_has_priority) +int GetStatusName(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus_has_priority) { BOOL noAwayMsg = FALSE; BOOL noXstatus = FALSE; @@ -293,7 +293,7 @@ int GetStatusName(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus } // Get Status name - TCHAR *tmp = pcli->pfnGetStatusModeDescription(nStatus, 0); + wchar_t *tmp = pcli->pfnGetStatusModeDescription(nStatus, 0); if (tmp && *tmp) { mir_tstrncpy(text, tmp, text_size); return 1; @@ -317,9 +317,9 @@ int GetStatusName(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus ///////////////////////////////////////////////////////////////////////////////////////// // Get Listening to information // -void GetListeningTo(TCHAR *text, int text_size, ClcCacheEntry *pdnce) +void GetListeningTo(wchar_t *text, int text_size, ClcCacheEntry *pdnce) { - *text = _T('\0'); + *text = '\0'; if (pdnce->m_iStatus == ID_STATUS_OFFLINE || pdnce->m_iStatus == 0) return; @@ -333,7 +333,7 @@ void GetListeningTo(TCHAR *text, int text_size, ClcCacheEntry *pdnce) // Getting Status message(Away message) // returns -1 for XStatus, 1 for Status // -int GetStatusMessage(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus_has_priority) +int GetStatusMessage(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus_has_priority) { BOOL noAwayMsg = FALSE; WORD wStatus = pdnce->getStatus(); @@ -393,7 +393,7 @@ LBL_Status: // Try to get XStatusMsg ptrT tszXStatusMsg(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusMsg")); if (tszXStatusMsg != NULL && tszXStatusMsg[0] != 0) { - TCHAR *tmp = NEWTSTR_ALLOCA(text); + wchar_t *tmp = NEWWSTR_ALLOCA(text); mir_sntprintf(text, text_size, L"%s: %s", tmp, tszXStatusMsg); CopySkipUnprintableChars(text, text, text_size - 1); } @@ -415,7 +415,7 @@ LBL_Status: // Try to get XStatusName ptrT tszXStatusName(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusName")); if (tszXStatusName != NULL && tszXStatusName[0] != 0) { - TCHAR *tmp = NEWTSTR_ALLOCA(text); + wchar_t *tmp = NEWWSTR_ALLOCA(text); mir_sntprintf(text, text_size, L"%s: %s", tszXStatusName, tmp); CopySkipUnprintableChars(text, text, text_size - 1); } @@ -474,11 +474,11 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact) return; ClcCacheEntry *pdnce = contact->pce; - TCHAR *name = pcli->pfnGetContactDisplayName(contact->hContact, 0); + wchar_t *name = pcli->pfnGetContactDisplayName(contact->hContact, 0); if (dat->first_line_append_nick && !dat->bForceInDialog) { DBVARIANT dbv = { 0 }; if (!db_get_ts(pdnce->hContact, pdnce->m_pszProto, "Nick", &dbv)) { - TCHAR nick[_countof(contact->szText)]; + wchar_t nick[_countof(contact->szText)]; mir_tstrncpy(nick, dbv.ptszVal, _countof(contact->szText)); db_free(&dbv); @@ -501,9 +501,9 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact) void Cache_GetNthLineText(ClcData *dat, ClcCacheEntry *pdnce, int n) { - TCHAR Text[240 - EXTRA_ICON_COUNT]; Text[0] = 0; + wchar_t Text[240 - EXTRA_ICON_COUNT]; Text[0] = 0; ClcLineInfo &line = (n == 2) ? dat->secondLine : dat->thirdLine; - TCHAR* &szText = (n == 2) ? pdnce->szSecondLineText : pdnce->szThirdLineText; + wchar_t* &szText = (n == 2) ? pdnce->szSecondLineText : pdnce->szThirdLineText; // in most cases replaceStrT does nothing if (!line.show) { @@ -521,7 +521,7 @@ void Cache_GetNthLineText(ClcData *dat, ClcCacheEntry *pdnce, int n) replaceStrT(szText, Text); CSmileyString &ss = (n == 2) ? pdnce->ssSecondLine : pdnce->ssThirdLine; - if (type == TEXT_LISTENING_TO && szText[0] != _T('\0')) + if (type == TEXT_LISTENING_TO && szText[0] != '\0') ss.AddListeningToIcon(dat, szText); else ss.ReplaceSmileys(dat, pdnce, szText, line.draw_smileys); @@ -529,25 +529,25 @@ void Cache_GetNthLineText(ClcData *dat, ClcCacheEntry *pdnce, int n) ///////////////////////////////////////////////////////////////////////////////////////// -void RemoveTag(TCHAR *to, TCHAR *tag) +void RemoveTag(wchar_t *to, wchar_t *tag) { - TCHAR *st = to; + wchar_t *st = to; int len = (int)mir_tstrlen(tag); int lastsize = (int)mir_tstrlen(to) + 1; - while (st = _tcsstr(st, tag)) { + while (st = wcsstr(st, tag)) { lastsize -= len; - memmove((void*)st, (void*)(st + len), (lastsize)*sizeof(TCHAR)); + memmove((void*)st, (void*)(st + len), (lastsize)*sizeof(wchar_t)); } } ///////////////////////////////////////////////////////////////////////////////////////// // Copy string with removing Escape chars from text and BBcodes -static int CopySkipUnprintableChars(TCHAR *to, TCHAR * buf, DWORD size) +static int CopySkipUnprintableChars(wchar_t *to, wchar_t * buf, DWORD size) { DWORD i; BOOL keep = 0; - TCHAR * cp = to; + wchar_t * cp = to; if (!to) return 0; if (!buf) { to[0] = '\0'; diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index ebc88e2976..91d9be08c1 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -44,7 +44,7 @@ static int StartScrollPos = 0; static BOOL g_bSortTimerIsSet = FALSE;
static ClcContact *hitcontact = NULL;
HANDLE hSkinFolder;
-TCHAR SkinsFolder[MAX_PATH];
+wchar_t SkinsFolder[MAX_PATH];
int ReloadSkinFolder(WPARAM, LPARAM)
{
@@ -202,7 +202,7 @@ static int clcProceedDragToScroll(HWND hwnd, int Y) return 1;
}
-static int clcSearchNextContact(HWND hwnd, ClcData *dat, int index, const TCHAR *text, int prefixOk, BOOL fSearchUp)
+static int clcSearchNextContact(HWND hwnd, ClcData *dat, int index, const wchar_t *text, int prefixOk, BOOL fSearchUp)
{
ClcGroup *group = &dat->list;
int testlen = (int)mir_tstrlen(text);
@@ -225,9 +225,9 @@ static int clcSearchNextContact(HWND hwnd, ClcData *dat, int index, const TCHAR found = true;
}
else if (dat->bFilterSearch) {
- TCHAR *lowered_szText = CharLowerW(NEWTSTR_ALLOCA(cc->szText));
- TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
- found = _tcsstr(lowered_szText, lowered_search) != NULL;
+ wchar_t *lowered_szText = CharLowerW(NEWWSTR_ALLOCA(cc->szText));
+ wchar_t *lowered_search = CharLowerW(NEWWSTR_ALLOCA(dat->szQuickSearch));
+ found = wcsstr(lowered_szText, lowered_search) != NULL;
}
else found = ((prefixOk && CSTR_EQUAL == CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, text, -1, cc->szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, cc->szText)));
@@ -1065,7 +1065,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (dat->dragStage == (DRAGSTAGE_NOTMOVED | DRAGSTAGEF_MAYBERENAME))
CLUI_SafeSetTimer(hwnd, TIMERID_RENAME, GetDoubleClickTime(), NULL);
else if ((dat->dragStage & DRAGSTAGEM_STAGE) == DRAGSTAGE_ACTIVE) {
- TCHAR Wording[500];
+ wchar_t Wording[500];
ClcContact *contDest, *contSour;
POINT pt = UNPACK_POINT(lParam);
int target = GetDropTargetInformation(hwnd, dat, pt);
@@ -1198,13 +1198,13 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, ClcGroup *group, *destgroup;
{
BOOL NeedRename = FALSE;
- TCHAR newName[128] = { 0 };
+ wchar_t newName[128] = { 0 };
pcli->pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
int i = pcli->pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
if (i != -1 && group->groupId != destgroup->groupId) {
- TCHAR *groupName = mir_tstrdup(Clist_GroupGetName(contact->groupId, 0));
- TCHAR *shortGroup = NULL;
- TCHAR *sourceGrName = mir_tstrdup(Clist_GroupGetName(destgroup->groupId, 0));
+ wchar_t *groupName = mir_tstrdup(Clist_GroupGetName(contact->groupId, 0));
+ wchar_t *shortGroup = NULL;
+ wchar_t *sourceGrName = mir_tstrdup(Clist_GroupGetName(destgroup->groupId, 0));
if (groupName) {
int len = (int)mir_tstrlen(groupName);
do { len--; } while (len >= 0 && groupName[len] != '\\');
@@ -1562,11 +1562,11 @@ static int clcHookModulesLoaded(WPARAM, LPARAM) FoldersGetCustomPathT(hSkinFolder, SkinsFolder, _countof(SkinsFolder), _T(DEFAULT_SKIN_FOLDER));
// Get icons
- TCHAR szMyPath[MAX_PATH];
+ wchar_t szMyPath[MAX_PATH];
GetModuleFileName(g_hInst, szMyPath, _countof(szMyPath));
SKINICONDESC sid = { 0 };
- sid.defaultFile.t = szMyPath;
+ sid.defaultFile.w = szMyPath;
sid.flags = SIDF_PATH_TCHAR;
sid.section.a = LPGEN("Contact list");
@@ -1666,7 +1666,7 @@ int ClcDoProtoAck(ACKDATA *ack) if (db_get_b(ack->hContact, ack->szModule, "ChatRoom", 0) != 0)
return 0;
- db_set_ws(ack->hContact, "CList", "StatusMsg", (const TCHAR *)ack->lParam);
+ db_set_ws(ack->hContact, "CList", "StatusMsg", (const wchar_t *)ack->lParam);
Clist_Broadcast(INTM_STATUSCHANGED, ack->hContact, 0);
}
else {
diff --git a/plugins/Clist_modern/src/modern_clc.h b/plugins/Clist_modern/src/modern_clc.h index a895e46231..64fd85c7e2 100644 --- a/plugins/Clist_modern/src/modern_clc.h +++ b/plugins/Clist_modern/src/modern_clc.h @@ -220,7 +220,7 @@ struct ClcLineInfo int top_space;
BOOL draw_smileys;
int type;
- TCHAR text[TEXT_TEXT_MAX_LENGTH];
+ wchar_t text[TEXT_TEXT_MAX_LENGTH];
BOOL xstatus_has_priority;
BOOL show_status_if_no_away;
BOOL show_listening_if_no_away;
@@ -374,10 +374,10 @@ DWORD GetDefaultExStyle(void); void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, BYTE *effect, COLORREF *eColour1, COLORREF *eColour2);
// clistsettings.c
-TCHAR* GetContactDisplayNameW(MCONTACT hContact, int mode);
+wchar_t* GetContactDisplayNameW(MCONTACT hContact, int mode);
// groups.c
-TCHAR* GetGroupNameTS(int idx, DWORD* pdwFlags);
+wchar_t* GetGroupNameTS(int idx, DWORD* pdwFlags);
int RenameGroupT(WPARAM groupID, LPARAM newName);
int GetContactCachedStatus(MCONTACT hContact);
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 03259dd5a0..e2a5cb896f 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -406,9 +406,9 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat) if (dat != NULL && dat->bFilterSearch && pdnce && pdnce->tszName) {
// search filtering
- TCHAR *lowered_name = CharLowerW(NEWTSTR_ALLOCA(pdnce->tszName));
- TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
- searchResult = _tcsstr(lowered_name, lowered_search) ? 0 : 1;
+ wchar_t *lowered_name = CharLowerW(NEWWSTR_ALLOCA(pdnce->tszName));
+ wchar_t *lowered_search = CharLowerW(NEWWSTR_ALLOCA(dat->szQuickSearch));
+ searchResult = wcsstr(lowered_name, lowered_search) ? 0 : 1;
}
if (pdnce && g_CluiData.bFilterEffective && dat != NULL && !dat->bForceInDialog) {
@@ -435,9 +435,9 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat) if (g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) {
ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
if (tszGroup != NULL) {
- TCHAR szGroupMask[256];
+ wchar_t szGroupMask[256];
mir_sntprintf(szGroupMask, L"%s|", tszGroup);
- filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0));
+ filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (wcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (wcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0));
}
else if (g_CluiData.filterFlags & CLVM_INCLUDED_UNGROUPED)
filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? filterResult : filterResult & 1;
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 5c98b322f1..605112c0fc 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -38,24 +38,24 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l struct FontOptionsList {
DWORD dwFlags;
int fontID;
- TCHAR *szGroup;
- TCHAR *szDescr;
+ wchar_t *szGroup;
+ wchar_t *szDescr;
COLORREF defColour;
- TCHAR *szDefFace;
+ wchar_t *szDefFace;
BYTE defCharset, defStyle;
char defSize;
FONTEFFECT defeffect;
COLORREF colour;
- TCHAR szFace[LF_FACESIZE];
+ wchar_t szFace[LF_FACESIZE];
BYTE charset, style;
char size;
};
-#define CLCGROUP LPGENT("Contact list") L"/" LPGENT("Contact names")
-#define CLCLINESGROUP LPGENT("Contact list") L"/" LPGENT("Row items")
-#define CLCFRAMESGROUP LPGENT("Contact list") L"/" LPGENT("Frame texts")
-#define CLCCOLOURSGROUP LPGENT("Contact list") L"/" LPGENT("Special colors")
+#define CLCGROUP LPGENW("Contact list") L"/" LPGENW("Contact names")
+#define CLCLINESGROUP LPGENW("Contact list") L"/" LPGENW("Row items")
+#define CLCFRAMESGROUP LPGENW("Contact list") L"/" LPGENW("Frame texts")
+#define CLCCOLOURSGROUP LPGENW("Contact list") L"/" LPGENW("Special colors")
#define DEFAULT_COLOUR RGB(0, 0, 0)
#define DEFAULT_GREYCOLOUR RGB(128, 128, 128)
@@ -68,53 +68,53 @@ struct FontOptionsList { #define DEFAULT_SMALLSIZE -8
static struct FontOptionsList fontOptionsList[] = {
- { FIDF_CLASSGENERAL, FONTID_CONTACTS, CLCGROUP, LPGENT("Standard contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_AWAY, CLCGROUP, LPGENT("Away contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_DND, CLCGROUP, LPGENT("Do not disturb contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_NA, CLCGROUP, LPGENT("Not available contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_OCCUPIED, CLCGROUP, LPGENT("Occupied contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_CHAT, CLCGROUP, LPGENT("Free for chat contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_INVISIBLE, CLCGROUP, LPGENT("Invisible contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_PHONE, CLCGROUP, LPGENT("On the phone contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_LUNCH, CLCGROUP, LPGENT("Out to lunch contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_OFFLINE, CLCGROUP, LPGENT("Offline contacts"), DEFAULT_GREYCOLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_INVIS, CLCGROUP, LPGENT("Online contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_OFFINVIS, CLCGROUP, LPGENT("Offline contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_NOTONLIST, CLCGROUP, LPGENT("Contacts who are 'not on list'"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_OPENGROUPS, CLCGROUP, LPGENT("Open groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_OPENGROUPCOUNTS, CLCGROUP, LPGENT("Open group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPS, CLCGROUP, LPGENT("Closed groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPCOUNTS, CLCGROUP, LPGENT("Closed group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSSMALL, FONTID_DIVIDERS, CLCGROUP, LPGENT("Dividers"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
-
- { FIDF_CLASSSMALL, FONTID_SECONDLINE, CLCLINESGROUP, LPGENT("Second line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
- { FIDF_CLASSSMALL, FONTID_THIRDLINE, CLCLINESGROUP, LPGENT("Third line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
- { FIDF_CLASSSMALL, FONTID_CONTACT_TIME, CLCLINESGROUP, LPGENT("Contact time"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
-
- { FIDF_CLASSGENERAL, FONTID_STATUSBAR_PROTONAME, CLCFRAMESGROUP, LPGENT("Status bar text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_EVENTAREA, CLCFRAMESGROUP, LPGENT("Event area text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_VIEMODES, CLCFRAMESGROUP, LPGENT("Current view mode text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_CONTACTS, CLCGROUP, LPGENW("Standard contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_AWAY, CLCGROUP, LPGENW("Away contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_DND, CLCGROUP, LPGENW("Do not disturb contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_NA, CLCGROUP, LPGENW("Not available contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_OCCUPIED, CLCGROUP, LPGENW("Occupied contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_CHAT, CLCGROUP, LPGENW("Free for chat contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_INVISIBLE, CLCGROUP, LPGENW("Invisible contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_PHONE, CLCGROUP, LPGENW("On the phone contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_LUNCH, CLCGROUP, LPGENW("Out to lunch contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_OFFLINE, CLCGROUP, LPGENW("Offline contacts"), DEFAULT_GREYCOLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_INVIS, CLCGROUP, LPGENW("Online contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_OFFINVIS, CLCGROUP, LPGENW("Offline contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_NOTONLIST, CLCGROUP, LPGENW("Contacts who are 'not on list'"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_OPENGROUPS, CLCGROUP, LPGENW("Open groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_OPENGROUPCOUNTS, CLCGROUP, LPGENW("Open group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPS, CLCGROUP, LPGENW("Closed groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPCOUNTS, CLCGROUP, LPGENW("Closed group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSSMALL, FONTID_DIVIDERS, CLCGROUP, LPGENW("Dividers"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+
+ { FIDF_CLASSSMALL, FONTID_SECONDLINE, CLCLINESGROUP, LPGENW("Second line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSSMALL, FONTID_THIRDLINE, CLCLINESGROUP, LPGENW("Third line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSSMALL, FONTID_CONTACT_TIME, CLCLINESGROUP, LPGENW("Contact time"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
+
+ { FIDF_CLASSGENERAL, FONTID_STATUSBAR_PROTONAME, CLCFRAMESGROUP, LPGENW("Status bar text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_EVENTAREA, CLCFRAMESGROUP, LPGENW("Event area text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_VIEMODES, CLCFRAMESGROUP, LPGENW("Current view mode text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
};
struct ColourOptionsList {
char *chGroup;
char *chName;
- TCHAR *szGroup;
- TCHAR *szDescr;
+ wchar_t *szGroup;
+ wchar_t *szDescr;
COLORREF defColour;
};
static struct ColourOptionsList colourOptionsList[] = {
- { "CLC", "BkColour", CLCGROUP, LPGENT("Background"), CLCDEFAULT_BKCOLOUR },
+ { "CLC", "BkColour", CLCGROUP, LPGENW("Background"), CLCDEFAULT_BKCOLOUR },
- { "CLC", "HotTextColour", CLCCOLOURSGROUP, LPGENT("Hot text"), CLCDEFAULT_MODERN_HOTTEXTCOLOUR },
- { "CLC", "SelTextColour", CLCCOLOURSGROUP, LPGENT("Selected text"), CLCDEFAULT_MODERN_SELTEXTCOLOUR },
- { "CLC", "QuickSearchColour", CLCCOLOURSGROUP, LPGENT("Quick search text"), CLCDEFAULT_MODERN_QUICKSEARCHCOLOUR },
+ { "CLC", "HotTextColour", CLCCOLOURSGROUP, LPGENW("Hot text"), CLCDEFAULT_MODERN_HOTTEXTCOLOUR },
+ { "CLC", "SelTextColour", CLCCOLOURSGROUP, LPGENW("Selected text"), CLCDEFAULT_MODERN_SELTEXTCOLOUR },
+ { "CLC", "QuickSearchColour", CLCCOLOURSGROUP, LPGENW("Quick search text"), CLCDEFAULT_MODERN_QUICKSEARCHCOLOUR },
- { "Menu", "TextColour", CLCCOLOURSGROUP, LPGENT("Menu text"), CLCDEFAULT_TEXTCOLOUR },
- { "Menu", "SelTextColour", CLCCOLOURSGROUP, LPGENT("Selected menu text"), CLCDEFAULT_MODERN_SELTEXTCOLOUR },
- { "FrameTitleBar", "TextColour", CLCCOLOURSGROUP, LPGENT("Frame title text"), CLCDEFAULT_TEXTCOLOUR },
- { "ModernSettings", "KeyColor", CLCCOLOURSGROUP, LPGENT("3rd party frames transparent back color"), SETTING_KEYCOLOR_DEFAULT }
+ { "Menu", "TextColour", CLCCOLOURSGROUP, LPGENW("Menu text"), CLCDEFAULT_TEXTCOLOUR },
+ { "Menu", "SelTextColour", CLCCOLOURSGROUP, LPGENW("Selected menu text"), CLCDEFAULT_MODERN_SELTEXTCOLOUR },
+ { "FrameTitleBar", "TextColour", CLCCOLOURSGROUP, LPGENW("Frame title text"), CLCDEFAULT_TEXTCOLOUR },
+ { "ModernSettings", "KeyColor", CLCCOLOURSGROUP, LPGENW("3rd party frames transparent back color"), SETTING_KEYCOLOR_DEFAULT }
};
void RegisterCLUIFonts(void)
@@ -246,34 +246,34 @@ static const struct CheckBoxToStyleEx_t 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)
@@ -486,7 +486,7 @@ static int _GetNetVisibleProtoCount() return netProtoCount;
}
-TCHAR *sortby[] = { LPGENT("Name"), LPGENT("Name (use locale settings)"), LPGENT("Status"), LPGENT("Last message time"), LPGENT("Account name"), LPGENT("Rate"), LPGENT("-Nothing-") };
+wchar_t *sortby[] = { LPGENW("Name"), LPGENW("Name (use locale settings)"), LPGENW("Status"), LPGENW("Last message time"), LPGENW("Account name"), LPGENW("Rate"), LPGENW("-Nothing-") };
int sortbyValue[] = { SORTBY_NAME, SORTBY_NAME_LOCALE, SORTBY_STATUS, SORTBY_LASTMSG, SORTBY_PROTO, SORTBY_RATE, SORTBY_NOTHING };
static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
@@ -803,7 +803,7 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC01), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
{
- TCHAR *hidemode[] = { TranslateT("Hide to tray"), TranslateT("Behind left edge"), TranslateT("Behind right edge") };
+ wchar_t *hidemode[] = { TranslateT("Hide to tray"), TranslateT("Behind left edge"), TranslateT("Behind right edge") };
for (int i = 0; i < _countof(hidemode); i++) {
int item = SendDlgItemMessage(hwndDlg, IDC_HIDEMETHOD, CB_ADDSTRING, 0, (LPARAM)hidemode[i]);
SendDlgItemMessage(hwndDlg, IDC_HIDEMETHOD, CB_SETITEMDATA, item, 0);
@@ -1002,7 +1002,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP {
DBVARIANT dbv = { 0 };
- TCHAR *s;
+ wchar_t *s;
if (!db_get_ts(NULL, "CList", "TitleText", &dbv))
s = dbv.ptszVal;
else
@@ -1148,7 +1148,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP db_set_b(NULL, "CList", "ThinBorder", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BORDER));
db_set_b(NULL, "CList", "NoBorder", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOBORDERWND));
{
- TCHAR title[256];
+ wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
db_set_ws(NULL, "CList", "TitleText", title);
}
@@ -1368,7 +1368,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];
Bitmap_GetFilter(filter, _countof(filter));
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp index deebf09991..e03c992085 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.cpp +++ b/plugins/Clist_modern/src/modern_clcpaint.cpp @@ -184,7 +184,7 @@ int CLCPaint::GetBasicFontID(ClcContact *contact) }
}
-void CLCPaint::GetTextSize(SIZE *text_size, HDC hdcMem, RECT free_row_rc, TCHAR *szText, SortedList *plText, UINT uTextFormat, int smiley_height)
+void CLCPaint::GetTextSize(SIZE *text_size, HDC hdcMem, RECT free_row_rc, wchar_t *szText, SortedList *plText, UINT uTextFormat, int smiley_height)
{
if (szText == NULL || !szText[0]) {
text_size->cy = 0;
@@ -398,7 +398,7 @@ RECT CLCPaint::_GetRectangle(ClcData *dat, RECT *row_rc, RECT *free_row_rc, int -void CLCPaint::_DrawTextSmiley(HDC hdcMem, RECT *free_rc, SIZE * text_size, TCHAR *szText, int start, int len, SortedList *plText, UINT uTextFormat, BOOL ResizeSizeSmiley)
+void CLCPaint::_DrawTextSmiley(HDC hdcMem, RECT *free_rc, SIZE * text_size, wchar_t *szText, int start, int len, SortedList *plText, UINT uTextFormat, BOOL ResizeSizeSmiley)
{
if (szText == NULL)
return;
@@ -614,19 +614,19 @@ MODERNMASK* CLCPaint::_GetCLCContactRowBackModernMask(ClcGroup *group, ClcContac _itoa(index, buf, BUF2SIZE);
AddParam(mpModernMask, HASH[hi_Index], buf, 0);
{
- TCHAR *b2 = NEWTSTR_ALLOCA(Drawing->szText);
+ wchar_t *b2 = NEWWSTR_ALLOCA(Drawing->szText);
for (int i = 0; b2[i] != 0; i++)
- if (b2[i] == _T(','))
- b2[i] = _T('.');
+ if (b2[i] == ',')
+ b2[i] = '.';
AddParam(mpModernMask, HASH[hi_Name], T2Utf(b2), 0);
}
if (group->parent) {
- TCHAR *b2 = NEWTSTR_ALLOCA(group->parent->cl[0]->szText);
+ wchar_t *b2 = NEWWSTR_ALLOCA(group->parent->cl[0]->szText);
for (int i = 0; b2[i] != 0; i++)
- if (b2[i] == _T(','))
- b2[i] = _T('.');
+ if (b2[i] == ',')
+ b2[i] = '.';
AddParam(mpModernMask, HASH[hi_Group], T2Utf(b2), 0);
}
@@ -763,7 +763,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R // 3 draw text
{
SIZE text_size = { 0 };
- TCHAR *szCounts = NULL;
+ wchar_t *szCounts = NULL;
RECT text_rect = fr_rc;
RECT counts_rc = { 0 };
UINT uTextFormat = DT_LEFT | DT_VCENTER | (gl_TrimText ? DT_END_ELLIPSIS : 0) | DT_SINGLELINE;
@@ -903,9 +903,9 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R if (((dat->bFilterSearch && Drawing->type != CLCIT_GROUP) || selected) && dat->szQuickSearch[0] != '\0') {
int idx = 0;
if (dat->bFilterSearch) {
- TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
- TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
- TCHAR *p1 = _tcsstr(lowered, lowered_search);
+ wchar_t *lowered = CharLowerW(NEWWSTR_ALLOCA(Drawing->szText));
+ wchar_t *lowered_search = CharLowerW(NEWWSTR_ALLOCA(dat->szQuickSearch));
+ wchar_t *p1 = wcsstr(lowered, lowered_search);
if (p1)
idx = int(p1 - lowered);
}
@@ -981,9 +981,9 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R if ((dat->bFilterSearch || selected) && dat->szQuickSearch[0] != '\0') {
int idx = 0;
if (dat->bFilterSearch) {
- TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
- TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
- TCHAR *p1 = _tcsstr(lowered, lowered_search);
+ wchar_t *lowered = CharLowerW(NEWWSTR_ALLOCA(Drawing->szText));
+ wchar_t *lowered_search = CharLowerW(NEWWSTR_ALLOCA(dat->szQuickSearch));
+ wchar_t *p1 = wcsstr(lowered, lowered_search);
if (p1)
idx = int(p1 - lowered);
}
@@ -1002,7 +1002,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R RECT count_rc = { 0 };
SIZE count_size = { 0 };
int space_width = 0;
- TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
+ wchar_t *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
// Has to draw the count?
if (szCounts && mir_tstrlen(szCounts) > 0) {
// calc width and height
@@ -1080,7 +1080,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R if (dat->secondLine.show && dat->secondLine.type == TEXT_CONTACT_TIME && pdnce->hTimeZone) {
// Get contact time
- TCHAR buf[70] = L"";
+ wchar_t buf[70] = L"";
mir_free_and_nil(pdnce->szSecondLineText);
TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", buf, _countof(buf), 0);
@@ -1108,7 +1108,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R if (dat->thirdLine.show && dat->thirdLine.type == TEXT_CONTACT_TIME && pdnce->hTimeZone) {
// Get contact time
- TCHAR buf[70] = L"";
+ wchar_t buf[70] = L"";
mir_free(pdnce->szThirdLineText);
TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", buf, _countof(buf), 0);
@@ -1391,7 +1391,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R break;
case TC_TIME:
- TCHAR szResult[80];
+ wchar_t szResult[80];
if (!TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", szResult, _countof(szResult), 0)) {
// Select font
ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL);
@@ -2103,7 +2103,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT case ITEM_CONTACT_TIME: /////////////////////////////////////////////////////////////////////////////////////////////////////
if (Drawing->type == CLCIT_CONTACT && dat->contact_time_show && pdnce->hTimeZone) {
- TCHAR szResult[80];
+ wchar_t szResult[80];
if (!TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", szResult, _countof(szResult), 0)) {
// Select font
@@ -2198,7 +2198,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT if (Drawing->type == CLCIT_GROUP) {
int full_text_width = text_size.cx;
// Has to draw the count?
- TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
+ wchar_t *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
if (szCounts && szCounts[0]) {
RECT space_rc = free_row_rc;
RECT counts_rc = free_row_rc;
@@ -2265,7 +2265,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT if (dat->secondLine.show) {
if (dat->secondLine.type == TEXT_CONTACT_TIME && pdnce->hTimeZone) {
// Get contact time
- TCHAR buf[70] = L"";
+ wchar_t buf[70] = L"";
TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", buf, _countof(buf), 0);
replaceStrT(pdnce->szSecondLineText, buf);
}
@@ -2298,7 +2298,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT if (dat->thirdLine.show) {
if (dat->thirdLine.type == TEXT_CONTACT_TIME && pdnce->hTimeZone) {
// Get contact time
- TCHAR buf[70] = L"";
+ wchar_t buf[70] = L"";
TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", buf, _countof(buf), 0);
replaceStrT(pdnce->szThirdLineText, buf);
}
@@ -2665,9 +2665,9 @@ void CLCPaint::_DrawContactText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, i if ((dat->bFilterSearch || selected) && dat->szQuickSearch[0] != '\0') {
int idx = 0;
if (dat->bFilterSearch) {
- TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
- TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
- TCHAR *p1 = _tcsstr(lowered, lowered_search);
+ wchar_t *lowered = CharLowerW(NEWWSTR_ALLOCA(Drawing->szText));
+ wchar_t *lowered_search = CharLowerW(NEWWSTR_ALLOCA(dat->szQuickSearch));
+ wchar_t *p1 = wcsstr(lowered, lowered_search);
if (p1)
idx = int(p1 - lowered);
}
@@ -2684,7 +2684,7 @@ void CLCPaint::_DrawContactText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, i void CLCPaint::_DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat, BYTE itemType)
{
if (Drawing->type == CLCIT_GROUP) {
- TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
+ wchar_t *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
// Has to draw the count?
if (szCounts && szCounts[0]) {
@@ -2718,7 +2718,7 @@ void CLCPaint::_DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing void CLCPaint::_DrawContactTime(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *prcItem)
{
- TCHAR szResult[80];
+ wchar_t szResult[80];
ClcCacheEntry *pdnce = Drawing->pce;
if (!pdnce)
return;
diff --git a/plugins/Clist_modern/src/modern_clcpaint.h b/plugins/Clist_modern/src/modern_clcpaint.h index 406bc51137..5a3d53adb0 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.h +++ b/plugins/Clist_modern/src/modern_clcpaint.h @@ -15,7 +15,7 @@ public: BOOL IsForegroundWindow(HWND hWnd);
HFONT ChangeToFont(HDC hdc, ClcData *dat, int id, int *fontHeight);
int GetBasicFontID(ClcContact *contact);
- void GetTextSize(SIZE *text_size, HDC hdcMem, RECT free_row_rc, TCHAR *szText, SortedList *plText, UINT uTextFormat, int smiley_height);
+ void GetTextSize(SIZE *text_size, HDC hdcMem, RECT free_row_rc, wchar_t *szText, SortedList *plText, UINT uTextFormat, int smiley_height);
void AddParam(MODERNMASK *mpModernMask, DWORD dwParamHash, const char* szValue, DWORD dwValueHash);
BOOL CheckMiniMode(ClcData *dat, BOOL selected);
@@ -101,7 +101,7 @@ private: int _GetGeneralisedStatus();
int _GetRealStatus(ClcContact *pContact, int nStatus);
RECT _GetRectangle(ClcData *dat, RECT *row_rc, RECT *free_row_rc, int *left_pos, int *right_pos, BOOL left, int real_width, int width, int height, int horizontal_space);
- void _DrawTextSmiley(HDC hdcMem, RECT *free_rc, SIZE * text_size, TCHAR *szText, int start, int len, SortedList *plText, UINT uTextFormat, BOOL ResizeSizeSmiley);
+ void _DrawTextSmiley(HDC hdcMem, RECT *free_rc, SIZE * text_size, wchar_t *szText, int start, int len, SortedList *plText, UINT uTextFormat, BOOL ResizeSizeSmiley);
void _AddParameter(MODERNMASK *mpModernMask, MASKPARAM * lpParam);
void _AddParamShort(MODERNMASK *mpModernMask, DWORD dwParamIndex, DWORD dwValueIndex);
void _FillParam(MASKPARAM * lpParam, DWORD dwParamHash, const char* szValue, DWORD dwValueHash);
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index d65e2f32bc..c20e9740e8 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -564,7 +564,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) if (tszLineText)
mir_tstrncpy(dat->secondLine.text, tszLineText, _countof(dat->secondLine.text));
else
- dat->secondLine.text[0] = _T('\0');
+ dat->secondLine.text[0] = '\0';
dat->secondLine.xstatus_has_priority = db_get_b(NULL, "CList", "SecondLineXStatusHasPriority", SETTING_SECONDLINE_XSTATUS_DEFAULT);
dat->secondLine.show_status_if_no_away = db_get_b(NULL, "CList", "SecondLineShowStatusIfNoAway", SETTING_SECONDLINE_STATUSIFNOAWAY_DEFAULT);
@@ -584,7 +584,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) if (tszLineText)
mir_tstrncpy(dat->thirdLine.text, tszLineText, _countof(dat->thirdLine.text));
else
- dat->thirdLine.text[0] = _T('\0');
+ dat->thirdLine.text[0] = '\0';
dat->thirdLine.xstatus_has_priority = db_get_b(NULL, "CList", "ThirdLineXStatusHasPriority", SETTING_THIRDLINE_XSTATUS_DEFAULT);
dat->thirdLine.show_status_if_no_away = db_get_b(NULL, "CList", "ThirdLineShowStatusIfNoAway", SETTING_THIRDLINE_STATUSIFNOAWAY_DEFAULT);
@@ -654,7 +654,7 @@ int ExpandMetaContact(HWND hwnd, ClcContact *contact, ClcData *dat) return contact->bSubExpanded;
}
-int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk)
+int cliFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk)
{
ClcGroup *group = &dat->list;
int testlen = (int)mir_tstrlen(text);
@@ -673,11 +673,11 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk) if (cc->type != CLCIT_DIVIDER) {
bool found;
if (dat->bFilterSearch) {
- TCHAR *lowered_szText = CharLowerW(NEWTSTR_ALLOCA(cc->szText));
- TCHAR *lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
- found = _tcsstr(lowered_szText, lowered_text) != NULL;
+ wchar_t *lowered_szText = CharLowerW(NEWWSTR_ALLOCA(cc->szText));
+ wchar_t *lowered_text = CharLowerW(NEWWSTR_ALLOCA(text));
+ found = wcsstr(lowered_szText, lowered_text) != NULL;
}
- else found = (prefixOk && !_tcsnicmp(text, cc->szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, cc->szText));
+ else found = (prefixOk && !wcsnicmp(text, cc->szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, cc->szText));
if (found) {
ClcGroup *ccGroup = group;
@@ -704,11 +704,11 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk) bool found;
if (dat->bFilterSearch) {
- TCHAR *lowered_szText = CharLowerW(NEWTSTR_ALLOCA(ccSub.szText));
- TCHAR *lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
- found = _tcsstr(lowered_szText, lowered_text) != NULL;
+ wchar_t *lowered_szText = CharLowerW(NEWWSTR_ALLOCA(ccSub.szText));
+ wchar_t *lowered_text = CharLowerW(NEWWSTR_ALLOCA(text));
+ found = wcsstr(lowered_szText, lowered_text) != NULL;
}
- else found = (prefixOk && !_tcsnicmp(text, ccSub.szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, ccSub.szText));
+ else found = (prefixOk && !wcsnicmp(text, ccSub.szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, ccSub.szText));
if (found) {
ClcGroup *ccGroup = group;
diff --git a/plugins/Clist_modern/src/modern_clist.h b/plugins/Clist_modern/src/modern_clist.h index fc9e6e3695..db9ba3fd67 100644 --- a/plugins/Clist_modern/src/modern_clist.h +++ b/plugins/Clist_modern/src/modern_clist.h @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void LoadContactTree(void);
HTREEITEM GetTreeItemByHContact(MCONTACT hContact);
-int GetContactInfosForSort(MCONTACT hContact, char **Proto, TCHAR **Name, int *Status);
+int GetContactInfosForSort(MCONTACT hContact, char **Proto, wchar_t **Name, int *Status);
///////////////////////////////////////////////////////////////////////////////
@@ -59,13 +59,13 @@ public: DestroySmileyList();
}
- void ReplaceSmileys(ClcData *dat, ClcCacheEntry *pdnce, TCHAR *szText, BOOL replace_smileys);
+ void ReplaceSmileys(ClcData *dat, ClcCacheEntry *pdnce, wchar_t *szText, BOOL replace_smileys);
/** Destroy smiley list */
void DestroySmileyList();
/** Copy Smiley List */
void _CopySmileyList(SortedList *plInput);
- void AddListeningToIcon(ClcData *dat, TCHAR *szText);
+ void AddListeningToIcon(ClcData *dat, wchar_t *szText);
};
@@ -86,10 +86,10 @@ struct ClcCacheEntry : public ClcCacheEntryBase void* ClcContact;
int IsExpanded;
- TCHAR* szSecondLineText;
+ wchar_t* szSecondLineText;
CSmileyString ssSecondLine;
- TCHAR* szThirdLineText;
+ wchar_t* szThirdLineText;
CSmileyString ssThirdLine;
HANDLE hTimeZone;
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index 0c05a92028..24cc1f273c 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -110,13 +110,13 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle) }
char *szProto = GetContactProto(p->hContact);
- TCHAR *szName = pcli->pfnGetContactDisplayName(p->hContact, 0);
+ wchar_t *szName = pcli->pfnGetContactDisplayName(p->hContact, 0);
if (szProto && szName) {
NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) malloc(sizeof(struct NotifyMenuItemExData));
if (nmi) {
- TCHAR szBuffer[128];
- TCHAR* szStatus = pcli->pfnGetStatusModeDescription(db_get_w(p->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
- TCHAR szwProto[64];
+ wchar_t szBuffer[128];
+ wchar_t* szStatus = pcli->pfnGetStatusModeDescription(db_get_w(p->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
+ wchar_t szwProto[64];
MultiByteToWideChar(CP_ACP, 0, szProto, -1, szwProto, 64);
szwProto[63] = 0;
mir_sntprintf(szBuffer, L"%s: %s (%s)", szwProto, szName, szStatus);
@@ -296,7 +296,7 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC) int iCount = GetMenuItemCount(g_CluiData.hMenuNotify);
rc.left += 26;
if (g_CluiData.hUpdateContact != 0) {
- TCHAR *szName = pcli->pfnGetContactDisplayName(g_CluiData.hUpdateContact, 0);
+ wchar_t *szName = pcli->pfnGetContactDisplayName(g_CluiData.hUpdateContact, 0);
int iIcon = cli_GetContactIcon(g_CluiData.hUpdateContact);
ske_ImageList_DrawEx(g_himlCListClc, iIcon, hDC, rc.left, (rc.bottom + rc.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL);
@@ -311,7 +311,7 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC) GetMenuItemInfo(g_CluiData.hMenuNotify, iCount - 1, TRUE, &mii);
NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) mii.dwItemData;
- TCHAR *szName = pcli->pfnGetContactDisplayName(nmi->hContact, 0);
+ wchar_t *szName = pcli->pfnGetContactDisplayName(nmi->hContact, 0);
int iIcon = cli_GetContactIcon(nmi->hContact);
ske_ImageList_DrawEx(g_himlCListClc, iIcon, hDC, rc.left, (rc.bottom + rc.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL);
rc.left += 18;
@@ -320,7 +320,7 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC) }
else {
HICON hIcon = (HICON)LoadImage(g_hMirApp, MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, 16, 16, 0);
- TCHAR *ptszEvents = TranslateT("No events");
+ wchar_t *ptszEvents = TranslateT("No events");
ske_DrawText(hDC, ptszEvents, (int)mir_tstrlen(ptszEvents), &rc, DT_VCENTER | DT_SINGLELINE);
ske_DrawIconEx(hDC, 4, (rc.bottom + rc.top - 16) / 2, hIcon, 16, 16, 0, 0, DI_NORMAL | DI_COMPAT);
DestroyIcon(hIcon);
@@ -488,7 +488,7 @@ int EventArea_Create(HWND hCluiWnd) ehhEventAreaBackgroundSettingsChanged(0, 0);
WNDCLASS wndclass = { 0 };
- TCHAR pluginname[] = L"EventArea";
+ wchar_t pluginname[] = L"EventArea";
int h = GetSystemMetrics(SM_CYSMICON) + 2;
if (GetClassInfo(g_hInst, pluginname, &wndclass) == 0) {
wndclass.style = 0;
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp index 92dde8c3c1..2605dea546 100644 --- a/plugins/Clist_modern/src/modern_clistmenus.cpp +++ b/plugins/Clist_modern/src/modern_clistmenus.cpp @@ -58,13 +58,13 @@ int InitCustomMenus(void) #define CLUI_FAVSETRATE "CLUI/SetContactRate" //LParam is rate, Wparam is contact handle
#define CLUI_FAVTOGGLESHOWOFFLINE "CLUI/ToggleContactShowOffline"
-static TCHAR *FAVMENUROOTNAME = LPGENT("&Contact rate");
+static wchar_t *FAVMENUROOTNAME = LPGENW("&Contact rate");
-static TCHAR *rates[] = {
- LPGENT("None"),
- LPGENT("Low"),
- LPGENT("Medium"),
- LPGENT("High")
+static wchar_t *rates[] = {
+ LPGENW("None"),
+ LPGENW("Low"),
+ LPGENW("Medium"),
+ LPGENW("High")
};
static HGENMENU hFavoriteContactMenu = NULL, hShowIfOflineItem = NULL;
@@ -124,7 +124,7 @@ int LoadFavoriteContactMenu() CMenuItem mi;
SET_UID(mi, 0xf99a2320, 0xc024, 0x48bd, 0x81, 0xf7, 0x9f, 0xa2, 0x5, 0xb0, 0x7f, 0xdc);
- mi.name.t = FAVMENUROOTNAME;
+ mi.name.w = FAVMENUROOTNAME;
mi.flags = CMIF_TCHAR;
hFavoriteContactMenu = Menu_AddContactMenuItem(&mi);
Menu_ConfigureItem(hFavoriteContactMenu, MCI_OPT_UNIQUENAME, "ModernClistMenu_ContactRate");
@@ -135,7 +135,7 @@ int LoadFavoriteContactMenu() mi.pszService = CLUI_FAVSETRATE;
for (int i = 0; i < _countof(rates); i++) {
mi.hIcolibItem = iconList[i].hIcolib;
- mi.name.t = rates[i];
+ mi.name.w = rates[i];
hFavoriteContactMenuItems[i] = Menu_AddContactMenuItem(&mi);
Menu_ConfigureItem(hFavoriteContactMenuItems[i], MCI_OPT_EXECPARAM, i);
}
@@ -143,7 +143,7 @@ int LoadFavoriteContactMenu() mi.hIcolibItem = NULL;
mi.pszService = CLUI_FAVTOGGLESHOWOFFLINE;
mi.position = -100000000;
- mi.name.t = LPGENT("Show even if offline");
+ mi.name.w = LPGENW("Show even if offline");
hShowIfOflineItem = Menu_AddContactMenuItem(&mi);
Menu_ConfigureItem(hShowIfOflineItem, MCI_OPT_EXECPARAM, _countof(rates) + 100000000);
return 0;
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index a6d774893a..5e8f223061 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -290,7 +290,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) hAuxOld = hAux;
hAux = GetAncestor(hAux, GA_ROOTOWNER);
if (hAuxOld == hAux) {
- TCHAR buf[255];
+ wchar_t buf[255];
GetClassName(hAux, buf, _countof(buf));
if (!mir_tstrcmp(buf, CLUIFrameSubContainerClassName)) {
hWndFound = TRUE;
diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp index f918d50773..ed7b571b64 100644 --- a/plugins/Clist_modern/src/modern_clistopts.cpp +++ b/plugins/Clist_modern/src/modern_clistopts.cpp @@ -508,7 +508,7 @@ static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wPara //TODO: init IDC_ALIGNGROUPCOMBO from db_get_b(NULL,"CList","AlignGroupCaptions",SETTING_ALIGNGROPCAPTION_DEFAULT);
{
int item;
- TCHAR *align[] = { LPGENT("Left align group names"), LPGENT("Center group names"), LPGENT("Right align group names") };
+ wchar_t *align[] = { LPGENW("Left align group names"), LPGENW("Center group names"), LPGENW("Right align group names") };
for (int i = 0; i < sizeof(align) / sizeof(char*); i++)
item = SendDlgItemMessage(hwndDlg, IDC_ALIGNGROUPCOMBO, CB_ADDSTRING, 0, (LPARAM)TranslateTS(align[i]));
SendDlgItemMessage(hwndDlg, IDC_ALIGNGROUPCOMBO, CB_SETCURSEL, db_get_b(NULL, "CList", "AlignGroupCaptions", SETTING_ALIGNGROPCAPTION_DEFAULT), 0);
@@ -716,7 +716,7 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM radio = TEXT_STATUS_MESSAGE;
db_set_w(NULL, "CList", "SecondLineType", (WORD)radio);
- TCHAR t[TEXT_TEXT_MAX_LENGTH];
+ wchar_t t[TEXT_TEXT_MAX_LENGTH];
GetDlgItemText(hwndDlg, IDC_VARIABLE_TEXT, t, _countof(t));
t[TEXT_TEXT_MAX_LENGTH - 1] = '\0';
db_set_ts(NULL, "CList", "SecondLineText", t);
@@ -882,7 +882,7 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM db_set_w(NULL, "CList", "ThirdLineType", (WORD)radio);
}
{
- TCHAR t[TEXT_TEXT_MAX_LENGTH];
+ wchar_t t[TEXT_TEXT_MAX_LENGTH];
GetDlgItemText(hwndDlg, IDC_VARIABLE_TEXT, t, _countof(t));
t[TEXT_TEXT_MAX_LENGTH - 1] = '\0';
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index 70665ab9cc..a212170259 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void InsertContactIntoTree(MCONTACT hContact, int status);
-TCHAR* UnknownConctactTranslatedName = NULL;
+wchar_t* UnknownConctactTranslatedName = NULL;
void cliFreeCacheItem(ClcCacheEntry *p)
{
@@ -78,7 +78,7 @@ int GetStatusForContact(MCONTACT hContact, char *szProto) return (szProto) ? db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) : ID_STATUS_OFFLINE;
}
-int GetContactInfosForSort(MCONTACT hContact, char **Proto, TCHAR **Name, int *Status)
+int GetContactInfosForSort(MCONTACT hContact, char **Proto, wchar_t **Name, int *Status)
{
ClcCacheEntry *cacheEntry = pcli->pfnGetCacheEntry(hContact);
if (cacheEntry != NULL) {
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 0a92bb92cc..c0b4e9c106 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -147,7 +147,7 @@ CLUI* CLUI::m_pCLUI = NULL; BOOL CLUI::m_fMainMenuInited = FALSE;
HWND CLUI::m_hWnd = NULL;
-static TCHAR tszFolderPath[MAX_PATH];
+static wchar_t tszFolderPath[MAX_PATH];
void CLUI::cliOnCreateClc(void)
{
@@ -184,9 +184,9 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM, LPARAM) return 0;
HWND hwndClist = GetFocus();
- TCHAR cls[128];
+ wchar_t cls[128];
GetClassName(hwndClist, cls, _countof(cls));
- if (mir_tstrcmp(_T(CLISTCONTROL_CLASS), cls))
+ if (mir_tstrcmp(CLISTCONTROL_CLASSW, cls))
hwndClist = pcli->hwndContactList;
MCONTACT hItem = (MCONTACT)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
@@ -316,13 +316,13 @@ HRESULT CLUI::LoadDllsRuntime() }
static IconItemT iconItem[] = {
- { LPGENT("Show avatar"), "ShowAvatar", IDI_SHOW_AVATAR },
- { LPGENT("Hide avatar"), "HideAvatar", IDI_HIDE_AVATAR }
+ { LPGENW("Show avatar"), "ShowAvatar", IDI_SHOW_AVATAR },
+ { LPGENW("Hide avatar"), "HideAvatar", IDI_HIDE_AVATAR }
};
HRESULT CLUI::RegisterAvatarMenu()
{
- Icon_RegisterT(g_hInst, LPGENT("Contact list"), iconItem, _countof(iconItem));
+ Icon_RegisterT(g_hInst, LPGENW("Contact list"), iconItem, _countof(iconItem));
CMenuItem mi;
@@ -348,7 +348,7 @@ HRESULT CLUI::RegisterAvatarMenu() HRESULT CLUI::CreateCLCWindow(const HWND hwndClui)
{
- pcli->hwndContactTree = CreateWindow(_T(CLISTCONTROL_CLASS), L"",
+ pcli->hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"",
WS_CHILD | WS_CLIPCHILDREN | CLS_CONTACTLIST
| (db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
| (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0)
@@ -412,7 +412,7 @@ HRESULT CLUI::CreateCLC() Frame.align = alClient;
Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
Frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NO_SUBCONTAINER | F_TCHAR;
- Frame.tname = LPGENT("My contacts");
+ Frame.tname = LPGENW("My contacts");
Frame.TBtname = TranslateT("My contacts");
hFrameContactTree = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
@@ -496,7 +496,7 @@ BOOL CLUI_CheckOwnedByClui(HWND hWnd) if (hWndMid == hWndClui)
return TRUE;
- TCHAR buf[255];
+ wchar_t buf[255];
GetClassName(hWndMid, buf, 254);
if (!mir_tstrcmpi(buf, CLUIFrameSubContainerClassName))
return TRUE;
@@ -664,7 +664,7 @@ void CLUI_ChangeWindowMode() styleEx |= WS_EX_LAYERED;
// 4 - Set Title
- TCHAR titleText[255] = { 0 };
+ wchar_t titleText[255] = { 0 };
DBVARIANT dbv;
if (db_get_ts(NULL, "CList", "TitleText", &dbv))
mir_tstrncpy(titleText, _T(MIRANDANAME), _countof(titleText));
@@ -880,12 +880,12 @@ int CLUI_OnSkinLoad(WPARAM, LPARAM) static int CLUI_GetConnectingIconForProtoCount(char *szAccoName)
{
int count;
- TCHAR fileFull[MAX_PATH];
+ wchar_t fileFull[MAX_PATH];
if (!tszFolderPath[0]) {
- TCHAR szRelativePath[MAX_PATH];
+ wchar_t szRelativePath[MAX_PATH];
GetModuleFileName(GetModuleHandle(NULL), szRelativePath, MAX_PATH);
- TCHAR *str = _tcsrchr(szRelativePath, '\\');
+ wchar_t *str = wcsrchr(szRelativePath, '\\');
if (str != NULL)
*str = 0;
PathToAbsoluteT(szRelativePath, tszFolderPath);
@@ -916,12 +916,12 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) return 8;
}
-static HICON CLUI_LoadIconFromExternalFile(TCHAR *filename, int i)
+static HICON CLUI_LoadIconFromExternalFile(wchar_t *filename, int i)
{
- TCHAR szPath[MAX_PATH], szFullPath[MAX_PATH];
+ wchar_t szPath[MAX_PATH], szFullPath[MAX_PATH];
mir_sntprintf(szPath, L"Icons\\%s", filename);
PathToAbsoluteT(szPath, szFullPath);
- if (_taccess(szPath, 0))
+ if (_waccess(szPath, 0))
return NULL;
HICON hIcon = NULL;
@@ -931,7 +931,7 @@ static HICON CLUI_LoadIconFromExternalFile(TCHAR *filename, int i) static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int idx)
{
- TCHAR szFullPath[MAX_PATH];
+ wchar_t szFullPath[MAX_PATH];
HICON hIcon;
if (szAccoName) {
@@ -1498,35 +1498,35 @@ BOOL cliInvalidateRect(HWND hWnd, CONST RECT* lpRect, BOOL bErase) return InvalidateRect(hWnd, lpRect, bErase);
}
-static BOOL FileExists(TCHAR * tszFilename)
+static BOOL FileExists(wchar_t * tszFilename)
{
- FILE * f = _tfopen(tszFilename, L"r");
+ FILE * f = _wfopen(tszFilename, L"r");
if (f == NULL) return FALSE;
fclose(f);
return TRUE;
}
-HANDLE RegisterIcolibIconHandle(char *szIcoID, char *szSectionName, char *szDescription, TCHAR *tszDefaultFile, int iDefaultIndex, HINSTANCE hDefaultModuleInst, int iDefaultResource)
+HANDLE RegisterIcolibIconHandle(char *szIcoID, char *szSectionName, char *szDescription, wchar_t *tszDefaultFile, int iDefaultIndex, HINSTANCE hDefaultModuleInst, int iDefaultResource)
{
if (hDefaultModuleInst == NULL)
return Skin_GetIconHandle(iDefaultResource);
- TCHAR fileFull[MAX_PATH] = { 0 };
+ wchar_t fileFull[MAX_PATH] = { 0 };
SKINICONDESC sid = { 0 };
sid.section.a = szSectionName;
sid.pszName = szIcoID;
sid.flags |= SIDF_PATH_TCHAR;
sid.description.a = szDescription;
- sid.defaultFile.t = fileFull;
+ sid.defaultFile.w = fileFull;
if (tszDefaultFile) {
PathToAbsoluteT(tszDefaultFile, fileFull);
if (!FileExists(fileFull))
- fileFull[0] = _T('\0');
+ fileFull[0] = '\0';
}
- if (fileFull[0] != _T('\0'))
+ if (fileFull[0] != '\0')
sid.iDefaultIndex = -iDefaultIndex;
else {
GetModuleFileName(hDefaultModuleInst, fileFull, _countof(fileFull));
@@ -2419,7 +2419,7 @@ LRESULT CLUI::OnMeasureItem(UINT, WPARAM, LPARAM lParam) case MENU_STATUSMENU:
HDC hdc = GetDC(m_hWnd);
- TCHAR *ptszStr = TranslateT("Status");
+ wchar_t *ptszStr = TranslateT("Status");
SIZE textSize;
GetTextExtentPoint32(hdc, ptszStr, (int)mir_tstrlen(ptszStr), &textSize);
pmis->itemWidth = textSize.cx;
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h index 4f285e9ad0..3aeb4ae795 100644 --- a/plugins/Clist_modern/src/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/modern_commonprototypes.h @@ -67,7 +67,7 @@ bool CLCItems_IsShowOfflineGroup(ClcGroup *group); int CListMod_HideWindow();
/* CLUI */
-HANDLE RegisterIcolibIconHandle(char *szIcoID, char *szSectionName, char *szDescription, TCHAR *tszDefaultFile, int iDefaultIndex, HINSTANCE hDefaultModule, int iDefaultResource);
+HANDLE RegisterIcolibIconHandle(char *szIcoID, char *szSectionName, char *szDescription, wchar_t *tszDefaultFile, int iDefaultIndex, HINSTANCE hDefaultModule, int iDefaultResource);
void CLUI_UpdateAeroGlass();
void CLUI_ChangeWindowMode();
BOOL CLUI_CheckOwnedByClui(HWND hwnd);
@@ -91,13 +91,13 @@ int CLUIUnreadEmailCountChanged(WPARAM wParam, LPARAM lParam); /* GDIPlus */
BOOL GDIPlus_AlphaBlend(HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWidthDest, int nHeightDest, HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, BLENDFUNCTION *blendFunction);
-HBITMAP GDIPlus_LoadGlyphImage(const TCHAR *szFileName);
+HBITMAP GDIPlus_LoadGlyphImage(const wchar_t *szFileName);
/* EventArea */
void EventArea_ConfigureEventArea();
/* ModernSkinButton */
-int ModernSkinButton_AddButton(HWND parent, char *ID, char *CommandService, char *StateDefService, char *HandeService, int Left, int Top, int Right, int Bottom, DWORD AlignedTo, TCHAR *Hint, char *DBkey, char *TypeDef, int MinWidth, int MinHeight);
+int ModernSkinButton_AddButton(HWND parent, char *ID, char *CommandService, char *StateDefService, char *HandeService, int Left, int Top, int Right, int Bottom, DWORD AlignedTo, wchar_t *Hint, char *DBkey, char *TypeDef, int MinWidth, int MinHeight);
int ModernSkinButtonLoadModule();
int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *r);
int ModernSkinButtonUnloadModule(WPARAM, LPARAM);
@@ -119,16 +119,16 @@ int ske_DrawNonFramedObjects(BOOL Erase, RECT *r); BOOL ske_DrawText(HDC hdc, LPCTSTR lpString, int nCount, RECT *lpRect, UINT format);
LPSKINOBJECTDESCRIPTOR ske_FindObjectByName(const char *szName, BYTE objType, SKINOBJECTSLIST *Skin);
HBITMAP ske_GetCurrentWindowImage();
-int ske_GetFullFilename(TCHAR *buf, const TCHAR *file, TCHAR *skinfolder, BOOL madeAbsolute);
-int ske_GetSkinFolder(TCHAR *szFileName, char *t2);
+int ske_GetFullFilename(wchar_t *buf, const wchar_t *file, wchar_t *skinfolder, BOOL madeAbsolute);
+int ske_GetSkinFolder(wchar_t *szFileName, char *t2);
BOOL ske_ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle);
HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i);
int ske_JustUpdateWindowImageRect(RECT *rty);
-HBITMAP ske_LoadGlyphImage(const TCHAR *szFileName);
+HBITMAP ske_LoadGlyphImage(const wchar_t *szFileName);
HRESULT SkinEngineLoadModule();
void ske_LoadSkinFromDB(void);
-int ske_LoadSkinFromIniFile(TCHAR*, BOOL);
-TCHAR* ske_ParseText(TCHAR *stzText);
+int ske_LoadSkinFromIniFile(wchar_t*, BOOL);
+wchar_t* ske_ParseText(wchar_t *stzText);
int ske_PrepareImageButDontUpdateIt(RECT *r);
int ske_ReCreateBackImage(BOOL Erase, RECT *w);
int ske_RedrawCompleteWindow();
@@ -214,7 +214,7 @@ void UnLoadContactListModule(); / void UpdateAllAvatars(ClcData *dat); //cache_func.c
void ApplyViewMode(const char *Name, bool onlySelector = false);
-void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szProtoFilter, DWORD statusMask, DWORD stickyStatusMask, unsigned int options, unsigned int stickies, unsigned int operators, unsigned int lmdat);
+void SaveViewMode(const char *name, const wchar_t *szGroupFilter, const char *szProtoFilter, DWORD statusMask, DWORD stickyStatusMask, unsigned int options, unsigned int stickies, unsigned int operators, unsigned int lmdat);
// cluiframes.c
int ExtraImage_ExtraIDToColumnNum(int extra);
@@ -238,7 +238,7 @@ void cliRebuildEntireList(HWND hwnd, ClcData *dat); void cliRecalcScrollBar(HWND hwnd, ClcData *dat);
void CLUI_cliOnCreateClc(void);
int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly);
-int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk);
+int cliFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk);
int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex);
int cli_IconFromStatusMode(const char *szProto, int nStatus, MCONTACT hContact);
int cli_GetContactIcon(MCONTACT hContact);
diff --git a/plugins/Clist_modern/src/modern_effectenum.h b/plugins/Clist_modern/src/modern_effectenum.h index 28f30beaf8..aff63b837c 100644 --- a/plugins/Clist_modern/src/modern_effectenum.h +++ b/plugins/Clist_modern/src/modern_effectenum.h @@ -20,9 +20,9 @@ typedef struct _MODERNEFFECT }MODERNEFFECT;
#ifdef _EFFECTENUM_FULL_H
-TCHAR * ModernEffectNames[] =
+wchar_t * ModernEffectNames[] =
#else
-TCHAR * _ModernEffectNames[] =
+wchar_t * _ModernEffectNames[] =
#endif
{
L"Shadow at left",
@@ -87,7 +87,7 @@ MODERNEFFECTMATRIX ModernEffectsEnum[] = { #define MAXPREDEFINEDEFFECTS sizeof(ModernEffectNames)/sizeof(ModernEffectNames[0])
#else
#define MAXPREDEFINEDEFFECTS sizeof(_ModernEffectNames)/sizeof(_ModernEffectNames[0])
-extern TCHAR * ModernEffectNames[];
+extern wchar_t * ModernEffectNames[];
#endif
extern BOOL SkinEngine_ResetTextEffect(HDC);
extern BOOL SkinEngine_SelectTextEffect(HDC hdc, BYTE EffectID, DWORD FirstColor, DWORD SecondColor);
\ No newline at end of file diff --git a/plugins/Clist_modern/src/modern_gdiplus.cpp b/plugins/Clist_modern/src/modern_gdiplus.cpp index e7d414125f..ce53d31913 100644 --- a/plugins/Clist_modern/src/modern_gdiplus.cpp +++ b/plugins/Clist_modern/src/modern_gdiplus.cpp @@ -48,7 +48,7 @@ DWORD argb_from_cola(COLORREF col, BYTE alpha) return((BYTE)(alpha) << 24 | col);
}
-HBITMAP GDIPlus_LoadGlyphImage(const TCHAR *tszFileName)
+HBITMAP GDIPlus_LoadGlyphImage(const wchar_t *tszFileName)
{
// Create a Bitmap object from a JPEG file.
Bitmap bitmap(tszFileName, 0);
@@ -149,7 +149,7 @@ COLORREF __inline _revcolref(COLORREF colref) // based on routine from http://www.codeproject.com/vcpp/gdiplus/imageexgdi.asp
//
-BOOL GDIPlus_IsAnimatedGif(TCHAR * szName)
+BOOL GDIPlus_IsAnimatedGif(wchar_t * szName)
{
int nFrameCount = 0;
Image image(szName);
@@ -169,7 +169,7 @@ BOOL GDIPlus_IsAnimatedGif(TCHAR * szName) return (BOOL)(nFrameCount > 1);
}
-void GDIPlus_ExtractAnimatedGIF(TCHAR *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar)
+void GDIPlus_ExtractAnimatedGIF(wchar_t *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar)
{
int nFrameCount = 0;
Bitmap image(szName);
diff --git a/plugins/Clist_modern/src/modern_global_structure.h b/plugins/Clist_modern/src/modern_global_structure.h index 7f54143571..242dc16c21 100644 --- a/plugins/Clist_modern/src/modern_global_structure.h +++ b/plugins/Clist_modern/src/modern_global_structure.h @@ -20,7 +20,7 @@ typedef struct tagCLUIDATA MCONTACT hUpdateContact;
// Contact List View Mode
- TCHAR groupFilter[2048];
+ wchar_t groupFilter[2048];
char protoFilter[2048];
char varFilter[2048];
DWORD lastMsgFilter;
diff --git a/plugins/Clist_modern/src/modern_keyboard.cpp b/plugins/Clist_modern/src/modern_keyboard.cpp index d55326fee4..f4773c48e2 100644 --- a/plugins/Clist_modern/src/modern_keyboard.cpp +++ b/plugins/Clist_modern/src/modern_keyboard.cpp @@ -49,21 +49,21 @@ int InitSkinHotKeys(void) shk.cbSize = sizeof(shk);
shk.dwFlags = HKD_TCHAR;
- shk.ptszDescription = LPGENT("Close Miranda");
+ shk.ptszDescription = LPGENW("Close Miranda");
shk.pszName = "CloseMiranda";
- shk.ptszSection = LPGENT("Main");
+ shk.ptszSection = LPGENW("Main");
shk.pszService = "CLIST/HK/CloseMiranda";
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENT("Restore last status");
+ shk.ptszDescription = LPGENW("Restore last status");
shk.pszName = "RestoreLastStatus";
- shk.ptszSection = LPGENT("Status");
+ shk.ptszSection = LPGENW("Status");
shk.pszService = "CLIST/HK/RestoreStatus";
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENT("Show/Hide offline users");
+ shk.ptszDescription = LPGENW("Show/Hide offline users");
shk.pszName = "ShowHideOfflineUsers";
- shk.ptszSection = LPGENT("Main");
+ shk.ptszSection = LPGENW("Main");
shk.pszService = MS_CLIST_TOGGLEHIDEOFFLINE;
Hotkey_Register(&shk);
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp index fbe18a6583..1fe7d491fb 100644 --- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp +++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp @@ -70,7 +70,7 @@ int RowHeight_CalcRowHeight(ClcData *dat, ClcContact *contact, int item) if (dat->text_replace_smileys && dat->first_line_draw_smileys && !dat->text_resize_smileys)
tmp = max(tmp, contact->ssText.iMaxSmileyHeight);
if (contact->type == CLCIT_GROUP) {
- TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, contact);
+ wchar_t *szCounts = pcli->pfnGetGroupCountsText(dat, contact);
// Has the count?
if (szCounts && szCounts[0])
tmp = max(tmp, dat->fontModernInfo[contact->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS].fontHeight);
@@ -108,7 +108,7 @@ int RowHeight_CalcRowHeight(ClcData *dat, ClcContact *contact, int item) g_clcPainter.ChangeToFont(hdc, dat, g_clcPainter.GetBasicFontID(contact), NULL);
g_clcPainter.GetTextSize(&size, hdc, dummyRect, contact->szText, contact->ssText.plText, 0, dat->text_resize_smileys ? 0 : contact->ssText.iMaxSmileyHeight);
if (contact->type == CLCIT_GROUP) {
- TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, contact);
+ wchar_t *szCounts = pcli->pfnGetGroupCountsText(dat, contact);
if (szCounts && mir_tstrlen(szCounts) > 0) {
RECT count_rc = { 0 };
// calc width and height
@@ -239,7 +239,7 @@ int RowHeight_CalcRowHeight(ClcData *dat, ClcContact *contact, int item) if (contact->type == CLCIT_CONTACT && dat->contact_time_show && pdnce->hTimeZone) {
pCell->h = dat->fontModernInfo[FONTID_CONTACT_TIME].fontHeight;
if (item == -1) {
- TCHAR szResult[80];
+ wchar_t szResult[80];
if (!TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", szResult, _countof(szResult), 0)) {
SIZE text_size = { 0 };
diff --git a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp index 902812a8de..a83baa7089 100644 --- a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp +++ b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp @@ -28,7 +28,7 @@ void RefreshTree(HWND hwndDlg, HTREEITEM hti); static char* rowOptTmplStr;
static ROWCELL* rowOptTmplRoot;
static ROWCELL* rowOptTA[100];
-TCHAR *types[] = {
+wchar_t *types[] = {
L"none", L"text1", L"text2", L"text3", L"status",
L"avatar", L"extra", L"extra1", L"extra2", L"extra3",
L"extra4", L"extra5", L"extra6", L"extra7", L"extra8",
@@ -308,7 +308,7 @@ void RefreshTree(HWND hwndDlg, HTREEITEM hti) cell = (pROWCELL)tvi.lParam;
if (cell)
{
- TCHAR buf[200] = { 0 };
+ wchar_t buf[200] = { 0 };
if (!cell->child)
{
if (cell->type == 0)
@@ -362,14 +362,14 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_SETCURSEL, 0, 0);
- TCHAR *h_alignment[] = { L"left", L"hCenter", L"right" };
+ wchar_t *h_alignment[] = { L"left", L"hCenter", L"right" };
for (i = 0; i < _countof(h_alignment); i++) {
item = SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateTS(h_alignment[i]));
SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_SETITEMDATA, item, 0);
}
SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_SETCURSEL, 0, 0);
- TCHAR *v_alignment[] = { L"top", L"vCenter", L"bottom" };
+ wchar_t *v_alignment[] = { L"top", L"vCenter", L"bottom" };
for (i = 0; i < _countof(v_alignment); i++) {
item = SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateTS(v_alignment[i]));
SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_SETITEMDATA, item, 0);
diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp index d0062aecd5..55341cd073 100644 --- a/plugins/Clist_modern/src/modern_skinbutton.cpp +++ b/plugins/Clist_modern/src/modern_skinbutton.cpp @@ -33,7 +33,7 @@ This file contains code related to new modern free positioned skinned buttons BOOL ModernSkinButtonModuleIsLoaded = FALSE; static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); int ModernSkinButtonUnloadModule(WPARAM wParam, LPARAM lParam); -HWND SetToolTip(HWND hwnd, TCHAR * tip); +HWND SetToolTip(HWND hwnd, wchar_t * tip); typedef struct _ModernSkinButtonCtrl { @@ -51,7 +51,7 @@ typedef struct _ModernSkinButtonCtrl char * ValueTypeDef; int Left, Top, Bottom, Right; HMENU hMenu; - TCHAR * Hint; + wchar_t * Hint; } ModernSkinButtonCtrl; typedef struct _HandleServiceParams @@ -457,7 +457,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM w return DefWindowProc(hwndDlg, msg, wParam, lParam); } -HWND SetToolTip(HWND hwnd, TCHAR * tip) +HWND SetToolTip(HWND hwnd, wchar_t * tip) { TOOLINFO ti; if (!tip) return 0; @@ -483,7 +483,7 @@ HWND SetToolTip(HWND hwnd, TCHAR * tip) } ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS; ti.uId = (UINT_PTR)hwnd; - ti.lpszText = (TCHAR*)tip; + ti.lpszText = (wchar_t*)tip; SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM)&ti); return hwndToolTips; @@ -516,7 +516,7 @@ int ModernSkinButton_AddButton(HWND parent, int Right, int Bottom, DWORD sbFlags, - TCHAR * Hint, + wchar_t * Hint, char * DBkey, char * TypeDef, int MinWidth, int MinHeight) @@ -607,7 +607,7 @@ static HWND ModernSkinButtonCreateWindow(ModernSkinButtonCtrl * bct, HWND parent if (bct == NULL) return FALSE; { - TCHAR *UnicodeID = mir_a2u(bct->ID); + wchar_t *UnicodeID = mir_a2u(bct->ID); hwnd = CreateWindow(_T(MODERNSKINBUTTONCLASS), UnicodeID, WS_VISIBLE | WS_CHILD, bct->Left, bct->Top, bct->Right - bct->Left, bct->Bottom - bct->Top, parent, NULL, g_hInst, NULL); mir_free(UnicodeID); } diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index e6c325481e..cc28081cb1 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -115,18 +115,18 @@ static MODERNEFFECT meCurrentEffect = { 0xFF, { 0 }, 0, 0 }; ////////////////////////////////////////////////////////////////////////// // Ini file parser -IniParser::IniParser(TCHAR * tcsFileName, BYTE flags) : _Flags(flags) +IniParser::IniParser(wchar_t * tcsFileName, BYTE flags) : _Flags(flags) { _DoInit(); if (!tcsFileName) return; - if (tcsFileName[0] == _T('%')) { + if (tcsFileName[0] == '%') { //TODO: Add parser of resource filename here _LoadResourceIni(g_hInst, MAKEINTRESOURCEA(IDR_MSF_DEFAULT_SKIN), "MSF"); return; } - _hFile = _tfopen(tcsFileName, L"r"); + _hFile = _wfopen(tcsFileName, L"r"); if (_hFile != NULL) { _eType = IT_FILE; _isValid = true; @@ -200,20 +200,20 @@ HRESULT IniParser::WriteStrToDb(const char * szSection, const char * szName, con return S_OK; } -int IniParser::GetSkinFolder(IN const TCHAR * szFileName, OUT TCHAR * pszFolderName) +int IniParser::GetSkinFolder(IN const wchar_t * szFileName, OUT wchar_t * pszFolderName) { - TCHAR *szBuff = mir_tstrdup(szFileName); - TCHAR *pszPos = szBuff + mir_tstrlen(szBuff); - while (pszPos > szBuff && *pszPos != _T('.')) { pszPos--; } - *pszPos = _T('\0'); + wchar_t *szBuff = mir_tstrdup(szFileName); + wchar_t *pszPos = szBuff + mir_tstrlen(szBuff); + while (pszPos > szBuff && *pszPos != '.') { pszPos--; } + *pszPos = '\0'; mir_tstrcpy(pszFolderName, szBuff); - TCHAR custom_folder[MAX_PATH], cus[MAX_PATH]; - TCHAR *b3; + wchar_t custom_folder[MAX_PATH], cus[MAX_PATH]; + wchar_t *b3; mir_tstrncpy(custom_folder, pszFolderName, _countof(custom_folder)); b3 = custom_folder + mir_tstrlen(custom_folder); - while (b3 > custom_folder && *b3 != _T('\\')) { b3--; } - *b3 = _T('\0'); + while (b3 > custom_folder && *b3 != '\\') { b3--; } + *b3 = '\0'; GetPrivateProfileString(L"Skin_Description_Section", L"SkinFolder", L"", cus, _countof(custom_folder), szFileName); if (cus[0] != 0) @@ -1467,13 +1467,13 @@ void ske_PreMultiplyChannels(HBITMAP hbmp, BYTE Mult) return; } -int ske_GetFullFilename(TCHAR *buf, const TCHAR *file, TCHAR *skinfolder, BOOL madeAbsolute) +int ske_GetFullFilename(wchar_t *buf, const wchar_t *file, wchar_t *skinfolder, BOOL madeAbsolute) { - TCHAR *SkinPlace = db_get_tsa(NULL, SKIN, "SkinFolder"); + wchar_t *SkinPlace = db_get_tsa(NULL, SKIN, "SkinFolder"); if (SkinPlace == NULL) SkinPlace = mir_tstrdup(L"\\Skin\\default"); - TCHAR b2[MAX_PATH]; + wchar_t b2[MAX_PATH]; if (file[0] != '\\' && file[1] != ':') mir_sntprintf(b2, L"%s\\%s", (skinfolder == NULL) ? SkinPlace : ((INT_PTR)skinfolder != -1) ? skinfolder : L"", file); else @@ -1557,7 +1557,7 @@ static BOOL ske_ReadTGAImageData(void * From, DWORD fromSize, BYTE * destBuf, DW return TRUE; } -static HBITMAP ske_LoadGlyphImage_TGA(const TCHAR *szFilename) +static HBITMAP ske_LoadGlyphImage_TGA(const wchar_t *szFilename) { BYTE *colormap = NULL; int cx = 0, cy = 0; @@ -1566,7 +1566,7 @@ static HBITMAP ske_LoadGlyphImage_TGA(const TCHAR *szFilename) if (!szFilename) return NULL; if (!wildcmpit(szFilename, L"*\\*%.tga")) { //Loading TGA image from file - FILE *fp = _tfopen(szFilename, L"rb"); + FILE *fp = _wfopen(szFilename, L"rb"); if (!fp) { TRACEVAR("error: couldn't open \"%s\"!\n", szFilename); return NULL; @@ -1618,12 +1618,12 @@ static HBITMAP ske_LoadGlyphImage_TGA(const TCHAR *szFilename) return NULL; } -static HBITMAP ske_LoadGlyphImageByDecoders(const TCHAR *tszFileName) +static HBITMAP ske_LoadGlyphImageByDecoders(const wchar_t *tszFileName) { - if (!_tcschr(tszFileName, '%') && !PathFileExists(tszFileName)) + if (!wcschr(tszFileName, '%') && !PathFileExists(tszFileName)) return NULL; - const TCHAR *ext = _tcsrchr(tszFileName, '.'); + const wchar_t *ext = wcsrchr(tszFileName, '.'); if (ext == NULL) return NULL; @@ -1661,7 +1661,7 @@ static HBITMAP ske_LoadGlyphImageByDecoders(const TCHAR *tszFileName) return hBitmap; } -static HBITMAP ske_skinLoadGlyphImage(const TCHAR *tszFileName) +static HBITMAP ske_skinLoadGlyphImage(const wchar_t *tszFileName) { if (!wildcmpit(tszFileName, L"*.tga")) return GDIPlus_LoadGlyphImage(tszFileName); @@ -1669,10 +1669,10 @@ static HBITMAP ske_skinLoadGlyphImage(const TCHAR *tszFileName) return ske_LoadGlyphImageByDecoders(tszFileName); } -HBITMAP ske_LoadGlyphImage(const TCHAR *tszFileName) +HBITMAP ske_LoadGlyphImage(const wchar_t *tszFileName) { // try to find image in loaded - TCHAR szFile[MAX_PATH] = { 0 }; + wchar_t szFile[MAX_PATH] = { 0 }; ske_GetFullFilename(szFile, tszFileName, g_SkinObjectList.szSkinPlace, TRUE); mir_cslock lck(cs_SkinChanging); @@ -1913,9 +1913,9 @@ static int ske_GetSkinFromDB(char *, SKINOBJECTSLIST *Skin) Skin->pMaskList = (LISTMODERNMASK*)mir_alloc(sizeof(LISTMODERNMASK)); memset(Skin->pMaskList, 0, sizeof(LISTMODERNMASK)); Skin->szSkinPlace = db_get_tsa(NULL, SKIN, "SkinFolder"); - if (!Skin->szSkinPlace || (_tcschr(Skin->szSkinPlace, '%') && !db_get_b(NULL, SKIN, "Modified", 0))) { + if (!Skin->szSkinPlace || (wcschr(Skin->szSkinPlace, '%') && !db_get_b(NULL, SKIN, "Modified", 0))) { BOOL bOnlyObjects = FALSE; - if (Skin->szSkinPlace && _tcschr(Skin->szSkinPlace, '%')) + if (Skin->szSkinPlace && wcschr(Skin->szSkinPlace, '%')) bOnlyObjects = TRUE; mir_free(Skin->szSkinPlace); Skin->szSkinPlace = mir_tstrdup(L"%Default%"); @@ -1957,9 +1957,9 @@ static int ske_LoadSkinFromResource(BOOL bOnlyObjects) } // Load data from ini file -int ske_LoadSkinFromIniFile(TCHAR *szFileName, BOOL bOnlyObjects) +int ske_LoadSkinFromIniFile(wchar_t *szFileName, BOOL bOnlyObjects) { - if (_tcschr(szFileName, _T('%'))) + if (wcschr(szFileName, '%')) return ske_LoadSkinFromResource(bOnlyObjects); IniParser parser(szFileName, bOnlyObjects ? IniParser::FLAG_ONLY_OBJECTS : IniParser::FLAG_WITH_SETTINGS); @@ -1968,7 +1968,7 @@ int ske_LoadSkinFromIniFile(TCHAR *szFileName, BOOL bOnlyObjects) CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)"ModernSkin"); - TCHAR skinFolder[MAX_PATH], skinFile[MAX_PATH]; + wchar_t skinFolder[MAX_PATH], skinFile[MAX_PATH]; IniParser::GetSkinFolder(szFileName, skinFolder); PathToRelativeT(szFileName, skinFile); @@ -2272,10 +2272,10 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect, // replace end of string by elipsis bNeedFreeWorkString = TRUE; - lpWorkString = (TCHAR*)mir_alloc((visibleCharCount + 4) * sizeof(TCHAR)); + lpWorkString = (wchar_t*)mir_alloc((visibleCharCount + 4) * sizeof(wchar_t)); - memcpy((void*)lpWorkString, lpString, visibleCharCount * sizeof(TCHAR)); - memcpy((void*)(lpWorkString + visibleCharCount), L"...", 4 * sizeof(TCHAR)); // 3 + 1 + memcpy((void*)lpWorkString, lpString, visibleCharCount * sizeof(wchar_t)); + memcpy((void*)(lpWorkString + visibleCharCount), L"...", 4 * sizeof(wchar_t)); // 3 + 1 nCount = visibleCharCount + 3; } @@ -3297,19 +3297,19 @@ static DWORD ske_HexToARGB(char * Hex) return AARRGGBB; } -static TCHAR *ske_ReAppend(TCHAR *lfirst, TCHAR * lsecond, int len) +static wchar_t *ske_ReAppend(wchar_t *lfirst, wchar_t * lsecond, int len) { size_t l1 = lfirst ? mir_tstrlen(lfirst) : 0; size_t l2 = (len ? len : (mir_tstrlen(lsecond) + 1)); - TCHAR *buf = (TCHAR *)mir_alloc((l1 + l2 + 1)*sizeof(TCHAR)); - if (lfirst) memmove(buf, lfirst, l1*sizeof(TCHAR)); - memmove(buf + l1, lsecond, l2*sizeof(TCHAR)); + wchar_t *buf = (wchar_t *)mir_alloc((l1 + l2 + 1)*sizeof(wchar_t)); + if (lfirst) memmove(buf, lfirst, l1*sizeof(wchar_t)); + memmove(buf + l1, lsecond, l2*sizeof(wchar_t)); mir_free(lfirst); - if (len) buf[l1 + l2] = _T('\0'); + if (len) buf[l1 + l2] = '\0'; return buf; } -TCHAR* ske_ReplaceVar(TCHAR *var) +wchar_t* ske_ReplaceVar(wchar_t *var) { if (!var) return mir_tstrdup(L""); if (!mir_tstrcmpi(var, L"Profile")) { @@ -3327,15 +3327,15 @@ TCHAR* ske_ReplaceVar(TCHAR *var) return mir_tstrdup(L""); } -TCHAR *ske_ParseText(TCHAR *stzText) +wchar_t *ske_ParseText(wchar_t *stzText) { size_t len = mir_tstrlen(stzText); - TCHAR *result = NULL; + wchar_t *result = NULL; size_t stpos = 0, curpos = 0; while (curpos < len) { //1 find first % - while (curpos < len && stzText[curpos] != (TCHAR)'%') + while (curpos < len && stzText[curpos] != (wchar_t)'%') curpos++; if (curpos < len) { //% found if (curpos - stpos > 0) @@ -3343,14 +3343,14 @@ TCHAR *ske_ParseText(TCHAR *stzText) stpos = curpos + 1; curpos++; //3 find second % - while (curpos < len && stzText[curpos] != (TCHAR)'%') + while (curpos < len && stzText[curpos] != (wchar_t)'%') curpos++; if (curpos >= len) break; if (curpos - stpos > 0) { - TCHAR *var = (TCHAR *)mir_alloc((curpos - stpos + 1)*sizeof(TCHAR)); - memcpy(var, stzText + stpos, (curpos - stpos)*sizeof(TCHAR)); - var[curpos - stpos] = (TCHAR)'\0'; + wchar_t *var = (wchar_t *)mir_alloc((curpos - stpos + 1)*sizeof(wchar_t)); + memcpy(var, stzText + stpos, (curpos - stpos)*sizeof(wchar_t)); + var[curpos - stpos] = (wchar_t)'\0'; var = ske_ReplaceVar(var); result = ske_ReAppend(result, var, 0); mir_free(var); diff --git a/plugins/Clist_modern/src/modern_skinengine.h b/plugins/Clist_modern/src/modern_skinengine.h index 7a165081fc..d59f64f680 100644 --- a/plugins/Clist_modern/src/modern_skinengine.h +++ b/plugins/Clist_modern/src/modern_skinengine.h @@ -21,7 +21,7 @@ struct SKINOBJECTSLIST {
DWORD dwObjLPReserved;
DWORD dwObjLPAlocated;
- TCHAR *szSkinPlace;
+ wchar_t *szSkinPlace;
LISTMODERNMASK *pMaskList;
SKINOBJECTDESCRIPTOR *pObjects;
SortedList *pTextList;
@@ -29,7 +29,7 @@ struct SKINOBJECTSLIST struct GLYPHIMAGE
{
- TCHAR *szFileName;
+ wchar_t *szFileName;
DWORD dwLoadedTimes;
HBITMAP hGlyph;
BYTE isSemiTransp;
@@ -69,7 +69,7 @@ public: typedef HRESULT(*ParserCallback_t)(const char *szSection, const char *szKey, const char *szValue, IniParser *This);
- IniParser(TCHAR *szFileName, BYTE flags = FLAG_WITH_SETTINGS);
+ IniParser(wchar_t *szFileName, BYTE flags = FLAG_WITH_SETTINGS);
IniParser(HINSTANCE hInst, const char *resourceName, const char *resourceType, BYTE flags = FLAG_ONLY_OBJECTS);
~IniParser();
@@ -77,7 +77,7 @@ public: HRESULT Parse(ParserCallback_t pLineCallBackProc, LPARAM lParam);
static HRESULT WriteStrToDb(const char *szSection, const char *szKey, const char *szValue, IniParser *This);
- static int GetSkinFolder(IN const TCHAR *szFileName, OUT TCHAR *pszFolderName);
+ static int GetSkinFolder(IN const wchar_t *szFileName, OUT wchar_t *pszFolderName);
private:
// common
diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp index 3be1b39192..6927134b57 100644 --- a/plugins/Clist_modern/src/modern_skinopt.cpp +++ b/plugins/Clist_modern/src/modern_skinopt.cpp @@ -32,14 +32,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct SkinListData { - TCHAR Name[MAX_NAME]; - TCHAR File[MAX_PATH]; + wchar_t Name[MAX_NAME]; + wchar_t File[MAX_PATH]; }; HBITMAP hPreviewBitmap = NULL; -HTREEITEM AddItemToTree(HWND hTree, TCHAR *itemName, void *data); -HTREEITEM AddSkinToListFullName(HWND hwndDlg, TCHAR *fullName); -HTREEITEM AddSkinToList(HWND hwndDlg, TCHAR *path, TCHAR *file); +HTREEITEM AddItemToTree(HWND hTree, wchar_t *itemName, void *data); +HTREEITEM AddSkinToListFullName(HWND hwndDlg, wchar_t *fullName); +HTREEITEM AddSkinToList(HWND hwndDlg, wchar_t *path, wchar_t *file); HTREEITEM FillAvailableSkinList(HWND hwndDlg); INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); @@ -53,8 +53,8 @@ int SkinOptInit(WPARAM wParam, LPARAM) odp.hInstance = g_hInst; odp.pfnDlgProc = DlgSkinOpts; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SKIN); - odp.ptszGroup = LPGENT("Skins"); - odp.ptszTitle = LPGENT("Contact list"); + odp.pwszGroup = LPGENW("Skins"); + odp.pwszTitle = LPGENW("Contact list"); odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; Options_AddPage(wParam, &odp); } @@ -117,8 +117,8 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara if (!sd) return 0; - TCHAR Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000]; - if (!_tcschr(sd->File, _T('%'))) { + wchar_t Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000]; + if (!wcschr(sd->File, '%')) { GetPrivateProfileString(L"Skin_Description_Section", L"Author", TranslateT("( unknown )"), Author, _countof(Author), sd->File); GetPrivateProfileString(L"Skin_Description_Section", L"URL", L"", URL, _countof(URL), sd->File); GetPrivateProfileString(L"Skin_Description_Section", L"Contact", L"", Contact, _countof(Contact), sd->File); @@ -254,11 +254,11 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara if (nmtv->itemNew.lParam) { SkinListData *sd = (SkinListData*)nmtv->itemNew.lParam; - TCHAR buf[MAX_PATH]; + wchar_t buf[MAX_PATH]; PathToRelativeT(sd->File, buf); SetDlgItemText(hwndDlg, IDC_EDIT_SKIN_FILENAME, buf); - TCHAR prfn[MAX_PATH] = { 0 }, imfn[MAX_PATH] = { 0 }, skinfolder[MAX_PATH] = { 0 }; + wchar_t prfn[MAX_PATH] = { 0 }, imfn[MAX_PATH] = { 0 }, skinfolder[MAX_PATH] = { 0 }; GetPrivateProfileString(L"Skin_Description_Section", L"Preview", L"", imfn, _countof(imfn), sd->File); IniParser::GetSkinFolder(sd->File, skinfolder); mir_sntprintf(prfn, L"%s\\%s", skinfolder, imfn); @@ -282,8 +282,8 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara if (!sd2) return 0; - TCHAR Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000]; - if (sd2->File && !_tcschr(sd2->File, _T('%'))) { + wchar_t Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000]; + if (sd2->File && !wcschr(sd2->File, '%')) { GetPrivateProfileString(L"Skin_Description_Section", L"Author", TranslateT("( unknown )"), Author, _countof(Author), sd2->File); GetPrivateProfileString(L"Skin_Description_Section", L"URL", L"", URL, _countof(URL), sd2->File); GetPrivateProfileString(L"Skin_Description_Section", L"Contact", L"", Contact, _countof(Contact), sd2->File); @@ -325,10 +325,10 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara return 0; } -int SearchSkinFiles(HWND hwndDlg, TCHAR * Folder) +int SearchSkinFiles(HWND hwndDlg, wchar_t * Folder) { struct _tfinddata_t fd = { 0 }; - TCHAR mask[MAX_PATH]; + wchar_t mask[MAX_PATH]; long hFile; mir_sntprintf(mask, L"%s\\*.msf", Folder); //fd.attrib = _A_SUBDIR; @@ -344,7 +344,7 @@ int SearchSkinFiles(HWND hwndDlg, TCHAR * Folder) { do { if (fd.attrib&_A_SUBDIR && !(mir_tstrcmpi(fd.name, L".") == 0 || mir_tstrcmpi(fd.name, L"..") == 0)) {//Next level of subfolders - TCHAR path[MAX_PATH]; + wchar_t path[MAX_PATH]; mir_sntprintf(path, L"%s\\%s", Folder, fd.name); SearchSkinFiles(hwndDlg, path); } @@ -366,7 +366,7 @@ HTREEITEM FillAvailableSkinList(HWND hwndDlg) if (attrib != INVALID_FILE_ATTRIBUTES && (attrib & FILE_ATTRIBUTE_DIRECTORY)) SearchSkinFiles(hwndDlg, SkinsFolder); { - TCHAR skinfull[MAX_PATH]; + wchar_t skinfull[MAX_PATH]; ptrT skinfile(db_get_tsa(NULL, SKIN, "SkinFile")); if (skinfile) { PathToAbsoluteT(skinfile, skinfull); @@ -375,16 +375,16 @@ HTREEITEM FillAvailableSkinList(HWND hwndDlg) } return res; } -HTREEITEM AddSkinToListFullName(HWND hwndDlg, TCHAR * fullName) +HTREEITEM AddSkinToListFullName(HWND hwndDlg, wchar_t * fullName) { - TCHAR path[MAX_PATH] = { 0 }; - TCHAR file[MAX_PATH] = { 0 }; - TCHAR *buf; + wchar_t path[MAX_PATH] = { 0 }; + wchar_t file[MAX_PATH] = { 0 }; + wchar_t *buf; mir_tstrncpy(path, fullName, _countof(path)); buf = path + mir_tstrlen(path); while (buf > path) { - if (*buf == _T('\\')) { - *buf = _T('\0'); + if (*buf == '\\') { + *buf = '\0'; break; } buf--; @@ -395,29 +395,29 @@ HTREEITEM AddSkinToListFullName(HWND hwndDlg, TCHAR * fullName) } -HTREEITEM AddSkinToList(HWND hwndDlg, TCHAR * path, TCHAR* file) +HTREEITEM AddSkinToList(HWND hwndDlg, wchar_t * path, wchar_t* file) { - TCHAR fullName[MAX_PATH], defskinname[MAX_PATH]; + wchar_t fullName[MAX_PATH], defskinname[MAX_PATH]; SkinListData *sd = (SkinListData *)mir_alloc(sizeof(SkinListData)); if (!sd) return 0; - if (!file || _tcschr(file, _T('%'))) { + if (!file || wcschr(file, '%')) { mir_sntprintf(sd->File, L"%%Default Skin%%"); mir_sntprintf(sd->Name, TranslateT("%Default Skin%")); - _tcsncpy_s(fullName, TranslateT("Default Skin"), _TRUNCATE); + wcsncpy_s(fullName, TranslateT("Default Skin"), _TRUNCATE); } else { mir_sntprintf(fullName, L"%s\\%s", path, file); - _tcsncpy_s(defskinname, file, _TRUNCATE); - TCHAR *p = _tcsrchr(defskinname, '.'); if (p) *p = 0; + wcsncpy_s(defskinname, file, _TRUNCATE); + wchar_t *p = wcsrchr(defskinname, '.'); if (p) *p = 0; GetPrivateProfileString(L"Skin_Description_Section", L"Name", defskinname, sd->Name, _countof(sd->Name), fullName); - _tcsncpy_s(sd->File, fullName, _TRUNCATE); + wcsncpy_s(sd->File, fullName, _TRUNCATE); } return AddItemToTree(GetDlgItem(hwndDlg, IDC_TREE1), sd->Name, sd); } -HTREEITEM FindChild(HWND hTree, HTREEITEM Parent, TCHAR * Caption, void * data) +HTREEITEM FindChild(HWND hTree, HTREEITEM Parent, wchar_t * Caption, void * data) { HTREEITEM tmp = NULL; if (Parent) @@ -427,7 +427,7 @@ HTREEITEM FindChild(HWND hTree, HTREEITEM Parent, TCHAR * Caption, void * data) while (tmp) { TVITEM tvi; - TCHAR buf[255]; + wchar_t buf[255]; tvi.hItem = tmp; tvi.mask = TVIF_TEXT | TVIF_HANDLE; tvi.pszText = buf; @@ -451,7 +451,7 @@ HTREEITEM FindChild(HWND hTree, HTREEITEM Parent, TCHAR * Caption, void * data) return tmp; } -HTREEITEM AddItemToTree(HWND hTree, TCHAR *itemName, void *data) +HTREEITEM AddItemToTree(HWND hTree, wchar_t *itemName, void *data) { HTREEITEM cItem = NULL; //Insert item node @@ -473,7 +473,7 @@ INT_PTR SvcActiveSkin(WPARAM, LPARAM) { ptrT skinfile(db_get_tsa(NULL, SKIN, "SkinFile")); if (skinfile) { - TCHAR skinfull[MAX_PATH]; + wchar_t skinfull[MAX_PATH]; PathToAbsoluteT(skinfile, skinfull); return (INT_PTR)mir_tstrdup(skinfull); } @@ -483,7 +483,7 @@ INT_PTR SvcActiveSkin(WPARAM, LPARAM) INT_PTR SvcApplySkin(WPARAM, LPARAM lParam) { - ske_LoadSkinFromIniFile((TCHAR *)lParam, FALSE); + ske_LoadSkinFromIniFile((wchar_t *)lParam, FALSE); ske_LoadSkinFromDB(); Clist_Broadcast(INTM_RELOADOPTIONS, 0, 0); Sync(CLUIFrames_OnClistResize_mod, 0, 0); @@ -519,9 +519,9 @@ INT_PTR SvcPreviewSkin(WPARAM wParam, LPARAM lParam) OffsetRect(&workRect, -workRect.left, -workRect.top); if (lParam) { - TCHAR prfn[MAX_PATH] = { 0 }; - TCHAR imfn[MAX_PATH] = { 0 }; - TCHAR skinfolder[MAX_PATH] = { 0 }; + wchar_t prfn[MAX_PATH] = { 0 }; + wchar_t imfn[MAX_PATH] = { 0 }; + wchar_t skinfolder[MAX_PATH] = { 0 }; GetPrivateProfileString(L"Skin_Description_Section", L"Preview", L"", imfn, _countof(imfn), (LPCTSTR)lParam); IniParser::GetSkinFolder((LPCTSTR)lParam, skinfolder); mir_sntprintf(prfn, L"%s\\%s", skinfolder, imfn); diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp index 09fbd5b350..d6a4a80fc5 100644 --- a/plugins/Clist_modern/src/modern_skinselector.cpp +++ b/plugins/Clist_modern/src/modern_skinselector.cpp @@ -363,10 +363,10 @@ SKINOBJECTDESCRIPTOR* skin_FindObjectByRequest(char *szValue, LISTMODERNMASK *mm return res;
}
-TCHAR* GetParamNT(char *string, TCHAR *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces)
+wchar_t* GetParamNT(char *string, wchar_t *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces)
{
- char *ansibuf = (char*)mir_alloc(buflen / sizeof(TCHAR));
- GetParamN(string, ansibuf, buflen / sizeof(TCHAR), paramN, Delim, SkipSpaces);
+ char *ansibuf = (char*)mir_alloc(buflen / sizeof(wchar_t));
+ GetParamN(string, ansibuf, buflen / sizeof(wchar_t), paramN, Delim, SkipSpaces);
MultiByteToWideChar(CP_UTF8, 0, ansibuf, -1, buf, buflen);
mir_free(ansibuf);
return buf;
@@ -437,7 +437,7 @@ int RegisterButtonByParce(char * ObjectName, char * Params) int Left, Top, Right, Bottom;
int MinWidth, MinHeight;
char TL[9] = { 0 };
- TCHAR Hint[250] = { 0 };
+ wchar_t Hint[250] = { 0 };
char Section[250] = { 0 };
char Type[250] = { 0 };
diff --git a/plugins/Clist_modern/src/modern_skinselector.h b/plugins/Clist_modern/src/modern_skinselector.h index 76f39f6ba9..804b97fabb 100644 --- a/plugins/Clist_modern/src/modern_skinselector.h +++ b/plugins/Clist_modern/src/modern_skinselector.h @@ -71,6 +71,6 @@ DWORD mod_CalcHash(const char *a); int RegisterObjectByParce(char *ObjectName, char *Params);
SKINOBJECTDESCRIPTOR* skin_FindObjectByRequest(char *szValue, LISTMODERNMASK *mmTemplateList);
SKINOBJECTDESCRIPTOR* skin_FindObjectByMask(MODERNMASK *mm, LISTMODERNMASK *mmTemplateList);
-TCHAR * GetParamNT(char *string, TCHAR *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces);
+wchar_t * GetParamNT(char *string, wchar_t *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces);
int SkinDrawGlyphMask(HDC hdc, RECT *rcSize, RECT *rcClip, MODERNMASK *ModernMask);
#endif
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index ade67318a6..f49faaa894 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -240,7 +240,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) if (p->bShowProtoEmails == 1 && ProtoServiceExists(szProto, PS_GETUNREADEMAILCOUNT)) {
int nEmails = (int)CallProtoService(szProto, PS_GETUNREADEMAILCOUNT, 0, 0);
if (nEmails > 0) {
- TCHAR str[40];
+ wchar_t str[40];
mir_sntprintf(str, L"[%d]", nEmails);
p->szProtoEMailCount = mir_tstrdup(str);
}
@@ -343,7 +343,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) p.extraIcon = NULL;
if ((p.xStatusMode & 8) && p.iProtoStatus > ID_STATUS_OFFLINE) {
- TCHAR str[512];
+ wchar_t str[512];
CUSTOM_STATUS cs = { sizeof(cs) };
cs.flags = CSSF_MASK_NAME | CSSF_TCHAR;
cs.ptszName = str;
@@ -861,7 +861,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa return DefWindowProc(hwnd, msg, wParam, lParam);
}
-TCHAR pluginname[] = L"ModernStatusBar";
+wchar_t pluginname[] = L"ModernStatusBar";
HWND StatusBar_Create(HWND parent)
{
diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp index 6de1116d5a..44218b6bba 100644 --- a/plugins/Clist_modern/src/modern_statusbar_options.cpp +++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp @@ -237,14 +237,14 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l SendDlgItemMessage(hwndDlg, IDC_OFFSETSPIN3, UDM_SETPOS, 0, MAKELONG(db_get_dw(NULL, "CLUI", "SpaceBetween", SETTING_SPACEBETWEEN_DEFAULT), 2));
{
- TCHAR *align[] = { LPGENT("Left"), LPGENT("Center"), LPGENT("Right") };
+ wchar_t *align[] = { LPGENW("Left"), LPGENW("Center"), LPGENW("Right") };
for (int i = 0; i < _countof(align); i++)
SendDlgItemMessage(hwndDlg, IDC_SBAR_HORIZ_ALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateTS(align[i]));
SendDlgItemMessage(hwndDlg, IDC_SBAR_HORIZ_ALIGN, CB_SETCURSEL, db_get_b(NULL, "CLUI", "Align", SETTING_ALIGN_DEFAULT), 0);
}
{
- TCHAR *align[] = { LPGENT("Top"), LPGENT("Center"), LPGENT("Bottom") };
+ wchar_t *align[] = { LPGENW("Top"), LPGENW("Center"), LPGENW("Bottom") };
for (int i = 0; i < _countof(align); i++)
SendDlgItemMessage(hwndDlg, IDC_SBAR_VERT_ALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateTS(align[i]));
SendDlgItemMessage(hwndDlg, IDC_SBAR_VERT_ALIGN, CB_SETCURSEL, db_get_b(NULL, "CLUI", "VAlign", SETTING_VALIGN_DEFAULT), 0);
diff --git a/plugins/Clist_modern/src/modern_tbbutton.cpp b/plugins/Clist_modern/src/modern_tbbutton.cpp index 34a6339e60..0ea00a70be 100644 --- a/plugins/Clist_modern/src/modern_tbbutton.cpp +++ b/plugins/Clist_modern/src/modern_tbbutton.cpp @@ -21,7 +21,7 @@ struct TBBUTTONDATA : public MButtonCtrl bool bHotMark; // button is hot marked (e.g. current state)
bool bFocused;
int nFontID; // internal font ID
- TCHAR szText[128]; // text on the button
+ wchar_t szText[128]; // text on the button
RECT rcMargins; // margins of inner content
HANDLE hIcolibHandle; // handle of icon in iconlib
@@ -238,7 +238,7 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam break;
case WM_SETTEXT:
- mir_tstrncpy(bct->szText, (TCHAR*)lParam, _countof(bct->szText));
+ mir_tstrncpy(bct->szText, (wchar_t*)lParam, _countof(bct->szText));
break;
case WM_SETFONT:
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp index 051ec14f57..7db4523adb 100644 --- a/plugins/Clist_modern/src/modern_toolbar.cpp +++ b/plugins/Clist_modern/src/modern_toolbar.cpp @@ -299,7 +299,7 @@ void CustomizeToolbar(HWND hwnd) static char szUrl[] = "http://miranda-ng.org/p/TopToolBar";
-static TCHAR szWarning[] = LPGENT("To view a toolbar in Clist_modern you need the TopToolBar plugin. Click Yes to download it or No to continue");
+static wchar_t szWarning[] = LPGENW("To view a toolbar in Clist_modern you need the TopToolBar plugin. Click Yes to download it or No to continue");
static void CopySettings(const char* to, const char* from, int defValue)
{
diff --git a/plugins/Clist_modern/src/modern_utils.cpp b/plugins/Clist_modern/src/modern_utils.cpp index 469836c255..07810bd37f 100644 --- a/plugins/Clist_modern/src/modern_utils.cpp +++ b/plugins/Clist_modern/src/modern_utils.cpp @@ -51,7 +51,7 @@ void TRACE_ERROR() // load small icon (not shared) it IS NEED to be destroyed
HICON LoadSmallIcon(HINSTANCE hInstance, int index)
{
- TCHAR filename[MAX_PATH] = { 0 };
+ wchar_t filename[MAX_PATH] = { 0 };
GetModuleFileName(hInstance, filename, MAX_PATH);
HICON hIcon = NULL;
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 7124d3f4b4..6ce7bd2965 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -245,7 +245,7 @@ static int FillDialog(HWND hwnd) item.pszText = TranslateT("Ungrouped contacts");
SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
- TCHAR *szGroup;
+ wchar_t *szGroup;
for (int i = 1; (szGroup = Clist_GroupGetName(i, NULL)) != NULL; i++) {
item.pszText = szGroup;
SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
@@ -344,7 +344,7 @@ static int DeleteAutoModesCallback(char *szsetting) }
-void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szProtoFilter, DWORD dwStatusMask, DWORD dwStickyStatusMask,
+void SaveViewMode(const char *name, const wchar_t *szGroupFilter, const char *szProtoFilter, DWORD dwStatusMask, DWORD dwStickyStatusMask,
unsigned int options, unsigned int stickies, unsigned int operators, unsigned int lmdat)
{
CLVM_EnumModes(DeleteAutoModesCallback);
@@ -372,7 +372,7 @@ void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szPr void SaveState()
{
- TCHAR newGroupFilter[2048] = L"|";
+ wchar_t newGroupFilter[2048] = L"|";
char newProtoFilter[2048] = "|";
DWORD statusMask = 0;
DWORD operators = 0;
@@ -400,7 +400,7 @@ void SaveState() }
{
LVITEM item = { 0 };
- TCHAR szTemp[256];
+ wchar_t szTemp[256];
HWND hwndList = GetDlgItem(clvmHwnd, IDC_GROUPS);
@@ -430,7 +430,7 @@ void SaveState() if (iLen) {
unsigned int stickies = 0;
- TCHAR *szTempModeName = (TCHAR*)mir_alloc((iLen + 1)*sizeof(TCHAR));
+ wchar_t *szTempModeName = (wchar_t*)mir_alloc((iLen + 1)*sizeof(wchar_t));
if (szTempModeName) {
SendDlgItemMessage(clvmHwnd, IDC_VIEWMODES, LB_GETTEXT, clvm_curItem, (LPARAM)szTempModeName);
@@ -495,13 +495,13 @@ static void UpdateFilters() if (iLen == 0)
return;
- TCHAR *szTempBuf = (TCHAR*)_alloca((iLen + 1)*sizeof(TCHAR));
+ wchar_t *szTempBuf = (wchar_t*)_alloca((iLen + 1)*sizeof(wchar_t));
SendDlgItemMessage(clvmHwnd, IDC_VIEWMODES, LB_GETTEXT, clvm_curItem, (LPARAM)szTempBuf);
T2Utf szBuf(szTempBuf);
mir_strncpy(g_szModename, szBuf, _countof(g_szModename));
{
- TCHAR szTemp[100];
+ wchar_t szTemp[100];
mir_sntprintf(szTemp, TranslateT("Configuring view mode: %s"), szTempBuf);
SetDlgItemText(clvmHwnd, IDC_CURVIEWMODE2, szTemp);
}
@@ -547,8 +547,8 @@ static void UpdateFilters() }
{
LVITEM item = { 0 };
- TCHAR szTemp[256];
- TCHAR szMask[256];
+ wchar_t szTemp[256];
+ wchar_t szMask[256];
int i;
HWND hwndList = GetDlgItem(clvmHwnd, IDC_GROUPS);
@@ -562,7 +562,7 @@ static void UpdateFilters() item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
mir_sntprintf(szMask, L"%s|", szTemp);
- if (szGF && _tcsstr(szGF, szMask))
+ if (szGF && wcsstr(szGF, szMask))
ListView_SetCheckState(hwndList, i, TRUE)
else
ListView_SetCheckState(hwndList, i, FALSE);
@@ -689,7 +689,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP int index = 0;
if (g_CluiData.current_viewmode[0] != '\0') {
- TCHAR *temp = mir_utf8decodeW(g_CluiData.current_viewmode);
+ wchar_t *temp = mir_utf8decodeW(g_CluiData.current_viewmode);
if (temp) {
index = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_FINDSTRING, -1, (LPARAM)temp);
mir_free(temp);
@@ -753,7 +753,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (MessageBox(0, TranslateT("Really delete this view mode? This cannot be undone"), TranslateT("Delete a view mode"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
int iLen = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETTEXTLEN, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), 0);
if (iLen) {
- TCHAR *szTempBuf = (TCHAR*)_alloca((iLen + 1)*sizeof(TCHAR));
+ wchar_t *szTempBuf = (wchar_t*)_alloca((iLen + 1)*sizeof(wchar_t));
SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETTEXT, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), (LPARAM)szTempBuf);
DeleteViewMode(T2Utf(szTempBuf));
@@ -769,7 +769,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_ADDVIEWMODE:
{
- TCHAR szBuf[256];
+ wchar_t szBuf[256];
szBuf[0] = 0;
GetDlgItemText(hwndDlg, IDC_NEWVIEMODE, szBuf, _countof(szBuf));
szBuf[255] = 0;
@@ -890,7 +890,7 @@ static int FillMenuCallback(char *szSetting) if (szSetting[0] == 13)
return 1;
- TCHAR *temp = mir_utf8decodeT(szSetting);
+ wchar_t *temp = mir_utf8decodeT(szSetting);
if (temp) {
AppendMenu(hViewModeMenu, MFT_STRING, menuCounter++, temp);
mir_free(temp);
@@ -1086,7 +1086,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (selection == 10002)
goto clvm_reset_command;
- TCHAR szTemp[256];
+ wchar_t szTemp[256];
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STRING;
diff --git a/plugins/Clist_modern/src/stdafx.h b/plugins/Clist_modern/src/stdafx.h index 21abdf4975..814eed1ffa 100644 --- a/plugins/Clist_modern/src/stdafx.h +++ b/plugins/Clist_modern/src/stdafx.h @@ -119,7 +119,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "resource.h"
#define DEFAULT_SKIN_FOLDER "Skins\\Modern contact list"
-extern TCHAR SkinsFolder[MAX_PATH];
+extern wchar_t SkinsFolder[MAX_PATH];
//macros to free data and set it pointer to NULL
#define mir_free_and_nil(x) {mir_free((void*)x); x=NULL;}
@@ -224,7 +224,7 @@ int AniAva_InitModule(); // HAVE TO BE AFTER GDI+ INITIALIZED int AniAva_UnloadModule();
int AniAva_UpdateOptions(); //reload options, //hot enable/disable engine
-int AniAva_AddAvatar(MCONTACT hContact, TCHAR * szFilename, int width, int heigth); // adds avatars to be displayed
+int AniAva_AddAvatar(MCONTACT hContact, wchar_t * szFilename, int width, int heigth); // adds avatars to be displayed
int AniAva_SetAvatarPos(MCONTACT hContact, RECT *rc, int overlayIdx, BYTE bAlpha); // update avatars pos
int AniAva_InvalidateAvatarPositions(MCONTACT hContact); // reset positions of avatars to be drawn (still be painted at same place)
int AniAva_RemoveInvalidatedAvatars(); // all avatars without validated position will be stop painted and probably removed
diff --git a/plugins/Clist_ng/SRC/clcopts.cpp b/plugins/Clist_ng/SRC/clcopts.cpp index 283c87bd0c..1a1c4b5fda 100644 --- a/plugins/Clist_ng/SRC/clcopts.cpp +++ b/plugins/Clist_ng/SRC/clcopts.cpp @@ -548,11 +548,11 @@ INT_PTR CALLBACK cfg::DlgProcDspClasses(HWND hwndDlg, UINT msg, WPARAM wParam, L {
switch(msg) {
case WM_INITDIALOG:
- SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateW(L"Offline contacts"));
- SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateW(L"Online contacts"));
- SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateW(L"Selected contacts"));
- SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateW(L"Hovered contacts"));
- SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateW(L"Priority contacts"));
+ SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Offline contacts"));
+ SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Online contacts"));
+ SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Selected contacts"));
+ SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Hovered contacts"));
+ SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Priority contacts"));
SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_SETCURSEL, 0, 0);
break;
diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp index 047ef84064..fef024d3b1 100644 --- a/plugins/Clist_nicer/src/CLCButton.cpp +++ b/plugins/Clist_nicer/src/CLCButton.cpp @@ -102,7 +102,7 @@ int ClcGetButtonId(HWND hwnd) struct MButtonExtension : public MButtonCtrl
{
HICON hIconPrivate;
- TCHAR szText[128];
+ wchar_t szText[128];
SIZE sLabel;
HIMAGELIST hIml;
int iIcon;
@@ -388,7 +388,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR break;
case WM_SETTEXT:
- _tcsncpy_s(bct->szText, (TCHAR*)lParam, _TRUNCATE);
+ wcsncpy_s(bct->szText, (wchar_t*)lParam, _TRUNCATE);
break;
case BM_GETIMAGE:
diff --git a/plugins/Clist_nicer/src/clc.h b/plugins/Clist_nicer/src/clc.h index 91b917162f..b083c93a83 100644 --- a/plugins/Clist_nicer/src/clc.h +++ b/plugins/Clist_nicer/src/clc.h @@ -94,7 +94,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct _OrderTreeData
{
BYTE ID;
- const TCHAR * Name;
+ const wchar_t * Name;
BYTE Position;
BOOL Visible;
BOOL fReserved;
@@ -105,7 +105,7 @@ struct TExtraCache MCONTACT hContact;
HANDLE hTimeZone;
BYTE valid;
- TCHAR *statusMsg;
+ wchar_t *statusMsg;
BYTE bStatusMsgValid;
DWORD dwCFlags;
DWORD dwDFlags; // display flags for caching only
@@ -274,7 +274,7 @@ struct TCluiData { BOOL bUsePerProto;
BOOL bOverridePerStatusColors;
BOOL bDontSeparateOffline;
- TCHAR groupFilter[2048];
+ wchar_t groupFilter[2048];
char protoFilter[2048];
char varFilter[2048];
DWORD lastMsgFilter;
@@ -308,7 +308,7 @@ struct TCluiData { int group_padding;
DWORD t_now;
BOOL realTimeSaving;
- TCHAR tszProfilePath[MAX_PATH];
+ wchar_t tszProfilePath[MAX_PATH];
FILETIME ft;
SYSTEMTIME st;
};
@@ -373,13 +373,13 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM // clcutils.c
void SetGroupExpand(HWND hwnd, struct ClcData *dat, ClcGroup *group, int newState);
void DoSelectionDefaultAction(HWND hwnd, struct ClcData *dat);
-int FindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefixOk);
+int FindRowByText(HWND hwnd, struct ClcData *dat, const wchar_t *text, int prefixOk);
void BeginRenameSelection(HWND hwnd, struct ClcData *dat);
int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **contact, ClcGroup **group, DWORD *flags);
void ScrollTo(HWND hwnd, struct ClcData *dat, int desty, int noSmooth);
void RecalcScrollBar(HWND hwnd, struct ClcData *dat);
-size_t MY_pathToRelative(const TCHAR *pSrc, TCHAR *pOut);
-size_t MY_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut);
+size_t MY_pathToRelative(const wchar_t *pSrc, wchar_t *pOut);
+size_t MY_pathToAbsolute(const wchar_t *pSrc, wchar_t *pOut);
#define DROPTARGET_OUTSIDE 0
#define DROPTARGET_ONSELF 1
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index b6ebeb7cb3..d46f474e20 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -52,14 +52,14 @@ ClcContact* CreateClcContact(void) return p;
}
-ClcContact* AddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText)
+ClcContact* AddInfoItemToGroup(ClcGroup *group, int flags, const wchar_t *pszText)
{
ClcContact *p = coreCli.pfnAddInfoItemToGroup(group, flags, pszText);
p->avatarLeft = p->extraIconRightBegin = -1;
return p;
}
-ClcGroup *AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers)
+ClcGroup *AddGroup(HWND hwnd, struct ClcData *dat, const wchar_t *szName, DWORD flags, int groupId, int calcTotalMembers)
{
ClcGroup *p = coreCli.pfnAddGroup(hwnd, dat, szName, flags, groupId, calcTotalMembers);
if (p && p->parent)
@@ -188,13 +188,13 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (!result && mir_tstrlen(dbv.ptszVal) > 1) {
size_t iLen = mir_tstrlen(dbv.ptszVal);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
- p->statusMsg = (TCHAR *)realloc(p->statusMsg, (iLen + 2) * sizeof(TCHAR));
- _tcsncpy(p->statusMsg, dbv.ptszVal, iLen + 1);
+ p->statusMsg = (wchar_t *)realloc(p->statusMsg, (iLen + 2) * sizeof(wchar_t));
+ wcsncpy(p->statusMsg, dbv.ptszVal, iLen + 1);
}
else {
int xStatus;
WPARAM xStatus2;
- TCHAR xStatusName[128];
+ wchar_t xStatusName[128];
CUSTOM_STATUS cst = { sizeof(cst) };
cst.flags = CSSF_MASK_STATUS;
@@ -204,9 +204,9 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) cst.wParam = &xStatus2;
cst.ptszName = xStatusName;
if (!CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, hContact, (LPARAM)&cst)) {
- TCHAR *szwXstatusName = TranslateTS(xStatusName);
- p->statusMsg = (TCHAR *)realloc(p->statusMsg, (mir_tstrlen(szwXstatusName) + 2) * sizeof(TCHAR));
- _tcsncpy(p->statusMsg, szwXstatusName, mir_tstrlen(szwXstatusName) + 1);
+ wchar_t *szwXstatusName = TranslateTS(xStatusName);
+ p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_tstrlen(szwXstatusName) + 2) * sizeof(wchar_t));
+ wcsncpy(p->statusMsg, szwXstatusName, mir_tstrlen(szwXstatusName) + 1);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
}
}
@@ -215,9 +215,9 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (p->bStatusMsgValid > STATUSMSG_XSTATUSNAME) {
int j = 0;
- p->statusMsg = (TCHAR *)realloc(p->statusMsg, (mir_tstrlen(dbv.ptszVal) + 2) * sizeof(TCHAR));
+ p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_tstrlen(dbv.ptszVal) + 2) * sizeof(wchar_t));
for (int i = 0; dbv.ptszVal[i]; i++) {
- if (dbv.ptszVal[i] == (TCHAR)0x0d)
+ if (dbv.ptszVal[i] == (wchar_t)0x0d)
continue;
p->statusMsg[j] = dbv.ptszVal[i] == (wchar_t)0x0a ? (wchar_t)' ' : dbv.ptszVal[i];
j++;
@@ -265,7 +265,7 @@ void ReloadExtraInfo(MCONTACT hContact) void RTL_DetectAndSet(ClcContact *contact, MCONTACT hContact)
{
WORD infoTypeC2[12];
- TCHAR *szText;
+ wchar_t *szText;
TExtraCache *p;
memset(infoTypeC2, 0, sizeof(infoTypeC2));
@@ -409,9 +409,9 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, struct ClcData if (cfg::dat.bFilterEffective & CLVM_FILTER_GROUPS) {
ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
if (tszGroup != NULL) {
- TCHAR szGroupMask[256];
+ wchar_t szGroupMask[256];
mir_sntprintf(szGroupMask, L"%s|", tszGroup);
- int bHasGroup = _tcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0;
+ int bHasGroup = wcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0;
filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | bHasGroup) : (filterResult & bHasGroup);
}
else if (cfg::dat.filterFlags & CLVM_INCLUDED_UNGROUPED)
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index f20f3bb4e6..5d73f252b9 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -62,18 +62,18 @@ struct CheckBoxToGroupStyleEx_t { 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 UINT sortCtrlIDs[] = { IDC_SORTPRIMARY, IDC_SORTTHEN, IDC_SORTFINALLY, 0 };
@@ -711,7 +711,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, {
DBVARIANT dbv;
if (!db_get_ts(NULL, "CLC", "BkBitmap", &dbv)) {
- TCHAR szPath[MAX_PATH];
+ wchar_t szPath[MAX_PATH];
if (PathToAbsoluteT(dbv.ptszVal, szPath))
SetDlgItemText(hwndDlg, IDC_FILENAME, szPath);
@@ -743,7 +743,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));
Bitmap_GetFilter(filter, _countof(filter));
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp index dd985a65fe..76d2aa23ed 100644 --- a/plugins/Clist_nicer/src/clcpaint.cpp +++ b/plugins/Clist_nicer/src/clcpaint.cpp @@ -36,7 +36,7 @@ extern char *im_clients[]; extern HICON im_clienthIcons[];
extern HICON overlayicons[];
-extern TCHAR *statusNames[];
+extern wchar_t *statusNames[];
extern LONG g_cxsmIcon, g_cysmIcon;
@@ -200,7 +200,7 @@ void PaintNotifyArea(HDC hDC, RECT *rc) rc->left += 26;
int iCount = GetMenuItemCount(cfg::dat.hMenuNotify);
if (cfg::dat.hUpdateContact != 0) {
- TCHAR *szName = pcli->pfnGetContactDisplayName(cfg::dat.hUpdateContact, 0);
+ wchar_t *szName = pcli->pfnGetContactDisplayName(cfg::dat.hUpdateContact, 0);
int iIcon = pcli->pfnGetContactIcon(cfg::dat.hUpdateContact);
ImageList_DrawEx(hCListImages, iIcon, hDC, rc->left, (rc->bottom + rc->top - g_cysmIcon) / 2, g_cxsmIcon, g_cysmIcon, CLR_NONE, CLR_NONE, ILD_NORMAL);
@@ -215,7 +215,7 @@ void PaintNotifyArea(HDC hDC, RECT *rc) GetMenuItemInfo(cfg::dat.hMenuNotify, iCount - 1, TRUE, &mii);
NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) mii.dwItemData;
- TCHAR *szName = pcli->pfnGetContactDisplayName(nmi->hContact, 0);
+ wchar_t *szName = pcli->pfnGetContactDisplayName(nmi->hContact, 0);
int iIcon = pcli->pfnGetContactIcon(nmi->hContact);
ImageList_DrawEx(hCListImages, iIcon, hDC, rc->left, (rc->bottom + rc->top - g_cysmIcon) / 2, g_cxsmIcon, g_cysmIcon, CLR_NONE, CLR_NONE, ILD_NORMAL);
rc->left += 18;
@@ -499,7 +499,7 @@ set_bg_l: else
ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight);
- TCHAR *szCounts = NULL;
+ wchar_t *szCounts = NULL;
if (type == CLCIT_GROUP) {
GetTextExtentPoint32(hdcMem, contact->szText, (int)mir_tstrlen(contact->szText), &textSize);
int width = textSize.cx;
@@ -1061,7 +1061,7 @@ bgskipped: }
}
else {
- TCHAR *szText = contact->szText;
+ wchar_t *szText = contact->szText;
rcContent.top = y + ((rowHeight - fontHeight) >> 1);
@@ -1103,7 +1103,7 @@ bgskipped: RECT rc2 = rcContent;
int fHeight = 0;
- TCHAR szResult[80];
+ wchar_t szResult[80];
if (TimeZone_PrintDateTime(cEntry->hTimeZone, L"t", szResult, _countof(szResult), 0))
goto nodisplay;
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index 626d421ae6..576642bf86 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -35,7 +35,7 @@ extern int /*g_isConnecting,*/ during_sizing; extern void ( *saveRecalcScrollBar )(HWND hwnd, struct ClcData *dat);
-static int MY_pathIsAbsolute(const TCHAR *path)
+static int MY_pathIsAbsolute(const wchar_t *path)
{
if (!path || !(mir_tstrlen(path) > 2))
return 0;
@@ -46,7 +46,7 @@ static int MY_pathIsAbsolute(const TCHAR *path) return 0;
}
-size_t MY_pathToRelative(const TCHAR *pSrc, TCHAR *pOut)
+size_t MY_pathToRelative(const wchar_t *pSrc, wchar_t *pOut)
{
size_t dwSrcLen, dwProfilePathLen;
@@ -58,25 +58,25 @@ size_t MY_pathToRelative(const TCHAR *pSrc, TCHAR *pOut) if (!MY_pathIsAbsolute(pSrc))
goto path_not_abs;
- TCHAR szTmp[MAX_PATH];
- memcpy(szTmp, pSrc, (dwSrcLen * sizeof(TCHAR)));
+ wchar_t szTmp[MAX_PATH];
+ memcpy(szTmp, pSrc, (dwSrcLen * sizeof(wchar_t)));
szTmp[dwSrcLen] = 0;
- _tcslwr(szTmp);
- if (_tcsstr(szTmp, cfg::dat.tszProfilePath)) {
+ wcslwr(szTmp);
+ if (wcsstr(szTmp, cfg::dat.tszProfilePath)) {
dwProfilePathLen = mir_tstrlen(cfg::dat.tszProfilePath);
- memcpy(pOut, (pSrc + (dwProfilePathLen - 1)), ((dwSrcLen - (dwProfilePathLen - 1)) * sizeof(TCHAR)));
+ memcpy(pOut, (pSrc + (dwProfilePathLen - 1)), ((dwSrcLen - (dwProfilePathLen - 1)) * sizeof(wchar_t)));
pOut[0] = '.';
pOut[dwSrcLen] = 0;
return (dwSrcLen - (dwProfilePathLen - 1));
}
path_not_abs:
- memcpy(pOut, pSrc, (dwSrcLen * sizeof(TCHAR)));
+ memcpy(pOut, pSrc, (dwSrcLen * sizeof(wchar_t)));
pOut[dwSrcLen] = 0;
return dwSrcLen;
}
-size_t MY_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut)
+size_t MY_pathToAbsolute(const wchar_t *pSrc, wchar_t *pOut)
{
size_t dwSrcLen;
@@ -87,7 +87,7 @@ size_t MY_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut) return 0;
if (MY_pathIsAbsolute(pSrc) && pSrc[0] != '.') {
- memcpy(pOut, pSrc, (dwSrcLen * sizeof(TCHAR)));
+ memcpy(pOut, pSrc, (dwSrcLen * sizeof(wchar_t)));
pOut[dwSrcLen] = 0;
return dwSrcLen;
}
@@ -167,7 +167,7 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, ClcContact *hitcontac GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_tstrlen(hitcontact->szText), &textSize);
width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
- TCHAR *szCounts;
+ wchar_t *szCounts;
szCounts = pcli->pfnGetGroupCountsText(dat, hitcontact);
if (szCounts[0]) {
GetTextExtentPoint32(hdc, L" ", 1, &textSize);
@@ -308,7 +308,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_tstrlen(hitcontact->szText), &textSize);
width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
- TCHAR *szCounts;
+ wchar_t *szCounts;
szCounts = pcli->pfnGetGroupCountsText(dat, hitcontact);
if (szCounts[0]) {
GetTextExtentPoint32(hdc, L" ", 1, &textSize);
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp index 34ec1b17dd..6a504da5b3 100644 --- a/plugins/Clist_nicer/src/clistevents.cpp +++ b/plugins/Clist_nicer/src/clistevents.cpp @@ -254,14 +254,14 @@ CListEvent* AddEvent(CLISTEVENT *cle) }
char *szProto = GetContactProto(p->hContact);
- TCHAR *szName = pcli->pfnGetContactDisplayName(p->hContact, 0);
+ wchar_t *szName = pcli->pfnGetContactDisplayName(p->hContact, 0);
if (szProto && szName) {
NotifyMenuItemExData *nmi = (NotifyMenuItemExData*)malloc(sizeof(NotifyMenuItemExData));
if (nmi) {
- TCHAR szBuffer[128];
- TCHAR* szStatus = pcli->pfnGetStatusModeDescription(db_get_w(p->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
+ wchar_t szBuffer[128];
+ wchar_t* szStatus = pcli->pfnGetStatusModeDescription(db_get_w(p->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
- TCHAR szwProto[64];
+ wchar_t szwProto[64];
MultiByteToWideChar(CP_ACP, 0, szProto, -1, szwProto, 64);
szwProto[63] = 0;
mir_sntprintf(szBuffer, L"%s: %s (%s)", szwProto, szName, szStatus);
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index 7e74dbd6b2..94cfbf6e52 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -98,7 +98,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA return FALSE;
}
else {
- TCHAR szTitle[512];
+ wchar_t szTitle[512];
DWORD dwFlags = db_get_dw(hContact, "CList", "CLN_Flags", 0);
BYTE bSecondLine = db_get_b(hContact, "CList", "CLN_2ndline", -1);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 8041d1dda3..954d08a5bd 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -60,7 +60,7 @@ static BYTE old_cliststate, show_on_first_autosize = FALSE; RECT cluiPos; -TCHAR *statusNames[12]; +wchar_t *statusNames[12]; extern LRESULT CALLBACK EventAreaWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); extern HANDLE hNotifyFrame; @@ -160,7 +160,7 @@ static int FS_FontsChanged(WPARAM, LPARAM) // last frame of all. static HWND PreCreateCLC(HWND parent) { - pcli->hwndContactTree = CreateWindow(_T(CLISTCONTROL_CLASS), L"", + pcli->hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"", WS_CHILD | CLS_CONTACTLIST | (db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0) | (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0) @@ -256,7 +256,7 @@ static void InitIcoLib() char szBuffer[128]; mir_snprintf(szBuffer, "cln_ovl_%d", ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE)); IconItemT icon = { pcli->pfnGetStatusModeDescription(ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE), 0), szBuffer, i }; - Icon_RegisterT(g_hInst, LPGENT("Contact list") L"/" LPGENT("Overlay icons"), &icon, 1); + Icon_RegisterT(g_hInst, LPGENW("Contact list") L"/" LPGENW("Overlay icons"), &icon, 1); } PROTOACCOUNT **accs = NULL; @@ -266,10 +266,10 @@ static void InitIcoLib() if (!Proto_IsAccountEnabled(accs[k]) || CallProtoService(accs[k]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0) continue; - TCHAR szDescr[128]; + wchar_t szDescr[128]; mir_sntprintf(szDescr, TranslateT("%s connecting"), accs[k]->tszAccountName); IconItemT icon = { szDescr, "conn", IDI_PROTOCONNECTING }; - Icon_RegisterT(g_hInst, LPGENT("Contact list") L"/" LPGENT("Connecting icons"), &icon, 1, accs[k]->szModuleName); + Icon_RegisterT(g_hInst, LPGENW("Contact list") L"/" LPGENW("Connecting icons"), &icon, 1, accs[k]->szModuleName); } } @@ -1415,7 +1415,7 @@ skipbg: if (!contactOK) MessageBox(0, TranslateT("The requested action requires a valid contact selection. Please select a contact from the contact list and repeat."), TranslateT("Parameter mismatch"), MB_OK); if (serviceFailure) { - TCHAR szError[512]; + wchar_t szError[512]; mir_sntprintf(szError, TranslateT("The service %S specified by the %S button definition was not found. You may need to install additional plugins."), item->szService, item->szName); MessageBox(NULL, szError, TranslateT("Service failure"), MB_OK); } @@ -1706,7 +1706,7 @@ buttons_done: } if (showOpts & 2) { - TCHAR szName[64]; + wchar_t szName[64]; PROTOACCOUNT *pa = Proto_GetAccount(szProto); if (pa) { mir_tstrncpy(szName, pa->tszAccountName, _countof(szName)); @@ -1722,7 +1722,7 @@ buttons_done: x += textSize.cx; } if (showOpts & 4) { - TCHAR *szStatus = pcli->pfnGetStatusModeDescription(status, 0); + wchar_t *szStatus = pcli->pfnGetStatusModeDescription(status, 0); GetTextExtentPoint32(dis->hDC, szStatus, (int)mir_tstrlen(szStatus), &textSize); TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, (int)mir_tstrlen(szStatus)); } @@ -1825,7 +1825,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar SendDlgItemMessage(hwndDlg, IDC_VERSION, WM_SETFONT, (WPARAM)hFont, 0); } { - TCHAR str[64]; + wchar_t str[64]; DWORD v = pluginInfo.version; mir_sntprintf(str, L"%s %d.%d.%d.%d", TranslateT("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v))); SetDlgItemText(hwndDlg, IDC_VERSION, str); @@ -1962,29 +1962,29 @@ void OnCreateClc() 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 }, - { LPGENT("Status mode"), FIDF_CLASSGENERAL }, - { LPGENT("Frame titles"), FIDF_CLASSGENERAL }, - { LPGENT("Event area"), FIDF_CLASSGENERAL }, - { LPGENT("Contact list local time"), 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 }, + { LPGENW("Status mode"), FIDF_CLASSGENERAL }, + { LPGENW("Frame titles"), FIDF_CLASSGENERAL }, + { LPGENW("Event area"), FIDF_CLASSGENERAL }, + { LPGENW("Contact list local time"), FIDF_CLASSGENERAL } }; void FS_RegisterFonts() { FontIDT fid = { sizeof(fid) }; - _tcsncpy(fid.group, LPGENT("Contact list"), _countof(fid.group)); + wcsncpy(fid.group, LPGENW("Contact list"), _countof(fid.group)); strncpy(fid.dbSettingsGroup, "CLC", 5); fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS | FIDF_APPENDNAME | FIDF_SAVEPOINTSIZE; @@ -1994,7 +1994,7 @@ void FS_RegisterFonts() pcli->pfnGetFontSetting(i, &lf, &fid.deffontsettings.colour); lf.lfHeight = -MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72); - _tcsncpy_s(fid.deffontsettings.szFace, lf.lfFaceName, _TRUNCATE); + wcsncpy_s(fid.deffontsettings.szFace, lf.lfFaceName, _TRUNCATE); fid.deffontsettings.charset = lf.lfCharSet; fid.deffontsettings.size = (char)lf.lfHeight; fid.deffontsettings.style = (lf.lfWeight >= FW_BOLD ? DBFONTF_BOLD : 0) | (lf.lfItalic ? DBFONTF_ITALIC : 0); @@ -2002,7 +2002,7 @@ void FS_RegisterFonts() fid.flags &= ~FIDF_CLASSMASK; fid.flags |= clistFontDescr[i].iMask; - _tcsncpy(fid.name, clistFontDescr[i].tszName, _countof(fid.name)); + wcsncpy(fid.name, clistFontDescr[i].tszName, _countof(fid.name)); char idstr[10]; mir_snprintf(idstr, "Font%d", i); @@ -2019,32 +2019,32 @@ void FS_RegisterFonts() 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); strncpy(colourid.dbSettingsGroup, "CLUI", sizeof(colourid.dbSettingsGroup)); strncpy(colourid.setting, "clr_frameborder", sizeof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Embedded frames border"), _countof(colourid.name)); + wcsncpy(colourid.name, LPGENW("Embedded frames border"), _countof(colourid.name)); colourid.order = 1; colourid.defcolour = RGB(40, 40, 40); ColourRegisterT(&colourid); diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp index 2a5fe5eca6..53e2692258 100644 --- a/plugins/Clist_nicer/src/cluiframes.cpp +++ b/plugins/Clist_nicer/src/cluiframes.cpp @@ -1348,7 +1348,7 @@ static int CLUIFramesLoadMainMenu() FRAMEWND &F = Frames[i]; mi.hIcolibItem = F.TitleBar.hicon; mi.position = separator; - mi.name.t = F.TitleBar.tbname ? F.TitleBar.tbname : F.name; + mi.name.w = F.TitleBar.tbname ? F.TitleBar.tbname : F.name; mi.pszService = 0; g_frameMenus.insert(F.MenuHandles.MainMenuItem = Menu_AddMainMenuItem(&mi)); CLUIFramesCreateMenuForFrame(F.id, F.MenuHandles.MainMenuItem, separator, true); @@ -1597,7 +1597,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) Frames[nFramescount].dwFlags = clfrm->Flags; if (clfrm->name == NULL || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->wname) : mir_strlen(clfrm->name)) == 0) { - TCHAR ptszClassName[256]; + wchar_t ptszClassName[256]; GetClassName(Frames[nFramescount].hWnd, ptszClassName, _countof(ptszClassName)); Frames[nFramescount].name = mir_tstrdup(ptszClassName); } @@ -2892,7 +2892,7 @@ INT_PTR CLUIFrameSetFloat(WPARAM wParam, LPARAM lParam) return 0; } -TCHAR g_ptszEventName[100]; +wchar_t g_ptszEventName[100]; static int CLUIFrameOnModulesLoad(WPARAM, LPARAM) { diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp index dec092b6a9..fe8f5e380f 100644 --- a/plugins/Clist_nicer/src/cluiopts.cpp +++ b/plugins/Clist_nicer/src/cluiopts.cpp @@ -233,7 +233,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l else
SetMenu(pcli->hwndContactList, pcli->hMenuMain);
- 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/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index 9a80fdd757..826fcdfcab 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -111,7 +111,7 @@ void CluiProtocolStatusChanged(int, const char*) else {
SIZE textSize;
BYTE showOpts = db_get_b(NULL, "CLUI", "SBarShow", 1);
- TCHAR szName[32];
+ wchar_t szName[32];
HDC hdc = GetDC(NULL);
HFONT hofont = reinterpret_cast<HFONT>(SelectObject(hdc, (HFONT)SendMessage(pcli->hwndStatus, WM_GETFONT, 0, 0)));
@@ -139,7 +139,7 @@ void CluiProtocolStatusChanged(int, const char*) x += textSize.cx + GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
if (showOpts & 4) {
- TCHAR* modeDescr = pcli->pfnGetStatusModeDescription(CallProtoService(accs[i]->szModuleName, PS_GETSTATUS, 0, 0), 0);
+ wchar_t* modeDescr = pcli->pfnGetStatusModeDescription(CallProtoService(accs[i]->szModuleName, PS_GETSTATUS, 0, 0), 0);
GetTextExtentPoint32(hdc, modeDescr, (int)mir_tstrlen(modeDescr), &textSize);
x += textSize.cx + GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
@@ -219,7 +219,7 @@ void CluiProtocolStatusChanged(int, const char*) * and uses timer based sort and redraw handling. This can improve performance
* when connecting multiple protocols significantly.
*/
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
/*
* set the global status icon and display the global (most online) status mode on the
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp index 4195d5fe63..663e4dadef 100644 --- a/plugins/Clist_nicer/src/config.cpp +++ b/plugins/Clist_nicer/src/config.cpp @@ -42,7 +42,7 @@ EXCEPTION_RECORD API::exRecord = { 0 }; CONTEXT API::exCtx = { 0 };
LRESULT API::exLastResult = 0;
char API::exSzFile[MAX_PATH] = "";
-TCHAR API::exReason[256] = L"";
+wchar_t API::exReason[256] = L"";
int API::exLine = 0;
bool API::exAllowContinue = false;
HMODULE API::hDwm = 0;
@@ -193,7 +193,7 @@ void API::Ex_Handler() ExitProcess(1);
}
-int API::Ex_ShowDialog(EXCEPTION_POINTERS *ep, const char *szFile, int line, TCHAR* szReason, bool fAllowContinue)
+int API::Ex_ShowDialog(EXCEPTION_POINTERS *ep, const char *szFile, int line, wchar_t* szReason, bool fAllowContinue)
{
char szDrive[MAX_PATH], szDir[MAX_PATH], szName[MAX_PATH], szExt[MAX_PATH];
@@ -230,9 +230,9 @@ void TSAPI Utils::showDlgControl(const HWND hwnd, UINT id, int showCmd) *
* return 0 and throw an exception if something goes wrong.
*/
-HMODULE Utils::loadSystemLibrary(const TCHAR* szFilename, bool useGetHandle)
+HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename, bool useGetHandle)
{
- TCHAR sysPathName[MAX_PATH + 2];
+ wchar_t sysPathName[MAX_PATH + 2];
HMODULE _h = 0;
try {
@@ -258,16 +258,16 @@ HMODULE Utils::loadSystemLibrary(const TCHAR* szFilename, bool useGetHandle) return (_h);
}
-CRTException::CRTException(const char *szMsg, const TCHAR *szParam) : std::runtime_error(std::string(szMsg))
+CRTException::CRTException(const char *szMsg, const wchar_t *szParam) : std::runtime_error(std::string(szMsg))
{
mir_sntprintf(m_szParam, MAX_PATH, szParam);
}
void CRTException::display() const
{
- TCHAR *tszMsg = mir_a2t(what());
+ wchar_t *tszMsg = mir_a2t(what());
- TCHAR tszBoxMsg[500];
+ wchar_t tszBoxMsg[500];
mir_sntprintf(tszBoxMsg, L"%s\n\n(%s)", tszMsg, m_szParam);
::MessageBox(0, tszBoxMsg, L"Clist_nicer runtime error", MB_OK | MB_ICONERROR);
mir_free(tszMsg);
diff --git a/plugins/Clist_nicer/src/config.h b/plugins/Clist_nicer/src/config.h index 327353432e..581d01b0be 100644 --- a/plugins/Clist_nicer/src/config.h +++ b/plugins/Clist_nicer/src/config.h @@ -38,13 +38,13 @@ typedef HRESULT (WINAPI *pfnDwmIsCompositionEnabled_t)(BOOL *); class CRTException : public std::runtime_error
{
public:
- CRTException(const char *szMsg, const TCHAR *szParam);
+ CRTException(const char *szMsg, const wchar_t *szParam);
~CRTException() {}
void display() const;
private:
- TCHAR m_szParam[MAX_PATH];
+ wchar_t m_szParam[MAX_PATH];
};
class cfg
@@ -80,7 +80,7 @@ public: static void Ex_CopyEditToClipboard (HWND hWnd);
static INT_PTR CALLBACK Ex_DlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
static void Ex_Handler ();
- static int Ex_ShowDialog (EXCEPTION_POINTERS *ep, const char *szFile, int line, TCHAR* szReason, bool fAllowContinue);
+ static int Ex_ShowDialog (EXCEPTION_POINTERS *ep, const char *szFile, int line, wchar_t* szReason, bool fAllowContinue);
static pfnDwmExtendFrameIntoClientArea_t pfnDwmExtendFrameIntoClientArea;
static pfnDwmIsCompositionEnabled_t pfnDwmIsCompositionEnabled;
@@ -92,7 +92,7 @@ public: static CONTEXT exCtx;
static LRESULT exLastResult;
static char exSzFile[MAX_PATH];
- static TCHAR exReason[256];
+ static wchar_t exReason[256];
static int exLine;
static bool exAllowContinue;
@@ -105,7 +105,7 @@ class Utils public:
static void TSAPI enableDlgControl(const HWND hwnd, UINT id, BOOL fEnable);
static void TSAPI showDlgControl(const HWND hwnd, UINT id, int showCmd);
- static HMODULE loadSystemLibrary(const TCHAR* szFilename, bool useGetHandle = false);
+ static HMODULE loadSystemLibrary(const wchar_t* szFilename, bool useGetHandle = false);
};
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index cd8a3d8f93..04bf2fc34d 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -101,7 +101,7 @@ static void MF_CalcFrequency(MCONTACT hContact, DWORD dwCutoffDays, int doSleep) db_set_dw(hContact, "CList", "mf_count", eventCount);
}
-extern TCHAR g_ptszEventName[];
+extern wchar_t g_ptszEventName[];
void MF_UpdateThread(LPVOID)
{
@@ -158,7 +158,7 @@ int __forceinline GetProtoIndex(char * szName) int __forceinline INTSORT_CompareContacts(const ClcContact* c1, const ClcContact* c2, UINT bywhat)
{
- TCHAR *namea, *nameb;
+ wchar_t *namea, *nameb;
int statusa, statusb;
char *szProto1, *szProto2;
int rc;
@@ -201,8 +201,8 @@ int __forceinline INTSORT_CompareContacts(const ClcContact* c1, const ClcContact switch (bywhat) {
case SORTBY_NAME:
- namea = (TCHAR *)c1->szText;
- nameb = (TCHAR *)c2->szText;
+ namea = (wchar_t *)c1->szText;
+ nameb = (wchar_t *)c2->szText;
return CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, namea, -1, nameb, -1) - 2;
case SORTBY_LASTMSG:
diff --git a/plugins/Clist_nicer/src/coolsblib.cpp b/plugins/Clist_nicer/src/coolsblib.cpp index 3dc6705d9a..61da1b3567 100644 --- a/plugins/Clist_nicer/src/coolsblib.cpp +++ b/plugins/Clist_nicer/src/coolsblib.cpp @@ -31,7 +31,7 @@ #include "userdefs.h"
#include "coolsb_internal.h"
-static TCHAR szPropStr[] = L"CoolSBSubclassPtr";
+static wchar_t szPropStr[] = L"CoolSBSubclassPtr";
LRESULT CALLBACK CoolSBWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 325330056c..5ed6ee4347 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -1169,10 +1169,10 @@ void IMG_LoadItems() if (db_get_ts(NULL, "CLC", "AdvancedSkin", &dbv))
return;
- TCHAR tszFileName[MAX_PATH];
+ wchar_t tszFileName[MAX_PATH];
MY_pathToAbsolute(dbv.ptszVal, tszFileName);
- // TODO: rewrite the skin loading in TCHAR manner
+ // TODO: rewrite the skin loading in wchar_t manner
char szFileName[MAX_PATH];
WideCharToMultiByte(CP_ACP, 0, tszFileName, MAX_PATH, szFileName, MAX_PATH, 0, 0);
@@ -1221,7 +1221,7 @@ void IMG_LoadItems() CoolSB_SetupScrollBar();
}
-void LoadPerContactSkins(TCHAR *tszFileName)
+void LoadPerContactSkins(wchar_t *tszFileName)
{
char szItem[100];
ptrA szSections(LPSTR(calloc(3002, 1)));
@@ -1441,7 +1441,7 @@ void extbk_import(char *file, HWND hwndDlg) static void ApplyCLUISkin()
{
DBVARIANT dbv = { 0 };
- TCHAR tszFinalName[MAX_PATH];
+ wchar_t tszFinalName[MAX_PATH];
char szFinalName[MAX_PATH];
if (!db_get_ts(NULL, "CLC", "AdvancedSkin", &dbv)) {
MY_pathToAbsolute(dbv.ptszVal, tszFinalName);
@@ -1524,7 +1524,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case IDC_SELECTSKINFILE:
{
OPENFILENAME ofn = { 0 };
- TCHAR str[MAX_PATH] = L"*.clist", final_path[MAX_PATH];
+ wchar_t str[MAX_PATH] = L"*.clist", final_path[MAX_PATH];
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
@@ -1562,7 +1562,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L break;
case IDC_RELOAD:
- TCHAR tszFilename[MAX_PATH], tszFinalPath[MAX_PATH];
+ wchar_t tszFilename[MAX_PATH], tszFinalPath[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_SKINFILE, tszFilename, _countof(tszFilename));
tszFilename[MAX_PATH - 1] = 0;
MY_pathToAbsolute(tszFilename, tszFinalPath);
diff --git a/plugins/Clist_nicer/src/extBackg.h b/plugins/Clist_nicer/src/extBackg.h index 607ac3dc17..474107b05a 100644 --- a/plugins/Clist_nicer/src/extBackg.h +++ b/plugins/Clist_nicer/src/extBackg.h @@ -71,14 +71,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. BOOL CheckItem(int item, HWND hwndDlg);
BOOL isValidItem(void);
-void extbk_export(const TCHAR *file);
-void extbk_import(const TCHAR *file, HWND hwndDlg);
+void extbk_export(const wchar_t *file);
+void extbk_import(const wchar_t *file, HWND hwndDlg);
void LoadExtBkSettingsFromDB();
void IMG_LoadItems();
void __fastcall IMG_RenderImageItem(HDC hdc, ImageItem *item, RECT *rc);
void IMG_InitDecoder();
-void LoadPerContactSkins(const TCHAR *file);
+void LoadPerContactSkins(const wchar_t *file);
static void SaveCompleteStructToDB();
StatusItems_t *GetProtocolStatusItem(const char *szProto);
diff --git a/plugins/Clist_nicer/src/groupmenu.cpp b/plugins/Clist_nicer/src/groupmenu.cpp index ca819a8c44..fe5c5177f9 100644 --- a/plugins/Clist_nicer/src/groupmenu.cpp +++ b/plugins/Clist_nicer/src/groupmenu.cpp @@ -80,12 +80,12 @@ static int OnBuildGroupMenu(WPARAM, LPARAM) }
IconItemT iconItem[] = {
- { LPGENT("Contact list"), "clist", IDI_CLIST }
+ { LPGENW("Contact list"), "clist", IDI_CLIST }
};
void InitIconLibMenuIcons(void)
{
- Icon_RegisterT(g_hInst, LPGENT("Contact list"), iconItem, _countof(iconItem));
+ Icon_RegisterT(g_hInst, LPGENW("Contact list"), iconItem, _countof(iconItem));
}
void InitGroupMenus(void)
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index 27b7742c62..07397d6c33 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -50,10 +50,10 @@ int ShowHide(WPARAM wParam, LPARAM lParam); int ClcShutdown(WPARAM wParam, LPARAM lParam);
CListEvent* AddEvent(CLISTEVENT *cle);
-ClcGroup* AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
+ClcGroup* AddGroup(HWND hwnd, struct ClcData *dat, const wchar_t *szName, DWORD flags, int groupId, int calcTotalMembers);
ClcContact* AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact);
-ClcContact* AddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText);
+ClcContact* AddInfoItemToGroup(ClcGroup *group, int flags, const wchar_t *pszText);
LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent);
INT_PTR TrayIconProcessMessage(WPARAM wParam, LPARAM lParam);
@@ -183,7 +183,7 @@ extern "C" int __declspec(dllexport) CListInitialise() cfg::dat.soundsOff = db_get_b(NULL, "Skin", "UseSound", 1) ? 0 : 1;
CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)cfg::dat.tszProfilePath);
- _tcslwr(cfg::dat.tszProfilePath);
+ wcslwr(cfg::dat.tszProfilePath);
// get the clist interface
pcli->hInst = g_hInst;
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp index 8f127b3bd0..6484ccba6a 100644 --- a/plugins/Clist_nicer/src/statusbar.cpp +++ b/plugins/Clist_nicer/src/statusbar.cpp @@ -159,7 +159,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM WORD wStatus = (WORD)CallProtoService(PD->RealName, PS_GETSTATUS, 0, 0);
BYTE isLocked = db_get_b(NULL, PD->RealName, "LockMainStatus", 0);
- TCHAR szTipText[256];
+ wchar_t szTipText[256];
mir_sntprintf(szTipText, L"<b>%s</b>: %s%s",
PD->RealName, pcli->pfnGetStatusModeDescription(wStatus, 0), isLocked ? L" (LOCKED)" : L"");
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index c684d6dc0c..772f2e0fa0 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -199,7 +199,7 @@ static int FillDialog(HWND hwnd) item.pszText = TranslateT("Ungrouped contacts");
SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
- TCHAR *grpName;
+ wchar_t *grpName;
for (i = 1; (grpName = Clist_GroupGetName(i, NULL)) != NULL; i++) {
item.pszText = grpName;
SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
@@ -296,7 +296,7 @@ static void SetIconsForColumn(HWND hwndList, HANDLE hItem, HANDLE hItemAll, int }
}
-void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szProtoFilter, DWORD statusMask, DWORD stickyStatusMask, unsigned int options,
+void SaveViewMode(const char *name, const wchar_t *szGroupFilter, const char *szProtoFilter, DWORD statusMask, DWORD stickyStatusMask, unsigned int options,
unsigned int stickies, unsigned int operators, unsigned int lmdat)
{
char szSetting[512];
@@ -346,7 +346,7 @@ void SaveState() {
LVITEM item = { 0 };
- TCHAR szTemp[256];
+ wchar_t szTemp[256];
HWND hwndList = GetDlgItem(sttClvmHwnd, IDC_GROUPS);
@@ -433,7 +433,7 @@ void UpdateFilters() SendDlgItemMessageA(sttClvmHwnd, IDC_VIEWMODES, LB_GETTEXT, sttClvm_curItem, (LPARAM)szBuf);
mir_strncpy(sttModeName, szBuf, sizeof(sttModeName));
{
- TCHAR szTemp[100];
+ wchar_t szTemp[100];
mir_sntprintf(szTemp, TranslateT("Current view mode: %S"), sttModeName);
SetDlgItemText(sttClvmHwnd, IDC_CURVIEWMODE2, szTemp);
}
@@ -480,8 +480,8 @@ void UpdateFilters() {
LVITEM item = { 0 };
- TCHAR szTemp[256];
- TCHAR szMask[256];
+ wchar_t szTemp[256];
+ wchar_t szMask[256];
HWND hwndList = GetDlgItem(sttClvmHwnd, IDC_GROUPS);
item.mask = LVIF_TEXT;
@@ -494,7 +494,7 @@ void UpdateFilters() item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
mir_sntprintf(szMask, L"%s|", szTemp);
- if (dbv_gf.ptszVal && _tcsstr(dbv_gf.ptszVal, szMask)) {
+ if (dbv_gf.ptszVal && wcsstr(dbv_gf.ptszVal, szMask)) {
ListView_SetCheckState(hwndList, i, TRUE);
}
else {
@@ -587,7 +587,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP CLCINFOITEM cii = { 0 };
cii.cbSize = sizeof(cii);
cii.hParentGroup = 0;
- cii.pszText = LPGENT("*** All contacts ***");
+ cii.pszText = LPGENW("*** All contacts ***");
hInfoItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
}
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETHIDEEMPTYGROUPS, 1, 0);
@@ -1044,7 +1044,7 @@ void ApplyViewMode(const char *name) mir_snprintf(szSetting, "%c%s_GF", 246, name);
ptrT tszGroups(db_get_tsa(NULL, CLVM_MODULE, szSetting));
if (mir_tstrlen(tszGroups) >= 2) {
- _tcsncpy_s(cfg::dat.groupFilter, tszGroups, _TRUNCATE);
+ wcsncpy_s(cfg::dat.groupFilter, tszGroups, _TRUNCATE);
cfg::dat.bFilterEffective |= CLVM_FILTER_GROUPS;
}
diff --git a/plugins/Cln_skinedit/src/main.cpp b/plugins/Cln_skinedit/src/main.cpp index 550c9573ff..ebb8726a92 100644 --- a/plugins/Cln_skinedit/src/main.cpp +++ b/plugins/Cln_skinedit/src/main.cpp @@ -655,7 +655,7 @@ static INT_PTR CALLBACK SkinEdit_ExtBkDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa SendMessage(hwndDlg, WM_USER + 101, 0, 0); psd->hMenuItems = CreatePopupMenu(); - AppendMenu(psd->hMenuItems, MF_STRING | MF_DISABLED, (UINT_PTR)0, LPGENT("Copy from")); + AppendMenu(psd->hMenuItems, MF_STRING | MF_DISABLED, (UINT_PTR)0, LPGENW("Copy from")); AppendMenuA(psd->hMenuItems, MF_SEPARATOR, (UINT_PTR)0, NULL); { diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 1dd0509bf3..7bef6f8f5b 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -192,7 +192,7 @@ int ParseStatusParam(char *status) char *PrettyStatusMode(int status, char *buffer, int size)
{
- TCHAR *data = pcli->pfnGetStatusModeDescription(status, 0);
+ wchar_t *data = pcli->pfnGetStatusModeDescription(status, 0);
if (data)
strncpy_s(buffer, size, _T2A(data), _TRUNCATE);
else
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 81bb0a8c75..275133cd1f 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -39,7 +39,7 @@ struct CONNECTION *connExceptionsTmp = NULL; struct CONNECTION *connCurrentEditModal = NULL;
int currentStatus = ID_STATUS_OFFLINE, diffstat = 0;
BOOL bOptionsOpen = FALSE;
-TCHAR *tcpStates[] = { L"CLOSED", L"LISTEN", L"SYN_SENT", L"SYN_RCVD", L"ESTAB", L"FIN_WAIT1", L"FIN_WAIT2", L"CLOSE_WAIT", L"CLOSING", L"LAST_ACK", L"TIME_WAIT", L"DELETE_TCB" };
+wchar_t *tcpStates[] = { L"CLOSED", L"LISTEN", L"SYN_SENT", L"SYN_RCVD", L"ESTAB", L"FIN_WAIT1", L"FIN_WAIT2", L"CLOSE_WAIT", L"CLOSING", L"LAST_ACK", L"TIME_WAIT", L"DELETE_TCB" };
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -62,22 +62,22 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_CONNEC //=========================================================================================
-BOOL strrep(TCHAR *src, TCHAR *needle, TCHAR *newstring)
+BOOL strrep(wchar_t *src, wchar_t *needle, wchar_t *newstring)
{
- TCHAR *found, begining[MAX_SETTING_STR], tail[MAX_SETTING_STR];
+ wchar_t *found, begining[MAX_SETTING_STR], tail[MAX_SETTING_STR];
size_t pos = 0;
//strset(begining, ' ');
//strset(tail, ' ');
- if (!(found = _tcsstr(src, needle)))
+ if (!(found = wcsstr(src, needle)))
return FALSE;
pos = (found - src);
- _tcsncpy_s(begining, src, pos);
+ wcsncpy_s(begining, src, pos);
begining[pos] = 0;
pos = pos + mir_tstrlen(needle);
- _tcsncpy_s(tail, src + pos, _TRUNCATE);
+ wcsncpy_s(tail, src + pos, _TRUNCATE);
begining[pos] = 0;
pos = mir_sntprintf(src, mir_tstrlen(src), L"%s%s%s", begining, newstring, tail);
@@ -187,7 +187,7 @@ void fillExceptionsListView(HWND hwndDlg) // items.
lvI.mask = LVIF_TEXT;
while (tmp) {
- TCHAR tmpAddress[25];
+ wchar_t tmpAddress[25];
lvI.iItem = i++;
lvI.iSubItem = 0;
lvI.pszText = tmp->PName;
@@ -207,7 +207,7 @@ void fillExceptionsListView(HWND hwndDlg) lvI.pszText = tmpAddress;
ListView_SetItem(hwndList, &lvI);
lvI.iSubItem = 3;
- lvI.pszText = tmp->Pid ? LPGENT("Show") : LPGENT("Hide");
+ lvI.pszText = tmp->Pid ? LPGENW("Show") : LPGENW("Hide");
ListView_SetItem(hwndList, &lvI);
tmp = tmp->next;
@@ -246,7 +246,7 @@ static INT_PTR CALLBACK FilterEditProc(HWND hWnd, UINT message, WPARAM wParam, L switch (LOWORD(wParam)) {
case ID_OK:
{
- TCHAR tmpPort[6];
+ wchar_t tmpPort[6];
GetDlgItemText(hWnd, ID_TXT_LOCAL_PORT, tmpPort, _countof(tmpPort));
if (tmpPort[0] == '*')
connCurrentEditModal->intIntPort = -1;
@@ -294,7 +294,7 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar {
LVCOLUMN lvc = { 0 };
LVITEM lvI = { 0 };
- TCHAR buff[256];
+ wchar_t buff[256];
bOptionsOpen = TRUE;
TranslateDialogDefault(hwndDlg);//translate miranda function
#ifdef _WIN64
@@ -588,8 +588,8 @@ int ConnectionNotifyOptInit(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_DIALOG);
- odp.ptszTitle = _T(PLUGINNAME);
- odp.ptszGroup = LPGENT("Plugins");
+ odp.pwszTitle = _T(PLUGINNAME);
+ odp.pwszGroup = LPGENW("Plugins");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = DlgProcConnectionNotifyOpts;//callback function name
Options_AddPage(wParam, &odp);
@@ -698,7 +698,7 @@ static unsigned __stdcall checkthread(void *) if (searchConnection(first, cur->strIntIp, cur->strExtIp, cur->intIntPort, cur->intExtPort, cur->state) == NULL && (settingStatusMask & (1 << (cur->state - 1)))) {
#ifdef _DEBUG
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, L"%s:%d\n%s:%d", cur->strIntIp, cur->intIntPort, cur->strExtIp, cur->intExtPort);
_OutputDebugString(L"New connection: %s", msg);
#endif
@@ -759,7 +759,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA //show popup
-void showMsg(TCHAR *pName, DWORD pid, TCHAR *intIp, TCHAR *extIp, int intPort, int extPort, int state)
+void showMsg(wchar_t *pName, DWORD pid, wchar_t *intIp, wchar_t *extIp, int intPort, int extPort, int state)
{
POPUPDATAT ppd;
@@ -777,7 +777,7 @@ void showMsg(TCHAR *pName, DWORD pid, TCHAR *intIp, TCHAR *extIp, int intPort, i ppd.lchContact = NULL;//(HANDLE)hContact; //Be sure to use a GOOD handle, since this will not be checked.
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON1));
if (settingResolveIp) {
- TCHAR hostName[128];
+ wchar_t hostName[128];
getDnsName(extIp, hostName, _countof(hostName));
mir_sntprintf(ppd.lptzText, L"%s:%d\n%s:%d", hostName, extPort, intIp, intPort);
}
@@ -793,9 +793,9 @@ void showMsg(TCHAR *pName, DWORD pid, TCHAR *intIp, TCHAR *extIp, int intPort, i ppd.iSeconds = settingInterval1;
//Now the "additional" data.
- _tcsncpy_s(mpd->strIntIp, intIp, _TRUNCATE);
- _tcsncpy_s(mpd->strExtIp, extIp, _TRUNCATE);
- _tcsncpy_s(mpd->PName, pName, _TRUNCATE);
+ wcsncpy_s(mpd->strIntIp, intIp, _TRUNCATE);
+ wcsncpy_s(mpd->strExtIp, extIp, _TRUNCATE);
+ wcsncpy_s(mpd->PName, pName, _TRUNCATE);
mpd->intIntPort = intPort;
mpd->intExtPort = extPort;
mpd->Pid = pid;
diff --git a/plugins/ConnectionNotify/src/debug.cpp b/plugins/ConnectionNotify/src/debug.cpp index 62aa9d9dae..506a0e07a1 100644 --- a/plugins/ConnectionNotify/src/debug.cpp +++ b/plugins/ConnectionNotify/src/debug.cpp @@ -1,6 +1,6 @@ #include "stdafx.h"
-void _OutputDebugString(TCHAR* lpOutputString, ...)
+void _OutputDebugString(wchar_t* lpOutputString, ...)
{
CMString format;
va_list args;
diff --git a/plugins/ConnectionNotify/src/debug.h b/plugins/ConnectionNotify/src/debug.h index 90c46be0f5..3e3783dcc9 100644 --- a/plugins/ConnectionNotify/src/debug.h +++ b/plugins/ConnectionNotify/src/debug.h @@ -4,7 +4,6 @@ #include <windows.h>
#include <stdio.h>
-#include <tchar.h>
-void _OutputDebugString(TCHAR* lpOutputString, ...);
+void _OutputDebugString(wchar_t* lpOutputString, ...);
#endif
\ No newline at end of file diff --git a/plugins/ConnectionNotify/src/filter.cpp b/plugins/ConnectionNotify/src/filter.cpp index e3843d12e3..f0c40dfed8 100644 --- a/plugins/ConnectionNotify/src/filter.cpp +++ b/plugins/ConnectionNotify/src/filter.cpp @@ -71,7 +71,7 @@ static INT_PTR CALLBACK ConnectionFilterEditProc(HWND hWnd, UINT message, WPARAM {
case ID_OK:
{
- TCHAR tmpPort[6];
+ wchar_t tmpPort[6];
if (bOptionsOpen)
{
MessageBox(hWnd, TranslateT("First close options window"), L"ConnectionNotify", MB_OK | MB_ICONSTOP);
diff --git a/plugins/ConnectionNotify/src/netstat.cpp b/plugins/ConnectionNotify/src/netstat.cpp index a12dfb0837..a9827bf7f4 100644 --- a/plugins/ConnectionNotify/src/netstat.cpp +++ b/plugins/ConnectionNotify/src/netstat.cpp @@ -41,15 +41,15 @@ struct CONNECTION *GetConnectionsTable() if (pTcpTable->table[i].dwLocalAddr) { IpAddr.S_un.S_addr = (ULONG)pTcpTable->table[i].dwLocalAddr; //_snprintf(newConn->strIntIp,_countof(newConn->strIntIp),"%d.%d.%d.%d",IpAddr.S_un.S_un_b.s_b1,IpAddr.S_un.S_un_b.s_b2,IpAddr.S_un.S_un_b.s_b3,IpAddr.S_un.S_un_b.s_b4); - TCHAR *strIntIp = mir_a2t(inet_ntoa(IpAddr)); - _tcsncpy(newConn->strIntIp, strIntIp, _countof(newConn->strIntIp) - 1); + wchar_t *strIntIp = mir_a2t(inet_ntoa(IpAddr)); + wcsncpy(newConn->strIntIp, strIntIp, _countof(newConn->strIntIp) - 1); mir_free(strIntIp); } if (pTcpTable->table[i].dwRemoteAddr) { IpAddr.S_un.S_addr = (u_long)pTcpTable->table[i].dwRemoteAddr; - TCHAR *strExtIp = mir_a2t(inet_ntoa(IpAddr)); - _tcsncpy(newConn->strExtIp, strExtIp, _countof(newConn->strExtIp) - 1); + wchar_t *strExtIp = mir_a2t(inet_ntoa(IpAddr)); + wcsncpy(newConn->strExtIp, strExtIp, _countof(newConn->strExtIp) - 1); mir_free(strExtIp); } newConn->state = pTcpTable->table[i].dwState; @@ -123,7 +123,7 @@ void deleteConnectionsTable(struct CONNECTION *head) head = NULL; } -struct CONNECTION *searchConnection(struct CONNECTION *head, TCHAR *intIp, TCHAR *extIp, int intPort, int extPort, int state) +struct CONNECTION *searchConnection(struct CONNECTION *head, wchar_t *intIp, wchar_t *extIp, int intPort, int extPort, int state) { for (struct CONNECTION *cur = head; cur != NULL; cur = cur->next) { if (mir_tstrcmp(cur->strIntIp, intIp) == 0 && @@ -136,7 +136,7 @@ struct CONNECTION *searchConnection(struct CONNECTION *head, TCHAR *intIp, TCHAR return NULL; } -void getDnsName(TCHAR *strIp, TCHAR *strHostName, size_t len) +void getDnsName(wchar_t *strIp, wchar_t *strHostName, size_t len) { in_addr iaHost; @@ -144,5 +144,5 @@ void getDnsName(TCHAR *strIp, TCHAR *strHostName, size_t len) iaHost.s_addr = inet_addr(szStrIP); mir_free(szStrIP); hostent *h = gethostbyaddr((char *)&iaHost, sizeof(struct in_addr), AF_INET); - _tcsncpy_s(strHostName, len, (h == NULL) ? strIp : _A2T(h->h_name), _TRUNCATE); + wcsncpy_s(strHostName, len, (h == NULL) ? strIp : _A2T(h->h_name), _TRUNCATE); } diff --git a/plugins/ConnectionNotify/src/netstat.h b/plugins/ConnectionNotify/src/netstat.h index 8ea8ed564a..f55bdd081f 100644 --- a/plugins/ConnectionNotify/src/netstat.h +++ b/plugins/ConnectionNotify/src/netstat.h @@ -4,17 +4,17 @@ struct CONNECTION
{
- TCHAR strIntIp[16];
- TCHAR strExtIp[16];
+ wchar_t strIntIp[16];
+ wchar_t strExtIp[16];
int intIntPort;
int intExtPort;
int state;
DWORD Pid;
- TCHAR PName[260];
+ wchar_t PName[260];
struct CONNECTION *next;
};
struct CONNECTION* GetConnectionsTable();
void deleteConnectionsTable(struct CONNECTION* head);
-struct CONNECTION* searchConnection(struct CONNECTION* head, TCHAR *intIp, TCHAR *extIp, int intPort, int extPort, int state);
-void getDnsName(TCHAR *strIp, TCHAR *strHostName, size_t len);
\ No newline at end of file +struct CONNECTION* searchConnection(struct CONNECTION* head, wchar_t *intIp, wchar_t *extIp, int intPort, int extPort, int state);
+void getDnsName(wchar_t *strIp, wchar_t *strHostName, size_t len);
diff --git a/plugins/ConnectionNotify/src/pid2name.cpp b/plugins/ConnectionNotify/src/pid2name.cpp index e30b032bdd..65270e6b00 100644 --- a/plugins/ConnectionNotify/src/pid2name.cpp +++ b/plugins/ConnectionNotify/src/pid2name.cpp @@ -1,6 +1,6 @@ #include "stdafx.h"
-void pid2name(DWORD procid, TCHAR *buffer, size_t bufLen)
+void pid2name(DWORD procid, wchar_t *buffer, size_t bufLen)
{
PROCESSENTRY32 ProcessStruct;
ProcessStruct.dwSize = sizeof(PROCESSENTRY32);
@@ -12,7 +12,7 @@ void pid2name(DWORD procid, TCHAR *buffer, size_t bufLen) do {
if (ProcessStruct.th32ProcessID == procid) {
- _tcsncpy_s(buffer, bufLen, ProcessStruct.szExeFile, _TRUNCATE);
+ wcsncpy_s(buffer, bufLen, ProcessStruct.szExeFile, _TRUNCATE);
break;
}
} while (Process32Next(hSnap, &ProcessStruct));
diff --git a/plugins/ConnectionNotify/src/pid2name.h b/plugins/ConnectionNotify/src/pid2name.h index d1e7609f10..70974afabf 100644 --- a/plugins/ConnectionNotify/src/pid2name.h +++ b/plugins/ConnectionNotify/src/pid2name.h @@ -3,6 +3,6 @@ #ifndef _INC_PID2NAME
#define _INC_PID2NAME
-void pid2name(DWORD, TCHAR*, size_t);
+void pid2name(DWORD, wchar_t*, size_t);
#endif
diff --git a/plugins/ConnectionNotify/src/stdafx.h b/plugins/ConnectionNotify/src/stdafx.h index b82329e376..4e7f512ad0 100644 --- a/plugins/ConnectionNotify/src/stdafx.h +++ b/plugins/ConnectionNotify/src/stdafx.h @@ -40,7 +40,7 @@ #define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x))
#define FREE(x) HeapFree(GetProcessHeap(), 0, (x))
-void showMsg(TCHAR *pName,DWORD pid,TCHAR *intIp,TCHAR *extIp,int intPort,int extPort,int state);
+void showMsg(wchar_t *pName,DWORD pid,wchar_t *intIp,wchar_t *extIp,int intPort,int extPort,int state);
//int __declspec(dllexport) Load(PLUGINLINK *link);
extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
static unsigned __stdcall checkthread(void *dummy);
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp index 808decafdc..5c3d44da55 100644 --- a/plugins/Console/src/Console.cpp +++ b/plugins/Console/src/Console.cpp @@ -66,7 +66,7 @@ typedef struct { typedef struct {
char szModule[128];
- TCHAR szMsg[1];
+ wchar_t szMsg[1];
} DUMPMSG;
@@ -111,7 +111,7 @@ static HGENMENU hMenu = NULL; static void LoadSettings();
static void ShowConsole(int show);
static INT_PTR ShowHideConsole(WPARAM wParam, LPARAM lParam);
-static int Openfile(TCHAR *outputFile, int selection);
+static int Openfile(wchar_t *outputFile, int selection);
////////////////////////////////////////////////////////////////////////////////
@@ -165,7 +165,7 @@ static void ShowConsole(int show) RedrawWindow(pActive->hList, NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW | RDW_ERASE);
if (hMenu)
- Menu_ModifyItem(hMenu, show ? LPGENT("Hide Console") : LPGENT("Show Console"));
+ Menu_ModifyItem(hMenu, show ? LPGENW("Hide Console") : LPGENW("Show Console"));
if (hTTBButt)
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTBButt, show ? TTBST_PUSHED : 0);
@@ -205,22 +205,22 @@ typedef struct UINT control;
UINT icon;
int type;
- TCHAR *tooltip;
+ wchar_t *tooltip;
} controlinfo;
static controlinfo ctrls[] =
{
// IDC_SCROLL & IDC_PAUSE must be first
- { IDC_SCROLL, IDI_SCROLL, BUTTONSETASFLATBTN, LPGENT("Scrolling (Ctrl+Q)") },
- { IDC_PAUSE, IDI_STARTED, BUTTONSETASFLATBTN, LPGENT("Pause logging (Ctrl+P)") },
- { IDC_SAVE, IDI_SAVE, BUTTONSETASFLATBTN, LPGENT("Save log to file (Ctrl+S)") },
- { IDC_COPY, IDI_COPY, BUTTONSETASFLATBTN, LPGENT("Copy selected log (Ctrl+C)") },
- { IDC_DELETE, IDI_DELETE, BUTTONSETASFLATBTN, LPGENT("Delete selected (Del)") },
- { IDC_OPTIONS, IDI_OPTIONS, BUTTONSETASFLATBTN, LPGENT("Log options (Ctrl+O)") },
- { IDC_STARTALL, IDI_START, BUTTONSETASFLATBTN, LPGENT("Start logging in all tabs") },
- { IDC_PAUSEALL, IDI_PAUSE, BUTTONSETASFLATBTN, LPGENT("Pause logging in all tabs") },
- { IDC_CLOSE, IDI_CLOSE, BUTTONSETASFLATBTN, LPGENT("Close tab (Ctrl+W)") },
+ { IDC_SCROLL, IDI_SCROLL, BUTTONSETASFLATBTN, LPGENW("Scrolling (Ctrl+Q)") },
+ { IDC_PAUSE, IDI_STARTED, BUTTONSETASFLATBTN, LPGENW("Pause logging (Ctrl+P)") },
+ { IDC_SAVE, IDI_SAVE, BUTTONSETASFLATBTN, LPGENW("Save log to file (Ctrl+S)") },
+ { IDC_COPY, IDI_COPY, BUTTONSETASFLATBTN, LPGENW("Copy selected log (Ctrl+C)") },
+ { IDC_DELETE, IDI_DELETE, BUTTONSETASFLATBTN, LPGENW("Delete selected (Del)") },
+ { IDC_OPTIONS, IDI_OPTIONS, BUTTONSETASFLATBTN, LPGENW("Log options (Ctrl+O)") },
+ { IDC_STARTALL, IDI_START, BUTTONSETASFLATBTN, LPGENW("Start logging in all tabs") },
+ { IDC_PAUSEALL, IDI_PAUSE, BUTTONSETASFLATBTN, LPGENW("Pause logging in all tabs") },
+ { IDC_CLOSE, IDI_CLOSE, BUTTONSETASFLATBTN, LPGENW("Close tab (Ctrl+W)") },
};
////////////////////////////////////////////////////////////////////////////////
@@ -372,23 +372,23 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LP if (dat && !dat->Paused) {
LVITEM lvi = { 0 };
int last = 0x7fffffff;
- TCHAR szBreak;
+ wchar_t szBreak;
DWORD len, tmplen;
DWORD wraplen = gWrapLen;
- TCHAR *str = ((DUMPMSG *)lParam)->szMsg;
+ wchar_t *str = ((DUMPMSG *)lParam)->szMsg;
lvi.iItem = 0x7fffffff;
- str = _tcstok(str, L"\n");
+ str = wcstok(str, L"\n");
if (gIcons && str != NULL) {
lvi.mask = LVIF_TEXT | LVIF_IMAGE;
- if (_tcsstr(str, L"Data received")) {
+ if (wcsstr(str, L"Data received")) {
if (gSeparator) ListView_InsertItem(dat->hList, &lvi);
lvi.iImage = IMG_IN;
}
- else if (_tcsstr(str, L"Data sent")) {
+ else if (wcsstr(str, L"Data sent")) {
if (gSeparator) ListView_InsertItem(dat->hList, &lvi);
lvi.iImage = IMG_OUT;
}
@@ -423,7 +423,7 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LP last = ListView_InsertItem(dat->hList, &lvi);
- str = _tcstok(NULL, L"\n");
+ str = wcstok(NULL, L"\n");
if (str) dat->newline = 1;
lvi.iImage = IMG_EMPTY;
@@ -477,8 +477,8 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LP case IDC_COPY:
{
int idx = 0;
- TCHAR szText[128];
- TCHAR *src, *dst, *buf;
+ wchar_t szText[128];
+ wchar_t *src, *dst, *buf;
int flags = LVNI_BELOW;
int count = ListView_GetSelectedCount(dat->hList);
@@ -487,7 +487,7 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LP else
count = ListView_GetItemCount(dat->hList);
- dst = buf = (TCHAR *)malloc((count * (sizeof(szText) + 1) + 1) * sizeof(TCHAR));
+ dst = buf = (wchar_t *)malloc((count * (sizeof(szText) + 1) + 1) * sizeof(wchar_t));
if (!buf) break;
while ((idx = ListView_GetNextItem(dat->hList, idx, flags)) > 0) {
@@ -502,9 +502,9 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LP if (dst - buf > 0 && OpenClipboard(hwndDlg)) {
EmptyClipboard();
- HGLOBAL hClipboardData = GlobalAlloc(GMEM_DDESHARE, (dst - buf + 1) * sizeof(TCHAR));
+ HGLOBAL hClipboardData = GlobalAlloc(GMEM_DDESHARE, (dst - buf + 1) * sizeof(wchar_t));
if (hClipboardData) {
- TCHAR *pchData = (TCHAR *)GlobalLock(hClipboardData);
+ wchar_t *pchData = (wchar_t *)GlobalLock(hClipboardData);
mir_tstrcpy(pchData, buf);
GlobalUnlock(hClipboardData);
SetClipboardData(CF_UNICODETEXT, hClipboardData);
@@ -541,21 +541,21 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LP case IDC_SAVE:
{
- TCHAR szFile[MAX_PATH];
+ wchar_t szFile[MAX_PATH];
if (!Openfile(szFile, ListView_GetSelectedCount(dat->hList))) break;
- FILE *fp = _tfopen(szFile, L"wt");
+ FILE *fp = _wfopen(szFile, L"wt");
if (fp) {
int idx = 0;
- TCHAR szText[128];
+ wchar_t szText[128];
int flags = LVNI_BELOW;
if (ListView_GetSelectedCount(dat->hList))
flags |= LVNI_SELECTED;
while ((idx = ListView_GetNextItem(dat->hList, idx, flags)) > 0) {
ListView_GetItemText(dat->hList, idx, 0, szText, _countof(szText));
- _ftprintf(fp, L"%s\n", szText);
+ fwprintf(fp, L"%s\n", szText);
}
fclose(fp);
}
@@ -608,9 +608,9 @@ static INT_PTR CALLBACK ConsoleDlgProc(HWND hwndDlg, UINT message, WPARAM wParam switch (message) {
case WM_INITDIALOG:
{
- TCHAR title[MAX_PATH];
- TCHAR name[MAX_PATH] = { 0 };
- TCHAR path[MAX_PATH] = { 0 };
+ wchar_t title[MAX_PATH];
+ wchar_t name[MAX_PATH] = { 0 };
+ wchar_t path[MAX_PATH] = { 0 };
hTabs = GetDlgItem(hwndDlg, IDC_TABS);
@@ -929,9 +929,9 @@ static int OnFastDump(WPARAM wParam, LPARAM lParam) LOGMSG *logMsg = (LOGMSG *)lParam;
DWORD headlen = (DWORD)mir_strlen(logMsg->pszHead);
DWORD msglen = (DWORD)mir_strlen(logMsg->pszMsg);
- DWORD len = (headlen + msglen + 1) * sizeof(TCHAR) + sizeof(DUMPMSG);
+ DWORD len = (headlen + msglen + 1) * sizeof(wchar_t) + sizeof(DUMPMSG);
DUMPMSG *dumpMsg = (DUMPMSG *)mir_alloc(len);
- TCHAR *str = dumpMsg->szMsg;
+ wchar_t *str = dumpMsg->szMsg;
char *szModule = (wParam) ? ((NETLIBUSER *)wParam)->szDescriptiveName : "[Core]";
mir_strncpy(dumpMsg->szModule, szModule, _countof(dumpMsg->szModule));
@@ -1096,8 +1096,8 @@ static int OnFontChange(WPARAM, LPARAM) FontIDT fid = { 0 };
fid.cbSize = sizeof(fid);
- mir_tstrncpy(fid.group, LPGENT("Console"), _countof(fid.group));
- mir_tstrncpy(fid.name, LPGENT("Text"), _countof(fid.name));
+ mir_tstrncpy(fid.group, LPGENW("Console"), _countof(fid.group));
+ mir_tstrncpy(fid.name, LPGENW("Text"), _countof(fid.name));
colLogFont = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&LogFont);
@@ -1120,12 +1120,12 @@ static int OnSystemModulesLoaded(WPARAM, LPARAM) FontIDT fid = { 0 };
fid.cbSize = sizeof(fid);
- mir_tstrncpy(fid.group, LPGENT("Console"), _countof(fid.group));
- mir_tstrncpy(fid.name, LPGENT("Text"), _countof(fid.name));
+ mir_tstrncpy(fid.group, LPGENW("Console"), _countof(fid.group));
+ mir_tstrncpy(fid.name, LPGENW("Text"), _countof(fid.name));
mir_strncpy(fid.dbSettingsGroup, "Console", _countof(fid.dbSettingsGroup));
mir_strncpy(fid.prefix, "ConsoleFont", _countof(fid.prefix));
- mir_tstrncpy(fid.backgroundGroup, LPGENT("Console"), _countof(fid.backgroundGroup));
- mir_tstrncpy(fid.backgroundName, LPGENT("Background"), _countof(fid.backgroundName));
+ mir_tstrncpy(fid.backgroundGroup, LPGENW("Console"), _countof(fid.backgroundGroup));
+ mir_tstrncpy(fid.backgroundName, LPGENW("Background"), _countof(fid.backgroundName));
fid.flags = FIDF_DEFAULTVALID;
fid.deffontsettings.charset = DEFAULT_CHARSET;
fid.deffontsettings.colour = RGB(0, 0, 0);
@@ -1138,8 +1138,8 @@ static int OnSystemModulesLoaded(WPARAM, LPARAM) ColourIDT cid = { 0 };
cid.cbSize = sizeof(cid);
- mir_tstrncpy(cid.group, LPGENT("Console"), _countof(cid.group));
- mir_tstrncpy(cid.name, LPGENT("Background"), _countof(cid.name));
+ mir_tstrncpy(cid.group, LPGENW("Console"), _countof(cid.group));
+ mir_tstrncpy(cid.name, LPGENW("Background"), _countof(cid.name));
mir_strncpy(cid.dbSettingsGroup, "Console", _countof(cid.dbSettingsGroup));
mir_strncpy(cid.setting, "BgColor", _countof(cid.setting));
cid.defcolour = RGB(255, 255, 255);
@@ -1164,7 +1164,7 @@ static int OnSystemModulesLoaded(WPARAM, LPARAM) mi.flags = CMIF_TCHAR;
mi.hIcolibItem = hIcons[0];
mi.position = 1900000000;
- mi.name.t = (IsWindowVisible(hwndConsole)) ? LPGENT("Hide Console") : LPGENT("Show Console");
+ mi.name.w = (IsWindowVisible(hwndConsole)) ? LPGENW("Hide Console") : LPGENW("Show Console");
mi.pszService = MS_CONSOLE_SHOW_HIDE;
hMenu = Menu_AddMainMenuItem(&mi);
@@ -1258,21 +1258,21 @@ void ShutdownConsole(void) ////////////////////////////////////////////////////////////////////////////////
-TCHAR *addstring(TCHAR *str, TCHAR *add) {
+wchar_t *addstring(wchar_t *str, wchar_t *add) {
mir_tstrcpy(str, add);
return str + mir_tstrlen(add) + 1;
}
-static int Openfile(TCHAR *outputFile, int selection)
+static int Openfile(wchar_t *outputFile, int selection)
{
- TCHAR filename[MAX_PATH + 2] = L"";
- TCHAR *title;
+ wchar_t filename[MAX_PATH + 2] = L"";
+ wchar_t *title;
- TCHAR *filter, *tmp, *tmp1, *tmp2;
+ wchar_t *filter, *tmp, *tmp1, *tmp2;
tmp1 = TranslateT("Text Files (*.txt)");
tmp2 = TranslateT("All Files");
- filter = tmp = (TCHAR*)_alloca((mir_tstrlen(tmp1) + mir_tstrlen(tmp2) + 11)*sizeof(TCHAR));
+ filter = tmp = (wchar_t*)_alloca((mir_tstrlen(tmp1) + mir_tstrlen(tmp2) + 11)*sizeof(wchar_t));
tmp = addstring(tmp, tmp1);
tmp = addstring(tmp, L"*.TXT");
tmp = addstring(tmp, tmp2);
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index 109bb50043..8852ad0eea 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -73,7 +73,7 @@ static int HookDBEventAdded(WPARAM hContact, LPARAM hDbEvent) SkinPlaySound("RecvContacts");
{
//add event to the contact list
- TCHAR caToolTip[128];
+ wchar_t caToolTip[128];
mir_sntprintf(caToolTip, L"%s %s", TranslateT("Contacts received from"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = {};
diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp index 0a008a12da..0373609632 100644 --- a/plugins/ContactsPlus/src/receive.cpp +++ b/plugins/ContactsPlus/src/receive.cpp @@ -81,17 +81,17 @@ static int RecvDlg_Resize(HWND, LPARAM, UTILRESIZECONTROL *urc) return RD_ANCHORX_LEFT | RD_ANCHORY_TOP; // default
}
-static TCHAR* ListView_GetItemTextEx(HWND hLV, int iItem, int iSubItem)
+static wchar_t* ListView_GetItemTextEx(HWND hLV, int iItem, int iSubItem)
{
LVITEM lvi = {0};
lvi.mask = LVIF_TEXT;
lvi.iSubItem = iSubItem;
lvi.cchTextMax = 64;
- lvi.pszText = (TCHAR*)mir_alloc(lvi.cchTextMax * sizeof(TCHAR));
+ lvi.pszText = (wchar_t*)mir_alloc(lvi.cchTextMax * sizeof(wchar_t));
// loop until the returned size is smaller than buffer size
while (SendMessage(hLV, LVM_GETITEMTEXT, iItem, (LPARAM)&lvi) == lvi.cchTextMax - 1) {
lvi.cchTextMax += 64;
- lvi.pszText = (TCHAR*)mir_realloc(lvi.pszText, lvi.cchTextMax * sizeof(TCHAR));
+ lvi.pszText = (wchar_t*)mir_realloc(lvi.pszText, lvi.cchTextMax * sizeof(wchar_t));
}
return lvi.pszText;
}
@@ -108,18 +108,18 @@ static void RebuildGroupCombo(HWND hwndDlg) if (bHasGroups) {
int curs = SendMessage(hGroupsCombo, CB_GETCURSEL, 0, 0);
- TCHAR *curst = NULL;
+ wchar_t *curst = NULL;
EnableDlgItem(hwndDlg, IDC_ENABLEGROUPS, TRUE);
EnableGroupCombo(hwndDlg);
if (curs != CB_ERR) {
- curst = (TCHAR*)_alloca((SendMessage(hGroupsCombo, CB_GETLBTEXTLEN, curs, 0) + 1) * sizeof(TCHAR));
+ curst = (wchar_t*)_alloca((SendMessage(hGroupsCombo, CB_GETLBTEXTLEN, curs, 0) + 1) * sizeof(wchar_t));
SendMessage(hGroupsCombo, CB_GETLBTEXT, curs, (LPARAM)curst);
}
SendMessage(hGroupsCombo, CB_RESETCONTENT, 0, 0);
- TCHAR *szGroup;
+ wchar_t *szGroup;
for (int i=1; (szGroup = Clist_GroupGetName(i, NULL)) != NULL; i++) {
int nIndex = SendMessage(hGroupsCombo, CB_ADDSTRING, 0, (LPARAM)szGroup);
SendMessage(hGroupsCombo, CB_SETITEMDATA, nIndex, i);
@@ -138,7 +138,7 @@ static void RebuildGroupCombo(HWND hwndDlg) static MCONTACT CreateTemporaryContactForItem(HWND hwndDlg, TRecvContactsData *wndData, int iItem)
{
- TCHAR *caUIN = ListView_GetItemTextEx(GetDlgItem(hwndDlg, IDC_CONTACTS), iItem, 0);
+ wchar_t *caUIN = ListView_GetItemTextEx(GetDlgItem(hwndDlg, IDC_CONTACTS), iItem, 0);
char *szProto = GetContactProto(wndData->mhContact);
wndData->rhSearch = (HANDLE)CallProtoService(szProto, PS_BASICSEARCH, 0, (LPARAM)caUIN); // find it
replaceStrT(wndData->haUin, caUIN);
@@ -148,7 +148,7 @@ static MCONTACT CreateTemporaryContactForItem(HWND hwndDlg, TRecvContactsData *w return NULL;
}
-void RecvListView_AddColumn(HWND hList, int nWidth, TCHAR *szTitle, int nItem)
+void RecvListView_AddColumn(HWND hList, int nWidth, wchar_t *szTitle, int nItem)
{
LVCOLUMN col;
col.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
@@ -239,10 +239,10 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara }
}
// new dlg init
- wndData->hIcons[0] = InitMButton(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGENT("Add Contact Permanently to List"));
- wndData->hIcons[1] = InitMButton(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGENT("View User's Details"));
- wndData->hIcons[2] = InitMButton(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGENT("View User's History"));
- wndData->hIcons[3] = InitMButton(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGENT("User Menu"));
+ wndData->hIcons[0] = InitMButton(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGENW("Add Contact Permanently to List"));
+ wndData->hIcons[1] = InitMButton(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGENW("View User's Details"));
+ wndData->hIcons[2] = InitMButton(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGENW("View User's History"));
+ wndData->hIcons[3] = InitMButton(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGENW("User Menu"));
SendMessage(hwndDlg,DM_UPDATETITLE,0,0);
// new dialog init done
@@ -301,11 +301,11 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara HWND hGroupsCombo = GetDlgItem(hwndDlg, IDC_GROUPS);
HWND hGroupsCheck = GetDlgItem(hwndDlg, IDC_ENABLEGROUPS);
int curs = SendMessage(hGroupsCombo, CB_GETCURSEL, 0, 0);
- TCHAR* caGroup = NULL;
+ wchar_t* caGroup = NULL;
int nGroupId = -1;
if (curs != CB_ERR && IsWindowEnabled(hGroupsCheck) && SendMessage(hGroupsCheck, BM_GETCHECK, 0, 0))
{ //got groups, get the one selected in combo
- caGroup = (TCHAR*)_alloca((SendMessage(hGroupsCombo, CB_GETLBTEXTLEN, curs, 0) + 1) * sizeof(TCHAR));
+ caGroup = (wchar_t*)_alloca((SendMessage(hGroupsCombo, CB_GETLBTEXTLEN, curs, 0) + 1) * sizeof(wchar_t));
SendMessage(hGroupsCombo, CB_GETLBTEXT, curs, (LPARAM)caGroup);
nGroupId = SendMessage(hGroupsCombo, CB_GETITEMDATA, curs, 0);
}
@@ -313,7 +313,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara for (int i = 0; i < ListView_GetItemCount(hLV); i++)
if (ListView_GetCheckState(hLV, i)) {
// found checked contact item, add it
- TCHAR *caUIN = ListView_GetItemTextEx(hLV, i, 0);
+ wchar_t *caUIN = ListView_GetItemTextEx(hLV, i, 0);
for (int j = 0; j < wndData->cbReceived; j++) // determine item index in packet
if (!mir_tstrcmp(wndData->maReceived[j]->mcaUIN, caUIN)) {
char *szProto =GetContactProto(wndData->mhContact);
@@ -437,10 +437,10 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara fi.psz = wndData->haUin;
int iLPos = ListView_FindItem(hLV, -1, &fi);
if (iLPos == -1) iLPos = 0;
- if (mir_tstrcmp(psr->nick.t, L"") && psr->nick.t)
- ListView_SetItemText(hLV, iLPos, 1, psr->nick.t);
- ListView_SetItemText(hLV, iLPos, 2, psr->firstName.t);
- ListView_SetItemText(hLV, iLPos, 3, psr->lastName.t);
+ if (mir_tstrcmp(psr->nick.w, L"") && psr->nick.w)
+ ListView_SetItemText(hLV, iLPos, 1, psr->nick.w);
+ ListView_SetItemText(hLV, iLPos, 2, psr->firstName.w);
+ ListView_SetItemText(hLV, iLPos, 3, psr->lastName.w);
break;
}
mir_free(wndData->haUin);
@@ -482,7 +482,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara break;
case DM_UPDATETITLE:
- UpdateDialogTitle(hwndDlg, wndData ? wndData->mhContact : NULL, LPGENT("Contacts from"));
+ UpdateDialogTitle(hwndDlg, wndData ? wndData->mhContact : NULL, LPGENW("Contacts from"));
if (wndData)
UpdateDialogAddButton(hwndDlg, wndData->mhContact);
break;
diff --git a/plugins/ContactsPlus/src/receive.h b/plugins/ContactsPlus/src/receive.h index 52db60a171..2bb0f5f659 100644 --- a/plugins/ContactsPlus/src/receive.h +++ b/plugins/ContactsPlus/src/receive.h @@ -35,8 +35,8 @@ #define IDI_DOWNARROW 264
struct TReceivedItem {
- TCHAR* mcaUIN;
- TCHAR* mcaNick;
+ wchar_t* mcaUIN;
+ wchar_t* mcaNick;
~TReceivedItem() { mir_free(mcaUIN); mir_free(mcaNick); }
TReceivedItem() { mcaUIN = NULL; mcaNick = NULL; }
};
@@ -52,7 +52,7 @@ struct TRecvContactsData HMENU mhPopup; // popup menu for listview
HANDLE hHook; // hook to event
HANDLE rhSearch; // handle to uin-search
- TCHAR* haUin;
+ wchar_t* haUin;
int iPopupItem;
TReceivedItem** maReceived;// received contacts
int cbReceived;
diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp index 38505ded75..7674ed4d57 100644 --- a/plugins/ContactsPlus/src/send.cpp +++ b/plugins/ContactsPlus/src/send.cpp @@ -234,10 +234,10 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara wndData = new TSendContactsData(lParam);
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)wndData);
// new dlg init
- wndData->hIcons[0] = InitMButton(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGENT("Add Contact Permanently to List"));
- wndData->hIcons[1] = InitMButton(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGENT("View User's Details"));
- wndData->hIcons[2] = InitMButton(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGENT("View User's History"));
- wndData->hIcons[3] = InitMButton(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGENT("User Menu"));
+ wndData->hIcons[0] = InitMButton(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGENW("Add Contact Permanently to List"));
+ wndData->hIcons[1] = InitMButton(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGENW("View User's Details"));
+ wndData->hIcons[2] = InitMButton(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGENW("View User's History"));
+ wndData->hIcons[3] = InitMButton(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGENW("User Menu"));
SendMessage(hwndDlg, DM_UPDATETITLE, 0, 0);
// new dialog init done
@@ -479,7 +479,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar TranslateDialogDefault(hwndDlg);
{
if (lParam)
- SetDlgItemText(hwndDlg, IDC_ERRORTEXT, TranslateTS((TCHAR*)lParam));
+ SetDlgItemText(hwndDlg, IDC_ERRORTEXT, TranslateTS((wchar_t*)lParam));
RECT rc, rcParent;
GetWindowRect(hwndDlg, &rc);
diff --git a/plugins/ContactsPlus/src/utils.cpp b/plugins/ContactsPlus/src/utils.cpp index 5ba7efea54..f16a559fe2 100644 --- a/plugins/ContactsPlus/src/utils.cpp +++ b/plugins/ContactsPlus/src/utils.cpp @@ -55,7 +55,7 @@ char* __fastcall null_strdup(const char *string) return NULL;
}
-TCHAR* GetContactUID(MCONTACT hContact)
+wchar_t* GetContactUID(MCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
char *uid = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
@@ -67,19 +67,19 @@ TCHAR* GetContactUID(MCONTACT hContact) return NULL;
if (vrUid.type == DBVT_DWORD) {
- TCHAR tmp[100];
- _itot(vrUid.dVal, tmp, 10);
+ wchar_t tmp[100];
+ _itow(vrUid.dVal, tmp, 10);
return mir_tstrdup(tmp);
}
if (vrUid.type == DBVT_ASCIIZ) {
- TCHAR *res = mir_a2t(vrUid.pszVal);
+ wchar_t *res = mir_a2t(vrUid.pszVal);
mir_free(vrUid.pszVal);
return res;
}
if (vrUid.type == DBVT_UTF8) {
- TCHAR *res = mir_utf8decodeT(vrUid.pszVal);
+ wchar_t *res = mir_utf8decodeT(vrUid.pszVal);
mir_free(vrUid.pszVal);
return res;
}
@@ -112,24 +112,24 @@ void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, MCONTACT hContact) }
-void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, TCHAR *pszTitleStart)
+void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, wchar_t *pszTitleStart)
{
- TCHAR newtitle[512];
+ wchar_t newtitle[512];
mir_tstrncpy(newtitle, TranslateTS(pszTitleStart), _countof(newtitle));
if (hContact) {
char *szProto = GetContactProto(hContact);
if (szProto) {
ptrT uid(GetContactUID(hContact));
- TCHAR *contactName = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR oldTitle[MAX_PATH];
+ wchar_t oldTitle[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_NAME, oldTitle, _countof(oldTitle));
if (mir_tstrcmp(uid ? uid : contactName, oldTitle))
SetDlgItemText(hwndDlg, IDC_NAME, uid ? uid : contactName);
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
mir_sntprintf(newtitle, L"%s %s (%s)", TranslateTS(pszTitleStart), contactName, szStatus);
}
}
@@ -145,7 +145,7 @@ void UpdateDialogAddButton(HWND hwndDlg, MCONTACT hContact) }
-HICON InitMButton(HWND hDlg, int idButton, int idIcon, TCHAR *szTip)
+HICON InitMButton(HWND hDlg, int idButton, int idIcon, wchar_t *szTip)
{
HWND hButton = GetDlgItem(hDlg, idButton);
HICON hIcon = Skin_LoadIcon(idIcon);
@@ -172,10 +172,10 @@ void EnableDlgItem(HWND hwndDlg, UINT control, int state) }
-TCHAR* GetWindowTextT(HWND hWnd)
+wchar_t* GetWindowTextT(HWND hWnd)
{
int len = GetWindowTextLength(hWnd) + 1;
- TCHAR* txt = (TCHAR*)mir_alloc(len * sizeof(TCHAR));
+ wchar_t* txt = (wchar_t*)mir_alloc(len * sizeof(wchar_t));
if (txt) {
txt[0] = 0;
GetWindowText(hWnd, txt, len);
@@ -183,9 +183,9 @@ TCHAR* GetWindowTextT(HWND hWnd) return txt;
}
-TCHAR* __fastcall strdupT(const TCHAR *string)
+wchar_t* __fastcall strdupT(const wchar_t *string)
{
if (string)
- return (TCHAR*)wcsdup((TCHAR*)string);
+ return (wchar_t*)wcsdup((wchar_t*)string);
return NULL;
}
diff --git a/plugins/ContactsPlus/src/utils.h b/plugins/ContactsPlus/src/utils.h index cf284b44e7..6783f5bd74 100644 --- a/plugins/ContactsPlus/src/utils.h +++ b/plugins/ContactsPlus/src/utils.h @@ -32,13 +32,13 @@ int __fastcall strcmpnull(const char *str1, const char *str2); void __fastcall strcpynull(char *str1, const char *str2);
char* __fastcall null_strdup(const char *string);
-TCHAR* GetContactUID(MCONTACT hContact);
+wchar_t* GetContactUID(MCONTACT hContact);
void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, MCONTACT hContact);
-void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, TCHAR *pszTitleStart);
+void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, wchar_t *pszTitleStart);
void UpdateDialogAddButton(HWND hwndDlg, MCONTACT hContact);
-HICON InitMButton(HWND hDlg, int idButton, int idIcon, TCHAR *szTip);
+HICON InitMButton(HWND hDlg, int idButton, int idIcon, wchar_t *szTip);
void DialogAddContactExecute(HWND hwndDlg, MCONTACT hNewContact);
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp index 1d6692ca26..5c96a12456 100644 --- a/plugins/CrashDumper/src/crshdmp.cpp +++ b/plugins/CrashDumper/src/crshdmp.cpp @@ -27,11 +27,11 @@ LCID packlcid; HANDLE hVerInfoFolder;
HMODULE hMsftedit;
-TCHAR* vertxt;
-TCHAR* profname;
-TCHAR* profpath;
+wchar_t* vertxt;
+wchar_t* profname;
+wchar_t* profpath;
-TCHAR CrashLogFolder[MAX_PATH], VersionInfoFolder[MAX_PATH];
+wchar_t CrashLogFolder[MAX_PATH], VersionInfoFolder[MAX_PATH];
bool servicemode, clsdates, dtsubfldr, catchcrashes, needrestart = 0;
@@ -67,7 +67,7 @@ INT_PTR StoreVersionInfoToFile(WPARAM, LPARAM lParam) {
CreateDirectoryTreeT(VersionInfoFolder);
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
mir_sntprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
HANDLE hDumpFile = CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -158,10 +158,10 @@ INT_PTR CopyLinkToClipboard(WPARAM, LPARAM) {
ptrT tmp(db_get_wsa(NULL, PluginName, "Username"));
if (tmp != NULL) {
- TCHAR buffer[MAX_PATH];
+ wchar_t buffer[MAX_PATH];
mir_sntprintf(buffer, L"http://vi.miranda-ng.org/detail/%s", tmp);
- int bufLen = (sizeof(buffer) + 1) * sizeof(TCHAR);
+ int bufLen = (sizeof(buffer) + 1) * sizeof(wchar_t);
HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, bufLen);
LPSTR buf = (LPSTR)GlobalLock(hData);
memcpy(buf, buffer, bufLen);
@@ -256,7 +256,7 @@ static int ModulesLoaded(WPARAM, LPARAM) }
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Version Information"), 2000089999, GetIconHandle(IDI_VI));
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Version Information"), 2000089999, GetIconHandle(IDI_VI));
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "9A7A9C76-7FD8-4C05-B402-6C46060C2D78");
SET_UID(mi, 0x52930e40, 0xb2ee, 0x4433, 0xad, 0x77, 0xf5, 0x42, 0xe, 0xf6, 0x57, 0xc1);
@@ -369,7 +369,7 @@ extern "C" int __declspec(dllexport) Load(void) profpath = Utils_ReplaceVarsT(L"%miranda_userdata%");
if (catchcrashes && !needrestart)
mir_sntprintf(CrashLogFolder, TEXT("%s\\CrashLog"), profpath);
- _tcsncpy_s(VersionInfoFolder, profpath, _TRUNCATE);
+ wcsncpy_s(VersionInfoFolder, profpath, _TRUNCATE);
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp index 0ea80781bd..3fa432aa47 100644 --- a/plugins/CrashDumper/src/dumper.cpp +++ b/plugins/CrashDumper/src/dumper.cpp @@ -18,9 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h"
-extern TCHAR* vertxt;
-extern TCHAR* profname;
-extern TCHAR* profpath;
+extern wchar_t* vertxt;
+extern wchar_t* profname;
+extern wchar_t* profpath;
void CreateMiniDump(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr)
{
@@ -36,8 +36,8 @@ void CreateMiniDump(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr) void WriteBBFile(CMString& buffer, bool hdr)
{
- static const TCHAR header[] = TEXT("[spoiler=VersionInfo][quote]");
- static const TCHAR footer[] = TEXT("[/quote][/spoiler]");
+ static const wchar_t header[] = TEXT("[spoiler=VersionInfo][quote]");
+ static const wchar_t footer[] = TEXT("[/quote][/spoiler]");
buffer.Append(hdr ? header : footer);
}
@@ -59,14 +59,14 @@ BOOL CALLBACK LoadedModules64(LPCSTR, DWORD64 ModuleBase, ULONG ModuleSize, PVOI const HMODULE hModule = (HMODULE)ModuleBase;
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetModuleFileName(hModule, path, MAX_PATH);
buffer.AppendFormat(TEXT("%s %p - %p"), path, (void*)ModuleBase, (void*)(ModuleBase + ModuleSize));
GetVersionInfo(hModule, buffer);
- TCHAR timebuf[30] = TEXT("");
+ wchar_t timebuf[30] = TEXT("");
GetLastWriteTime(path, timebuf, 30);
buffer.AppendFormat(TEXT(" [%s]\r\n"), timebuf);
@@ -100,7 +100,7 @@ BOOL CALLBACK LoadedModulesFind64(LPCSTR ModuleName, DWORD64 ModuleBase, ULONG M }
-void GetLinkedModulesInfo(TCHAR *moduleName, CMString &buffer)
+void GetLinkedModulesInfo(wchar_t *moduleName, CMString &buffer)
{
HANDLE hDllFile = CreateFile(moduleName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hDllFile == INVALID_HANDLE_VALUE)
@@ -114,7 +114,7 @@ void GetLinkedModulesInfo(TCHAR *moduleName, CMString &buffer) LPVOID dllAddr = MapViewOfFile(hDllMapping, FILE_MAP_READ, 0, 0, 0);
- static const TCHAR format[] = TEXT(" Plugin statically linked to missing module: %S\r\n");
+ static const wchar_t format[] = TEXT(" Plugin statically linked to missing module: %S\r\n");
__try {
PIMAGE_NT_HEADERS nthdrs = ImageNtHeader(dllAddr);
@@ -173,10 +173,10 @@ static void GetPluginsString(CMString& buffer, unsigned& flags) {
buffer.AppendFormat(TEXT("Service Mode: %s\r\n"), servicemode ? TEXT("Yes") : TEXT("No"));
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetModuleFileName(NULL, path, MAX_PATH);
- LPTSTR fname = _tcsrchr(path, TEXT('\\'));
+ LPTSTR fname = wcsrchr(path, TEXT('\\'));
if (fname == NULL) fname = path;
mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\*.dll"));
@@ -189,7 +189,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags) CMString ubuffer;
ListItem* dlllist = NULL;
- static const TCHAR format[] = TEXT("\xa4 %s v.%s%d.%d.%d.%d%s [%s] - %S %s\r\n");
+ static const wchar_t format[] = TEXT("\xa4 %s v.%s%d.%d.%d.%d%s [%s] - %S %s\r\n");
do {
bool loaded = false;
@@ -201,7 +201,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags) }
if (hModule == NULL) {
if ((flags & VI_FLAG_PRNVAR) && IsPluginEnabled(FindFileData.cFileName)) {
- TCHAR timebuf[30] = TEXT("");
+ wchar_t timebuf[30] = TEXT("");
GetLastWriteTime(&FindFileData.ftLastWriteTime, timebuf, 30);
ubuffer.AppendFormat(format, FindFileData.cFileName,
@@ -220,10 +220,10 @@ static void GetPluginsString(CMString& buffer, unsigned& flags) PLUGININFOEX* pi = GetMirInfo(hModule);
if (pi != NULL) {
- TCHAR timebuf[30] = TEXT("");
+ wchar_t timebuf[30] = TEXT("");
GetLastWriteTime(&FindFileData.ftLastWriteTime, timebuf, 30);
- const TCHAR *unica = !(((PLUGININFOEX*)pi)->flags & UNICODE_AWARE) ? TEXT("|ANSI|") : TEXT("");
+ const wchar_t *unica = !(((PLUGININFOEX*)pi)->flags & UNICODE_AWARE) ? TEXT("|ANSI|") : TEXT("");
ListItem* lst = new ListItem;
int v1, v2, v3, v4;
@@ -345,17 +345,17 @@ static void GetProtocolStrings(CMString& buffer) for (i = 0; i < protoCountMy; i++)
buffer.AppendFormat(TEXT("%-24s %d - Enabled %d - Disabled %sLoaded\r\n"),
- (TCHAR*)_A2T(protoListMy[i]), protos[i].countse,
+ (wchar_t*)_A2T(protoListMy[i]), protos[i].countse,
protos[i].countsd, protos[i].nloaded ? L"Not " : L"");
}
static void GetWeatherStrings(CMString& buffer, unsigned flags)
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetModuleFileName(NULL, path, MAX_PATH);
- LPTSTR fname = _tcsrchr(path, TEXT('\\'));
+ LPTSTR fname = wcsrchr(path, TEXT('\\'));
if (fname == NULL) fname = path;
mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\weather\\*.ini"));
@@ -399,11 +399,11 @@ static void GetWeatherStrings(CMString& buffer, unsigned flags) id += 5;
}
- TCHAR timebuf[30] = TEXT("");
+ wchar_t timebuf[30] = TEXT("");
GetLastWriteTime(&FindFileData.ftLastWriteTime, timebuf, 30);
- static const TCHAR format[] = TEXT(" %s v.%s%S%s [%s] - %S\r\n");
+ static const wchar_t format[] = TEXT(" %s v.%s%S%s [%s] - %S\r\n");
buffer.AppendFormat(format, FindFileData.cFileName,
(flags & VI_FLAG_FORMAT) ? TEXT("[b]") : TEXT(""),
@@ -419,10 +419,10 @@ static void GetWeatherStrings(CMString& buffer, unsigned flags) static void GetIconStrings(CMString& buffer)
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetModuleFileName(NULL, path, MAX_PATH);
- LPTSTR fname = _tcsrchr(path, TEXT('\\'));
+ LPTSTR fname = wcsrchr(path, TEXT('\\'));
if (fname == NULL) fname = path;
mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\Icons\\*.*"));
@@ -433,7 +433,7 @@ static void GetIconStrings(CMString& buffer) do {
if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue;
- TCHAR timebuf[30] = TEXT("");
+ wchar_t timebuf[30] = TEXT("");
GetLastWriteTime(&FindFileData.ftLastWriteTime, timebuf, 30);
buffer.AppendFormat(TEXT(" %s [%s]\r\n"), FindFileData.cFileName, timebuf);
@@ -450,7 +450,7 @@ void PrintVersionInfo(CMString& buffer, unsigned flags) GetFreeMemoryString(buffer);
buffer.Append(L"\r\n");
- TCHAR tszOsVer[200];
+ wchar_t tszOsVer[200];
GetOSDisplayString(tszOsVer, _countof(tszOsVer));
buffer.Append(tszOsVer);
buffer.Append(L"\r\n");
@@ -464,7 +464,7 @@ void PrintVersionInfo(CMString& buffer, unsigned flags) GetLanguageString(buffer);
buffer.Append(L"\r\n");
- TCHAR *profpathfull = Utils_ReplaceVarsT(profpath);
+ wchar_t *profpathfull = Utils_ReplaceVarsT(profpath);
if (flags & VI_FLAG_PRNVAR) {
GetFreeDiskString(profpathfull, buffer);
buffer.Append(L"\r\n");
@@ -474,12 +474,12 @@ void PrintVersionInfo(CMString& buffer, unsigned flags) GetWow64String(buffer);
buffer.Append(L"\r\n");
- TCHAR path[MAX_PATH], mirtime[30];
+ wchar_t path[MAX_PATH], mirtime[30];
GetModuleFileName(NULL, path, MAX_PATH);
GetLastWriteTime(path, mirtime, 30);
buffer.AppendFormat(TEXT("Build time: %s\r\n"), mirtime);
- TCHAR profpn[MAX_PATH];
+ wchar_t profpn[MAX_PATH];
mir_sntprintf(profpn, TEXT("%s\\%s"), profpathfull, profname);
DATABASELINK *db = FindDatabasePlugin(profpn);
@@ -505,8 +505,8 @@ void PrintVersionInfo(CMString& buffer, unsigned flags) GetLanguagePackString(buffer);
buffer.Append(L"\r\n");
- // buffer.AppendFormat(TEXT("Nightly: %s\r\n"), _tcsstr(vertxt, TEXT("alpha")) ? TEXT("Yes") : TEXT("No"));
- // buffer.AppendFormat(TEXT("Unicode: %s\r\n"), _tcsstr(vertxt, TEXT("Unicode")) ? TEXT("Yes") : TEXT("No"));
+ // buffer.AppendFormat(TEXT("Nightly: %s\r\n"), wcsstr(vertxt, TEXT("alpha")) ? TEXT("Yes") : TEXT("No"));
+ // buffer.AppendFormat(TEXT("Unicode: %s\r\n"), wcsstr(vertxt, TEXT("Unicode")) ? TEXT("Yes") : TEXT("No"));
GetPluginsString(buffer, flags);
@@ -541,7 +541,7 @@ void PrintVersionInfo(CMString& buffer, unsigned flags) }
-void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHAR* msg)
+void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const wchar_t* msg)
{
if (exc_ptr->ContextRecord == NULL || (exc_ptr->ContextRecord->ContextFlags & CONTEXT_CONTROL) == 0)
return;
@@ -573,7 +573,7 @@ void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHA const PLUGININFOEX *pluginInfoEx = GetPluginInfoEx();
- TCHAR curtime[30];
+ wchar_t curtime[30];
GetISO8061Time(NULL, curtime, 30);
CMString buffer;
@@ -596,7 +596,7 @@ void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHA buffer.Append(TEXT("\r\nStack Trace:\r\n---------------------------------------------------------------\r\n"));
for (int i = 81; --i;) {
- char symbuf[sizeof(IMAGEHLP_SYMBOL64) + MAX_SYM_NAME * sizeof(TCHAR) + 4] = { 0 };
+ char symbuf[sizeof(IMAGEHLP_SYMBOL64) + MAX_SYM_NAME * sizeof(wchar_t) + 4] = { 0 };
PIMAGEHLP_SYMBOL64 pSym = (PIMAGEHLP_SYMBOL64)symbuf;
pSym->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64);
pSym->MaxNameLength = MAX_SYM_NAME;
@@ -651,7 +651,7 @@ void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHA HMODULE hModule = (HMODULE)Module.BaseOfImage;
PLUGININFOEX *pi = GetMirInfo(hModule);
if (pi != NULL) {
- static const TCHAR formatc[] = TEXT("\r\nLikely cause of the crash plugin: %S\r\n\r\n");
+ static const wchar_t formatc[] = TEXT("\r\nLikely cause of the crash plugin: %S\r\n\r\n");
if (pi->shortName) {
CMString crashcause;
@@ -663,7 +663,7 @@ void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHA }
- static const TCHAR formatd[] = TEXT("%p (%S %p): %S (%d): %S\r\n");
+ static const wchar_t formatd[] = TEXT("%p (%S %p): %S (%d): %S\r\n");
buffer.AppendFormat(formatd, (void*)frame.AddrPC.Offset, moduleName, (void*)Module.BaseOfImage,lineFileName, Line.LineNumber, name);
}
diff --git a/plugins/CrashDumper/src/exhndlr.cpp b/plugins/CrashDumper/src/exhndlr.cpp index c690bdc9d2..6fbace54c1 100644 --- a/plugins/CrashDumper/src/exhndlr.cpp +++ b/plugins/CrashDumper/src/exhndlr.cpp @@ -46,7 +46,7 @@ int myDebugFilter(unsigned int code, PEXCEPTION_POINTERS ep) void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify)
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
SYSTEMTIME st;
HANDLE hDumpFile = NULL;
diff --git a/plugins/CrashDumper/src/stdafx.h b/plugins/CrashDumper/src/stdafx.h index 64b86b2da7..f7abf43d21 100644 --- a/plugins/CrashDumper/src/stdafx.h +++ b/plugins/CrashDumper/src/stdafx.h @@ -92,8 +92,8 @@ extern DWORD mirandaVersion; extern LCID packlcid;
extern bool servicemode, clsdates, dtsubfldr, catchcrashes, needrestart;
-extern TCHAR CrashLogFolder[MAX_PATH];
-extern TCHAR VersionInfoFolder[MAX_PATH];
+extern wchar_t CrashLogFolder[MAX_PATH];
+extern wchar_t VersionInfoFolder[MAX_PATH];
void WriteBBFile(CMString& buffer, bool hdr);
void WriteUtfFile(HANDLE hDumpFile, char* bufu);
@@ -119,14 +119,14 @@ void ReadableExceptionInfo(PEXCEPTION_RECORD excrec, CMString& buffer); void GetLastWriteTime(LPCTSTR fileName, LPTSTR lpszString, DWORD dwSize);
void GetLastWriteTime(FILETIME* ftime, LPTSTR lpszString, DWORD dwSize);
void StoreStringToClip(CMString& buffer);
-void ShowMessage(int type, const TCHAR* format, ...);
-bool IsPluginEnabled(TCHAR* filename);
+void ShowMessage(int type, const wchar_t* format, ...);
+bool IsPluginEnabled(wchar_t* filename);
PLUGININFOEX* GetMirInfo(HMODULE hModule);
const PLUGININFOEX* GetPluginInfoEx(void);
void CreateMiniDump(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr);
-void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHAR* msg);
+void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const wchar_t* msg);
void PrintVersionInfo(CMString& buffer, unsigned flags = VI_FLAG_PRNVAR);
bool ProcessVIHash(bool store);
diff --git a/plugins/CrashDumper/src/ui.cpp b/plugins/CrashDumper/src/ui.cpp index 34f82b15a3..14e018aa2f 100644 --- a/plugins/CrashDumper/src/ui.cpp +++ b/plugins/CrashDumper/src/ui.cpp @@ -278,7 +278,7 @@ LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) break;
case 3:
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
mir_sntprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
ShellExecute(NULL, TEXT("open"), path, NULL, NULL, SW_SHOW);
break;
@@ -295,7 +295,7 @@ LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) return DefWindowProc(hWnd, msg, wParam, lParam);
}
-void ShowMessage(int type, const TCHAR* format, ...)
+void ShowMessage(int type, const wchar_t* format, ...)
{
POPUPDATAT pi = { 0 };
diff --git a/plugins/CrashDumper/src/upload.cpp b/plugins/CrashDumper/src/upload.cpp index fbd87e2f5c..ad180b0589 100644 --- a/plugins/CrashDumper/src/upload.cpp +++ b/plugins/CrashDumper/src/upload.cpp @@ -235,7 +235,7 @@ bool ProcessVIHash(bool store) mir_md5_state_t context;
mir_md5_init(&context);
- mir_md5_append(&context, (PBYTE)buffer.c_str(), buffer.GetLength()*sizeof(TCHAR));
+ mir_md5_append(&context, (PBYTE)buffer.c_str(), buffer.GetLength()*sizeof(wchar_t));
mir_md5_finish(&context, hash);
char hashstr[40];
diff --git a/plugins/CrashDumper/src/utils.cpp b/plugins/CrashDumper/src/utils.cpp index 4abad60ed6..356bf6a8a1 100644 --- a/plugins/CrashDumper/src/utils.cpp +++ b/plugins/CrashDumper/src/utils.cpp @@ -105,9 +105,9 @@ void GetInternetExplorerVersion(CMString &buffer) HKEY hKey;
DWORD size;
- TCHAR ieVersion[1024] = { 0 };
- TCHAR ieBuild[512] = { 0 };
- TCHAR iVer[64] = { 0 };
+ wchar_t ieVersion[1024] = { 0 };
+ wchar_t ieBuild[512] = { 0 };
+ wchar_t iVer[64] = { 0 };
if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Internet Explorer"), 0, KEY_QUERY_VALUE, &hKey)) {
size = _countof(ieBuild);
@@ -144,9 +144,9 @@ void GetInternetExplorerVersion(CMString &buffer) buffer.AppendFormat(TEXT(" (build %s)"), ieBuild);
}
-void TrimMultiSpaces(TCHAR *str)
+void TrimMultiSpaces(wchar_t *str)
{
- TCHAR *src = str, *dest = str;
+ wchar_t *src = str, *dest = str;
bool trimst = false;
for (;;) {
@@ -169,8 +169,8 @@ void GetProcessorString(CMString &buffer) HKEY hKey;
DWORD size;
- TCHAR cpuIdent[512] = { 0 };
- TCHAR cpuName[512] = { 0 };
+ wchar_t cpuIdent[512] = { 0 };
+ wchar_t cpuName[512] = { 0 };
if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Hardware\\Description\\System\\CentralProcessor\\0"), 0, KEY_QUERY_VALUE, &hKey)) {
size = _countof(cpuName);
@@ -343,7 +343,7 @@ void GetAdminString(CMString &buffer) void GetLanguageString(CMString &buffer)
{
- TCHAR name1[256], name2[256], name3[256], name4[256];
+ wchar_t name1[256], name2[256], name3[256], name4[256];
GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SENGLANGUAGE, name1, 256);
GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SENGLANGUAGE, name2, 256);
@@ -358,7 +358,7 @@ void GetLanguagePackString(CMString &buffer) {
buffer.Append(TEXT("Language pack: "));
if (packlcid != LOCALE_USER_DEFAULT) {
- TCHAR lang[MAX_PATH], ctry[MAX_PATH];
+ wchar_t lang[MAX_PATH], ctry[MAX_PATH];
if (GetLocaleInfo(packlcid, LOCALE_SENGLANGUAGE, lang, MAX_PATH)) {
if (GetLocaleInfo(packlcid, LOCALE_SISO3166CTRYNAME, ctry, MAX_PATH))
buffer.AppendFormat(TEXT("%s (%s) [%04x]"), lang, ctry, packlcid);
@@ -408,7 +408,7 @@ void GetVersionInfo(HMODULE hLib, CMString& buffer) void StoreStringToClip(CMString& buffer)
{
- int bufLen = (buffer.GetLength() + 1) * sizeof(TCHAR);
+ int bufLen = (buffer.GetLength() + 1) * sizeof(wchar_t);
HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, bufLen);
LPSTR buf = (LPSTR)GlobalLock(hData);
@@ -425,7 +425,7 @@ void StoreStringToClip(CMString& buffer) }
}
-bool IsPluginEnabled(TCHAR* filename)
+bool IsPluginEnabled(wchar_t* filename)
{
char* fname;
crsi_t2a(fname, filename);
diff --git a/plugins/Db3x_mmap/src/database.cpp b/plugins/Db3x_mmap/src/database.cpp index d5ff51a4a4..06cfcaf963 100644 --- a/plugins/Db3x_mmap/src/database.cpp +++ b/plugins/Db3x_mmap/src/database.cpp @@ -76,9 +76,9 @@ DWORD CDb3Mmap::ReallocSpace(DWORD ofs, int oldSize, int newSize) /////////////////////////////////////////////////////////////////////////////////////////
static DWORD DatabaseCorrupted = 0;
-static TCHAR *msg = NULL;
+static wchar_t *msg = NULL;
static DWORD dwErr = 0;
-static TCHAR tszPanic[] = LPGENT("Miranda has detected corruption in your database. This corruption may be fixed by DbChecker plugin. Please download it from http://miranda-ng.org/p/DbChecker/. Miranda will now shut down.");
+static wchar_t tszPanic[] = LPGENW("Miranda has detected corruption in your database. This corruption may be fixed by DbChecker plugin. Please download it from http://miranda-ng.org/p/DbChecker/. Miranda will now shut down.");
void __cdecl dbpanic(void *)
{
@@ -86,7 +86,7 @@ void __cdecl dbpanic(void *) if (dwErr == ERROR_DISK_FULL)
msg = TranslateT("Disk is full. Miranda will now shut down.");
- TCHAR err[256];
+ wchar_t err[256];
mir_sntprintf(err, msg, TranslateT("Database failure. Miranda will now shut down."), dwErr);
MessageBox(0, err, TranslateT("Database Error"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
@@ -95,7 +95,7 @@ void __cdecl dbpanic(void *) TerminateProcess(GetCurrentProcess(), 255);
}
-void CDb3Mmap::DatabaseCorruption(TCHAR *text)
+void CDb3Mmap::DatabaseCorruption(wchar_t *text)
{
int kill = 0;
diff --git a/plugins/Db3x_mmap/src/dbheaders.cpp b/plugins/Db3x_mmap/src/dbheaders.cpp index 8662142d0d..8cd51d5a6b 100644 --- a/plugins/Db3x_mmap/src/dbheaders.cpp +++ b/plugins/Db3x_mmap/src/dbheaders.cpp @@ -55,8 +55,8 @@ int CDb3Mmap::CreateDbHeaders(const DBSignature& _sign) /////////////////////////////////////////////////////////////////////////////////////////
-static TCHAR tszOldHeaders[] =
-LPGENT("This profile is too old to be updated with PluginUpdater, your database must be converted first.\n\nWould you like to read how to fix this?");
+static wchar_t tszOldHeaders[] =
+LPGENW("This profile is too old to be updated with PluginUpdater, your database must be converted first.\n\nWould you like to read how to fix this?");
int CDb3Mmap::CheckDbHeaders(bool bInteractive)
{
@@ -70,9 +70,9 @@ int CDb3Mmap::CheckDbHeaders(bool bInteractive) if (!memcmp(&m_dbHeader.signature, &dbSignatureSD, sizeof(m_dbHeader.signature))) {
if (bInteractive)
if (IDYES == MessageBox(NULL, TranslateTS(tszOldHeaders), TranslateT("Obsolete database format"), MB_YESNO | MB_ICONWARNING)) {
- TCHAR tszCurPath[MAX_PATH];
+ wchar_t tszCurPath[MAX_PATH];
GetModuleFileName(NULL, tszCurPath, _countof(tszCurPath));
- TCHAR *p = _tcsrchr(tszCurPath, '\\');
+ wchar_t *p = wcsrchr(tszCurPath, '\\');
if (p) *p = 0;
HKEY hPathSetting;
diff --git a/plugins/Db3x_mmap/src/dbintf.cpp b/plugins/Db3x_mmap/src/dbintf.cpp index 18735f7c44..f831b627b8 100644 --- a/plugins/Db3x_mmap/src/dbintf.cpp +++ b/plugins/Db3x_mmap/src/dbintf.cpp @@ -44,7 +44,7 @@ static int stringCompare2(const char *p1, const char *p2) return mir_strcmp(p1, p2);
}
-CDb3Mmap::CDb3Mmap(const TCHAR *tszFileName, int iMode) :
+CDb3Mmap::CDb3Mmap(const wchar_t *tszFileName, int iMode) :
m_hDbFile(INVALID_HANDLE_VALUE),
m_safetyMode(true),
m_bReadOnly((iMode & DBMODE_READONLY) != 0),
diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h index 9a5b690799..dc21944426 100644 --- a/plugins/Db3x_mmap/src/dbintf.h +++ b/plugins/Db3x_mmap/src/dbintf.h @@ -183,7 +183,7 @@ struct DBCachedContact : public DBCachedContactBase struct CDb3Mmap : public MIDatabase, public MIDatabaseChecker, public MZeroedObject
{
- CDb3Mmap(const TCHAR *tszFileName, int mode);
+ CDb3Mmap(const wchar_t *tszFileName, int mode);
~CDb3Mmap();
int Load(bool bSkipInit);
@@ -193,14 +193,14 @@ struct CDb3Mmap : public MIDatabase, public MIDatabaseChecker, public MZeroedObj void ToggleEncryption(void);
void StoreKey(void);
- void SetPassword(const TCHAR *ptszPassword);
+ void SetPassword(const wchar_t *ptszPassword);
void UpdateMenuItem(void);
int PrepareCheck(int*);
- __forceinline LPTSTR GetMenuTitle() const { return m_bUsesPassword ? LPGENT("Change/remove password") : LPGENT("Set password"); }
+ __forceinline LPTSTR GetMenuTitle() const { return m_bUsesPassword ? LPGENW("Change/remove password") : LPGENW("Set password"); }
- void DatabaseCorruption(TCHAR *text);
+ void DatabaseCorruption(wchar_t *text);
void WriteSignature(DBSignature&);
__forceinline HANDLE getFile() const { return m_hDbFile; }
@@ -282,7 +282,7 @@ public: // Check functions int WorkFinalTasks(int);
protected:
- TCHAR* m_tszProfileName;
+ wchar_t* m_tszProfileName;
HANDLE m_hDbFile;
DBHeader m_dbHeader;
DWORD m_ChunkSize;
diff --git a/plugins/Db3x_mmap/src/dbtool/modulechain.cpp b/plugins/Db3x_mmap/src/dbtool/modulechain.cpp index cdfc9b3cc9..16ff76df78 100644 --- a/plugins/Db3x_mmap/src/dbtool/modulechain.cpp +++ b/plugins/Db3x_mmap/src/dbtool/modulechain.cpp @@ -96,9 +96,9 @@ int CDb3Mmap::WorkModuleChain(int firstTime) n++;
}
if (n) {
- TCHAR szModuleName[257];
+ wchar_t szModuleName[257];
MultiByteToWideChar(CP_ACP, 0, modChain[iCurrentModName].name, -1, szModuleName, _countof(szModuleName));
- TCHAR *pszModuleName = szModuleName;
+ wchar_t *pszModuleName = szModuleName;
cb->pfnAddLogMessage(STATUS_WARNING, TranslateT("Module name '%s' is not unique: %d duplicates found"), pszModuleName, n);
}
diff --git a/plugins/Db3x_mmap/src/init.cpp b/plugins/Db3x_mmap/src/init.cpp index ad2b9130aa..1480ad214a 100644 --- a/plugins/Db3x_mmap/src/init.cpp +++ b/plugins/Db3x_mmap/src/init.cpp @@ -47,7 +47,7 @@ LIST<CDb3Mmap> g_Dbs(1, HandleKeySortT); /////////////////////////////////////////////////////////////////////////////////////////
// returns 0 if the profile is created, EMKPRF*
-static int makeDatabase(const TCHAR *profile)
+static int makeDatabase(const wchar_t *profile)
{
std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, 0));
if (db->Create() != ERROR_SUCCESS)
@@ -57,7 +57,7 @@ static int makeDatabase(const TCHAR *profile) }
// returns 0 if the given profile has a valid header
-static int grokHeader(const TCHAR *profile)
+static int grokHeader(const wchar_t *profile)
{
std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, DBMODE_SHARED | DBMODE_READONLY));
if (db->Load(true) != ERROR_SUCCESS)
@@ -67,7 +67,7 @@ static int grokHeader(const TCHAR *profile) }
// returns 0 if all the APIs are injected otherwise, 1
-static MIDatabase* LoadDatabase(const TCHAR *profile, BOOL bReadOnly)
+static MIDatabase* LoadDatabase(const wchar_t *profile, BOOL bReadOnly)
{
// set the memory, lists & UTF8 manager
mir_getLP(&pluginInfo);
@@ -87,7 +87,7 @@ static int UnloadDatabase(MIDatabase *db) return 0;
}
-MIDatabaseChecker* CheckDb(const TCHAR *profile, int *error)
+MIDatabaseChecker* CheckDb(const wchar_t *profile, int *error)
{
std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, DBMODE_READONLY));
if (db->Load(true) != ERROR_SUCCESS) {
diff --git a/plugins/Db3x_mmap/src/ui.cpp b/plugins/Db3x_mmap/src/ui.cpp index e29e8f0ec2..36896352e4 100644 --- a/plugins/Db3x_mmap/src/ui.cpp +++ b/plugins/Db3x_mmap/src/ui.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct DlgChangePassParam
{
CDb3Mmap *db;
- TCHAR newPass[100];
+ wchar_t newPass[100];
int wrongPass;
};
@@ -141,7 +141,7 @@ bool CDb3Mmap::EnterPassword(const BYTE *pKey, const size_t keyLen) static bool CheckOldPassword(HWND hwndDlg, CDb3Mmap *db)
{
if (db->usesPassword()) {
- TCHAR buf[100];
+ wchar_t buf[100];
GetDlgItemText(hwndDlg, IDC_OLDPASS, buf, _countof(buf));
if (!db->m_crypto->checkPassword(T2Utf(buf))) {
SetDlgItemText(hwndDlg, IDC_HEADERBAR, TranslateT("Wrong old password entered!"));
@@ -154,7 +154,7 @@ static bool CheckOldPassword(HWND hwndDlg, CDb3Mmap *db) static INT_PTR CALLBACK sttChangePassword(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
DlgChangePassParam *param = (DlgChangePassParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- TCHAR buf[100];
+ wchar_t buf[100];
switch (uMsg) {
case WM_INITDIALOG:
@@ -199,7 +199,7 @@ static INT_PTR CALLBACK sttChangePassword(HWND hwndDlg, UINT uMsg, WPARAM wParam break;
case IDOK:
- TCHAR buf2[100];
+ wchar_t buf2[100];
GetDlgItemText(hwndDlg, IDC_USERPASS1, buf2, _countof(buf2));
if (mir_tstrlen(buf2) < 3) {
SetDlgItemText(hwndDlg, IDC_HEADERBAR, TranslateT("Password is too short!"));
@@ -313,13 +313,13 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM) CMenuItem mi;
// main menu item
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Database"), 500000000, iconList[0].hIcolib);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Database"), 500000000, iconList[0].hIcolib);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "F7C5567C-D1EE-484B-B4F6-24677A5AAAEF");
SET_UID(mi, 0x50321866, 0xba1, 0x46dd, 0xb3, 0xa6, 0xc3, 0xcc, 0x55, 0xf2, 0x42, 0x9e);
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = iconList[1].hIcolib;
- mi.name.t = db->GetMenuTitle();
+ mi.name.w = db->GetMenuTitle();
mi.pszService = MS_DB_CHANGEPASSWORD;
hSetPwdMenu = Menu_AddMainMenuItem(&mi);
return 0;
diff --git a/plugins/DbChecker/src/main.cpp b/plugins/DbChecker/src/main.cpp index 54166a4afb..80ff103a0c 100644 --- a/plugins/DbChecker/src/main.cpp +++ b/plugins/DbChecker/src/main.cpp @@ -73,7 +73,7 @@ static INT_PTR CheckProfile(WPARAM wParam, LPARAM lParam) bLaunchMiranda = lParam != 0;
bAutoExit = lParam == 2;
bServiceMode = false;
- _tcsncpy(opts.filename, (TCHAR*)wParam, _countof(opts.filename));
+ wcsncpy(opts.filename, (wchar_t*)wParam, _countof(opts.filename));
return DialogBox(hInst, MAKEINTRESOURCE(IDD_WIZARD), NULL, WizardDlgProc);
}
diff --git a/plugins/DbChecker/src/openerror.cpp b/plugins/DbChecker/src/openerror.cpp index 49d4b88bf7..a5ea7c99a6 100644 --- a/plugins/DbChecker/src/openerror.cpp +++ b/plugins/DbChecker/src/openerror.cpp @@ -28,7 +28,7 @@ INT_PTR CALLBACK OpenErrorDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM switch (message) {
case WM_INITDIALOG:
{
- TCHAR szError[256];
+ wchar_t szError[256];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, opts.error, 0, szError, _countof(szError), NULL);
SetDlgItemText(hdlg, IDC_ERRORTEXT, szError);
}
diff --git a/plugins/DbChecker/src/progress.cpp b/plugins/DbChecker/src/progress.cpp index 7d6edd8d75..e5dce00b3f 100644 --- a/plugins/DbChecker/src/progress.cpp +++ b/plugins/DbChecker/src/progress.cpp @@ -28,12 +28,12 @@ HANDLE hEventRun = NULL, hEventAbort = NULL; int errorCount;
LRESULT wizardResult;
-void AddToStatus(int flags, const TCHAR* fmt, ...)
+void AddToStatus(int flags, const wchar_t* fmt, ...)
{
va_list vararg;
va_start(vararg, fmt);
- TCHAR str[256];
+ wchar_t str[256];
mir_vsntprintf(str, _countof(str), fmt, vararg);
va_end(vararg);
@@ -120,7 +120,7 @@ INT_PTR CALLBACK ProgressDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM return TRUE;
case WM_DRAWITEM:
- TCHAR str[256];
+ wchar_t str[256];
{
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
int bold = 0;
diff --git a/plugins/DbChecker/src/selectdb.cpp b/plugins/DbChecker/src/selectdb.cpp index 1f44e9913d..3b4cebdc58 100644 --- a/plugins/DbChecker/src/selectdb.cpp +++ b/plugins/DbChecker/src/selectdb.cpp @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-static bool CheckBroken(const TCHAR *ptszFullPath)
+static bool CheckBroken(const wchar_t *ptszFullPath)
{
DATABASELINK *dblink = FindDatabasePlugin(ptszFullPath);
if (dblink == NULL || dblink->CheckDB == NULL)
@@ -30,7 +30,7 @@ static bool CheckBroken(const TCHAR *ptszFullPath) int OpenDatabase(HWND hdlg, INT iNextPage)
{
- TCHAR tszMsg[1024];
+ wchar_t tszMsg[1024];
int error = 0;
if (opts.dbChecker == NULL) {
@@ -73,9 +73,9 @@ int OpenDatabase(HWND hdlg, INT iNextPage) return true;
}
-void GetProfileDirectory(TCHAR* szMirandaDir, TCHAR* szPath, int cbPath)
+void GetProfileDirectory(wchar_t* szMirandaDir, wchar_t* szPath, int cbPath)
{
- TCHAR szProfileDir[MAX_PATH], szExpandedProfileDir[MAX_PATH], szMirandaBootIni[MAX_PATH];
+ wchar_t szProfileDir[MAX_PATH], szExpandedProfileDir[MAX_PATH], szMirandaBootIni[MAX_PATH];
mir_tstrcpy(szMirandaBootIni, szMirandaDir);
mir_tstrcat(szMirandaBootIni, L"\\mirandaboot.ini");
@@ -88,57 +88,57 @@ void GetProfileDirectory(TCHAR* szMirandaDir, TCHAR* szPath, int cbPath) szPath[mir_tstrlen(szPath) - 1] = 0;
}
-static int AddDatabaseToList(HWND hwndList, const TCHAR* filename, TCHAR* dir)
+static int AddDatabaseToList(HWND hwndList, const wchar_t* filename, wchar_t* dir)
{
LV_ITEM lvi;
lvi.mask = LVIF_PARAM;
lvi.iSubItem = 0;
for (lvi.iItem = ListView_GetItemCount(hwndList) - 1; lvi.iItem >= 0; lvi.iItem--) {
ListView_GetItem(hwndList, &lvi);
- if (!mir_tstrcmpi((TCHAR*)lvi.lParam, filename))
+ if (!mir_tstrcmpi((wchar_t*)lvi.lParam, filename))
return lvi.iItem;
}
struct _stat st;
- if (_tstat(filename, &st) == -1)
+ if (_wstat(filename, &st) == -1)
return -1;
DWORD totalSize = st.st_size;
bool isBroken = CheckBroken(filename);
- const TCHAR *pName = _tcsrchr(filename, '\\');
+ const wchar_t *pName = wcsrchr(filename, '\\');
if (pName == NULL)
pName = (LPTSTR)filename;
else
pName++;
- TCHAR szName[MAX_PATH];
+ wchar_t szName[MAX_PATH];
mir_sntprintf(szName, L"%s%s", dir, pName);
- TCHAR *pDot = _tcsrchr(szName, '.');
+ wchar_t *pDot = wcsrchr(szName, '.');
if (pDot != NULL && !mir_tstrcmpi(pDot, L".dat"))
*pDot = 0;
lvi.iItem = 0;
lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
lvi.iSubItem = 0;
- lvi.lParam = (LPARAM)_tcsdup(filename);
+ lvi.lParam = (LPARAM)wcsdup(filename);
lvi.pszText = szName;
lvi.iImage = (isBroken) ? 1 : 0;
int iNewItem = ListView_InsertItem(hwndList, &lvi);
- TCHAR szSize[20];
+ wchar_t szSize[20];
mir_sntprintf(szSize, L"%.2lf MB", totalSize / 1048576.0);
ListView_SetItemText(hwndList, iNewItem, 1, szSize);
return iNewItem;
}
-void FindAdd(HWND hdlg, TCHAR *szProfileDir, TCHAR *szPrefix)
+void FindAdd(HWND hdlg, wchar_t *szProfileDir, wchar_t *szPrefix)
{
HANDLE hFind;
WIN32_FIND_DATA fd;
- TCHAR szSearchPath[MAX_PATH], szFilename[MAX_PATH];
+ wchar_t szSearchPath[MAX_PATH], szFilename[MAX_PATH];
mir_tstrcpy(szSearchPath, szProfileDir);
mir_tstrcat(szSearchPath, L"\\*.*");
@@ -150,14 +150,14 @@ void FindAdd(HWND hdlg, TCHAR *szProfileDir, TCHAR *szPrefix) continue;
mir_sntprintf(szFilename, L"%s\\%s\\%s.dat", szProfileDir, fd.cFileName, fd.cFileName);
- if (_taccess(szFilename, 0) == 0)
+ if (_waccess(szFilename, 0) == 0)
AddDatabaseToList(GetDlgItem(hdlg, IDC_DBLIST), szFilename, szPrefix);
} while (FindNextFile(hFind, &fd));
FindClose(hFind);
}
}
-TCHAR *addstring(TCHAR *str, TCHAR *add)
+wchar_t *addstring(wchar_t *str, wchar_t *add)
{
mir_tstrcpy(str, add);
return str + mir_tstrlen(add) + 1;
@@ -191,16 +191,16 @@ INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lvc.pszText = TranslateT("Total size");
ListView_InsertColumn(GetDlgItem(hdlg, IDC_DBLIST), 1, &lvc);
- TCHAR szMirandaPath[MAX_PATH];
+ wchar_t szMirandaPath[MAX_PATH];
GetModuleFileName(NULL, szMirandaPath, _countof(szMirandaPath));
- TCHAR *str2 = _tcsrchr(szMirandaPath, '\\');
+ wchar_t *str2 = wcsrchr(szMirandaPath, '\\');
if (str2 != NULL)
*str2 = 0;
int i = 0;
HKEY hKey;
- TCHAR szProfileDir[MAX_PATH];
- TCHAR szMirandaProfiles[MAX_PATH];
+ wchar_t szProfileDir[MAX_PATH];
+ wchar_t szMirandaProfiles[MAX_PATH];
DWORD cbData = _countof(szMirandaPath);
mir_tstrcpy(szMirandaProfiles, szMirandaPath);
@@ -259,13 +259,13 @@ INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM case IDC_OTHER:
{
OPENFILENAME ofn = { 0 };
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
// L"Miranda Databases (*.dat)\0*.DAT\0All Files (*)\0*\0";
- TCHAR *filter, *tmp, *tmp1, *tmp2;
+ wchar_t *filter, *tmp, *tmp1, *tmp2;
tmp1 = TranslateT("Miranda Databases (*.dat)");
tmp2 = TranslateT("All Files");
- filter = tmp = (TCHAR*)_alloca((mir_tstrlen(tmp1) + mir_tstrlen(tmp2) + 11)*sizeof(TCHAR));
+ filter = tmp = (wchar_t*)_alloca((mir_tstrlen(tmp1) + mir_tstrlen(tmp2) + 11)*sizeof(wchar_t));
tmp = addstring(tmp, tmp1);
tmp = addstring(tmp, L"*.DAT");
tmp = addstring(tmp, tmp2);
@@ -312,7 +312,7 @@ INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM if (lvi.iItem == -1) break;
lvi.mask = LVIF_PARAM;
ListView_GetItem(GetDlgItem(hdlg, IDC_DBLIST), &lvi);
- SetDlgItemText(hdlg, IDC_FILE, (TCHAR*)lvi.lParam);
+ SetDlgItemText(hdlg, IDC_FILE, (wchar_t*)lvi.lParam);
SendMessage(hdlg, WM_COMMAND, MAKEWPARAM(IDC_FILE, EN_CHANGE), (LPARAM)GetDlgItem(hdlg, IDC_FILE));
}
break;
diff --git a/plugins/DbChecker/src/stdafx.h b/plugins/DbChecker/src/stdafx.h index c2235a6c4c..6f2f4b80c9 100644 --- a/plugins/DbChecker/src/stdafx.h +++ b/plugins/DbChecker/src/stdafx.h @@ -41,10 +41,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct DbToolOptions
{
- TCHAR filename[MAX_PATH];
- TCHAR workingFilename[MAX_PATH];
- TCHAR outputFilename[MAX_PATH];
- TCHAR backupFilename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
+ wchar_t workingFilename[MAX_PATH];
+ wchar_t outputFilename[MAX_PATH];
+ wchar_t backupFilename[MAX_PATH];
DATABASELINK *dblink;
MIDatabaseChecker* dbChecker;
HANDLE hOutFile;
@@ -74,6 +74,6 @@ INT_PTR CALLBACK OpenErrorDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM int OpenDatabase(HWND hdlg, INT iNextPage);
#define STATUS_CLASSMASK 0x0f
-void AddToStatus(int flags, const TCHAR* fmt, ...);
+void AddToStatus(int flags, const wchar_t* fmt, ...);
void SetProgressBar(int perThou);
diff --git a/plugins/DbChecker/src/worker.cpp b/plugins/DbChecker/src/worker.cpp index 674088d9f5..92ab1cf497 100644 --- a/plugins/DbChecker/src/worker.cpp +++ b/plugins/DbChecker/src/worker.cpp @@ -41,9 +41,9 @@ static void Finalize(time_t& ts) }
if (opts.bBackup) {
- TCHAR dbPath[MAX_PATH], dbFile[MAX_PATH];
+ wchar_t dbPath[MAX_PATH], dbFile[MAX_PATH];
mir_tstrcpy(dbPath, opts.filename);
- TCHAR* str2 = _tcsrchr(dbPath, '\\');
+ wchar_t* str2 = wcsrchr(dbPath, '\\');
if (str2 != NULL) {
mir_tstrcpy(dbFile, str2 + 1);
*str2 = 0;
@@ -57,7 +57,7 @@ static void Finalize(time_t& ts) mir_sntprintf(opts.backupFilename, TranslateT("%s\\Backup of %s"), dbPath, dbFile);
else
mir_sntprintf(opts.backupFilename, TranslateT("%s\\Backup (%d) of %s"), dbPath, i, dbFile);
- if (_taccess(opts.backupFilename, 0) == -1) break;
+ if (_waccess(opts.backupFilename, 0) == -1) break;
}
if (!MoveFile(opts.filename, opts.backupFilename))
@@ -87,7 +87,7 @@ void __cdecl WorkerThread(void *) }
else {
mir_tstrcpy(opts.outputFilename, opts.filename);
- *_tcsrchr(opts.outputFilename, '.') = 0;
+ *wcsrchr(opts.outputFilename, '.') = 0;
mir_tstrcat(opts.outputFilename, TranslateT(" (Output).dat"));
opts.hOutFile = CreateFile(opts.outputFilename, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
if (opts.hOutFile == INVALID_HANDLE_VALUE) {
diff --git a/plugins/DbEditorPP/src/copymodule.cpp b/plugins/DbEditorPP/src/copymodule.cpp index 424b43837f..042719fe53 100644 --- a/plugins/DbEditorPP/src/copymodule.cpp +++ b/plugins/DbEditorPP/src/copymodule.cpp @@ -27,7 +27,7 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
{
mac = (ModuleAndContact *)lParam;
- TCHAR name[NAME_SIZE], msg[MSG_SIZE];
+ wchar_t name[NAME_SIZE], msg[MSG_SIZE];
mir_sntprintf(msg, TranslateT("Copy module \"%s\""), _A2T(mac->module));
SetWindowText(hwnd, msg);
diff --git a/plugins/DbEditorPP/src/deletemodule.cpp b/plugins/DbEditorPP/src/deletemodule.cpp index 4905fedd10..5bb46feefb 100644 --- a/plugins/DbEditorPP/src/deletemodule.cpp +++ b/plugins/DbEditorPP/src/deletemodule.cpp @@ -9,7 +9,7 @@ int deleteModule(MCONTACT hContact, const char *module, int confirm) return 0;
if (confirm && db_get_b(NULL, modname, "WarnOnDelete", 1)) {
- TCHAR text[MSG_SIZE];
+ wchar_t text[MSG_SIZE];
mir_sntprintf(text, TranslateT("Are you sure you want to delete module \"%s\"?"), _A2T(module));
if (dlg(text, MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
return 0;
@@ -75,11 +75,11 @@ INT_PTR CALLBACK DeleteModuleDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM) {
switch (msg) {
case WM_INITDIALOG:
- SetWindowText(hwnd, LPGENT("Delete module from database... Loading"));
+ SetWindowText(hwnd, LPGENW("Delete module from database... Loading"));
EnableWindow(GetDlgItem(hwnd, IDC_CONTACTS), 0);
EnableWindow(GetDlgItem(hwnd, IDOK), 0);
- SetDlgItemText(hwnd, IDC_INFOTEXT, LPGENT("Delete module from database"));
- SetDlgItemText(hwnd, CHK_COPY2ALL, LPGENT("Delete from all contacts (including Settings)"));
+ SetDlgItemText(hwnd, IDC_INFOTEXT, LPGENW("Delete module from database"));
+ SetDlgItemText(hwnd, CHK_COPY2ALL, LPGENW("Delete from all contacts (including Settings)"));
EnableWindow(GetDlgItem(hwnd, CHK_COPY2ALL), 0);
CheckDlgButton(hwnd, CHK_COPY2ALL, BST_CHECKED);
TranslateDialogDefault(hwnd);
diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp index ec10e43f29..40b0fd405a 100644 --- a/plugins/DbEditorPP/src/exportimport.cpp +++ b/plugins/DbEditorPP/src/exportimport.cpp @@ -1,15 +1,15 @@ #include "stdafx.h"
-TCHAR *GetFilter()
+wchar_t *GetFilter()
{
- static TCHAR filter[MAX_PATH];
+ static wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s%c*.ini%c%s%c*.*%c", TranslateT("INI Files"), 0, 0, TranslateT("All Files"), 0, 0);
return filter;
}
-int Openfile(TCHAR *outputFile, const char *module, int maxlen)
+int Openfile(wchar_t *outputFile, const char *module, int maxlen)
{
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
if (module) {
int n = 0;
@@ -17,13 +17,13 @@ int Openfile(TCHAR *outputFile, const char *module, int maxlen) while (filename[n]) {
switch (filename[n]) {
- case _T('*'):
- case _T(':'):
- case _T('/'):
- case _T('?'):
- case _T('|'):
- case _T('\\'):
- filename[n] = _T('_');
+ case '*':
+ case ':':
+ case '/':
+ case '?':
+ case '|':
+ case '\\':
+ filename[n] = '_';
break;
}
n++;
@@ -148,10 +148,10 @@ void exportDB(MCONTACT hContact, const char *module) if (!EnumModules(&modlist))
return;
- TCHAR fileName[MAX_PATH];
+ wchar_t fileName[MAX_PATH];
if (Openfile(fileName, (hContact == INVALID_CONTACT_ID) ? NULL : module, MAX_PATH)) {
- FILE *file = _tfopen(fileName, L"wt");
+ FILE *file = _wfopen(fileName, L"wt");
if (!file) {
msg(TranslateT("Couldn't open file for writing"));
return;
@@ -427,7 +427,7 @@ INT_PTR CALLBACK ImportDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara TranslateDialogDefault(hwnd);
SendDlgItemMessage(hwnd, IDC_TEXT, EM_LIMITTEXT, (WPARAM)0x7FFFFFFF, 0);
- TCHAR name[NAME_SIZE], msg[MSG_SIZE];
+ wchar_t name[NAME_SIZE], msg[MSG_SIZE];
GetContactName((MCONTACT)lParam, NULL, name, _countof(name));
@@ -446,7 +446,7 @@ INT_PTR CALLBACK ImportDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_TEXT));
if (length) {
- TCHAR *data = (TCHAR*)mir_alloc((length + 1)*sizeof(TCHAR));
+ wchar_t *data = (wchar_t*)mir_alloc((length + 1)*sizeof(wchar_t));
GetDlgItemText(hwnd, IDC_TEXT, data, length + 1);
importSettings(hContact, T2Utf(data));
mir_free(data);
@@ -463,7 +463,7 @@ void ImportSettingsMenuItem(MCONTACT hContact) CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_IMPORT), hwnd2mainWindow, ImportDlgProc, hContact);
}
-int Openfile2Import(TCHAR *outputFiles, int maxlen)
+int Openfile2Import(wchar_t *outputFiles, int maxlen)
{
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
@@ -486,9 +486,9 @@ BOOL Exists(LPCTSTR strName) void ImportSettingsFromFileMenuItem(MCONTACT hContact, const char *FilePath)
{
- TCHAR szFileNames[MAX_PATH * 10];
- TCHAR szPath[MAX_PATH] = { 0 };
- TCHAR szFile[MAX_PATH];
+ wchar_t szFileNames[MAX_PATH * 10];
+ wchar_t szPath[MAX_PATH] = { 0 };
+ wchar_t szFile[MAX_PATH];
DWORD offset = 0;
diff --git a/plugins/DbEditorPP/src/findwindow.cpp b/plugins/DbEditorPP/src/findwindow.cpp index 0f07fb1934..3769825cd9 100644 --- a/plugins/DbEditorPP/src/findwindow.cpp +++ b/plugins/DbEditorPP/src/findwindow.cpp @@ -37,18 +37,18 @@ static int lastColumn = -1; typedef struct {
HWND hwnd; // hwnd to item list
- TCHAR* search; // text to find
- TCHAR* replace; // text to replace
+ wchar_t* search; // text to find
+ wchar_t* replace; // text to replace
int options; // or'd about items
} FindInfo;
ColumnsSettings csResultList[] = {
- { LPGENT("Result"), 0, "Search0width", 100 },
- { LPGENT("Contact"), 1, "Search1width", 100 },
- { LPGENT("Module"), 2, "Search2width", 100 },
- { LPGENT("Setting"), 3, "Search3width", 100 },
- { LPGENT("Value"), 4, "Search4width", 150 },
+ { LPGENW("Result"), 0, "Search0width", 100 },
+ { LPGENW("Contact"), 1, "Search1width", 100 },
+ { LPGENW("Module"), 2, "Search2width", 100 },
+ { LPGENW("Setting"), 3, "Search3width", 100 },
+ { LPGENW("Value"), 4, "Search4width", 150 },
{0}
};
@@ -95,8 +95,8 @@ INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (GetWindowLongPtr(GetDlgItem(hwnd, IDC_SEARCH), GWLP_USERDATA)) // stop the search
SetWindowLongPtr(GetDlgItem(hwnd, IDC_SEARCH), GWLP_USERDATA, 0);
else {
- TCHAR text[FLD_SIZE];
- TCHAR replace[FLD_SIZE] = {0};
+ wchar_t text[FLD_SIZE];
+ wchar_t replace[FLD_SIZE] = {0};
if (!GetDlgItemText(hwnd, IDC_TEXT, text, _countof(text)) && !IsDlgButtonChecked(hwnd, IDC_EXACT)) break;
@@ -225,10 +225,10 @@ void newFindWindow() { CreateDialog(hInst, MAKEINTRESOURCE(IDD_FIND), hwnd2mainWindow, FindWindowDlgProc);
}
-void ItemFound(HWND hwnd, MCONTACT hContact, const char *module, const char *setting, TCHAR* value, int type)
+void ItemFound(HWND hwnd, MCONTACT hContact, const char *module, const char *setting, wchar_t* value, int type)
{
- TCHAR name[NAME_SIZE];
- TCHAR* mode;
+ wchar_t name[NAME_SIZE];
+ wchar_t* mode;
if (type & F_REPLACED)
mode = TranslateT("Replaced");
@@ -429,7 +429,7 @@ void __cdecl FindSettings(LPVOID param) // check in settings value
if (fi->options & F_SETVAL) {
- TCHAR *value = NULL;
+ wchar_t *value = NULL;
switch(dbv.type) {
@@ -437,7 +437,7 @@ void __cdecl FindSettings(LPVOID param) case DBVT_WORD:
case DBVT_DWORD:
if ((fi->options & F_NUMSRCH) && numsearch == getNumericValue(&dbv)) {
- TCHAR *val = fi->search;
+ wchar_t *val = fi->search;
int flag = F_SETVAL;
if (fi->options & F_NUMREPL) {
@@ -468,7 +468,7 @@ void __cdecl FindSettings(LPVOID param) if (FindMatchT(value, fi->search, fi->options)) {
foundCount++;
ptrT ptr;
- TCHAR *newValue = value;
+ wchar_t *newValue = value;
int flag = F_SETVAL;
if (fi->replace) {
@@ -567,7 +567,7 @@ void __cdecl FindSettings(LPVOID param) } // for(module)
}
- TCHAR msg[MSG_SIZE];
+ wchar_t msg[MSG_SIZE];
mir_sntprintf(msg, TranslateT("Finished. Items found: %d / replaced: %d / deleted: %d"), foundCount, replaceCount, deleteCount);
SendDlgItemMessage(hwndParent, IDC_SBAR, SB_SETTEXT, 0, (LPARAM)msg);
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index b914c6a216..442237c4f6 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -113,7 +113,7 @@ int ModulesLoaded(WPARAM, LPARAM) // Register menu item
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Database"), 1900000001);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Database"), 1900000001);
SET_UID(mi, 0xe298849c, 0x1a8c, 0x4fc7, 0xa0, 0xf4, 0x78, 0x18, 0xf, 0xe2, 0xf7, 0xc9);
mi.position = 1900000001;
@@ -135,7 +135,7 @@ int ModulesLoaded(WPARAM, LPARAM) hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "hk_dbepp_open";
hkd.pszService = "DBEditorpp/MenuCommand";
- hkd.ptszDescription = LPGENT("Open Database Editor");
+ hkd.ptszDescription = LPGENW("Open Database Editor");
hkd.ptszSection = text;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_EXT, 'D');
Hotkey_Register(&hkd);
@@ -265,7 +265,7 @@ int WriteBlobFromString(MCONTACT hContact, const char *szModule, const char *szS return res;
}
-TCHAR *DBVType(BYTE type)
+wchar_t *DBVType(BYTE type)
{
switch (type) {
case DBVT_BYTE: return L"BYTE";
@@ -312,14 +312,14 @@ int setNumericValue(MCONTACT hContact, const char *module, const char *setting, return 0;
}
-int IsRealUnicode(TCHAR *value)
+int IsRealUnicode(wchar_t *value)
{
BOOL nonascii = 0;
WideCharToMultiByte(Langpack_GetDefaultCodePage(), WC_NO_BEST_FIT_CHARS, value, -1, NULL, 0, NULL, &nonascii);
return nonascii;
}
-int setTextValue(MCONTACT hContact, const char *module, const char *setting, TCHAR *value, int type)
+int setTextValue(MCONTACT hContact, const char *module, const char *setting, wchar_t *value, int type)
{
#ifdef _UNICODE
if (type == DBVT_UTF8 || type == DBVT_WCHAR)
@@ -415,7 +415,7 @@ int GetValueW(MCONTACT hContact, const char *module, const char *setting, WCHAR return 0;
}
-int GetContactName(MCONTACT hContact, const char *proto, TCHAR *value, int maxlen)
+int GetContactName(MCONTACT hContact, const char *proto, wchar_t *value, int maxlen)
{
if (!value)
return 0;
@@ -427,7 +427,7 @@ int GetContactName(MCONTACT hContact, const char *proto, TCHAR *value, int maxle char *szProto = (char*)proto;
char tmp[FLD_SIZE];
- TCHAR name[NAME_SIZE]; name[0] = 0;
+ wchar_t name[NAME_SIZE]; name[0] = 0;
if (hContact && (!proto || !proto[0]))
if (!db_get_static(hContact, "Protocol", "p", tmp, _countof(tmp)))
@@ -555,8 +555,8 @@ INT_PTR CALLBACK ColumnsCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam) {
ColumnsSortParams params = *(ColumnsSortParams *)myParam;
const int maxSize = 1024;
- TCHAR text1[maxSize];
- TCHAR text2[maxSize];
+ wchar_t text1[maxSize];
+ wchar_t text2[maxSize];
ListView_GetItemText(params.hList, lParam1, params.column, text1, _countof(text1));
ListView_GetItemText(params.hList, lParam2, params.column, text2, _countof(text2));
diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp index 84248d6a5e..7351297335 100644 --- a/plugins/DbEditorPP/src/main_window.cpp +++ b/plugins/DbEditorPP/src/main_window.cpp @@ -112,7 +112,7 @@ LRESULT CALLBACK ModuleTreeSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR case WM_KEYUP:
if (wParam == VK_DELETE || wParam == VK_F2 || wParam == VK_F5 || wParam == VK_F3) {
TVITEM tvi;
- TCHAR text[FLD_SIZE];
+ wchar_t text[FLD_SIZE];
tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
tvi.hItem = TreeView_GetSelection(hwnd);
tvi.pszText = text;
@@ -129,7 +129,7 @@ LRESULT CALLBACK ModuleTreeSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR }
else if ((mtis->type == CONTACT) && hContact) {
if (db_get_b(NULL, "CList", "ConfirmDelete", 1)) {
- TCHAR str[MSG_SIZE];
+ wchar_t str[MSG_SIZE];
mir_sntprintf(str, TranslateT("Are you sure you want to delete contact \"%s\"?"), text);
if (dlg(str, MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
break;
@@ -193,7 +193,7 @@ static LRESULT CALLBACK SettingListSubclassProc(HWND hwnd, UINT msg, WPARAM wPar INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR text[256];
+ wchar_t text[256];
switch (msg) {
case WM_INITDIALOG:
diff --git a/plugins/DbEditorPP/src/moduletree.cpp b/plugins/DbEditorPP/src/moduletree.cpp index cea9dc8bf1..00fce5eb74 100644 --- a/plugins/DbEditorPP/src/moduletree.cpp +++ b/plugins/DbEditorPP/src/moduletree.cpp @@ -46,7 +46,7 @@ int doContacts(HTREEITEM contactsRoot, ModuleSettingLL *modlist, MCONTACT hSelec tvi.item.cChildren = 1;
char szProto[FLD_SIZE];
- TCHAR name[NAME_SIZE];
+ wchar_t name[NAME_SIZE];
for (MCONTACT hContact = db_find_first(); hContact && hwnd2mainWindow; hContact = db_find_next(hContact)) {
@@ -105,7 +105,7 @@ void doItems(ModuleSettingLL* modlist, int count) {
HWND hwnd = GetParent(hwnd2Tree); //!!!
- TCHAR percent[128], title[96];
+ wchar_t percent[128], title[96];
mir_sntprintf(title, TranslateT("Loading modules..."));
TVITEM item = { 0 };
@@ -152,7 +152,7 @@ HTREEITEM findItemInTree(MCONTACT hContact, const char* module) {
TVITEM item;
HTREEITEM lastItem;
- TCHAR text[FLD_SIZE];
+ wchar_t text[FLD_SIZE];
if (!TreeView_GetCount(hwnd2Tree))
return 0;
@@ -231,7 +231,7 @@ http://www.codeguru.com/Cpp/controls/treeview/treetraversal/comments.php/c683/?t TVITEM item;
HTREEITEM lastItem, prelastItem;
BOOL Result = 0;
- TCHAR text[FLD_SIZE];
+ wchar_t text[FLD_SIZE];
if (!TreeView_GetCount(hwnd2Tree))
return Result;
@@ -325,7 +325,7 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID param) switch ((INT_PTR)param) {
case 1: // restore after rebuild
if (HTREEITEM item = TreeView_GetSelection(hwnd2Tree)) {
- TCHAR text[FLD_SIZE];
+ wchar_t text[FLD_SIZE];
TVITEM tvi = { 0 };
tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
tvi.pszText = text;
@@ -503,7 +503,7 @@ void moduleListWM_NOTIFY(HWND hwnd, UINT, WPARAM wParam, LPARAM lParam)// hwnd h {
LPNMTREEVIEW pnmtv = (LPNMTREEVIEW)lParam;
TVITEM tvi = { 0 };
- TCHAR text[FLD_SIZE];
+ wchar_t text[FLD_SIZE];
MCONTACT hContact;
tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
tvi.hItem = pnmtv->itemNew.hItem;
@@ -584,7 +584,7 @@ void moduleListWM_NOTIFY(HWND hwnd, UINT, WPARAM wParam, LPARAM lParam)// hwnd h case TVN_ENDLABELEDIT:
LPNMTVDISPINFO ptvdi = (LPNMTVDISPINFO)lParam;
TVITEM tvi = { 0 };
- TCHAR text[FLD_SIZE];
+ wchar_t text[FLD_SIZE];
ModuleTreeInfoStruct *mtis;
tvi.mask = TVIF_HANDLE | TVIF_TEXT | TVIF_PARAM;
tvi.hItem = ptvdi->item.hItem;
@@ -626,7 +626,7 @@ void moduleListRightClick(HWND hwnd, WPARAM, LPARAM lParam) // hwnd here is to t TVITEM tvi = { 0 };
HMENU hMenu, hSubMenu;
int menuNumber;
- TCHAR text[FLD_SIZE];
+ wchar_t text[FLD_SIZE];
tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
tvi.hItem = hti.hItem;
@@ -718,7 +718,7 @@ void moduleListRightClick(HWND hwnd, WPARAM, LPARAM lParam) // hwnd here is to t case MENU_DELETE_CONTACT:
if (db_get_b(NULL, "CList", "ConfirmDelete", 1)) {
- TCHAR str[MSG_SIZE];
+ wchar_t str[MSG_SIZE];
mir_sntprintf(str, TranslateT("Are you sure you want to delete contact \"%s\"?"), text);
if (dlg(str, MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
break;
diff --git a/plugins/DbEditorPP/src/renamemodule.cpp b/plugins/DbEditorPP/src/renamemodule.cpp index d2addc9fc3..bb713adadd 100644 --- a/plugins/DbEditorPP/src/renamemodule.cpp +++ b/plugins/DbEditorPP/src/renamemodule.cpp @@ -30,7 +30,7 @@ INT_PTR CALLBACK AddModDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
TranslateDialogDefault(hwnd);
- TCHAR msg[MSG_SIZE], name[NAME_SIZE];
+ wchar_t msg[MSG_SIZE], name[NAME_SIZE];
GetContactName((MCONTACT)lParam, NULL, name, _countof(name));
mir_sntprintf(msg, TranslateT("Add module to \"%s\""), name);
diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp index 863cfc8869..329b363edc 100644 --- a/plugins/DbEditorPP/src/settinglist.cpp +++ b/plugins/DbEditorPP/src/settinglist.cpp @@ -9,11 +9,11 @@ static int lastColumn = -1; struct ColumnsSettings csSettingList[] =
{
- { LPGENT("Name"), 0, "Column0width", 180 },
- { LPGENT("Value"), 1, "Column1width", 250 },
- { LPGENT("Type"), 2, "Column2width", 60 },
- { LPGENT("Size"), 3, "Column3width", 80 },
- { LPGENT("#"), 4, "Column4width", 30 },
+ { LPGENW("Name"), 0, "Column0width", 180 },
+ { LPGENW("Value"), 1, "Column1width", 250 },
+ { LPGENW("Type"), 2, "Column2width", 60 },
+ { LPGENW("Size"), 3, "Column3width", 80 },
+ { LPGENW("#"), 4, "Column4width", 30 },
{ 0 }
};
@@ -49,7 +49,7 @@ int convertSetting(MCONTACT hContact, const char *module, const char *setting, i int res = 0;
DWORD val = 0;
- TCHAR tmp[16];
+ wchar_t tmp[16];
ptrT value;
switch (dbv.type) {
@@ -74,7 +74,7 @@ int convertSetting(MCONTACT hContact, const char *module, const char *setting, i value = mir_a2t(dbv.pszVal);
if (mir_tstrlen(value) < 11)
- val = _tcstoul(value, NULL, NULL);
+ val = wcstoul(value, NULL, NULL);
}
switch (toType) {
@@ -132,7 +132,7 @@ void DeleteSettingsFromList(MCONTACT hContact, const char *module, const char *s if (!count) return;
if (db_get_b(NULL, modname, "WarnOnDelete", 1)) {
- TCHAR text[MSG_SIZE];
+ wchar_t text[MSG_SIZE];
mir_sntprintf(text, TranslateT("Are you sure you want to delete setting(s): %d?"), count);
if (dlg(text, MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
return;
@@ -206,7 +206,7 @@ void updateListItem(int index, const char *setting, DBVARIANT *dbv, int resident return;
}
- TCHAR data[32];
+ wchar_t data[32];
int length;
switch (dbv->type) {
@@ -295,7 +295,7 @@ void updateListItem(int index, const char *setting, DBVARIANT *dbv, int resident void addListHandle(MCONTACT hContact)
{
- TCHAR name[NAME_SIZE], data[32];
+ wchar_t name[NAME_SIZE], data[32];
LVITEM lvi = { 0 };
lvi.mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM;
lvi.lParam = hContact;
@@ -475,7 +475,7 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd, UINT msg, WPARAM return 0;
}
- TCHAR *value = (TCHAR*)mir_alloc(len*sizeof(TCHAR));
+ wchar_t *value = (wchar_t*)mir_alloc(len*sizeof(wchar_t));
GetWindowText(hwnd, value, len);
@@ -508,51 +508,51 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd, UINT msg, WPARAM }
switch (value[0]) {
- case _T('b'):
- case _T('B'):
- val = _tcstoul(&value[1], NULL, 0);
- if (!val || value[1] == _T('0')) {
+ case 'b':
+ case 'B':
+ val = wcstoul(&value[1], NULL, 0);
+ if (!val || value[1] == '0') {
res = !db_set_b(info.hContact, info.module, info.setting, (BYTE)val);
}
else
res = setTextValue(info.hContact, info.module, info.setting, value, dbv.type);
break;
- case _T('w'):
- case _T('W'):
- val = _tcstoul(&value[1], NULL, 0);
- if (!val || value[1] == _T('0'))
+ case 'w':
+ case 'W':
+ val = wcstoul(&value[1], NULL, 0);
+ if (!val || value[1] == '0')
res = !db_set_w(info.hContact, info.module, info.setting, (WORD)val);
else
res = setTextValue(info.hContact, info.module, info.setting, value, dbv.type);
break;
- case _T('d'):
- case _T('D'):
- val = _tcstoul(&value[1], NULL, 0);
- if (!val || value[1] == _T('0'))
+ case 'd':
+ case 'D':
+ val = wcstoul(&value[1], NULL, 0);
+ if (!val || value[1] == '0')
res = !db_set_dw(info.hContact, info.module, info.setting, val);
else
res = setTextValue(info.hContact, info.module, info.setting, value, dbv.type);
break;
- case _T('0'):
+ case '0':
i = 1;
// fall through
- case _T('1'):
- case _T('2'):
- case _T('3'):
- case _T('4'):
- case _T('5'):
- case _T('6'):
- case _T('7'):
- case _T('8'):
- case _T('9'):
- case _T('-'):
- case _T('x'):
- case _T('X'):
- if (value[i] == _T('x') || value[i] == _T('X'))
- val = _tcstoul(&value[i + 1], NULL, 16);
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '-':
+ case 'x':
+ case 'X':
+ if (value[i] == 'x' || value[i] == 'X')
+ val = wcstoul(&value[i + 1], NULL, 16);
else
- val = _tcstoul(value, NULL, 10);
+ val = wcstoul(value, NULL, 10);
switch (dbv.type) {
case DBVT_BYTE:
@@ -567,8 +567,8 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd, UINT msg, WPARAM break;
}
break;
- case _T('\"'):
- case _T('\''):
+ case '\"':
+ case '\'':
{
size_t nlen = mir_tstrlen(value);
int sh = 0;
@@ -638,7 +638,7 @@ void EditLabel(int item, int subitem) if (!subitem)
info.hwnd2Edit = CreateWindow(L"EDIT", _A2T(setting), WS_BORDER | WS_VISIBLE | WS_CHILD | ES_AUTOHSCROLL, rc.left, rc.top, (rc.right - rc.left), (rc.bottom - rc.top), hwnd2List, 0, hInst, 0);
else {
- TCHAR *str = NULL, value[16] = { 0 };
+ wchar_t *str = NULL, value[16] = { 0 };
switch (dbv.type) {
case DBVT_ASCIIZ:
diff --git a/plugins/DbEditorPP/src/settingsdlg.cpp b/plugins/DbEditorPP/src/settingsdlg.cpp index b712386a5b..ed13f64227 100644 --- a/plugins/DbEditorPP/src/settingsdlg.cpp +++ b/plugins/DbEditorPP/src/settingsdlg.cpp @@ -130,7 +130,7 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l TranslateDialogDefault(hwnd);
{
- TCHAR text[MSG_SIZE];
+ wchar_t text[MSG_SIZE];
mir_sntprintf(text, dbsetting->setting?TranslateT("Edit setting (%s)"):TranslateT("New setting (%s)"), DBVType(dbsetting->dbv.type));
SetWindowText(hwnd, text);
}
@@ -157,21 +157,21 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l case CHK_DECIMAL:
CheckRadioButton(hwnd, CHK_HEX, CHK_DECIMAL, LOWORD(wParam));
{
- TCHAR *setting, text[32];
+ wchar_t *setting, text[32];
int settingLength, tmp;
settingLength = GetWindowTextLength(GetDlgItem(hwnd, IDC_SETTINGVALUE));
if (settingLength)
{
- setting = (TCHAR*)mir_alloc((settingLength+1)*sizeof(TCHAR));
+ setting = (wchar_t*)mir_alloc((settingLength+1)*sizeof(wchar_t));
GetDlgItemText(hwnd, IDC_SETTINGVALUE, setting, settingLength + 1);
if (LOWORD(wParam) == CHK_DECIMAL && IsDlgButtonChecked(hwnd, CHK_DECIMAL))
{
- _stscanf(setting, L"%X", &tmp);
+ swscanf(setting, L"%X", &tmp);
mir_sntprintf(text, L"%u", tmp);
}
else
{
- _stscanf(setting, L"%u", &tmp);
+ swscanf(setting, L"%u", &tmp);
mir_sntprintf(text, L"%X", tmp);
}
SetDlgItemText(hwnd, IDC_SETTINGVALUE, text);
@@ -188,7 +188,7 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l {
struct DBsetting *dbsetting = (struct DBsetting*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- TCHAR settingname[FLD_SIZE];
+ wchar_t settingname[FLD_SIZE];
GetDlgItemText(hwnd, IDC_SETTINGNAME, settingname, _countof(settingname));
if (settingname[0])
@@ -221,7 +221,7 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l break;
int len = GetWindowTextLength(GetDlgItem(hwnd, valueID))+1;
- TCHAR *value = (TCHAR*)mir_alloc(len*sizeof(TCHAR));
+ wchar_t *value = (wchar_t*)mir_alloc(len*sizeof(wchar_t));
GetDlgItemText(hwnd, valueID, value, len);
_T2A setting(settingname);
@@ -235,7 +235,7 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l case DBVT_BYTE:
case DBVT_WORD:
case DBVT_DWORD:
- res = setNumericValue(dbsetting->hContact, dbsetting->module, setting, _tcstoul(value, NULL, IsDlgButtonChecked(hwnd, CHK_HEX)? 16 : 10), type);
+ res = setNumericValue(dbsetting->hContact, dbsetting->module, setting, wcstoul(value, NULL, IsDlgButtonChecked(hwnd, CHK_HEX)? 16 : 10), type);
break;
case DBVT_ASCIIZ:
case DBVT_UTF8:
diff --git a/plugins/DbEditorPP/src/stdafx.h b/plugins/DbEditorPP/src/stdafx.h index 8533d5942c..f573d1739c 100644 --- a/plugins/DbEditorPP/src/stdafx.h +++ b/plugins/DbEditorPP/src/stdafx.h @@ -4,8 +4,6 @@ // Includes
//=====================================================
-#include <tchar.h>
-
#include <Windows.h>
#include <commctrl.h>
#include <stdio.h>
@@ -134,7 +132,7 @@ struct ModuleSettingLL };
struct ColumnsSettings {
- TCHAR *name;
+ wchar_t *name;
int index;
char *dbname;
int defsize;
@@ -203,14 +201,14 @@ extern bool g_bUsePopups; //main
char *StringFromBlob(BYTE *blob, WORD len);
int WriteBlobFromString(MCONTACT hContact, const char *module, const char *setting, const char *value, int len);
-TCHAR *DBVType(BYTE type);
+wchar_t *DBVType(BYTE type);
DWORD getNumericValue(DBVARIANT *dbv);
int setNumericValue(MCONTACT hContact, const char *module, const char *setting, DWORD value, int type);
-int IsRealUnicode(TCHAR *value);
-int setTextValue(MCONTACT hContact, const char *module, const char *setting, TCHAR *value, int type);
+int IsRealUnicode(wchar_t *value);
+int setTextValue(MCONTACT hContact, const char *module, const char *setting, wchar_t *value, int type);
int GetValueA(MCONTACT hContact, const char *module, const char *setting, char *value, int length);
int GetValueW(MCONTACT hContact, const char *module, const char *setting, WCHAR *value, int length);
-int GetContactName(MCONTACT hContact, const char *proto, TCHAR *value, int maxlen);
+int GetContactName(MCONTACT hContact, const char *proto, wchar_t *value, int maxlen);
int ApplyProtoFilter(MCONTACT hContact);
void loadListSettings(HWND hwnd, ColumnsSettings *cs);
void saveListSettings(HWND hwnd, ColumnsSettings *cs);
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp index a5ca3e7c0e..3c8ce19c50 100644 --- a/plugins/DbEditorPP/src/watchedvars.cpp +++ b/plugins/DbEditorPP/src/watchedvars.cpp @@ -7,11 +7,11 @@ static WatchListArrayStruct WatchListArray = {0}; static int lastColumn = -1;
ColumnsSettings csWatchList[] = {
- { LPGENT("Contact"), 0, "Watch0width", 100 },
- { LPGENT("Module"), 1, "Watch1width", 100 },
- { LPGENT("Setting"), 2, "Watch2width", 100 },
- { LPGENT("Value"), 3, "Watch3width", 200 },
- { LPGENT("Type"), 4, "Watch4width", 75 },
+ { LPGENW("Contact"), 0, "Watch0width", 100 },
+ { LPGENW("Module"), 1, "Watch1width", 100 },
+ { LPGENW("Setting"), 2, "Watch2width", 100 },
+ { LPGENW("Value"), 3, "Watch3width", 200 },
+ { LPGENW("Type"), 4, "Watch4width", 75 },
{0}
};
@@ -109,7 +109,7 @@ void addwatchtolist(HWND hwnd, struct DBsetting *lParam) if (db_get_s(lParam->hContact, lParam->module, lParam->setting, &(lParam->dbv), 0))
return;
- TCHAR data[32], tmp[16], name[NAME_SIZE];
+ wchar_t data[32], tmp[16], name[NAME_SIZE];
GetContactName(lParam->hContact, NULL, name, _countof(name));
lvItem.pszText = name;
@@ -352,7 +352,7 @@ void popupWatchedVar(MCONTACT hContact, const char *module, const char *setting) COLORREF colorText = db_get_dw(NULL, modname, "PopupTextColour", RGB(0, 0, 0));
int timeout = db_get_b(NULL, modname, "PopupDelay", 3);
- TCHAR name[NAME_SIZE], text[MAX_SECONDLINE], value[MAX_SECONDLINE];
+ wchar_t name[NAME_SIZE], text[MAX_SECONDLINE], value[MAX_SECONDLINE];
GetContactName(hContact, NULL, name, _countof(name));
// 2nd line
diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp index 53a2dad93a..82d06ad4bb 100644 --- a/plugins/Db_autobackups/src/backup.cpp +++ b/plugins/Db_autobackups/src/backup.cpp @@ -9,7 +9,7 @@ LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) switch (msg) {
case WM_COMMAND:
{
- TCHAR* ptszPath = (TCHAR*)PUGetPluginData(hWnd);
+ wchar_t* ptszPath = (wchar_t*)PUGetPluginData(hWnd);
if (ptszPath != 0)
ShellExecute(0, L"open", ptszPath, NULL, NULL, SW_SHOW);
@@ -25,12 +25,12 @@ LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) }
return DefWindowProc(hWnd, msg, wParam, lParam);
}
-void ShowPopup(TCHAR* ptszText, TCHAR* ptszHeader, TCHAR* ptszPath)
+void ShowPopup(wchar_t* ptszText, wchar_t* ptszHeader, wchar_t* ptszPath)
{
POPUPDATAT ppd = { 0 };
- _tcsncpy_s(ppd.lptzText, ptszText, _TRUNCATE);
- _tcsncpy_s(ppd.lptzContactName, ptszHeader, _TRUNCATE);
+ wcsncpy_s(ppd.lptzText, ptszText, _TRUNCATE);
+ wcsncpy_s(ppd.lptzContactName, ptszHeader, _TRUNCATE);
if (ptszPath != NULL)
ppd.PluginData = (void*)mir_tstrdup(ptszPath);
ppd.PluginWindowProc = DlgProcPopup;
@@ -57,20 +57,20 @@ INT_PTR CALLBACK DlgProcProgress(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM) return FALSE;
}
-TCHAR* DoubleSlash(TCHAR *sorce)
+wchar_t* DoubleSlash(wchar_t *sorce)
{
- TCHAR *ret, *r, *s;
+ wchar_t *ret, *r, *s;
- ret = (TCHAR*)mir_alloc((MAX_PATH * sizeof(TCHAR)));
+ ret = (wchar_t*)mir_alloc((MAX_PATH * sizeof(wchar_t)));
if (ret == NULL)
return NULL;
for (s = sorce, r = ret; *s && (r - ret) < (MAX_PATH - 1); s++, r++) {
- if (*s != _T('\\'))
+ if (*s != '\\')
*r = *s;
else {
- *r = _T('\\');
+ *r = '\\';
r++;
- *r = _T('\\');
+ *r = '\\';
}
}
r[0] = 0;
@@ -107,7 +107,7 @@ bool MakeZip_Dir(LPCSTR szDir, LPCTSTR szDest, LPCSTR /* szDbName */, HWND progr return 1;
}
-bool MakeZip(TCHAR *tszSource, TCHAR *tszDest, TCHAR *dbname, HWND progress_dialog)
+bool MakeZip(wchar_t *tszSource, wchar_t *tszDest, wchar_t *dbname, HWND progress_dialog)
{
HWND hProgBar = GetDlgItem(progress_dialog, IDC_PROGRESS);
@@ -124,7 +124,7 @@ bool MakeZip(TCHAR *tszSource, TCHAR *tszDest, TCHAR *dbname, HWND progress_dial struct backupFile
{
- TCHAR Name[MAX_PATH];
+ wchar_t Name[MAX_PATH];
FILETIME CreationTime;
};
@@ -140,11 +140,11 @@ int Comp(const void *i, const void *j) return 1;
}
-int RotateBackups(TCHAR *backupfolder, TCHAR *dbname)
+int RotateBackups(wchar_t *backupfolder, wchar_t *dbname)
{
backupFile *bf = NULL, *bftmp;
HANDLE hFind;
- TCHAR backupfolderTmp[MAX_PATH];
+ wchar_t backupfolderTmp[MAX_PATH];
WIN32_FIND_DATA FindFileData;
if (options.num_backups == 0)
@@ -162,7 +162,7 @@ int RotateBackups(TCHAR *backupfolder, TCHAR *dbname) if (bftmp == NULL)
goto err_out;
bf = bftmp;
- _tcsncpy_s(bf[i].Name, FindFileData.cFileName, _TRUNCATE);
+ wcsncpy_s(bf[i].Name, FindFileData.cFileName, _TRUNCATE);
bf[i].CreationTime = FindFileData.ftCreationTime;
i ++;
} while (FindNextFile(hFind, &FindFileData));
@@ -179,10 +179,10 @@ err_out: }
-int Backup(TCHAR *backup_filename)
+int Backup(wchar_t *backup_filename)
{
bool bZip = false;
- TCHAR dbname[MAX_PATH], source_file[MAX_PATH] = { 0 }, dest_file[MAX_PATH];
+ wchar_t dbname[MAX_PATH], source_file[MAX_PATH] = { 0 }, dest_file[MAX_PATH];
HWND progress_dialog = NULL;
SYSTEMTIME st;
@@ -190,7 +190,7 @@ int Backup(TCHAR *backup_filename) if (backup_filename == NULL) {
int err;
- TCHAR *backupfolder, buffer[MAX_COMPUTERNAME_LENGTH + 1];
+ wchar_t *backupfolder, buffer[MAX_COMPUTERNAME_LENGTH + 1];
DWORD size = _countof(buffer);
bZip = options.use_zip != 0;
@@ -209,8 +209,8 @@ int Backup(TCHAR *backup_filename) mir_free(backupfolder);
}
else {
- _tcsncpy_s(dest_file, backup_filename, _TRUNCATE);
- if (!mir_tstrcmp(_tcsrchr(backup_filename, _T('.')), L".zip"))
+ wcsncpy_s(dest_file, backup_filename, _TRUNCATE);
+ if (!mir_tstrcmp(wcsrchr(backup_filename, '.'), L".zip"))
bZip = true;
}
if (!options.disable_popups)
@@ -222,7 +222,7 @@ int Backup(TCHAR *backup_filename) SetDlgItemText(progress_dialog, IDC_PROGRESSMESSAGE, TranslateT("Copying database file..."));
mir_sntprintf(source_file, L"%s\\%s", profilePath, dbname);
- TCHAR *pathtmp = Utils_ReplaceVarsT(source_file);
+ wchar_t *pathtmp = Utils_ReplaceVarsT(source_file);
BOOL res = 0;
if (bZip)
{
@@ -254,14 +254,14 @@ int Backup(TCHAR *backup_filename) if (!options.disable_popups) {
size_t dest_file_len = mir_tstrlen(dest_file);
- TCHAR *puText;
+ wchar_t *puText;
if (dest_file_len > 50) {
size_t i;
- puText = (TCHAR*)mir_alloc(sizeof(TCHAR) * (dest_file_len + 2));
- for (i = (dest_file_len - 1); dest_file[i] != _T('\\'); i--)
+ puText = (wchar_t*)mir_alloc(sizeof(wchar_t) * (dest_file_len + 2));
+ for (i = (dest_file_len - 1); dest_file[i] != '\\'; i--)
;
- //_tcsncpy_s(dest_file, backup_filename, _TRUNCATE);
+ //wcsncpy_s(dest_file, backup_filename, _TRUNCATE);
mir_tstrncpy(puText, dest_file, (i + 2));
mir_tstrcat(puText, L"\n");
mir_tstrcat(puText, (dest_file + i + 1));
@@ -287,14 +287,14 @@ int Backup(TCHAR *backup_filename) void BackupThread(void *backup_filename)
{
- Backup((TCHAR*)backup_filename);
+ Backup((wchar_t*)backup_filename);
InterlockedExchange(&m_state, 0); /* Backup done. */
mir_free(backup_filename);
}
-void BackupStart(TCHAR *backup_filename)
+void BackupStart(wchar_t *backup_filename)
{
- TCHAR *tm = NULL;
+ wchar_t *tm = NULL;
LONG cur_state;
cur_state = InterlockedCompareExchange(&m_state, 1, 0);
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp index ea26811a07..52cc10aa91 100644 --- a/plugins/Db_autobackups/src/main.cpp +++ b/plugins/Db_autobackups/src/main.cpp @@ -2,7 +2,7 @@ int hLangpack;
HINSTANCE g_hInstance;
-TCHAR *profilePath;
+wchar_t *profilePath;
HANDLE hFolder;
char g_szMirVer[100];
@@ -34,7 +34,7 @@ static INT_PTR ABService(WPARAM, LPARAM) static INT_PTR DBSaveAs(WPARAM, LPARAM)
{
- TCHAR fname_buff[MAX_PATH], tszFilter[200];
+ wchar_t fname_buff[MAX_PATH], tszFilter[200];
OPENFILENAME ofn = { 0 };
CallService(MS_DB_GETPROFILENAMET, _countof(fname_buff), (LPARAM)fname_buff);
@@ -65,7 +65,7 @@ static int FoldersGetBackupPath(WPARAM, LPARAM) static int ModulesLoad(WPARAM, LPARAM)
{
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Database"), 500100000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Database"), 500100000);
SET_UID(mi, 0x1439b1db, 0x7d95, 0x495b, 0xbf, 0x5, 0x3d, 0x21, 0xc1, 0xeb, 0xf7, 0x58);
mi.name.a = LPGEN("Backup profile");
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp index 7c7aacf482..046f777fd9 100644 --- a/plugins/Db_autobackups/src/options.cpp +++ b/plugins/Db_autobackups/src/options.cpp @@ -43,10 +43,10 @@ int LoadOptions(void) DBVARIANT dbv;
if (!db_get_ts(0, "AutoBackups", "Folder", &dbv)) {
- TCHAR *tmp = Utils_ReplaceVarsT(dbv.ptszVal);
+ wchar_t *tmp = Utils_ReplaceVarsT(dbv.ptszVal);
if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':')
- _tcsncpy_s(options.folder, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(options.folder, dbv.ptszVal, _TRUNCATE);
else
mir_sntprintf(options.folder, L"%s\\%s", profilePath, dbv.ptszVal);
@@ -69,7 +69,7 @@ int LoadOptions(void) int SaveOptions(void)
{
- TCHAR prof_dir[MAX_PATH];
+ wchar_t prof_dir[MAX_PATH];
db_set_b(0, "AutoBackups", "BackupType", (BYTE)options.backup_types);
if (options.period < 1)
@@ -81,15 +81,15 @@ int SaveOptions(void) size_t prof_len = mir_tstrlen(prof_dir);
size_t opt_len = mir_tstrlen(options.folder);
- if (opt_len > prof_len && _tcsncmp(options.folder, prof_dir, prof_len) == 0) {
+ if (opt_len > prof_len && wcsncmp(options.folder, prof_dir, prof_len) == 0) {
db_set_ts(0, "AutoBackups", "Folder", (options.folder + prof_len));
}
else
db_set_ts(0, "AutoBackups", "Folder", options.folder);
- TCHAR *tmp = Utils_ReplaceVarsT(options.folder);
+ wchar_t *tmp = Utils_ReplaceVarsT(options.folder);
if (mir_tstrlen(tmp) < 2 || tmp[1] != ':') {
- _tcsncpy_s(prof_dir, options.folder, _TRUNCATE);
+ wcsncpy_s(prof_dir, options.folder, _TRUNCATE);
mir_sntprintf(options.folder, L"%s\\%s", profilePath, prof_dir);
}
mir_free(tmp);
@@ -108,7 +108,7 @@ Options new_options; int SetDlgState(HWND hwndDlg)
{
- TCHAR buff[10];
+ wchar_t buff[10];
if (new_options.backup_types == BT_DISABLED) {
CheckDlgButton(hwndDlg, IDC_RAD_DISABLED, BST_CHECKED);
@@ -148,10 +148,10 @@ int SetDlgState(HWND hwndDlg) }
SendDlgItemMessage(hwndDlg, SPIN_PERIOD, UDM_SETRANGE32, 1, (LPARAM)60);
- SetDlgItemText(hwndDlg, IDC_ED_PERIOD, _itot(new_options.period, buff, 10));
+ SetDlgItemText(hwndDlg, IDC_ED_PERIOD, _itow(new_options.period, buff, 10));
SendDlgItemMessage(hwndDlg, SPIN_NUMBACKUPS, UDM_SETRANGE32, 1, (LPARAM)100);
- SetDlgItemText(hwndDlg, IDC_ED_NUMBACKUPS, _itot(new_options.num_backups, buff, 10));
+ SetDlgItemText(hwndDlg, IDC_ED_NUMBACKUPS, _itow(new_options.num_backups, buff, 10));
SetDlgItemText(hwndDlg, IDC_ED_FOLDER, new_options.folder);
@@ -171,7 +171,7 @@ int CALLBACK BrowseProc(HWND hwnd, UINT uMsg, LPARAM, LPARAM) switch (uMsg)
{
case BFFM_INITIALIZED:
- TCHAR *folder = Utils_ReplaceVarsT(options.folder);
+ wchar_t *folder = Utils_ReplaceVarsT(options.folder);
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)folder);
mir_free(folder);
break;
@@ -181,7 +181,7 @@ int CALLBACK BrowseProc(HWND hwnd, UINT uMsg, LPARAM, LPARAM) INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR folder_buff[MAX_PATH] = { 0 };
+ wchar_t folder_buff[MAX_PATH] = { 0 };
switch (msg) {
case WM_INITDIALOG:
@@ -194,7 +194,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ShowWindow(GetDlgItem(hwndDlg, IDC_LNK_FOLDERS), SW_SHOW);
}
else {
- TCHAR tszTooltipText[4096];
+ wchar_t tszTooltipText[4096];
mir_sntprintf(tszTooltipText, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
L"%miranda_path%", TranslateT("path to Miranda root folder"),
L"%miranda_profilesdir%", TranslateT("path to folder containing Miranda profiles"),
@@ -341,11 +341,11 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- TCHAR buff[10];
+ wchar_t buff[10];
GetDlgItemText(hwndDlg, IDC_ED_PERIOD, buff, _countof(buff));
- new_options.period = _ttoi(buff);
+ new_options.period = _wtoi(buff);
GetDlgItemText(hwndDlg, IDC_ED_NUMBACKUPS, buff, _countof(buff));
- new_options.num_backups = _ttoi(buff);
+ new_options.num_backups = _wtoi(buff);
switch (SendDlgItemMessage(hwndDlg, IDC_PT, CB_GETCURSEL, 0, 0)) {
case 0: new_options.period_type = PT_DAYS; break;
@@ -355,26 +355,26 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP GetDlgItemText(hwndDlg, IDC_ED_FOLDER, folder_buff, _countof(folder_buff));
{
- TCHAR backupfolder[MAX_PATH] = { 0 };
+ wchar_t backupfolder[MAX_PATH] = { 0 };
BOOL folder_ok = TRUE;
- TCHAR *tmp = Utils_ReplaceVarsT(folder_buff);
+ wchar_t *tmp = Utils_ReplaceVarsT(folder_buff);
if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':')
- _tcsncpy_s(backupfolder, tmp, _TRUNCATE);
+ wcsncpy_s(backupfolder, tmp, _TRUNCATE);
else
mir_sntprintf(backupfolder, L"%s\\%s", profilePath, tmp);
mir_free(tmp);
int err = CreateDirectoryTreeT(backupfolder);
if (err != ERROR_ALREADY_EXISTS && err != 0) {
- TCHAR msg_buff[512];
+ wchar_t msg_buff[512];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, err, 0, msg_buff, 512, 0);
MessageBox(0, msg_buff, TranslateT("Error creating backup folder"), MB_OK | MB_ICONERROR);
folder_ok = FALSE;
}
if (folder_ok) {
- _tcsncpy_s(new_options.folder, folder_buff, _TRUNCATE);
+ wcsncpy_s(new_options.folder, folder_buff, _TRUNCATE);
memcpy(&options, &new_options, sizeof(Options));
SaveOptions();
}
diff --git a/plugins/Db_autobackups/src/options.h b/plugins/Db_autobackups/src/options.h index 991c109285..8cd2b4f1b2 100644 --- a/plugins/Db_autobackups/src/options.h +++ b/plugins/Db_autobackups/src/options.h @@ -29,7 +29,7 @@ typedef struct Options_tag { int backup_types;
unsigned int period;
PeriodType period_type;
- TCHAR folder[MAX_PATH];
+ wchar_t folder[MAX_PATH];
int num_backups;
BOOL disable_progress;
BOOL disable_popups;
diff --git a/plugins/Db_autobackups/src/stdafx.h b/plugins/Db_autobackups/src/stdafx.h index e7f2d81b1d..55ed621497 100644 --- a/plugins/Db_autobackups/src/stdafx.h +++ b/plugins/Db_autobackups/src/stdafx.h @@ -39,7 +39,7 @@ int SetBackupTimer(void);
int OptionsInit(WPARAM wParam, LPARAM lParam);
int LoadOptions(void);
-void BackupStart(TCHAR *backup_filename);
+void BackupStart(wchar_t *backup_filename);
struct ZipFile
{
@@ -51,7 +51,7 @@ struct ZipFile int CreateZipFile(const char *szDestPath, OBJLIST<ZipFile> &lstFiles, const std::function<bool(size_t)> &fnCallback);
extern HINSTANCE g_hInstance;
-extern TCHAR *profilePath;
+extern wchar_t *profilePath;
extern char g_szMirVer[];
static IconItem iconList[] = {
diff --git a/plugins/Dbx_mdb/src/dbintf.cpp b/plugins/Dbx_mdb/src/dbintf.cpp index 2ff199717e..35e93d8fba 100644 --- a/plugins/Dbx_mdb/src/dbintf.cpp +++ b/plugins/Dbx_mdb/src/dbintf.cpp @@ -175,7 +175,7 @@ int CDbxMdb::Check(void) if (pFile == nullptr)
return EGROKPRF_CANTREAD;
- fseek(pFile, iDefHeaderOffset, SEEK_SET);
+ fseek(pFile, (LONG)iDefHeaderOffset, SEEK_SET);
BYTE buf[_countof(bDefHeader)];
if (fread(buf, 1, _countof(buf), pFile) != _countof(buf))
return EGROKPRF_DAMAGED;
@@ -217,7 +217,7 @@ bool CDbxMdb::Remap() static DWORD DatabaseCorrupted = 0;
static const TCHAR *msg = NULL;
static DWORD dwErr = 0;
-static TCHAR tszPanic[] = LPGENT("Miranda has detected corruption in your database. This corruption may be fixed by DbChecker plugin. Please download it from http://miranda-ng.org/p/DbChecker/. Miranda will now shut down.");
+static wchar_t tszPanic[] = LPGENW("Miranda has detected corruption in your database. This corruption may be fixed by DbChecker plugin. Please download it from http://miranda-ng.org/p/DbChecker/. Miranda will now shut down.");
EXTERN_C void __cdecl dbpanic(void *)
{
diff --git a/plugins/Dbx_mdb/src/ui.cpp b/plugins/Dbx_mdb/src/ui.cpp index 003b068a48..3c12bf6dd6 100644 --- a/plugins/Dbx_mdb/src/ui.cpp +++ b/plugins/Dbx_mdb/src/ui.cpp @@ -182,7 +182,7 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM) CMenuItem mi;
// main menu item
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Database"), 500000000, iconList[0].hIcolib);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Database"), 500000000, iconList[0].hIcolib);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "F7C5567C-D1EE-484B-B4F6-24677A5AAAEF");
SET_UID(mi, 0x50321866, 0xba1, 0x46dd, 0xb3, 0xa6, 0xc3, 0xcc, 0x55, 0xf2, 0x42, 0x9e);
diff --git a/plugins/Dropbox/src/dropbox.cpp b/plugins/Dropbox/src/dropbox.cpp index f7b4b62731..4a6faac5b1 100644 --- a/plugins/Dropbox/src/dropbox.cpp +++ b/plugins/Dropbox/src/dropbox.cpp @@ -167,7 +167,7 @@ UINT CDropbox::RequestAccessTokenAsync(void *owner, void *param) if (hwndDlg)
SetDlgItemText(hwndDlg, IDC_AUTH_STATUS, TranslateT("server does not respond"));
/*else
- ShowNotification((TCHAR*)error_description, MB_ICONERROR);*/
+ ShowNotification((wchar_t*)error_description, MB_ICONERROR);*/
return 0;
}
@@ -178,7 +178,7 @@ UINT CDropbox::RequestAccessTokenAsync(void *owner, void *param) if (hwndDlg)
SetDlgItemText(hwndDlg, IDC_AUTH_STATUS, error_description);
/*else
- ShowNotification((TCHAR*)error_description, MB_ICONERROR);*/
+ ShowNotification((wchar_t*)error_description, MB_ICONERROR);*/
return 0;
}
diff --git a/plugins/Dropbox/src/dropbox.h b/plugins/Dropbox/src/dropbox.h index 1b2272729d..5c1efa5d08 100644 --- a/plugins/Dropbox/src/dropbox.h +++ b/plugins/Dropbox/src/dropbox.h @@ -109,7 +109,7 @@ private: // utils
static char* PreparePath(const char *oldPath, char *newPath);
- static char* PreparePath(const TCHAR *oldPath, char *newPath);
+ static char* PreparePath(const wchar_t *oldPath, char *newPath);
static bool IsAccountIntercepted(const char *module);
@@ -118,10 +118,10 @@ private: static MEVENT AddEventToDb(MCONTACT hContact, WORD type, DWORD flags, DWORD cbBlob, PBYTE pBlob);
- void SendToContact(MCONTACT hContact, const TCHAR *data);
- void PasteToInputArea(MCONTACT hContact, const TCHAR *data);
- void PasteToClipboard(const TCHAR *data);
- void Report(MCONTACT hContact, const TCHAR *data);
+ void SendToContact(MCONTACT hContact, const wchar_t *data);
+ void PasteToInputArea(MCONTACT hContact, const wchar_t *data);
+ void PasteToClipboard(const wchar_t *data);
+ void Report(MCONTACT hContact, const wchar_t *data);
template<int(CDropbox::*Event)(WPARAM, LPARAM)>
static int GlobalEvent(void *obj, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/Dropbox/src/dropbox_options.cpp b/plugins/Dropbox/src/dropbox_options.cpp index 9f7bd0221b..f5ff7516fd 100644 --- a/plugins/Dropbox/src/dropbox_options.cpp +++ b/plugins/Dropbox/src/dropbox_options.cpp @@ -152,15 +152,15 @@ void CDropboxOptionsInterception::OnApply() int CDropbox::OnOptionsInitialized(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.ptszTitle = _T(MODULE);
+ odp.pwszTitle = MODULEW;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszGroup = LPGENW("Network");
- odp.ptszTab = LPGENT("General");
+ odp.pwszTab = LPGENW("General");
odp.pDialog = CDropboxOptionsMain::CreateOptionsPage(this);
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Interception");
+ odp.pwszTab = LPGENW("Interception");
odp.pDialog = CDropboxOptionsInterception::CreateOptionsPage(this);
Options_AddPage(wParam, &odp);
diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp index dbe8602112..6896398ced 100644 --- a/plugins/Dropbox/src/dropbox_services.cpp +++ b/plugins/Dropbox/src/dropbox_services.cpp @@ -45,11 +45,11 @@ INT_PTR CDropbox::ProtoSendFile(WPARAM, LPARAM lParam) FileTransferParam *ftp = new FileTransferParam(pccsd->hContact);
- const TCHAR *description = (TCHAR*)pccsd->wParam;
+ const wchar_t *description = (wchar_t*)pccsd->wParam;
if (description && description[0])
- ftp->AppendFormatData(L"%s\r\n", (TCHAR*)pccsd->wParam);
+ ftp->AppendFormatData(L"%s\r\n", (wchar_t*)pccsd->wParam);
- TCHAR **paths = (TCHAR**)pccsd->lParam;
+ wchar_t **paths = (wchar_t**)pccsd->lParam;
ftp->SetWorkingDirectory(paths[0]);
for (int i = 0; paths[i]; i++) {
if (PathIsDirectory(paths[i]))
diff --git a/plugins/Dropbox/src/dropbox_transfers.cpp b/plugins/Dropbox/src/dropbox_transfers.cpp index c41bcdf290..33d9ed8613 100644 --- a/plugins/Dropbox/src/dropbox_transfers.cpp +++ b/plugins/Dropbox/src/dropbox_transfers.cpp @@ -96,7 +96,7 @@ UINT CDropbox::UploadToDropbox(void *owner, void *arg) FileTransferParam *ftp = (FileTransferParam*)arg;
try {
- const TCHAR *folderName = ftp->GetFolderName();
+ const wchar_t *folderName = ftp->GetFolderName();
if (folderName) {
char path[MAX_PATH], url[MAX_PATH];
PreparePath(folderName, path);
@@ -108,7 +108,7 @@ UINT CDropbox::UploadToDropbox(void *owner, void *arg) ftp->FirstFile();
do
{
- const TCHAR *fileName = ftp->GetCurrentRelativeFilePath();
+ const wchar_t *fileName = ftp->GetCurrentRelativeFilePath();
uint64_t fileSize = ftp->GetCurrentFileSize();
int chunkSize = ftp->GetCurrentFileChunkSize();
@@ -139,9 +139,9 @@ UINT CDropbox::UploadToDropbox(void *owner, void *arg) size = 0;
char path[MAX_PATH];
- const TCHAR *serverFolder = ftp->GetServerFolder();
+ const wchar_t *serverFolder = ftp->GetServerFolder();
if (serverFolder) {
- TCHAR serverPath[MAX_PATH] = { 0 };
+ wchar_t serverPath[MAX_PATH] = { 0 };
mir_sntprintf(serverPath, L"%s\\%s", serverFolder, fileName);
PreparePath(serverPath, path);
}
@@ -151,7 +151,7 @@ UINT CDropbox::UploadToDropbox(void *owner, void *arg) ftp->Progress(size);
- if (!_tcschr(fileName, L'\\')) {
+ if (!wcschr(fileName, L'\\')) {
char url[MAX_PATH];
instance->CreateDownloadUrl(path, url);
ftp->AppendFormatData(L"%s\r\n", ptrT(mir_utf8decodeT(url)));
diff --git a/plugins/Dropbox/src/dropbox_utils.cpp b/plugins/Dropbox/src/dropbox_utils.cpp index 67994b6e1b..28bf244984 100644 --- a/plugins/Dropbox/src/dropbox_utils.cpp +++ b/plugins/Dropbox/src/dropbox_utils.cpp @@ -16,7 +16,7 @@ char* CDropbox::PreparePath(const char *oldPath, char *newPath) return newPath;
}
-char* CDropbox::PreparePath(const TCHAR *oldPath, char *newPath)
+char* CDropbox::PreparePath(const wchar_t *oldPath, char *newPath)
{
return PreparePath(ptrA(mir_utf8encodeW(oldPath)), newPath);
}
@@ -95,7 +95,7 @@ MEVENT CDropbox::AddEventToDb(MCONTACT hContact, WORD type, DWORD flags, DWORD c return db_event_add(hContact, &dbei);
}
-void CDropbox::SendToContact(MCONTACT hContact, const TCHAR *data)
+void CDropbox::SendToContact(MCONTACT hContact, const wchar_t *data)
{
if (hContact == GetDefaultContact()) {
char *message = mir_utf8encodeT(data);
@@ -122,7 +122,7 @@ void CDropbox::SendToContact(MCONTACT hContact, const TCHAR *data) AddEventToDb(hContact, EVENTTYPE_MESSAGE, DBEF_UTF | DBEF_SENT, (DWORD)mir_strlen(message), (PBYTE)message);
}
-void CDropbox::PasteToInputArea(MCONTACT hContact, const TCHAR *data)
+void CDropbox::PasteToInputArea(MCONTACT hContact, const wchar_t *data)
{
MessageWindowInputData mwid = { sizeof(MessageWindowInputData) };
mwid.hContact = hContact;
@@ -137,17 +137,17 @@ void CDropbox::PasteToInputArea(MCONTACT hContact, const TCHAR *data) }
}
-void CDropbox::PasteToClipboard(const TCHAR *data)
+void CDropbox::PasteToClipboard(const wchar_t *data)
{
if (OpenClipboard(NULL)) {
EmptyClipboard();
- size_t size = sizeof(TCHAR) * (mir_tstrlen(data) + 1);
+ size_t size = sizeof(wchar_t) * (mir_tstrlen(data) + 1);
HGLOBAL hClipboardData = GlobalAlloc(NULL, size);
if (hClipboardData) {
- TCHAR *pchData = (TCHAR*)GlobalLock(hClipboardData);
+ wchar_t *pchData = (wchar_t*)GlobalLock(hClipboardData);
if (pchData) {
- memcpy(pchData, (TCHAR*)data, size);
+ memcpy(pchData, (wchar_t*)data, size);
GlobalUnlock(hClipboardData);
SetClipboardData(CF_UNICODETEXT, hClipboardData);
}
@@ -156,7 +156,7 @@ void CDropbox::PasteToClipboard(const TCHAR *data) }
}
-void CDropbox::Report(MCONTACT hContact, const TCHAR *data)
+void CDropbox::Report(MCONTACT hContact, const wchar_t *data)
{
if (db_get_b(NULL, MODULE, "UrlAutoSend", 1))
SendToContact(hContact, data);
diff --git a/plugins/Dropbox/src/file_transfer.h b/plugins/Dropbox/src/file_transfer.h index 0800903627..6feacbb445 100644 --- a/plugins/Dropbox/src/file_transfer.h +++ b/plugins/Dropbox/src/file_transfer.h @@ -12,7 +12,7 @@ private: bool isTerminated;
- const TCHAR* folderName;
+ const wchar_t* folderName;
int relativePathStart;
CMString serverFolder;
@@ -40,7 +40,7 @@ public: pfts.totalBytes = 0;
pfts.totalFiles = 0;
pfts.totalProgress = 0;
- pfts.ptszFiles = (TCHAR**)mir_alloc(sizeof(TCHAR*) * (pfts.totalFiles + 1));
+ pfts.ptszFiles = (wchar_t**)mir_alloc(sizeof(wchar_t*) * (pfts.totalFiles + 1));
pfts.ptszFiles[pfts.totalFiles] = NULL;
pfts.tszWorkingDir = NULL;
pfts.tszCurrentFile = NULL;
@@ -75,7 +75,7 @@ public: return pfts.hContact;
}
- const TCHAR* GetData() const
+ const wchar_t* GetData() const
{
if (data.IsEmpty())
return NULL;
@@ -87,40 +87,40 @@ public: isTerminated = true;
}
- void SetWorkingDirectory(const TCHAR *path)
+ void SetWorkingDirectory(const wchar_t *path)
{
- relativePathStart = _tcsrchr(path, '\\') - path + 1;
- pfts.tszWorkingDir = (TCHAR*)mir_calloc(sizeof(TCHAR) * relativePathStart);
+ relativePathStart = wcsrchr(path, '\\') - path + 1;
+ pfts.tszWorkingDir = (wchar_t*)mir_calloc(sizeof(wchar_t) * relativePathStart);
mir_tstrncpy(pfts.tszWorkingDir, path, relativePathStart);
if (PathIsDirectory(path))
- folderName = _tcsrchr(path, '\\') + 1;
+ folderName = wcsrchr(path, '\\') + 1;
}
- void SetServerFolder(const TCHAR *path)
+ void SetServerFolder(const wchar_t *path)
{
if (path)
serverFolder = path;
}
- const TCHAR* GetServerFolder() const
+ const wchar_t* GetServerFolder() const
{
if (serverFolder.IsEmpty())
return NULL;
return serverFolder;
}
- const TCHAR* GetFolderName() const
+ const wchar_t* GetFolderName() const
{
return folderName;
}
- void AddFile(const TCHAR *path)
+ void AddFile(const wchar_t *path)
{
- pfts.ptszFiles = (TCHAR**)mir_realloc(pfts.ptszFiles, sizeof(TCHAR*) * (pfts.totalFiles + 2));
+ pfts.ptszFiles = (wchar_t**)mir_realloc(pfts.ptszFiles, sizeof(wchar_t*) * (pfts.totalFiles + 2));
pfts.ptszFiles[pfts.totalFiles++] = mir_tstrdup(path);
pfts.ptszFiles[pfts.totalFiles] = NULL;
- FILE *file = _tfopen(path, L"rb");
+ FILE *file = _wfopen(path, L"rb");
if (file != NULL) {
_fseeki64(file, 0, SEEK_END);
pfts.totalBytes += _ftelli64(file);
@@ -128,7 +128,7 @@ public: }
}
- void AppendFormatData(const TCHAR *format, ...)
+ void AppendFormatData(const wchar_t *format, ...)
{
va_list args;
va_start(args, format);
@@ -136,24 +136,24 @@ public: va_end(args);
}
- const TCHAR* GetCurrentFilePath() const
+ const wchar_t* GetCurrentFilePath() const
{
return pfts.ptszFiles[pfts.currentFileNumber];
}
- const TCHAR* GetCurrentRelativeFilePath() const
+ const wchar_t* GetCurrentRelativeFilePath() const
{
return &GetCurrentFilePath()[relativePathStart];
}
- const TCHAR* GetCurrentFileName() const
+ const wchar_t* GetCurrentFileName() const
{
- return _tcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
+ return wcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
}
void OpenCurrentFile()
{
- hFile = _tfopen(GetCurrentFilePath(), L"rb");
+ hFile = _wfopen(GetCurrentFilePath(), L"rb");
if (!hFile)
throw DropboxException("Unable to open file");
_fseeki64(hFile, 0, SEEK_END);
@@ -212,7 +212,7 @@ public: pfts.currentFileNumber = 0;
pfts.currentFileProgress = 0;
- pfts.tszCurrentFile = _tcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
+ pfts.tszCurrentFile = wcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&pfts);
OpenCurrentFile();
@@ -227,7 +227,7 @@ public: return false;
pfts.currentFileProgress = 0;
- pfts.tszCurrentFile = _tcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
+ pfts.tszCurrentFile = wcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, (HANDLE)id, 0);
OpenCurrentFile();
diff --git a/plugins/Dropbox/src/stdafx.h b/plugins/Dropbox/src/stdafx.h index 21da021e56..56ebe56e24 100644 --- a/plugins/Dropbox/src/stdafx.h +++ b/plugins/Dropbox/src/stdafx.h @@ -65,6 +65,7 @@ public: };
#define MODULE "Dropbox"
+#define MODULEW L"Dropbox"
#include "dropbox_options.h"
#include "http_request.h"
diff --git a/plugins/Exchange/src/MirandaExchange.cpp b/plugins/Exchange/src/MirandaExchange.cpp index 43a87b679a..ebca794f89 100644 --- a/plugins/Exchange/src/MirandaExchange.cpp +++ b/plugins/Exchange/src/MirandaExchange.cpp @@ -117,15 +117,15 @@ CKeeper::CKeeper( LPTSTR szSender, LPTSTR szSubject, LPSTR szEntryID) if (NULL != szSender) {
m_nSizeSender = (UINT)mir_tstrlen(szSender)+1;
- m_szSender = new TCHAR[ m_nSizeSender ];
- memset(m_szSender, 0, m_nSizeSender * sizeof(TCHAR));
+ m_szSender = new wchar_t[ m_nSizeSender ];
+ memset(m_szSender, 0, m_nSizeSender * sizeof(wchar_t));
mir_tstrcpy(m_szSender, szSender);
}
if (NULL != szSubject) {
m_nSizeSubject = (UINT)mir_tstrlen(szSubject) +1;
- m_szSubject = new TCHAR[m_nSizeSubject];
- memset(m_szSubject, 0, m_nSizeSubject * sizeof(TCHAR));
+ m_szSubject = new wchar_t[m_nSizeSubject];
+ memset(m_szSubject, 0, m_nSizeSubject * sizeof(wchar_t));
mir_tstrcpy(m_szSubject, szSubject);
}
@@ -389,13 +389,13 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass {
_popupUtil(TranslateT("Connecting to Exchange ..."));
UINT nSize = 0;
- short nSizeOfTCHAR = sizeof( TCHAR );
+ short nSizeOfTCHAR = sizeof( wchar_t );
if (m_szUsername == NULL && NULL != szUsername) {
nSize = (UINT)mir_tstrlen(szUsername);
if (nSize > 0) {
nSize++;
- m_szUsername = new TCHAR[nSize];
+ m_szUsername = new wchar_t[nSize];
memset ( m_szUsername, 0, nSize * nSizeOfTCHAR );
mir_tstrcpy( m_szUsername, szUsername );
}
@@ -405,7 +405,7 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass nSize = (UINT)mir_tstrlen(szPassword);
if (nSize > 0) {
nSize++;
- m_szPassword = new TCHAR[nSize];
+ m_szPassword = new wchar_t[nSize];
memset(m_szPassword, 0, nSize * nSizeOfTCHAR);
mir_tstrcpy(m_szPassword, szPassword);
}
@@ -415,7 +415,7 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass nSize = (UINT)mir_tstrlen(szExchangeServer);
if (nSize > 0) {
nSize++;
- m_szExchangeServer = new TCHAR[nSize];
+ m_szExchangeServer = new wchar_t[nSize];
memset(m_szExchangeServer, 0, nSize * nSizeOfTCHAR);
mir_tstrcpy(m_szExchangeServer, szExchangeServer);
}
@@ -431,11 +431,11 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass }
if ( SUCCEEDED(hr)) {
- TCHAR szPIDandName[128];
- TCHAR szPID[20];
+ wchar_t szPIDandName[128];
+ wchar_t szPID[20];
_tstrtime(szPID);
- _tcsncpy(szPIDandName, m_szUsername, _countof(szPIDandName)-1);
+ wcsncpy(szPIDandName, m_szUsername, _countof(szPIDandName)-1);
mir_tstrncat(szPIDandName, szPID, _countof(szPIDandName) - mir_tstrlen(szPIDandName));
hr = CreateProfile(szPIDandName);
@@ -514,7 +514,7 @@ HRESULT CMirandaExchange::CreateProfile( LPTSTR szProfileName ) ULONG ulFlags = 0;
SRestriction sres;
SIZE_T nSize;
- TCHAR* szUniqName;
+ wchar_t* szUniqName;
enum {iSvcName, iSvcUID, cptaSvc};
SizedSPropTagArray(cptaSvc, sptCols) =
@@ -563,10 +563,10 @@ HRESULT CMirandaExchange::CreateProfile( LPTSTR szProfileName ) if (FAILED(hr))
return hr;
nSize = mir_tstrlen(m_szUsername);
- szUniqName = (TCHAR*)mir_alloc(sizeof(TCHAR) * (nSize + 4));
+ szUniqName = (wchar_t*)mir_alloc(sizeof(wchar_t) * (nSize + 4));
if (szUniqName != NULL) {
- memcpy(szUniqName, L"=", sizeof(TCHAR));
- memcpy((szUniqName + 1), m_szUsername, (sizeof(TCHAR) * (nSize + 1)));
+ memcpy(szUniqName, L"=", sizeof(wchar_t));
+ memcpy((szUniqName + 1), m_szUsername, (sizeof(wchar_t) * (nSize + 1)));
// Set values for PR_PROFILE_UNRESOLVED_NAME and PR_PROFILE_UNRESOLVED_SERVER
SPropValue spval[2];
spval[0].ulPropTag = PR_PROFILE_UNRESOLVED_NAME;
@@ -716,8 +716,8 @@ HRESULT CMirandaExchange::CheckInFolder( LPMAPIFOLDER lpFolder ) LPSRowSet lpRow = NULL;
LPSPropValue lpRowProp = NULL;
ULONG i = 0L;
- TCHAR* szSenderName = NULL;
- TCHAR* szSubject = NULL;
+ wchar_t* szSenderName = NULL;
+ wchar_t* szSubject = NULL;
LPSTR szEntryID = NULL;
if ( lpFolder == NULL || !m_bFolderInboxOK )
@@ -842,7 +842,7 @@ HRESULT CMirandaExchange::OpenTheMessage( LPTSTR ) HKEY hTheKey;
HRESULT hRes = E_FAIL;
- TCHAR szRegValue[ 512 ];
+ wchar_t szRegValue[ 512 ];
DWORD dwLength = 512 ;
DWORD dwType = REG_SZ;
@@ -863,11 +863,11 @@ HRESULT CMirandaExchange::OpenTheMessage( LPTSTR ) else
{
- TCHAR* szTheEnd = _tcsstr( szRegValue,L".EXE" );
+ wchar_t* szTheEnd = wcsstr( szRegValue,L".EXE" );
if ( NULL != szTheEnd )
{
- szRegValue[ mir_tstrlen(szRegValue) - mir_tstrlen(szTheEnd) +5 ] = _T('\0');
+ szRegValue[ mir_tstrlen(szRegValue) - mir_tstrlen(szTheEnd) +5 ] = '\0';
mir_tstrcat( szRegValue, L" /recycle" );
STARTUPINFO si;
PROCESS_INFORMATION pi;
diff --git a/plugins/Exchange/src/dlg_handlers.cpp b/plugins/Exchange/src/dlg_handlers.cpp index a134dafa10..4032a748e6 100644 --- a/plugins/Exchange/src/dlg_handlers.cpp +++ b/plugins/Exchange/src/dlg_handlers.cpp @@ -40,7 +40,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara int bCheck = db_get_b(NULL, ModuleName, "Check", 1);
- TCHAR buffer[4096];
+ wchar_t buffer[4096];
GetStringFromDatabase("Username", L"", buffer, _countof(buffer));
SetDlgItemText(hWnd, IDC_USER_EDIT, buffer);
@@ -110,7 +110,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara case PSN_APPLY:
db_set_b(NULL, ModuleName, "Check", IsDlgButtonChecked(hWnd, IDC_CHECK_EMAILS));
- TCHAR buffer[4096];
+ wchar_t buffer[4096];
GetDlgItemText(hWnd, IDC_USER_EDIT, buffer, _countof(buffer));
db_set_ts(NULL, ModuleName, "Username", buffer);
@@ -173,7 +173,7 @@ int CALLBACK ListSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) int count = ListView_GetItemCount(hWnd);
for (int i = 0; i < count; i++) {
if (ListView_GetItemState(hWnd, i, LVIS_SELECTED)) {
- TCHAR emailID[4096]; //uhh
+ wchar_t emailID[4096]; //uhh
ListView_GetItemText(hWnd, i, 2, emailID, _countof(emailID));
exchangeServer.OpenMessage(emailID);
}
@@ -226,8 +226,8 @@ INT_PTR CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam LVITEM item = { 0 };
TEmailHeader email = { 0 };
email.cbSize = sizeof(TEmailHeader);
- TCHAR sender[1024] = L"";
- TCHAR subject[1024] = L"";
+ wchar_t sender[1024] = L"";
+ wchar_t subject[1024] = L"";
//char buffer[4096];
email.cSender = sizeof(sender);
email.cSubject = sizeof(subject);
@@ -297,7 +297,7 @@ INT_PTR CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam int count = ListView_GetItemCount(hList);
for (int i = 0; i < count; i++) {
if (ListView_GetCheckState(hList, i)) {
- TCHAR emailID[2048]; //uhh ohh
+ wchar_t emailID[2048]; //uhh ohh
LVITEM item = { 0 };
item.iItem = i;
item.mask = LVIF_TEXT;
diff --git a/plugins/Exchange/src/emails.cpp b/plugins/Exchange/src/emails.cpp index 496d8969eb..f38bc7335c 100644 --- a/plugins/Exchange/src/emails.cpp +++ b/plugins/Exchange/src/emails.cpp @@ -57,12 +57,12 @@ int CExchangeServer::Connect(int bForceConnect) }
if ( !IsConnected() && bTryConnect) {
- TCHAR user[1024]; //lovely
- TCHAR password[1024]; //i know
- TCHAR server[1024];
+ wchar_t user[1024]; //lovely
+ wchar_t password[1024]; //i know
+ wchar_t server[1024];
GetStringFromDatabase("Username", L"", user, _countof(user));
- _tcsncpy_s(user, VARST(user), _TRUNCATE);
+ wcsncpy_s(user, VARST(user), _TRUNCATE);
GetStringFromDatabase("Password", L"", password, _countof(password));
GetStringFromDatabase("Server", L"", server, _countof(server));
@@ -92,7 +92,7 @@ int CExchangeServer::Disconnect() // return -1; //0 on success, != 0 otherwise
}
-int CExchangeServer::DoConnect(TCHAR *user, TCHAR *password, TCHAR *server, int)
+int CExchangeServer::DoConnect(wchar_t *user, wchar_t *password, wchar_t *server, int)
{
if (bTryConnect)
@@ -152,7 +152,7 @@ int CExchangeServer::IsServerAvailable() if (sServer == INVALID_SOCKET)
return 0; //server is not available
- TCHAR szServer[1024];
+ wchar_t szServer[1024];
GetStringFromDatabase("Server", L"", szServer, sizeof(szServer));
sockaddr_in addrServer;
InitSocketAddr(&addrServer, mir_t2a(szServer));
@@ -205,8 +205,8 @@ int CExchangeServer::GetEmailHeader(int iUnreadEmail, TEmailHeader *emailInfo) #ifndef NO_EXCHANGE_TEST
if (NULL != m_HeadersKeeper[iUnreadEmail]) {
- TCHAR* szSender = m_HeadersKeeper[iUnreadEmail]->m_szSender;
- TCHAR* szSubject = m_HeadersKeeper[iUnreadEmail]->m_szSubject;
+ wchar_t* szSender = m_HeadersKeeper[iUnreadEmail]->m_szSender;
+ wchar_t* szSubject = m_HeadersKeeper[iUnreadEmail]->m_szSubject;
if (NULL == szSender)
szSender = L"";
@@ -229,7 +229,7 @@ int CExchangeServer::GetEmailHeader(int iUnreadEmail, TEmailHeader *emailInfo) return 0;
}
-int CExchangeServer::MarkEmailAsRead(TCHAR *emailID)
+int CExchangeServer::MarkEmailAsRead(wchar_t *emailID)
{
if (!IsConnected())
return -1;
@@ -241,7 +241,7 @@ int CExchangeServer::MarkEmailAsRead(TCHAR *emailID) return 0;
}
-int CExchangeServer::OpenMessage(TCHAR *emailID)
+int CExchangeServer::OpenMessage(wchar_t *emailID)
{
if (!IsConnected())
return -1;
@@ -277,7 +277,7 @@ int CExchangeServer::Check(int bNoEmailsNotify) }
if (((count > 0) || ((bNoEmailsNotify) && (count >= 0))) && (count != -1)) {
- TCHAR buffer[1024];
+ wchar_t buffer[1024];
if (count != 1)
mir_sntprintf(buffer, TranslateT("You have %d unread emails..."), count);
else
@@ -292,7 +292,7 @@ int CExchangeServer::Check(int bNoEmailsNotify) return count;
}
-int ShowMessage(TCHAR *message, int cUnreadEmails)
+int ShowMessage(wchar_t *message, int cUnreadEmails)
{
int usePopups = ServiceExists(MS_POPUP_ADDPOPUPT) ? db_get_b(NULL, ModuleName, "UsePopups", 0) : 0;
if (usePopups)
@@ -301,21 +301,21 @@ int ShowMessage(TCHAR *message, int cUnreadEmails) return ShowMessageBoxMessage(TranslateT("Do you want to see the email headers?"), message, cUnreadEmails);
}
-int ShowPopupMessage(TCHAR *title, TCHAR *message, int cUnreadEmails)
+int ShowPopupMessage(wchar_t *title, wchar_t *message, int cUnreadEmails)
{
POPUPDATAT popup = {0};
popup.lchContact = NULL;
popup.colorBack = NULL;
popup.colorText = NULL;
popup.lchIcon = hiMailIcon;
- _tcsncpy_s(popup.lptzContactName, MAX_CONTACTNAME, title, _TRUNCATE);
- _tcsncpy_s(popup.lptzText, MAX_SECONDLINE, message, _TRUNCATE);
+ wcsncpy_s(popup.lptzContactName, MAX_CONTACTNAME, title, _TRUNCATE);
+ wcsncpy_s(popup.lptzText, MAX_SECONDLINE, message, _TRUNCATE);
popup.PluginWindowProc = DlgProcPopup;
popup.PluginData = (int *) cUnreadEmails;
return PUAddPopupT(&popup);
}
-int ShowMessageBoxMessage(TCHAR *title, TCHAR *message, int cUnreadEmails)
+int ShowMessageBoxMessage(wchar_t *title, wchar_t *message, int cUnreadEmails)
{
if (MessageBox(0, message, title, MB_YESNO) == IDYES)
ShowEmailsWindow(cUnreadEmails);
diff --git a/plugins/Exchange/src/emails.h b/plugins/Exchange/src/emails.h index 6dedbd24ce..2a624b8262 100644 --- a/plugins/Exchange/src/emails.h +++ b/plugins/Exchange/src/emails.h @@ -33,9 +33,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct TEmailHeader{
int cbSize;
DWORD flags; //flags
- TCHAR *szSender; //pointer to string that receives the sender name
+ wchar_t *szSender; //pointer to string that receives the sender name
int cSender; //size of szSender buffer
- TCHAR *szSubject; //pointer to string that receives the email subject
+ wchar_t *szSubject; //pointer to string that receives the email subject
int cSubject; //size of szSubject buffer
char *emailID;
};
@@ -50,7 +50,7 @@ class CExchangeServer{ int cConnections; //number of connection attempts
int bTryConnect;
- int DoConnect(TCHAR *user, TCHAR *password, TCHAR *server, int port);
+ int DoConnect(wchar_t *user, wchar_t *password, wchar_t *server, int port);
int DoDisconnect();
public:
@@ -76,18 +76,18 @@ class CExchangeServer{ /*
*/
- int MarkEmailAsRead(TCHAR *emailID);
+ int MarkEmailAsRead(wchar_t *emailID);
- int OpenMessage(TCHAR *emailID);
+ int OpenMessage(wchar_t *emailID);
int Check(int bNoEmailsNotify = FALSE);
};
extern CExchangeServer exchangeServer;
-int ShowMessage(TCHAR *message, int cUnreadEmails);
-int ShowPopupMessage(TCHAR *title, TCHAR *message, int cUnreadEmails);
-int ShowMessageBoxMessage(TCHAR *title, TCHAR *message, int cUnreadEmails);
+int ShowMessage(wchar_t *message, int cUnreadEmails);
+int ShowPopupMessage(wchar_t *title, wchar_t *message, int cUnreadEmails);
+int ShowMessageBoxMessage(wchar_t *title, wchar_t *message, int cUnreadEmails);
int ShowEmailsWindow(int cUnreadEmails);
diff --git a/plugins/Exchange/src/hooked_events.cpp b/plugins/Exchange/src/hooked_events.cpp index ecf569ef70..c484e976c3 100644 --- a/plugins/Exchange/src/hooked_events.cpp +++ b/plugins/Exchange/src/hooked_events.cpp @@ -66,7 +66,7 @@ int OnModulesLoaded(WPARAM, LPARAM) mi.position = 10000000;
mi.pszService = MS_EXCHANGE_CHECKEMAIL;
mi.flags = CMIF_TCHAR;
- mi.name.t = LPGENT("Check exchange mailbox");
+ mi.name.w = LPGENW("Check exchange mailbox");
Menu_AddMainMenuItem(&mi);
hEmailsDlg = NULL; //CreateDialog(hInstance, MAKEINTRESOURCE(IDD_EMAILS), NULL, DlgProcEmails); //create emails window
@@ -82,8 +82,8 @@ int OnOptionsInitialise(WPARAM wParam, LPARAM) odp.position = 100000000;
odp.hInstance = hInstance;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_EXCHANGE);
- odp.ptszTitle = LPGENT("Exchange notify");
- odp.ptszGroup = LPGENT("Plugins");
+ odp.pwszTitle = LPGENW("Exchange notify");
+ odp.pwszGroup = LPGENW("Plugins");
odp.groupPosition = 910000000;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = DlgProcOptions;
diff --git a/plugins/Exchange/src/utils.cpp b/plugins/Exchange/src/utils.cpp index c1b297f164..9b5204a0cb 100644 --- a/plugins/Exchange/src/utils.cpp +++ b/plugins/Exchange/src/utils.cpp @@ -92,23 +92,23 @@ char *BinToHex(int size, PBYTE data) return szresult;
}
-void HexToBin(TCHAR *inData, ULONG &size, LPBYTE &outData)
+void HexToBin(wchar_t *inData, ULONG &size, LPBYTE &outData)
{
- TCHAR buffer[32] = { 0 };
- _tcsncpy(buffer, L"0x", _countof(L"0x"));
- _tcsncpy(buffer + 2, inData, HEX_SIZE);
- _stscanf(buffer, L"%x", &size);
+ wchar_t buffer[32] = { 0 };
+ wcsncpy(buffer, L"0x", _countof(L"0x"));
+ wcsncpy(buffer + 2, inData, HEX_SIZE);
+ swscanf(buffer, L"%x", &size);
outData = (unsigned char*)new char[size * 2];
- TCHAR *tmp = inData + HEX_SIZE;
+ wchar_t *tmp = inData + HEX_SIZE;
buffer[4] = '\0'; //mark the end of the string
for (UINT i = 0; i < size; i++) {
- _tcsncpy(buffer + 2, &tmp[i * 2], 2);
- _stscanf(buffer, L"%hhx", &outData[i]);
+ wcsncpy(buffer + 2, &tmp[i * 2], 2);
+ swscanf(buffer, L"%hhx", &outData[i]);
}
}
-int GetStringFromDatabase(char *szSettingName, TCHAR *szError, TCHAR *szResult, int size)
+int GetStringFromDatabase(char *szSettingName, wchar_t *szError, wchar_t *szResult, int size)
{
DBVARIANT dbv = { 0 };
int res = 1;
@@ -117,7 +117,7 @@ int GetStringFromDatabase(char *szSettingName, TCHAR *szError, TCHAR *szResult, res = 0;
size_t tmp = mir_tstrlen(dbv.ptszVal);
size_t len = (tmp < size - 1) ? tmp : size - 1;
- _tcsncpy(szResult, dbv.ptszVal, len);
+ wcsncpy(szResult, dbv.ptszVal, len);
szResult[len] = '\0';
mir_free(dbv.ptszVal);
}
@@ -125,7 +125,7 @@ int GetStringFromDatabase(char *szSettingName, TCHAR *szError, TCHAR *szResult, res = 1;
size_t tmp = mir_tstrlen(szError);
size_t len = (tmp < size - 1) ? tmp : size - 1;
- _tcsncpy(szResult, szError, len);
+ wcsncpy(szResult, szError, len);
szResult[len] = '\0';
}
return res;
@@ -220,11 +220,11 @@ int ThreadCheckEmail(int bForceAttempt) return 0;
}
-void _popupUtil(TCHAR* szMsg)
+void _popupUtil(wchar_t* szMsg)
{
POPUPDATAT ppd = { 0 };
ppd.lchIcon = hiMailIcon;
- _tcsncpy(ppd.lptzContactName, L"Exchange notifier", MAX_CONTACTNAME - 1);
- _tcsncpy(ppd.lptzText, szMsg, MAX_SECONDLINE - 1);
+ wcsncpy(ppd.lptzContactName, L"Exchange notifier", MAX_CONTACTNAME - 1);
+ wcsncpy(ppd.lptzText, szMsg, MAX_SECONDLINE - 1);
PUAddPopupT(&ppd); //show a popup to tell the user what we're doing.
}
diff --git a/plugins/Exchange/src/utils.h b/plugins/Exchange/src/utils.h index c430a5f995..efc7942b95 100644 --- a/plugins/Exchange/src/utils.h +++ b/plugins/Exchange/src/utils.h @@ -34,16 +34,16 @@ int Log(char *format, ...); int Info(char *title, char *format, ...);
char *BinToHex(int size, PBYTE data);
-void HexToBin(TCHAR *inData, ULONG &size, PBYTE &outData);
+void HexToBin(wchar_t *inData, ULONG &size, PBYTE &outData);
void ScreenToClient(HWND hWnd, LPRECT rect);
void AnchorMoveWindow(HWND window, const WINDOWPOS *parentPos, int anchors);
RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, int anchors);
-int GetStringFromDatabase(char *szSettingName, TCHAR *szError, TCHAR *szResult, int size);
+int GetStringFromDatabase(char *szSettingName, wchar_t *szError, wchar_t *szResult, int size);
int ThreadCheckEmail(int bForceAttempt);
-void _popupUtil(TCHAR *szMsg);
+void _popupUtil(wchar_t *szMsg);
#endif
\ No newline at end of file diff --git a/plugins/ExternalAPI/m_folders.h b/plugins/ExternalAPI/m_folders.h index b0db2df31f..fbdc248d1c 100644 --- a/plugins/ExternalAPI/m_folders.h +++ b/plugins/ExternalAPI/m_folders.h @@ -189,7 +189,7 @@ __inline static INT_PTR FoldersGetCustomPathW(HANDLE hFolderEntry, wchar_t *path if (res) {
wchar_t buffer[MAX_PATH];
PathToAbsoluteW(notFoundW, buffer);
- _tcsncpy_s(pathW, size, buffer, _TRUNCATE);
+ wcsncpy_s(pathW, size, buffer, _TRUNCATE);
}
return res;
diff --git a/plugins/FTPFileYM/src/dialog.cpp b/plugins/FTPFileYM/src/dialog.cpp index 1706832239..39192e6583 100644 --- a/plugins/FTPFileYM/src/dialog.cpp +++ b/plugins/FTPFileYM/src/dialog.cpp @@ -79,7 +79,7 @@ UploadDialog::Tab::Tab(GenericJob *Job) : m_stzComplet[0] = 0;
m_stzRemain[0] = 0;
- TCHAR buff[256];
+ wchar_t buff[256];
TCITEM tab = { 0 };
tab.mask = TCIF_TEXT;
tab.pszText = Utils::getTextFragment(m_job->m_tszFileName, 20, buff);
@@ -130,7 +130,7 @@ void UploadDialog::Tab::select() void UploadDialog::Tab::labelCompleted()
{
- TCHAR buff[64], buff2[256];
+ wchar_t buff[64], buff2[256];
mir_sntprintf(buff2, L"* %s", Utils::getTextFragment(m_job->m_tszFileName, 20, buff));
TCITEM tab = { 0 };
@@ -286,7 +286,7 @@ INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar int times[10] = { 5, 15, 30, 1 * 60, 2 * 60, 5 * 60, 10 * 60, 1 * 24 * 60, 2 * 24 * 60, 7 * 24 * 60 };
bool bChecked = (tab->m_iOptAutoDelete == -1);
- TCHAR buff[256];
+ wchar_t buff[256];
for (int i = 0; i < _countof(times); i++) {
if (i == 3 || i == 7)
diff --git a/plugins/FTPFileYM/src/dialog.h b/plugins/FTPFileYM/src/dialog.h index 9354d45e3c..66244b7168 100644 --- a/plugins/FTPFileYM/src/dialog.h +++ b/plugins/FTPFileYM/src/dialog.h @@ -33,7 +33,7 @@ class UploadDialog private:
static UploadDialog *instance;
static mir_cs mutexTabs;
- TCHAR m_tszToolTipText[1024];
+ wchar_t m_tszToolTipText[1024];
UploadDialog();
@@ -48,9 +48,9 @@ public: bool m_bOptAutosend;
int m_iOptAutoDelete;
- TCHAR m_stzSpeed[64];
- TCHAR m_stzComplet[64];
- TCHAR m_stzRemain[64];
+ wchar_t m_stzSpeed[64];
+ wchar_t m_stzComplet[64];
+ wchar_t m_stzRemain[64];
Tab(GenericJob *Job);
~Tab();
diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp index 3fd2de8122..c5e4d548b3 100644 --- a/plugins/FTPFileYM/src/ftpfile.cpp +++ b/plugins/FTPFileYM/src/ftpfile.cpp @@ -89,21 +89,21 @@ static void InitIcolib() void InitMenuItems()
{
- TCHAR stzName[256];
+ wchar_t stzName[256];
CMenuItem mi;
SET_UID(mi, 0xB7132F5A, 0x65FC, 0x42C5, 0xB4, 0xCB, 0x54, 0xBC, 0xAC, 0x58, 0x34, 0xE9);
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = iconList[ServerList::FTP_COUNT].hIcolib;
mi.position = 3000090001;
- mi.name.t = LPGENT("FTP File");
+ mi.name.w = LPGENW("FTP File");
hMainMenu = Menu_AddMainMenuItem(&mi);
if (opt.bUseSubmenu)
hMenu = Menu_AddContactMenuItem(&mi);
memset(&mi, 0, sizeof(mi));
- mi.name.t = stzName;
+ mi.name.w = stzName;
mi.flags = CMIF_TCHAR | CMIF_SYSTEM;
CMenuItem mi2;
@@ -124,7 +124,7 @@ void InitMenuItems() mi2.root = hSubMenu[i];
mi2.pszService = MS_FTPFILE_CONTACTMENU;
- mi2.name.t = LPGENT("Upload file(s)");
+ mi2.name.w = LPGENW("Upload file(s)");
HGENMENU tmp = Menu_AddContactMenuItem(&mi2);
Menu_ConfigureItem(tmp, MCI_OPT_EXECPARAM, mi2.position = i + UploadJob::FTP_RAWFILE);
@@ -134,7 +134,7 @@ void InitMenuItems() mi2.root = hSubMenu[i];
mi2.pszService = MS_FTPFILE_CONTACTMENU;
- mi2.name.t = LPGENT("Zip and upload file(s)");
+ mi2.name.w = LPGENW("Zip and upload file(s)");
tmp = Menu_AddContactMenuItem(&mi2);
Menu_ConfigureItem(tmp, MCI_OPT_EXECPARAM, i + UploadJob::FTP_ZIPFILE);
@@ -144,7 +144,7 @@ void InitMenuItems() mi2.root = hSubMenu[i];
mi2.pszService = MS_FTPFILE_CONTACTMENU;
- mi2.name.t = LPGENT("Zip and upload folder");
+ mi2.name.w = LPGENW("Zip and upload folder");
tmp = Menu_AddContactMenuItem(&mi2);
Menu_ConfigureItem(tmp, MCI_OPT_EXECPARAM, i + UploadJob::FTP_ZIPFOLDER);
@@ -158,7 +158,7 @@ void InitMenuItems() mi.flags = CMIF_TCHAR;
mi.hIcolibItem = iconList[ServerList::FTP_COUNT].hIcolib;
mi.position = 3000090001;
- mi.name.t = LPGENT("FTP File manager");
+ mi.name.w = LPGENW("FTP File manager");
mi.pszService = MS_FTPFILE_SHOWMANAGER;
mi.root = hMainMenu;
Menu_AddMainMenuItem(&mi);
diff --git a/plugins/FTPFileYM/src/job_delete.cpp b/plugins/FTPFileYM/src/job_delete.cpp index 19d6aff7ad..2449d1e91a 100644 --- a/plugins/FTPFileYM/src/job_delete.cpp +++ b/plugins/FTPFileYM/src/job_delete.cpp @@ -89,7 +89,7 @@ void DeleteJob::run() DBEntry::remove(m_entry->m_fileID);
}
else if (manDlg != NULL && m_treeItem) {
- TCHAR *error = mir_a2t(szError);
+ wchar_t *error = mir_a2t(szError);
mir_tstrcpy(m_treeItem->m_tszToolTip, error);
m_treeItem->setState(Manager::TreeItem::_ERROR());
FREE(error);
diff --git a/plugins/FTPFileYM/src/job_generic.cpp b/plugins/FTPFileYM/src/job_generic.cpp index 92dabed7d9..9d4adf6013 100644 --- a/plugins/FTPFileYM/src/job_generic.cpp +++ b/plugins/FTPFileYM/src/job_generic.cpp @@ -54,7 +54,7 @@ GenericJob::~GenericJob() int GenericJob::openFileDialog()
{
- TCHAR temp[MAX_PATH] = L"";
+ wchar_t temp[MAX_PATH] = L"";
mir_sntprintf(temp, L"%s\0*.*\0", TranslateT("All Files (*.*)"));
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
@@ -85,12 +85,12 @@ int GenericJob::openFolderDialog() void GenericJob::getFilesFromOpenDialog()
{
- TCHAR stzFile[MAX_PATH];
+ wchar_t stzFile[MAX_PATH];
size_t length = mir_tstrlen(m_tszFilePath);
if (m_tszFilePath[0] && m_tszFilePath[length + 1]) // multiple files
{
- TCHAR *ptr = m_tszFilePath + length + 1;
+ wchar_t *ptr = m_tszFilePath + length + 1;
while (ptr[0]) {
mir_sntprintf(stzFile, L"%s\\%s", m_tszFilePath, ptr);
addFile(stzFile);
@@ -102,9 +102,9 @@ void GenericJob::getFilesFromOpenDialog() }
}
-int GenericJob::getFilesFromFolder(TCHAR *stzFolder)
+int GenericJob::getFilesFromFolder(wchar_t *stzFolder)
{
- TCHAR stzFile[MAX_PATH], stzDirSave[MAX_PATH];
+ wchar_t stzFile[MAX_PATH], stzDirSave[MAX_PATH];
GetCurrentDirectory(MAX_PATH, stzDirSave);
if (!SetCurrentDirectory(stzFolder)) {
@@ -152,7 +152,7 @@ int GenericJob::getFiles() int GenericJob::getFiles(void **objects, int objCount, DWORD flags)
{
if (m_mode == FTP_ZIPFOLDER) {
- TCHAR *folder;
+ wchar_t *folder;
if (flags & FUPL_UNICODE)
folder = mir_u2t((wchar_t *)objects[0]);
else
@@ -164,7 +164,7 @@ int GenericJob::getFiles(void **objects, int objCount, DWORD flags) }
else {
for (int i = 0; i < objCount; i++) {
- TCHAR *fileName;
+ wchar_t *fileName;
if (flags & FUPL_UNICODE)
fileName = mir_u2t((wchar_t *)objects[i]);
else
@@ -178,9 +178,9 @@ int GenericJob::getFiles(void **objects, int objCount, DWORD flags) return (m_files.size() == 0) ? 0 : 1;
}
-void GenericJob::addFile(TCHAR *fileName)
+void GenericJob::addFile(wchar_t *fileName)
{
- TCHAR *buff = mir_tstrdup(fileName);
+ wchar_t *buff = mir_tstrdup(fileName);
m_files.push_back(buff);
}
@@ -215,7 +215,7 @@ bool GenericJob::isConnecting() return (m_status == STATUS_CONNECTING || m_status == STATUS_CREATED);
}
-TCHAR *GenericJob::getStatusString()
+wchar_t *GenericJob::getStatusString()
{
switch (m_status) {
case STATUS_CANCELED: return TranslateT("CANCELED");
diff --git a/plugins/FTPFileYM/src/job_generic.h b/plugins/FTPFileYM/src/job_generic.h index beeb1b606f..ffc370958d 100644 --- a/plugins/FTPFileYM/src/job_generic.h +++ b/plugins/FTPFileYM/src/job_generic.h @@ -43,8 +43,8 @@ private: int openFileDialog();
int openFolderDialog();
void getFilesFromOpenDialog();
- int getFilesFromFolder(TCHAR *stzFolder);
- void addFile(TCHAR *fileName);
+ int getFilesFromFolder(wchar_t *stzFolder);
+ void addFile(wchar_t *fileName);
public:
enum EMode
@@ -69,15 +69,15 @@ public: MCONTACT m_hContact;
int m_iFtpNum, m_fileID;
ServerList::FTP *m_ftp;
- TCHAR m_tszFilePath[1024];
- TCHAR m_tszFileName[64];
+ wchar_t m_tszFilePath[1024];
+ wchar_t m_tszFileName[64];
char m_szSafeFileName[64];
EMode m_mode;
EStatus m_status;
UploadDialog::Tab *m_tab;
- vector<TCHAR *> m_files;
- TCHAR* operator[] (int i) const { return m_files[i];}
+ vector<wchar_t *> m_files;
+ wchar_t* operator[] (int i) const { return m_files[i];}
GenericJob(MCONTACT hContact, int m_iFtpNum, EMode mode);
GenericJob(GenericJob *job);
@@ -93,7 +93,7 @@ public: bool isConnecting();
bool isCanceled();
- TCHAR *getStatusString();
+ wchar_t *getStatusString();
virtual void start() = 0;
virtual void pause() = 0;
diff --git a/plugins/FTPFileYM/src/job_packer.cpp b/plugins/FTPFileYM/src/job_packer.cpp index 3a6b037d5a..135b06e665 100644 --- a/plugins/FTPFileYM/src/job_packer.cpp +++ b/plugins/FTPFileYM/src/job_packer.cpp @@ -35,20 +35,20 @@ PackerJob::PackerJob(MCONTACT hContact, int iFtpNum, EMode mode) : void PackerJob::getZipFilePath()
{
- TCHAR buff[256], stzFileName[256] = { 0 };
- TCHAR *pch;
+ wchar_t buff[256], stzFileName[256] = { 0 };
+ wchar_t *pch;
if (m_files.size() == 1) {
mir_tstrcpy(stzFileName, Utils::getFileNameFromPath(m_files[0]));
- pch = _tcsrchr(stzFileName, '.');
+ pch = wcsrchr(stzFileName, '.');
if (pch) *pch = 0;
}
else {
mir_tstrcpy(buff, m_files[0]);
- pch = _tcsrchr(buff, '\\');
+ pch = wcsrchr(buff, '\\');
if (pch) {
*pch = 0;
- pch = _tcsrchr(buff, '\\');
+ pch = wcsrchr(buff, '\\');
if (pch) mir_tstrcpy(stzFileName, pch + 1);
}
}
@@ -109,7 +109,7 @@ void PackerJob::pack() {
struct _stat fileInfo;
for (UINT i = 0; i < m_files.size(); i++) {
- if (_tstat(m_files[i], &fileInfo) == 0)
+ if (_wstat(m_files[i], &fileInfo) == 0)
m_uiFileSize += (UINT64)fileInfo.st_size;
}
@@ -161,7 +161,7 @@ int PackerJob::createZipFile() FREE(file);
if (err == ZIP_OK) {
- FILE *fin = _tfopen(m_files[i], L"rb");
+ FILE *fin = _wfopen(m_files[i], L"rb");
if (fin) {
do {
if (isCanceled()) {
@@ -209,7 +209,7 @@ Cleanup: return result;
}
-uLong PackerJob::getFileTime(TCHAR *file, tm_zip*, uLong *dt)
+uLong PackerJob::getFileTime(wchar_t *file, tm_zip*, uLong *dt)
{
FILETIME ftLocal;
HANDLE hFind;
@@ -238,7 +238,7 @@ void PackerJob::updateStats() double perc = m_uiFileSize ? ((double)m_uiReaded / m_uiFileSize) * 100 : 0;
mir_sntprintf(m_tab->m_stzComplet, TranslateT("%0.1f%% (%d kB/%d kB)"), perc, (int)m_uiReaded / 1024, (int)m_uiFileSize / 1024);
- TCHAR buff[256];
+ wchar_t buff[256];
long s = (m_uiFileSize - m_uiReaded) / (long)(speed * 1024);
int d = (s / 60 / 60 / 24);
int h = (s - d * 60 * 60 * 24) / 60 / 60;
diff --git a/plugins/FTPFileYM/src/job_packer.h b/plugins/FTPFileYM/src/job_packer.h index 5cd36a0d87..14edcbeda1 100644 --- a/plugins/FTPFileYM/src/job_packer.h +++ b/plugins/FTPFileYM/src/job_packer.h @@ -37,7 +37,7 @@ private: static int iRunningJobCount;
static void waitingThread(void *arg);
- static uLong getFileTime(TCHAR *file, tm_zip *tmzip, uLong *dt);
+ static uLong getFileTime(wchar_t *file, tm_zip *tmzip, uLong *dt);
void pack();
void getZipFilePath();
diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp index f4bb1b2fb3..b6c1e9a20c 100644 --- a/plugins/FTPFileYM/src/job_upload.cpp +++ b/plugins/FTPFileYM/src/job_upload.cpp @@ -245,8 +245,8 @@ INT_PTR CALLBACK UploadJob::DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wPa case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- TCHAR buff[256];
- TCHAR *fileName = mir_a2t((char *)lParam);
+ wchar_t buff[256];
+ wchar_t *fileName = mir_a2t((char *)lParam);
mir_sntprintf(buff, TranslateT("File exists - %s"), fileName);
SetWindowText(hwndDlg, buff);
FREE(fileName);
@@ -266,7 +266,7 @@ void UploadJob::upload() {
refreshTab(true);
- m_fp = _tfopen(m_tszFilePath, L"rb");
+ m_fp = _wfopen(m_tszFilePath, L"rb");
if (m_fp == NULL) {
Utils::msgBox(TranslateT("Error occurred when opening local file.\nAborting file upload..."), MB_OK | MB_ICONERROR);
return;
@@ -277,7 +277,7 @@ void UploadJob::upload() headerList = curl_slist_append(headerList, getChmodString());
struct _stat fileInfo;
- _tstat(m_tszFilePath, &fileInfo);
+ _wstat(m_tszFilePath, &fileInfo);
m_uiFileSize = (UINT64)fileInfo.st_size;
CURL *hCurl = curlInit(getUrlString(), headerList);
@@ -402,7 +402,7 @@ void UploadJob::updateStats() int m = (s - d * 60 * 60 * 24 - h * 60 * 60) / 60;
s = s - (d * 24 * 60 * 60) - (h * 60 * 60) - (m * 60);
- TCHAR buff[256];
+ wchar_t buff[256];
if (d > 0) mir_sntprintf(buff, L"%dd %02d:%02d:%02d", d, h, m, s);
else mir_sntprintf(buff, L"%02d:%02d:%02d", h, m, s);
mir_sntprintf(m_tab->m_stzRemain, L"%s (%d kB/%d kB)", buff, (m_uiFileSize - m_uiTotalSent) / 1024, m_uiFileSize / 1024);
diff --git a/plugins/FTPFileYM/src/manager.cpp b/plugins/FTPFileYM/src/manager.cpp index 8d68a8f1c6..d838e77884 100644 --- a/plugins/FTPFileYM/src/manager.cpp +++ b/plugins/FTPFileYM/src/manager.cpp @@ -377,7 +377,7 @@ INT_PTR CALLBACK Manager::ManagerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (item) {
if (item->m_tszToolTip[0]) {
- _tcsncpy(tvInfoTip->pszText, item->m_tszToolTip, tvInfoTip->cchTextMax - 1);
+ wcsncpy(tvInfoTip->pszText, item->m_tszToolTip, tvInfoTip->cchTextMax - 1);
tvInfoTip->pszText[tvInfoTip->cchTextMax - 1] = 0;
}
}
diff --git a/plugins/FTPFileYM/src/manager.h b/plugins/FTPFileYM/src/manager.h index 088ddf0b03..52983d6f5a 100644 --- a/plugins/FTPFileYM/src/manager.h +++ b/plugins/FTPFileYM/src/manager.h @@ -49,7 +49,7 @@ public: public:
HTREEITEM m_handle;
HTREEITEM m_parent;
- TCHAR m_tszToolTip[256];
+ wchar_t m_tszToolTip[256];
int m_fileID;
TreeItem(HTREEITEM _handle, HTREEITEM _parent, int _id);
diff --git a/plugins/FTPFileYM/src/mir_db.cpp b/plugins/FTPFileYM/src/mir_db.cpp index c09b6dac51..e14e2caccc 100644 --- a/plugins/FTPFileYM/src/mir_db.cpp +++ b/plugins/FTPFileYM/src/mir_db.cpp @@ -46,7 +46,7 @@ int DB::setAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, return db_set_s(hContact, szModule, formSet, szValue);
}
-int DB::setStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *stzValue)
+int DB::setStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, wchar_t *stzValue)
{
char formSet[256];
mir_snprintf(formSet, szSetting, id);
@@ -94,7 +94,7 @@ int DB::getAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, return getAString(hContact, szModule, formSet, buff);
}
-int DB::getString(MCONTACT hContact, char *szModule, char *szSetting, TCHAR *buff)
+int DB::getString(MCONTACT hContact, char *szModule, char *szSetting, wchar_t *buff)
{
DBVARIANT dbv;
if (!db_get_ts(hContact, szModule, szSetting, &dbv)) {
@@ -107,7 +107,7 @@ int DB::getString(MCONTACT hContact, char *szModule, char *szSetting, TCHAR *buf return 1;
}
-int DB::getStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *buff)
+int DB::getStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, wchar_t *buff)
{
char formSet[256];
mir_snprintf(formSet, szSetting, id);
diff --git a/plugins/FTPFileYM/src/mir_db.h b/plugins/FTPFileYM/src/mir_db.h index f53e084667..750f6c6b8a 100644 --- a/plugins/FTPFileYM/src/mir_db.h +++ b/plugins/FTPFileYM/src/mir_db.h @@ -28,7 +28,7 @@ public: static int setDwordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue);
static int setAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, char *szValue);
- static int setStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *stzValue);
+ static int setStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, wchar_t *stzValue);
static int getByteF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue = -1);
static int getWordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue = -1);
@@ -37,8 +37,8 @@ public: // !!!!!!!!!!!!!!!!!!! dangerous as hell
static int getAString(MCONTACT hContact, char *szModule, char *szSetting, char *buff);
static int getAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, char *buff);
- static int getString(MCONTACT hContact, char *szModule, char *szSetting, TCHAR *buff);
- static int getStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *buff);
+ static int getString(MCONTACT hContact, char *szModule, char *szSetting, wchar_t *buff);
+ static int getStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, wchar_t *buff);
static int deleteSettingF(MCONTACT hContact, char *szModule, char *szSetting, int id);
};
diff --git a/plugins/FTPFileYM/src/options.cpp b/plugins/FTPFileYM/src/options.cpp index dc2942b077..fa0632194b 100644 --- a/plugins/FTPFileYM/src/options.cpp +++ b/plugins/FTPFileYM/src/options.cpp @@ -250,15 +250,15 @@ int Options::InitOptions(WPARAM wParam, LPARAM) odp.position = 100000000;
odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszTitle = LPGENT("FTP File");
- odp.ptszGroup = LPGENT("Services");
+ odp.pwszTitle = LPGENW("FTP File");
+ odp.pwszGroup = LPGENW("Services");
- odp.ptszTab = LPGENT("Accounts");
+ odp.pwszTab = LPGENW("Accounts");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FTPFILE);
odp.pfnDlgProc = Options::DlgProcOptsAccounts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Advanced");
+ odp.pwszTab = LPGENW("Advanced");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ADVANCED);
odp.pfnDlgProc = Options::DlgProcOptsAdvanced;
Options_AddPage(wParam, &odp);
diff --git a/plugins/FTPFileYM/src/serverlist.h b/plugins/FTPFileYM/src/serverlist.h index d542ea6c07..05b2e66724 100644 --- a/plugins/FTPFileYM/src/serverlist.h +++ b/plugins/FTPFileYM/src/serverlist.h @@ -40,7 +40,7 @@ public: };
bool m_bEnabled;
- TCHAR m_stzName[64];
+ wchar_t m_stzName[64];
char m_szServer[256];
char m_szUser[64];
char m_szPass[64];
diff --git a/plugins/FTPFileYM/src/utils.cpp b/plugins/FTPFileYM/src/utils.cpp index d17bb4ba6c..d15a706055 100644 --- a/plugins/FTPFileYM/src/utils.cpp +++ b/plugins/FTPFileYM/src/utils.cpp @@ -32,7 +32,7 @@ int Utils::getDeleteTimeMin() return -1;
}
-int Utils::msgBox(TCHAR *stzMsg, UINT uType)
+int Utils::msgBox(wchar_t *stzMsg, UINT uType)
{
HWND hwnd = (uDlg != NULL) ? uDlg->m_hwnd : 0;
return MessageBox(hwnd, stzMsg, TranslateT("FTP File"), uType);
@@ -58,14 +58,14 @@ HANDLE Utils::getIconHandle(const char *szName) return IcoLib_GetIconHandle(buff);
}
-TCHAR* Utils::getFileNameFromPath(TCHAR *stzPath)
+wchar_t* Utils::getFileNameFromPath(wchar_t *stzPath)
{
- TCHAR *pch = _tcsrchr(stzPath, '\\');
+ wchar_t *pch = wcsrchr(stzPath, '\\');
if (pch) return pch + 1;
else return L"file.zip";
}
-TCHAR* Utils::getTextFragment(TCHAR *stzText, size_t length, TCHAR *buff)
+wchar_t* Utils::getTextFragment(wchar_t *stzText, size_t length, wchar_t *buff)
{
if (mir_tstrlen(stzText) > length) {
mir_tstrcpy(buff, stzText);
@@ -95,7 +95,7 @@ void Utils::copyToClipboard(char *szText) const char from_chars[] = "àáâãäå¸æçèéêëìíîïðñòóôõö÷øùúûüýþÿÀÁÂÃÄŨÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß !@#$%^&=,{}[];'`";
const char to_chars[] = "abvgdeezziiklmnoprstufhccwwqyqeuaABVGDEEZZIIKLMNOPRSTUFHCCWWQYQEUA_________________";
-char* Utils::makeSafeString(TCHAR *input, char *output)
+char* Utils::makeSafeString(wchar_t *input, char *output)
{
char *buff = mir_t2a(input);
size_t length = mir_strlen(buff);
@@ -155,12 +155,12 @@ void Utils::curlSetOpt(CURL *hCurl, ServerList::FTP *ftp, char *url, struct curl INT_PTR CALLBACK Utils::DlgProcSetFileName(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR *fileName = (TCHAR *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ wchar_t *fileName = (wchar_t *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- fileName = (TCHAR *)lParam;
+ fileName = (wchar_t *)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)fileName);
SetDlgItemText(hwndDlg, IDC_NAME, fileName);
@@ -189,7 +189,7 @@ INT_PTR CALLBACK Utils::DlgProcSetFileName(HWND hwndDlg, UINT msg, WPARAM wParam return FALSE;
}
-bool Utils::setFileNameDlg(TCHAR *nameBuff)
+bool Utils::setFileNameDlg(wchar_t *nameBuff)
{
if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DLG_NAME), 0, DlgProcSetFileName, (LPARAM)nameBuff) == IDOK)
return true;
@@ -199,8 +199,8 @@ bool Utils::setFileNameDlg(TCHAR *nameBuff) bool Utils::setFileNameDlgA(char *nameBuff)
{
- TCHAR buff[64];
- TCHAR *tmp = mir_a2t(nameBuff);
+ wchar_t buff[64];
+ wchar_t *tmp = mir_a2t(nameBuff);
mir_tstrcpy(buff, tmp);
FREE(tmp);
diff --git a/plugins/FTPFileYM/src/utils.h b/plugins/FTPFileYM/src/utils.h index 7c83869ade..de5fd9d911 100644 --- a/plugins/FTPFileYM/src/utils.h +++ b/plugins/FTPFileYM/src/utils.h @@ -27,21 +27,21 @@ private: static INT_PTR CALLBACK DlgProcSetFileName(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
public:
- static int msgBox(TCHAR *szMsg, UINT uType);
+ static int msgBox(wchar_t *szMsg, UINT uType);
static int msgBoxA(char *szMsg, UINT uType);
static int getDeleteTimeMin();
static HICON loadIconEx(const char *szName);
static HANDLE getIconHandle(const char *szName);
- static TCHAR *getFileNameFromPath(TCHAR *stzPath);
- static TCHAR *getTextFragment(TCHAR *stzText, size_t length, TCHAR *buff);
- static char *makeSafeString(TCHAR *input, char *output);
+ static wchar_t *getFileNameFromPath(wchar_t *stzPath);
+ static wchar_t *getTextFragment(wchar_t *stzText, size_t length, wchar_t *buff);
+ static char *makeSafeString(wchar_t *input, char *output);
static void createFileDownloadLink(char *szUrl, char *fileName, char *buff, int buffSize);
static void copyToClipboard(char *szText);
static void curlSetOpt(CURL *hCurl, ServerList::FTP *ftp, char *url, struct curl_slist *headerList, char *errorBuff);
- static bool setFileNameDlg(TCHAR *nameBuff);
+ static bool setFileNameDlg(wchar_t *nameBuff);
static bool setFileNameDlgA(char *nameBuff);
};
diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp index 38cd4abb62..fb837cdd09 100644 --- a/plugins/FavContacts/src/contact_cache.cpp +++ b/plugins/FavContacts/src/contact_cache.cpp @@ -114,7 +114,7 @@ float CContactCache::getWeight(int rate) return -1;
}
-static bool AppendInfo(TCHAR *buf, int size, MCONTACT hContact, int info)
+static bool AppendInfo(wchar_t *buf, int size, MCONTACT hContact, int info)
{
ptrT str(Contact_GetInfo(info, hContact));
if (str != NULL) {
@@ -128,7 +128,7 @@ static bool AppendInfo(TCHAR *buf, int size, MCONTACT hContact, int info) void CContactCache::TContactInfo::LoadInfo()
{
if (infoLoaded) return;
- TCHAR *p = info;
+ wchar_t *p = info;
p[0] = p[1] = 0;
@@ -147,22 +147,22 @@ void CContactCache::TContactInfo::LoadInfo() infoLoaded = true;
}
-TCHAR *nb_stristr(TCHAR *str, TCHAR *substr)
+wchar_t *nb_stristr(wchar_t *str, wchar_t *substr)
{
if (!substr || !*substr) return str;
if (!str || !*str) return NULL;
- TCHAR *str_up = NEWTSTR_ALLOCA(str);
- TCHAR *substr_up = NEWTSTR_ALLOCA(substr);
+ wchar_t *str_up = NEWWSTR_ALLOCA(str);
+ wchar_t *substr_up = NEWWSTR_ALLOCA(substr);
CharUpperBuff(str_up, (DWORD)mir_tstrlen(str_up));
CharUpperBuff(substr_up, (DWORD)mir_tstrlen(substr_up));
- TCHAR *p = _tcsstr(str_up, substr_up);
+ wchar_t *p = wcsstr(str_up, substr_up);
return p ? (str + (p - str_up)) : NULL;
}
-bool CContactCache::filter(int rate, TCHAR *str)
+bool CContactCache::filter(int rate, wchar_t *str)
{
if (!str || !*str)
return true;
@@ -172,7 +172,7 @@ bool CContactCache::filter(int rate, TCHAR *str) HKL kbdLayouts[10];
int nKbdLayouts = GetKeyboardLayoutList(_countof(kbdLayouts), kbdLayouts);
- TCHAR buf[256];
+ wchar_t buf[256];
BYTE keyState[256] = { 0 };
for (int iLayout = 0; iLayout < nKbdLayouts; ++iLayout) {
@@ -188,7 +188,7 @@ bool CContactCache::filter(int rate, TCHAR *str) buf[i] = 0;
}
- for (TCHAR *p = m_cache[rate]->info; p && *p; p = p + mir_tstrlen(p) + 1)
+ for (wchar_t *p = m_cache[rate]->info; p && *p; p = p + mir_tstrlen(p) + 1)
if (nb_stristr(p, buf))
return true;
}
diff --git a/plugins/FavContacts/src/contact_cache.h b/plugins/FavContacts/src/contact_cache.h index 6bbd52a74b..2987290735 100644 --- a/plugins/FavContacts/src/contact_cache.h +++ b/plugins/FavContacts/src/contact_cache.h @@ -11,7 +11,7 @@ public: MCONTACT hContact;
float rate;
bool infoLoaded;
- TCHAR info[INFOSIZE];
+ wchar_t info[INFOSIZE];
TContactInfo()
{
@@ -39,7 +39,7 @@ public: MCONTACT get(int rate);
float getWeight(int rate);
- bool filter(int rate, TCHAR *str);
+ bool filter(int rate, wchar_t *str);
};
#endif // __contact_cache__
diff --git a/plugins/FavContacts/src/favlist.h b/plugins/FavContacts/src/favlist.h index c8adf21ca1..91245327d7 100644 --- a/plugins/FavContacts/src/favlist.h +++ b/plugins/FavContacts/src/favlist.h @@ -6,8 +6,8 @@ struct TContactInfo private:
MCONTACT hContact;
DWORD status;
- TCHAR *name;
- TCHAR *group;
+ wchar_t *name;
+ wchar_t *group;
bool bManual;
float fRate;
@@ -39,7 +39,7 @@ public: return hContact;
}
- TCHAR *getGroup() const
+ wchar_t *getGroup() const
{
return group;
}
@@ -66,7 +66,7 @@ class TFavContacts : public LIST < TContactInfo > {
private:
int nGroups;
- TCHAR *prevGroup;
+ wchar_t *prevGroup;
MIDatabase *db;
int addContact(MCONTACT hContact, bool bManual)
@@ -84,7 +84,7 @@ private: TContactInfo *info = new TContactInfo(hContact, bManual);
insert(info);
- TCHAR *group = info->getGroup();
+ wchar_t *group = info->getGroup();
if (prevGroup && mir_tstrcmp(prevGroup, group))
++nGroups;
prevGroup = group;
diff --git a/plugins/FavContacts/src/http_api.cpp b/plugins/FavContacts/src/http_api.cpp index ab04a6ac71..cc84b08adc 100644 --- a/plugins/FavContacts/src/http_api.cpp +++ b/plugins/FavContacts/src/http_api.cpp @@ -74,7 +74,7 @@ public: for (int i = 0; i < favList.getCount(); ++i)
{
MCONTACT hContact = favList[i]->getHandle();
- TCHAR *name = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
AVATARCACHEENTRY *avatar = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, hContact, 0);
int status = db_get_w(hContact, GetContactProto(hContact), "Status", ID_STATUS_OFFLINE);
diff --git a/plugins/FavContacts/src/menu.cpp b/plugins/FavContacts/src/menu.cpp index 6110ad45ba..15c2f3189e 100644 --- a/plugins/FavContacts/src/menu.cpp +++ b/plugins/FavContacts/src/menu.cpp @@ -23,11 +23,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. UINT g_maxItemWidth = 0;
float g_widthMultiplier = 0;
-TCHAR g_filter[1024] = { 0 };
+wchar_t g_filter[1024] = { 0 };
HWND g_hwndMenuHost = NULL;
-static TCHAR* sttGetGroupName(int id)
+static wchar_t* sttGetGroupName(int id)
{
if (id == 1) {
if (g_Options.bUseGroups)
@@ -42,7 +42,7 @@ static BOOL sttMeasureItem_Group(LPMEASUREITEMSTRUCT lpmis, Options *options) {
HDC hdc = GetDC(g_hwndMenuHost);
HFONT hfntSave = (HFONT)SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT));
- TCHAR *name = sttGetGroupName(-INT_PTR(lpmis->itemData));
+ wchar_t *name = sttGetGroupName(-INT_PTR(lpmis->itemData));
if (!options->bSysColors)
SelectObject(hdc, g_Options.hfntName);
@@ -71,7 +71,7 @@ static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options) if (options->bSecondLine) {
bool bFree = false;
- TCHAR *title = db_get_tsa(hContact, "CList", "StatusMsg");
+ wchar_t *title = db_get_tsa(hContact, "CList", "StatusMsg");
if (title == NULL) {
char *proto = GetContactProto(hContact);
int status = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE);
@@ -89,7 +89,7 @@ static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options) mir_free(title);
}
- TCHAR *name = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
if (!options->bSysColors) SelectObject(hdc, g_Options.hfntName);
GetTextExtentPoint32(hdc, name, (int)mir_tstrlen(name), &sz);
@@ -155,7 +155,7 @@ static BOOL sttDrawItem_Group(LPDRAWITEMSTRUCT lpdis, Options *options = NULL) SetTextColor(lpdis->hDC, g_Options.clLine1Sel);
}
- TCHAR *name = sttGetGroupName(-INT_PTR(lpdis->itemData));
+ wchar_t *name = sttGetGroupName(-INT_PTR(lpdis->itemData));
if (!options->bSysColors)
SelectObject(lpdis->hDC, g_Options.hfntName);
DrawText(lpdis->hDC, name, -1, &lpdis->rcItem, DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER | DT_CENTER);
@@ -301,7 +301,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL) }
if (true) {
- TCHAR *name = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
if (!options->bSysColors)
SelectObject(hdcTemp, g_Options.hfntName);
@@ -315,7 +315,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL) if (options->bSecondLine) {
bool bFree = false;
- TCHAR *title = db_get_tsa(hContact, "CList", "StatusMsg");
+ wchar_t *title = db_get_tsa(hContact, "CList", "StatusMsg");
if (title == NULL) {
int status = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE);
title = pcli->pfnGetStatusModeDescription(status, 0);
@@ -393,9 +393,9 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, if (size_t l = mir_tstrlen(g_filter))
g_filter[l - 1] = 0;
}
- else if (_istalnum(LOWORD(wParam))) {
+ else if (iswalnum(LOWORD(wParam))) {
if (mir_tstrlen(g_filter) < _countof(g_filter) - 1) {
- TCHAR s[] = { LOWORD(wParam), 0 };
+ wchar_t s[] = { LOWORD(wParam), 0 };
mir_tstrcat(g_filter, s);
}
}
@@ -444,7 +444,7 @@ int ShowMenu(bool centered) HMENU hMenu = CreatePopupMenu();
SIZE szMenu = { 0 };
SIZE szColumn = { 0 };
- TCHAR *prevGroup = NULL;
+ wchar_t *prevGroup = NULL;
int idItem = 100;
MCONTACT hContact;
diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp index 7a2658b6bc..556e0ebbaa 100644 --- a/plugins/FavContacts/src/services.cpp +++ b/plugins/FavContacts/src/services.cpp @@ -128,27 +128,27 @@ int ProcessReloadFonts(WPARAM, LPARAM) LOGFONT lf = { 0 };
FontIDT fontid = { sizeof(fontid) };
- mir_tstrcpy(fontid.group, LPGENT("Favorite Contacts"));
- mir_tstrcpy(fontid.name, LPGENT("Contact name"));
+ mir_tstrcpy(fontid.group, LPGENW("Favorite Contacts"));
+ mir_tstrcpy(fontid.name, LPGENW("Contact name"));
g_Options.clLine1 = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
g_Options.hfntName = CreateFontIndirect(&lf);
- mir_tstrcpy(fontid.name, LPGENT("Second line"));
+ mir_tstrcpy(fontid.name, LPGENW("Second line"));
g_Options.clLine2 = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
g_Options.hfntSecond = CreateFontIndirect(&lf);
- mir_tstrcpy(fontid.name, LPGENT("Selected contact name (color)"));
+ mir_tstrcpy(fontid.name, LPGENW("Selected contact name (color)"));
g_Options.clLine1Sel = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
- mir_tstrcpy(fontid.name, LPGENT("Selected second line (color)"));
+ mir_tstrcpy(fontid.name, LPGENW("Selected second line (color)"));
g_Options.clLine2Sel = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
ColourIDT colourid = { sizeof(colourid) };
- mir_tstrcpy(colourid.group, LPGENT("Favorite Contacts"));
- mir_tstrcpy(colourid.name, LPGENT("Background"));
+ mir_tstrcpy(colourid.group, LPGENW("Favorite Contacts"));
+ mir_tstrcpy(colourid.name, LPGENW("Background"));
g_Options.clBack = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, (LPARAM)&lf);
- mir_tstrcpy(colourid.name, LPGENT("Selected background"));
+ mir_tstrcpy(colourid.name, LPGENW("Selected background"));
g_Options.clBackSel = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, (LPARAM)&lf);
return 0;
@@ -171,38 +171,38 @@ int ProcessModulesLoaded(WPARAM, LPARAM) /////////////////////////////////////////////////////////////////////////////////////
FontIDT fontid = { sizeof(fontid) };
- mir_tstrcpy(fontid.group, LPGENT("Favorite Contacts"));
+ mir_tstrcpy(fontid.group, LPGENW("Favorite Contacts"));
mir_strcpy(fontid.dbSettingsGroup, "FavContacts");
- mir_tstrcpy(fontid.backgroundGroup, LPGENT("Favorite Contacts"));
+ mir_tstrcpy(fontid.backgroundGroup, LPGENW("Favorite Contacts"));
fontid.flags = FIDF_DEFAULTVALID;
fontid.deffontsettings.charset = DEFAULT_CHARSET;
fontid.deffontsettings.size = -11;
mir_tstrcpy(fontid.deffontsettings.szFace, L"MS Shell Dlg");
fontid.deffontsettings.style = 0;
- mir_tstrcpy(fontid.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(fontid.backgroundName, LPGENW("Background"));
- mir_tstrcpy(fontid.name, LPGENT("Contact name"));
+ mir_tstrcpy(fontid.name, LPGENW("Contact name"));
mir_strcpy(fontid.prefix, "fntName");
fontid.deffontsettings.colour = GetSysColor(COLOR_MENUTEXT);
fontid.deffontsettings.style = DBFONTF_BOLD;
FontRegisterT(&fontid);
- mir_tstrcpy(fontid.name, LPGENT("Second line"));
+ mir_tstrcpy(fontid.name, LPGENW("Second line"));
mir_strcpy(fontid.prefix, "fntSecond");
fontid.deffontsettings.colour = sttShadeColor(GetSysColor(COLOR_MENUTEXT), GetSysColor(COLOR_MENU));
fontid.deffontsettings.style = 0;
FontRegisterT(&fontid);
- mir_tstrcpy(fontid.backgroundName, LPGENT("Selected background"));
+ mir_tstrcpy(fontid.backgroundName, LPGENW("Selected background"));
- mir_tstrcpy(fontid.name, LPGENT("Selected contact name (color)"));
+ mir_tstrcpy(fontid.name, LPGENW("Selected contact name (color)"));
mir_strcpy(fontid.prefix, "fntNameSel");
fontid.deffontsettings.colour = GetSysColor(COLOR_HIGHLIGHTTEXT);
fontid.deffontsettings.style = DBFONTF_BOLD;
FontRegisterT(&fontid);
- mir_tstrcpy(fontid.name, LPGENT("Selected second line (color)"));
+ mir_tstrcpy(fontid.name, LPGENW("Selected second line (color)"));
mir_strcpy(fontid.prefix, "fntSecondSel");
fontid.deffontsettings.colour = sttShadeColor(GetSysColor(COLOR_HIGHLIGHTTEXT), GetSysColor(COLOR_HIGHLIGHT));
fontid.deffontsettings.style = 0;
@@ -211,15 +211,15 @@ int ProcessModulesLoaded(WPARAM, LPARAM) /////////////////////////////////////////////////////////////////////////////////////
ColourIDT colourid = { sizeof(colourid) };
- mir_tstrcpy(colourid.group, LPGENT("Favorite Contacts"));
+ mir_tstrcpy(colourid.group, LPGENW("Favorite Contacts"));
mir_strcpy(colourid.dbSettingsGroup, "FavContacts");
- mir_tstrcpy(colourid.name, LPGENT("Background"));
+ mir_tstrcpy(colourid.name, LPGENW("Background"));
mir_strcpy(colourid.setting, "BackColour");
colourid.defcolour = GetSysColor(COLOR_MENU);
ColourRegisterT(&colourid);
- mir_tstrcpy(colourid.name, LPGENT("Selected background"));
+ mir_tstrcpy(colourid.name, LPGENW("Selected background"));
mir_strcpy(colourid.setting, "SelectedColour");
colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT);
ColourRegisterT(&colourid);
diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp index 3345635863..db57964ac1 100644 --- a/plugins/FileAsMessage/src/main.cpp +++ b/plugins/FileAsMessage/src/main.cpp @@ -149,8 +149,8 @@ int OnOptInitialise(WPARAM wParam, LPARAM lParam) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.ptszTitle = _T(SERVICE_TITLE);
- odp.ptszGroup = LPGENT("Events");
+ odp.pszTitle = SERVICE_TITLE;
+ odp.pwszGroup = LPGENW("Events");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = OptionsDlgProc;
Options_AddPage(wParam, &odp);
diff --git a/plugins/FingerprintNG/src/finger_groups.h b/plugins/FingerprintNG/src/finger_groups.h index 89314cd237..965a1938f1 100644 --- a/plugins/FingerprintNG/src/finger_groups.h +++ b/plugins/FingerprintNG/src/finger_groups.h @@ -1,127 +1,127 @@ case MIRANDA_CASE:
if (db_get_b(NULL, MODULENAME, "GroupMiranda", 1))
- return LPGENT("Client icons") L"/" LPGENT("Miranda clients");
+ return LPGENW("Client icons") L"/" LPGENW("Miranda clients");
break;
case MIRANDA_VERSION_CASE:
if (db_get_b(NULL, MODULENAME, "GroupMirandaVersion", 1))
- return LPGENT("Client icons") L"/" LPGENT("Miranda clients");
+ return LPGENW("Client icons") L"/" LPGENW("Miranda clients");
break;
case MIRANDA_PACKS_CASE:
if (db_get_b(NULL, MODULENAME, "GroupMirandaPacks", 1))
- return LPGENT("Client icons") L"/" LPGENT("Miranda clients") L"/" LPGENT("Pack overlays");
+ return LPGENW("Client icons") L"/" LPGENW("Miranda clients") L"/" LPGENW("Pack overlays");
break;
case MULTI_CASE:
if (db_get_b(NULL, MODULENAME, "GroupMulti", 1))
- return LPGENT("Client icons") L"/" LPGENT("Multi-proto clients");
+ return LPGENW("Client icons") L"/" LPGENW("Multi-proto clients");
break;
case AIM_CASE:
if (db_get_b(NULL, MODULENAME, "GroupAIM", 1))
- return LPGENT("Client icons") L"/" LPGENT("AIM clients");
+ return LPGENW("Client icons") L"/" LPGENW("AIM clients");
break;
case GG_CASE:
if (db_get_b(NULL, MODULENAME, "GroupGG", 1))
- return LPGENT("Client icons") L"/" LPGENT("Gadu-Gadu clients");
+ return LPGENW("Client icons") L"/" LPGENW("Gadu-Gadu clients");
break;
case ICQ_CASE:
if (db_get_b(NULL, MODULENAME, "GroupICQ", 1))
- return LPGENT("Client icons") L"/" LPGENT("ICQ clients");
+ return LPGENW("Client icons") L"/" LPGENW("ICQ clients");
break;
case IRC_CASE:
if (db_get_b(NULL, MODULENAME, "GroupIRC", 1))
- return LPGENT("Client icons") L"/" LPGENT("IRC clients");
+ return LPGENW("Client icons") L"/" LPGENW("IRC clients");
break;
case JABBER_CASE:
if (db_get_b(NULL, MODULENAME, "GroupJabber", 1))
- return LPGENT("Client icons") L"/" LPGENT("Jabber clients");
+ return LPGENW("Client icons") L"/" LPGENW("Jabber clients");
break;
case MRA_CASE:
if (db_get_b(NULL, MODULENAME, "GroupMRA", 1))
- return LPGENT("Client icons") L"/" LPGENT("MRA clients");
+ return LPGENW("Client icons") L"/" LPGENW("MRA clients");
break;
case MSN_CASE:
if (db_get_b(NULL, MODULENAME, "GroupMSN", 1))
- return LPGENT("Client icons") L"/" LPGENT("MSN clients");
+ return LPGENW("Client icons") L"/" LPGENW("MSN clients");
break;
case QQ_CASE:
if (db_get_b(NULL, MODULENAME, "GroupQQ", 1))
- return LPGENT("Client icons") L"/" LPGENT("QQ clients");
+ return LPGENW("Client icons") L"/" LPGENW("QQ clients");
break;
case RSS_CASE:
if (db_get_b(NULL, MODULENAME, "GroupRSS", 1))
- return LPGENT("Client icons") L"/" LPGENT("RSS clients");
+ return LPGENW("Client icons") L"/" LPGENW("RSS clients");
break;
case TLEN_CASE:
if (db_get_b(NULL, MODULENAME, "GroupTlen", 1))
- return LPGENT("Client icons") L"/" LPGENT("Tlen clients");
+ return LPGENW("Client icons") L"/" LPGENW("Tlen clients");
break;
case WEATHER_CASE:
if (db_get_b(NULL, MODULENAME, "GroupWeather", 1))
- return LPGENT("Client icons") L"/" LPGENT("Weather clients");
+ return LPGENW("Client icons") L"/" LPGENW("Weather clients");
break;
case YAHOO_CASE:
if (db_get_b(NULL, MODULENAME, "GroupYahoo", 1))
- return LPGENT("Client icons") L"/" LPGENT("Yahoo clients");
+ return LPGENW("Client icons") L"/" LPGENW("Yahoo clients");
break;
case FACEBOOK_CASE:
if (db_get_b(NULL, MODULENAME, "GroupFacebook", 1))
- return LPGENT("Client icons") L"/" LPGENT("Facebook clients");
+ return LPGENW("Client icons") L"/" LPGENW("Facebook clients");
break;
case VK_CASE:
if (db_get_b(NULL, MODULENAME, "GroupVK", 1))
- return LPGENT("Client icons") L"/" LPGENT("VKontakte clients");
+ return LPGENW("Client icons") L"/" LPGENW("VKontakte clients");
break;
case OTHER_PROTOS_CASE:
if (db_get_b(NULL, MODULENAME, "GroupOtherProtos", 1))
- return LPGENT("Client icons") L"/" LPGENT("Other protocols");
+ return LPGENW("Client icons") L"/" LPGENW("Other protocols");
break;
case OTHERS_CASE:
if (db_get_b(NULL, MODULENAME, "GroupOthers", 1))
- return LPGENT("Client icons") L"/" LPGENT("Other icons");
+ return LPGENW("Client icons") L"/" LPGENW("Other icons");
break;
case OVERLAYS_RESOURCE_CASE:
if (db_get_b(NULL, MODULENAME, "GroupOverlaysResource", 1))
- return LPGENT("Client icons") L"/" LPGENT("Overlays") L"/" LPGENT("Resource");
+ return LPGENW("Client icons") L"/" LPGENW("Overlays") L"/" LPGENW("Resource");
break;
case OVERLAYS_PLATFORM_CASE:
if (db_get_b(NULL, MODULENAME, "GroupOverlaysPlatform", 1))
- return LPGENT("Client icons") L"/" LPGENT("Overlays") L"/" LPGENT("Platform");
+ return LPGENW("Client icons") L"/" LPGENW("Overlays") L"/" LPGENW("Platform");
break;
case OVERLAYS_UNICODE_CASE:
if (db_get_b(NULL, MODULENAME, "GroupOverlaysUnicode", 1))
- return LPGENT("Client icons") L"/" LPGENT("Overlays") L"/" LPGENT("Platform");
+ return LPGENW("Client icons") L"/" LPGENW("Overlays") L"/" LPGENW("Platform");
break;
case OVERLAYS_SECURITY_CASE:
if (db_get_b(NULL, MODULENAME, "GroupOverlaysSecurity", 1))
- return LPGENT("Client icons") L"/" LPGENT("Overlays") L"/" LPGENT("Security");
+ return LPGENW("Client icons") L"/" LPGENW("Overlays") L"/" LPGENW("Security");
break;
case OVERLAYS_PROTO_CASE:
if (db_get_b(NULL, MODULENAME, "GroupOverlaysProtos", 1))
- return LPGENT("Client icons") L"/" LPGENT("Overlays") L"/" LPGENT("Protocol");
+ return LPGENW("Client icons") L"/" LPGENW("Overlays") L"/" LPGENW("Protocol");
break;
default:
- return LPGENT("Client icons");
+ return LPGENW("Client icons");
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index a5f3394462..4ca28bdac2 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" static UINT g_LPCodePage; -static TCHAR g_szSkinLib[MAX_PATH]; +static wchar_t g_szSkinLib[MAX_PATH]; static HANDLE hExtraIcon = NULL; static HANDLE hFolderChanged = NULL, hIconFolder = NULL; @@ -37,7 +37,7 @@ static INT_PTR ServiceGetClientIconW(WPARAM wParam, LPARAM lParam); * prepares upperstring masks and registers them in IcoLib */ -static TCHAR* getSectionName(int flag) +static wchar_t* getSectionName(int flag) { switch (flag) { @@ -58,19 +58,19 @@ void __fastcall Prepare(KN_FP_MASK* mask, bool bEnable) return; size_t iMaskLen = mir_tstrlen(mask->szMask) + 1; - LPTSTR pszNewMask = (LPTSTR)HeapAlloc(hHeap, HEAP_NO_SERIALIZE, iMaskLen * sizeof(TCHAR)); - _tcscpy_s(pszNewMask, iMaskLen, mask->szMask); - _tcsupr_s(pszNewMask, iMaskLen); + LPTSTR pszNewMask = (LPTSTR)HeapAlloc(hHeap, HEAP_NO_SERIALIZE, iMaskLen * sizeof(wchar_t)); + wcscpy_s(pszNewMask, iMaskLen, mask->szMask); + _wcsupr_s(pszNewMask, iMaskLen); mask->szMaskUpper = pszNewMask; - TCHAR destfile[MAX_PATH]; + wchar_t destfile[MAX_PATH]; if (mask->iIconIndex == IDI_NOTFOUND || mask->iIconIndex == IDI_UNKNOWN || mask->iIconIndex == IDI_UNDETECTED) GetModuleFileName(g_hInst, destfile, MAX_PATH); else { - _tcsncpy_s(destfile, g_szSkinLib, _TRUNCATE); + wcsncpy_s(destfile, g_szSkinLib, _TRUNCATE); struct _stat64i32 stFileInfo; - if (_tstat(destfile, &stFileInfo) == -1) + if (_wstat(destfile, &stFileInfo) == -1) return; } @@ -80,10 +80,10 @@ void __fastcall Prepare(KN_FP_MASK* mask, bool bEnable) SKINICONDESC sid = { 0 }; sid.flags = SIDF_ALL_TCHAR; - sid.section.t = SectName; + sid.section.w = SectName; sid.pszName = mask->szIconName; - sid.description.t = mask->szClientDescription; - sid.defaultFile.t = destfile; + sid.description.w = mask->szClientDescription; + sid.defaultFile.w = destfile; sid.iDefaultIndex = -mask->iIconIndex; mask->hIcolibItem = IcoLib_AddIcon(&sid); } @@ -237,7 +237,7 @@ BOOL __fastcall WildCompareW(LPWSTR wszName, LPWSTR wszMask) return FALSE; } -static void MatchMasks(TCHAR* szMirVer, short *base, short *overlay, short *overlay2, short *overlay3, short *overlay4) +static void MatchMasks(wchar_t* szMirVer, short *base, short *overlay, short *overlay2, short *overlay3, short *overlay4) { int i = 0, j = -1, k = -1, n = -1, m = -1; @@ -250,11 +250,11 @@ static void MatchMasks(TCHAR* szMirVer, short *base, short *overlay, short *over continue; if (p.iIconIndex != IDI_NOTFOUND && p.iIconIndex != IDI_UNKNOWN && p.iIconIndex != IDI_UNDETECTED) { - TCHAR destfile[MAX_PATH]; - _tcsncpy_s(destfile, g_szSkinLib, _TRUNCATE); + wchar_t destfile[MAX_PATH]; + wcsncpy_s(destfile, g_szSkinLib, _TRUNCATE); struct _stat64i32 stFileInfo; - if (_tstat(destfile, &stFileInfo) == -1) + if (_wstat(destfile, &stFileInfo) == -1) i = NOTFOUND_MASK_NUMBER; } break; @@ -272,7 +272,7 @@ static void MatchMasks(TCHAR* szMirVer, short *base, short *overlay, short *over continue; struct _stat64i32 stFileInfo; - if (_tstat(g_szSkinLib, &stFileInfo) != -1) + if (_wstat(g_szSkinLib, &stFileInfo) != -1) break; } @@ -327,7 +327,7 @@ void __fastcall GetIconsIndexesA(LPSTR szMirVer, short *base, short *overlay, sh } LPTSTR tszMirVerUp = mir_a2t(szMirVer); - _tcsupr(tszMirVerUp); + wcsupr(tszMirVerUp); MatchMasks(tszMirVerUp, base, overlay, overlay2, overlay3, overlay4); mir_free(tszMirVerUp); } diff --git a/plugins/FingerprintNG/src/masks.cpp b/plugins/FingerprintNG/src/masks.cpp index a7e8f7ad37..fe07ab9854 100644 --- a/plugins/FingerprintNG/src/masks.cpp +++ b/plugins/FingerprintNG/src/masks.cpp @@ -46,17 +46,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * In order to get "Unknown" client, last mask should be "?*".
*/
-#define NIGHTLY_CORE_VERSION L"|*Miranda*NG*" _T(MIRANDA_VERSION_CORE_STRING) L"*"
-
KN_FP_MASK def_kn_fp_mask[] =
{// {"Client_IconName", L"|^*Mask*|*names*", L"Icon caption", IDI_RESOURCE_ID, CLIENT_CASE, OVERLAY? },
//#########################################################################################################################################################################
//################################# MIRANDA ###########################################################################################################################
//#########################################################################################################################################################################
- { "client_Miranda_NG", L"|*nightly.miranda.im*" NIGHTLY_CORE_VERSION, L"Miranda NG", IDI_MIRANDA_NG, MIRANDA_CASE },
+ { "client_Miranda_NG", L"|*nightly.miranda.im*" L"|*Miranda*NG*" _A2W(MIRANDA_VERSION_CORE_STRING) L"*", L"Miranda NG", IDI_MIRANDA_NG, MIRANDA_CASE },
- { "client_Miranda_NG_stbl", L"|Miranda*NG*", LPGENT("Miranda NG stable"), IDI_MIRANDA_NG_STABLE, MIRANDA_CASE },
+ { "client_Miranda_NG_stbl", L"|Miranda*NG*", LPGENW("Miranda NG stable"), IDI_MIRANDA_NG_STABLE, MIRANDA_CASE },
{ "client_Miranda_010xx", L"Miranda*IM*0.10.*", L"Miranda IM v0.10.x.x", IDI_MIRANDA_010X, MIRANDA_CASE },
{ "client_Miranda_09XX", L"|*Miranda*IM*0.9*"
@@ -70,9 +68,9 @@ KN_FP_MASK def_kn_fp_mask[] = { "client_Miranda_05XX", L"*Miranda*0.5*", L"Miranda IM v0.5.x.x", IDI_MIRANDA_05XX, MIRANDA_CASE },
{ "client_Miranda_04XX", L"*Miranda*0.4*", L"Miranda IM v0.4.x.x", IDI_MIRANDA_04XX, MIRANDA_CASE },
- { "client_Miranda_old", L"*Miranda*0.?*", LPGENT("Miranda IM (old versions)"), IDI_MIRANDA_OLD, MIRANDA_CASE },
+ { "client_Miranda_old", L"*Miranda*0.?*", LPGENW("Miranda IM (old versions)"), IDI_MIRANDA_OLD, MIRANDA_CASE },
- { "client_Miranda_unknown", L"*Miranda*", LPGENT("Miranda (unknown)"), IDI_MIRANDA_UNKNOWN, MIRANDA_CASE },
+ { "client_Miranda_unknown", L"*Miranda*", LPGENW("Miranda (unknown)"), IDI_MIRANDA_UNKNOWN, MIRANDA_CASE },
//#########################################################################################################################################################################
//################################# MULTI-PROTOCOL ####################################################################################################################
@@ -205,7 +203,7 @@ KN_FP_MASK def_kn_fp_mask[] = { "client_SmartICQ", L"Smart*ICQ*", L"SmartICQ", IDI_SMARTICQ, ICQ_CASE, TRUE },
{ "client_StrICQ", L"StrICQ*", L"StrICQ", IDI_STRICQ, ICQ_CASE, TRUE },
- { "client_spam", L"*spam*", LPGENT("spam client"), IDI_SPAM, ICQ_CASE, TRUE },
+ { "client_spam", L"*spam*", LPGENW("spam client"), IDI_SPAM, ICQ_CASE, TRUE },
{ "client_libicq2k", L"libicq*", L"LibICQ/JIT", IDI_LIBICQ2000, ICQ_CASE, TRUE },
{ "client_TICQClient", L"*TICQ*Client*", L"TICQClient (Delphi lib)", IDI_TICQ, ICQ_CASE, TRUE },
@@ -405,7 +403,7 @@ KN_FP_MASK def_kn_fp_mask[] = { "client_mobber", L"*mobber*", L"mobber", IDI_MOBBER, JABBER_CASE, TRUE },
{ "client_myJabber", L"*myJabber*", L"myJabber", IDI_MYJABBER, JABBER_CASE, TRUE },
{ "client_orkut", L"*orkut*", L"orkut", IDI_ORKUT, JABBER_CASE, TRUE },
- { "client_pjc", L"|*PJC*|*pjc.googlecode.com*", LPGENT("PHP Jabber Client"), IDI_PJC, JABBER_CASE, TRUE },
+ { "client_pjc", L"|*PJC*|*pjc.googlecode.com*", LPGENW("PHP Jabber Client"), IDI_PJC, JABBER_CASE, TRUE },
{ "client_saje", L"*saje*", L"saje", IDI_SAJE, JABBER_CASE, TRUE },
{ "client_schuelervz", L"*schuelervz*", L"SchulerVZ", IDI_SCHULERVZ, JABBER_CASE, TRUE },
{ "client_studivz", L"*studivz*", L"StudiVZ", IDI_STUDIVZ, JABBER_CASE, TRUE },
@@ -439,7 +437,7 @@ KN_FP_MASK def_kn_fp_mask[] = { "client_KVIrc", L"*KVIrc*", L"KVIrc", IDI_KVIRC, IRC_CASE, TRUE },
{ "client_Klient", L"*Klient*", L"Klient", IDI_KLIENT, IRC_CASE, TRUE },
{ "client_Konversation", L"*Konversation*", L"Konversation", IDI_KONVERSATION, IRC_CASE, TRUE },
- { "client_MP3Script", L"*MP3*Script*", LPGENT("MP3 Script for mIRC"), IDI_MP3_SCRIPT, IRC_CASE, TRUE },
+ { "client_MP3Script", L"*MP3*Script*", LPGENW("MP3 Script for mIRC"), IDI_MP3_SCRIPT, IRC_CASE, TRUE },
{ "client_NeoRaTrion", L"*NeoRa*Trion*", L"NeoRa Trion", IDI_NEORATRION, IRC_CASE, TRUE },
{ "client_Nettalk", L"*Nettalk*", L"Nettalk", IDI_NETTALK, IRC_CASE, TRUE },
{ "client_NoNameScript", L"*NoName*Script*", L"NoNameScript", IDI_NONAME_SCRIPT, IRC_CASE, TRUE },
@@ -522,10 +520,10 @@ KN_FP_MASK def_kn_fp_mask[] = //#########################################################################################################################################################################
{ "client_MRA_official", L"|magent*|Mail.ru Agent*official*"
L"|Mail.ru Agent*PC*"
- L"|*agent.mail.ru*", LPGENT("Mail.Ru Agent (official)"), IDI_MAIL_RU_OFFICIAL, MRA_CASE, TRUE },
+ L"|*agent.mail.ru*", LPGENW("Mail.Ru Agent (official)"), IDI_MAIL_RU_OFFICIAL, MRA_CASE, TRUE },
{ "client_MRA_Mobile", L"|MobileAgent*|Mail.ru Agent*Symbian*", L"Mail.Ru Mobile Agent", IDI_MAIL_RU_MOBILE, MRA_CASE, TRUE },
{ "client_MRA_web", L"|webagent*|*Web Agent*", L"Mail.Ru Web Agent", IDI_MAIL_RU_WEBAGENT, MRA_CASE, TRUE },
- { "client_MRA_unknown", L"|Mail.ru Agent*|MRA client", LPGENT("Mail.Ru (unknown client)"), IDI_MAIL_RU_UNKNOWN, MRA_CASE },
+ { "client_MRA_unknown", L"|Mail.ru Agent*|MRA client", LPGENW("Mail.Ru (unknown client)"), IDI_MAIL_RU_UNKNOWN, MRA_CASE },
//#########################################################################################################################################################################
//################################# YAHOO #############################################################################################################################
@@ -569,7 +567,7 @@ KN_FP_MASK def_kn_fp_mask[] = { "client_QQConcept", L"QQ*Concept*", L"QQ Concept", IDI_QQCONCEPT, QQ_CASE, TRUE },
{ "client_QQCRM", L"QQ*CRM*", L"QQ CRM", IDI_QQCRM, QQ_CASE, TRUE },
{ "client_QQSilver", L"QQ*Silverlight*", L"QQ Silverlight", IDI_QQSILVER, QQ_CASE, TRUE },
- { "client_TM2008", L"|TM2008*|TM2009*|TM2010*", LPGENT("TM 2008 and >"), IDI_TM2008, QQ_CASE },
+ { "client_TM2008", L"|TM2008*|TM2009*|TM2010*", LPGENW("TM 2008 and >"), IDI_TM2008, QQ_CASE },
{ "client_TM", L"TM*", L"TM", IDI_TM, QQ_CASE },
{ "client_QQInt", L"QQ*International*", L"QQ International", IDI_QQINT, QQ_CASE },
{ "client_YamQQ", L"YamQQ*", L"Yam QQ", IDI_YAMQQ, QQ_CASE },
@@ -579,12 +577,12 @@ KN_FP_MASK def_kn_fp_mask[] = //#########################################################################################################################################################################
//################################# GADU-GADU #########################################################################################################################
//#########################################################################################################################################################################
- { "client_GG", L"|Gadu-Gadu*|GG*", LPGENT("Gadu-Gadu client"), IDI_GG, GG_CASE },
+ { "client_GG", L"|Gadu-Gadu*|GG*", LPGENW("Gadu-Gadu client"), IDI_GG, GG_CASE },
//#########################################################################################################################################################################
//################################# TLEN ##############################################################################################################################
//#########################################################################################################################################################################
- { "client_Tlen", L"*Tlen*", LPGENT("Tlen.pl client"), IDI_TLEN, TLEN_CASE },
+ { "client_Tlen", L"*Tlen*", LPGENW("Tlen.pl client"), IDI_TLEN, TLEN_CASE },
//#########################################################################################################################################################################
//################################# Facebook ##########################################################################################################################
@@ -607,11 +605,11 @@ KN_FP_MASK def_kn_fp_mask[] = { "client_Pidgin", L"|*Pidgin*|*libpurple*|Purple*", L"Pidgin (libpurple)", IDI_PIDGIN, MULTI_CASE },
- { "client_Python", L"|*Python*|Py*|*ταλιςμαη*", LPGENT("Python-based clients"), IDI_PYTHON, MULTI_CASE },
+ { "client_Python", L"|*Python*|Py*|*ταλιςμαη*", LPGENW("Python-based clients"), IDI_PYTHON, MULTI_CASE },
- { "client_Jabber", L"*Jabber*client*", LPGENT("Jabber client"), IDI_JABBER, JABBER_CASE, TRUE },
+ { "client_Jabber", L"*Jabber*client*", LPGENW("Jabber client"), IDI_JABBER, JABBER_CASE, TRUE },
- { "client_XMPP", L"|*XMPP*|Mrim*|*DRQZ00fz5WPn1gH+*", LPGENT("XMPP client"), IDI_XMPP, JABBER_CASE },
+ { "client_XMPP", L"|*XMPP*|Mrim*|*DRQZ00fz5WPn1gH+*", LPGENW("XMPP client"), IDI_XMPP, JABBER_CASE },
{ "client_Hangouts", L"messaging-*", L"Google+ Hangouts", IDI_HANGOUTS, OTHER_PROTOS_CASE, TRUE },
@@ -627,9 +625,9 @@ KN_FP_MASK def_kn_fp_mask[] = //################################# UNDEFINED CLIENTS #################################################################################################################
//#########################################################################################################################################################################
- { "client_Notfound", L"Notfound", LPGENT("Client not found"), IDI_NOTFOUND, OTHERS_CASE, TRUE },
- { "client_Unknown", L"|*Unknown*|...", LPGENT("Unknown client"), IDI_UNKNOWN, OTHERS_CASE, TRUE },
- { "client_Undetected", L"?*", LPGENT("Undetected client"), IDI_UNDETECTED, OTHERS_CASE, TRUE },
+ { "client_Notfound", L"Notfound", LPGENW("Client not found"), IDI_NOTFOUND, OTHERS_CASE, TRUE },
+ { "client_Unknown", L"|*Unknown*|...", LPGENW("Unknown client"), IDI_UNKNOWN, OTHERS_CASE, TRUE },
+ { "client_Undetected", L"?*", LPGENW("Undetected client"), IDI_UNDETECTED, OTHERS_CASE, TRUE },
};
@@ -688,76 +686,76 @@ KN_FP_MASK def_kn_fp_overlays_mask[] = //#########################################################################################################################################################################
//################################# PROTO OVERLAYS ####################################################################################################################
//#########################################################################################################################################################################
- { "client_AIM_overlay", L"|^AIM*|*AIM*", LPGENT("AIM overlay"), IDI_AIM_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_ICQJ_Plus_over", L"*ICQ*Plus*", LPGENT("ICQJ Plus Mod overlay"), IDI_ICQJ_PLUS_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_ICQJ_overlay", L"|^ICQ|^ICQ*|*ICQ*|MRA client", LPGENT("ICQJ overlay"), IDI_ICQJ_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_IRC_overlay", L"|^IRC*|Miranda*IRC*", LPGENT("IRC overlay"), IDI_IRC_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_JGmail_overlay", L"*JGmail*", LPGENT("JGmail overlay"), IDI_GMAIL_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_JGTalk_overlay", L"*JGTalk*", LPGENT("JGTalk overlay"), IDI_JGTALK_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_Jabber_overlay", L"|^jabber*|Miranda*Jabber*|py*jabb*", LPGENT("Jabber overlay"), IDI_JABBER_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_MSN_overlay", L"|^MSN*|*Miranda*MSN*", LPGENT("MSN overlay"), IDI_MSN_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_QQ_overlay", L"|Miranda*QQ*|MIM*QQ*", LPGENT("QQ overlay"), IDI_QQ_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_Tlen_overlay", L"|^tlen*|*tlen*", LPGENT("Tlen.pl overlay"), IDI_TLEN_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_Yahoo_overlay", L"|^Yahoo*|*yahoo*", LPGENT("Yahoo overlay"), IDI_YAHOO_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_AIM_overlay", L"|^AIM*|*AIM*", LPGENW("AIM overlay"), IDI_AIM_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_ICQJ_Plus_over", L"*ICQ*Plus*", LPGENW("ICQJ Plus Mod overlay"), IDI_ICQJ_PLUS_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_ICQJ_overlay", L"|^ICQ|^ICQ*|*ICQ*|MRA client", LPGENW("ICQJ overlay"), IDI_ICQJ_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_IRC_overlay", L"|^IRC*|Miranda*IRC*", LPGENW("IRC overlay"), IDI_IRC_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_JGmail_overlay", L"*JGmail*", LPGENW("JGmail overlay"), IDI_GMAIL_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_JGTalk_overlay", L"*JGTalk*", LPGENW("JGTalk overlay"), IDI_JGTALK_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_Jabber_overlay", L"|^jabber*|Miranda*Jabber*|py*jabb*", LPGENW("Jabber overlay"), IDI_JABBER_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_MSN_overlay", L"|^MSN*|*Miranda*MSN*", LPGENW("MSN overlay"), IDI_MSN_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_QQ_overlay", L"|Miranda*QQ*|MIM*QQ*", LPGENW("QQ overlay"), IDI_QQ_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_Tlen_overlay", L"|^tlen*|*tlen*", LPGENW("Tlen.pl overlay"), IDI_TLEN_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_Yahoo_overlay", L"|^Yahoo*|*yahoo*", LPGENW("Yahoo overlay"), IDI_YAHOO_OVERLAY, OVERLAYS_PROTO_CASE },
{ "client_MRA_overlay", L"|^MRA*|^Mail.ru*"
L"|*MRA*|*Mail.ru*IM*|Mrim*"
- L"|*DRQZ00fz5WPn1gH+*|*nxthUwJANorB6+*|ICQ client", LPGENT("Mail.Ru Agent overlay"), IDI_MAILRU_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_VK_overlay", L"|Miranda*VKontakte*", LPGENT("VK overlay"), IDI_VK_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_Skype_overlay", L"|Miranda*Skype*", LPGENT("Skype overlay"), IDI_SKYPE_OVERLAY, OVERLAYS_PROTO_CASE },
+ L"|*DRQZ00fz5WPn1gH+*|*nxthUwJANorB6+*|ICQ client", LPGENW("Mail.Ru Agent overlay"), IDI_MAILRU_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_VK_overlay", L"|Miranda*VKontakte*", LPGENW("VK overlay"), IDI_VK_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_Skype_overlay", L"|Miranda*Skype*", LPGENW("Skype overlay"), IDI_SKYPE_OVERLAY, OVERLAYS_PROTO_CASE },
//#########################################################################################################################################################################
//################################# CLIENT VERSION OVERLAYS ###########################################################################################################
//#########################################################################################################################################################################
- { "client_ICQ3_over", L"ICQ*2003*", LPGENT("ICQ 2003 overlay"), IDI_ICQ3_OVERLAY, ICQ_CASE },
- { "client_ICQ4_over", L"|ICQ*4*|ICQ*lite*4*", LPGENT("ICQ Lite 4 overlay"), IDI_ICQ4_OVERLAY, ICQ_CASE },
- { "client_ICQ5_over", L"|ICQ*5*|ICQ*lite*5*|icq5*", LPGENT("ICQ v5.x overlay"), IDI_ICQ5_OVERLAY, ICQ_CASE },
- { "client_ICQ6_over", L"ICQ*6*", LPGENT("ICQ v6.x overlay"), IDI_ICQ6_OVERLAY, ICQ_CASE },
- { "client_ICQ7_over", L"ICQ*7*", LPGENT("ICQ v7.x overlay"), IDI_ICQ7_OVERLAY, ICQ_CASE },
- { "client_ICQ8_over", L"ICQ*8*", LPGENT("ICQ v8.x overlay"), IDI_ICQ8_OVERLAY, ICQ_CASE },
-
- { "client_Yahoo_11", L"*Yahoo 11*", LPGENT("Yahoo v11.x overlay"), IDI_YAHOO11_OVERLAY, YAHOO_CASE },
- { "client_Yahoo_10", L"*Yahoo 10*", LPGENT("Yahoo v10.x overlay"), IDI_YAHOO10_OVERLAY, YAHOO_CASE },
- { "client_Yahoo_9", L"*Yahoo 9*", LPGENT("Yahoo v9.x overlay"), IDI_YAHOO9_OVERLAY, YAHOO_CASE },
-
- { "client_GG_11", L"|Gadu-Gadu*11*|GG*11*", LPGENT("Gadu-Gadu v11 client"), IDI_GG11_OVERLAY, GG_CASE },
- { "client_GG_10", L"|Gadu-Gadu*10*|GG*10", LPGENT("Gadu-Gadu v10 client"), IDI_GG10_OVERLAY, GG_CASE },
- { "client_GG_9", L"|Gadu-Gadu*9*|GG*9*", LPGENT("Gadu-Gadu v9 client"), IDI_GG9_OVERLAY, GG_CASE },
- { "client_GG_8", L"|Gadu-Gadu*8*|GG*8*", LPGENT("Gadu-Gadu v8 client"), IDI_GG8_OVERLAY, GG_CASE },
-
- // {"client_Tlen_8", L"Tlen Protocol 1?", LPGENT("Tlen 8.x overlay"), IDI_TLEN8_OVERLAY, TLEN_CASE },
- { "client_Tlen_7", L"Tlen Protocol 16", LPGENT("Tlen 7.x overlay"), IDI_TLEN7_OVERLAY, TLEN_CASE },
- { "client_Tlen_6", L"Tlen Protocol 10", LPGENT("Tlen 6.x overlay"), IDI_TLEN6_OVERLAY, TLEN_CASE },
- { "client_Tlen_5", L"Tlen Protocol 7", LPGENT("Tlen 5.x overlay"), IDI_TLEN5_OVERLAY, TLEN_CASE },
-
- { "client_QQ_2012", L"|QQ2012*|TM2012*", LPGENT("TM/QQ 2012 overlay"), IDI_QQ_2012_OVERLAY, QQ_CASE },
- { "client_QQ_2011", L"|QQ2011*|TM2011*", LPGENT("TM/QQ 2011 overlay"), IDI_QQ_2011_OVERLAY, QQ_CASE },
- { "client_QQ_2010", L"|QQ2010*|TM2010*", LPGENT("TM/QQ 2010 overlay"), IDI_QQ_2010_OVERLAY, QQ_CASE },
- { "client_QQ_2009", L"|QQ2009*|TM2009*", LPGENT("TM/QQ 2009 overlay"), IDI_QQ_2009_OVERLAY, QQ_CASE },
- { "client_QQ_2008", L"|QQ2008*|TM2008*", LPGENT("TM/QQ 2008 overlay"), IDI_QQ_2008_OVERLAY, QQ_CASE },
- { "client_QQ_2007", L"|QQ2007*|TM2007*", LPGENT("TM/QQ 2007 overlay"), IDI_QQ_2007_OVERLAY, QQ_CASE },
- { "client_QQ_2006", L"|QQ2006*|TM2006*", LPGENT("TM/QQ 2006 overlay"), IDI_QQ_2006_OVERLAY, QQ_CASE },
- { "client_QQ_2005", L"|QQ2005*|TM2005*", LPGENT("TM/QQ 2005 overlay"), IDI_QQ_2005_OVERLAY, QQ_CASE },
- { "client_QQ_2004", L"QQ2004*", LPGENT("QQ 2004 overlay"), IDI_QQ_2004_OVERLAY, QQ_CASE },
- { "client_QQ_2003", L"|QQ2003*|TM 3.*", LPGENT("TM 3.x / QQ 2003 overlay"), IDI_QQ_2003_OVERLAY, QQ_CASE },
- { "client_TM_2002", L"TM 2.*", LPGENT("TM 2.x overlay"), IDI_QQ_2002_OVERLAY, QQ_CASE },
- { "client_TM_2001", L"TM 1.*", LPGENT("TM 1.x overlay"), IDI_QQ_2001_OVERLAY, QQ_CASE },
- { "client_QQ_2000", L"QQ2000*", LPGENT("QQ 2000 overlay"), IDI_QQ_2000_OVERLAY, QQ_CASE },
+ { "client_ICQ3_over", L"ICQ*2003*", LPGENW("ICQ 2003 overlay"), IDI_ICQ3_OVERLAY, ICQ_CASE },
+ { "client_ICQ4_over", L"|ICQ*4*|ICQ*lite*4*", LPGENW("ICQ Lite 4 overlay"), IDI_ICQ4_OVERLAY, ICQ_CASE },
+ { "client_ICQ5_over", L"|ICQ*5*|ICQ*lite*5*|icq5*", LPGENW("ICQ v5.x overlay"), IDI_ICQ5_OVERLAY, ICQ_CASE },
+ { "client_ICQ6_over", L"ICQ*6*", LPGENW("ICQ v6.x overlay"), IDI_ICQ6_OVERLAY, ICQ_CASE },
+ { "client_ICQ7_over", L"ICQ*7*", LPGENW("ICQ v7.x overlay"), IDI_ICQ7_OVERLAY, ICQ_CASE },
+ { "client_ICQ8_over", L"ICQ*8*", LPGENW("ICQ v8.x overlay"), IDI_ICQ8_OVERLAY, ICQ_CASE },
+
+ { "client_Yahoo_11", L"*Yahoo 11*", LPGENW("Yahoo v11.x overlay"), IDI_YAHOO11_OVERLAY, YAHOO_CASE },
+ { "client_Yahoo_10", L"*Yahoo 10*", LPGENW("Yahoo v10.x overlay"), IDI_YAHOO10_OVERLAY, YAHOO_CASE },
+ { "client_Yahoo_9", L"*Yahoo 9*", LPGENW("Yahoo v9.x overlay"), IDI_YAHOO9_OVERLAY, YAHOO_CASE },
+
+ { "client_GG_11", L"|Gadu-Gadu*11*|GG*11*", LPGENW("Gadu-Gadu v11 client"), IDI_GG11_OVERLAY, GG_CASE },
+ { "client_GG_10", L"|Gadu-Gadu*10*|GG*10", LPGENW("Gadu-Gadu v10 client"), IDI_GG10_OVERLAY, GG_CASE },
+ { "client_GG_9", L"|Gadu-Gadu*9*|GG*9*", LPGENW("Gadu-Gadu v9 client"), IDI_GG9_OVERLAY, GG_CASE },
+ { "client_GG_8", L"|Gadu-Gadu*8*|GG*8*", LPGENW("Gadu-Gadu v8 client"), IDI_GG8_OVERLAY, GG_CASE },
+
+ // {"client_Tlen_8", L"Tlen Protocol 1?", LPGENW("Tlen 8.x overlay"), IDI_TLEN8_OVERLAY, TLEN_CASE },
+ { "client_Tlen_7", L"Tlen Protocol 16", LPGENW("Tlen 7.x overlay"), IDI_TLEN7_OVERLAY, TLEN_CASE },
+ { "client_Tlen_6", L"Tlen Protocol 10", LPGENW("Tlen 6.x overlay"), IDI_TLEN6_OVERLAY, TLEN_CASE },
+ { "client_Tlen_5", L"Tlen Protocol 7", LPGENW("Tlen 5.x overlay"), IDI_TLEN5_OVERLAY, TLEN_CASE },
+
+ { "client_QQ_2012", L"|QQ2012*|TM2012*", LPGENW("TM/QQ 2012 overlay"), IDI_QQ_2012_OVERLAY, QQ_CASE },
+ { "client_QQ_2011", L"|QQ2011*|TM2011*", LPGENW("TM/QQ 2011 overlay"), IDI_QQ_2011_OVERLAY, QQ_CASE },
+ { "client_QQ_2010", L"|QQ2010*|TM2010*", LPGENW("TM/QQ 2010 overlay"), IDI_QQ_2010_OVERLAY, QQ_CASE },
+ { "client_QQ_2009", L"|QQ2009*|TM2009*", LPGENW("TM/QQ 2009 overlay"), IDI_QQ_2009_OVERLAY, QQ_CASE },
+ { "client_QQ_2008", L"|QQ2008*|TM2008*", LPGENW("TM/QQ 2008 overlay"), IDI_QQ_2008_OVERLAY, QQ_CASE },
+ { "client_QQ_2007", L"|QQ2007*|TM2007*", LPGENW("TM/QQ 2007 overlay"), IDI_QQ_2007_OVERLAY, QQ_CASE },
+ { "client_QQ_2006", L"|QQ2006*|TM2006*", LPGENW("TM/QQ 2006 overlay"), IDI_QQ_2006_OVERLAY, QQ_CASE },
+ { "client_QQ_2005", L"|QQ2005*|TM2005*", LPGENW("TM/QQ 2005 overlay"), IDI_QQ_2005_OVERLAY, QQ_CASE },
+ { "client_QQ_2004", L"QQ2004*", LPGENW("QQ 2004 overlay"), IDI_QQ_2004_OVERLAY, QQ_CASE },
+ { "client_QQ_2003", L"|QQ2003*|TM 3.*", LPGENW("TM 3.x / QQ 2003 overlay"), IDI_QQ_2003_OVERLAY, QQ_CASE },
+ { "client_TM_2002", L"TM 2.*", LPGENW("TM 2.x overlay"), IDI_QQ_2002_OVERLAY, QQ_CASE },
+ { "client_TM_2001", L"TM 1.*", LPGENW("TM 1.x overlay"), IDI_QQ_2001_OVERLAY, QQ_CASE },
+ { "client_QQ_2000", L"QQ2000*", LPGENW("QQ 2000 overlay"), IDI_QQ_2000_OVERLAY, QQ_CASE },
//#########################################################################################################################################################################
//################################# PLATFORM OVERLAYS #################################################################################################################
//#########################################################################################################################################################################
- { "client_on_Win32", L"|*Win*|* WM *|wmagent*|*Vista*", LPGENT("Windows overlay"), IDI_PLATFORM_WIN, OVERLAYS_PLATFORM_CASE },
- { "client_on_iOS", L"|*ipad*|*iphone*|*iOS*", LPGENT("iOS overlay (iPhone/iPad)"), IDI_PLATFORM_IOS, OVERLAYS_PLATFORM_CASE },
- { "client_on_Mac", L"|^*smack*|* Mac *|*mac*|*OSX*", LPGENT("MacOS overlay"), IDI_PLATFORM_MAC, OVERLAYS_PLATFORM_CASE },
- { "client_on_Linux", L"*Linux*", LPGENT("Linux overlay"), IDI_PLATFORM_LINUX, OVERLAYS_PLATFORM_CASE },
- { "client_on_Flash", L"|*Flash*|*Web*ICQ*", LPGENT("Flash overlay"), IDI_PLATFORM_FLASH, OVERLAYS_PLATFORM_CASE },
- { "client_on_Java", L"|*Java*|jagent*|ICQ2Go!*", LPGENT("Java overlay"), IDI_PLATFORM_JAVA, OVERLAYS_PLATFORM_CASE },
- { "client_on_Symbian", L"|*Symbian*|sagent*", LPGENT("Symbian overlay"), IDI_PLATFORM_SYMBIAN, OVERLAYS_PLATFORM_CASE },
- { "client_on_Amiga", L"*Amiga*", LPGENT("Amiga overlay"), IDI_PLATFORM_AMIGA, OVERLAYS_PLATFORM_CASE },
- { "client_on_Android", L"|*Android*|*(android)*", LPGENT("Android overlay"), IDI_PLATFORM_ANDROID, OVERLAYS_PLATFORM_CASE },
- { "client_on_Website", L"|*(website)*|*(Web)*", LPGENT("Website overlay"), IDI_PLATFORM_WEBSITE, OVERLAYS_PLATFORM_CASE },
- { "client_on_WinPhone", L"|*(wphone)*|*(WP)*", LPGENT("Windows Phone overlay"), IDI_PLATFORM_WINPHONE, OVERLAYS_PLATFORM_CASE },
- { "client_on_mobile", L"*(mobile)*", LPGENT("Mobile overlay"), IDI_PLATFORM_MOBILE, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Win32", L"|*Win*|* WM *|wmagent*|*Vista*", LPGENW("Windows overlay"), IDI_PLATFORM_WIN, OVERLAYS_PLATFORM_CASE },
+ { "client_on_iOS", L"|*ipad*|*iphone*|*iOS*", LPGENW("iOS overlay (iPhone/iPad)"), IDI_PLATFORM_IOS, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Mac", L"|^*smack*|* Mac *|*mac*|*OSX*", LPGENW("MacOS overlay"), IDI_PLATFORM_MAC, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Linux", L"*Linux*", LPGENW("Linux overlay"), IDI_PLATFORM_LINUX, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Flash", L"|*Flash*|*Web*ICQ*", LPGENW("Flash overlay"), IDI_PLATFORM_FLASH, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Java", L"|*Java*|jagent*|ICQ2Go!*", LPGENW("Java overlay"), IDI_PLATFORM_JAVA, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Symbian", L"|*Symbian*|sagent*", LPGENW("Symbian overlay"), IDI_PLATFORM_SYMBIAN, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Amiga", L"*Amiga*", LPGENW("Amiga overlay"), IDI_PLATFORM_AMIGA, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Android", L"|*Android*|*(android)*", LPGENW("Android overlay"), IDI_PLATFORM_ANDROID, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Website", L"|*(website)*|*(Web)*", LPGENW("Website overlay"), IDI_PLATFORM_WEBSITE, OVERLAYS_PLATFORM_CASE },
+ { "client_on_WinPhone", L"|*(wphone)*|*(WP)*", LPGENW("Windows Phone overlay"), IDI_PLATFORM_WINPHONE, OVERLAYS_PLATFORM_CASE },
+ { "client_on_mobile", L"*(mobile)*", LPGENW("Mobile overlay"), IDI_PLATFORM_MOBILE, OVERLAYS_PLATFORM_CASE },
};
int DEFAULT_KN_FP_OVERLAYS_COUNT = _countof(def_kn_fp_overlays_mask);
@@ -770,37 +768,37 @@ int DEFAULT_KN_FP_OVERLAYS_COUNT = _countof(def_kn_fp_overlays_mask); KN_FP_MASK def_kn_fp_overlays2_mask[] =
{// {"Client_IconName", L"|^*Mask*|*names*", L"Icon caption", IDI_RESOURCE_ID, CLIENT_CASE, OVERLAY? },
- { "client_debug_overlay", L"|*[*debug*]*|*test*|*теÑÑ‚*", LPGENT("debug overlay"), IDI_DEBUG_OVERLAY, OVERLAYS_RESOURCE_CASE },
- { "client_office_overlay", L"|*[*office*]*|*[*офиÑ*]*", LPGENT("office overlay"), IDI_OFFICE_OVERLAY, OVERLAYS_RESOURCE_CASE },
- { "client_mobile_overlay", L"|*[*mobile*]*|*[*pda*]*", LPGENT("mobile overlay"), IDI_MOBILE_OVERLAY, OVERLAYS_RESOURCE_CASE },
- { "client_home_overlay", L"|*[*home*]*|*[*дом*]*|*[*хоме*]*", LPGENT("home overlay"), IDI_HOME_OVERLAY, OVERLAYS_RESOURCE_CASE },
+ { "client_debug_overlay", L"|*[*debug*]*|*test*|*теÑÑ‚*", LPGENW("debug overlay"), IDI_DEBUG_OVERLAY, OVERLAYS_RESOURCE_CASE },
+ { "client_office_overlay", L"|*[*office*]*|*[*офиÑ*]*", LPGENW("office overlay"), IDI_OFFICE_OVERLAY, OVERLAYS_RESOURCE_CASE },
+ { "client_mobile_overlay", L"|*[*mobile*]*|*[*pda*]*", LPGENW("mobile overlay"), IDI_MOBILE_OVERLAY, OVERLAYS_RESOURCE_CASE },
+ { "client_home_overlay", L"|*[*home*]*|*[*дом*]*|*[*хоме*]*", LPGENW("home overlay"), IDI_HOME_OVERLAY, OVERLAYS_RESOURCE_CASE },
{ "client_work_overlay", L"|*[*work*]*|*wrk*"
- L"|*[*работа*]*|*ворк*", LPGENT("work overlay"), IDI_WORK_OVERLAY, OVERLAYS_RESOURCE_CASE },
+ L"|*[*работа*]*|*ворк*", LPGENW("work overlay"), IDI_WORK_OVERLAY, OVERLAYS_RESOURCE_CASE },
{ "client_note_overlay", L"|*[*note*]*|*[*laptop*]*"
L"|*[*нетбу*]*|*[*ноут*]*|*[*ноте*]*"
L"|*[*кирпич*]*|*[*portable*]*"
- L"|*[*flash*]*|*[*usb*]*", LPGENT("notebook overlay"), IDI_NOTEBOOK_OVERLAY, OVERLAYS_RESOURCE_CASE },
+ L"|*[*flash*]*|*[*usb*]*", LPGENW("notebook overlay"), IDI_NOTEBOOK_OVERLAY, OVERLAYS_RESOURCE_CASE },
// {"client_MirNG_09_over", L"*Miranda*NG*\?.\?\?.9.*", L"Miranda NG v0.9 #2 overlay", IDI_MIRANDA_NG_V9, MIRANDA_VERSION_CASE },
// {"client_MirNG_08_over", L"*Miranda*NG*\?.\?\?.8.*", L"Miranda NG v0.8 #2 overlay", IDI_MIRANDA_NG_V8, MIRANDA_VERSION_CASE },
// {"client_MirNG_07_over", L"*Miranda*NG*\?.\?\?.7.*", L"Miranda NG v0.7 #2 overlay", IDI_MIRANDA_NG_V7, MIRANDA_VERSION_CASE },
- { "client_MirNG_06_over", L"*Miranda*NG*\?.\?\?.6.*", LPGENT("Miranda NG v0.6 #2 overlay"), IDI_MIRANDA_NG_V6, MIRANDA_VERSION_CASE },
- { "client_MirNG_05_over", L"*Miranda*NG*\?.\?\?.5.*", LPGENT("Miranda NG v0.5 #2 overlay"), IDI_MIRANDA_NG_V5, MIRANDA_VERSION_CASE },
- { "client_MirNG_04_over", L"*Miranda*NG*\?.\?\?.4.*", LPGENT("Miranda NG v0.4 #2 overlay"), IDI_MIRANDA_NG_V4, MIRANDA_VERSION_CASE },
- { "client_MirNG_03_over", L"*Miranda*NG*\?.\?\?.3.*", LPGENT("Miranda NG v0.3 #2 overlay"), IDI_MIRANDA_NG_V3, MIRANDA_VERSION_CASE },
- { "client_MirNG_02_over", L"*Miranda*NG*\?.\?\?.2.*", LPGENT("Miranda NG v0.2 #2 overlay"), IDI_MIRANDA_NG_V2, MIRANDA_VERSION_CASE },
- { "client_MirNG_01_over", L"*Miranda*NG*\?.\?\?.1.*", LPGENT("Miranda NG v0.1 #2 overlay"), IDI_MIRANDA_NG_V1, MIRANDA_VERSION_CASE },
-
- { "client_MirIM_010_over", L"*Miranda*0.10.*", LPGENT("Miranda IM v0.10 #2 overlay"), IDI_MIRANDA_IM_V10, MIRANDA_VERSION_CASE },
- { "client_MirIM_09_over", L"*Miranda*0.9.*", LPGENT("Miranda IM v0.9 #2 overlay"), IDI_MIRANDA_IM_V9, MIRANDA_VERSION_CASE },
- { "client_MirIM_08_over", L"*Miranda*0.8.*", LPGENT("Miranda IM v0.8 #2 overlay"), IDI_MIRANDA_IM_V8, MIRANDA_VERSION_CASE },
- { "client_MirIM_07_over", L"*Miranda*0.7.*", LPGENT("Miranda IM v0.7 #2 overlay"), IDI_MIRANDA_IM_V7, MIRANDA_VERSION_CASE },
- { "client_MirIM_06_over", L"*Miranda*0.6.*", LPGENT("Miranda IM v0.6 #2 overlay"), IDI_MIRANDA_IM_V6, MIRANDA_VERSION_CASE },
- { "client_MirIM_05_over", L"*Miranda*0.5.*", LPGENT("Miranda IM v0.5 #2 overlay"), IDI_MIRANDA_IM_V5, MIRANDA_VERSION_CASE },
- { "client_MirIM_04_over", L"*Miranda*0.4.*", LPGENT("Miranda IM v0.4 #2 overlay"), IDI_MIRANDA_IM_V4, MIRANDA_VERSION_CASE },
+ { "client_MirNG_06_over", L"*Miranda*NG*\?.\?\?.6.*", LPGENW("Miranda NG v0.6 #2 overlay"), IDI_MIRANDA_NG_V6, MIRANDA_VERSION_CASE },
+ { "client_MirNG_05_over", L"*Miranda*NG*\?.\?\?.5.*", LPGENW("Miranda NG v0.5 #2 overlay"), IDI_MIRANDA_NG_V5, MIRANDA_VERSION_CASE },
+ { "client_MirNG_04_over", L"*Miranda*NG*\?.\?\?.4.*", LPGENW("Miranda NG v0.4 #2 overlay"), IDI_MIRANDA_NG_V4, MIRANDA_VERSION_CASE },
+ { "client_MirNG_03_over", L"*Miranda*NG*\?.\?\?.3.*", LPGENW("Miranda NG v0.3 #2 overlay"), IDI_MIRANDA_NG_V3, MIRANDA_VERSION_CASE },
+ { "client_MirNG_02_over", L"*Miranda*NG*\?.\?\?.2.*", LPGENW("Miranda NG v0.2 #2 overlay"), IDI_MIRANDA_NG_V2, MIRANDA_VERSION_CASE },
+ { "client_MirNG_01_over", L"*Miranda*NG*\?.\?\?.1.*", LPGENW("Miranda NG v0.1 #2 overlay"), IDI_MIRANDA_NG_V1, MIRANDA_VERSION_CASE },
+
+ { "client_MirIM_010_over", L"*Miranda*0.10.*", LPGENW("Miranda IM v0.10 #2 overlay"), IDI_MIRANDA_IM_V10, MIRANDA_VERSION_CASE },
+ { "client_MirIM_09_over", L"*Miranda*0.9.*", LPGENW("Miranda IM v0.9 #2 overlay"), IDI_MIRANDA_IM_V9, MIRANDA_VERSION_CASE },
+ { "client_MirIM_08_over", L"*Miranda*0.8.*", LPGENW("Miranda IM v0.8 #2 overlay"), IDI_MIRANDA_IM_V8, MIRANDA_VERSION_CASE },
+ { "client_MirIM_07_over", L"*Miranda*0.7.*", LPGENW("Miranda IM v0.7 #2 overlay"), IDI_MIRANDA_IM_V7, MIRANDA_VERSION_CASE },
+ { "client_MirIM_06_over", L"*Miranda*0.6.*", LPGENW("Miranda IM v0.6 #2 overlay"), IDI_MIRANDA_IM_V6, MIRANDA_VERSION_CASE },
+ { "client_MirIM_05_over", L"*Miranda*0.5.*", LPGENW("Miranda IM v0.5 #2 overlay"), IDI_MIRANDA_IM_V5, MIRANDA_VERSION_CASE },
+ { "client_MirIM_04_over", L"*Miranda*0.4.*", LPGENW("Miranda IM v0.4 #2 overlay"), IDI_MIRANDA_IM_V4, MIRANDA_VERSION_CASE },
};
int DEFAULT_KN_FP_OVERLAYS2_COUNT = _countof(def_kn_fp_overlays2_mask);
@@ -811,10 +809,10 @@ int DEFAULT_KN_FP_OVERLAYS2_COUNT = _countof(def_kn_fp_overlays2_mask); //#########################################################################################################################################################################
KN_FP_MASK def_kn_fp_overlays3_mask[] =
{// {"Client_IconName", L"|^*Mask*|*names*", L"Icon caption", IDI_RESOURCE_ID, CLIENT_CASE, OVERLAY? },
- { "client_platform_x64", L"|*x64*|*64*bit*", LPGENT("x64 overlay"), IDI_PLATFORM_X64, OVERLAYS_PLATFORM_CASE },
- { "client_platform_x32", L"|*x32*|*32*bit*|*x86*", LPGENT("x32 overlay"), IDI_PLATFORM_X32, OVERLAYS_PLATFORM_CASE },
+ { "client_platform_x64", L"|*x64*|*64*bit*", LPGENW("x64 overlay"), IDI_PLATFORM_X64, OVERLAYS_PLATFORM_CASE },
+ { "client_platform_x32", L"|*x32*|*32*bit*|*x86*", LPGENW("x32 overlay"), IDI_PLATFORM_X32, OVERLAYS_PLATFORM_CASE },
- { "client_Unicode", L"*unicode*", LPGENT("Unicode overlay"), IDI_UNICODE_CLIENT, OVERLAYS_UNICODE_CASE },
+ { "client_Unicode", L"*unicode*", LPGENW("Unicode overlay"), IDI_UNICODE_CLIENT, OVERLAYS_UNICODE_CASE },
};
int DEFAULT_KN_FP_OVERLAYS3_COUNT = _countof(def_kn_fp_overlays3_mask);
@@ -825,9 +823,9 @@ int DEFAULT_KN_FP_OVERLAYS3_COUNT = _countof(def_kn_fp_overlays3_mask); //#########################################################################################################################################################################
KN_FP_MASK def_kn_fp_overlays4_mask[] =
{// {"Client_IconName", L"|^*Mask*|*names*", L"Icon caption", IDI_RESOURCE_ID, CLIENT_CASE, OVERLAY? },
- { "client_NewGPG_over", L"*New*GPG*", LPGENT("NewGPG overlay"), IDI_NEWGPG_OVERLAY, OVERLAYS_SECURITY_CASE },
- { "client_MirOTR_over", L"*Mir*OTR*", LPGENT("MirOTR overlay"), IDI_MIROTR_OVERLAY, OVERLAYS_SECURITY_CASE },
- { "client_SecureIM_over", L"*Secure*IM*", LPGENT("SecureIM overlay"), IDI_SECUREIM_OVERLAY, OVERLAYS_SECURITY_CASE },
+ { "client_NewGPG_over", L"*New*GPG*", LPGENW("NewGPG overlay"), IDI_NEWGPG_OVERLAY, OVERLAYS_SECURITY_CASE },
+ { "client_MirOTR_over", L"*Mir*OTR*", LPGENW("MirOTR overlay"), IDI_MIROTR_OVERLAY, OVERLAYS_SECURITY_CASE },
+ { "client_SecureIM_over", L"*Secure*IM*", LPGENW("SecureIM overlay"), IDI_SECUREIM_OVERLAY, OVERLAYS_SECURITY_CASE },
};
int DEFAULT_KN_FP_OVERLAYS4_COUNT = _countof(def_kn_fp_overlays4_mask);
diff --git a/plugins/FingerprintNG/src/options.cpp b/plugins/FingerprintNG/src/options.cpp index 87d45c35ae..0aef494660 100644 --- a/plugins/FingerprintNG/src/options.cpp +++ b/plugins/FingerprintNG/src/options.cpp @@ -117,9 +117,9 @@ int OnOptInitialise(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_hInst;
- odp.ptszGroup = LPGENT("Icons");
+ odp.pwszGroup = LPGENW("Icons");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG);
- odp.ptszTitle = LPGENT("Fingerprint");
+ odp.pwszTitle = LPGENW("Fingerprint");
odp.pfnDlgProc = DlgProcOptions;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &odp);
diff --git a/plugins/FloatingContacts/src/bitmap_funcs.cpp b/plugins/FloatingContacts/src/bitmap_funcs.cpp index ab3eca3c02..4db3c8f07c 100644 --- a/plugins/FloatingContacts/src/bitmap_funcs.cpp +++ b/plugins/FloatingContacts/src/bitmap_funcs.cpp @@ -697,7 +697,7 @@ void MyBitmap::DrawIcon(HICON hic, int x, int y, int w, int h) // Base on code by Artem Shpynov
// from clist_modern plugin
// slightly modified and integrated to MyBitmap class
-void MyBitmap::DrawText(TCHAR *str, int x, int y, int blur, int strength)
+void MyBitmap::DrawText(wchar_t *str, int x, int y, int blur, int strength)
{
SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_tstrlen(str), &sz);
sz.cx += (blur + 2) * 2; sz.cy += (blur + 2) * 2;
diff --git a/plugins/FloatingContacts/src/bitmap_funcs.h b/plugins/FloatingContacts/src/bitmap_funcs.h index d28923ff8d..55726b14c7 100644 --- a/plugins/FloatingContacts/src/bitmap_funcs.h +++ b/plugins/FloatingContacts/src/bitmap_funcs.h @@ -94,7 +94,7 @@ public: void IncreaseAlpha(float q);
void DrawIcon(HICON hic, int x, int y, int w = 0, int h = 0);
- void DrawText(TCHAR *str, int x, int y, int blur = 0, int strength = 0);
+ void DrawText(wchar_t *str, int x, int y, int blur = 0, int strength = 0);
__forceinline COLOR32 *getBits() { return bits; }
__forceinline COLOR32 *getRow(int row) { return bits + row * width; }
diff --git a/plugins/FloatingContacts/src/filedrop.cpp b/plugins/FloatingContacts/src/filedrop.cpp index 5858e85789..76da433254 100644 --- a/plugins/FloatingContacts/src/filedrop.cpp +++ b/plugins/FloatingContacts/src/filedrop.cpp @@ -113,7 +113,7 @@ HRESULT STDMETHODCALLTYPE CDropTarget::Drop(IDataObject *pData, DWORD, POINTL, D }
}
else {
- TCHAR *pText = (TCHAR*)GlobalLock(stg.hGlobal);
+ wchar_t *pText = (wchar_t*)GlobalLock(stg.hGlobal);
if (pText != NULL) {
SendMsgDialog(hwndCurDrag, pText);
GlobalUnlock(stg.hGlobal);
diff --git a/plugins/FloatingContacts/src/fltcont.h b/plugins/FloatingContacts/src/fltcont.h index 616baa50dc..691fc6101c 100644 --- a/plugins/FloatingContacts/src/fltcont.h +++ b/plugins/FloatingContacts/src/fltcont.h @@ -58,6 +58,7 @@ enum //
#define MODULE "FloatingContacts"
+#define MODULEW L"FloatingContacts"
#define TOTOPTIME_P 1000
#define TOTOPTIME_MAX (15*(60000/TOTOPTIME_P))
@@ -135,7 +136,7 @@ static __forceinline BOOL ImageList_GetIconSize_my(HIMAGELIST himl, SIZE &sz) void RegHotkey ( MCONTACT hContact, HWND hwnd );
BOOL IsStatusVisible ( int status );
BOOL HideOnFullScreen ();
-void SendMsgDialog ( HWND hwnd, TCHAR *pText );
+void SendMsgDialog ( HWND hwnd, wchar_t *pText );
void SaveContactsPos ( void );
/////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index d9e4d92fbf..ac8d80cadc 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -26,7 +26,7 @@ static void LoadContact(MCONTACT hContact); // Internal funcs
static void RepaintWindow(HWND hwnd, HDC hdc);
-static void CreateThumbWnd(TCHAR *ptszName, MCONTACT hContact, int nX, int nY);
+static void CreateThumbWnd(wchar_t *ptszName, MCONTACT hContact, int nX, int nY);
static void RegisterWindowClass(void);
static void UnregisterWindowClass(void);
static void LoadDBSettings(void);
@@ -123,11 +123,11 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) static LPCTSTR s_fonts[FLT_FONTIDS] =
{
- { LPGENT("Standard contacts") },
- { LPGENT("Online contacts to whom you have a different visibility") },
- { LPGENT("Offline contacts") },
- { LPGENT("Offline contacts to whom you have a different visibility") },
- { LPGENT("Contacts which are 'not on list'") }
+ { LPGENW("Standard contacts") },
+ { LPGENW("Online contacts to whom you have a different visibility") },
+ { LPGENW("Offline contacts") },
+ { LPGENW("Offline contacts to whom you have a different visibility") },
+ { LPGENW("Contacts which are 'not on list'") }
};
///////////////////////////////////////////////////////
@@ -310,7 +310,7 @@ static void LoadDBSettings() bIsCListShow = (db_get_b(NULL, "CList", "State", 0) == 2);
}
-void SendMsgDialog(HWND hwnd, TCHAR *pText)
+void SendMsgDialog(HWND hwnd, wchar_t *pText)
{
ThumbInfo *pThumb = thumbList.FindThumb(hwnd);
if (pThumb != NULL)
@@ -413,7 +413,7 @@ static LRESULT __stdcall CommWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM case WM_REFRESH_CONTACT:
if (pThumb) {
- _tcsncpy(pThumb->ptszName, pcli->pfnGetContactDisplayName(pThumb->hContact, 0), USERNAME_LEN - 1);
+ wcsncpy(pThumb->ptszName, pcli->pfnGetContactDisplayName(pThumb->hContact, 0), USERNAME_LEN - 1);
pThumb->RefreshContactStatus((int)lParam);
pThumb->ResizeThumb();
}
@@ -500,7 +500,7 @@ static void UnregisterWindowClass() UnregisterClass(WND_CLASS, hInst);
}
-static void CreateThumbWnd(TCHAR *ptszName, MCONTACT hContact, int nX, int nY)
+static void CreateThumbWnd(wchar_t *ptszName, MCONTACT hContact, int nX, int nY)
{
ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
if (pThumb != NULL)
@@ -532,7 +532,7 @@ static void CreateThumbsFont() }
LOGFONT lf;
- FontService_GetFont(LPGENT("Floating contacts"), s_fonts[nFontId], &tColor[nFontId], &lf);
+ FontService_GetFont(LPGENW("Floating contacts"), s_fonts[nFontId], &tColor[nFontId], &lf);
hFont[nFontId] = CreateFontIndirect(&lf);
}
}
@@ -679,8 +679,8 @@ static void LoadContacts() static IconItemT g_iconList[] =
{
- { LPGENT("Show all thumbs"), "flt_show", IDI_HIDE },
- { LPGENT("Hide all thumbs"), "flt_hide", IDI_SHOW }
+ { LPGENW("Show all thumbs"), "flt_show", IDI_HIDE },
+ { LPGENW("Hide all thumbs"), "flt_hide", IDI_SHOW }
};
static INT_PTR OnMainMenu_HideAll(WPARAM, LPARAM)
@@ -725,7 +725,7 @@ static void LoadMenus() mi.position = 0xFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_HIDE));
- mi.name.t = LPGENT("Remove thumb");
+ mi.name.w = LPGENW("Remove thumb");
mi.pszService = MODULE "/RemoveThumb";
hMenuItemRemove = Menu_AddContactMenuItem(&mi);
@@ -735,7 +735,7 @@ static void LoadMenus() mi.pszService = MODULE "/MainHideAllThumbs";
int i = (fcOpt.bHideAll) ? 0 : 1;
mi.hIcolibItem = g_iconList[i].hIcolib;
- mi.name.t = g_iconList[i].tszDescr;
+ mi.name.w = g_iconList[i].tszDescr;
hMainMenuItemHideAll = Menu_AddMainMenuItem(&mi);
// Register hotkeys
@@ -764,7 +764,7 @@ static void LoadContact(MCONTACT hContact) DWORD dwPos = db_get_dw(hContact, MODULE, "ThumbsPos", (DWORD)-1);
if (dwPos != -1) {
- TCHAR *ptName = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *ptName = pcli->pfnGetContactDisplayName(hContact, 0);
if (ptName != NULL) {
int nX = DB_POS_GETX(dwPos);
int nY = DB_POS_GETY(dwPos);
@@ -910,7 +910,7 @@ extern "C" int __declspec(dllexport) Load() mir_getLP(&pluginInfoEx);
mir_getCLI();
- Icon_RegisterT(hInst, _T(MODULE), g_iconList, _countof(g_iconList));
+ Icon_RegisterT(hInst, MODULEW, g_iconList, _countof(g_iconList));
LoadMenus();
InitOptions();
@@ -924,7 +924,7 @@ extern "C" int __declspec(dllexport) Load() char szId[20];
mir_snprintf(szId, "Font%d", i);
- FontService_RegisterFont(MODULE, szId, LPGENT("Floating contacts"), s_fonts[i], NULL, NULL, i + 1, false, &lf, defColor);
+ FontService_RegisterFont(MODULE, szId, LPGENW("Floating contacts"), s_fonts[i], NULL, NULL, i + 1, false, &lf, defColor);
}
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoded);
diff --git a/plugins/FloatingContacts/src/options.cpp b/plugins/FloatingContacts/src/options.cpp index bad721a483..ecf1100007 100644 --- a/plugins/FloatingContacts/src/options.cpp +++ b/plugins/FloatingContacts/src/options.cpp @@ -244,7 +244,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP case IDC_BROWSE:
{
- TCHAR str[MAX_PATH], filter[512];
+ wchar_t str[MAX_PATH], filter[512];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
Bitmap_GetFilter(filter, _countof(filter));
@@ -301,7 +301,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP db_set_b(NULL, MODULE, "BkUseBitmap", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
db_set_ts(NULL, MODULE, "BkBitmap", str);
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp index 51dc4132d1..a5d901bdd6 100644 --- a/plugins/FloatingContacts/src/thumbs.cpp +++ b/plugins/FloatingContacts/src/thumbs.cpp @@ -738,13 +738,13 @@ ThumbList::ThumbList() : OBJLIST<ThumbInfo>(1, NumericKeySortT) ThumbList::~ThumbList()
{}
-ThumbInfo *ThumbList::AddThumb(HWND hwnd, TCHAR *ptszName, MCONTACT hContact)
+ThumbInfo *ThumbList::AddThumb(HWND hwnd, wchar_t *ptszName, MCONTACT hContact)
{
if (ptszName == NULL || hContact == NULL || hwnd == NULL)
return NULL;
ThumbInfo *pThumb = new ThumbInfo;
- _tcsncpy_s(pThumb->ptszName, ptszName, _TRUNCATE);
+ wcsncpy_s(pThumb->ptszName, ptszName, _TRUNCATE);
pThumb->hContact = hContact;
pThumb->hwnd = hwnd;
diff --git a/plugins/FloatingContacts/src/thumbs.h b/plugins/FloatingContacts/src/thumbs.h index 0fe58fceb0..d3e8d396d1 100644 --- a/plugins/FloatingContacts/src/thumbs.h +++ b/plugins/FloatingContacts/src/thumbs.h @@ -14,7 +14,7 @@ struct ThumbInfo {
MCONTACT hContact;
HWND hwnd;
- TCHAR ptszName[USERNAME_LEN];
+ wchar_t ptszName[USERNAME_LEN];
int iIcon;
CDropTarget *dropTarget;
DockOpt dockOpt;
@@ -60,7 +60,7 @@ public: ThumbList();
~ThumbList();
- ThumbInfo* AddThumb(HWND hwnd, TCHAR *ptszName, MCONTACT hContact);
+ ThumbInfo* AddThumb(HWND hwnd, wchar_t *ptszName, MCONTACT hContact);
void RemoveThumb(ThumbInfo *pThumb);
ThumbInfo* FindThumb(HWND hwnd);
diff --git a/plugins/Folders/src/dlg_handlers.cpp b/plugins/Folders/src/dlg_handlers.cpp index d14722300f..82a1b38d04 100644 --- a/plugins/Folders/src/dlg_handlers.cpp +++ b/plugins/Folders/src/dlg_handlers.cpp @@ -13,19 +13,19 @@ static PFolderItem GetSelectedItem(HWND hWnd) return (PFolderItem)SendDlgItemMessage(hWnd, IDC_FOLDERS_ITEMS_LIST, LB_GETITEMDATA, index, 0);
}
-static void GetEditText(HWND hWnd, TCHAR *buffer, int size)
+static void GetEditText(HWND hWnd, wchar_t *buffer, int size)
{
GetWindowText(GetDlgItem(hWnd, IDC_FOLDER_EDIT), buffer, size);
}
-static void SetEditText(HWND hWnd, const TCHAR *buffer)
+static void SetEditText(HWND hWnd, const wchar_t *buffer)
{
bInitializing = 1;
SetDlgItemText(hWnd, IDC_FOLDER_EDIT, buffer);
bInitializing = 0;
}
-static int ContainsSection(HWND hWnd, const TCHAR *section)
+static int ContainsSection(HWND hWnd, const wchar_t *section)
{
int index = SendDlgItemMessage(hWnd, IDC_FOLDERS_SECTIONS_LIST, LB_FINDSTRINGEXACT, -1, (LPARAM)section);
return (index != LB_ERR);
@@ -37,7 +37,7 @@ static void LoadRegisteredFolderSections(HWND hWnd) for (int i = 0; i < lstRegisteredFolders.getCount(); i++) {
CFolderItem &tmp = lstRegisteredFolders[i];
- TCHAR *translated = mir_a2t(tmp.GetSection());
+ wchar_t *translated = mir_a2t(tmp.GetSection());
if (!ContainsSection(hWnd, TranslateTS(translated))) {
int idx = SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM)TranslateTS(translated));
SendMessage(hwndList, LB_SETITEMDATA, idx, (LPARAM)tmp.GetSection());
@@ -71,7 +71,7 @@ static void LoadRegisteredFolderItems(HWND hWnd) static void RefreshPreview(HWND hWnd)
{
- TCHAR tmp[MAX_FOLDER_SIZE];
+ wchar_t tmp[MAX_FOLDER_SIZE];
GetEditText(hWnd, tmp, MAX_FOLDER_SIZE);
SetDlgItemText(hWnd, IDC_PREVIEW_EDIT, ExpandPath(tmp));
}
@@ -90,7 +90,7 @@ static void SaveItem(HWND hWnd, PFolderItem item, int bEnableApply) if (!item)
return;
- TCHAR buffer[MAX_FOLDER_SIZE];
+ wchar_t buffer[MAX_FOLDER_SIZE];
GetEditText(hWnd, buffer, _countof(buffer));
item->SetFormat(buffer);
@@ -103,7 +103,7 @@ static int ChangesNotSaved(HWND hWnd, PFolderItem item) if (!item)
return 0;
- TCHAR buffer[MAX_FOLDER_SIZE];
+ wchar_t buffer[MAX_FOLDER_SIZE];
GetEditText(hWnd, buffer, MAX_FOLDER_SIZE);
return mir_tstrcmp(item->GetFormat(), buffer) != 0;
}
@@ -119,7 +119,7 @@ static void CheckForChanges(HWND hWnd, int bNeedConfirmation = 1) static INT_PTR CALLBACK DlgProcVariables(HWND hWnd, UINT msg, WPARAM wParam, LPARAM)
{
- TCHAR tszMessage[2048];
+ wchar_t tszMessage[2048];
switch (msg) {
case WM_INITDIALOG:
diff --git a/plugins/Folders/src/folderItem.cpp b/plugins/Folders/src/folderItem.cpp index e1b46cb393..9cc475593e 100644 --- a/plugins/Folders/src/folderItem.cpp +++ b/plugins/Folders/src/folderItem.cpp @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-CFolderItem::CFolderItem(const char *sectionName, const char *name, const TCHAR *format, const TCHAR *userName)
+CFolderItem::CFolderItem(const char *sectionName, const char *name, const wchar_t *format, const wchar_t *userName)
{
m_szSection = mir_strdup(sectionName);
m_szName = mir_strdup(name);
@@ -43,7 +43,7 @@ CFolderItem::~CFolderItem() mir_free(m_tszUserName);
}
-void CFolderItem::SetFormat(const TCHAR *newFormat)
+void CFolderItem::SetFormat(const wchar_t *newFormat)
{
mir_free(m_tszOldFormat);
m_tszOldFormat = m_tszFormat;
@@ -55,12 +55,12 @@ int CFolderItem::IsEqual(const CFolderItem *other) return (IsEqual(other->GetSection(), other->GetUserName()));
}
-int CFolderItem::IsEqual(const char *section, const TCHAR *name)
+int CFolderItem::IsEqual(const char *section, const wchar_t *name)
{
return !mir_tstrcmp(m_tszUserName, name) && !mir_strcmp(m_szSection, section);
}
-int CFolderItem::IsEqualTranslated(const char *trSection, const TCHAR *trName)
+int CFolderItem::IsEqualTranslated(const char *trSection, const wchar_t *trName)
{
return !mir_tstrcmp(TranslateTS(m_tszUserName), trName) && !mir_strcmp(Translate(m_szSection), trSection);
}
@@ -111,7 +111,7 @@ int CFolderItem::FolderDeleteOldDirectory(int showFolder) return res;
}
-void CFolderItem::GetDataFromDatabase(const TCHAR *szNotFound)
+void CFolderItem::GetDataFromDatabase(const wchar_t *szNotFound)
{
char szSettingName[256];
strcpy_s(szSettingName, _countof(szSettingName), m_szSection);
diff --git a/plugins/Folders/src/folderItem.h b/plugins/Folders/src/folderItem.h index 03b88f86e5..ad02db6d12 100644 --- a/plugins/Folders/src/folderItem.h +++ b/plugins/Folders/src/folderItem.h @@ -32,30 +32,30 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class CFolderItem
{
char *m_szSection, *m_szName;
- TCHAR *m_tszFormat, *m_tszOldFormat, *m_tszUserName;
+ wchar_t *m_tszFormat, *m_tszOldFormat, *m_tszUserName;
- void GetDataFromDatabase(const TCHAR *szNotFound);
+ void GetDataFromDatabase(const wchar_t *szNotFound);
void WriteDataToDatabase();
int FolderCreateDirectory(int showFolder = 0);
int FolderDeleteOldDirectory(int showFolder = 0);
public:
- CFolderItem(const char *sectionName, const char *name, const TCHAR *format, const TCHAR *userName);
+ CFolderItem(const char *sectionName, const char *name, const wchar_t *format, const wchar_t *userName);
virtual ~CFolderItem();
CMString Expand();
void Save();
int IsEqual(const CFolderItem *other);
- int IsEqual(const char *section, const TCHAR *name);
- int IsEqualTranslated(const char *trSection, const TCHAR *trName);
+ int IsEqual(const char *section, const wchar_t *name);
+ int IsEqualTranslated(const char *trSection, const wchar_t *trName);
int operator ==(const CFolderItem *other);
__inline const char* GetSection() const { return m_szSection; }
__inline const char* GetName() const { return m_szName; }
- __inline const TCHAR* GetUserName() const { return m_tszUserName; }
- __inline const TCHAR* GetFormat() const { return m_tszFormat; }
- void SetFormat(const TCHAR *newFormat);
+ __inline const wchar_t* GetUserName() const { return m_tszUserName; }
+ __inline const wchar_t* GetFormat() const { return m_tszFormat; }
+ void SetFormat(const wchar_t *newFormat);
};
typedef CFolderItem *PFolderItem;
diff --git a/plugins/Folders/src/services.cpp b/plugins/Folders/src/services.cpp index 348db4468e..de7669c4e9 100644 --- a/plugins/Folders/src/services.cpp +++ b/plugins/Folders/src/services.cpp @@ -22,10 +22,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define DEFAULT_SECTION "Unknown"
-TCHAR szCurrentProfilePath[MAX_FOLDERS_PATH];
-TCHAR szCurrentProfile[MAX_FOLDERS_PATH];
-TCHAR szMirandaPath[MAX_FOLDERS_PATH];
-TCHAR szUserDataPath[MAX_FOLDERS_PATH];
+wchar_t szCurrentProfilePath[MAX_FOLDERS_PATH];
+wchar_t szCurrentProfile[MAX_FOLDERS_PATH];
+wchar_t szMirandaPath[MAX_FOLDERS_PATH];
+wchar_t szUserDataPath[MAX_FOLDERS_PATH];
INT_PTR RegisterPathService(WPARAM, LPARAM lParam)
{
@@ -69,7 +69,7 @@ INT_PTR GetPathService(WPARAM wParam, LPARAM lParam) CMString buf(p->Expand());
if (data->flags & FF_UNICODE)
- _tcsncpy_s(data->szPathT, data->nMaxPathSize, buf, _TRUNCATE);
+ wcsncpy_s(data->szPathT, data->nMaxPathSize, buf, _TRUNCATE);
else
strncpy_s(data->szPath, data->nMaxPathSize, _T2A(buf), _TRUNCATE);
return 0;
@@ -81,12 +81,12 @@ int InitServices() {
CallService(MS_DB_GETPROFILEPATHT, _countof(szCurrentProfilePath), (LPARAM)szCurrentProfilePath);
CallService(MS_DB_GETPROFILENAMET, _countof(szCurrentProfile), (LPARAM)szCurrentProfile);
- TCHAR *pos = _tcsrchr(szCurrentProfile, '.'); if (pos) *pos = 0;
+ wchar_t *pos = wcsrchr(szCurrentProfile, '.'); if (pos) *pos = 0;
GetModuleFileName(GetModuleHandleA("mir_app.mir"), szMirandaPath, _countof(szMirandaPath));
- pos = _tcsrchr(szMirandaPath, '\\'); if (pos) *pos = 0;
+ pos = wcsrchr(szMirandaPath, '\\'); if (pos) *pos = 0;
- TCHAR *szTemp = Utils_ReplaceVarsT(L"%miranda_userdata%");
+ wchar_t *szTemp = Utils_ReplaceVarsT(L"%miranda_userdata%");
mir_sntprintf(szUserDataPath, szTemp);
mir_free(szTemp);
diff --git a/plugins/Folders/src/services.h b/plugins/Folders/src/services.h index 6f1acaf1ca..c262748b13 100644 --- a/plugins/Folders/src/services.h +++ b/plugins/Folders/src/services.h @@ -23,10 +23,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MAX_FOLDERS_PATH 512
-extern TCHAR szCurrentProfilePath[MAX_FOLDERS_PATH];
-extern TCHAR szCurrentProfile[MAX_FOLDERS_PATH];
-extern TCHAR szMirandaPath[MAX_FOLDERS_PATH];
-extern TCHAR szUserDataPath[MAX_FOLDERS_PATH];
+extern wchar_t szCurrentProfilePath[MAX_FOLDERS_PATH];
+extern wchar_t szCurrentProfile[MAX_FOLDERS_PATH];
+extern wchar_t szMirandaPath[MAX_FOLDERS_PATH];
+extern wchar_t szUserDataPath[MAX_FOLDERS_PATH];
int InitServices();
void InitOptions();
diff --git a/plugins/Folders/src/utils.cpp b/plugins/Folders/src/utils.cpp index 97ffef2eb6..2adc3b7035 100644 --- a/plugins/Folders/src/utils.cpp +++ b/plugins/Folders/src/utils.cpp @@ -20,12 +20,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-CMString ExpandPath(const TCHAR *format)
+CMString ExpandPath(const wchar_t *format)
{
CMString res;
if (ServiceExists(MS_VARS_FORMATSTRING))
- res = VARST(ptrT(variables_parse((TCHAR*)format, NULL, NULL)));
+ res = VARST(ptrT(variables_parse((wchar_t*)format, NULL, NULL)));
else
res = VARST(format);
@@ -47,20 +47,20 @@ CMString ExpandPath(const TCHAR *format) return res;
}
-void RemoveDirectories(const TCHAR *path)
+void RemoveDirectories(const wchar_t *path)
{
- TCHAR *pos;
- TCHAR *buffer = NEWWSTR_ALLOCA(path);
+ wchar_t *pos;
+ wchar_t *buffer = NEWWSTR_ALLOCA(path);
if (!(GetFileAttributes(buffer) & FILE_ATTRIBUTE_REPARSE_POINT))
RemoveDirectory(buffer);
- while (pos = _tcsrchr(buffer, '\\')) {
+ while (pos = wcsrchr(buffer, '\\')) {
pos[0] = '\0';
if (!(GetFileAttributes(buffer) & FILE_ATTRIBUTE_REPARSE_POINT))
RemoveDirectory(buffer);
}
}
-bool DirectoryExists(const TCHAR *path)
+bool DirectoryExists(const wchar_t *path)
{
DWORD dwAttributes = GetFileAttributes(path);
if (dwAttributes == INVALID_FILE_ATTRIBUTES || !(dwAttributes & FILE_ATTRIBUTE_DIRECTORY))
diff --git a/plugins/Folders/src/utils.h b/plugins/Folders/src/utils.h index 3307335e14..4724635ce0 100644 --- a/plugins/Folders/src/utils.h +++ b/plugins/Folders/src/utils.h @@ -21,9 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef M_FOLDERS_UTILS_H
#define M_FOLDERS_UTILS_H
-CMString ExpandPath(const TCHAR *format);
+CMString ExpandPath(const wchar_t *format);
-void RemoveDirectories(const TCHAR *szPath);
-bool DirectoryExists(const TCHAR *szPath);
+void RemoveDirectories(const wchar_t *szPath);
+bool DirectoryExists(const wchar_t *szPath);
#endif
\ No newline at end of file diff --git a/plugins/GmailNotifier/src/options.cpp b/plugins/GmailNotifier/src/options.cpp index 959fcd6d16..7be689df09 100644 --- a/plugins/GmailNotifier/src/options.cpp +++ b/plugins/GmailNotifier/src/options.cpp @@ -126,7 +126,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_PRGBROWSE:
{
OPENFILENAME OpenFileName;
- TCHAR szName[_MAX_PATH];
+ wchar_t szName[_MAX_PATH];
memset(&OpenFileName, 0, sizeof(OPENFILENAME));
GetDlgItemText(hwndDlg, IDC_PRG, szName, _countof(szName));
OpenFileName.lStructSize = sizeof(OPENFILENAME);
diff --git a/plugins/HTTPServer/src/Glob.h b/plugins/HTTPServer/src/Glob.h index 2e0c92fc4f..c556f73786 100644 --- a/plugins/HTTPServer/src/Glob.h +++ b/plugins/HTTPServer/src/Glob.h @@ -54,7 +54,7 @@ using namespace std; #define SD_BOTH 0x02
#define MODULE "HTTPServer"
-#define MSG_BOX_TITEL TranslateT("Miranda NG HTTP-Server")
+#define MSG_BOX_TITEL Translate("Miranda NG HTTP-Server")
#define SplitIpAddress( p ) (BYTE)(p>>24),(BYTE)(p>>16),(BYTE)(p>>8),(BYTE)(p)
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index d79e8a8450..ed36ad8ac2 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -462,7 +462,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare) | OFN_ALLOWMULTISELECT;
ofn.hwndOwner = hwndOwner;
ofn.hInstance = hInstance;
- ofn.lpstrTitle = TranslateT("Specify a file to share");
+ ofn.lpstrTitle = Translate("Specify a file to share");
ofn.lpTemplateName = MAKEINTRESOURCE(IDD_NEW_SHARE_PROPERTIES);
ofn.lpfnHook = ShareNewFileDialogHook;
ofn.lCustData = (LPARAM)pstNewShare;
@@ -505,7 +505,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare) pstNewShare->pszRealPath[pstNewShare->dwMaxRealPath] = '\0';
if (CallService(MS_HTTP_ADD_CHANGE_REMOVE, 0, (LPARAM)pstNewShare)) {
- MessageBox(NULL, TranslateT("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, Translate("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
return false;
}
pszFileNamePos++;
@@ -516,7 +516,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare) }
else {
if (CallService(MS_HTTP_ADD_CHANGE_REMOVE, 0, (LPARAM)pstNewShare)) {
- MessageBox(NULL, TranslateT("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, Translate("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
return false;
}
}
@@ -722,36 +722,36 @@ static INT_PTR CALLBACK DlgProcStatsticView(HWND hwndDlg, UINT msg, WPARAM wPara LVCOLUMN cCol = { 0 };
cCol.mask = LVCF_TEXT | LVCF_WIDTH;
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx1", 126);
- cCol.pszText = TranslateT("Share name");
+ cCol.pszText = Translate("Share name");
ListView_InsertColumn(hShareList, 0, &cCol);
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx2", 48);
- cCol.pszText = TranslateT("Max Downloads");
+ cCol.pszText = Translate("Max Downloads");
ListView_InsertColumn(hShareList, 1, &cCol);
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx3", 96);
- cCol.pszText = TranslateT("Allowed IP");
+ cCol.pszText = Translate("Allowed IP");
ListView_InsertColumn(hShareList, 2, &cCol);
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx4", 104);
- cCol.pszText = TranslateT("Allowed Mask");
+ cCol.pszText = Translate("Allowed Mask");
ListView_InsertColumn(hShareList, 3, &cCol);
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx5", 252);
- cCol.pszText = TranslateT("Real path");
+ cCol.pszText = Translate("Real path");
ListView_InsertColumn(hShareList, 4, &cCol);
cCol.mask = LVCF_TEXT | LVCF_WIDTH;
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx6", 142);
- cCol.pszText = TranslateT("Share name");
+ cCol.pszText = Translate("Share name");
ListView_InsertColumn(hUserList, 0, &cCol);
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx7", 111);
- cCol.pszText = TranslateT("User");
+ cCol.pszText = Translate("User");
ListView_InsertColumn(hUserList, 1, &cCol);
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx8", 100);
- cCol.pszText = TranslateT("Agent");
+ cCol.pszText = Translate("Agent");
ListView_InsertColumn(hUserList, 2, &cCol);
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx9", 100);
- cCol.pszText = TranslateT("Completed");
+ cCol.pszText = Translate("Completed");
ListView_InsertColumn(hUserList, 3, &cCol);
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx10", 100);
- cCol.pszText = TranslateT("Speed");
+ cCol.pszText = Translate("Speed");
ListView_InsertColumn(hUserList, 4, &cCol);
bool b = db_get_b(NULL, MODULE, "StatWnd_ShowHidden", 0) != 0;
@@ -805,7 +805,7 @@ static INT_PTR CALLBACK DlgProcStatsticView(HWND hwndDlg, UINT msg, WPARAM wPara strncpy(&szServPath[1], fileName + 1, MAX_PATH - 2);
if (CallService(MS_HTTP_ADD_CHANGE_REMOVE, 0, (LPARAM)&stNewShare)) {
- MessageBox(NULL, TranslateT("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, Translate("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
return false;
}
}
@@ -915,18 +915,18 @@ static INT_PTR CALLBACK DlgProcStatsticView(HWND hwndDlg, UINT msg, WPARAM wPara if (ListView_GetItem(hShareList, &sItem)) {
string sLink = sCreateLink(sItem.pszText);
if (sLink.size() <= 0) {
- MessageBox(hwndDlg, TranslateT("Selected link size is 0"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(hwndDlg, Translate("Selected link size is 0"), MSG_BOX_TITEL, MB_OK);
return TRUE;
}
if (LOWORD(wParam) == ID_SHARELIST_COPYLINK) {
if (!OpenClipboard(hwndDlg)) {
- MessageBox(hwndDlg, TranslateT("Failed to get access to clipboard"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(hwndDlg, Translate("Failed to get access to clipboard"), MSG_BOX_TITEL, MB_OK);
return TRUE;
}
if (!EmptyClipboard()) {
- MessageBox(hwndDlg, TranslateT("Failed to get close the clipboard"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(hwndDlg, Translate("Failed to get close the clipboard"), MSG_BOX_TITEL, MB_OK);
return TRUE;
}
@@ -940,15 +940,15 @@ static INT_PTR CALLBACK DlgProcStatsticView(HWND hwndDlg, UINT msg, WPARAM wPara HANDLE hMyData = SetClipboardData(CF_TEXT, hglbCopy);
if (!hMyData)
- MessageBox(hwndDlg, TranslateT("Failed to set clipboard data"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(hwndDlg, Translate("Failed to set clipboard data"), MSG_BOX_TITEL, MB_OK);
CloseClipboard();
}
else Utils_OpenUrl(sLink.c_str());
}
- else MessageBox(hwndDlg, TranslateT("ListView_GetItem failed"), MSG_BOX_TITEL, MB_OK);
+ else MessageBox(hwndDlg, Translate("ListView_GetItem failed"), MSG_BOX_TITEL, MB_OK);
}
- else MessageBox(hwndDlg, TranslateT("No share selected"), MSG_BOX_TITEL, MB_OK);
+ else MessageBox(hwndDlg, Translate("No share selected"), MSG_BOX_TITEL, MB_OK);
return TRUE;
}
@@ -1238,14 +1238,14 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP bool bNew = IsDlgButtonChecked(hwndDlg, IDC_ADD_STATISTICS_MENU_ITEM) == BST_CHECKED;
if (b != bNew) {
db_set_b(NULL, MODULE, "AddStatisticsMenuItem", bNew);
- MessageBox(hwndDlg, TranslateT("You need to restart Miranda to change the main menu"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(hwndDlg, Translate("You need to restart Miranda to change the main menu"), MSG_BOX_TITEL, MB_OK);
}
b = db_get_b(NULL, MODULE, "AddAcceptConMenuItem", 1) != 0;
bNew = IsDlgButtonChecked(hwndDlg, IDC_ACCEPT_COM_MENU_ITEM) == BST_CHECKED;
if (b != bNew) {
db_set_b(NULL, MODULE, "AddAcceptConMenuItem", bNew);
- MessageBox(hwndDlg, TranslateT("You need to restart Miranda to change the main menu"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(hwndDlg, Translate("You need to restart Miranda to change the main menu"), MSG_BOX_TITEL, MB_OK);
}
bNew = IsDlgButtonChecked(hwndDlg, IDC_WRITE_LOG_FILE) == BST_CHECKED;
@@ -1343,8 +1343,8 @@ int OptionsInitialize(WPARAM wParam, LPARAM /*lParam*/) odp.hInstance = hInstance;
odp.pszTemplate = MAKEINTRESOURCE(IDD_OPT_HTTP_SERVER);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszTitle = LPGENT("HTTP Server");
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszTitle = LPGENW("HTTP Server");
+ odp.pwszGroup = LPGENW("Network");
odp.pfnDlgProc = OptionsDlgProc;
Options_AddPage(wParam, &odp);
return 0;
@@ -1477,7 +1477,7 @@ void InitGuiElements() SET_UID(mi, 0xb30a6ab5, 0x17a8, 0x4e2e, 0x84, 0x52, 0x5f, 0xbc, 0x83, 0x35, 0xf2, 0x6);
mi.hIcolibItem = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SHARE_NEW_FILE));
mi.position = -2000019955;
- mi.name.t = LPGENT("HTTP Share new file");
+ mi.name.w = LPGENW("HTTP Share new file");
mi.pszService = MS_SHARE_NEW_FILE;
hShareNewFileMenuItem = Menu_AddContactMenuItem(&mi);
@@ -1485,7 +1485,7 @@ void InitGuiElements() SET_UID(mi, 0x68db84c9, 0xe6b4, 0x4b4f, 0x93, 0x4b, 0xfd, 0x34, 0x2d, 0x83, 0x11, 0xe7);
mi.position = 1000085005;
mi.flags = CMIF_TCHAR;
- mi.name.t = LPGENT("Show HTTP server statistics");
+ mi.name.w = LPGENW("Show HTTP server statistics");
mi.pszService = MS_SHOW_STATISTICS_VIEW;
hShowStatisticsViewMenuItem = Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index 76f1ffe840..9cad408bbd 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -152,15 +152,15 @@ bool bWriteToFile(HANDLE hFile, const char * pszSrc, int nLen = -1) // Developer : KN
/////////////////////////////////////////////////////////////////////
-void LogEvent(const TCHAR * pszTitle, const char * pszLog)
+void LogEvent(const char * pszTitle, const char * pszLog)
{
HANDLE hFile = CreateFile(sLogFilePath.c_str(), GENERIC_WRITE, FILE_SHARE_READ, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
- MessageBox(NULL, TranslateT("Failed to open or create log file"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, Translate("Failed to open or create log file"), MSG_BOX_TITEL, MB_OK);
return;
}
if (SetFilePointer(hFile, 0, 0, FILE_END) == INVALID_SET_FILE_POINTER) {
- MessageBox(NULL, TranslateT("Failed to move to the end of the log file"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, Translate("Failed to move to the end of the log file"), MSG_BOX_TITEL, MB_OK);
CloseHandle(hFile);
return;
}
@@ -179,7 +179,7 @@ void LogEvent(const TCHAR * pszTitle, const char * pszLog) !bWriteToFile(hFile, " : ") ||
!bWriteToFile(hFile, pszLog, nLogLen) ||
!bWriteToFile(hFile, "\r\n")) {
- MessageBox(NULL, TranslateT("Failed to write some part of the log file"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, Translate("Failed to write some part of the log file"), MSG_BOX_TITEL, MB_OK);
}
CloseHandle(hFile);
}
@@ -251,7 +251,7 @@ bool bReadConfigurationFile() // move rest of buffer to front
if (pszCurPos && pszCurPos != szBuf) {
dwBytesInBuffer = DWORD(sizeof(szBuf) - (pszCurPos - szBuf));
- memmove(szBuf, pszCurPos, dwBytesInBuffer * sizeof(TCHAR));
+ memmove(szBuf, pszCurPos, dwBytesInBuffer * sizeof(wchar_t));
}
// append data to buffer
@@ -336,21 +336,19 @@ bool bReadConfigurationFile() bool bWriteConfigurationFile()
{
CLFileShareListAccess clCritSection;
- char szBuf[1000];
+ char szBuf[1000], temp[200];
mir_strcpy(szBuf, szPluginPath);
mir_strcat(szBuf, szConfigFile);
HANDLE hFile = CreateFile(szBuf, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
- TCHAR temp[200];
- mir_sntprintf(temp, "%s%s", TranslateT("Failed to open or create file "), _T(szConfigFile));
+ mir_snprintf(temp, "%s%s", Translate("Failed to open or create file "), szConfigFile);
MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK);
return false;
}
DWORD dwBytesWriten = 0;
if (!WriteFile(hFile, szXmlHeader, sizeof(szXmlHeader) - 1, &dwBytesWriten, NULL)) {
- TCHAR temp[200];
- mir_sntprintf(temp, "%s%s", TranslateT("Failed to write xml header to file "), _T(szConfigFile));
+ mir_snprintf(temp, "%s%s", TranslateT("Failed to write xml header to file "), szConfigFile);
MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK);
}
else {
@@ -364,8 +362,7 @@ bool bWriteConfigurationFile() SplitIpAddress(pclCur->st.dwAllowedMask));
if (!WriteFile(hFile, szBuf, dwBytesToWrite, &dwBytesWriten, NULL)) {
- TCHAR temp[200];
- mir_sntprintf(temp, "%s%s", TranslateT("Failed to write xml data to file "), _T(szConfigFile));
+ mir_snprintf(temp, "%s%s", Translate("Failed to write xml data to file "), szConfigFile);
MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK);
break;
}
@@ -373,8 +370,7 @@ bool bWriteConfigurationFile() }
if (!WriteFile(hFile, szXmlTail, sizeof(szXmlTail) - 1, &dwBytesWriten, NULL)) {
- TCHAR temp[200];
- mir_sntprintf(temp, "%s%s", TranslateT("Failed to write xml tail to file "), _T(szConfigFile));
+ mir_snprintf(temp, "%s%s", Translate("Failed to write xml tail to file "), szConfigFile);
MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK);
}
}
@@ -653,8 +649,8 @@ INT_PTR nToggelAcceptConnections(WPARAM wparam, LPARAM /*lparam*/) hDirectBoundPort = (HANDLE)CallService(MS_NETLIB_BINDPORT, (WPARAM)hNetlibUser, (LPARAM)& nlb);
if (!hDirectBoundPort) {
- TCHAR szTemp[200];
- mir_snprintf(szTemp, TranslateT("Failed to bind to port %s\r\nThis is most likely because another program or service is using this port"),
+ char szTemp[200];
+ mir_snprintf(szTemp, Translate("Failed to bind to port %s\r\nThis is most likely because another program or service is using this port"),
nlb.wPort == 80 ? "80" : nus.szIncomingPorts);
MessageBox(NULL, szTemp, MSG_BOX_TITEL, MB_OK);
return 1001;
@@ -746,9 +742,9 @@ int MainInit(WPARAM /*wparam*/, LPARAM /*lparam*/) NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_INCOMING;
nlu.szSettingsModule = MODULE;
- nlu.ptszDescriptiveName = TranslateT("HTTP Server");
+ nlu.szDescriptiveName = Translate("HTTP Server");
hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)& nlu);
if (!hNetlibUser) {
MessageBox(NULL, "Failed to register NetLib user", MSG_BOX_TITEL, MB_OK);
@@ -931,7 +927,7 @@ extern "C" __declspec(dllexport) int Load() mi.flags = CMIF_TCHAR;
mi.hIcolibItem = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SHARE_NEW_FILE));
mi.position = 1000085000;
- mi.name.a = LPGENT("Enable HTTP server");
+ mi.name.a = LPGEN("Enable HTTP server");
mi.pszService = MS_HTTP_ACCEPT_CONNECTIONS;
hAcceptConnectionsMenuItem = Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/HistoryLinkListPlus/src/linklist.cpp b/plugins/HistoryLinkListPlus/src/linklist.cpp index 2d4ea92498..0ad6c2cda1 100644 --- a/plugins/HistoryLinkListPlus/src/linklist.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist.cpp @@ -64,7 +64,7 @@ extern "C" __declspec(dllexport) int Load(void) SET_UID(mi, 0x2964dc6c, 0x9cf9, 0x4f20, 0x8f, 0x8a, 0xc6, 0xfe, 0xe2, 0x65, 0xac, 0xc9);
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_LINKLISTICON));
- mi.name.t = LPGENT("&Create Linklist");
+ mi.name.w = LPGENW("&Create Linklist");
mi.pszService = "Linklist/MenuCommand";
Menu_AddContactMenuItem(&mi);
diff --git a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp index 9946d3f060..812a828b6b 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp @@ -35,8 +35,8 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) switch (msg) {
case WM_INITDIALOG: {
MCONTACT hContact;
- TCHAR title[256];
- TCHAR filter[FILTERTEXT];
+ wchar_t title[256];
+ wchar_t filter[FILTERTEXT];
RECT rc;
POINT pt;
@@ -118,12 +118,12 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) WriteMessage(hDlg, DlgParam->listStart, SendDlgItemMessage(hDlg, IDC_MAIN, EM_LINEFROMCHAR, -1, 0));
break;
case WM_LBUTTONUP:
- link = (LPTSTR)mir_alloc((pENLink->chrg.cpMax - pENLink->chrg.cpMin + 2) * sizeof(TCHAR));
+ link = (LPTSTR)mir_alloc((pENLink->chrg.cpMax - pENLink->chrg.cpMin + 2) * sizeof(wchar_t));
if (link == NULL)
break;
SendDlgItemMessage(hDlg, IDC_MAIN, EM_EXSETSEL, 0, (LPARAM)&pENLink->chrg);
SendDlgItemMessage(hDlg, IDC_MAIN, EM_GETSELTEXT, 0, (LPARAM)link);
- if (_tcsstr(link, L"mailto:") != NULL)
+ if (wcsstr(link, L"mailto:") != NULL)
ShellExecute(HWND_TOP, NULL, link, NULL, NULL, SW_SHOWNORMAL);
else {
bool openNewWindow = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_OPEN_WINDOW, 0xFF) != 0xFF;
@@ -142,7 +142,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) if (mouseEvent == 0x01)
EnableMenuItem(hSubMenu, IDM_SHOWMESSAGE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
TranslateMenu(hSubMenu);
- link = (LPTSTR)mir_alloc((pENLink->chrg.cpMax - pENLink->chrg.cpMin + 4) * sizeof(TCHAR));
+ link = (LPTSTR)mir_alloc((pENLink->chrg.cpMax - pENLink->chrg.cpMin + 4) * sizeof(wchar_t));
if (link == NULL)
break;
SendDlgItemMessage(hDlg, IDC_MAIN, EM_EXSETSEL, 0, (LPARAM)&pENLink->chrg);
@@ -154,13 +154,13 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) switch (TrackPopupMenu(hSubMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hDlg, NULL)) {
case IDM_LINK_OPEN:
- if (_tcsstr(link, L"mailto:") != NULL)
+ if (wcsstr(link, L"mailto:") != NULL)
ShellExecute(HWND_TOP, NULL, link, NULL, NULL, SW_SHOWNORMAL);
else
Utils_OpenUrlT(link,false);
break;
case IDM_LINK_OPENNEW:
- if (_tcsstr(link, L"mailto:") != NULL)
+ if (wcsstr(link, L"mailto:") != NULL)
ShellExecute(HWND_TOP, NULL, link, NULL, NULL, SW_SHOWNORMAL);
else
Utils_OpenUrlT(link);
@@ -170,7 +170,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) break;
EmptyClipboard();
- size_t dataLen = ((mir_tstrlen(link) + 1) * sizeof(TCHAR));
+ size_t dataLen = ((mir_tstrlen(link) + 1) * sizeof(wchar_t));
HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, dataLen);
memcpy((LPTSTR)GlobalLock(hData), link, dataLen);
GlobalUnlock(hData);
@@ -187,7 +187,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) }
} break;
case WM_COMMAND: {
- TCHAR filter[40];
+ wchar_t filter[40];
listMenu = GetMenu(hDlg);
switch (wParam) {
@@ -373,7 +373,7 @@ INT_PTR CALLBACK SearchDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara } break;
case IDSEARCH: {
BYTE flags = 0x00;
- TCHAR filter[FILTERTEXT];
+ wchar_t filter[FILTERTEXT];
LPTSTR buffer;
int length;
@@ -393,7 +393,7 @@ INT_PTR CALLBACK SearchDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara flags |= SLL_DEEP;
length = GetWindowTextLength(GetDlgItem(hDlg, IDC_SEARCHSTRING)) + 1;
- buffer = (LPTSTR)mir_alloc((length + 1) * sizeof(TCHAR));
+ buffer = (LPTSTR)mir_alloc((length + 1) * sizeof(wchar_t));
if (buffer) {
GetDlgItemText(hDlg, IDC_SEARCHSTRING, buffer, length);
WriteLinkList(hListDlg, flags, DlgParam->listStart, buffer, 0);
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index 558a931e05..7517494115 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -45,11 +45,11 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart) LISTELEMENT *newElement, *actualElement;
BYTE type = LINK_UNKNOWN;
int direction, isLink, linkFound = 0;
- TCHAR date[DATE_SIZE + 1];
- TCHAR time[TIME_SIZE + 1];
- TCHAR link[LINK_MAX + 1];
- TCHAR templink[LINK_MAX + 1];
- TCHAR dbdate[DATE_SIZE + TIME_SIZE];
+ wchar_t date[DATE_SIZE + 1];
+ wchar_t time[TIME_SIZE + 1];
+ wchar_t link[LINK_MAX + 1];
+ wchar_t templink[LINK_MAX + 1];
+ wchar_t dbdate[DATE_SIZE + TIME_SIZE];
if (listStart == NULL)
return -1;
@@ -66,26 +66,26 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart) //hyperlinks are delimited by: <non-alphanumeric>"hyperlink"<whitespace>
//then all punctuation is stripped from the end of "hyperlink"
iLastAlphaNum = 0;
- while (msg[i] && !_istalnum(msg[i])) {
+ while (msg[i] && !iswalnum(msg[i])) {
// support for files
- if (msg[i] == _T('\\') && msg[i + 1] == _T('\\') && _istalnum(msg[i + 2]))
+ if (msg[i] == '\\' && msg[i + 1] == '\\' && iswalnum(msg[i + 2]))
break;
if(IsDBCSLeadByte(msg[i]) && msg[i + 1])
i ++;
i ++;
- if (msg[i] != _T('\n'))
+ if (msg[i] != '\n')
charCount ++;
}
- if (msg[i] == _T('\0'))
+ if (msg[i] == '\0')
break;
cpWordStart = charCount;
wordStart = i;
- while (msg[i] && !_istspace(msg[i])) {
+ while (msg[i] && !iswspace(msg[i])) {
if (IsDBCSLeadByte(msg[i]) && msg[i + 1]) {
i ++;
} else {
- if (_istalnum(msg[i]) || msg[i]==_T('/')) {
+ if (iswalnum(msg[i]) || msg[i]=='/') {
cpLastAlphaNum = charCount;
iLastAlphaNum = i;
}
@@ -102,8 +102,8 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart) isLink = 0;
wordlen = (i - wordStart + 1);
- word = (LPTSTR)mir_alloc(wordlen * sizeof(TCHAR));
- wordsearch = (LPTSTR)mir_alloc(wordlen * sizeof(TCHAR));
+ word = (LPTSTR)mir_alloc(wordlen * sizeof(wchar_t));
+ wordsearch = (LPTSTR)mir_alloc(wordlen * sizeof(wchar_t));
if (word == NULL || wordsearch == NULL) {
mir_free(word);
mir_free(wordsearch);
@@ -111,26 +111,26 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart) break;
}
- _tcsncpy_s(word, wordlen, msg + wordStart, (wordlen - 1));
- _tcsncpy_s(wordsearch, wordlen, msg + wordStart, (wordlen - 1));
+ wcsncpy_s(word, wordlen, msg + wordStart, (wordlen - 1));
+ wcsncpy_s(wordsearch, wordlen, msg + wordStart, (wordlen - 1));
CharLower(wordsearch);
for (j = 0; j < _countof(hyperlinkPrefixes); j ++) {
- if (!_tcsncmp(wordsearch, hyperlinkPrefixes[j], mir_tstrlen(hyperlinkPrefixes[j]))) {
+ if (!wcsncmp(wordsearch, hyperlinkPrefixes[j], mir_tstrlen(hyperlinkPrefixes[j]))) {
isLink = 1;
break;
}
}
if (!isLink) {
for (j = 0; j < _countof(hyperlinkSubstrings); j ++) {
- if (_tcsstr(wordsearch + 1,hyperlinkSubstrings[j])) {
+ if (wcsstr(wordsearch + 1,hyperlinkSubstrings[j])) {
isLink = 1;
break;
}
}
}
- if (_tcschr(wordsearch,_T('@')) && _tcschr(wordsearch,_T('.')) && !_tcschr(wordsearch,_T(':')) && !_tcschr(wordsearch,_T('/'))) {
+ if (wcschr(wordsearch,'@') && wcschr(wordsearch,'.') && !wcschr(wordsearch,':') && !wcschr(wordsearch,'/')) {
isLink = 1; //e-mail addresses
type = LINK_MAIL;
} else if (isLink) {
@@ -138,29 +138,28 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart) }
if (isLink && wordlen <= LINK_MAX) {
- if (_tcsstr(wordsearch, L"www.") != NULL && _tcsstr(wordsearch, L"http://") == NULL && _tcsstr(wordsearch, L"https://") == NULL) {
- _tcsncpy_s(link, L"http://", LINK_MAX);
- _tcsncat_s(link, word, LINK_MAX);
+ if (wcsstr(wordsearch, L"www.") != NULL && wcsstr(wordsearch, L"http://") == NULL && wcsstr(wordsearch, L"https://") == NULL) {
+ wcsncpy_s(link, L"http://", LINK_MAX);
+ wcsncat_s(link, word, LINK_MAX);
} else {
- _tcsncpy_s(link, word, LINK_MAX);
+ wcsncpy_s(link, word, LINK_MAX);
}
TimeZone_ToStringT(dbei->timestamp, L"d-t", dbdate, _countof(dbdate));
- date_ptr = _tcstok_s(dbdate, L"-", &tok_ctx);
- time_ptr = _tcstok_s(NULL, L"-", &tok_ctx);
- _tcsncpy_s(date, date_ptr, _TRUNCATE);
- _tcsncpy_s(time, time_ptr, _TRUNCATE);
+ date_ptr = wcstok_s(dbdate, L"-", &tok_ctx);
+ time_ptr = wcstok_s(NULL, L"-", &tok_ctx);
+ wcsncpy_s(date, date_ptr, _TRUNCATE);
+ wcsncpy_s(time, time_ptr, _TRUNCATE);
- if (dbei->flags & DBEF_SENT) {
+ if (dbei->flags & DBEF_SENT)
direction = DIRECTION_OUT;
- } else {
+ else
direction = DIRECTION_IN;
- }
- if (type == LINK_MAIL && _tcsstr(link, L"mailto:") == NULL) {
- _tcsncpy_s(templink, link, _TRUNCATE);
- _tcsncpy_s(link, L"mailto:", _TRUNCATE);
- _tcsncpy_s((link + _mstrlen(L"mailto:")), (_countof(link) - _mstrlen(L"mailto:")), templink, _TRUNCATE);
+ if (type == LINK_MAIL && wcsstr(link, L"mailto:") == NULL) {
+ wcsncpy_s(templink, link, _TRUNCATE);
+ wcsncpy_s(link, L"mailto:", _TRUNCATE);
+ wcsncpy_s((link + _mstrlen(L"mailto:")), (_countof(link) - _mstrlen(L"mailto:")), templink, _TRUNCATE);
}
// Add new Element to list:
@@ -172,9 +171,9 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart) memset(newElement, 0, sizeof(LISTELEMENT));
newElement->direction = direction;
newElement->type = type;
- _tcsncpy_s(newElement->date, date, _TRUNCATE);
- _tcsncpy_s(newElement->time, time, _TRUNCATE);
- _tcsncpy_s(newElement->link, link, _TRUNCATE);
+ wcsncpy_s(newElement->date, date, _TRUNCATE);
+ wcsncpy_s(newElement->time, time, _TRUNCATE);
+ wcsncpy_s(newElement->link, link, _TRUNCATE);
newElement->hEvent = hEvent;
actualElement = listStart;
@@ -249,10 +248,10 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc HWND hwndProgress = NULL;
RECT DesktopRect;
MYCOLOURSET colourSet;
- TCHAR textLine[LINK_MAX + DIR_SIZE + TIME_SIZE + TYPE_SIZE + 6];
- TCHAR searchText[320];
- TCHAR lastDate[11] = {0};
- TCHAR filter1, filter2, filter3;
+ wchar_t textLine[LINK_MAX + DIR_SIZE + TIME_SIZE + TYPE_SIZE + 6];
+ wchar_t searchText[320];
+ wchar_t lastDate[11] = {0};
+ wchar_t filter1, filter2, filter3;
size_t lineLen, listCount=0, realListCount=0, actCount=0, len, appCount = 0;
int linePos = -1;
LISTELEMENT *actualElement;
@@ -303,7 +302,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc cf.dwMask = CFM_ITALIC | CFM_BOLD | CFM_FACE | CFM_COLOR;
cf.dwEffects = CFE_BOLD;
cf.crTextColor = colourSet.text;
- _tcscpy_s(cf.szFaceName, L"Arial");
+ wcscpy_s(cf.szFaceName, L"Arial");
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
mir_sntprintf(searchText, L"%s '%s': %d\n\n", TranslateT("Matches for searchtext"), searchString, listCount);
@@ -314,7 +313,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_FACE | CFM_BOLD;
- _tcscpy_s(cf.szFaceName, L"Courier");
+ wcscpy_s(cf.szFaceName, L"Courier");
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
}
@@ -325,13 +324,13 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc linePos = GetLastLinePos(listStart);
if ((realListCount - append) == 1)
- _tcscpy_s(lastDate, actualElement->date);
+ wcscpy_s(lastDate, actualElement->date);
for(appCount = 1; appCount <= (realListCount - append); appCount++)
{
actualElement = actualElement->nextElement;
if(appCount == (realListCount - append - 1))
- _tcscpy_s(lastDate, actualElement->date);
+ wcscpy_s(lastDate, actualElement->date);
}
gtl.flags = GTL_PRECISE;
gtl.codepage = CP_ACP;
@@ -385,7 +384,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc db_event_get(actualElement->hEvent, &dbe);
dbe.pBlob[dbe.cbBlob] = 0;
LPTSTR msg = DbGetEventTextT(&dbe, CP_ACP);
- if ( _tcsstr(msg, searchString))
+ if ( wcsstr(msg, searchString))
filter3 = 1;
mir_free(dbe.pBlob);
@@ -393,7 +392,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc }
else filter3 = 0;
}
- else if ( _tcsstr(actualElement->link, searchString))
+ else if ( wcsstr(actualElement->link, searchString))
filter3 = 1;
}
else filter3 = 1;
@@ -415,7 +414,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc cf.cbSize = sizeof(cf);
cf.dwMask = CFM_ITALIC | CFM_BOLD | CFM_FACE;
cf.dwEffects = CFE_BOLD;
- _tcscpy_s(cf.szFaceName, L"Arial");
+ wcscpy_s(cf.szFaceName, L"Arial");
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
if ( options.showDate != 0 )
{
@@ -423,11 +422,11 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc SendDlgItemMessage( hDlg, IDC_MAIN, EM_REPLACESEL, FALSE, (LPARAM) L"\n\n");
linePos += 3;
}
- _tcscpy_s(lastDate, actualElement->date);
+ wcscpy_s(lastDate, actualElement->date);
memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof cf;
cf.dwMask = CFM_ITALIC | CFM_BOLD | CFM_UNDERLINE | CFM_FACE;
- _tcscpy_s(cf.szFaceName, L"Courier");
+ wcscpy_s(cf.szFaceName, L"Courier");
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
}
memset(&cf, 0, sizeof(cf));
@@ -485,7 +484,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc cf.cbSize = sizeof(cf);
cf.dwMask = CFM_ITALIC | CFM_BOLD | CFM_FACE;
cf.dwEffects = CFE_BOLD;
- _tcscpy_s(cf.szFaceName, L"Arial");
+ wcscpy_s(cf.szFaceName, L"Arial");
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
SendDlgItemMessage( hDlg, IDC_MAIN, EM_REPLACESEL, FALSE, (LPARAM)TranslateT("No messages found!\nPlease change current filter options."));
SendDlgItemMessage( hDlg, IDC_MAIN, EM_REPLACESEL, FALSE, (LPARAM)L"\n");
@@ -525,7 +524,7 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_FACE | CFM_BOLD | CFM_ITALIC | CFM_COLOR;
- _tcscpy_s(cf.szFaceName, L"Courier");
+ wcscpy_s(cf.szFaceName, L"Courier");
cf.crTextColor = TxtColourSel;
SendDlgItemMessage( hDlg, IDC_OPTIONS_RE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
if ( options->showLine == 1 )
@@ -537,7 +536,7 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B cf.cbSize = sizeof(cf);
cf.dwMask = CFM_BOLD | CFM_FACE | CFM_COLOR;
cf.dwEffects = CFE_BOLD;
- _tcscpy_s(cf.szFaceName, L"Arial");
+ wcscpy_s(cf.szFaceName, L"Arial");
cf.crTextColor = TxtColourSel;
SendDlgItemMessage( hDlg, IDC_OPTIONS_RE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
@@ -549,7 +548,7 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_ITALIC | CFM_BOLD | CFM_UNDERLINE | CFM_FACE;
- _tcscpy_s(cf.szFaceName, L"Courier");
+ wcscpy_s(cf.szFaceName, L"Courier");
SendDlgItemMessage( hDlg, IDC_OPTIONS_RE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
// incoming
@@ -557,7 +556,7 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B cf.cbSize = sizeof(cf);
cf.dwMask = CFM_COLOR | CFM_FACE;
cf.crTextColor = InColourSel;
- _tcscpy_s(cf.szFaceName, L"Courier");
+ wcscpy_s(cf.szFaceName, L"Courier");
SendDlgItemMessage(hDlg, IDC_OPTIONS_RE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf );
if ( options->showDirection == 1 )
@@ -580,7 +579,7 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B cf.cbSize = sizeof(cf);
cf.dwMask = CFM_COLOR | CFM_FACE;
cf.crTextColor = OutColourSel;
- _tcscpy_s(cf.szFaceName, L"Courier");
+ wcscpy_s(cf.szFaceName, L"Courier");
SendDlgItemMessage(hDlg, IDC_OPTIONS_RE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
@@ -718,13 +717,13 @@ Little helper function to draw a horizontal line */
void DrawLine(HWND hDlg, size_t lineLen)
{
- TCHAR line[LINK_MAX + 18];
+ wchar_t line[LINK_MAX + 18];
size_t i;
for (i=0; (i<lineLen+18)&&(i<LINK_MAX+18); i++ )
{
- line[i] = _T('_');
+ line[i] = '_';
}
- line[lineLen+18] = _T('\0');
+ line[lineLen+18] = '\0';
SendDlgItemMessage( hDlg, IDC_MAIN, EM_REPLACESEL, FALSE, (LPARAM)line);
SendDlgItemMessage( hDlg, IDC_MAIN, EM_REPLACESEL, FALSE, (LPARAM)L"\n");
return;
@@ -775,7 +774,7 @@ void GetListInfo(BYTE params, LISTELEMENT *listStart, LPCTSTR searchString, siz dbe.pBlob = (PBYTE)mir_alloc(dbe.cbBlob+1);
db_event_get(actualElement->hEvent, &dbe);
dbe.pBlob[dbe.cbBlob] = 0;
- if ( _tcsstr((LPTSTR)dbe.pBlob, searchString))
+ if ( wcsstr((LPTSTR)dbe.pBlob, searchString))
filter3 = 1;
mir_free(dbe.pBlob);
@@ -785,7 +784,7 @@ void GetListInfo(BYTE params, LISTELEMENT *listStart, LPCTSTR searchString, siz }
else
{
- if(_tcsstr(actualElement->link, searchString))
+ if(wcsstr(actualElement->link, searchString))
filter3 = 1;
}
}
@@ -1238,15 +1237,15 @@ BOOL SaveEditAsStream( HWND hDlg ) LONG lOut;
OPENFILENAME ofn;
HANDLE hFile;
- TCHAR szFilename[MAX_PATH];
+ wchar_t szFilename[MAX_PATH];
// Initialize filename field
- _tcscpy_s(szFilename, L"*.rtf");
+ wcscpy_s(szFilename, L"*.rtf");
// Fill in OPENFILENAME struct
memset(&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hDlg;
- TCHAR temp[MAX_PATH];
+ wchar_t temp[MAX_PATH];
mir_sntprintf(temp, L"%s (*.rtf)%c*.rtf%c%s (*.*)%c*.*%c%c", TranslateT("RTF file"), 0, 0, TranslateT("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
ofn.lpstrFile = szFilename;
diff --git a/plugins/HistoryLinkListPlus/src/stdafx.h b/plugins/HistoryLinkListPlus/src/stdafx.h index 37859b91b2..e0ff6adecd 100644 --- a/plugins/HistoryLinkListPlus/src/stdafx.h +++ b/plugins/HistoryLinkListPlus/src/stdafx.h @@ -76,9 +76,9 @@ struct LISTELEMENT {
BYTE direction;
BYTE type;
- TCHAR date[DATE_SIZE];
- TCHAR time[TIME_SIZE];
- TCHAR link[LINK_MAX];
+ wchar_t date[DATE_SIZE];
+ wchar_t time[TIME_SIZE];
+ wchar_t link[LINK_MAX];
MEVENT hEvent;
int linePos;
struct LISTELEMENT *nextElement;
diff --git a/plugins/HistoryStats/src/_consts.h b/plugins/HistoryStats/src/_consts.h index f1e8c8fa47..cd06f27fe3 100644 --- a/plugins/HistoryStats/src/_consts.h +++ b/plugins/HistoryStats/src/_consts.h @@ -4,11 +4,9 @@ #include "stdafx.h"
#if defined(HISTORYSTATS_CONST_DEFINE)
-#define CONST_T(nam, txt) extern const TCHAR* nam = _T(txt);
#define CONST_A(nam, txt) extern const char* nam = txt;
#define CONST_W(nam, txt) extern const WCHAR* nam = L#txt;
#else
-#define CONST_T(nam, txt) extern const TCHAR* nam;
#define CONST_A(nam, txt) extern const char* nam;
#define CONST_W(nam, txt) extern const WCHAR* nam;
#endif
@@ -109,72 +107,72 @@ namespace con CONST_A(SettGroup , "Group" )
// column tags
- CONST_T(ColChatDuration , "chatduration" )
- CONST_T(ColEvents , "events" )
- CONST_T(ColGroup , "group" )
- CONST_T(ColInOut , "inouttext" )
- CONST_T(ColInOutGraph , "inout" )
- CONST_T(ColNick , "nick" )
- CONST_T(ColProtocol , "protocol" )
- CONST_T(ColRank , "rank" )
- CONST_T(ColSplit , "split" )
- CONST_T(ColSplitTimeline , "splittimeline" )
- CONST_T(ColTimeline , "timeline" )
- CONST_T(ColWordCount , "wordcount" )
- CONST_T(ColWords , "commonwords" )
+ CONST_W(ColChatDuration , "chatduration" )
+ CONST_W(ColEvents , "events" )
+ CONST_W(ColGroup , "group" )
+ CONST_W(ColInOut , "inouttext" )
+ CONST_W(ColInOutGraph , "inout" )
+ CONST_W(ColNick , "nick" )
+ CONST_W(ColProtocol , "protocol" )
+ CONST_W(ColRank , "rank" )
+ CONST_W(ColSplit , "split" )
+ CONST_W(ColSplitTimeline , "splittimeline" )
+ CONST_W(ColTimeline , "timeline" )
+ CONST_W(ColWordCount , "wordcount" )
+ CONST_W(ColWords , "commonwords" )
// suffix for column-specific settings
- CONST_T(SuffixData , "/data" )
+ CONST_W(SuffixData , "/data" )
// suffix for shared column data (filter words)
- CONST_T(SuffixWords , "/words" )
+ CONST_W(SuffixWords , "/words" )
// keys for common column settings
- CONST_T(KeyGUID , "guid" )
- CONST_T(KeyEnabled , "enabled" )
- CONST_T(KeyTitle , "title" )
+ CONST_W(KeyGUID , "guid" )
+ CONST_W(KeyEnabled , "enabled" )
+ CONST_W(KeyTitle , "title" )
// keys for column-specific settings
- CONST_T(KeyAbsolute , "absolute" ) // InOut, InOutGraph
- CONST_T(KeyAbsTime , "abs_time" ) // InOut, InOutGraph
- CONST_T(KeyBlocks , "blocks" ) // Split, SplitTimeline
- CONST_T(KeyBlockUnit , "block_unit" ) // Split, SplitTimeline
- CONST_T(KeyContactCount , "contact_count" ) // Nick
- CONST_T(KeyCustomGroup , "custom_group" ) // SplitTimeline
- CONST_T(KeyDays , "days" ) // Timeline
- CONST_T(KeyDetail , "detail" ) // ChatDuration, InOutGraph, Nick, Split, Timeline, WordCount, Words
- CONST_T(KeyDetailInOut , "detail_inout" ) // Words
- CONST_T(KeyDetailInvert , "detail_invert" ) // InOutGraph
- CONST_T(KeyDetailPercent , "detail_percent" ) // InOutGraph
- CONST_T(KeyDOWGroup , "dow_group" ) // SplitTimeline
- CONST_T(KeyFilterLinks , "filter_links" ) // [Base]Words
- CONST_T(KeyFilterWords , "filter_words" ) // [Base]Words
- CONST_T(KeyGraph , "graph" ) // ChatDuration
- CONST_T(KeyGraphAlign , "graph_align" ) // Split, SplitTimeline
- CONST_T(KeyGraphPercent , "graph_percent" ) // InOutGraph
- CONST_T(KeyHODGroup , "hod_group" ) // SplitTimeline
- CONST_T(KeyIgnoreOld , "ignore_old" ) // Timeline
- CONST_T(KeyInOutColor , "in_out_color" ) // Words
- CONST_T(KeyMaxLength , "max_length" ) // [Base]Words
- CONST_T(KeyMinLength , "min_length" ) // [Base]Words
- CONST_T(KeyNum , "num" ) // Words, **keys for common column settings**
- CONST_T(KeyOffset , "offset" ) // Words
- CONST_T(KeyShowSum , "show_sum" ) // InOutGraph
- CONST_T(KeySource , "source" ) // [Base]Words, Events, InOut, InOutGraph, Split, SplitTimeline, Timeline
- CONST_T(KeySourceType , "source_type" ) // Split, SplitTimeline, Timeline
- CONST_T(KeyTopPerColumn , "top_per_column" ) // SplitTimeline
- CONST_T(KeyUnitsPerBlock , "units_per_block" ) // Split, SplitTimeline
- CONST_T(KeyVisMode , "vis_mode" ) // ChatDuration, Split, SplitTimeline, WordCount, Words
+ CONST_W(KeyAbsolute , "absolute" ) // InOut, InOutGraph
+ CONST_W(KeyAbsTime , "abs_time" ) // InOut, InOutGraph
+ CONST_W(KeyBlocks , "blocks" ) // Split, SplitTimeline
+ CONST_W(KeyBlockUnit , "block_unit" ) // Split, SplitTimeline
+ CONST_W(KeyContactCount , "contact_count" ) // Nick
+ CONST_W(KeyCustomGroup , "custom_group" ) // SplitTimeline
+ CONST_W(KeyDays , "days" ) // Timeline
+ CONST_W(KeyDetail , "detail" ) // ChatDuration, InOutGraph, Nick, Split, Timeline, WordCount, Words
+ CONST_W(KeyDetailInOut , "detail_inout" ) // Words
+ CONST_W(KeyDetailInvert , "detail_invert" ) // InOutGraph
+ CONST_W(KeyDetailPercent , "detail_percent" ) // InOutGraph
+ CONST_W(KeyDOWGroup , "dow_group" ) // SplitTimeline
+ CONST_W(KeyFilterLinks , "filter_links" ) // [Base]Words
+ CONST_W(KeyFilterWords , "filter_words" ) // [Base]Words
+ CONST_W(KeyGraph , "graph" ) // ChatDuration
+ CONST_W(KeyGraphAlign , "graph_align" ) // Split, SplitTimeline
+ CONST_W(KeyGraphPercent , "graph_percent" ) // InOutGraph
+ CONST_W(KeyHODGroup , "hod_group" ) // SplitTimeline
+ CONST_W(KeyIgnoreOld , "ignore_old" ) // Timeline
+ CONST_W(KeyInOutColor , "in_out_color" ) // Words
+ CONST_W(KeyMaxLength , "max_length" ) // [Base]Words
+ CONST_W(KeyMinLength , "min_length" ) // [Base]Words
+ CONST_W(KeyNum , "num" ) // Words, **keys for common column settings**
+ CONST_W(KeyOffset , "offset" ) // Words
+ CONST_W(KeyShowSum , "show_sum" ) // InOutGraph
+ CONST_W(KeySource , "source" ) // [Base]Words, Events, InOut, InOutGraph, Split, SplitTimeline, Timeline
+ CONST_W(KeySourceType , "source_type" ) // Split, SplitTimeline, Timeline
+ CONST_W(KeyTopPerColumn , "top_per_column" ) // SplitTimeline
+ CONST_W(KeyUnitsPerBlock , "units_per_block" ) // Split, SplitTimeline
+ CONST_W(KeyVisMode , "vis_mode" ) // ChatDuration, Split, SplitTimeline, WordCount, Words
// keeys for shared column data (filter words)
- CONST_T(KeyID , "id" )
- CONST_T(KeyName , "name" )
- CONST_T(KeyMode , "mode" )
- CONST_T(KeyNumWords , "num_words" )
+ CONST_W(KeyID , "id" )
+ CONST_W(KeyName , "name" )
+ CONST_W(KeyMode , "mode" )
+ CONST_W(KeyNumWords , "num_words" )
// keys for sort settings
- CONST_T(KeyAsc , "asc" )
- CONST_T(KeyBy , "by" )
+ CONST_W(KeyAsc , "asc" )
+ CONST_W(KeyBy , "by" )
// miranda services created by historystats
CONST_A(SvcConfigure , "HistoryStats/Configure" )
@@ -206,7 +204,7 @@ namespace con const COLORREF ColorTotals = RGB(0xDF, 0xDF, 0xDF);
}
-#undef CONST_T
+#undef CONST_W
#undef CONST_A
#undef CONST_W
diff --git a/plugins/HistoryStats/src/bandctrl.cpp b/plugins/HistoryStats/src/bandctrl.cpp index 5569efbf3c..2240b1f55c 100644 --- a/plugins/HistoryStats/src/bandctrl.cpp +++ b/plugins/HistoryStats/src/bandctrl.cpp @@ -10,7 +10,7 @@ void BandCtrl::setLayout(int nLayout) SendMessage(m_hBandWnd, BCM_SETLAYOUT, nLayout, 0);
}
-HANDLE BandCtrl::addButton(DWORD dwFlags, HICON hIcon, INT_PTR dwData, const TCHAR *szTooltip, const TCHAR *szText)
+HANDLE BandCtrl::addButton(DWORD dwFlags, HICON hIcon, INT_PTR dwData, const wchar_t *szTooltip, const wchar_t *szText)
{
BCBUTTON bcb;
diff --git a/plugins/HistoryStats/src/bandctrl.h b/plugins/HistoryStats/src/bandctrl.h index 77f1b7d023..4917545c87 100644 --- a/plugins/HistoryStats/src/bandctrl.h +++ b/plugins/HistoryStats/src/bandctrl.h @@ -25,7 +25,7 @@ public: public:
void setLayout(int nLayout);
- HANDLE addButton(DWORD dwFlags, HICON hIcon, INT_PTR dwData, const TCHAR* szTooltip = NULL, const TCHAR* szText = NULL);
+ HANDLE addButton(DWORD dwFlags, HICON hIcon, INT_PTR dwData, const wchar_t* szTooltip = NULL, const wchar_t* szText = NULL);
bool isButtonChecked(HANDLE hButton);
void checkButton(HANDLE hButton, bool bCheck);
DWORD getButtonData(HANDLE hButton);
diff --git a/plugins/HistoryStats/src/bandctrldefs.h b/plugins/HistoryStats/src/bandctrldefs.h index a48ac238e8..1be373dcfa 100644 --- a/plugins/HistoryStats/src/bandctrldefs.h +++ b/plugins/HistoryStats/src/bandctrldefs.h @@ -44,8 +44,8 @@ public: struct BCBUTTON {
DWORD dwFlags;
HICON hIcon;
- const TCHAR *m_szText;
- const TCHAR *m_szTooltip;
+ const wchar_t *m_szText;
+ const wchar_t *m_szTooltip;
INT_PTR dwData;
};
diff --git a/plugins/HistoryStats/src/bandctrlimpl.cpp b/plugins/HistoryStats/src/bandctrlimpl.cpp index 76e8b47dbe..d3ed8a4f65 100644 --- a/plugins/HistoryStats/src/bandctrlimpl.cpp +++ b/plugins/HistoryStats/src/bandctrlimpl.cpp @@ -8,7 +8,7 @@ * BandCtrlImpl
*/
-const TCHAR* BandCtrlImpl::m_ClassName = L"HistoryStatsBand";
+const wchar_t* BandCtrlImpl::m_ClassName = L"HistoryStatsBand";
const int BandCtrlImpl::m_PollId = 100;
const int BandCtrlImpl::m_PollDelay = 50;
@@ -604,7 +604,7 @@ void BandCtrlImpl::recalcButtonRects() m_Items[i].uTTId, // uId
m_Items[i].rItem, // rect
NULL, // hInstance
- const_cast<TCHAR*>(m_Items[i].tooltip.c_str()), // lpszText
+ const_cast<wchar_t*>(m_Items[i].tooltip.c_str()), // lpszText
};
SendMessage(m_hTooltip, TTM_SETTOOLINFO, 0, reinterpret_cast<LPARAM>(&ti));
@@ -625,7 +625,7 @@ void BandCtrlImpl::recalcButtonRects() m_hTooltip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, L"", WS_POPUP, 0, 0, 0, 0, NULL, NULL, g_hInst, NULL);
TOOLINFO ti = { sizeof(TOOLINFO), TTF_SUBCLASS, m_hWnd, UINT_PTR(i+1), m_Items[i].rItem, NULL,
- const_cast<TCHAR*>(m_Items[i].tooltip.c_str()), // lpszText
+ const_cast<wchar_t*>(m_Items[i].tooltip.c_str()), // lpszText
};
if (SendMessage(m_hTooltip, TTM_ADDTOOL, 0, reinterpret_cast<LPARAM>(&ti)))
diff --git a/plugins/HistoryStats/src/bandctrlimpl.h b/plugins/HistoryStats/src/bandctrlimpl.h index a9df939a00..7eef92ba68 100644 --- a/plugins/HistoryStats/src/bandctrlimpl.h +++ b/plugins/HistoryStats/src/bandctrlimpl.h @@ -31,7 +31,7 @@ private: };
private:
- static const TCHAR* m_ClassName;
+ static const wchar_t* m_ClassName;
static const int m_PollId;
static const int m_PollDelay;
diff --git a/plugins/HistoryStats/src/canvas.cpp b/plugins/HistoryStats/src/canvas.cpp index be0cd3978c..118534209d 100644 --- a/plugins/HistoryStats/src/canvas.cpp +++ b/plugins/HistoryStats/src/canvas.cpp @@ -131,13 +131,13 @@ bool Canvas::getDigest(Digest& digest) return true;
}
-bool Canvas::writePNG(const TCHAR* szFileName)
+bool Canvas::writePNG(const wchar_t* szFileName)
{
IMGSRVC_INFO img = { 0 };
img.cbSize = sizeof(img);
img.dwMask = IMGI_HBITMAP;
img.hbm = m_hBmp;
img.fif = FIF_PNG;
- img.tszName = (TCHAR*)szFileName;
+ img.tszName = (wchar_t*)szFileName;
return CallService(MS_IMG_SAVE, (WPARAM)&img, IMGL_TCHAR) == 0;
}
diff --git a/plugins/HistoryStats/src/canvas.h b/plugins/HistoryStats/src/canvas.h index a5b7f06519..99213316f2 100644 --- a/plugins/HistoryStats/src/canvas.h +++ b/plugins/HistoryStats/src/canvas.h @@ -48,7 +48,7 @@ public: void endDraw();
bool getDigest(Digest& digest);
- bool writePNG(const TCHAR* szFileName);
+ bool writePNG(const wchar_t* szFileName);
};
#endif // HISTORYSTATS_GUARD_CANVAS_H
diff --git a/plugins/HistoryStats/src/column.h b/plugins/HistoryStats/src/column.h index 1c1aaca70e..bb03bc1291 100644 --- a/plugins/HistoryStats/src/column.h +++ b/plugins/HistoryStats/src/column.h @@ -38,8 +38,8 @@ private: {
public:
ext::string m_UID;
- const TCHAR* m_Title;
- const TCHAR* m_Description;
+ const wchar_t* m_Title;
+ const wchar_t* m_Description;
FactoryBase* m_pFactory;
};
@@ -170,9 +170,9 @@ public: /*
* public interface for virtual functions
*/
- const TCHAR* getUID() const { return impl_getUID(); }
- const TCHAR* getTitle() const { return impl_getTitle(); }
- const TCHAR* getDescription() const { return impl_getDescription(); }
+ const wchar_t* getUID() const { return impl_getUID(); }
+ const wchar_t* getTitle() const { return impl_getTitle(); }
+ const wchar_t* getDescription() const { return impl_getDescription(); }
void copyConfig(const Column* pSource) { impl_copyConfig(pSource); }
int getFeatures() const { return impl_getFeatures(); }
void configRead(const SettingsTree& settings) { impl_configRead(settings); }
@@ -206,19 +206,19 @@ protected: * Returns a unique ID for column.
* [virtual/abstract]
*/
- virtual const TCHAR* impl_getUID() const = 0;
+ virtual const wchar_t* impl_getUID() const = 0;
/*
* Returns the title for the column.
* [virtual/abstract]
*/
- virtual const TCHAR* impl_getTitle() const = 0;
+ virtual const wchar_t* impl_getTitle() const = 0;
/*
* Returns the description for the column.
* [virtual/abstract]
*/
- virtual const TCHAR* impl_getDescription() const = 0;
+ virtual const wchar_t* impl_getDescription() const = 0;
/*
* Creates a exact copy of the column.
diff --git a/plugins/HistoryStats/src/column_chatduration.cpp b/plugins/HistoryStats/src/column_chatduration.cpp index 4954f693b8..762e750d1b 100644 --- a/plugins/HistoryStats/src/column_chatduration.cpp +++ b/plugins/HistoryStats/src/column_chatduration.cpp @@ -79,11 +79,11 @@ Column::StyleList ColChatDuration::impl_outputGetAdditionalStyles(IDProvider& id void ColChatDuration::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szVisModeDesc[] = {
- LPGENT("Minimum chat duration"),
- LPGENT("Average chat duration"),
- LPGENT("Maximum chat duration"),
- LPGENT("Total chat duration"),
+ static const wchar_t* szVisModeDesc[] = {
+ LPGENW("Minimum chat duration"),
+ LPGENW("Average chat duration"),
+ LPGENW("Maximum chat duration"),
+ LPGENW("Total chat duration"),
};
if (row == 1)
@@ -162,11 +162,11 @@ void ColChatDuration::impl_outputRenderRow(ext::ostream& tos, const Contact& con // output tooltip
if (m_bDetail)
{
- static const TCHAR* szPrefixes[] = {
- LPGENT("[Min] #{amount}"),
- LPGENT("[Avg] #{amount}"),
- LPGENT("[Max] #{amount}"),
- LPGENT("[Sum] #{amount}"),
+ static const wchar_t* szPrefixes[] = {
+ LPGENW("[Min] #{amount}"),
+ LPGENW("[Avg] #{amount}"),
+ LPGENW("[Max] #{amount}"),
+ LPGENW("[Sum] #{amount}"),
};
ext::string strTooltip;
diff --git a/plugins/HistoryStats/src/column_chatduration.h b/plugins/HistoryStats/src/column_chatduration.h index b3f325692e..95e8e237ce 100644 --- a/plugins/HistoryStats/src/column_chatduration.h +++ b/plugins/HistoryStats/src/column_chatduration.h @@ -27,9 +27,9 @@ public: explicit ColChatDuration();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColChatDuration; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Chat duration"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding the amount of time you have chatted with the given contact."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColChatDuration; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Chat duration"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding the amount of time you have chatted with the given contact."); }
virtual void impl_copyConfig(const Column* pSource);
virtual int impl_getFeatures() const { return cfHasConfig; }
virtual void impl_configRead(const SettingsTree& settings);
diff --git a/plugins/HistoryStats/src/column_events.cpp b/plugins/HistoryStats/src/column_events.cpp index 5b2c859d8c..1ecea2f2d5 100644 --- a/plugins/HistoryStats/src/column_events.cpp +++ b/plugins/HistoryStats/src/column_events.cpp @@ -31,13 +31,13 @@ void ColEvents::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup) {
m_hSource = Opt.insertCombo(hGroup, TranslateT("Events to count"));
- static const TCHAR* sourceTexts[] = {
- LPGENT("URLs (incoming)"),
- LPGENT("URLs (outgoing)"),
- LPGENT("URLs (all)"),
- LPGENT("Files (incoming)"),
- LPGENT("Files (outgoing)"),
- LPGENT("Files (all)"),
+ static const wchar_t* sourceTexts[] = {
+ LPGENW("URLs (incoming)"),
+ LPGENW("URLs (outgoing)"),
+ LPGENW("URLs (all)"),
+ LPGENW("Files (incoming)"),
+ LPGENW("Files (outgoing)"),
+ LPGENW("Files (all)"),
};
array_each_(i, sourceTexts)
@@ -55,18 +55,18 @@ void ColEvents::impl_configFromUI(OptionsCtrl& Opt) void ColEvents::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szShortDesc[] = {
- LPGENT("URLs"),
- LPGENT("Files"),
+ static const wchar_t* szShortDesc[] = {
+ LPGENW("URLs"),
+ LPGENW("Files"),
};
- static const TCHAR* szSourceDesc[] = {
- LPGENT("Incoming URLs"),
- LPGENT("Outgoing URLs"),
- LPGENT("URLs"),
- LPGENT("Incoming files"),
- LPGENT("Outgoing files"),
- LPGENT("Files"),
+ static const wchar_t* szSourceDesc[] = {
+ LPGENW("Incoming URLs"),
+ LPGENW("Outgoing URLs"),
+ LPGENW("URLs"),
+ LPGENW("Incoming files"),
+ LPGENW("Outgoing files"),
+ LPGENW("Files"),
};
if (row == 1)
diff --git a/plugins/HistoryStats/src/column_events.h b/plugins/HistoryStats/src/column_events.h index 09a045c92c..5fd9d52dff 100644 --- a/plugins/HistoryStats/src/column_events.h +++ b/plugins/HistoryStats/src/column_events.h @@ -19,9 +19,9 @@ public: explicit ColEvents();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColEvents; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Events"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding event counts for incoming, outgoing or total number of files or URLs."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColEvents; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Events"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding event counts for incoming, outgoing or total number of files or URLs."); }
virtual void impl_copyConfig(const Column* pSource);
virtual int impl_getFeatures() const { return cfHasConfig; }
virtual void impl_configRead(const SettingsTree& settings);
diff --git a/plugins/HistoryStats/src/column_group.h b/plugins/HistoryStats/src/column_group.h index caf7061500..4683bdb47e 100644 --- a/plugins/HistoryStats/src/column_group.h +++ b/plugins/HistoryStats/src/column_group.h @@ -11,9 +11,9 @@ class ColGroup : public Column
{
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColGroup; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Group"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding the contact list's group name the contact is in."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColGroup; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Group"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding the contact list's group name the contact is in."); }
virtual int impl_getFeatures() const { return 0; }
virtual int impl_configGetRestrictions(ext::string*) const { return crHTMLFull; }
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
diff --git a/plugins/HistoryStats/src/column_inout.cpp b/plugins/HistoryStats/src/column_inout.cpp index 6bdc88909c..67a8d7d35f 100644 --- a/plugins/HistoryStats/src/column_inout.cpp +++ b/plugins/HistoryStats/src/column_inout.cpp @@ -46,16 +46,16 @@ void ColInOut::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup) Opt.insertRadio(m_hAbsolute, m_hAbsTime, TranslateT("Units per week"));
Opt.insertRadio(m_hAbsolute, m_hAbsTime, TranslateT("Units per month (30 days)"));
- static const TCHAR* sourceTexts[] = {
- LPGENT("Characters (incoming)"),
- LPGENT("Characters (outgoing)"),
- LPGENT("Characters (all)"),
- LPGENT("Messages (incoming)"),
- LPGENT("Messages (outgoing)"),
- LPGENT("Messages (all)"),
- LPGENT("Chats (incoming)"),
- LPGENT("Chats (outgoing)"),
- LPGENT("Chats (all)"),
+ static const wchar_t* sourceTexts[] = {
+ LPGENW("Characters (incoming)"),
+ LPGENW("Characters (outgoing)"),
+ LPGENW("Characters (all)"),
+ LPGENW("Messages (incoming)"),
+ LPGENW("Messages (outgoing)"),
+ LPGENW("Messages (all)"),
+ LPGENW("Chats (incoming)"),
+ LPGENW("Chats (outgoing)"),
+ LPGENW("Chats (all)"),
};
array_each_(i, sourceTexts)
@@ -77,28 +77,28 @@ void ColInOut::impl_configFromUI(OptionsCtrl& Opt) void ColInOut::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szShortDesc[] = {
- LPGENT("Characters"),
- LPGENT("Messages"),
- LPGENT("Chats")
+ static const wchar_t* szShortDesc[] = {
+ LPGENW("Characters"),
+ LPGENW("Messages"),
+ LPGENW("Chats")
};
- static const TCHAR* szSourceDesc[] = {
- LPGENT("Incoming characters"),
- LPGENT("Outgoing characters"),
- LPGENT("Characters"),
- LPGENT("Incoming messages"),
- LPGENT("Outgoing messages"),
- LPGENT("Messages"),
- LPGENT("Incoming chats"),
- LPGENT("Outgoing chats"),
- LPGENT("Chats")
+ static const wchar_t* szSourceDesc[] = {
+ LPGENW("Incoming characters"),
+ LPGENW("Outgoing characters"),
+ LPGENW("Characters"),
+ LPGENW("Incoming messages"),
+ LPGENW("Outgoing messages"),
+ LPGENW("Messages"),
+ LPGENW("Incoming chats"),
+ LPGENW("Outgoing chats"),
+ LPGENW("Chats")
};
- static const TCHAR* szUnitDesc[] = {
- LPGENT("day"),
- LPGENT("week"),
- LPGENT("month"),
+ static const wchar_t* szUnitDesc[] = {
+ LPGENW("day"),
+ LPGENW("week"),
+ LPGENW("month"),
};
if (row == 1)
diff --git a/plugins/HistoryStats/src/column_inout.h b/plugins/HistoryStats/src/column_inout.h index 1a5ff19d39..c1ece71bff 100644 --- a/plugins/HistoryStats/src/column_inout.h +++ b/plugins/HistoryStats/src/column_inout.h @@ -23,9 +23,9 @@ public: explicit ColInOut();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColInOut; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("In/out"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding counts for incoming, outgoing or total characters, messages or chats. This column can display absolute and average values."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColInOut; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("In/out"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding counts for incoming, outgoing or total characters, messages or chats. This column can display absolute and average values."); }
virtual void impl_copyConfig(const Column* pSource);
virtual int impl_getFeatures() const { return cfHasConfig; }
virtual void impl_configRead(const SettingsTree& settings);
diff --git a/plugins/HistoryStats/src/column_inoutgraph.cpp b/plugins/HistoryStats/src/column_inoutgraph.cpp index be00a85cb6..288080c6fa 100644 --- a/plugins/HistoryStats/src/column_inoutgraph.cpp +++ b/plugins/HistoryStats/src/column_inoutgraph.cpp @@ -132,16 +132,16 @@ SIZE ColInOutGraph::impl_outputMeasureHeader() const void ColInOutGraph::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szSourceDesc[] = {
- LPGENT("Characters"),
- LPGENT("Messages"),
- LPGENT("Chats")
+ static const wchar_t* szSourceDesc[] = {
+ LPGENW("Characters"),
+ LPGENW("Messages"),
+ LPGENW("Chats")
};
- static const TCHAR* szSourceUnit[] = {
- LPGENT("day"),
- LPGENT("week"),
- LPGENT("month"),
+ static const wchar_t* szSourceUnit[] = {
+ LPGENW("day"),
+ LPGENW("week"),
+ LPGENW("month"),
};
if (row == 1)
diff --git a/plugins/HistoryStats/src/column_inoutgraph.h b/plugins/HistoryStats/src/column_inoutgraph.h index 67089c260b..6b08170ff4 100644 --- a/plugins/HistoryStats/src/column_inoutgraph.h +++ b/plugins/HistoryStats/src/column_inoutgraph.h @@ -35,9 +35,9 @@ public: ColInOutGraph();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColInOutGraph; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("In/out graph"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding in/out bar graphs for characters, messages or chats."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColInOutGraph; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("In/out graph"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding in/out bar graphs for characters, messages or chats."); }
virtual void impl_copyConfig(const Column* pSource);
virtual int impl_getFeatures() const { return cfHasConfig; }
virtual void impl_configRead(const SettingsTree& settings);
diff --git a/plugins/HistoryStats/src/column_nick.h b/plugins/HistoryStats/src/column_nick.h index 6701aa1976..b11959838e 100644 --- a/plugins/HistoryStats/src/column_nick.h +++ b/plugins/HistoryStats/src/column_nick.h @@ -21,9 +21,9 @@ public: explicit ColNick();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColNick; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Nick"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding the contact's nick and first/last message time if selected."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColNick; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Nick"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding the contact's nick and first/last message time if selected."); }
virtual void impl_copyConfig(const Column* pSource);
virtual int impl_getFeatures() const { return cfHasConfig; }
virtual void impl_configRead(const SettingsTree& settings);
diff --git a/plugins/HistoryStats/src/column_protocol.h b/plugins/HistoryStats/src/column_protocol.h index 611b4fbc7a..1fc303e91f 100644 --- a/plugins/HistoryStats/src/column_protocol.h +++ b/plugins/HistoryStats/src/column_protocol.h @@ -11,9 +11,9 @@ class ColProtocol : public Column
{
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColProtocol; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Protocol"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding the contact's protocol."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColProtocol; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Protocol"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding the contact's protocol."); }
virtual int impl_getFeatures() const { return 0; }
virtual int impl_configGetRestrictions(ext::string*) const { return crHTMLFull; }
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
diff --git a/plugins/HistoryStats/src/column_rank.h b/plugins/HistoryStats/src/column_rank.h index b0c152db84..fddadbaae7 100644 --- a/plugins/HistoryStats/src/column_rank.h +++ b/plugins/HistoryStats/src/column_rank.h @@ -14,9 +14,9 @@ private: int m_nNextRank;
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColRank; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Rank"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding the contact's placing according to your sorting criteria."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColRank; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Rank"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding the contact's placing according to your sorting criteria."); }
virtual int impl_getFeatures() const { return 0; }
virtual int impl_configGetRestrictions(ext::string*) const { return crHTMLFull; }
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
diff --git a/plugins/HistoryStats/src/column_split.cpp b/plugins/HistoryStats/src/column_split.cpp index 0b3be3ca4f..c0b2ce3990 100644 --- a/plugins/HistoryStats/src/column_split.cpp +++ b/plugins/HistoryStats/src/column_split.cpp @@ -73,16 +73,16 @@ void ColSplit::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup) Opt.insertRadio(hTemp, m_hGraphAlign, TranslateT("Align on week boundary"));
m_hDetail = Opt.insertCheck(hGroup, TranslateT("Details for every bar (tooltip)"));
- static const TCHAR* sourceTexts[] = {
- LPGENT("Characters (incoming)"),
- LPGENT("Characters (outgoing)"),
- LPGENT("Characters (all)"),
- LPGENT("Messages (incoming)"),
- LPGENT("Messages (outgoing)"),
- LPGENT("Messages (all)"),
- LPGENT("Chats (incoming)"),
- LPGENT("Chats (outgoing)"),
- LPGENT("Chats (all)"),
+ static const wchar_t* sourceTexts[] = {
+ LPGENW("Characters (incoming)"),
+ LPGENW("Characters (outgoing)"),
+ LPGENW("Characters (all)"),
+ LPGENW("Messages (incoming)"),
+ LPGENW("Messages (outgoing)"),
+ LPGENW("Messages (all)"),
+ LPGENW("Chats (incoming)"),
+ LPGENW("Chats (outgoing)"),
+ LPGENW("Chats (all)"),
};
array_each_(i, sourceTexts)
@@ -90,10 +90,10 @@ void ColSplit::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup) Opt.addComboItem(m_hSource, TranslateTS(sourceTexts[i]));
}
- static const TCHAR* unitTexts[] = {
- LPGENT("Hours"),
- LPGENT("Days"),
- LPGENT("Weeks"),
+ static const wchar_t* unitTexts[] = {
+ LPGENW("Hours"),
+ LPGENW("Days"),
+ LPGENW("Weeks"),
};
array_each_(i, unitTexts)
@@ -263,22 +263,22 @@ Column::StyleList ColSplit::impl_outputGetAdditionalStyles(IDProvider& idp) void ColSplit::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szTypeDesc[] = {
- LPGENT("Hours of day"),
- LPGENT("Days of week"),
- LPGENT("\"Split\""),
+ static const wchar_t* szTypeDesc[] = {
+ LPGENW("Hours of day"),
+ LPGENW("Days of week"),
+ LPGENW("\"Split\""),
};
- static const TCHAR* szSourceDesc[] = {
- LPGENT("incoming characters"),
- LPGENT("outgoing characters"),
- LPGENT("all characters"),
- LPGENT("incoming messages"),
- LPGENT("outgoing messages"),
- LPGENT("all messages"),
- LPGENT("incoming chats"),
- LPGENT("outgoing chats"),
- LPGENT("all chats"),
+ static const wchar_t* szSourceDesc[] = {
+ LPGENW("incoming characters"),
+ LPGENW("outgoing characters"),
+ LPGENW("all characters"),
+ LPGENW("incoming messages"),
+ LPGENW("outgoing messages"),
+ LPGENW("all messages"),
+ LPGENW("incoming chats"),
+ LPGENW("outgoing chats"),
+ LPGENW("all chats"),
};
if (row == 1)
@@ -344,14 +344,14 @@ void ColSplit::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, D {
SplitParams params = getParams();
- static const TCHAR* szWDayName[] = {
- LPGENT("wday3:Mon"),
- LPGENT("wday3:Tue"),
- LPGENT("wday3:Wed"),
- LPGENT("wday3:Thu"),
- LPGENT("wday3:Fri"),
- LPGENT("wday3:Sat"),
- LPGENT("wday3:Sun")
+ static const wchar_t* szWDayName[] = {
+ LPGENW("wday3:Mon"),
+ LPGENW("wday3:Tue"),
+ LPGENW("wday3:Wed"),
+ LPGENW("wday3:Thu"),
+ LPGENW("wday3:Fri"),
+ LPGENW("wday3:Sat"),
+ LPGENW("wday3:Sun")
};
const int* pData = reinterpret_cast<const int*>(contact.getSlot(contactDataSlotGet()));
diff --git a/plugins/HistoryStats/src/column_split.h b/plugins/HistoryStats/src/column_split.h index 06159d1615..4dbe77fe3d 100644 --- a/plugins/HistoryStats/src/column_split.h +++ b/plugins/HistoryStats/src/column_split.h @@ -49,9 +49,9 @@ public: explicit ColSplit();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColSplit; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("\"Split\""); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding a graphical overview of your chatting amount split by day of week or by hour of day. Different chatting amount measures are available."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColSplit; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("\"Split\""); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding a graphical overview of your chatting amount split by day of week or by hour of day. Different chatting amount measures are available."); }
virtual void impl_copyConfig(const Column* pSource);
virtual int impl_getFeatures() const { return cfHasConfig | cfAcquiresData; }
virtual void impl_configRead(const SettingsTree& settings);
diff --git a/plugins/HistoryStats/src/column_splittimeline.cpp b/plugins/HistoryStats/src/column_splittimeline.cpp index 17e139ba78..55d8f791c3 100644 --- a/plugins/HistoryStats/src/column_splittimeline.cpp +++ b/plugins/HistoryStats/src/column_splittimeline.cpp @@ -90,19 +90,19 @@ void ColSplitTimeline::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGrou m_hCustomGroup = Opt.insertEdit (hTempRadio, TranslateT("Number of columns to group"), L"", OptionsCtrl::OCF_NUMBER);
m_hTopPerColumn = Opt.insertCheck(hGroup, TranslateT("Calculate maximum per column (not per graph)"));
- static const TCHAR* sourceTexts[] = {
- LPGENT("Characters (incoming)"),
- LPGENT("Characters (outgoing)"),
- LPGENT("Characters (all)"),
- LPGENT("Characters (in/out ratio)"),
- LPGENT("Messages (incoming)"),
- LPGENT("Messages (outgoing)"),
- LPGENT("Messages (all)"),
- LPGENT("Messages (in/out ratio)"),
- LPGENT("Chats (incoming)"),
- LPGENT("Chats (outgoing)"),
- LPGENT("Chats (all)"),
- LPGENT("Chats (in/out ratio)"),
+ static const wchar_t* sourceTexts[] = {
+ LPGENW("Characters (incoming)"),
+ LPGENW("Characters (outgoing)"),
+ LPGENW("Characters (all)"),
+ LPGENW("Characters (in/out ratio)"),
+ LPGENW("Messages (incoming)"),
+ LPGENW("Messages (outgoing)"),
+ LPGENW("Messages (all)"),
+ LPGENW("Messages (in/out ratio)"),
+ LPGENW("Chats (incoming)"),
+ LPGENW("Chats (outgoing)"),
+ LPGENW("Chats (all)"),
+ LPGENW("Chats (in/out ratio)"),
};
array_each_(i, sourceTexts)
@@ -110,10 +110,10 @@ void ColSplitTimeline::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGrou Opt.addComboItem(m_hSource, TranslateTS(sourceTexts[i]));
}
- static const TCHAR* unitTexts[] = {
- LPGENT("Hours"),
- LPGENT("Days"),
- LPGENT("Weeks"),
+ static const wchar_t* unitTexts[] = {
+ LPGENW("Hours"),
+ LPGENW("Days"),
+ LPGENW("Weeks"),
};
array_each_(i, unitTexts)
@@ -250,25 +250,25 @@ void ColSplitTimeline::impl_contactDataMerge(Contact& contact, const Contact& in void ColSplitTimeline::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szTypeDesc[] = {
- LPGENT("Hours of day timeline"),
- LPGENT("Days of week timeline"),
- LPGENT("\"Split\" timeline"),
+ static const wchar_t* szTypeDesc[] = {
+ LPGENW("Hours of day timeline"),
+ LPGENW("Days of week timeline"),
+ LPGENW("\"Split\" timeline"),
};
- static const TCHAR* szSourceDesc[] = {
- LPGENT("incoming characters"),
- LPGENT("outgoing characters"),
- LPGENT("all characters"),
- LPGENT("in/out ratio of characters"),
- LPGENT("incoming messages"),
- LPGENT("outgoing messages"),
- LPGENT("all messages"),
- LPGENT("in/out ratio of messages"),
- LPGENT("incoming chats"),
- LPGENT("outgoing chats"),
- LPGENT("all chats"),
- LPGENT("in/out ratio of chats"),
+ static const wchar_t* szSourceDesc[] = {
+ LPGENW("incoming characters"),
+ LPGENW("outgoing characters"),
+ LPGENW("all characters"),
+ LPGENW("in/out ratio of characters"),
+ LPGENW("incoming messages"),
+ LPGENW("outgoing messages"),
+ LPGENW("all messages"),
+ LPGENW("in/out ratio of messages"),
+ LPGENW("incoming chats"),
+ LPGENW("outgoing chats"),
+ LPGENW("all chats"),
+ LPGENW("in/out ratio of chats"),
};
if (row == 1)
diff --git a/plugins/HistoryStats/src/column_splittimeline.h b/plugins/HistoryStats/src/column_splittimeline.h index ad2d41548b..4b28d74646 100644 --- a/plugins/HistoryStats/src/column_splittimeline.h +++ b/plugins/HistoryStats/src/column_splittimeline.h @@ -76,9 +76,9 @@ public: explicit ColSplitTimeline();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColSplitTimeline; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("\"Split\" timeline"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding a graphical overview of your chatting behavior (out, in, total, in/out ratio) from the first to the last day of your history. The information is spread along x- and y-axis and the values are encoded as color values. Different chatting behavior measures are available."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColSplitTimeline; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("\"Split\" timeline"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding a graphical overview of your chatting behavior (out, in, total, in/out ratio) from the first to the last day of your history. The information is spread along x- and y-axis and the values are encoded as color values. Different chatting behavior measures are available."); }
virtual void impl_copyConfig(const Column* pSource);
virtual int impl_getFeatures() const { return cfHasConfig | cfAcquiresData; }
virtual void impl_configRead(const SettingsTree& settings);
diff --git a/plugins/HistoryStats/src/column_timeline.cpp b/plugins/HistoryStats/src/column_timeline.cpp index b6a5dc55c5..67e579ca0e 100644 --- a/plugins/HistoryStats/src/column_timeline.cpp +++ b/plugins/HistoryStats/src/column_timeline.cpp @@ -47,19 +47,19 @@ void ColTimeline::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup) m_hDetail = Opt.insertCheck(hGroup, TranslateT("Details for every bar (tooltip)"));
m_hDays = Opt.insertEdit (hGroup, TranslateT("Number of days to group"), L"", OptionsCtrl::OCF_NUMBER);
- static const TCHAR* sourceTexts[] = {
- LPGENT("Characters (incoming)"),
- LPGENT("Characters (outgoing)"),
- LPGENT("Characters (all)"),
- LPGENT("Characters (in/out ratio)"),
- LPGENT("Messages (incoming)"),
- LPGENT("Messages (outgoing)"),
- LPGENT("Messages (all)"),
- LPGENT("Messages (in/out ratio)"),
- LPGENT("Chats (incoming)"),
- LPGENT("Chats (outgoing)"),
- LPGENT("Chats (all)"),
- LPGENT("Chats (in/out ratio)"),
+ static const wchar_t* sourceTexts[] = {
+ LPGENW("Characters (incoming)"),
+ LPGENW("Characters (outgoing)"),
+ LPGENW("Characters (all)"),
+ LPGENW("Characters (in/out ratio)"),
+ LPGENW("Messages (incoming)"),
+ LPGENW("Messages (outgoing)"),
+ LPGENW("Messages (all)"),
+ LPGENW("Messages (in/out ratio)"),
+ LPGENW("Chats (incoming)"),
+ LPGENW("Chats (outgoing)"),
+ LPGENW("Chats (all)"),
+ LPGENW("Chats (in/out ratio)"),
};
array_each_(i, sourceTexts)
@@ -190,19 +190,19 @@ Column::StyleList ColTimeline::impl_outputGetAdditionalStyles(IDProvider& idp) void ColTimeline::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szSourceDesc[] = {
- LPGENT("incoming characters"),
- LPGENT("outgoing characters"),
- LPGENT("all characters"),
- LPGENT("in/out ratio of characters"),
- LPGENT("incoming messages"),
- LPGENT("outgoing messages"),
- LPGENT("all messages"),
- LPGENT("in/out ratio of messages"),
- LPGENT("incoming chats"),
- LPGENT("outgoing chats"),
- LPGENT("all chats"),
- LPGENT("in/out ratio of chats"),
+ static const wchar_t* szSourceDesc[] = {
+ LPGENW("incoming characters"),
+ LPGENW("outgoing characters"),
+ LPGENW("all characters"),
+ LPGENW("in/out ratio of characters"),
+ LPGENW("incoming messages"),
+ LPGENW("outgoing messages"),
+ LPGENW("all messages"),
+ LPGENW("in/out ratio of messages"),
+ LPGENW("incoming chats"),
+ LPGENW("outgoing chats"),
+ LPGENW("all chats"),
+ LPGENW("in/out ratio of chats"),
};
if (row == 1)
diff --git a/plugins/HistoryStats/src/column_timeline.h b/plugins/HistoryStats/src/column_timeline.h index 3e8125fd68..fb0b9c5b85 100644 --- a/plugins/HistoryStats/src/column_timeline.h +++ b/plugins/HistoryStats/src/column_timeline.h @@ -52,9 +52,9 @@ public: explicit ColTimeline();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColTimeline; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Timeline"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding a graphical overview of your chatting behavior (out, in, total, in/out ratio) from the first to the last day of your history on a daily basis. Multiple days can be grouped. Different chatting behavior measures are available."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColTimeline; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Timeline"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding a graphical overview of your chatting behavior (out, in, total, in/out ratio) from the first to the last day of your history on a daily basis. Multiple days can be grouped. Different chatting behavior measures are available."); }
virtual void impl_copyConfig(const Column* pSource);
virtual int impl_getFeatures() const { return cfHasConfig | cfAcquiresData; }
virtual void impl_configRead(const SettingsTree& settings);
diff --git a/plugins/HistoryStats/src/column_wordcount.cpp b/plugins/HistoryStats/src/column_wordcount.cpp index a00d9c510d..a83f27e652 100644 --- a/plugins/HistoryStats/src/column_wordcount.cpp +++ b/plugins/HistoryStats/src/column_wordcount.cpp @@ -110,16 +110,16 @@ void ColWordCount::impl_contactDataTransformCleanup(Contact& contact) const void ColWordCount::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szTypeDesc[] = {
- LPGENT("Total word count"),
- LPGENT("Distinct word count"),
- LPGENT("Ratio total/distinct words")
+ static const wchar_t* szTypeDesc[] = {
+ LPGENW("Total word count"),
+ LPGENW("Distinct word count"),
+ LPGENW("Ratio total/distinct words")
};
- static const TCHAR* szSourceDesc[] = {
- LPGENT("incoming messages"),
- LPGENT("outgoing messages"),
- LPGENT("all messages"),
+ static const wchar_t* szSourceDesc[] = {
+ LPGENW("incoming messages"),
+ LPGENW("outgoing messages"),
+ LPGENW("all messages"),
};
if (row == 1)
diff --git a/plugins/HistoryStats/src/column_wordcount.h b/plugins/HistoryStats/src/column_wordcount.h index 6277bc6cbb..e29b6836aa 100644 --- a/plugins/HistoryStats/src/column_wordcount.h +++ b/plugins/HistoryStats/src/column_wordcount.h @@ -21,9 +21,9 @@ public: explicit ColWordCount();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColWordCount; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Word count"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding the number of (distinct) words used by you, by your contact, or by both of you."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColWordCount; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Word count"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding the number of (distinct) words used by you, by your contact, or by both of you."); }
virtual void impl_copyConfig(const Column* pSource);
virtual void impl_configRead(const SettingsTree& settings);
virtual void impl_configWrite(SettingsTree& settings) const;
diff --git a/plugins/HistoryStats/src/column_words.cpp b/plugins/HistoryStats/src/column_words.cpp index 6de8d42440..7d79cb467f 100644 --- a/plugins/HistoryStats/src/column_words.cpp +++ b/plugins/HistoryStats/src/column_words.cpp @@ -216,16 +216,16 @@ Column::StyleList ColWords::impl_outputGetAdditionalStyles(IDProvider&) void ColWords::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szTypeDesc[] = {
- LPGENT("Most common words"),
- LPGENT("Least common words"),
- LPGENT("Longest words"),
+ static const wchar_t* szTypeDesc[] = {
+ LPGENW("Most common words"),
+ LPGENW("Least common words"),
+ LPGENW("Longest words"),
};
- static const TCHAR* szSourceDesc[] = {
- LPGENT("incoming messages"),
- LPGENT("outgoing messages"),
- LPGENT("all messages"),
+ static const wchar_t* szSourceDesc[] = {
+ LPGENW("incoming messages"),
+ LPGENW("outgoing messages"),
+ LPGENW("all messages"),
};
if (row == 1)
diff --git a/plugins/HistoryStats/src/column_words.h b/plugins/HistoryStats/src/column_words.h index 0ec4c4fbc4..d215fd4753 100644 --- a/plugins/HistoryStats/src/column_words.h +++ b/plugins/HistoryStats/src/column_words.h @@ -64,9 +64,9 @@ public: explicit ColWords();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColWords; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Words"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding a list of a specified number of most/least common words or longest words used by you, by your contact, or by both of you."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColWords; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Words"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding a list of a specified number of most/least common words or longest words used by you, by your contact, or by both of you."); }
virtual void impl_copyConfig(const Column* pSource);
virtual void impl_configRead(const SettingsTree& settings);
virtual void impl_configWrite(SettingsTree& settings) const;
diff --git a/plugins/HistoryStats/src/dlgfilterwords.cpp b/plugins/HistoryStats/src/dlgfilterwords.cpp index 48d1dfb4da..9344e55f19 100644 --- a/plugins/HistoryStats/src/dlgfilterwords.cpp +++ b/plugins/HistoryStats/src/dlgfilterwords.cpp @@ -78,11 +78,11 @@ void DlgFilterWords::onWMInitDialog() static const struct
{
WORD iconId;
- TCHAR* szTooltip;
+ wchar_t* szTooltip;
bool bDisabled;
} columnBand[] = {
- { IDI_COL_ADD, LPGENT("Add set"), false },
- { IDI_COL_DEL, LPGENT("Delete set"), true },
+ { IDI_COL_ADD, LPGENW("Add set"), false },
+ { IDI_COL_DEL, LPGENW("Delete set"), true },
};
array_each_(i, columnBand)
@@ -109,15 +109,15 @@ void DlgFilterWords::onWMInitDialog() }
// init other controls
- static const TCHAR* szWordFilterModes[] = {
- LPGENT("Filter words matching"),
- LPGENT("Filter words containing"),
- LPGENT("Filter words starting with"),
- LPGENT("Filter words ending with"),
- LPGENT("Filter messages matching"),
- LPGENT("Filter messages containing"),
- LPGENT("Filter messages starting with"),
- LPGENT("Filter messages ending with"),
+ static const wchar_t* szWordFilterModes[] = {
+ LPGENW("Filter words matching"),
+ LPGENW("Filter words containing"),
+ LPGENW("Filter words starting with"),
+ LPGENW("Filter words ending with"),
+ LPGENW("Filter messages matching"),
+ LPGENW("Filter messages containing"),
+ LPGENW("Filter messages starting with"),
+ LPGENW("Filter messages ending with"),
};
array_each_(i, szWordFilterModes)
@@ -209,7 +209,7 @@ void DlgFilterWords::onSetSelChanging(HANDLE hItem, INT_PTR dwData) // set name
HWND hText = GetDlgItem(m_hWnd, IDC_SETNAME);
int nLen = GetWindowTextLength(hText);
- TCHAR* szText = new TCHAR[nLen + 1];
+ wchar_t* szText = new wchar_t[nLen + 1];
if (GetWindowText(hText, szText, nLen + 1)) {
pFilter->setName(szText);
@@ -221,7 +221,7 @@ void DlgFilterWords::onSetSelChanging(HANDLE hItem, INT_PTR dwData) // words
hText = GetDlgItem(m_hWnd, IDC_WORDS);
nLen = GetWindowTextLength(hText);
- szText = new TCHAR[nLen + 1];
+ szText = new wchar_t[nLen + 1];
if (GetWindowText(hText, szText, nLen + 1)) {
ext::string strText = szText;
diff --git a/plugins/HistoryStats/src/dlgoption.cpp b/plugins/HistoryStats/src/dlgoption.cpp index 03125b1857..61a67c04f2 100644 --- a/plugins/HistoryStats/src/dlgoption.cpp +++ b/plugins/HistoryStats/src/dlgoption.cpp @@ -90,21 +90,21 @@ void DlgOption::onWMInitDialog() static const struct
{
WORD iconId;
- TCHAR* szText;
- TCHAR* szTooltip;
+ wchar_t* szText;
+ wchar_t* szTooltip;
bool bRight;
WORD dlgId;
bool bVisible;
bool bDropDown;
}
pageBand[] = {
- { IDI_SETT_GLOBAL, LPGENT("Global"), LPGENT("Global settings"), false, IDD_SUB_GLOBAL, true, false },
- { IDI_SETT_EXCLUDE, LPGENT("Exclude"), LPGENT("Exclude contacts"), false, IDD_SUB_EXCLUDE, true, false },
- { IDI_SETT_INPUT, LPGENT("Input"), LPGENT("Input settings"), false, IDD_SUB_INPUT, true, false },
- { IDI_SETT_COLUMNS, LPGENT("Columns"), LPGENT("Column settings"), false, IDD_SUB_COLUMNS, true, false },
- { IDI_SETT_OUTPUT, LPGENT("Output"), LPGENT("Output settings"), false, IDD_SUB_OUTPUT, true, false },
- { IDI_CREATE, LPGENT("Create"), LPGENT("Create statistics"), true, 0, true, true },
- { IDI_CREATE_WARNING, LPGENT("Create"), LPGENT("Create statistics (there are warnings)"), true, 0, false, true },
+ { IDI_SETT_GLOBAL, LPGENW("Global"), LPGENW("Global settings"), false, IDD_SUB_GLOBAL, true, false },
+ { IDI_SETT_EXCLUDE, LPGENW("Exclude"), LPGENW("Exclude contacts"), false, IDD_SUB_EXCLUDE, true, false },
+ { IDI_SETT_INPUT, LPGENW("Input"), LPGENW("Input settings"), false, IDD_SUB_INPUT, true, false },
+ { IDI_SETT_COLUMNS, LPGENW("Columns"), LPGENW("Column settings"), false, IDD_SUB_COLUMNS, true, false },
+ { IDI_SETT_OUTPUT, LPGENW("Output"), LPGENW("Output settings"), false, IDD_SUB_OUTPUT, true, false },
+ { IDI_CREATE, LPGENW("Create"), LPGENW("Create statistics"), true, 0, true, true },
+ { IDI_CREATE_WARNING, LPGENW("Create"), LPGENW("Create statistics (there are warnings)"), true, 0, false, true },
};
array_each_(i, pageBand)
diff --git a/plugins/HistoryStats/src/dlgoption.h b/plugins/HistoryStats/src/dlgoption.h index 03b882eb24..2621b48ea0 100644 --- a/plugins/HistoryStats/src/dlgoption.h +++ b/plugins/HistoryStats/src/dlgoption.h @@ -75,11 +75,11 @@ private: {
private:
struct SupportInfo {
- TCHAR* szPlugin;
- TCHAR* szTeaser;
- TCHAR* szDescription;
- TCHAR* szLinkTexts;
- TCHAR* szLinkURLs;
+ wchar_t* szPlugin;
+ wchar_t* szTeaser;
+ wchar_t* szDescription;
+ wchar_t* szLinkTexts;
+ wchar_t* szLinkURLs;
};
private:
diff --git a/plugins/HistoryStats/src/dlgoption_subcolumns.cpp b/plugins/HistoryStats/src/dlgoption_subcolumns.cpp index cf385fe4ad..f6c635bfa0 100644 --- a/plugins/HistoryStats/src/dlgoption_subcolumns.cpp +++ b/plugins/HistoryStats/src/dlgoption_subcolumns.cpp @@ -163,16 +163,16 @@ void DlgOption::SubColumns::onWMInitDialog() static const struct
{
WORD iconId;
- TCHAR* szTooltip;
+ wchar_t* szTooltip;
bool bRight;
bool bDropDown;
bool bDisabled;
}
columnBand[] = {
- { IDI_COL_ADD, LPGENT("Add column..."), false, true, false },
- { IDI_COL_DEL, LPGENT("Delete column"), false, false, true },
- { IDI_COL_DOWN, LPGENT("Move down"), true, false, true },
- { IDI_COL_UP, LPGENT("Move up"), true, false, true },
+ { IDI_COL_ADD, LPGENW("Add column..."), false, true, false },
+ { IDI_COL_DEL, LPGENW("Delete column"), false, false, true },
+ { IDI_COL_DOWN, LPGENW("Move down"), true, false, true },
+ { IDI_COL_UP, LPGENW("Move up"), true, false, true },
};
array_each_(i, columnBand)
@@ -311,7 +311,7 @@ void DlgOption::SubColumns::rearrangeControls() void DlgOption::SubColumns::toggleInfo()
{
HWND hInfo = GetDlgItem(getHWnd(), IDC_INFO);
- const TCHAR* szInfoLabelText = m_bShowInfo ? LPGENT("Hide additional column info...") : LPGENT("Show additional column info...");
+ const wchar_t* szInfoLabelText = m_bShowInfo ? LPGENW("Hide additional column info...") : LPGENW("Show additional column info...");
SetDlgItemText(getHWnd(), IDC_INFOLABEL, TranslateTS(szInfoLabelText));
ShowWindow(hInfo, m_bShowInfo ? SW_SHOW : SW_HIDE);
@@ -407,7 +407,7 @@ void DlgOption::SubColumns::onColSelChanged(HANDLE hItem, INT_PTR) tvi.item.state = TVIS_EXPANDED;
tvi.item.stateMask = TVIS_EXPANDED;
- tvi.item.pszText = const_cast<TCHAR*>(TranslateT("For this config the selected column..."));
+ tvi.item.pszText = const_cast<wchar_t*>(TranslateT("For this config the selected column..."));
tvi.hParent = TreeView_InsertItem(hInfo, &tvi);
// show capabilities of column
@@ -425,7 +425,7 @@ void DlgOption::SubColumns::onColSelChanged(HANDLE hItem, INT_PTR) msg += ((restrictions & Column::crPNGMask) == Column::crPNGPartial) ? TranslateT("PNG (partial)") : L"PNG";
}
- tvi.item.pszText = const_cast<TCHAR*>(msg.c_str());
+ tvi.item.pszText = const_cast<wchar_t*>(msg.c_str());
TreeView_InsertItem(hInfo, &tvi);
// show effect of current config
@@ -464,7 +464,7 @@ void DlgOption::SubColumns::onColSelChanged(HANDLE hItem, INT_PTR) msg += ((restrictions & Column::crHTMLMask) == Column::crHTMLFull) ? L"HTML" : L"PNG";
}
- tvi.item.pszText = const_cast<TCHAR*>(msg.c_str());
+ tvi.item.pszText = const_cast<wchar_t*>(msg.c_str());
TreeView_InsertItem(hInfo, &tvi);
SendMessage(hInfo, WM_SETREDRAW, TRUE, 0);
diff --git a/plugins/HistoryStats/src/dlgoption_subglobal.cpp b/plugins/HistoryStats/src/dlgoption_subglobal.cpp index d04db4d390..ec6c21ae94 100644 --- a/plugins/HistoryStats/src/dlgoption_subglobal.cpp +++ b/plugins/HistoryStats/src/dlgoption_subglobal.cpp @@ -94,10 +94,10 @@ INT_PTR CALLBACK DlgOption::SubGlobal::staticInfoProc(HWND hDlg, UINT msg, WPARA if (HIWORD(wParam) == STN_CLICKED) {
HWND hLink = reinterpret_cast<HWND>(lParam);
int nLen = GetWindowTextLength(hLink);
- TCHAR* szTitle = new TCHAR[nLen + 1];
+ wchar_t* szTitle = new wchar_t[nLen + 1];
if (GetWindowText(hLink, szTitle, nLen + 1)) {
- TCHAR* szEndOfURL = (TCHAR*)ext::strfunc::str(szTitle, L" [");
+ wchar_t* szEndOfURL = (wchar_t*)ext::strfunc::str(szTitle, L" [");
if (szEndOfURL) {
*szEndOfURL = '\0';
g_pSettings->openURL(szTitle);
@@ -112,7 +112,7 @@ INT_PTR CALLBACK DlgOption::SubGlobal::staticInfoProc(HWND hDlg, UINT msg, WPARA case WM_CTLCOLORSTATIC:
HWND hStatic = reinterpret_cast<HWND>(lParam);
- TCHAR szClassName[64];
+ wchar_t szClassName[64];
if (GetClassName(hStatic, szClassName, _countof(szClassName)) && ext::strfunc::cmp(szClassName, WC_EDIT) == 0) {
HDC hDC = reinterpret_cast<HDC>(wParam);
@@ -313,9 +313,9 @@ void DlgOption::SubGlobal::initSupportInfo() static const SupportInfo Infos[] = {
{
TranslateT("At this time there is no external plugin supported."),
- LPGENT(""),
- LPGENT(""),
- LPGENT(""),
+ LPGENW(""),
+ LPGENW(""),
+ LPGENW(""),
L""
},
};
@@ -335,14 +335,14 @@ void DlgOption::SubGlobal::initSupportInfo() tvi.item.state = TVIS_EXPANDED | TVIS_BOLD;
tvi.item.stateMask = TVIS_EXPANDED | TVIS_BOLD;
- tvi.item.pszText = const_cast<TCHAR*>(TranslateT("Supported plugins (double-click to learn more):"));
+ tvi.item.pszText = const_cast<wchar_t*>(TranslateT("Supported plugins (double-click to learn more):"));
tvi.hParent = TreeView_InsertItem(hInfo, &tvi);
tvi.item.stateMask &= ~TVIS_BOLD;
array_each_(i, Infos)
{
- tvi.item.pszText = const_cast<TCHAR*>(Infos[i].szPlugin);
+ tvi.item.pszText = const_cast<wchar_t*>(Infos[i].szPlugin);
tvi.item.lParam = reinterpret_cast<LPARAM>(&Infos[i]);
TreeView_InsertItem(hInfo, &tvi);
}
@@ -385,7 +385,7 @@ void DlgOption::SubGlobal::rearrangeControls() void DlgOption::SubGlobal::toggleInfo()
{
HWND hInfo = GetDlgItem(getHWnd(), IDC_INFO);
- const TCHAR* szInfoLabelText = m_bShowInfo ? LPGENT("HistoryStats supports several plugins. Click to hide info...") : LPGENT("HistoryStats supports several plugins. Click to learn more...");
+ const wchar_t* szInfoLabelText = m_bShowInfo ? LPGENW("HistoryStats supports several plugins. Click to hide info...") : LPGENW("HistoryStats supports several plugins. Click to learn more...");
SetDlgItemText(getHWnd(), IDC_INFOLABEL, TranslateTS(szInfoLabelText));
ShowWindow(hInfo, m_bShowInfo ? SW_SHOW : SW_HIDE);
diff --git a/plugins/HistoryStats/src/dlgoption_suboutput.cpp b/plugins/HistoryStats/src/dlgoption_suboutput.cpp index 866c865dd6..67c58f9910 100644 --- a/plugins/HistoryStats/src/dlgoption_suboutput.cpp +++ b/plugins/HistoryStats/src/dlgoption_suboutput.cpp @@ -137,44 +137,44 @@ void DlgOption::SubOutput::onWMInitDialog() m_hAutoOpenMenu = m_Options.insertCheck(hTemp2, TranslateT("...via Miranda NG main menu"));
// our sort levels
- static const TCHAR* sortLevels[Settings::cNumSortLevels] = {
- LPGENT("First sort by"),
- LPGENT("Then sort by"),
- LPGENT("Finally sort by")
+ static const wchar_t* sortLevels[Settings::cNumSortLevels] = {
+ LPGENW("First sort by"),
+ LPGENW("Then sort by"),
+ LPGENW("Finally sort by")
};
// our sort keys
static const struct {
int key;
- TCHAR* desc;
+ wchar_t* desc;
} sortKeys[] = {
- { Settings::skNick , LPGENT("Nick") },
- { Settings::skProtocol , LPGENT("Protocol") },
- { Settings::skGroup , LPGENT("Group") },
- { Settings::skBytesIn , LPGENT("Characters (incoming, absolute)") },
- { Settings::skBytesOut , LPGENT("Characters (outgoing, absolute)") },
- { Settings::skBytesTotal , LPGENT("Characters (all, absolute)") },
- { Settings::skBytesInAvg , LPGENT("Characters (incoming, average)") },
- { Settings::skBytesOutAvg , LPGENT("Characters (outgoing, average)") },
- { Settings::skBytesTotalAvg , LPGENT("Characters (all, average)") },
- { Settings::skMessagesIn , LPGENT("Messages (incoming, absolute)") },
- { Settings::skMessagesOut , LPGENT("Messages (outgoing, absolute)") },
- { Settings::skMessagesTotal , LPGENT("Messages (all, absolute)") },
- { Settings::skMessagesInAvg , LPGENT("Messages (incoming, average)") },
- { Settings::skMessagesOutAvg , LPGENT("Messages (outgoing, average)") },
- { Settings::skMessagesTotalAvg , LPGENT("Messages (all, average)") },
- { Settings::skChatsIn , LPGENT("Chats (incoming, absolute)") },
- { Settings::skChatsOut , LPGENT("Chats (outgoing, absolute)") },
- { Settings::skChatsTotal , LPGENT("Chats (all, absolute)") },
- { Settings::skChatsInAvg , LPGENT("Chats (incoming, average)") },
- { Settings::skChatsOutAvg , LPGENT("Chats (outgoing, average)") },
- { Settings::skChatsTotalAvg , LPGENT("Chats (all, average)") },
- { Settings::skChatDurationTotal , LPGENT("Chat duration (total)") },
- { Settings::skChatDurationMin , LPGENT("Chat duration (minimum)") },
- { Settings::skChatDurationAvg , LPGENT("Chat duration (average)") },
- { Settings::skChatDurationMax , LPGENT("Chat duration (maximum)") },
- { Settings::skTimeOfFirstMessage, LPGENT("Time of first message to/from contact") },
- { Settings::skTimeOfLastMessage , LPGENT("Time of last message to/from contact") },
+ { Settings::skNick , LPGENW("Nick") },
+ { Settings::skProtocol , LPGENW("Protocol") },
+ { Settings::skGroup , LPGENW("Group") },
+ { Settings::skBytesIn , LPGENW("Characters (incoming, absolute)") },
+ { Settings::skBytesOut , LPGENW("Characters (outgoing, absolute)") },
+ { Settings::skBytesTotal , LPGENW("Characters (all, absolute)") },
+ { Settings::skBytesInAvg , LPGENW("Characters (incoming, average)") },
+ { Settings::skBytesOutAvg , LPGENW("Characters (outgoing, average)") },
+ { Settings::skBytesTotalAvg , LPGENW("Characters (all, average)") },
+ { Settings::skMessagesIn , LPGENW("Messages (incoming, absolute)") },
+ { Settings::skMessagesOut , LPGENW("Messages (outgoing, absolute)") },
+ { Settings::skMessagesTotal , LPGENW("Messages (all, absolute)") },
+ { Settings::skMessagesInAvg , LPGENW("Messages (incoming, average)") },
+ { Settings::skMessagesOutAvg , LPGENW("Messages (outgoing, average)") },
+ { Settings::skMessagesTotalAvg , LPGENW("Messages (all, average)") },
+ { Settings::skChatsIn , LPGENW("Chats (incoming, absolute)") },
+ { Settings::skChatsOut , LPGENW("Chats (outgoing, absolute)") },
+ { Settings::skChatsTotal , LPGENW("Chats (all, absolute)") },
+ { Settings::skChatsInAvg , LPGENW("Chats (incoming, average)") },
+ { Settings::skChatsOutAvg , LPGENW("Chats (outgoing, average)") },
+ { Settings::skChatsTotalAvg , LPGENW("Chats (all, average)") },
+ { Settings::skChatDurationTotal , LPGENW("Chat duration (total)") },
+ { Settings::skChatDurationMin , LPGENW("Chat duration (minimum)") },
+ { Settings::skChatDurationAvg , LPGENW("Chat duration (average)") },
+ { Settings::skChatDurationMax , LPGENW("Chat duration (maximum)") },
+ { Settings::skTimeOfFirstMessage, LPGENW("Time of first message to/from contact") },
+ { Settings::skTimeOfLastMessage , LPGENW("Time of last message to/from contact") },
};
m_SortKeyToIndex.resize(Settings::skLAST - Settings::skFIRST + 1);
@@ -205,26 +205,26 @@ void DlgOption::SubOutput::onWMInitDialog() }
// our "omit by value" data
- static const TCHAR* omitData[] = {
- LPGENT("Characters (incoming, absolute)"),
- LPGENT("Characters (outgoing, absolute)"),
- LPGENT("Characters (all, absolute)"),
- LPGENT("Characters (incoming, average per week)"),
- LPGENT("Characters (outgoing, average per week)"),
- LPGENT("Characters (all, average per week)"),
- LPGENT("Messages (incoming, absolute)"),
- LPGENT("Messages (outgoing, absolute)"),
- LPGENT("Messages (all, absolute)"),
- LPGENT("Messages (incoming, average per week)"),
- LPGENT("Messages (outgoing, average per week)"),
- LPGENT("Messages (all, average per week)"),
- LPGENT("Chats (incoming, absolute)"),
- LPGENT("Chats (outgoing, absolute)"),
- LPGENT("Chats (all, absolute)"),
- LPGENT("Chats (incoming, average per week)"),
- LPGENT("Chats (outgoing, average per week)"),
- LPGENT("Chats (all, average per week)"),
- LPGENT("Chat duration (total, hours)"),
+ static const wchar_t* omitData[] = {
+ LPGENW("Characters (incoming, absolute)"),
+ LPGENW("Characters (outgoing, absolute)"),
+ LPGENW("Characters (all, absolute)"),
+ LPGENW("Characters (incoming, average per week)"),
+ LPGENW("Characters (outgoing, average per week)"),
+ LPGENW("Characters (all, average per week)"),
+ LPGENW("Messages (incoming, absolute)"),
+ LPGENW("Messages (outgoing, absolute)"),
+ LPGENW("Messages (all, absolute)"),
+ LPGENW("Messages (incoming, average per week)"),
+ LPGENW("Messages (outgoing, average per week)"),
+ LPGENW("Messages (all, average per week)"),
+ LPGENW("Chats (incoming, absolute)"),
+ LPGENW("Chats (outgoing, absolute)"),
+ LPGENW("Chats (all, absolute)"),
+ LPGENW("Chats (incoming, average per week)"),
+ LPGENW("Chats (outgoing, average per week)"),
+ LPGENW("Chats (all, average per week)"),
+ LPGENW("Chat duration (total, hours)"),
};
array_each_(i, omitData)
diff --git a/plugins/HistoryStats/src/iconlib.cpp b/plugins/HistoryStats/src/iconlib.cpp index 3f105824fa..7993c26a3b 100644 --- a/plugins/HistoryStats/src/iconlib.cpp +++ b/plugins/HistoryStats/src/iconlib.cpp @@ -8,30 +8,30 @@ bool IconLib::m_bIcoLibAvailable = false; HANDLE IconLib::m_hHookSkin2IconsChanged = NULL;
IconLib::IconInfo IconLib::m_IconInfo[] = {
- { IDI_HISTORYSTATS , "main_menu" , NULL, LPGENT("Create statistics (main menu)") },
- { IDI_HISTORYSTATS , "menu_show" , NULL, LPGENT("Show statistics (main menu)") },
- { IDI_HISTORYSTATS , "menu_config" , NULL, LPGENT("Configure... (main menu)") },
- { IDI_HISTORYSTATS , "contact_menu" , NULL, LPGENT("Contact menu") },
- { IDI_EXCLUDE_NO , "exclude_no" , NULL, LPGENT("Unexcluded contacts") },
- { IDI_EXCLUDE_YES , "exclude_yes" , NULL, LPGENT("Excluded contacts") },
- { IDI_TREE_CHECK1 , "tree_check1" , LPGENT("Options tree"), LPGENT("Checkbox") },
- { IDI_TREE_CHECK2 , "tree_check2" , LPGENT("Options tree"), LPGENT("Checkbox (checked)") },
- { IDI_TREE_CHECK3 , "tree_check3" , LPGENT("Options tree"), LPGENT("Checkbox (disabled)") },
- { IDI_TREE_CHECK4 , "tree_check4" , LPGENT("Options tree"), LPGENT("Checkbox (checked & disabled)") },
- { IDI_TREE_RADIO1 , "tree_radio1" , LPGENT("Options tree"), LPGENT("Radio button") },
- { IDI_TREE_RADIO2 , "tree_radio2" , LPGENT("Options tree"), LPGENT("Radio button (checked)") },
- { IDI_TREE_RADIO3 , "tree_radio3" , LPGENT("Options tree"), LPGENT("Radio button (disabled)") },
- { IDI_TREE_RADIO4 , "tree_radio4" , LPGENT("Options tree"), LPGENT("Radio button (checked & disabled)") },
- { IDI_TREE_EDIT1 , "tree_edit1" , LPGENT("Options tree"), LPGENT("Edit control") },
- { IDI_TREE_EDIT2 , "tree_edit2" , LPGENT("Options tree"), LPGENT("Edit control (disabled)") },
- { IDI_TREE_COMBO1 , "tree_combo1" , LPGENT("Options tree"), LPGENT("Combo box") },
- { IDI_TREE_COMBO2 , "tree_combo2" , LPGENT("Options tree"), LPGENT("Combo box (disabled)") },
- { IDI_TREE_FOLDER1 , "tree_folder1" , LPGENT("Options tree"), LPGENT("Folder") },
- { IDI_TREE_FOLDER2 , "tree_folder2" , LPGENT("Options tree"), LPGENT("Folder (disabled)") },
- { IDI_TREE_BUTTON1 , "tree_button1" , LPGENT("Options tree"), LPGENT("Button") },
- { IDI_TREE_BUTTON2 , "tree_button2" , LPGENT("Options tree"), LPGENT("Button (disabled)") },
- { IDI_TREE_DATETIME1, "tree_datetime1", LPGENT("Options tree"), LPGENT("Date/time picker") },
- { IDI_TREE_DATETIME2, "tree_datetime2", LPGENT("Options tree"), LPGENT("Date/time picker (disabled)") },
+ { IDI_HISTORYSTATS , "main_menu" , NULL, LPGENW("Create statistics (main menu)") },
+ { IDI_HISTORYSTATS , "menu_show" , NULL, LPGENW("Show statistics (main menu)") },
+ { IDI_HISTORYSTATS , "menu_config" , NULL, LPGENW("Configure... (main menu)") },
+ { IDI_HISTORYSTATS , "contact_menu" , NULL, LPGENW("Contact menu") },
+ { IDI_EXCLUDE_NO , "exclude_no" , NULL, LPGENW("Unexcluded contacts") },
+ { IDI_EXCLUDE_YES , "exclude_yes" , NULL, LPGENW("Excluded contacts") },
+ { IDI_TREE_CHECK1 , "tree_check1" , LPGENW("Options tree"), LPGENW("Checkbox") },
+ { IDI_TREE_CHECK2 , "tree_check2" , LPGENW("Options tree"), LPGENW("Checkbox (checked)") },
+ { IDI_TREE_CHECK3 , "tree_check3" , LPGENW("Options tree"), LPGENW("Checkbox (disabled)") },
+ { IDI_TREE_CHECK4 , "tree_check4" , LPGENW("Options tree"), LPGENW("Checkbox (checked & disabled)") },
+ { IDI_TREE_RADIO1 , "tree_radio1" , LPGENW("Options tree"), LPGENW("Radio button") },
+ { IDI_TREE_RADIO2 , "tree_radio2" , LPGENW("Options tree"), LPGENW("Radio button (checked)") },
+ { IDI_TREE_RADIO3 , "tree_radio3" , LPGENW("Options tree"), LPGENW("Radio button (disabled)") },
+ { IDI_TREE_RADIO4 , "tree_radio4" , LPGENW("Options tree"), LPGENW("Radio button (checked & disabled)") },
+ { IDI_TREE_EDIT1 , "tree_edit1" , LPGENW("Options tree"), LPGENW("Edit control") },
+ { IDI_TREE_EDIT2 , "tree_edit2" , LPGENW("Options tree"), LPGENW("Edit control (disabled)") },
+ { IDI_TREE_COMBO1 , "tree_combo1" , LPGENW("Options tree"), LPGENW("Combo box") },
+ { IDI_TREE_COMBO2 , "tree_combo2" , LPGENW("Options tree"), LPGENW("Combo box (disabled)") },
+ { IDI_TREE_FOLDER1 , "tree_folder1" , LPGENW("Options tree"), LPGENW("Folder") },
+ { IDI_TREE_FOLDER2 , "tree_folder2" , LPGENW("Options tree"), LPGENW("Folder (disabled)") },
+ { IDI_TREE_BUTTON1 , "tree_button1" , LPGENW("Options tree"), LPGENW("Button") },
+ { IDI_TREE_BUTTON2 , "tree_button2" , LPGENW("Options tree"), LPGENW("Button (disabled)") },
+ { IDI_TREE_DATETIME1, "tree_datetime1", LPGENW("Options tree"), LPGENW("Date/time picker") },
+ { IDI_TREE_DATETIME2, "tree_datetime2", LPGENW("Options tree"), LPGENW("Date/time picker (disabled)") },
};
ext::string IconLib::m_Section;
diff --git a/plugins/HistoryStats/src/iconlib.h b/plugins/HistoryStats/src/iconlib.h index 6586d1284e..5ac891850c 100644 --- a/plugins/HistoryStats/src/iconlib.h +++ b/plugins/HistoryStats/src/iconlib.h @@ -44,8 +44,8 @@ private: {
WORD wID;
char* szIconName;
- TCHAR* szSection;
- TCHAR* szDescription;
+ wchar_t* szSection;
+ wchar_t* szDescription;
HICON hIcon;
};
diff --git a/plugins/HistoryStats/src/main.cpp b/plugins/HistoryStats/src/main.cpp index f44efb8a85..4f3db4a67f 100644 --- a/plugins/HistoryStats/src/main.cpp +++ b/plugins/HistoryStats/src/main.cpp @@ -156,18 +156,18 @@ void AddMainMenu() CreateServiceFunction(con::SvcShowStatistics, MenuShowStatistics);
CreateServiceFunction(con::SvcConfigure, MenuConfigure);
- HGENMENU hRoot = bInPopup ? Menu_CreateRoot(MO_MAIN, LPGENT("Statistics"), 1910000000) : NULL;
+ HGENMENU hRoot = bInPopup ? Menu_CreateRoot(MO_MAIN, LPGENW("Statistics"), 1910000000) : NULL;
Menu_ConfigureItem(hRoot, MCI_OPT_UID, "7F116B24-9D84-4D04-B6AA-EED95051A184");
g_hMenuCreateStatistics = mu::clist::addMainMenuItem(
- LPGENT("Create statistics"), 0, 1910000000, IconLib::getIcon(IconLib::iiMenuCreateStatistics), con::SvcCreateStatistics, hRoot);
+ LPGENW("Create statistics"), 0, 1910000000, IconLib::getIcon(IconLib::iiMenuCreateStatistics), con::SvcCreateStatistics, hRoot);
g_hMenuShowStatistics = mu::clist::addMainMenuItem(
- LPGENT("Show statistics"), // MEMO: implicit translation
+ LPGENW("Show statistics"), // MEMO: implicit translation
0, 1910000001, IconLib::getIcon(IconLib::iiMenuShowStatistics), con::SvcShowStatistics, hRoot);
g_hMenuConfigure = mu::clist::addMainMenuItem(
- bInPopup ? LPGENT("Configure...") : LPGENT("Configure statistics..."), // MEMO: implicit translation
+ bInPopup ? LPGENW("Configure...") : LPGENW("Configure statistics..."), // MEMO: implicit translation
0, 1910000002, IconLib::getIcon(IconLib::iiMenuConfigure), con::SvcConfigure, hRoot);
}
@@ -317,7 +317,7 @@ void AddContactMenu() CreateServiceFunction(con::SvcToggleExclude, MenuToggleExclude);
g_hMenuToggleExclude = mu::clist::addContactMenuItem(
- LPGENT("Exclude from statistics"), // MEMO: implicit translation
+ LPGENW("Exclude from statistics"), // MEMO: implicit translation
0,
800000,
IconLib::getIcon(IconLib::iiContactMenu),
@@ -328,14 +328,14 @@ void AddContactMenu() CreateServiceFunction(con::SvcHistoryPaste, MenuHistoryPaste);
g_hMenuHistoryCopy = mu::clist::addContactMenuItem(
- LPGENT("Copy history")), // MEMO: implicit translation
+ LPGENW("Copy history")), // MEMO: implicit translation
0,
800001,
NULL,
con::SvcHistoryCopy);
g_hMenuHistoryPaste = mu::clist::addContactMenuItem(
- LPGENT("Paste history...")), // MEMO: implicit translation
+ LPGENW("Paste history...")), // MEMO: implicit translation
0,
800002,
NULL,
diff --git a/plugins/HistoryStats/src/message.cpp b/plugins/HistoryStats/src/message.cpp index 66a928bc8a..a42974a8fe 100644 --- a/plugins/HistoryStats/src/message.cpp +++ b/plugins/HistoryStats/src/message.cpp @@ -22,7 +22,7 @@ void Message::makeRawAvailable() break;
}
- m_Raw.assign(reinterpret_cast<const TCHAR*>(m_RawSource), m_nLength);
+ m_Raw.assign(reinterpret_cast<const wchar_t*>(m_RawSource), m_nLength);
m_Available |= Raw;
}
while (false);
@@ -42,14 +42,14 @@ void Message::stripRawRTF() void Message::stripBBCodes()
{
- static const TCHAR* szSimpleBBCodes[][2] = {
+ static const wchar_t* szSimpleBBCodes[][2] = {
{ L"[b]", L"[/b]" },
{ L"[u]", L"[/u]" },
{ L"[i]", L"[/i]" },
{ L"[s]", L"[/s]" },
};
- static const TCHAR* szParamBBCodes[][2] = {
+ static const wchar_t* szParamBBCodes[][2] = {
{ L"[url=", L"[/url]" },
{ L"[color=", L"[/color]" },
};
@@ -60,8 +60,8 @@ void Message::stripBBCodes() // remove simple BBcodes
array_each_(i, szSimpleBBCodes)
{
- const TCHAR* szOpenTag = szSimpleBBCodes[i][0];
- const TCHAR* szCloseTag = szSimpleBBCodes[i][1];
+ const wchar_t* szOpenTag = szSimpleBBCodes[i][0];
+ const wchar_t* szCloseTag = szSimpleBBCodes[i][1];
int lenOpen = ext::strfunc::len(szOpenTag);
int lenClose = ext::strfunc::len(szCloseTag);
@@ -88,8 +88,8 @@ void Message::stripBBCodes() // remove BBcodes with parameters
array_each_(i, szParamBBCodes)
{
- const TCHAR* szOpenTag = szParamBBCodes[i][0];
- const TCHAR* szCloseTag = szParamBBCodes[i][1];
+ const wchar_t* szOpenTag = szParamBBCodes[i][0];
+ const wchar_t* szCloseTag = szParamBBCodes[i][1];
int lenOpen = ext::strfunc::len(szOpenTag);
int lenClose = ext::strfunc::len(szCloseTag);
@@ -120,11 +120,11 @@ void Message::stripBBCodes() void Message::filterLinks()
{
- static const TCHAR* szSpaces = L" \r\r\n";
- static const TCHAR* szPrefixes = L"([{<:\"'";
- static const TCHAR* szSuffixes = L".,:;!?)]}>\"'";
- static const TCHAR* szValidProtocol = L"abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- static const TCHAR* szValidHost = L".-abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ static const wchar_t* szSpaces = L" \r\r\n";
+ static const wchar_t* szPrefixes = L"([{<:\"'";
+ static const wchar_t* szSuffixes = L".,:;!?)]}>\"'";
+ static const wchar_t* szValidProtocol = L"abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ static const wchar_t* szValidHost = L".-abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
// init with raw text
m_WithoutLinks = getRaw();
diff --git a/plugins/HistoryStats/src/message.h b/plugins/HistoryStats/src/message.h index 6dc9e2f28a..f3aa8e75a7 100644 --- a/plugins/HistoryStats/src/message.h +++ b/plugins/HistoryStats/src/message.h @@ -56,7 +56,7 @@ public: m_Timestamp = localTimestamp;
}
- void assignText(const TCHAR* msg, ext::string::size_type len)
+ void assignText(const wchar_t* msg, ext::string::size_type len)
{
m_RawSource = msg;
m_nLength = len;
diff --git a/plugins/HistoryStats/src/mirandasettings.cpp b/plugins/HistoryStats/src/mirandasettings.cpp index cc6623545d..e2b9bc9d49 100644 --- a/plugins/HistoryStats/src/mirandasettings.cpp +++ b/plugins/HistoryStats/src/mirandasettings.cpp @@ -27,7 +27,7 @@ int MirandaSettings::readDWord(const char* szSetting, int dwDefault) const return db_get_dw(m_hContact, m_strModule.c_str(), szSetting, dwDefault);
}
-ext::string MirandaSettings::readStr(const char* szSetting, const TCHAR* szDefault) const
+ext::string MirandaSettings::readStr(const char* szSetting, const wchar_t* szDefault) const
{
DBVARIANT dbv;
if (db_get_s(m_hContact, m_strModule.c_str(), szSetting, &dbv))
@@ -38,7 +38,7 @@ ext::string MirandaSettings::readStr(const char* szSetting, const TCHAR* szDefau return str;
}
-ext::string MirandaSettings::readStrDirect(const char* szSetting, const TCHAR* szDefault) const
+ext::string MirandaSettings::readStrDirect(const char* szSetting, const wchar_t* szDefault) const
{
DBVARIANT dbv;
@@ -73,7 +73,7 @@ ext::string MirandaSettings::readStrDirect(const char* szSetting, const TCHAR* s return str;
}
-void MirandaSettings::readTree(const char* szSetting, const TCHAR* szDefault, SettingsTree& value) const
+void MirandaSettings::readTree(const char* szSetting, const wchar_t* szDefault, SettingsTree& value) const
{
value.fromString(readStr(szSetting, szDefault));
}
@@ -98,12 +98,12 @@ void MirandaSettings::writeDWord(const char* szSetting, int dwValue) const db_set_dw(m_hContact, m_strModule.c_str(), szSetting, dwValue);
}
-void MirandaSettings::writeStr(const char* szSetting, const TCHAR* szValue) const
+void MirandaSettings::writeStr(const char* szSetting, const wchar_t* szValue) const
{
db_set_ts(m_hContact, m_strModule.c_str(), szSetting, szValue);
}
-void MirandaSettings::writeStrDirect(const char* szSetting, const TCHAR* szValue) const
+void MirandaSettings::writeStrDirect(const char* szSetting, const wchar_t* szValue) const
{
db_set_ts(m_hContact, m_strModule.c_str(), szSetting, szValue);
}
diff --git a/plugins/HistoryStats/src/mirandasettings.h b/plugins/HistoryStats/src/mirandasettings.h index 11e743c977..c8671faa4c 100644 --- a/plugins/HistoryStats/src/mirandasettings.h +++ b/plugins/HistoryStats/src/mirandasettings.h @@ -39,17 +39,17 @@ public: int readByte(const char* szSetting, int bDefault) const;
int readWord(const char* szSetting, int wDefault) const;
int readDWord(const char* szSetting, int dwDeault) const;
- ext::string readStr(const char* szSetting, const TCHAR* szDefault) const;
- ext::string readStrDirect(const char* szSetting, const TCHAR* szDefault) const;
- void readTree(const char* szSetting, const TCHAR* szDefault, SettingsTree& value) const;
+ ext::string readStr(const char* szSetting, const wchar_t* szDefault) const;
+ ext::string readStrDirect(const char* szSetting, const wchar_t* szDefault) const;
+ void readTree(const char* szSetting, const wchar_t* szDefault, SettingsTree& value) const;
// writing
void writeBool(const char* szSetting, bool bValue) const;
void writeByte(const char* szSetting, int bValue) const;
void writeWord(const char* szSetting, int wValue) const;
void writeDWord(const char* szSetting, int dwValue) const;
- void writeStr(const char* szSetting, const TCHAR* szValue) const;
- void writeStrDirect(const char* szSetting, const TCHAR* szValue) const;
+ void writeStr(const char* szSetting, const wchar_t* szValue) const;
+ void writeStrDirect(const char* szSetting, const wchar_t* szValue) const;
void writeTree(const char* szSetting, const SettingsTree& value) const;
// misc functions
diff --git a/plugins/HistoryStats/src/mu_common.cpp b/plugins/HistoryStats/src/mu_common.cpp index 4bdf16a7f1..7b1ee72f8d 100644 --- a/plugins/HistoryStats/src/mu_common.cpp +++ b/plugins/HistoryStats/src/mu_common.cpp @@ -15,11 +15,11 @@ namespace mu namespace clist
{
- HGENMENU addMainMenuItem(const TCHAR* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, HGENMENU hRoot)
+ HGENMENU addMainMenuItem(const wchar_t* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, HGENMENU hRoot)
{
// TODO: support for unicode-core with unicode-aware CList
CMenuItem mi;
- mi.name.t = (TCHAR*)pszName;
+ mi.name.w = (wchar_t*)pszName;
mi.flags = flags | CMIF_TCHAR;
mi.position = position;
mi.hIcolibItem = hIcon;
@@ -29,11 +29,11 @@ namespace mu return Menu_AddMainMenuItem(&mi);
}
- HGENMENU addContactMenuItem(const TCHAR* pszName, DWORD flags, int position, HICON hIcon, const char* pszService)
+ HGENMENU addContactMenuItem(const wchar_t* pszName, DWORD flags, int position, HICON hIcon, const char* pszService)
{
// TODO: support for unicode-core with unicode-aware CList
CMenuItem mi;
- mi.name.t = (TCHAR*)pszName;
+ mi.name.w = (wchar_t*)pszName;
mi.flags = flags | CMIF_TCHAR;
mi.position = position;
mi.hIcolibItem = hIcon;
@@ -49,12 +49,12 @@ namespace mu namespace db
{
- int getProfilePath(int cbName, TCHAR* pszName)
+ int getProfilePath(int cbName, wchar_t* pszName)
{
return CallService(MS_DB_GETPROFILEPATHT, cbName, reinterpret_cast<LPARAM>(pszName));
}
- int getProfileName(int cbName, TCHAR* pszName)
+ int getProfileName(int cbName, wchar_t* pszName)
{
return CallService(MS_DB_GETPROFILENAMET, cbName, reinterpret_cast<LPARAM>(pszName));
}
@@ -95,11 +95,11 @@ namespace mu return true;
}
- void addIcon(const TCHAR* szSection, const TCHAR* szDescription, const char* szIconName, const char* szDefaultFile, int iDefaultIndex)
+ void addIcon(const wchar_t* szSection, const wchar_t* szDescription, const char* szIconName, const char* szDefaultFile, int iDefaultIndex)
{
SKINICONDESC sid = { 0 };
- sid.section.t = const_cast<TCHAR*>(szSection);
- sid.description.t = const_cast<TCHAR*>(szDescription);
+ sid.section.w = const_cast<wchar_t*>(szSection);
+ sid.description.w = const_cast<wchar_t*>(szDescription);
sid.pszName = const_cast<char*>(szIconName);
sid.defaultFile.a = const_cast<char*>(szDefaultFile);
sid.iDefaultIndex = iDefaultIndex;
@@ -119,16 +119,16 @@ namespace mu namespace opt
{
- void addPage(WPARAM addInfo, const TCHAR* pszGroup, const TCHAR* pszTitle, const TCHAR* pszTab, DLGPROC pfnDlgProc, const char* pszTemplate, HINSTANCE hInstance, DWORD flags /* = ODPF_BOLDGROUPS */)
+ void addPage(WPARAM addInfo, const wchar_t* pszGroup, const wchar_t* pszTitle, const wchar_t* pszTab, DLGPROC pfnDlgProc, const char* pszTemplate, HINSTANCE hInstance, DWORD flags /* = ODPF_BOLDGROUPS */)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.ptszTitle = const_cast<TCHAR*>(pszTitle);
+ odp.pwszTitle = const_cast<wchar_t*>(pszTitle);
odp.pfnDlgProc = pfnDlgProc;
odp.pszTemplate = const_cast<char*>(pszTemplate);
odp.hInstance = hInstance;
- odp.ptszGroup = const_cast<TCHAR*>(pszGroup);
+ odp.pwszGroup = const_cast<wchar_t*>(pszGroup);
odp.flags = flags | ODPF_TCHAR;
- odp.ptszTab = const_cast<TCHAR*>(pszTab);
+ odp.pwszTab = const_cast<wchar_t*>(pszTab);
Options_AddPage(addInfo, &odp);
}
}
diff --git a/plugins/HistoryStats/src/mu_common.h b/plugins/HistoryStats/src/mu_common.h index 98bab3800e..cc82ea61da 100644 --- a/plugins/HistoryStats/src/mu_common.h +++ b/plugins/HistoryStats/src/mu_common.h @@ -13,8 +13,8 @@ namespace mu namespace clist
{
- HGENMENU addMainMenuItem(const TCHAR* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, HGENMENU hRoot = 0);
- HGENMENU addContactMenuItem(const TCHAR* pszName, DWORD flags, int position, HICON hIcon, const char* pszService);
+ HGENMENU addMainMenuItem(const wchar_t* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, HGENMENU hRoot = 0);
+ HGENMENU addContactMenuItem(const wchar_t* pszName, DWORD flags, int position, HICON hIcon, const char* pszService);
}
/*
@@ -23,8 +23,8 @@ namespace mu namespace db
{
- int getProfilePath(int cbName, TCHAR* pszName);
- int getProfileName(int cbName, TCHAR* pszName);
+ int getProfilePath(int cbName, wchar_t* pszName);
+ int getProfileName(int cbName, wchar_t* pszName);
void setSafetyMode(bool safetyMode);
}
@@ -45,7 +45,7 @@ namespace mu namespace icolib
{
bool _available();
- void addIcon(const TCHAR* szSection, const TCHAR* szDescription, const char* szIconName, const char* szDefaultFile, int iDefaultIndex);
+ void addIcon(const wchar_t* szSection, const wchar_t* szDescription, const char* szIconName, const char* szDefaultFile, int iDefaultIndex);
HICON getIcon(const char* szIconName);
}
@@ -55,7 +55,7 @@ namespace mu namespace opt
{
- void addPage(WPARAM addInfo, const TCHAR* pszGroup, const TCHAR* pszTitle, const TCHAR* pszTab, DLGPROC pfnDlgProc, const char* pszTemplate, HINSTANCE hInstance, DWORD flags = ODPF_BOLDGROUPS);
+ void addPage(WPARAM addInfo, const wchar_t* pszGroup, const wchar_t* pszTitle, const wchar_t* pszTab, DLGPROC pfnDlgProc, const char* pszTemplate, HINSTANCE hInstance, DWORD flags = ODPF_BOLDGROUPS);
}
/*
diff --git a/plugins/HistoryStats/src/optionsctrl.cpp b/plugins/HistoryStats/src/optionsctrl.cpp index 2359259bad..c2b6e2738f 100644 --- a/plugins/HistoryStats/src/optionsctrl.cpp +++ b/plugins/HistoryStats/src/optionsctrl.cpp @@ -7,98 +7,98 @@ * OptionsCtrl
*/
-HANDLE OptionsCtrl::insertGroup(HANDLE hParent, const TCHAR* szLabel, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
+HANDLE OptionsCtrl::insertGroup(HANDLE hParent, const wchar_t* szLabel, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
{
OCGROUP ocg;
ocg.dwFlags = dwFlags;
- ocg.szLabel = const_cast<TCHAR*>(szLabel);
+ ocg.szLabel = const_cast<wchar_t*>(szLabel);
ocg.dwData = dwData;
return reinterpret_cast<HANDLE>(SendMessage(m_hOptWnd, OCM_INSERTGROUP, reinterpret_cast<WPARAM>(hParent), reinterpret_cast<LPARAM>(&ocg)));
}
-HANDLE OptionsCtrl::insertCheck(HANDLE hParent, const TCHAR* szLabel, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
+HANDLE OptionsCtrl::insertCheck(HANDLE hParent, const wchar_t* szLabel, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
{
OCCHECK occ;
occ.dwFlags = dwFlags;
- occ.szLabel = const_cast<TCHAR*>(szLabel);
+ occ.szLabel = const_cast<wchar_t*>(szLabel);
occ.dwData = dwData;
return reinterpret_cast<HANDLE>(SendMessage(m_hOptWnd, OCM_INSERTCHECK, reinterpret_cast<WPARAM>(hParent), reinterpret_cast<LPARAM>(&occ)));
}
-HANDLE OptionsCtrl::insertRadio(HANDLE hParent, HANDLE hSibling, const TCHAR* szLabel, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
+HANDLE OptionsCtrl::insertRadio(HANDLE hParent, HANDLE hSibling, const wchar_t* szLabel, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
{
OCRADIO ocr;
ocr.dwFlags = dwFlags;
- ocr.szLabel = const_cast<TCHAR*>(szLabel);
+ ocr.szLabel = const_cast<wchar_t*>(szLabel);
ocr.dwData = dwData;
ocr.hSibling = hSibling;
return reinterpret_cast<HANDLE>(SendMessage(m_hOptWnd, OCM_INSERTRADIO, reinterpret_cast<WPARAM>(hParent), reinterpret_cast<LPARAM>(&ocr)));
}
-HANDLE OptionsCtrl::insertEdit(HANDLE hParent, const TCHAR* szLabel, const TCHAR* szEdit /* = L"" */, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
+HANDLE OptionsCtrl::insertEdit(HANDLE hParent, const wchar_t* szLabel, const wchar_t* szEdit /* = L"" */, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
{
OCEDIT oce;
oce.dwFlags = dwFlags;
- oce.szLabel = const_cast<TCHAR*>(szLabel);
+ oce.szLabel = const_cast<wchar_t*>(szLabel);
oce.dwData = dwData;
- oce.szEdit = const_cast<TCHAR*>(szEdit);
+ oce.szEdit = const_cast<wchar_t*>(szEdit);
return reinterpret_cast<HANDLE>(SendMessage(m_hOptWnd, OCM_INSERTEDIT, reinterpret_cast<WPARAM>(hParent), reinterpret_cast<LPARAM>(&oce)));
}
-HANDLE OptionsCtrl::insertCombo(HANDLE hParent, const TCHAR* szLabel, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
+HANDLE OptionsCtrl::insertCombo(HANDLE hParent, const wchar_t* szLabel, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
{
OCCOMBO occ;
occ.dwFlags = dwFlags;
- occ.szLabel = const_cast<TCHAR*>(szLabel);
+ occ.szLabel = const_cast<wchar_t*>(szLabel);
occ.dwData = dwData;
return reinterpret_cast<HANDLE>(SendMessage(m_hOptWnd, OCM_INSERTCOMBO, reinterpret_cast<WPARAM>(hParent), reinterpret_cast<LPARAM>(&occ)));
}
-HANDLE OptionsCtrl::insertButton(HANDLE hParent, const TCHAR* szLabel, const TCHAR* szButton, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
+HANDLE OptionsCtrl::insertButton(HANDLE hParent, const wchar_t* szLabel, const wchar_t* szButton, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
{
OCBUTTON ocb;
ocb.dwFlags = dwFlags;
- ocb.szLabel = const_cast<TCHAR*>(szLabel);
+ ocb.szLabel = const_cast<wchar_t*>(szLabel);
ocb.dwData = dwData;
- ocb.szButton = const_cast<TCHAR*>(szButton);
+ ocb.szButton = const_cast<wchar_t*>(szButton);
return reinterpret_cast<HANDLE>(SendMessage(m_hOptWnd, OCM_INSERTBUTTON, reinterpret_cast<WPARAM>(hParent), reinterpret_cast<LPARAM>(&ocb)));
}
-HANDLE OptionsCtrl::insertDateTime(HANDLE hParent, const TCHAR* szLabel, DWORD dwDateTime, const TCHAR* szFormat /* = L"%Y-%m-%d" */, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
+HANDLE OptionsCtrl::insertDateTime(HANDLE hParent, const wchar_t* szLabel, DWORD dwDateTime, const wchar_t* szFormat /* = L"%Y-%m-%d" */, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
{
OCDATETIME ocdt;
ocdt.dwFlags = dwFlags;
- ocdt.szLabel = const_cast<TCHAR*>(szLabel);
+ ocdt.szLabel = const_cast<wchar_t*>(szLabel);
ocdt.dwData = dwData;
- ocdt.szFormat = const_cast<TCHAR*>(szFormat);
+ ocdt.szFormat = const_cast<wchar_t*>(szFormat);
ocdt.dwDateTime = dwDateTime;
return reinterpret_cast<HANDLE>(SendMessage(m_hOptWnd, OCM_INSERTDATETIME, reinterpret_cast<WPARAM>(hParent), reinterpret_cast<LPARAM>(&ocdt)));
}
-HANDLE OptionsCtrl::insertColor(HANDLE hParent, const TCHAR* szLabel, COLORREF crColor /* = 0 */, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
+HANDLE OptionsCtrl::insertColor(HANDLE hParent, const wchar_t* szLabel, COLORREF crColor /* = 0 */, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
{
OCCOLOR occ;
occ.dwFlags = dwFlags;
- occ.szLabel = const_cast<TCHAR*>(szLabel);
+ occ.szLabel = const_cast<wchar_t*>(szLabel);
occ.dwData = dwData;
occ.crColor = crColor;
return reinterpret_cast<HANDLE>(SendMessage(m_hOptWnd, OCM_INSERTCOLOR, reinterpret_cast<WPARAM>(hParent), reinterpret_cast<LPARAM>(&occ)));
}
-const TCHAR* OptionsCtrl::getItemLabel(HANDLE hItem)
+const wchar_t* OptionsCtrl::getItemLabel(HANDLE hItem)
{
- return reinterpret_cast<const TCHAR*>(SendMessage(m_hOptWnd, OCM_GETITEMLABEL, reinterpret_cast<WPARAM>(hItem), 0));
+ return reinterpret_cast<const wchar_t*>(SendMessage(m_hOptWnd, OCM_GETITEMLABEL, reinterpret_cast<WPARAM>(hItem), 0));
}
-void OptionsCtrl::setItemLabel(HANDLE hItem, const TCHAR* szLabel)
+void OptionsCtrl::setItemLabel(HANDLE hItem, const wchar_t* szLabel)
{
SendMessage(m_hOptWnd, OCM_SETITEMLABEL, reinterpret_cast<WPARAM>(hItem), reinterpret_cast<LPARAM>(szLabel));
}
@@ -153,17 +153,17 @@ void OptionsCtrl::setEditNumber(HANDLE hEdit, int nNumber) SendMessage(m_hOptWnd, OCM_SETEDITNUMBER, reinterpret_cast<WPARAM>(hEdit), nNumber);
}
-const TCHAR* OptionsCtrl::getEditString(HANDLE hEdit)
+const wchar_t* OptionsCtrl::getEditString(HANDLE hEdit)
{
- return reinterpret_cast<const TCHAR*>(SendMessage(m_hOptWnd, OCM_GETEDITSTRING, reinterpret_cast<WPARAM>(hEdit), 0));
+ return reinterpret_cast<const wchar_t*>(SendMessage(m_hOptWnd, OCM_GETEDITSTRING, reinterpret_cast<WPARAM>(hEdit), 0));
}
-void OptionsCtrl::setEditString(HANDLE hEdit, const TCHAR* szString)
+void OptionsCtrl::setEditString(HANDLE hEdit, const wchar_t* szString)
{
SendMessage(m_hOptWnd, OCM_SETEDITSTRING, reinterpret_cast<WPARAM>(hEdit), reinterpret_cast<LPARAM>(szString));
}
-void OptionsCtrl::addComboItem(HANDLE hCombo, const TCHAR* szItem)
+void OptionsCtrl::addComboItem(HANDLE hCombo, const wchar_t* szItem)
{
SendMessage(m_hOptWnd, OCM_ADDCOMBOITEM, reinterpret_cast<WPARAM>(hCombo), reinterpret_cast<LPARAM>(szItem));
}
diff --git a/plugins/HistoryStats/src/optionsctrl.h b/plugins/HistoryStats/src/optionsctrl.h index 026a535176..629249e99b 100644 --- a/plugins/HistoryStats/src/optionsctrl.h +++ b/plugins/HistoryStats/src/optionsctrl.h @@ -39,16 +39,16 @@ public: operator HWND() { return m_hOptWnd; }
public:
- HANDLE insertGroup(HANDLE hParent, const TCHAR* szLabel, DWORD dwFlags = 0, INT_PTR dwData = 0);
- HANDLE insertCheck(HANDLE hParent, const TCHAR* szLabel, DWORD dwFlags = 0, INT_PTR dwData = 0);
- HANDLE insertRadio(HANDLE hParent, HANDLE hSibling, const TCHAR* szLabel, DWORD dwFlags = 0, INT_PTR dwData = 0);
- HANDLE insertEdit(HANDLE hParent, const TCHAR* szLabel, const TCHAR* szEdit = L"", DWORD dwFlags = 0, INT_PTR dwData = 0);
- HANDLE insertCombo(HANDLE hParent, const TCHAR* szLabel, DWORD dwFlags = 0, INT_PTR dwData = 0);
- HANDLE insertButton(HANDLE hParent, const TCHAR* szLabel, const TCHAR* szButton, DWORD dwFlags = 0, INT_PTR dwData = 0);
- HANDLE insertDateTime(HANDLE hParent, const TCHAR* szLabel, DWORD dwDateTime, const TCHAR* szFormat = L"%Y-%m-%d", DWORD dwFlags = 0, INT_PTR dwData = 0);
- HANDLE insertColor(HANDLE hParent, const TCHAR* szLabel, COLORREF crColor = 0, DWORD dwFlags = 0, INT_PTR dwData = 0);
- const TCHAR* getItemLabel(HANDLE hItem);
- void setItemLabel(HANDLE hItem, const TCHAR* szLabel);
+ HANDLE insertGroup(HANDLE hParent, const wchar_t* szLabel, DWORD dwFlags = 0, INT_PTR dwData = 0);
+ HANDLE insertCheck(HANDLE hParent, const wchar_t* szLabel, DWORD dwFlags = 0, INT_PTR dwData = 0);
+ HANDLE insertRadio(HANDLE hParent, HANDLE hSibling, const wchar_t* szLabel, DWORD dwFlags = 0, INT_PTR dwData = 0);
+ HANDLE insertEdit(HANDLE hParent, const wchar_t* szLabel, const wchar_t* szEdit = L"", DWORD dwFlags = 0, INT_PTR dwData = 0);
+ HANDLE insertCombo(HANDLE hParent, const wchar_t* szLabel, DWORD dwFlags = 0, INT_PTR dwData = 0);
+ HANDLE insertButton(HANDLE hParent, const wchar_t* szLabel, const wchar_t* szButton, DWORD dwFlags = 0, INT_PTR dwData = 0);
+ HANDLE insertDateTime(HANDLE hParent, const wchar_t* szLabel, DWORD dwDateTime, const wchar_t* szFormat = L"%Y-%m-%d", DWORD dwFlags = 0, INT_PTR dwData = 0);
+ HANDLE insertColor(HANDLE hParent, const wchar_t* szLabel, COLORREF crColor = 0, DWORD dwFlags = 0, INT_PTR dwData = 0);
+ const wchar_t* getItemLabel(HANDLE hItem);
+ void setItemLabel(HANDLE hItem, const wchar_t* szLabel);
bool isItemEnabled(HANDLE hItem);
void enableItem(HANDLE hItem, bool bEnable);
DWORD getItemData(HANDLE hItem);
@@ -59,9 +59,9 @@ public: void setRadioChecked(HANDLE hRadio, int nCheck);
int getEditNumber(HANDLE hEdit);
void setEditNumber(HANDLE hEdit, int nNumber);
- const TCHAR* getEditString(HANDLE hEdit);
- void setEditString(HANDLE hEdit, const TCHAR* szString);
- void addComboItem(HANDLE hCombo, const TCHAR* szItem);
+ const wchar_t* getEditString(HANDLE hEdit);
+ void setEditString(HANDLE hEdit, const wchar_t* szString);
+ void addComboItem(HANDLE hCombo, const wchar_t* szItem);
int getComboSelected(HANDLE hCombo);
void setComboSelected(HANDLE hCombo, int nSelect);
void ensureVisible(HANDLE hItem);
diff --git a/plugins/HistoryStats/src/optionsctrldefs.h b/plugins/HistoryStats/src/optionsctrldefs.h index 837a41924e..7b24009cdf 100644 --- a/plugins/HistoryStats/src/optionsctrldefs.h +++ b/plugins/HistoryStats/src/optionsctrldefs.h @@ -17,8 +17,8 @@ public: OCM_INSERTEDIT = WM_USER + 3, // (HANDLE hParent, OCEDIT* pEdit) -> HANDLE hEdit [Edit]
OCM_INSERTCOMBO = WM_USER + 4, // (HANDLE hParent, OCCOMBO* pCombo) -> HANDLE hCombo [Combo]
OCM_INSERTBUTTON = WM_USER + 5, // (HANDLE hParent, OCBUTTON* pButton) -> HANDLE hButton [Button]
- OCM_GETITEMLABEL = WM_USER + 6, // (HANDLE hItem, #) -> const TCHAR* szLabel
- OCM_SETITEMLABEL = WM_USER + 7, // (HANDLE hItem, const TCHAR* szLabel) -> #
+ OCM_GETITEMLABEL = WM_USER + 6, // (HANDLE hItem, #) -> const wchar_t* szLabel
+ OCM_SETITEMLABEL = WM_USER + 7, // (HANDLE hItem, const wchar_t* szLabel) -> #
OCM_ISITEMENABLED = WM_USER + 8, // (HANDLE hItem, #) -> BOOL bEnabled
OCM_ENABLEITEM = WM_USER + 9, // (HANDLE hItem, BOOL bEnable) -> #
OCM_GETITEMDATA = WM_USER + 10, // (HANDLE hItem, #) -> INT_PTR dwData
@@ -29,9 +29,9 @@ public: OCM_SETRADIOCHECKED = WM_USER + 15, // (HANDLE hRadio, int nCheck) -> # [Radio]
OCM_GETEDITNUMBER = WM_USER + 16, // (HANDLE hEdit, #) -> int nNumber [Edit]
OCM_SETEDITNUMBER = WM_USER + 17, // (HANDLE hEdit, int nNumber) -> # [Edit]
- OCM_GETEDITSTRING = WM_USER + 18, // (HANDLE hEdit, #) -> const TCHAR* szString [Edit]
- OCM_SETEDITSTRING = WM_USER + 19, // (HANDLE hEdit, const TCHAR* szString) -> # [Edit]
- OCM_ADDCOMBOITEM = WM_USER + 20, // (HANDLE hCombo, const TCHAR* szItem) -> # [Combo]
+ OCM_GETEDITSTRING = WM_USER + 18, // (HANDLE hEdit, #) -> const wchar_t* szString [Edit]
+ OCM_SETEDITSTRING = WM_USER + 19, // (HANDLE hEdit, const wchar_t* szString) -> # [Edit]
+ OCM_ADDCOMBOITEM = WM_USER + 20, // (HANDLE hCombo, const wchar_t* szItem) -> # [Combo]
OCM_GETCOMBOSELECTED = WM_USER + 21, // (HANDLE hCombo, #) -> int nSelected [Combo]
OCM_SETCOMBOSELECTED = WM_USER + 22, // (HANDLE hCombo, int nSelect) -> # [Combo]
OCM_ENSUREVISIBLE = WM_USER + 23, // (HANDLE hItem, #) -> #
@@ -89,54 +89,54 @@ public: struct OCGROUP {
DWORD dwFlags;
- TCHAR* szLabel;
+ wchar_t* szLabel;
INT_PTR dwData;
};
struct OCCHECK {
DWORD dwFlags;
- TCHAR* szLabel;
+ wchar_t* szLabel;
INT_PTR dwData;
};
struct OCRADIO {
DWORD dwFlags;
- TCHAR* szLabel;
+ wchar_t* szLabel;
INT_PTR dwData;
HANDLE hSibling;
};
struct OCEDIT {
DWORD dwFlags;
- TCHAR* szLabel;
+ wchar_t* szLabel;
INT_PTR dwData;
- TCHAR* szEdit;
+ wchar_t* szEdit;
};
struct OCCOMBO {
DWORD dwFlags;
- TCHAR* szLabel;
+ wchar_t* szLabel;
INT_PTR dwData;
};
struct OCBUTTON {
DWORD dwFlags;
- TCHAR* szLabel;
+ wchar_t* szLabel;
INT_PTR dwData;
- TCHAR* szButton;
+ wchar_t* szButton;
};
struct OCDATETIME {
DWORD dwFlags;
- TCHAR* szLabel;
+ wchar_t* szLabel;
INT_PTR dwData;
- TCHAR* szFormat;
+ wchar_t* szFormat;
DWORD dwDateTime;
};
struct OCCOLOR {
DWORD dwFlags;
- TCHAR* szLabel;
+ wchar_t* szLabel;
INT_PTR dwData;
COLORREF crColor;
};
diff --git a/plugins/HistoryStats/src/optionsctrlimpl.cpp b/plugins/HistoryStats/src/optionsctrlimpl.cpp index f4d8e55e5e..95c17cd380 100644 --- a/plugins/HistoryStats/src/optionsctrlimpl.cpp +++ b/plugins/HistoryStats/src/optionsctrlimpl.cpp @@ -8,7 +8,7 @@ * OptionsCtrlImpl
*/
-const TCHAR* OptionsCtrlImpl::m_ClassName = L"HistoryStatsOptions";
+const wchar_t* OptionsCtrlImpl::m_ClassName = L"HistoryStatsOptions";
HIMAGELIST OptionsCtrlImpl::m_hStateIcons = NULL;
int OptionsCtrlImpl::m_nStateIconsRef = 0;
@@ -140,7 +140,7 @@ LRESULT CALLBACK OptionsCtrlImpl::staticWndProc(HWND hWnd, UINT msg, WPARAM wPar return reinterpret_cast<LRESULT>(pCtrl->onOCMGetItemLabel(reinterpret_cast<HTREEITEM>(wParam)));
case OCM_SETITEMLABEL:
- pCtrl->onOCMSetItemLabel(reinterpret_cast<HTREEITEM>(wParam), reinterpret_cast<const TCHAR*>(lParam));
+ pCtrl->onOCMSetItemLabel(reinterpret_cast<HTREEITEM>(wParam), reinterpret_cast<const wchar_t*>(lParam));
return 0;
case OCM_ISITEMENABLED:
@@ -182,11 +182,11 @@ LRESULT CALLBACK OptionsCtrlImpl::staticWndProc(HWND hWnd, UINT msg, WPARAM wPar return reinterpret_cast<LPARAM>(pCtrl->onOCMGetEditString(reinterpret_cast<HTREEITEM>(wParam)));
case OCM_SETEDITSTRING:
- pCtrl->onOCMSetEditString(reinterpret_cast<HTREEITEM>(wParam), reinterpret_cast<const TCHAR*>(lParam));
+ pCtrl->onOCMSetEditString(reinterpret_cast<HTREEITEM>(wParam), reinterpret_cast<const wchar_t*>(lParam));
return 0;
case OCM_ADDCOMBOITEM:
- pCtrl->onOCMAddComboItem(reinterpret_cast<HTREEITEM>(wParam), reinterpret_cast<const TCHAR*>(lParam));
+ pCtrl->onOCMAddComboItem(reinterpret_cast<HTREEITEM>(wParam), reinterpret_cast<const wchar_t*>(lParam));
return 0;
case OCM_GETCOMBOSELECTED:
@@ -839,12 +839,12 @@ HTREEITEM OptionsCtrlImpl::onOCMInsertColor(HTREEITEM hParent, OCCOLOR* pColor) return (new Color(this, hParent ? getItem(hParent) : NULL, pColor->szLabel, pColor->crColor, pColor->dwFlags, pColor->dwData))->m_hItem;
}
-const TCHAR* OptionsCtrlImpl::onOCMGetItemLabel(HTREEITEM hItem)
+const wchar_t* OptionsCtrlImpl::onOCMGetItemLabel(HTREEITEM hItem)
{
return getItem(hItem)->getLabel();
}
-void OptionsCtrlImpl::onOCMSetItemLabel(HTREEITEM hItem, const TCHAR* szLabel)
+void OptionsCtrlImpl::onOCMSetItemLabel(HTREEITEM hItem, const wchar_t* szLabel)
{
assert(szLabel);
@@ -928,7 +928,7 @@ void OptionsCtrlImpl::onOCMSetEditNumber(HTREEITEM hEdit, int nNumber) reinterpret_cast<Edit*>(pEdit)->setNumber(nNumber);
}
-const TCHAR* OptionsCtrlImpl::onOCMGetEditString(HTREEITEM hEdit)
+const wchar_t* OptionsCtrlImpl::onOCMGetEditString(HTREEITEM hEdit)
{
Item* pEdit = getItem(hEdit);
@@ -937,7 +937,7 @@ const TCHAR* OptionsCtrlImpl::onOCMGetEditString(HTREEITEM hEdit) return reinterpret_cast<Edit*>(pEdit)->getString();
}
-void OptionsCtrlImpl::onOCMSetEditString(HTREEITEM hEdit, const TCHAR *szString)
+void OptionsCtrlImpl::onOCMSetEditString(HTREEITEM hEdit, const wchar_t *szString)
{
assert(szString);
@@ -948,7 +948,7 @@ void OptionsCtrlImpl::onOCMSetEditString(HTREEITEM hEdit, const TCHAR *szString) reinterpret_cast<Edit*>(pEdit)->setString(szString);
}
-void OptionsCtrlImpl::onOCMAddComboItem(HTREEITEM hCombo, const TCHAR* szItem)
+void OptionsCtrlImpl::onOCMAddComboItem(HTREEITEM hCombo, const wchar_t* szItem)
{
assert(szItem);
@@ -1111,7 +1111,7 @@ void OptionsCtrlImpl::onOCMSetItemColor(HTREEITEM hColor, COLORREF crColor) reinterpret_cast<Color*>(pColor)->setColor(crColor);
}
-void OptionsCtrlImpl::insertItem(Item* pParent, Item* pItem, const TCHAR* szNodeText, DWORD dwFlags, int iImage)
+void OptionsCtrlImpl::insertItem(Item* pParent, Item* pItem, const wchar_t* szNodeText, DWORD dwFlags, int iImage)
{
assert(!pParent || pParent->m_hItem);
assert(pItem);
@@ -1121,7 +1121,7 @@ void OptionsCtrlImpl::insertItem(Item* pParent, Item* pItem, const TCHAR* szNode tvis.hParent = pParent ? pParent->m_hItem : TVI_ROOT;
tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE | TVIF_PARAM;
- tvis.item.pszText = const_cast<TCHAR*>(szNodeText);
+ tvis.item.pszText = const_cast<wchar_t*>(szNodeText);
tvis.item.iImage = iImage;
tvis.item.iSelectedImage = iImage;
tvis.item.stateMask = TVIS_EXPANDED | ((dwFlags & OCF_BOLD) ? TVIS_BOLD : 0);
@@ -1192,7 +1192,7 @@ void OptionsCtrlImpl::setStateImage(HTREEITEM hItem, int iImage) TreeView_SetItem(m_hTree, &tvi);
}
-void OptionsCtrlImpl::setNodeText(HTREEITEM hItem, const TCHAR* szNodeText)
+void OptionsCtrlImpl::setNodeText(HTREEITEM hItem, const wchar_t* szNodeText)
{
assert(hItem);
assert(szNodeText);
@@ -1200,7 +1200,7 @@ void OptionsCtrlImpl::setNodeText(HTREEITEM hItem, const TCHAR* szNodeText) TVITEM tvi;
tvi.mask = TVIF_HANDLE | TVIF_TEXT;
tvi.hItem = hItem;
- tvi.pszText = const_cast<TCHAR*>(szNodeText);
+ tvi.pszText = const_cast<wchar_t*>(szNodeText);
TreeView_SetItem(m_hTree, &tvi);
}
diff --git a/plugins/HistoryStats/src/optionsctrlimpl.h b/plugins/HistoryStats/src/optionsctrlimpl.h index e931aa8933..97d27a92a2 100644 --- a/plugins/HistoryStats/src/optionsctrlimpl.h +++ b/plugins/HistoryStats/src/optionsctrlimpl.h @@ -76,7 +76,7 @@ private: INT_PTR m_dwData;
protected:
- explicit Item(OptionsCtrlImpl* pCtrl, ItemType ItemType, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData);
+ explicit Item(OptionsCtrlImpl* pCtrl, ItemType ItemType, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData);
void enableChilds(bool bEnable);
@@ -91,8 +91,8 @@ private: virtual void setEnabled(bool bEnable) = 0;
virtual void childAdded(Item* pChild) = 0;
- virtual void setLabel(const TCHAR* szLabel);
- virtual const TCHAR* getLabel() { return m_strLabel.c_str(); }
+ virtual void setLabel(const wchar_t* szLabel);
+ virtual const wchar_t* getLabel() { return m_strLabel.c_str(); }
};
class Group
@@ -102,7 +102,7 @@ private: bool m_bDrawLine;
public:
- explicit Group(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData);
+ explicit Group(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData);
virtual void setEnabled(bool bEnable);
virtual void childAdded(Item* pChild);
@@ -122,7 +122,7 @@ private: void updateItem();
public:
- explicit Check(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData);
+ explicit Check(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData);
virtual void onToggle();
@@ -171,7 +171,7 @@ private: void updateItem();
public:
- explicit Radio(OptionsCtrlImpl* pCtrl, Item* pParent, Radio* pSibling, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData);
+ explicit Radio(OptionsCtrlImpl* pCtrl, Item* pParent, Radio* pSibling, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData);
virtual ~Radio();
virtual void onToggle();
@@ -196,7 +196,7 @@ private: ext::string getCombinedText();
public:
- explicit Edit(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, const TCHAR* szEdit, DWORD dwFlags, INT_PTR dwData);
+ explicit Edit(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, const wchar_t* szEdit, DWORD dwFlags, INT_PTR dwData);
virtual void onToggle() { onActivate(); }
virtual void onSelect();
@@ -206,11 +206,11 @@ private: virtual void setEnabled(bool bEnable);
virtual void childAdded(Item* pChild);
- virtual void setLabel(const TCHAR* szLabel);
+ virtual void setLabel(const wchar_t* szLabel);
- const TCHAR* getString();
- void setString(const TCHAR* szString);
- int getNumber() { return _ttoi(getString()); }
+ const wchar_t* getString();
+ void setString(const wchar_t* szString);
+ int getNumber() { return _wtoi(getString()); }
void setNumber(int nNumber) { setString(utils::intToString(nNumber).c_str()); }
};
@@ -230,7 +230,7 @@ private: ext::string getCombinedText();
public:
- explicit Combo(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData);
+ explicit Combo(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData);
virtual void onToggle() { onActivate(); }
virtual void onSelect();
@@ -240,9 +240,9 @@ private: virtual void setEnabled(bool bEnable);
virtual void childAdded(Item* pChild);
- virtual void setLabel(const TCHAR* szLabel);
+ virtual void setLabel(const wchar_t* szLabel);
- void addItem(const TCHAR* szItem);
+ void addItem(const wchar_t* szItem);
int getSelected();
void setSelected(int nSelect);
void onSelChanged();
@@ -256,7 +256,7 @@ private: HWND m_hButtonWnd;
public:
- explicit Button(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, const TCHAR* szButton, DWORD dwFlags, INT_PTR dwData);
+ explicit Button(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, const wchar_t* szButton, DWORD dwFlags, INT_PTR dwData);
virtual void onToggle() { onActivate(); }
virtual void onSelect();
@@ -266,7 +266,7 @@ private: virtual void setEnabled(bool bEnable);
virtual void childAdded(Item* pChild);
- virtual void setLabel(const TCHAR* szLabel);
+ virtual void setLabel(const wchar_t* szLabel);
};
class DateTime
@@ -294,7 +294,7 @@ private: ext::string getCombinedText();
public:
- explicit DateTime(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, const TCHAR* szFormat, time_t timestamp, DWORD dwFlags, INT_PTR dwData);
+ explicit DateTime(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, const wchar_t* szFormat, time_t timestamp, DWORD dwFlags, INT_PTR dwData);
virtual void onToggle() { onActivate(); }
virtual void onSelect();
@@ -304,7 +304,7 @@ private: virtual void setEnabled(bool bEnable);
virtual void childAdded(Item* pChild);
- virtual void setLabel(const TCHAR* szLabel);
+ virtual void setLabel(const wchar_t* szLabel);
bool isNone();
void setNone();
@@ -325,7 +325,7 @@ private: COLORREF getColorValue();
public:
- explicit Color(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, COLORREF crColor, DWORD dwFlags, INT_PTR dwData);
+ explicit Color(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, COLORREF crColor, DWORD dwFlags, INT_PTR dwData);
virtual void onToggle() { onActivate(); }
virtual void onSelect();
@@ -335,7 +335,7 @@ private: virtual void setEnabled(bool bEnable);
virtual void childAdded(Item* pChild);
- virtual void setLabel(const TCHAR* szLabel);
+ virtual void setLabel(const wchar_t* szLabel);
COLORREF getColor();
void setColor(COLORREF crColor);
@@ -343,7 +343,7 @@ private: };
private:
- static const TCHAR* m_ClassName;
+ static const wchar_t* m_ClassName;
static HIMAGELIST m_hStateIcons;
static int m_nStateIconsRef;
@@ -402,8 +402,8 @@ private: HTREEITEM onOCMInsertButton(HTREEITEM hParent, OCBUTTON* pButton);
HTREEITEM onOCMInsertDateTime(HTREEITEM hParent, OCDATETIME* pDateTime);
HTREEITEM onOCMInsertColor(HTREEITEM hParent, OCCOLOR* pColor);
- const TCHAR* onOCMGetItemLabel(HTREEITEM hItem);
- void onOCMSetItemLabel(HTREEITEM hItem, const TCHAR* szLabel);
+ const wchar_t* onOCMGetItemLabel(HTREEITEM hItem);
+ void onOCMSetItemLabel(HTREEITEM hItem, const wchar_t* szLabel);
bool onOCMIsItemEnabled(HTREEITEM hItem);
void onOCMEnableItem(HTREEITEM hItem, bool bEnable);
DWORD onOCMGetItemData(HTREEITEM hItem);
@@ -414,9 +414,9 @@ private: void onOCMSetRadioChecked(HTREEITEM hRadio, int nCheck);
int onOCMGetEditNumber(HTREEITEM hEdit);
void onOCMSetEditNumber(HTREEITEM hEdit, int nNumber);
- const TCHAR* onOCMGetEditString(HTREEITEM hEdit);
- void onOCMSetEditString(HTREEITEM hEdit, const TCHAR *szString);
- void onOCMAddComboItem(HTREEITEM hCombo, const TCHAR* szItem);
+ const wchar_t* onOCMGetEditString(HTREEITEM hEdit);
+ void onOCMSetEditString(HTREEITEM hEdit, const wchar_t *szString);
+ void onOCMAddComboItem(HTREEITEM hCombo, const wchar_t* szItem);
int onOCMGetComboSelected(HTREEITEM hCombo);
void onOCMSetComboSelected(HTREEITEM hCombo, int nSelect);
void onOCMEnsureVisible(HTREEITEM hItem);
@@ -434,13 +434,13 @@ private: void onOCMSetItemColor(HTREEITEM hColor, COLORREF crColor);
private:
- void insertItem(Item* pParent, Item* pItem, const TCHAR* szNodeText, DWORD dwFlags, int iImage);
+ void insertItem(Item* pParent, Item* pItem, const wchar_t* szNodeText, DWORD dwFlags, int iImage);
void setModified(Item* pItem, bool bModified = true);
bool isItemValid(HTREEITEM hItem);
Item* getItem(HTREEITEM hItem);
void setItem(HTREEITEM hItem, Item* pItem);
void setStateImage(HTREEITEM hItem, int iImage);
- void setNodeText(HTREEITEM hItem, const TCHAR* szNodeText);
+ void setNodeText(HTREEITEM hItem, const wchar_t* szNodeText);
bool getItemFreeRect(HTREEITEM hItem, RECT& outRect);
};
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_button.cpp b/plugins/HistoryStats/src/optionsctrlimpl_button.cpp index 5c56523322..868fa46436 100644 --- a/plugins/HistoryStats/src/optionsctrlimpl_button.cpp +++ b/plugins/HistoryStats/src/optionsctrlimpl_button.cpp @@ -7,7 +7,7 @@ * OptionsCtrlImpl::Button
*/
-OptionsCtrlImpl::Button::Button(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, const TCHAR* szButton, DWORD dwFlags, INT_PTR dwData)
+OptionsCtrlImpl::Button::Button(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, const wchar_t* szButton, DWORD dwFlags, INT_PTR dwData)
: Item(pCtrl, itButton, szLabel, dwFlags, dwData)
, m_hButtonWnd(NULL)
, m_strButton(szButton)
@@ -113,7 +113,7 @@ void OptionsCtrlImpl::Button::childAdded(Item* pChild) }
}
-void OptionsCtrlImpl::Button::setLabel(const TCHAR* szLabel)
+void OptionsCtrlImpl::Button::setLabel(const wchar_t* szLabel)
{
m_strLabel = szLabel;
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_check.cpp b/plugins/HistoryStats/src/optionsctrlimpl_check.cpp index 351c77b1d0..8776224299 100644 --- a/plugins/HistoryStats/src/optionsctrlimpl_check.cpp +++ b/plugins/HistoryStats/src/optionsctrlimpl_check.cpp @@ -25,7 +25,7 @@ void OptionsCtrlImpl::Check::updateItem() enableChilds(getChildEnable());
}
-OptionsCtrlImpl::Check::Check(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData) :
+OptionsCtrlImpl::Check::Check(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData) :
Item(pCtrl, itCheck, szLabel, dwFlags, dwData)
{
m_bChecked = bool_(dwFlags & OCF_CHECKED);
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_color.cpp b/plugins/HistoryStats/src/optionsctrlimpl_color.cpp index a8991041f1..e0b330d147 100644 --- a/plugins/HistoryStats/src/optionsctrlimpl_color.cpp +++ b/plugins/HistoryStats/src/optionsctrlimpl_color.cpp @@ -12,7 +12,7 @@ COLORREF OptionsCtrlImpl::Color::getColorValue() return SendMessage(m_hColorWnd, CPM_GETCOLOUR, 0, 0);
}
-OptionsCtrlImpl::Color::Color(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, COLORREF crColor, DWORD dwFlags, INT_PTR dwData)
+OptionsCtrlImpl::Color::Color(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, COLORREF crColor, DWORD dwFlags, INT_PTR dwData)
: Item(pCtrl, itColor, szLabel, dwFlags, dwData)
, m_hColorWnd(NULL)
, m_crColor(crColor)
@@ -130,7 +130,7 @@ void OptionsCtrlImpl::Color::childAdded(Item* pChild) }
}
-void OptionsCtrlImpl::Color::setLabel(const TCHAR* szLabel)
+void OptionsCtrlImpl::Color::setLabel(const wchar_t* szLabel)
{
m_strLabel = szLabel;
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_combo.cpp b/plugins/HistoryStats/src/optionsctrlimpl_combo.cpp index 436e32aa13..db0837a97e 100644 --- a/plugins/HistoryStats/src/optionsctrlimpl_combo.cpp +++ b/plugins/HistoryStats/src/optionsctrlimpl_combo.cpp @@ -46,7 +46,7 @@ ext::string OptionsCtrlImpl::Combo::getCombinedText() }
}
-OptionsCtrlImpl::Combo::Combo(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData)
+OptionsCtrlImpl::Combo::Combo(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData)
: Item(pCtrl, itCombo, szLabel, dwFlags, dwData), m_hComboWnd(NULL), m_nSelected(-1)
{
m_bDisableChildsOnIndex0 = bool_(dwFlags & OCF_DISABLECHILDSONINDEX0);
@@ -177,7 +177,7 @@ void OptionsCtrlImpl::Combo::childAdded(Item* pChild) }
}
-void OptionsCtrlImpl::Combo::setLabel(const TCHAR* szLabel)
+void OptionsCtrlImpl::Combo::setLabel(const wchar_t* szLabel)
{
m_strLabel = szLabel;
@@ -188,7 +188,7 @@ void OptionsCtrlImpl::Combo::setLabel(const TCHAR* szLabel) }
}
-void OptionsCtrlImpl::Combo::addItem(const TCHAR* szItem)
+void OptionsCtrlImpl::Combo::addItem(const wchar_t* szItem)
{
m_Items.push_back(szItem);
}
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_datetime.cpp b/plugins/HistoryStats/src/optionsctrlimpl_datetime.cpp index d55e4c0a38..0a32c7a29c 100644 --- a/plugins/HistoryStats/src/optionsctrlimpl_datetime.cpp +++ b/plugins/HistoryStats/src/optionsctrlimpl_datetime.cpp @@ -180,7 +180,7 @@ ext::string OptionsCtrlImpl::DateTime::getCombinedText() return strTemp;
}
-OptionsCtrlImpl::DateTime::DateTime(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, const TCHAR* szFormat, time_t timestamp, DWORD dwFlags, INT_PTR dwData)
+OptionsCtrlImpl::DateTime::DateTime(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, const wchar_t* szFormat, time_t timestamp, DWORD dwFlags, INT_PTR dwData)
: Item(pCtrl, itDateTime, szLabel, dwFlags, dwData), m_hDateTimeWnd(NULL), m_strFormat(szFormat), m_timestamp(timestamp)
{
m_bDisableChildsOnNone = bool_(dwFlags & OCF_DISABLECHILDSONNONE);
@@ -313,7 +313,7 @@ void OptionsCtrlImpl::DateTime::childAdded(Item* pChild) }
}
-void OptionsCtrlImpl::DateTime::setLabel(const TCHAR* szLabel)
+void OptionsCtrlImpl::DateTime::setLabel(const wchar_t* szLabel)
{
m_strLabel = szLabel;
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_edit.cpp b/plugins/HistoryStats/src/optionsctrlimpl_edit.cpp index ce8a053190..c297fedd16 100644 --- a/plugins/HistoryStats/src/optionsctrlimpl_edit.cpp +++ b/plugins/HistoryStats/src/optionsctrlimpl_edit.cpp @@ -10,7 +10,7 @@ ext::string OptionsCtrlImpl::Edit::getEditText()
{
int nLen = GetWindowTextLength(m_hEditWnd);
- TCHAR* szBuf = new TCHAR[nLen + 1];
+ wchar_t* szBuf = new wchar_t[nLen + 1];
GetWindowText(m_hEditWnd, szBuf, nLen + 1);
@@ -38,7 +38,7 @@ ext::string OptionsCtrlImpl::Edit::getCombinedText() }
}
-OptionsCtrlImpl::Edit::Edit(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, const TCHAR* szEdit, DWORD dwFlags, INT_PTR dwData)
+OptionsCtrlImpl::Edit::Edit(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, const wchar_t* szEdit, DWORD dwFlags, INT_PTR dwData)
: Item(pCtrl, itEdit, szLabel, dwFlags, dwData), m_hEditWnd(NULL)
{
m_strEdit = szEdit;
@@ -154,7 +154,7 @@ void OptionsCtrlImpl::Edit::childAdded(Item* pChild) }
}
-const TCHAR* OptionsCtrlImpl::Edit::getString()
+const wchar_t* OptionsCtrlImpl::Edit::getString()
{
if (m_hEditWnd)
{
@@ -164,7 +164,7 @@ const TCHAR* OptionsCtrlImpl::Edit::getString() return m_strEdit.c_str();
}
-void OptionsCtrlImpl::Edit::setString(const TCHAR* szString)
+void OptionsCtrlImpl::Edit::setString(const wchar_t* szString)
{
m_strEdit = szString;
@@ -178,7 +178,7 @@ void OptionsCtrlImpl::Edit::setString(const TCHAR* szString) }
}
-void OptionsCtrlImpl::Edit::setLabel(const TCHAR* szLabel)
+void OptionsCtrlImpl::Edit::setLabel(const wchar_t* szLabel)
{
m_strLabel = szLabel;
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_group.cpp b/plugins/HistoryStats/src/optionsctrlimpl_group.cpp index b92a88a42d..2d36374668 100644 --- a/plugins/HistoryStats/src/optionsctrlimpl_group.cpp +++ b/plugins/HistoryStats/src/optionsctrlimpl_group.cpp @@ -5,7 +5,7 @@ * OptionsCtrlImpl::Group
*/
-OptionsCtrlImpl::Group::Group(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData)
+OptionsCtrlImpl::Group::Group(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData)
: Item(pCtrl, itGroup, szLabel, dwFlags, dwData)
{
m_bDrawLine = bool_(dwFlags & OCF_DRAWLINE);
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_item.cpp b/plugins/HistoryStats/src/optionsctrlimpl_item.cpp index b628b834a5..2900ce6a44 100644 --- a/plugins/HistoryStats/src/optionsctrlimpl_item.cpp +++ b/plugins/HistoryStats/src/optionsctrlimpl_item.cpp @@ -5,7 +5,7 @@ * OptionsCtrlImpl::Item
*/
-OptionsCtrlImpl::Item::Item(OptionsCtrlImpl* pCtrl, ItemType ItemType, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData) :
+OptionsCtrlImpl::Item::Item(OptionsCtrlImpl* pCtrl, ItemType ItemType, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData) :
m_pCtrl(pCtrl), m_hItem(NULL), m_nRef(1), m_ItemType(ItemType), m_strLabel(szLabel), m_dwData(dwData)
{
m_bEnabled = !(dwFlags & OCF_DISABLED);
@@ -25,7 +25,7 @@ void OptionsCtrlImpl::Item::enableChilds(bool bEnable) }
}
-void OptionsCtrlImpl::Item::setLabel(const TCHAR* szLabel)
+void OptionsCtrlImpl::Item::setLabel(const wchar_t* szLabel)
{
m_strLabel = szLabel;
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_radio.cpp b/plugins/HistoryStats/src/optionsctrlimpl_radio.cpp index f3ee55cb17..a8fc86ae86 100644 --- a/plugins/HistoryStats/src/optionsctrlimpl_radio.cpp +++ b/plugins/HistoryStats/src/optionsctrlimpl_radio.cpp @@ -74,7 +74,7 @@ void OptionsCtrlImpl::Radio::updateItem() }
}
-OptionsCtrlImpl::Radio::Radio(OptionsCtrlImpl* pCtrl, Item* pParent, Radio* pSibling, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData)
+OptionsCtrlImpl::Radio::Radio(OptionsCtrlImpl* pCtrl, Item* pParent, Radio* pSibling, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData)
: Item(pCtrl, itRadio, szLabel, dwFlags, dwData)
{
m_bDisableChildsOnUncheck = bool_(dwFlags & OCF_DISABLECHILDSONUNCHECK);
diff --git a/plugins/HistoryStats/src/settings.cpp b/plugins/HistoryStats/src/settings.cpp index ebd57958c7..34fbf1d640 100644 --- a/plugins/HistoryStats/src/settings.cpp +++ b/plugins/HistoryStats/src/settings.cpp @@ -13,11 +13,11 @@ Settings::CharMapper::CharMapper(const Settings& settings)
{
- static const TCHAR* defaultWordDelimiters = L"\n\r\t";
+ static const wchar_t* defaultWordDelimiters = L"\n\r\t";
array_each_(i, m_CharMap)
{
- m_CharMap[i] = static_cast<TCHAR>(i);
+ m_CharMap[i] = static_cast<wchar_t>(i);
}
LCID lcid = GetUserDefaultLCID();
@@ -63,12 +63,12 @@ Settings::Filter::Filter(const ext::string& strID) * Settings
*/
-const TCHAR* Settings::getDefaultWordDelimiters()
+const wchar_t* Settings::getDefaultWordDelimiters()
{
return L".?!,:;()[]{}<>+-*/=\\_^&\"'~%#@|$";
}
-const TCHAR* Settings::getDefaultStyleSheet()
+const wchar_t* Settings::getDefaultStyleSheet()
{
static ext::string StyleSheet;
@@ -104,17 +104,17 @@ const TCHAR* Settings::getDefaultStyleSheet() return StyleSheet.c_str();
}
-const TCHAR* Settings::getDefaultHideContactMenuProtos()
+const wchar_t* Settings::getDefaultHideContactMenuProtos()
{
return L"{num:0;}";
}
-const TCHAR* Settings::getDefaultProtosIgnore()
+const wchar_t* Settings::getDefaultProtosIgnore()
{
return L"{num:0;}";
}
-const TCHAR* Settings::getDefaultColumns()
+const wchar_t* Settings::getDefaultColumns()
{
return
L"{num:11;}"
@@ -131,7 +131,7 @@ const TCHAR* Settings::getDefaultColumns() L"10{enabled:y;guid:split;}10/data{block_unit:0;blocks:28;detail:y;graph_align:1;source:0;source_type:2;units_per_block:6;vis_mode:0;}";
}
-const TCHAR* Settings::getDefaultSort()
+const wchar_t* Settings::getDefaultSort()
{
return
L"0{by:17;asc:n}"
@@ -139,17 +139,17 @@ const TCHAR* Settings::getDefaultSort() L"2{by:-1;asc:y}";
}
-const TCHAR* Settings::getDefaultOutputFile()
+const wchar_t* Settings::getDefaultOutputFile()
{
return L"HistoryStats\\stats.html";
}
-const TCHAR* Settings::getDefaultOutputExtraFolder()
+const wchar_t* Settings::getDefaultOutputExtraFolder()
{
return L"extra";
}
-const TCHAR* Settings::getDefaultFilterWords()
+const wchar_t* Settings::getDefaultFilterWords()
{
return L"{num:0;}";
}
@@ -566,7 +566,7 @@ void Settings::ensureConstraints() utils::ensureRange(m_TableHeaderRepeat, 0, 1000, 0);
}
-void Settings::openURL(const TCHAR* szURL)
+void Settings::openURL(const wchar_t* szURL)
{
if (m_PathToBrowser.empty())
ShellExecute(NULL, L"open", szURL, NULL, NULL, SW_SHOWNORMAL);
diff --git a/plugins/HistoryStats/src/settings.h b/plugins/HistoryStats/src/settings.h index 2c91882230..77cafca6e7 100644 --- a/plugins/HistoryStats/src/settings.h +++ b/plugins/HistoryStats/src/settings.h @@ -138,16 +138,16 @@ public: #else // _UNICODE
typedef unsigned char t_uchar;
#endif // _UNICODE
-#define T_NUMCHARS (1 << (sizeof(TCHAR) * 8))
+#define T_NUMCHARS (1 << (sizeof(wchar_t) * 8))
private:
- TCHAR m_CharMap[T_NUMCHARS];
+ wchar_t m_CharMap[T_NUMCHARS];
#undef T_NUMCHARS
public:
explicit CharMapper(const Settings& settings);
- TCHAR mapChar(TCHAR c) const { return m_CharMap[static_cast<t_uchar>(c)]; }
+ wchar_t mapChar(wchar_t c) const { return m_CharMap[static_cast<t_uchar>(c)]; }
};
typedef std::set<ext::string> WordSet;
@@ -193,15 +193,15 @@ public: typedef std::vector<Column*> ColumnList;
public:
- static const TCHAR* getDefaultWordDelimiters();
- static const TCHAR* getDefaultStyleSheet();
- static const TCHAR* getDefaultHideContactMenuProtos();
- static const TCHAR* getDefaultProtosIgnore();
- static const TCHAR* getDefaultColumns();
- static const TCHAR* getDefaultSort();
- static const TCHAR* getDefaultOutputFile();
- static const TCHAR* getDefaultOutputExtraFolder();
- static const TCHAR* getDefaultFilterWords();
+ static const wchar_t* getDefaultWordDelimiters();
+ static const wchar_t* getDefaultStyleSheet();
+ static const wchar_t* getDefaultHideContactMenuProtos();
+ static const wchar_t* getDefaultProtosIgnore();
+ static const wchar_t* getDefaultColumns();
+ static const wchar_t* getDefaultSort();
+ static const wchar_t* getDefaultOutputFile();
+ static const wchar_t* getDefaultOutputExtraFolder();
+ static const wchar_t* getDefaultFilterWords();
public:
const DWORD m_VersionCurrent;
@@ -305,7 +305,7 @@ public: void ensureConstraints();
- void openURL(const TCHAR* szURL);
+ void openURL(const wchar_t* szURL);
};
#endif // HISTORYSTATS_GUARD_SETTINGS_H
diff --git a/plugins/HistoryStats/src/settingsserializer.cpp b/plugins/HistoryStats/src/settingsserializer.cpp index 0610fcf5e8..1c295460e9 100644 --- a/plugins/HistoryStats/src/settingsserializer.cpp +++ b/plugins/HistoryStats/src/settingsserializer.cpp @@ -484,7 +484,7 @@ ext::string SettingsSerializer::getLastStatisticsFile() return m_DB.readStr(con::SettLastStatisticsFile, L"");
}
-void SettingsSerializer::setLastStatisticsFile(const TCHAR* szFileName)
+void SettingsSerializer::setLastStatisticsFile(const wchar_t* szFileName)
{
m_DB.writeStr(con::SettLastStatisticsFile, szFileName);
}
diff --git a/plugins/HistoryStats/src/settingsserializer.h b/plugins/HistoryStats/src/settingsserializer.h index 6f967f20ca..88bd9e1c6d 100644 --- a/plugins/HistoryStats/src/settingsserializer.h +++ b/plugins/HistoryStats/src/settingsserializer.h @@ -33,7 +33,7 @@ public: void setShowSupportInfo(bool bShow);
ext::string getLastStatisticsFile();
- void setLastStatisticsFile(const TCHAR* szFileName);
+ void setLastStatisticsFile(const wchar_t* szFileName);
bool canShowStatistics();
void showStatistics();
};
diff --git a/plugins/HistoryStats/src/settingstree.cpp b/plugins/HistoryStats/src/settingstree.cpp index 2e8ab0a0a4..a73ef0f442 100644 --- a/plugins/HistoryStats/src/settingstree.cpp +++ b/plugins/HistoryStats/src/settingstree.cpp @@ -74,7 +74,7 @@ void SettingsTree::fromString(const ext::string& config) ext::string SettingsTree::toString() const
{
- static const TCHAR* replaces[5][2] = {
+ static const wchar_t* replaces[5][2] = {
{ L"\\", L"\\\\" },
{ L"{", L"\\{" },
{ L"}", L"\\}" },
@@ -113,7 +113,7 @@ ext::string SettingsTree::toString() const return data;
}
-void SettingsTree::setKey(const TCHAR* key)
+void SettingsTree::setKey(const wchar_t* key)
{
m_CurKey = key;
@@ -125,7 +125,7 @@ void SettingsTree::setKey(const TCHAR* key) m_pCurValues = NULL;
}
-bool SettingsTree::readBool(const TCHAR* setting, bool errorValue) const
+bool SettingsTree::readBool(const wchar_t* setting, bool errorValue) const
{
if (m_pCurValues) {
ValueMap::iterator i = m_pCurValues->find(setting);
@@ -138,19 +138,19 @@ bool SettingsTree::readBool(const TCHAR* setting, bool errorValue) const return errorValue;
}
-int SettingsTree::readInt(const TCHAR* setting, int errorValue) const
+int SettingsTree::readInt(const wchar_t* setting, int errorValue) const
{
if (m_pCurValues) {
ValueMap::iterator i = m_pCurValues->find(setting);
if (i != m_pCurValues->end())
- return _ttoi(i->second.c_str());
+ return _wtoi(i->second.c_str());
}
return errorValue;
}
-int SettingsTree::readIntRanged(const TCHAR* setting, int errorValue, int minValue, int maxValue) const
+int SettingsTree::readIntRanged(const wchar_t* setting, int errorValue, int minValue, int maxValue) const
{
int value = readInt(setting, errorValue);
if (minValue <= value && value <= maxValue)
@@ -159,7 +159,7 @@ int SettingsTree::readIntRanged(const TCHAR* setting, int errorValue, int minVal return errorValue;
}
-ext::string SettingsTree::readStr(const TCHAR* setting, const TCHAR* errorValue) const
+ext::string SettingsTree::readStr(const wchar_t* setting, const wchar_t* errorValue) const
{
if (m_pCurValues) {
ValueMap::iterator i = m_pCurValues->find(setting);
@@ -171,28 +171,28 @@ ext::string SettingsTree::readStr(const TCHAR* setting, const TCHAR* errorValue) return errorValue;
}
-void SettingsTree::writeBool(const TCHAR* setting, bool value)
+void SettingsTree::writeBool(const wchar_t* setting, bool value)
{
makeKeyValid();
(*m_pCurValues)[setting] = value ? L"y" : L"n";
}
-void SettingsTree::writeInt(const TCHAR* setting, int value)
+void SettingsTree::writeInt(const wchar_t* setting, int value)
{
makeKeyValid();
(*m_pCurValues)[setting] = utils::intToString(value);
}
-void SettingsTree::writeStr(const TCHAR* setting, const TCHAR* value)
+void SettingsTree::writeStr(const wchar_t* setting, const wchar_t* value)
{
makeKeyValid();
(*m_pCurValues)[setting] = value;
}
-bool SettingsTree::hasSetting(const TCHAR* setting) const
+bool SettingsTree::hasSetting(const wchar_t* setting) const
{
if (m_pCurValues) {
ValueMap::const_iterator i = m_pCurValues->find(setting);
@@ -203,7 +203,7 @@ bool SettingsTree::hasSetting(const TCHAR* setting) const return false;
}
-bool SettingsTree::delSetting(const TCHAR* setting)
+bool SettingsTree::delSetting(const wchar_t* setting)
{
if (m_pCurValues) {
ValueMap::iterator i = m_pCurValues->find(setting);
diff --git a/plugins/HistoryStats/src/settingstree.h b/plugins/HistoryStats/src/settingstree.h index c96261390b..f8c471e340 100644 --- a/plugins/HistoryStats/src/settingstree.h +++ b/plugins/HistoryStats/src/settingstree.h @@ -30,20 +30,20 @@ public: void fromString(const ext::string& config);
ext::string toString() const;
- void setKey(const TCHAR* key);
+ void setKey(const wchar_t* key);
const ext::string& getKey() const { return m_CurKey; }
- bool readBool(const TCHAR* setting, bool errorValue) const;
- int readInt(const TCHAR* setting, int errorValue) const;
- int readIntRanged(const TCHAR* setting, int errorValue, int minValue, int maxValue) const;
- ext::string readStr(const TCHAR* setting, const TCHAR* errorValue) const;
+ bool readBool(const wchar_t* setting, bool errorValue) const;
+ int readInt(const wchar_t* setting, int errorValue) const;
+ int readIntRanged(const wchar_t* setting, int errorValue, int minValue, int maxValue) const;
+ ext::string readStr(const wchar_t* setting, const wchar_t* errorValue) const;
- void writeBool(const TCHAR* setting, bool value);
- void writeInt(const TCHAR* setting, int value);
- void writeStr(const TCHAR* setting, const TCHAR* value);
+ void writeBool(const wchar_t* setting, bool value);
+ void writeInt(const wchar_t* setting, int value);
+ void writeStr(const wchar_t* setting, const wchar_t* value);
- bool hasSetting(const TCHAR* setting) const;
- bool delSetting(const TCHAR* setting);
+ bool hasSetting(const wchar_t* setting) const;
+ bool delSetting(const wchar_t* setting);
};
#endif // HISTORYSTATS_GUARD_SETTINGSTREE_H
\ No newline at end of file diff --git a/plugins/HistoryStats/src/statistic.cpp b/plugins/HistoryStats/src/statistic.cpp index 0f66d31c62..0d9b1deea9 100644 --- a/plugins/HistoryStats/src/statistic.cpp +++ b/plugins/HistoryStats/src/statistic.cpp @@ -193,7 +193,7 @@ DWORD Statistic::getHistoryTime() ext::string Statistic::createFile(const ext::string& desiredName)
{
if (!m_Settings.m_OverwriteAlways && utils::fileExists(desiredName)) {
- TCHAR tempBuf[MAX_PATH];
+ wchar_t tempBuf[MAX_PATH];
UINT nUnique = GetTempFileName(m_TempPath.c_str(), L"his", 0, tempBuf);
@@ -220,7 +220,7 @@ ext::string Statistic::createFile(const ext::string& desiredName) return desiredName;
}
-bool Statistic::newFile(const TCHAR* fileExt, ext::string& writeFile, ext::string& finalURL)
+bool Statistic::newFile(const wchar_t* fileExt, ext::string& writeFile, ext::string& finalURL)
{
++m_nLastFileNr;
@@ -352,7 +352,7 @@ void Statistic::stepProgress(bool bSub, int step /* = 1 */) bool Statistic::stepInit()
{
// file management
- TCHAR tempPath[MAX_PATH];
+ wchar_t tempPath[MAX_PATH];
int nRes = GetTempPath(MAX_PATH, tempPath);
if (nRes > 0) {
@@ -1333,19 +1333,19 @@ bool Statistic::createStatisticsSteps() static const struct
{
bool (Statistic::*stepFn)();
- TCHAR* stepMsg;
+ wchar_t* stepMsg;
}
stepsInfo[] = {
- { &Statistic::stepInit, LPGENT("Initializing") },
- { &Statistic::stepReadDB, LPGENT("Reading database") },
- { &Statistic::stepRemoveContacts, LPGENT("Removing contacts") },
- { &Statistic::stepSortContacts, LPGENT("Sorting contacts") },
- { &Statistic::stepPreOmitContacts, LPGENT("Precollecting column data") },
- { &Statistic::stepOmitContacts, LPGENT("Limiting number of contacts") },
- { &Statistic::stepCalcTotals, LPGENT("Calculating totals") },
- { &Statistic::stepPostOmitContacts, LPGENT("Postcollecting column data") },
- { &Statistic::stepTransformData, LPGENT("Transforming data") },
- { &Statistic::stepWriteHTML, LPGENT("Creating HTML") }
+ { &Statistic::stepInit, LPGENW("Initializing") },
+ { &Statistic::stepReadDB, LPGENW("Reading database") },
+ { &Statistic::stepRemoveContacts, LPGENW("Removing contacts") },
+ { &Statistic::stepSortContacts, LPGENW("Sorting contacts") },
+ { &Statistic::stepPreOmitContacts, LPGENW("Precollecting column data") },
+ { &Statistic::stepOmitContacts, LPGENW("Limiting number of contacts") },
+ { &Statistic::stepCalcTotals, LPGENW("Calculating totals") },
+ { &Statistic::stepPostOmitContacts, LPGENW("Postcollecting column data") },
+ { &Statistic::stepTransformData, LPGENW("Transforming data") },
+ { &Statistic::stepWriteHTML, LPGENW("Creating HTML") }
};
setProgressMax(false, _countof(stepsInfo));
@@ -1414,7 +1414,7 @@ INT_PTR CALLBACK Statistic::staticConflictProc(HWND hDlg, UINT uMsg, WPARAM wPar lvc.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_FMT;
lvc.fmt = LVCFMT_LEFT;
lvc.cx = 400;
- lvc.pszText = const_cast<TCHAR*>(TranslateT("Already existing file"));
+ lvc.pszText = const_cast<wchar_t*>(TranslateT("Already existing file"));
ListView_InsertColumn(hWndFiles, 0, &lvc);
int nIndex = 0;
@@ -1425,7 +1425,7 @@ INT_PTR CALLBACK Statistic::staticConflictProc(HWND hDlg, UINT uMsg, WPARAM wPar lvi.mask = LVIF_TEXT;
lvi.iItem = nIndex++;
lvi.iSubItem = 0;
- lvi.pszText = const_cast<TCHAR*>(fi->first.c_str());
+ lvi.pszText = const_cast<wchar_t*>(fi->first.c_str());
ListView_InsertItem(hWndFiles, &lvi);
}
}
diff --git a/plugins/HistoryStats/src/statistic.h b/plugins/HistoryStats/src/statistic.h index 07b502b200..93f3d729bf 100644 --- a/plugins/HistoryStats/src/statistic.h +++ b/plugins/HistoryStats/src/statistic.h @@ -182,7 +182,7 @@ public: // file management
ext::string createFile(const ext::string& desiredName);
- bool newFile(const TCHAR* fileExt, ext::string& writeFile, ext::string& finalURL);
+ bool newFile(const wchar_t* fileExt, ext::string& writeFile, ext::string& finalURL);
bool newFilePNG(ext::string& writeFile, ext::string& finalURL) { return newFile(L".png", writeFile, finalURL); }
bool newFilePNG(Canvas& canvas, ext::string& finalURL);
};
diff --git a/plugins/HistoryStats/src/stdafx.h b/plugins/HistoryStats/src/stdafx.h index 8646a67c1e..d4fcfc6f6b 100644 --- a/plugins/HistoryStats/src/stdafx.h +++ b/plugins/HistoryStats/src/stdafx.h @@ -19,7 +19,6 @@ #pragma comment(lib, "UxTheme.lib")
-#include <tchar.h>
#include <stdio.h>
#include <cstdio>
diff --git a/plugins/HistoryStats/src/utf8buffer.h b/plugins/HistoryStats/src/utf8buffer.h index e4727afc30..56342adbf7 100644 --- a/plugins/HistoryStats/src/utf8buffer.h +++ b/plugins/HistoryStats/src/utf8buffer.h @@ -5,15 +5,15 @@ #include <string>
class UTF8Buffer
- : public std::basic_streambuf<TCHAR, std::char_traits<TCHAR> >
+ : public std::basic_streambuf<wchar_t, std::char_traits<wchar_t> >
, private pattern::NotCopyable<UTF8Buffer>
{
private:
- typedef std::char_traits<TCHAR> _Tr;
+ typedef std::char_traits<wchar_t> _Tr;
private:
int m_BufSize;
- TCHAR* m_pBuf;
+ wchar_t* m_pBuf;
ext::a::ostream& m_Stream;
char* m_pUTF8Buf;
WCHAR* m_pBufW;
@@ -23,7 +23,7 @@ private: #endif // _UNICODE
private:
- void dump(const TCHAR* pBegin, const TCHAR* pEnd)
+ void dump(const wchar_t* pBegin, const wchar_t* pEnd)
{
size_t len = pEnd - pBegin;
@@ -81,7 +81,7 @@ public: explicit UTF8Buffer(ext::a::ostream& outStream, int bufferSize = 4096)
: m_BufSize(bufferSize), m_Stream(outStream)
{
- m_pBuf = new TCHAR[m_BufSize];
+ m_pBuf = new wchar_t[m_BufSize];
m_pUTF8Buf = new char[3 * m_BufSize];
#if defined(_UNICODE)
diff --git a/plugins/HistoryStats/src/utils.cpp b/plugins/HistoryStats/src/utils.cpp index 91dedaf163..b70ee4630e 100644 --- a/plugins/HistoryStats/src/utils.cpp +++ b/plugins/HistoryStats/src/utils.cpp @@ -12,23 +12,23 @@ namespace utils
{
- ext::string timestampToString(time_t value, const TCHAR* format)
+ ext::string timestampToString(time_t value, const wchar_t* format)
{
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
return (ext::strfunc::ftime(temp, 100, format, gmtime(&value)) > 0) ? temp : L"";
}
- ext::string tmStructToString(const tm& value, const TCHAR* format)
+ ext::string tmStructToString(const tm& value, const wchar_t* format)
{
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
return (ext::strfunc::ftime(temp, 100, format, &value) > 0) ? temp : L"";
}
ext::string durationToString(DWORD value)
{
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
value += 59;
value /= 60;
@@ -48,9 +48,9 @@ namespace utils struct tm dateTM;
- dateTM.tm_year = _ttoi(date.c_str() + 0) - 1900;
- dateTM.tm_mon = _ttoi(date.c_str() + 5) - 1;
- dateTM.tm_mday = _ttoi(date.c_str() + 8);
+ dateTM.tm_year = _wtoi(date.c_str() + 0) - 1900;
+ dateTM.tm_mon = _wtoi(date.c_str() + 5) - 1;
+ dateTM.tm_mday = _wtoi(date.c_str() + 8);
dateTM.tm_hour = dateTM.tm_min = dateTM.tm_sec = 0;
dateTM.tm_isdst = dateTM.tm_wday = dateTM.tm_yday = 0;
@@ -75,7 +75,7 @@ namespace utils ext::string intToString(int value)
{
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
ext::strfunc::sprintf(temp, L"%d", value);
@@ -84,7 +84,7 @@ namespace utils ext::string intToPadded(int value, int len)
{
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
ext::strfunc::sprintf(temp, L"%0*d", len, value);
@@ -93,7 +93,7 @@ namespace utils ext::string intToGrouped(int value)
{
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
const char* grouping = Locale::grouping();
ext::strfunc::sprintf(temp, L"%d", value);
@@ -117,7 +117,7 @@ namespace utils ext::string floatToString(double value, int precision)
{
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
ext::strfunc::sprintf(temp, L"%.*f", precision, value);
@@ -126,7 +126,7 @@ namespace utils ext::string floatToGrouped(double value, int precision)
{
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
const char* grouping = Locale::grouping();
ext::strfunc::sprintf(temp, L"%.*f", precision, value);
@@ -154,7 +154,7 @@ namespace utils ext::string ratioToPercent(int numerator, int denominator)
{
float value = 0.0;
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
if (denominator != 0) {
value = 1.0f * numerator / denominator;
@@ -165,7 +165,7 @@ namespace utils return temp;
}
- void replaceAllInPlace(ext::string& text, const TCHAR* find, const TCHAR* replace)
+ void replaceAllInPlace(ext::string& text, const wchar_t* find, const wchar_t* replace)
{
ext::string::size_type pos = 0;
ext::string::size_type find_len = ext::strfunc::len(find);
@@ -186,7 +186,7 @@ namespace utils replaceAllInPlace(text, L">", L">");
}
- const TCHAR* stripPrefix(const TCHAR* szPrefix, const TCHAR* szText)
+ const wchar_t* stripPrefix(const wchar_t* szPrefix, const wchar_t* szText)
{
int i = 0;
@@ -199,31 +199,31 @@ namespace utils return szText;
}
- ext::string replaceVariables(const ext::string& strFormat, time_t timeValue, const TCHAR* szNick /* = L"" */)
+ ext::string replaceVariables(const ext::string& strFormat, time_t timeValue, const wchar_t* szNick /* = L"" */)
{
- static const TCHAR* szMonthName[][2] = {
- { LPGENT("month3:Jan"), LPGENT("monthF:January") },
- { LPGENT("month3:Feb"), LPGENT("monthF:February") },
- { LPGENT("month3:Mar"), LPGENT("monthF:March") },
- { LPGENT("month3:Apr"), LPGENT("monthF:April") },
- { LPGENT("month3:May"), LPGENT("monthF:May") },
- { LPGENT("month3:Jun"), LPGENT("monthF:June") },
- { LPGENT("month3:Jul"), LPGENT("monthF:July") },
- { LPGENT("month3:Aug"), LPGENT("monthF:August") },
- { LPGENT("month3:Sep"), LPGENT("monthF:September") },
- { LPGENT("month3:Oct"), LPGENT("monthF:October") },
- { LPGENT("month3:Nov"), LPGENT("monthF:November") },
- { LPGENT("month3:Dec"), LPGENT("monthF:December") },
+ static const wchar_t* szMonthName[][2] = {
+ { LPGENW("month3:Jan"), LPGENW("monthF:January") },
+ { LPGENW("month3:Feb"), LPGENW("monthF:February") },
+ { LPGENW("month3:Mar"), LPGENW("monthF:March") },
+ { LPGENW("month3:Apr"), LPGENW("monthF:April") },
+ { LPGENW("month3:May"), LPGENW("monthF:May") },
+ { LPGENW("month3:Jun"), LPGENW("monthF:June") },
+ { LPGENW("month3:Jul"), LPGENW("monthF:July") },
+ { LPGENW("month3:Aug"), LPGENW("monthF:August") },
+ { LPGENW("month3:Sep"), LPGENW("monthF:September") },
+ { LPGENW("month3:Oct"), LPGENW("monthF:October") },
+ { LPGENW("month3:Nov"), LPGENW("monthF:November") },
+ { LPGENW("month3:Dec"), LPGENW("monthF:December") },
};
- static const TCHAR* szWDayName[][3] = {
- { LPGENT("wday2:Mo"), LPGENT("wday3:Mon"), LPGENT("wdayF:Monday") },
- { LPGENT("wday2:Tu"), LPGENT("wday3:Tue"), LPGENT("wdayF:Tuesday") },
- { LPGENT("wday2:We"), LPGENT("wday3:Wed"), LPGENT("wdayF:Wednesday") },
- { LPGENT("wday2:Th"), LPGENT("wday3:Thu"), LPGENT("wdayF:Thursday") },
- { LPGENT("wday2:Fr"), LPGENT("wday3:Fri"), LPGENT("wdayF:Friday") },
- { LPGENT("wday2:Sa"), LPGENT("wday3:Sat"), LPGENT("wdayF:Saturday") },
- { LPGENT("wday2:Su"), LPGENT("wday3:Sun"), LPGENT("wdayF:Sunday") },
+ static const wchar_t* szWDayName[][3] = {
+ { LPGENW("wday2:Mo"), LPGENW("wday3:Mon"), LPGENW("wdayF:Monday") },
+ { LPGENW("wday2:Tu"), LPGENW("wday3:Tue"), LPGENW("wdayF:Tuesday") },
+ { LPGENW("wday2:We"), LPGENW("wday3:Wed"), LPGENW("wdayF:Wednesday") },
+ { LPGENW("wday2:Th"), LPGENW("wday3:Thu"), LPGENW("wdayF:Thursday") },
+ { LPGENW("wday2:Fr"), LPGENW("wday3:Fri"), LPGENW("wdayF:Friday") },
+ { LPGENW("wday2:Sa"), LPGENW("wday3:Sat"), LPGENW("wdayF:Saturday") },
+ { LPGENW("wday2:Su"), LPGENW("wday3:Sun"), LPGENW("wdayF:Sunday") },
};
struct tm* timeTM = gmtime(&timeValue);
@@ -337,7 +337,7 @@ namespace utils ext::string toLowerCase(const ext::string& text)
{
int len = text.length();
- TCHAR* buf = new TCHAR[len + 1];
+ wchar_t* buf = new wchar_t[len + 1];
LCID lcid = GetUserDefaultLCID();
@@ -355,7 +355,7 @@ namespace utils ext::string toUpperCase(const ext::string& text)
{
int len = text.length();
- TCHAR* buf = new TCHAR[len + 1];
+ wchar_t* buf = new wchar_t[len + 1];
LCID lcid = GetUserDefaultLCID();
@@ -387,7 +387,7 @@ namespace utils dotPos = version.length();
}
- res.parts[part--] = _ttoi(version.substr(0, dotPos).c_str());
+ res.parts[part--] = _wtoi(version.substr(0, dotPos).c_str());
version.erase(0, dotPos + 1);
}
@@ -397,7 +397,7 @@ namespace utils ext::string versionToDotted(DWORD version)
{
- TCHAR temp[16] = { 0 };
+ wchar_t temp[16] = { 0 };
ext::strfunc::sprintf(
temp,
@@ -440,7 +440,7 @@ namespace utils return ret_str;
}
- ext::a::string convertTToUTF8(const TCHAR* str, size_t str_len)
+ ext::a::string convertTToUTF8(const wchar_t* str, size_t str_len)
{
#if defined(_UNICODE)
const WCHAR* conv_str = str;
@@ -649,7 +649,7 @@ namespace utils return false;
// check for disallowed names
- static const TCHAR* disallowedNames[] = {
+ static const wchar_t* disallowedNames[] = {
L"clock$",
L"aux",
L"con",
@@ -776,7 +776,7 @@ namespace utils ext::string colorToHTML(COLORREF crColor)
{
- static const TCHAR hexDigits[] = L"0123456789ABCDEF";
+ static const wchar_t hexDigits[] = L"0123456789ABCDEF";
ext::string htmlColor(7, '#');
@@ -823,7 +823,7 @@ namespace utils ext::string getGUID()
{
- static const TCHAR hexDigits[] = L"0123456789ABCDEF";
+ static const wchar_t hexDigits[] = L"0123456789ABCDEF";
GUID guid;
CoCreateGuid(&guid);
@@ -893,7 +893,7 @@ namespace utils static ext::string strMirandaPath;
if (strMirandaPath.empty()) {
- TCHAR szPath[MAX_PATH] = { 0 };
+ wchar_t szPath[MAX_PATH] = { 0 };
PathToAbsoluteT(L"x", szPath);
strMirandaPath = extractPath(szPath);
@@ -907,7 +907,7 @@ namespace utils static ext::string strProfilePath;
if (strProfilePath.empty()) {
- TCHAR szPath[MAX_PATH] = { 0 };
+ wchar_t szPath[MAX_PATH] = { 0 };
mu::db::getProfilePath(MAX_PATH, szPath);
strProfilePath = szPath;
@@ -926,7 +926,7 @@ namespace utils static ext::string strProfileName;
if (strProfileName.empty()) {
- TCHAR szName[MAX_PATH] = { 0 };
+ wchar_t szName[MAX_PATH] = { 0 };
mu::db::getProfileName(MAX_PATH, szName);
strProfileName = szName;
@@ -1031,7 +1031,7 @@ ext::t::string RTFFilter::filter(const ext::t::string& str) return str;
}
- TCHAR* out_buf = new TCHAR[len / sizeof(TCHAR)];
+ wchar_t* out_buf = new wchar_t[len / sizeof(wchar_t)];
intptr_t res = m_Data.m_RTFConvString(
strA.c_str(),
@@ -1048,7 +1048,7 @@ ext::t::string RTFFilter::filter(const ext::t::string& str) return str;
}
- ext::t::string out_str(out_buf, res / sizeof(TCHAR)-1);
+ ext::t::string out_str(out_buf, res / sizeof(wchar_t)-1);
delete[] out_buf;
return out_str;
diff --git a/plugins/HistoryStats/src/utils.h b/plugins/HistoryStats/src/utils.h index 834b154ccb..884b1c7302 100644 --- a/plugins/HistoryStats/src/utils.h +++ b/plugins/HistoryStats/src/utils.h @@ -7,8 +7,8 @@ namespace utils
{
// time formatting
- ext::string timestampToString(time_t value, const TCHAR* format);
- ext::string tmStructToString(const tm& value, const TCHAR* format);
+ ext::string timestampToString(time_t value, const wchar_t* format);
+ ext::string tmStructToString(const tm& value, const wchar_t* format);
inline ext::string timestampToDateTime(DWORD value) { return timestampToString(value, L"%c"); }
inline ext::string timestampToDate(DWORD value) { return timestampToString(value, L"%x"); }
inline ext::string timestampToTime(DWORD value) { return timestampToString(value, L"%X"); }
@@ -27,12 +27,12 @@ namespace utils ext::string ratioToPercent(int numerator, int denominator);
// text conversion
- void replaceAllInPlace(ext::string& text, const TCHAR* find, const TCHAR* replace);
+ void replaceAllInPlace(ext::string& text, const wchar_t* find, const wchar_t* replace);
void htmlEscapeInPlace(ext::string& text);
- inline ext::string replaceAll(ext::string text, const TCHAR* find, const TCHAR* replace) { replaceAllInPlace(text, find, replace); return text; }
+ inline ext::string replaceAll(ext::string text, const wchar_t* find, const wchar_t* replace) { replaceAllInPlace(text, find, replace); return text; }
inline ext::string htmlEscape(ext::string text) { htmlEscapeInPlace(text); return text; }
- const TCHAR* stripPrefix(const TCHAR* szPrefix, const TCHAR* szText);
- ext::string replaceVariables(const ext::string& strFormat, time_t timeValue, const TCHAR* szNick = L"");
+ const wchar_t* stripPrefix(const wchar_t* szPrefix, const wchar_t* szText);
+ ext::string replaceVariables(const ext::string& strFormat, time_t timeValue, const wchar_t* szNick = L"");
// case conversion
ext::string toLowerCase(const ext::string& text);
@@ -45,21 +45,21 @@ namespace utils // character conversion (wide, ansi, utf8)
ext::a::string convertWToA(const WCHAR* str, size_t len);
ext::w::string convertAToW(const char* str, size_t len);
- ext::a::string convertTToUTF8(const TCHAR* str, size_t str_len);
+ ext::a::string convertTToUTF8(const wchar_t* str, size_t str_len);
ext::string convertUTF8ToT(const char* str, size_t str_len);
size_t rawUTF8Encode(const WCHAR* pIn, size_t lenIn, char* pOut);
size_t getUTF8Len(const char* str);
// character conversion (convenience functions)
- inline ext::a::string toA(const TCHAR* str) { return convertWToA(str, ext::strfunc::len(str)); }
- inline ext::w::string toW(const TCHAR* str) { return str; }
+ inline ext::a::string toA(const wchar_t* str) { return convertWToA(str, ext::strfunc::len(str)); }
+ inline ext::w::string toW(const wchar_t* str) { return str; }
inline ext::string fromA(const char* str) { return convertAToW(str, ext::a::strfunc::len(str)); }
inline ext::string fromW(const WCHAR* str) { return str; }
inline ext::a::string toA(const ext::string& str) { return convertWToA(str.c_str(), str.length()); }
inline ext::w::string toW(const ext::string& str) { return str; }
inline ext::string fromA(const ext::a::string& str) { return convertAToW(str.c_str(), str.length()); }
inline ext::string fromW(const ext::w::string& str) { return str; }
- inline ext::a::string toUTF8(const TCHAR* str) { return convertTToUTF8(str, ext::strfunc::len(str)); }
+ inline ext::a::string toUTF8(const wchar_t* str) { return convertTToUTF8(str, ext::strfunc::len(str)); }
inline ext::string fromUTF8(const char* str) { return convertUTF8ToT(str, ext::a::strfunc::len(str)); }
inline ext::a::string toUTF8(const ext::string& str) { return convertTToUTF8(str.c_str(), str.length()); }
inline ext::string fromUTF8(const ext::a::string& str) { return convertUTF8ToT(str.c_str(), str.length()); }
@@ -133,8 +133,8 @@ class Locale : private pattern::NotCopyable<Locale>
{
private:
- TCHAR m_DecimalPoint;
- TCHAR m_ThousandSep;
+ wchar_t m_DecimalPoint;
+ wchar_t m_ThousandSep;
ext::a::string m_Grouping;
private:
@@ -145,8 +145,8 @@ private: public:
static void init();
- static TCHAR decimalPoint() { return m_Data.m_DecimalPoint; }
- static TCHAR thousandSep() { return m_Data.m_ThousandSep; }
+ static wchar_t decimalPoint() { return m_Data.m_DecimalPoint; }
+ static wchar_t thousandSep() { return m_Data.m_ThousandSep; }
static const char* grouping() { return m_Data.m_Grouping.c_str(); }
};
diff --git a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp index 677cb1ff89..30c64f0d74 100644 --- a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp +++ b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp @@ -130,8 +130,8 @@ int initializeOptions(WPARAM wParam, LPARAM) OptDlgPg.hInstance = hInstance;
OptDlgPg.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
OptDlgPg.pszTemplate = MAKEINTRESOURCEA(dlg_options);
- OptDlgPg.ptszGroup = LPGENT("Customize");
- OptDlgPg.ptszTitle = LPGENT("Hardware HotKeys");
+ OptDlgPg.pwszGroup = LPGENW("Customize");
+ OptDlgPg.pwszTitle = LPGENW("Hardware HotKeys");
OptDlgPg.pfnDlgProc = OptDlgProc;
OptDlgPg.hLangpack = hLangpack;
Options_AddPage(wParam, &OptDlgPg);
diff --git a/plugins/IEHistory/src/IEHistory.cpp b/plugins/IEHistory/src/IEHistory.cpp index 6f0e9667ea..5a0460db92 100644 --- a/plugins/IEHistory/src/IEHistory.cpp +++ b/plugins/IEHistory/src/IEHistory.cpp @@ -77,7 +77,7 @@ extern "C" int __declspec(dllexport) Load(void) /// menu items CMenuItem mi; SET_UID(mi, 0x28848d7a, 0x6995, 0x4799, 0x82, 0xd7, 0x18, 0x40, 0x3d, 0xe3, 0x71, 0xc4); - mi.name.t = LPGENT("View &history"); + mi.name.w = LPGENW("View &history"); mi.flags = CMIF_TCHAR; mi.position = 1000090000; mi.hIcolibItem = hIcon; @@ -86,7 +86,7 @@ extern "C" int __declspec(dllexport) Load(void) /// @todo (White-Tiger#1#08/19/14): fully implement System History someday^^ SET_UID(mi, 0xfcb4bb2a, 0xd4d8, 0x48ab, 0x94, 0xcc, 0x5b, 0xe9, 0x8d, 0x53, 0x3e, 0xf1); - mi.name.t = LPGENT("&System History"); + mi.name.w = LPGENW("&System History"); Menu_AddMainMenuItem(&mi); HookEvents(); diff --git a/plugins/IEHistory/src/dlgHandlers.cpp b/plugins/IEHistory/src/dlgHandlers.cpp index 836599dd8e..a56e975015 100644 --- a/plugins/IEHistory/src/dlgHandlers.cpp +++ b/plugins/IEHistory/src/dlgHandlers.cpp @@ -69,8 +69,8 @@ void LoadName(HWND hWnd) SetWindowText(hWnd, TranslateT("System History"));
return;
}
- TCHAR *szOther = GetContactName(data->contact);
- TCHAR buffer[1024];
+ wchar_t *szOther = GetContactName(data->contact);
+ wchar_t buffer[1024];
sntprintf(buffer, 1024, L"'%s' - IEHistory", szOther);
SetWindowText(hWnd, buffer);
mir_free(szOther);
@@ -227,7 +227,7 @@ int DoLoadEvents(HWND hWnd, HistoryWindowData *data, IEVIEWEVENT ieEvent) CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&ieEvent);
ScrollToBottom(hWnd);
- TCHAR buffer[256];
+ wchar_t buffer[256];
itot(data->index + 1, buffer, 10);
SendDlgItemMessage(hWnd, IDC_STATUSBAR, SB_SETTEXT, 0 | SBT_POPOUT, (LPARAM)buffer);
itot(data->index + ieEvent.count, buffer, 10);
@@ -501,7 +501,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara CheckDlgButton(hWnd, IDC_SHOW_LAST_FIRST, db_get_b(NULL, ModuleName, "ShowLastPageFirst", 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_LOAD_BACKGROUND, db_get_b(NULL, ModuleName, "UseWorkerThread", 0) ? BST_CHECKED : BST_UNCHECKED);
- TCHAR buffer[40];
+ wchar_t buffer[40];
_itot_s(count, buffer, 10);
SetDlgItemText(hWnd, IDC_EVENTS_COUNT, buffer);
}
@@ -539,7 +539,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara if (IsDlgButtonChecked(hWnd, IDC_LOAD_ALL))
count = 0;
else {
- TCHAR buffer[1024];
+ wchar_t buffer[1024];
GetDlgItemText(hWnd, IDC_EVENTS_COUNT, buffer, _countof(buffer));
count = _tstol(buffer);
count = (count < 0) ? 0 : count;
@@ -636,7 +636,7 @@ INT_PTR CALLBACK SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam data->hLastFoundEvent = GetNeededEvent(data->hLastFoundEvent, 1, direction);
if (type == SEARCH_TEXT) { //text search
- TCHAR text[2048]; //TODO buffer overrun
+ wchar_t text[2048]; //TODO buffer overrun
GetDlgItemText(hWnd, IDC_SEARCH_TEXT, text, _countof(text));
searchResult = SearchHistory(data->contact, data->hLastFoundEvent, text, direction, type);
}
diff --git a/plugins/IEHistory/src/events.cpp b/plugins/IEHistory/src/events.cpp index f9cc9c4c56..67edd36a56 100644 --- a/plugins/IEHistory/src/events.cpp +++ b/plugins/IEHistory/src/events.cpp @@ -39,7 +39,7 @@ int OnOptionsInitialize(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; odp.position = 100000000; - odp.ptszTitle = LPGENT("History"); + odp.pwszTitle = LPGENW("History"); odp.pfnDlgProc = OptionsDlgProc; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_HISTORY); odp.hInstance = hInstance; diff --git a/plugins/IEHistory/src/utils.cpp b/plugins/IEHistory/src/utils.cpp index d34557b094..090033c533 100644 --- a/plugins/IEHistory/src/utils.cpp +++ b/plugins/IEHistory/src/utils.cpp @@ -78,10 +78,10 @@ int Info(char *title, char *format, ...) returns the name of a contact */ -TCHAR* GetContactName(MCONTACT contact) +wchar_t* GetContactName(MCONTACT contact) { ptrT name(Contact_GetInfo(CNF_DISPLAY, contact)); - return (name) ? _tcsdup(name) : NULL; + return (name) ? wcsdup(name) : NULL; } /* @@ -211,7 +211,7 @@ SearchResult SearchHistory(MCONTACT contact, MEVENT hFirstEvent, void *searchDat int index = 0; MEVENT hEvent = hFirstEvent; void *buffer = NULL; - TCHAR *search; + wchar_t *search; bool found = false; int oldSize, newSize; oldSize = newSize = 0; @@ -223,7 +223,7 @@ SearchResult SearchHistory(MCONTACT contact, MEVENT hFirstEvent, void *searchDat newSize = db_event_getBlobSize(hEvent); if (newSize > oldSize) { - buffer = (TCHAR *)realloc(buffer, newSize); + buffer = (wchar_t *)realloc(buffer, newSize); oldSize = newSize; } dbEvent.pBlob = (PBYTE)buffer; @@ -247,8 +247,8 @@ SearchResult SearchHistory(MCONTACT contact, MEVENT hFirstEvent, void *searchDat #else search = (char *) buffer; #endif - TCHAR *data = (TCHAR *)searchData; - TCHAR *tmp = _tcsstr(search, data); + wchar_t *data = (wchar_t *)searchData; + wchar_t *tmp = wcsstr(search, data); if (tmp) { found = true; diff --git a/plugins/IEHistory/src/utils.h b/plugins/IEHistory/src/utils.h index 7cdf8186f6..6cb2b71370 100644 --- a/plugins/IEHistory/src/utils.h +++ b/plugins/IEHistory/src/utils.h @@ -68,7 +68,7 @@ int Log(char *format, ...); void ScreenToClient(HWND hWnd, LPRECT rect); int Info(char *title, char *format, ...); -TCHAR *GetContactName(MCONTACT contact); +wchar_t *GetContactName(MCONTACT contact); void AnchorMoveWindow(HWND window, const WINDOWPOS *parentPos, int anchors); RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, int anchors); diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index 24d39ed408..c43c1dc415 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -193,7 +193,7 @@ void HTMLBuilder::getUINs(MCONTACT hContact, char *&uinIn, char *&uinOut) wchar_t* HTMLBuilder::getContactName(MCONTACT hContact, const char *szProto)
{
- TCHAR *str = Contact_GetInfo(CNF_DISPLAY, hContact, szProto);
+ wchar_t *str = Contact_GetInfo(CNF_DISPLAY, hContact, szProto);
if (str != NULL)
return str;
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index 94495a434c..f99da29479 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -38,14 +38,14 @@ struct {
DLGPROC dlgProc;
DWORD dlgId;
- TCHAR *tabName;
+ wchar_t *tabName;
}
static tabPages[] =
{
- { IEViewGeneralOptDlgProc, IDD_GENERAL_OPTIONS, LPGENT("General") },
- { IEViewSRMMOptDlgProc, IDD_SRMM_OPTIONS, LPGENT("Message Log") },
- { IEViewGroupChatsOptDlgProc, IDD_SRMM_OPTIONS, LPGENT("Group chats") },
- { IEViewHistoryOptDlgProc, IDD_SRMM_OPTIONS, LPGENT("History") }
+ { IEViewGeneralOptDlgProc, IDD_GENERAL_OPTIONS, LPGENW("General") },
+ { IEViewSRMMOptDlgProc, IDD_SRMM_OPTIONS, LPGENW("Message Log") },
+ { IEViewGroupChatsOptDlgProc, IDD_SRMM_OPTIONS, LPGENW("Group chats") },
+ { IEViewHistoryOptDlgProc, IDD_SRMM_OPTIONS, LPGENW("History") }
};
static LPARAM GetItemParam(HWND hwndTreeView, HTREEITEM hItem)
@@ -437,20 +437,20 @@ int IEViewOptInit(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInstance;
- odp.ptszGroup = LPGENT("Message sessions");
- odp.ptszTitle = LPGENT("IEView");
+ odp.pwszGroup = LPGENW("Message sessions");
+ odp.pwszTitle = LPGENW("IEView");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pszTemplate = MAKEINTRESOURCEA(tabPages[0].dlgId);
odp.pfnDlgProc = tabPages[0].dlgProc;
- odp.ptszTab = tabPages[0].tabName;
+ odp.pwszTab = tabPages[0].tabName;
Options_AddPage(wParam, &odp);
- odp.ptszGroup = LPGENT("Skins");
- odp.ptszTitle = LPGENT("IEView");
+ odp.pwszGroup = LPGENW("Skins");
+ odp.pwszTitle = LPGENW("IEView");
for (size_t i = 1; i < _countof(tabPages); i++) {
odp.pszTemplate = MAKEINTRESOURCEA(tabPages[i].dlgId);
odp.pfnDlgProc = tabPages[i].dlgProc;
- odp.ptszTab = tabPages[i].tabName;
+ odp.pwszTab = tabPages[i].tabName;
Options_AddPage(wParam, &odp);
}
return 0;
@@ -509,7 +509,7 @@ static INT_PTR CALLBACK IEViewGeneralOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w EnableWindow(GetDlgItem(hwndDlg, IDC_SMILEYS_IN_NAMES), Options::isSmileyAdd());
EnableWindow(GetDlgItem(hwndDlg, IDC_EMBED_SIZE), IsDlgButtonChecked(hwndDlg, IDC_ENABLE_EMBED));
{
- TCHAR* size[] = { L"320 x 205", L"480 x 385", L"560 x 349", L"640 x 390" };
+ wchar_t* size[] = { L"320 x 205", L"480 x 385", L"560 x 349", L"640 x 390" };
for (int i = 0; i < _countof(size); ++i) {
int item = SendDlgItemMessage(hwndDlg, IDC_EMBED_SIZE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(size[i]));
SendDlgItemMessage(hwndDlg, IDC_EMBED_SIZE, CB_SETITEMDATA, item, 0);
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index 49ee57bc83..c0712adff6 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -35,8 +35,8 @@ TemplateHTMLBuilder::~TemplateHTMLBuilder() char* TemplateHTMLBuilder::getAvatar(MCONTACT hContact, const char *szProto)
{
DBVARIANT dbv;
- TCHAR tmpPath[MAX_PATH];
- TCHAR *result = NULL;
+ wchar_t tmpPath[MAX_PATH];
+ wchar_t *result = NULL;
if (Options::getAvatarServiceFlags() == Options::AVATARSERVICE_PRESENT) {
avatarCacheEntry *ace;
@@ -54,11 +54,11 @@ char* TemplateHTMLBuilder::getAvatar(MCONTACT hContact, const char *szProto) }
if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
if (mir_tstrlen(dbv.ptszVal) > 0) {
- //TCHAR *ext = _tcsrchr(dbv.ptszVal, '.');
+ //wchar_t *ext = wcsrchr(dbv.ptszVal, '.');
if (result == NULL) {
/* relative -> absolute */
mir_tstrcpy(tmpPath, dbv.ptszVal);
- if (_tcsncmp(tmpPath, L"http://", 7))
+ if (wcsncmp(tmpPath, L"http://", 7))
PathToAbsoluteT(dbv.ptszVal, tmpPath);
result = tmpPath;
}
@@ -83,7 +83,7 @@ int TemplateHTMLBuilder::getFlags(ProtocolSettings * protoSettings) char *TemplateHTMLBuilder::timestampToString(DWORD dwFlags, time_t check, int mode)
{
static char szResult[512]; szResult[0] = '\0';
- TCHAR str[300];
+ wchar_t str[300];
if (mode) // time
TimeZone_ToStringT(check, (dwFlags & Options::LOG_SHOW_SECONDS) ? L"s" : L"t", str, _countof(str));
@@ -96,9 +96,9 @@ char *TemplateHTMLBuilder::timestampToString(DWORD dwFlags, time_t check, int mo tm_today.tm_hour = tm_today.tm_min = tm_today.tm_sec = 0;
today = mktime(&tm_today);
if (dwFlags & Options::LOG_RELATIVE_DATE && check >= today)
- _tcsncpy(str, TranslateT("Today"), _countof(str));
+ wcsncpy(str, TranslateT("Today"), _countof(str));
else if (dwFlags & Options::LOG_RELATIVE_DATE && check > (today - 86400))
- _tcsncpy(str, TranslateT("Yesterday"), _countof(str));
+ wcsncpy(str, TranslateT("Yesterday"), _countof(str));
else
TimeZone_ToStringT(check, (dwFlags & Options::LOG_LONG_DATE) ? L"D" : L"d", str, _countof(str));
}
@@ -152,13 +152,13 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr szNameIn = mir_strdup(" ");
}
mir_snprintf(tempStr, "%snoavatar.png", tempBase);
- TCHAR szNoAvatarPath[MAX_PATH];
- _tcsncpy_s(szNoAvatarPath, _A2T(protoSettings->getSRMMTemplateFilename()), _TRUNCATE);
- TCHAR *szNoAvatarPathTmp = _tcsrchr(szNoAvatarPath, '\\');
+ wchar_t szNoAvatarPath[MAX_PATH];
+ wcsncpy_s(szNoAvatarPath, _A2T(protoSettings->getSRMMTemplateFilename()), _TRUNCATE);
+ wchar_t *szNoAvatarPathTmp = wcsrchr(szNoAvatarPath, '\\');
if (szNoAvatarPathTmp != NULL)
*szNoAvatarPathTmp = 0;
mir_tstrcat(szNoAvatarPath, L"\\noavatar.png");
- if (_taccess(szNoAvatarPath, 0) == -1)
+ if (_waccess(szNoAvatarPath, 0) == -1)
mir_snprintf(tempStr, "%snoavatar.jpg", tempBase);
else
mir_snprintf(tempStr, "%snoavatar.png", tempBase);
@@ -321,13 +321,13 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, szNameIn = mir_strdup(" ");
}
- TCHAR szNoAvatarPath[MAX_PATH];
- _tcsncpy_s(szNoAvatarPath, _A2T(protoSettings->getSRMMTemplateFilename()), _TRUNCATE);
- TCHAR *szNoAvatarPathTmp = _tcsrchr(szNoAvatarPath, '\\');
+ wchar_t szNoAvatarPath[MAX_PATH];
+ wcsncpy_s(szNoAvatarPath, _A2T(protoSettings->getSRMMTemplateFilename()), _TRUNCATE);
+ wchar_t *szNoAvatarPathTmp = wcsrchr(szNoAvatarPath, '\\');
if (szNoAvatarPathTmp != NULL)
*szNoAvatarPathTmp = 0;
mir_tstrcat(szNoAvatarPath, L"\\noavatar.png");
- if (_taccess(szNoAvatarPath, 0) == -1)
+ if (_waccess(szNoAvatarPath, 0) == -1)
mir_snprintf(tempStr, "%snoavatar.jpg", tempBase);
else
mir_snprintf(tempStr, "%snoavatar.png", tempBase);
diff --git a/plugins/IEView/src/external_funcs.cpp b/plugins/IEView/src/external_funcs.cpp index d5c75e5e89..3ca5d06151 100644 --- a/plugins/IEView/src/external_funcs.cpp +++ b/plugins/IEView/src/external_funcs.cpp @@ -40,7 +40,7 @@ namespace External WPARAM wParam = Var_To<WPARAM>(pDispParams->rgvarg[1], wType);
LPARAM lParam = Var_To<LPARAM>(pDispParams->rgvarg[0], lType);
- INT_PTR res = CallService(_T2A((TCHAR*)szName), wParam, lParam);
+ INT_PTR res = CallService(_T2A((wchar_t*)szName), wParam, lParam);
if (wType == 'A' || wType == 'U') mir_free((void*)wParam);
if (lType == 'A' || lType == 'U') mir_free((void*)lParam);
@@ -67,7 +67,7 @@ namespace External WPARAM wParam = Var_To<WPARAM>(pDispParams->rgvarg[1], wType);
LPARAM lParam = Var_To<LPARAM>(pDispParams->rgvarg[0], lType);
- INT_PTR res = ProtoChainSend(hContact, _T2A((TCHAR*)szName), wParam, lParam);
+ INT_PTR res = ProtoChainSend(hContact, _T2A((wchar_t*)szName), wParam, lParam);
if (wType == 'A' || wType == 'U') mir_free((void*)wParam);
if (lType == 'A' || lType == 'U') mir_free((void*)lParam);
@@ -101,7 +101,7 @@ namespace External DBVARIANT dbv = { 0 };
- if (db_get(hContact, _T2A((TCHAR*)szModule), _T2A((TCHAR*)szSetting), &dbv))
+ if (db_get(hContact, _T2A((wchar_t*)szModule), _T2A((wchar_t*)szSetting), &dbv))
return S_OK;
if (pVarResult != nullptr)
@@ -175,7 +175,7 @@ namespace External return E_INVALIDARG;
}
- INT_PTR res = ::db_set(hContact, _T2A((TCHAR*)szModule), _T2A((TCHAR*)szSetting), &dbv);
+ INT_PTR res = ::db_set(hContact, _T2A((wchar_t*)szModule), _T2A((wchar_t*)szSetting), &dbv);
if (pVarResult != nullptr)
{
@@ -210,14 +210,14 @@ namespace External if (OpenClipboard(NULL))
{
EmptyClipboard();
- size_t size = sizeof(TCHAR)* (mir_wstrlen(data) + 1);
+ size_t size = sizeof(wchar_t)* (mir_wstrlen(data) + 1);
HGLOBAL hClipboardData = GlobalAlloc(0, size);
if (hClipboardData)
{
- TCHAR *pchData = (TCHAR*)GlobalLock(hClipboardData);
+ wchar_t *pchData = (wchar_t*)GlobalLock(hClipboardData);
if (pchData)
{
- memcpy(pchData, (TCHAR*)data, size);
+ memcpy(pchData, (wchar_t*)data, size);
GlobalUnlock(hClipboardData);
SetClipboardData(CF_UNICODETEXT, hClipboardData);
}
diff --git a/plugins/IEView/src/ieview_main.cpp b/plugins/IEView/src/ieview_main.cpp index 852bc3ccaf..ecf69d2561 100644 --- a/plugins/IEView/src/ieview_main.cpp +++ b/plugins/IEView/src/ieview_main.cpp @@ -60,7 +60,7 @@ static int ModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
int wdsize = GetCurrentDirectory(0, NULL);
- TCHAR *workingDir = new TCHAR[wdsize];
+ wchar_t *workingDir = new wchar_t[wdsize];
GetCurrentDirectory(wdsize, workingDir);
Utils::convertPath(workingDir);
workingDirUtf8 = mir_utf8encodeT(workingDir);
diff --git a/plugins/IgnoreState/src/main.cpp b/plugins/IgnoreState/src/main.cpp index 17768316b0..e83b181864 100644 --- a/plugins/IgnoreState/src/main.cpp +++ b/plugins/IgnoreState/src/main.cpp @@ -33,14 +33,14 @@ INT currentFilter = 0; INT clistIcon = 0; //Icon slot to use
IGNOREITEMS ii[] = {
- { LPGENT("All"), IGNOREEVENT_ALL, SKINICON_OTHER_FILLEDBLOB },
- { LPGENT("Messages"), IGNOREEVENT_MESSAGE, SKINICON_EVENT_MESSAGE },
- { LPGENT("URL"), IGNOREEVENT_URL, SKINICON_EVENT_URL },
- { LPGENT("Files"), IGNOREEVENT_FILE, SKINICON_EVENT_FILE },
- { LPGENT("User Online"), IGNOREEVENT_USERONLINE, SKINICON_OTHER_USERONLINE },
- { LPGENT("Authorization"), IGNOREEVENT_AUTHORIZATION, SKINICON_OTHER_MIRANDA },
- { LPGENT("You Were Added"), IGNOREEVENT_YOUWEREADDED, SKINICON_OTHER_ADDCONTACT },
- { LPGENT("Typing Notify"), IGNOREEVENT_TYPINGNOTIFY, SKINICON_OTHER_TYPING }
+ { LPGENW("All"), IGNOREEVENT_ALL, SKINICON_OTHER_FILLEDBLOB },
+ { LPGENW("Messages"), IGNOREEVENT_MESSAGE, SKINICON_EVENT_MESSAGE },
+ { LPGENW("URL"), IGNOREEVENT_URL, SKINICON_EVENT_URL },
+ { LPGENW("Files"), IGNOREEVENT_FILE, SKINICON_EVENT_FILE },
+ { LPGENW("User Online"), IGNOREEVENT_USERONLINE, SKINICON_OTHER_USERONLINE },
+ { LPGENW("Authorization"), IGNOREEVENT_AUTHORIZATION, SKINICON_OTHER_MIRANDA },
+ { LPGENW("You Were Added"), IGNOREEVENT_YOUWEREADDED, SKINICON_OTHER_ADDCONTACT },
+ { LPGENW("Typing Notify"), IGNOREEVENT_TYPINGNOTIFY, SKINICON_OTHER_TYPING }
};
int nII = _countof(ii);
diff --git a/plugins/IgnoreState/src/stdafx.h b/plugins/IgnoreState/src/stdafx.h index 979b893ece..4ba2b7e83a 100644 --- a/plugins/IgnoreState/src/stdafx.h +++ b/plugins/IgnoreState/src/stdafx.h @@ -41,7 +41,7 @@ struct IGNOREITEMS
{
- TCHAR* name;
+ wchar_t* name;
int type;
int icon;
bool filtered;
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index 920bf8b15d..c19816d33c 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct AccountMap
{
- AccountMap(const char *_src, int _origIdx, const TCHAR *_srcName) :
+ AccountMap(const char *_src, int _origIdx, const wchar_t *_srcName) :
szSrcAcc(mir_strdup(_src)),
iSrcIndex(_origIdx),
tszSrcName(mir_tstrdup(_srcName)),
@@ -72,10 +72,10 @@ static MIDatabase *srcDb, *dstDb; /////////////////////////////////////////////////////////////////////////////////////////
-void AddMessage(const TCHAR* fmt, ...)
+void AddMessage(const wchar_t* fmt, ...)
{
va_list args;
- TCHAR msgBuf[4096];
+ wchar_t msgBuf[4096];
va_start(args, fmt);
mir_vsntprintf(msgBuf, _countof(msgBuf), TranslateTS(fmt), args);
@@ -111,7 +111,7 @@ static int myGetD(MCONTACT hContact, const char *szModule, const char *szSetting return srcDb->GetContactSetting(hContact, szModule, szSetting, &dbv) ? iDefault : dbv.dVal;
}
-static TCHAR* myGetWs(MCONTACT hContact, const char *szModule, const char *szSetting)
+static wchar_t* myGetWs(MCONTACT hContact, const char *szModule, const char *szSetting)
{
DBVARIANT dbv = { DBVT_TCHAR };
return srcDb->GetContactSettingStr(hContact, szModule, szSetting, &dbv) ? NULL : dbv.ptszVal;
@@ -138,7 +138,7 @@ static MCONTACT HContactFromNumericID(char *pszProtoName, char *pszSetting, DWOR return INVALID_CONTACT_ID;
}
-static MCONTACT HContactFromID(char *pszProtoName, char *pszSetting, TCHAR *pwszID)
+static MCONTACT HContactFromID(char *pszProtoName, char *pszSetting, wchar_t *pwszID)
{
for (MCONTACT hContact = dstDb->FindFirstContact(); hContact; hContact = dstDb->FindNextContact(hContact)) {
char *szProto = GetContactProto(hContact);
@@ -230,7 +230,7 @@ static LRESULT CALLBACK ListWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM ListView_GetSubItemRect(hwnd, hit.iItem, 1, LVIR_BOUNDS, &r);
r.top--; r.bottom--;
- TCHAR tszText[100];
+ wchar_t tszText[100];
ListView_GetItemText(hwnd, hit.iItem, 1, tszText, _countof(tszText));
LVITEM lvitem;
@@ -369,7 +369,7 @@ static bool FindDestAccount(const char *szProto) return false;
}
-static PROTOACCOUNT* FindMyAccount(const char *szProto, const char *szBaseProto, const TCHAR *ptszName, bool bStrict)
+static PROTOACCOUNT* FindMyAccount(const char *szProto, const char *szBaseProto, const wchar_t *ptszName, bool bStrict)
{
int destProtoCount;
PROTOACCOUNT **destAccs;
@@ -469,7 +469,7 @@ bool ImportAccounts(OBJLIST<char> &arSkippedModules) continue;
if (!Proto_IsProtocolLoaded(p.szBaseProto)) {
- AddMessage(LPGENT("Protocol %S is not loaded, skipping account %s creation"), p.szBaseProto, p.tszSrcName);
+ AddMessage(LPGENW("Protocol %S is not loaded, skipping account %s creation"), p.szBaseProto, p.tszSrcName);
continue;
}
@@ -480,7 +480,7 @@ bool ImportAccounts(OBJLIST<char> &arSkippedModules) p.pa = ProtoCreateAccount(&newacc);
if (p.pa == NULL) {
- AddMessage(LPGENT("Unable to create an account %s of protocol %S"), p.tszSrcName, p.szBaseProto);
+ AddMessage(LPGENW("Unable to create an account %s of protocol %S"), p.tszSrcName, p.szBaseProto);
return false;
}
@@ -525,12 +525,12 @@ static MCONTACT MapContact(MCONTACT hSrc) return (pDestContact == NULL) ? INVALID_CONTACT_ID : pDestContact->dstID;
}
-static MCONTACT AddContact(char *szProto, char *pszUniqueSetting, DBVARIANT *id, const TCHAR *pszUserID, TCHAR *nick, TCHAR *group)
+static MCONTACT AddContact(char *szProto, char *pszUniqueSetting, DBVARIANT *id, const wchar_t *pszUserID, wchar_t *nick, wchar_t *group)
{
MCONTACT hContact = CallService(MS_DB_CONTACT_ADD, 0, 0);
if (Proto_AddToContact(hContact, szProto) != 0) {
CallService(MS_DB_CONTACT_DELETE, hContact, 0);
- AddMessage(LPGENT("Failed to add %S contact %s"), szProto, pszUserID);
+ AddMessage(LPGENW("Failed to add %S contact %s"), szProto, pszUserID);
return INVALID_CONTACT_ID;
}
@@ -540,9 +540,9 @@ static MCONTACT AddContact(char *szProto, char *pszUniqueSetting, DBVARIANT *id, if (nick && *nick) {
db_set_ws(hContact, "CList", "MyHandle", nick);
- AddMessage(LPGENT("Added %S contact %s, '%s'"), szProto, pszUserID, nick);
+ AddMessage(LPGENW("Added %S contact %s, '%s'"), szProto, pszUserID, nick);
}
- else AddMessage(LPGENT("Added %S contact %s"), szProto, pszUserID);
+ else AddMessage(LPGENW("Added %S contact %s"), szProto, pszUserID);
srcDb->FreeVariant(id);
return hContact;
@@ -582,7 +582,7 @@ static int ImportGroup(const char* szSettingName, LPARAM lParam) {
int *pnGroups = (int*)lParam;
- TCHAR *tszGroup = myGetWs(NULL, "CListGroups", szSettingName);
+ wchar_t *tszGroup = myGetWs(NULL, "CListGroups", szSettingName);
if (tszGroup != NULL) {
if (CreateGroup(tszGroup + 1, NULL))
pnGroups[0]++;
@@ -659,7 +659,7 @@ void ImportMeta(DBCachedContact *ccSrc) if (ccDst == NULL) {
MCONTACT hDest = FindExistingMeta(ccSrc);
if (hDest == 0) {
- AddMessage(LPGENT("Metacontact cannot be imported due to its ambiguity."));
+ AddMessage(LPGENW("Metacontact cannot be imported due to its ambiguity."));
return;
}
@@ -714,14 +714,14 @@ void ImportMeta(DBCachedContact *ccSrc) if (tszNick && *tszNick) {
db_set_ws(hDest, "CList", "MyHandle", tszNick);
- AddMessage(LPGENT("Added metacontact '%s'"), tszNick);
+ AddMessage(LPGENW("Added metacontact '%s'"), tszNick);
}
- else AddMessage(LPGENT("Added metacontact"));
+ else AddMessage(LPGENW("Added metacontact"));
}
PROTOACCOUNT *pa = Proto_GetAccount(META_PROTO);
if (pa) {
- AccountMap pda(META_PROTO, 0, _T(META_PROTO));
+ AccountMap pda(META_PROTO, 0, META_PROTOW);
ImportContactSettings(&pda, ccSrc->contactID, ccDst->contactID);
}
@@ -735,7 +735,7 @@ static MCONTACT ImportContact(MCONTACT hSrc) // Check what protocol this contact belongs to
DBCachedContact *cc = srcDb->m_cache->GetCachedContact(hSrc);
if (cc == NULL || cc->szProto == NULL) {
- AddMessage(LPGENT("Skipping contact with no protocol"));
+ AddMessage(LPGENW("Skipping contact with no protocol"));
return NULL;
}
@@ -746,40 +746,40 @@ static MCONTACT ImportContact(MCONTACT hSrc) AccountMap *pda = arAccountMap.find((AccountMap*)&cc->szProto);
if (pda == NULL || pda->pa == NULL) {
- AddMessage(LPGENT("Skipping contact, account %S cannot be mapped."), cc->szProto);
+ AddMessage(LPGENW("Skipping contact, account %S cannot be mapped."), cc->szProto);
return NULL;
}
if (!Proto_GetAccount(pda->pa->szModuleName)) {
- AddMessage(LPGENT("Skipping contact, %S not installed."), cc->szProto);
+ AddMessage(LPGENW("Skipping contact, %S not installed."), cc->szProto);
return NULL;
}
// Skip protocols with no unique id setting (some non IM protocols return NULL)
char *pszUniqueSetting = (char*)CallProtoService(pda->pa->szModuleName, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
if (!pszUniqueSetting || (INT_PTR)pszUniqueSetting == CALLSERVICE_NOTFOUND) {
- AddMessage(LPGENT("Skipping non-IM contact (%S)"), cc->szProto);
+ AddMessage(LPGENW("Skipping non-IM contact (%S)"), cc->szProto);
return NULL;
}
DBVARIANT dbv;
if (myGet(hSrc, cc->szProto, pszUniqueSetting, &dbv)) {
- AddMessage(LPGENT("Skipping %S contact, ID not found"), cc->szProto);
+ AddMessage(LPGENW("Skipping %S contact, ID not found"), cc->szProto);
return NULL;
}
// Does the contact already exist?
- TCHAR id[40], *pszUniqueID;
+ wchar_t id[40], *pszUniqueID;
MCONTACT hDst;
switch (dbv.type) {
case DBVT_DWORD:
- pszUniqueID = _ltot(dbv.dVal, id, 10);
+ pszUniqueID = _ltow(dbv.dVal, id, 10);
hDst = HContactFromNumericID(pda->pa->szModuleName, pszUniqueSetting, dbv.dVal);
break;
case DBVT_ASCIIZ:
case DBVT_UTF8:
- pszUniqueID = NEWTSTR_ALLOCA(_A2T(dbv.pszVal));
+ pszUniqueID = NEWWSTR_ALLOCA(_A2T(dbv.pszVal));
hDst = HContactFromID(pda->pa->szModuleName, pszUniqueSetting, pszUniqueID);
break;
@@ -789,7 +789,7 @@ static MCONTACT ImportContact(MCONTACT hSrc) }
if (hDst != INVALID_CONTACT_ID) {
- AddMessage(LPGENT("Skipping duplicate %S contact %s"), cc->szProto, pszUniqueID);
+ AddMessage(LPGENW("Skipping duplicate %S contact %s"), cc->szProto, pszUniqueID);
srcDb->FreeVariant(&dbv);
arContactMap.insert(new ContactMap(hSrc, hDst));
return NULL;
@@ -801,7 +801,7 @@ static MCONTACT ImportContact(MCONTACT hSrc) hDst = AddContact(pda->pa->szModuleName, pszUniqueSetting, &dbv, pszUniqueID, tszNick, tszGroup);
if (hDst == INVALID_CONTACT_ID) {
- AddMessage(LPGENT("Unknown error while adding %S contact %s"), pda->pa->szModuleName, pszUniqueID);
+ AddMessage(LPGENW("Unknown error while adding %S contact %s"), pda->pa->szModuleName, pszUniqueID);
return INVALID_CONTACT_ID;
}
@@ -939,7 +939,7 @@ static void ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int protoC if (dstDb->AddEvent(hOwner, &dbei) != NULL)
nMessagesCount++;
else
- AddMessage(LPGENT("Failed to add message"));
+ AddMessage(LPGENW("Failed to add message"));
}
}
else nDupes++;
@@ -973,18 +973,18 @@ void MirandaImport(HWND hdlg) hdlgProgress = hdlg;
if ((dstDb = GetCurrentDatabase()) == NULL) {
- AddMessage(LPGENT("Error retrieving current profile, exiting."));
+ AddMessage(LPGENW("Error retrieving current profile, exiting."));
return;
}
DATABASELINK *dblink = FindDatabasePlugin(importFile);
if (dblink == NULL) {
- AddMessage(LPGENT("There's no database driver to open the input file, exiting."));
+ AddMessage(LPGENW("There's no database driver to open the input file, exiting."));
return;
}
if ((srcDb = dblink->Load(importFile, TRUE)) == NULL) {
- AddMessage(LPGENT("Error loading source file, exiting."));
+ AddMessage(LPGENW("Error loading source file, exiting."));
return;
}
@@ -999,7 +999,7 @@ void MirandaImport(HWND hdlg) // Get number of contacts
int nNumberOfContacts = srcDb->GetContactCount();
- AddMessage(LPGENT("Number of contacts in database: %d"), nNumberOfContacts);
+ AddMessage(LPGENW("Number of contacts in database: %d"), nNumberOfContacts);
AddMessage(L"");
// Configure database for fast writing
@@ -1010,7 +1010,7 @@ void MirandaImport(HWND hdlg) OBJLIST<char> arSkippedAccs(1, CompareModules);
if (!ImportAccounts(arSkippedAccs)) {
- AddMessage(LPGENT("Error mapping accounts, exiting."));
+ AddMessage(LPGENW("Error mapping accounts, exiting."));
return;
}
@@ -1021,10 +1021,10 @@ void MirandaImport(HWND hdlg) // Import Groups
if (nImportOptions & IOPT_GROUPS) {
- AddMessage(LPGENT("Importing groups."));
+ AddMessage(LPGENW("Importing groups."));
nGroupsCount = ImportGroups();
if (nGroupsCount == -1)
- AddMessage(LPGENT("Group import failed."));
+ AddMessage(LPGENW("Group import failed."));
AddMessage(L"");
}
@@ -1032,7 +1032,7 @@ void MirandaImport(HWND hdlg) // Import Contacts
if (nImportOptions & IOPT_CONTACTS) {
- AddMessage(LPGENT("Importing contacts."));
+ AddMessage(LPGENW("Importing contacts."));
int i = 1;
MCONTACT hContact = srcDb->FindFirstContact();
while (hContact != NULL) {
@@ -1056,13 +1056,13 @@ void MirandaImport(HWND hdlg) for (i = 0; i < arMetas.getCount(); i++)
ImportMeta(arMetas[i]);
}
- else AddMessage(LPGENT("Skipping new contacts import."));
+ else AddMessage(LPGENW("Skipping new contacts import."));
AddMessage(L"");
// End of Import Contacts
// Import NULL contact message chain
if (nImportOptions & IOPT_SYSTEM) {
- AddMessage(LPGENT("Importing system history."));
+ AddMessage(LPGENW("Importing system history."));
int protoCount;
PROTOACCOUNT **accs;
@@ -1071,12 +1071,12 @@ void MirandaImport(HWND hdlg) if (protoCount > 0)
ImportHistory(NULL, accs, protoCount);
}
- else AddMessage(LPGENT("Skipping system history import."));
+ else AddMessage(LPGENW("Skipping system history import."));
AddMessage(L"");
// Import other contact messages
if (nImportOptions & IOPT_HISTORY) {
- AddMessage(LPGENT("Importing history."));
+ AddMessage(LPGENW("Importing history."));
MCONTACT hContact = srcDb->FindFirstContact();
for (int i = 1; hContact != NULL; i++) {
ImportHistory(hContact, NULL, NULL);
@@ -1085,7 +1085,7 @@ void MirandaImport(HWND hdlg) hContact = srcDb->FindNextContact(hContact);
}
}
- else AddMessage(LPGENT("Skipping history import."));
+ else AddMessage(LPGENW("Skipping history import."));
AddMessage(L"");
// Restore database writing mode
@@ -1098,17 +1098,17 @@ void MirandaImport(HWND hdlg) dwTimer = time(NULL) - dwTimer;
// Print statistics
- AddMessage(LPGENT("Import completed in %d seconds."), dwTimer);
+ AddMessage(LPGENW("Import completed in %d seconds."), dwTimer);
SetProgress(100);
AddMessage(nMessagesCount == 0 ?
- LPGENT("Added %d contacts and %d groups.") : LPGENT("Added %d contacts, %d groups and %d events."),
+ LPGENW("Added %d contacts and %d groups.") : LPGENW("Added %d contacts, %d groups and %d events."),
nContactsCount, nGroupsCount, nMessagesCount);
if (nSkippedContacts)
- AddMessage(LPGENT("Skipped %d contacts."), nSkippedContacts);
+ AddMessage(LPGENW("Skipped %d contacts."), nSkippedContacts);
if (nDupes || nSkippedEvents)
- AddMessage(LPGENT("Skipped %d duplicates and %d filtered events."), nDupes, nSkippedEvents);
+ AddMessage(LPGENW("Skipped %d duplicates and %d filtered events."), nDupes, nSkippedEvents);
arMetas.destroy();
arAccountMap.destroy();
diff --git a/plugins/Import/src/miranda.cpp b/plugins/Import/src/miranda.cpp index cbddcb5836..dc4c5c86f8 100644 --- a/plugins/Import/src/miranda.cpp +++ b/plugins/Import/src/miranda.cpp @@ -24,15 +24,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. time_t dwSinceDate = 0;
-TCHAR importFile[MAX_PATH];
+wchar_t importFile[MAX_PATH];
//=======================================================================================
// Profile selection dialog
-static void SearchForLists(HWND hwndDlg, const TCHAR *mirandaPath, const TCHAR *mirandaProf)
+static void SearchForLists(HWND hwndDlg, const wchar_t *mirandaPath, const wchar_t *mirandaProf)
{
// find in Miranda profile subfolders
- TCHAR searchspec[MAX_PATH];
+ wchar_t searchspec[MAX_PATH];
mir_sntprintf(searchspec, L"%s\\*.*", mirandaPath);
WIN32_FIND_DATA fd;
@@ -49,9 +49,9 @@ static void SearchForLists(HWND hwndDlg, const TCHAR *mirandaPath, const TCHAR * if (mirandaProf != NULL && !mir_tstrcmpi(mirandaProf, fd.cFileName))
continue;
- TCHAR buf[MAX_PATH], profile[MAX_PATH];
+ wchar_t buf[MAX_PATH], profile[MAX_PATH];
mir_sntprintf(buf, L"%s\\%s\\%s.dat", mirandaPath, fd.cFileName, fd.cFileName);
- if (_taccess(buf, 0) == 0) {
+ if (_waccess(buf, 0) == 0) {
mir_sntprintf(profile, L"%s.dat", fd.cFileName);
int i = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_ADDSTRING, 0, (LPARAM)profile);
@@ -65,7 +65,7 @@ static void SearchForLists(HWND hwndDlg, const TCHAR *mirandaPath, const TCHAR * INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM)
{
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
switch(message) {
case WM_INITDIALOG:
@@ -84,7 +84,7 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETCURSEL, 0, 0);
SendMessage(hwndDlg, WM_COMMAND, MAKELONG(IDC_LIST, LBN_SELCHANGE), 0);
GetDlgItemText(hwndDlg, IDC_FILENAME, filename, _countof(filename));
- if (_taccess(filename, 4))
+ if (_waccess(filename, 4))
SendMessage(GetParent(hwndDlg), WIZM_DISABLEBUTTON, 1, 0);
return TRUE;
@@ -96,7 +96,7 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR case IDOK:
GetDlgItemText(hwndDlg, IDC_FILENAME, filename, _countof(filename));
- if (_taccess(filename, 4)) {
+ if (_waccess(filename, 4)) {
MessageBox(hwndDlg, TranslateT("The given file does not exist. Please check that you have entered the name correctly."), TranslateT("Miranda Import"), MB_OK);
break;
}
@@ -112,7 +112,7 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR if (HIWORD(wParam) == LBN_SELCHANGE) {
int sel = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETCURSEL, 0, 0);
if (sel != LB_ERR) {
- SetDlgItemText(hwndDlg, IDC_FILENAME, (TCHAR*)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, sel, 0));
+ SetDlgItemText(hwndDlg, IDC_FILENAME, (wchar_t*)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, sel, 0));
SendMessage(GetParent(hwndDlg), WIZM_ENABLEBUTTON, 1, 0);
}
}
@@ -121,7 +121,7 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR case IDC_OTHER:
ptrT pfd(Utils_ReplaceVarsT(L"%miranda_profilesdir%"));
- TCHAR str[MAX_PATH], text[256];
+ wchar_t str[MAX_PATH], text[256];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
mir_sntprintf(text, L"%s (*.dat, *.bak)%c*.dat;*.bak%c%s (*.*)%c*.*%c%c", TranslateT("Miranda NG database"), 0, 0, TranslateT("All Files"), 0, 0, 0);
diff --git a/plugins/Import/src/stdafx.h b/plugins/Import/src/stdafx.h index 2be67303d6..260f49da20 100644 --- a/plugins/Import/src/stdafx.h +++ b/plugins/Import/src/stdafx.h @@ -85,7 +85,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define IOPT_HISTORY 0x000007FE
-void AddMessage(const TCHAR* fmt, ...);
+void AddMessage(const wchar_t* fmt, ...);
INT_PTR CALLBACK WizardIntroPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK ProgressPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam);
@@ -96,12 +96,12 @@ INT_PTR CALLBACK FinishedPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM bool IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO dbei);
-int CreateGroup(const TCHAR* name, MCONTACT hContact);
+int CreateGroup(const wchar_t* name, MCONTACT hContact);
extern HINSTANCE hInst;
extern HWND hwndAccMerge;
extern int nImportOptions;
-extern TCHAR importFile[];
+extern wchar_t importFile[];
extern time_t dwSinceDate;
extern bool g_bServiceMode;
diff --git a/plugins/Import/src/utils.cpp b/plugins/Import/src/utils.cpp index 05d4e1d0ad..59adce72b9 100644 --- a/plugins/Import/src/utils.cpp +++ b/plugins/Import/src/utils.cpp @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ------------------------------------------------
// Returns 1 if successful and 0 when it fails.
-int CreateGroup(const TCHAR *group, MCONTACT hContact)
+int CreateGroup(const wchar_t *group, MCONTACT hContact)
{
if (group == NULL)
return 0;
@@ -38,7 +38,7 @@ int CreateGroup(const TCHAR *group, MCONTACT hContact) if (hContact)
db_set_ts(hContact, "CList", "Group", group);
else
- AddMessage(LPGENT("Skipping duplicate group %s."), group);
+ AddMessage(LPGENW("Skipping duplicate group %s."), group);
return 0;
}
diff --git a/plugins/Import/src/wizard.cpp b/plugins/Import/src/wizard.cpp index 7232aec1fd..189a530d55 100644 --- a/plugins/Import/src/wizard.cpp +++ b/plugins/Import/src/wizard.cpp @@ -146,7 +146,7 @@ INT_PTR CALLBACK WizardDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lP break;
case WIZM_SETCANCELTEXT:
- SetDlgItemText(hdlg, IDCANCEL, (TCHAR*)lParam);
+ SetDlgItemText(hdlg, IDCANCEL, (wchar_t*)lParam);
break;
case WM_COMMAND:
diff --git a/plugins/KeyboardNotify/src/EnumProc.cpp b/plugins/KeyboardNotify/src/EnumProc.cpp index 527e4fda05..e1056113e4 100644 --- a/plugins/KeyboardNotify/src/EnumProc.cpp +++ b/plugins/KeyboardNotify/src/EnumProc.cpp @@ -18,8 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-BOOL findFilename(TCHAR *);
-TCHAR *filename(TCHAR *);
+BOOL findFilename(wchar_t *);
+wchar_t *filename(wchar_t *);
// Globals
extern PROCESS_LIST ProcessList;
@@ -40,7 +40,7 @@ BOOL areThereProcessesRunning(void) // While there are processes, keep looping.
for (procentry.dwSize=sizeof(PROCESSENTRY32), bFlag=Process32First(hSnapShot, &procentry); bFlag; procentry.dwSize=sizeof(PROCESSENTRY32), bFlag=Process32Next(hSnapShot, &procentry)) {
- TCHAR *szFileNameAux = filename(procentry.szExeFile);
+ wchar_t *szFileNameAux = filename(procentry.szExeFile);
// Search szFileName in user-defined list
if (findFilename(szFileNameAux))
@@ -50,7 +50,7 @@ BOOL areThereProcessesRunning(void) return FALSE;
}
-BOOL findFilename(TCHAR *fileName)
+BOOL findFilename(wchar_t *fileName)
{
for (int i=0; i < ProcessList.count; i++)
if (ProcessList.szFileName[i] && !_wcsicmp(ProcessList.szFileName[i], fileName))
@@ -60,9 +60,9 @@ BOOL findFilename(TCHAR *fileName) }
-TCHAR *filename(TCHAR *fullFileName)
+wchar_t *filename(wchar_t *fullFileName)
{
- TCHAR *str;
+ wchar_t *str;
str = wcsrchr(fullFileName, '\\');
if (!str)
diff --git a/plugins/KeyboardNotify/src/EnumProc.h b/plugins/KeyboardNotify/src/EnumProc.h index 489ce06fd6..5f401ce9e0 100644 --- a/plugins/KeyboardNotify/src/EnumProc.h +++ b/plugins/KeyboardNotify/src/EnumProc.h @@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct {
int count;
- TCHAR **szFileName;
+ wchar_t **szFileName;
} PROCESS_LIST;
BOOL areThereProcessesRunning(void);
diff --git a/plugins/KeyboardNotify/src/flash.cpp b/plugins/KeyboardNotify/src/flash.cpp index c2a22d11bf..bbbcc84da4 100644 --- a/plugins/KeyboardNotify/src/flash.cpp +++ b/plugins/KeyboardNotify/src/flash.cpp @@ -33,7 +33,7 @@ FLASHING_SEQUENCE *getTrillianSeq(void); void updateTrillianSeq(void);
static void __cdecl TestThread(void *param);
static void PreviewThread(void *);
-FLASHING_SEQUENCE str2FS(TCHAR *);
+FLASHING_SEQUENCE str2FS(wchar_t *);
BYTE KbdChar2Byte(char);
void countUnopenEvents(int *, int *, int *, int *);
@@ -195,11 +195,11 @@ void updateTrillianSeq(void) }
}
-void useExternSequence(TCHAR *extStr)
+void useExternSequence(wchar_t *extStr)
{
static FLASHING_SEQUENCE Extern = {0};
- TCHAR externStr[MAX_PATH+1];
+ wchar_t externStr[MAX_PATH+1];
mir_wstrcpy(externStr, extStr);
Extern = str2FS(normalizeCustomString(externStr));
@@ -209,98 +209,98 @@ void useExternSequence(TCHAR *extStr) }
-TCHAR *normalizeCustomString(TCHAR *customStr)
+wchar_t *normalizeCustomString(wchar_t *customStr)
{
int len=0, status=0;
BOOL used[4];
- TCHAR strAux[MAX_PATH+1], *str;
+ wchar_t strAux[MAX_PATH+1], *str;
for (mir_wstrcpy(str=strAux, customStr); *str; str++) {
switch (*str) {
- case _T('['):
+ case '[':
if (status == 0) {
status = 1;
customStr[len++] = *str;
used[0] = used [1] = used[2] = used[3] = FALSE;
}
break;
- case _T(']'):
+ case ']':
if (status == 1) {
status = 0;
customStr[len++] = *str;
}
break;
- case _T('0'):
- case _T('1'):
- case _T('2'):
- case _T('3'):
+ case '0':
+ case '1':
+ case '2':
+ case '3':
if (status == 0)
customStr[len++] = *str;
- else if (!used[*str - _T('0')]) {
+ else if (!used[*str - '0']) {
customStr[len++] = *str;
- used[*str - _T('0')] = TRUE;
+ used[*str - '0'] = TRUE;
}
break;
}
}
if (status == 1)
- customStr[len++] = _T(']');
- customStr[len] = _T('\0');
+ customStr[len++] = ']';
+ customStr[len] = '\0';
return customStr;
}
-TCHAR* getCurrentSequenceString(void)
+wchar_t* getCurrentSequenceString(void)
{
- static TCHAR CurrentSeqString[MAX_PATH+1];
- TCHAR *str = CurrentSeqString;
+ static wchar_t CurrentSeqString[MAX_PATH+1];
+ wchar_t *str = CurrentSeqString;
for (unsigned i=0; i < pFS->size; i++) {
switch (pFS->frame[i]) {
case 0:
- *(str++) = _T('0');
+ *(str++) = '0';
break;
case 1:
- *(str++) = _T('3');
+ *(str++) = '3';
break;
case 2:
- *(str++) = _T('1');
+ *(str++) = '1';
break;
case 3:
- *(str++) = _T('[');
- *(str++) = _T('1');
- *(str++) = _T('3');
- *(str++) = _T(']');
+ *(str++) = '[';
+ *(str++) = '1';
+ *(str++) = '3';
+ *(str++) = ']';
break;
case 4:
- *(str++) = _T('2');
+ *(str++) = '2';
break;
case 5:
- *(str++) = _T('[');
- *(str++) = _T('2');
- *(str++) = _T('3');
- *(str++) = _T(']');
+ *(str++) = '[';
+ *(str++) = '2';
+ *(str++) = '3';
+ *(str++) = ']';
break;
case 6:
- *(str++) = _T('[');
- *(str++) = _T('1');
- *(str++) = _T('2');
- *(str++) = _T(']');
+ *(str++) = '[';
+ *(str++) = '1';
+ *(str++) = '2';
+ *(str++) = ']';
break;
case 7:
- *(str++) = _T('[');
- *(str++) = _T('1');
- *(str++) = _T('2');
- *(str++) = _T('3');
- *(str++) = _T(']');
+ *(str++) = '[';
+ *(str++) = '1';
+ *(str++) = '2';
+ *(str++) = '3';
+ *(str++) = ']';
}
}
- *str = _T('\0');
+ *str = '\0';
return CurrentSeqString;
}
-void testSequence(TCHAR *testStr)
+void testSequence(wchar_t *testStr)
{
if (bTestSemaphore) // we try to avoid concurrent test threads
return;
@@ -362,15 +362,15 @@ static void PreviewThread(void*) }
-FLASHING_SEQUENCE str2FS(TCHAR *str)
+FLASHING_SEQUENCE str2FS(wchar_t *str)
{
FLASHING_SEQUENCE Temp = {0};
for (Temp.size=Temp.index=0; *str; str++) {
Temp.size++;
- if (*str == _T('[')) {
+ if (*str == '[') {
Temp.frame[Temp.size - 1] = 0;
- for (str++; *str && *str != _T(']'); str++)
+ for (str++; *str && *str != ']'; str++)
Temp.frame[Temp.size - 1] += KbdChar2Byte(*str) & Leds2Flash;
if (!*str) break;
}
diff --git a/plugins/KeyboardNotify/src/flash.h b/plugins/KeyboardNotify/src/flash.h index f60706fc76..96421c966e 100644 --- a/plugins/KeyboardNotify/src/flash.h +++ b/plugins/KeyboardNotify/src/flash.h @@ -19,10 +19,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void RestoreLEDState(void);
BYTE getBlinkingLeds(void);
void setFlashingSequence(void);
-void useExternSequence(TCHAR *);
-TCHAR *normalizeCustomString(TCHAR *);
-TCHAR *getCurrentSequenceString(void);
-void testSequence(TCHAR *);
+void useExternSequence(wchar_t *);
+wchar_t *normalizeCustomString(wchar_t *);
+wchar_t *getCurrentSequenceString(void);
+void testSequence(wchar_t *);
void previewFlashing(BOOL);
#define LedState(a) (((BYTE)(GetKeyState(a) & 0xffff))!=0)
diff --git a/plugins/KeyboardNotify/src/keyboard.cpp b/plugins/KeyboardNotify/src/keyboard.cpp index 8fd9325b5f..5fd5116dc5 100644 --- a/plugins/KeyboardNotify/src/keyboard.cpp +++ b/plugins/KeyboardNotify/src/keyboard.cpp @@ -37,7 +37,7 @@ typedef struct _KEYBOARD_INDICATOR_PARAMETERS { BOOL OpenKeyboardDevice()
{
int i = 0;
- TCHAR aux1[MAX_PATH+1], aux2[MAX_PATH+1];
+ wchar_t aux1[MAX_PATH+1], aux2[MAX_PATH+1];
do {
mir_sntprintf(aux1, L"Kbd%d", i);
@@ -74,7 +74,7 @@ BOOL ToggleKeyboardLights(BYTE byte) void CloseKeyboardDevice()
{
int i = 0;
- TCHAR aux[MAX_PATH+1];
+ wchar_t aux[MAX_PATH+1];
do {
if (hKbdDev[i] != INVALID_HANDLE_VALUE)
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 9bccd96da1..3cafb2523b 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -463,7 +463,7 @@ static INT_PTR StartBlinkService(WPARAM wParam, LPARAM lParam) nExternCount += (unsigned int)wParam;
if (bFlashOnOther && checkNotifyOptions() && checkGlobalStatus() && checkGlobalXstatus()) {
if (lParam)
- useExternSequence((TCHAR *)lParam);
+ useExternSequence((wchar_t *)lParam);
SetEvent(hFlashEvent);
}
@@ -490,10 +490,10 @@ static INT_PTR IsFlashingActiveService(WPARAM, LPARAM) INT_PTR NormalizeSequenceService(WPARAM, LPARAM lParam)
{
- TCHAR strAux[MAX_PATH + 1], *strIn = (TCHAR*)lParam;
+ wchar_t strAux[MAX_PATH + 1], *strIn = (wchar_t*)lParam;
- _tcsncpy_s(strAux, strIn, _TRUNCATE);
- _tcsncpy_s(strIn, MAX_PATH, normalizeCustomString(strAux), _TRUNCATE);
+ wcsncpy_s(strAux, strIn, _TRUNCATE);
+ wcsncpy_s(strIn, MAX_PATH, normalizeCustomString(strAux), _TRUNCATE);
return (INT_PTR)strIn;
}
@@ -518,7 +518,7 @@ void createProcessList(void) int count = db_get_w(NULL, KEYBDMODULE, "processcount", 0);
ProcessList.count = 0;
- ProcessList.szFileName = (TCHAR **)mir_alloc(count * sizeof(TCHAR *));
+ ProcessList.szFileName = (wchar_t **)mir_alloc(count * sizeof(wchar_t *));
if (ProcessList.szFileName) {
for (int i = 0; i < count; i++)
ProcessList.szFileName[i] = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i));
@@ -820,20 +820,20 @@ static void destroyProtocolList(void) // We use the profile name to create the first part of each event name
// We do so to avoid problems between different instances of the plugin concurrently running
-void createEventPrefix(TCHAR *prefixName, size_t maxLen)
+void createEventPrefix(wchar_t *prefixName, size_t maxLen)
{
size_t len;
- TCHAR profileName[MAX_PATH + 1], *str;
+ wchar_t profileName[MAX_PATH + 1], *str;
getAbsoluteProfileName(profileName, MAX_PATH);
- while (str = _tcschr(profileName, _T('\\')))
- *str = _T('/');
+ while (str = wcschr(profileName, '\\'))
+ *str = '/';
if ((len = mir_tstrlen(profileName)) <= maxLen)
- _tcsncpy_s(prefixName, maxLen, profileName, _TRUNCATE);
+ wcsncpy_s(prefixName, maxLen, profileName, _TRUNCATE);
else {
str = profileName + len - maxLen / 2;
- _tcsncpy_s(prefixName, (maxLen / 2), profileName, _TRUNCATE);
+ wcsncpy_s(prefixName, (maxLen / 2), profileName, _TRUNCATE);
mir_tstrcat(prefixName, str);
}
}
@@ -907,7 +907,7 @@ static int OnPreshutdown(WPARAM, LPARAM) static int ModulesLoaded(WPARAM, LPARAM)
{
- TCHAR eventPrefix[MAX_PATH + 1], eventName[MAX_PATH + 1];
+ wchar_t eventPrefix[MAX_PATH + 1], eventName[MAX_PATH + 1];
createProtocolList();
LoadSettings();
diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index afd15ae342..5f5f0bd92d 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -34,66 +34,66 @@ extern PROCESS_LIST ProcessList; HWND hwndProto, hwndBasic, hwndEffect, hwndTheme, hwndIgnore, hwndCurrentTab; -TCHAR *AttendedName[]={L"Miranda", L"Windows"}; -TCHAR *OrderName[]={LPGENT("left -> right"), LPGENT("right -> left"), LPGENT("left <-> right")}; +wchar_t *AttendedName[]={L"Miranda", L"Windows"}; +wchar_t *OrderName[]={LPGENW("left -> right"), LPGENW("right -> left"), LPGENW("left <-> right")}; PROCESS_LIST ProcessListAux; XSTATUS_INFO *XstatusListAux; BYTE trillianLedsMsg, trillianLedsURL, trillianLedsFile, trillianLedsOther; -static void writeThemeToCombo(const TCHAR *theme, const TCHAR *custom, BOOL overrideExisting) +static void writeThemeToCombo(const wchar_t *theme, const wchar_t *custom, BOOL overrideExisting) { int item = SendDlgItemMessage(hwndTheme, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); if (item == CB_ERR) { item = SendDlgItemMessage(hwndTheme, IDC_THEME, CB_ADDSTRING, 0, (LPARAM)theme); - TCHAR *str = mir_tstrdup(custom); + wchar_t *str = mir_tstrdup(custom); SendDlgItemMessage(hwndTheme, IDC_THEME, CB_SETITEMDATA, (WPARAM)item, (LPARAM)str); } else if (overrideExisting) { - TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndTheme, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); + wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndTheme, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); if (str) mir_tstrcpy(str, custom); } } -void exportThemes(const TCHAR *filename) +void exportThemes(const wchar_t *filename) { - FILE *fExport = _tfopen(filename, L"wt"); + FILE *fExport = _wfopen(filename, L"wt"); if (!fExport) return; fwprintf(fExport, TranslateT("\n; Automatically generated Keyboard Notify Theme file\n\n\n")); - TCHAR *szTheme; + wchar_t *szTheme; for (int i = 0; szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) { - _ftprintf(fExport, L"[%s]\n", szTheme); + fwprintf(fExport, L"[%s]\n", szTheme); mir_free(szTheme); if (szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i))) { - _ftprintf(fExport, L"%s\n\n", szTheme); + fwprintf(fExport, L"%s\n\n", szTheme); mir_free(szTheme); } else - _ftprintf(fExport, L"0\n\n"); + fwprintf(fExport, L"0\n\n"); } - _ftprintf(fExport, TranslateT("\n; End of automatically generated Keyboard Notify Theme file\n")); + fwprintf(fExport, TranslateT("\n; End of automatically generated Keyboard Notify Theme file\n")); fclose(fExport); } -void importThemes(const TCHAR *filename, BOOL overrideExisting) +void importThemes(const wchar_t *filename, BOOL overrideExisting) { - FILE *fImport = _tfopen(filename, L"rt"); + FILE *fImport = _wfopen(filename, L"rt"); if (!fImport) return; int status = 0; size_t i; - TCHAR buffer[MAX_PATH + 1], theme[MAX_PATH + 1], *str; + wchar_t buffer[MAX_PATH + 1], theme[MAX_PATH + 1], *str; - while (_fgetts(buffer, MAX_PATH, fImport) != NULL) { + while (fgetws(buffer, MAX_PATH, fImport) != NULL) { for (str = buffer; *str && isspace(*str); str++); //ltrim if (!*str || *str == ';') //empty line or comment continue; @@ -119,7 +119,7 @@ void importThemes(const TCHAR *filename, BOOL overrideExisting) static void createProcessListAux(void) { ProcessListAux.count = ProcessList.count; - ProcessListAux.szFileName = (TCHAR **)mir_alloc(ProcessListAux.count * sizeof(TCHAR *)); + ProcessListAux.szFileName = (wchar_t **)mir_alloc(ProcessListAux.count * sizeof(wchar_t *)); if (!ProcessListAux.szFileName) ProcessListAux.count = 0; else @@ -213,7 +213,7 @@ static INT_PTR CALLBACK DlgProcProcesses(HWND hwndDlg, UINT msg, WPARAM wParam, EnableWindow(GetDlgItem(hwndDlg, IDC_DELETEPGM), TRUE); break; case CBN_EDITCHANGE: - TCHAR szFileName[MAX_PATH + 1]; + wchar_t szFileName[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_PROGRAMS, szFileName, _countof(szFileName)); int item = SendMessage((HWND)lParam, CB_FINDSTRINGEXACT, -1, (LPARAM)szFileName); if (item == CB_ERR) { //new program @@ -229,7 +229,7 @@ static INT_PTR CALLBACK DlgProcProcesses(HWND hwndDlg, UINT msg, WPARAM wParam, break; case IDC_ADDPGM: { - TCHAR szFileName[MAX_PATH + 1]; + wchar_t szFileName[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_PROGRAMS, szFileName, _countof(szFileName)); if (!szFileName[0]) break; @@ -240,7 +240,7 @@ static INT_PTR CALLBACK DlgProcProcesses(HWND hwndDlg, UINT msg, WPARAM wParam, break; case IDC_DELETEPGM: { - TCHAR szFileName[MAX_PATH + 1]; + wchar_t szFileName[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_PROGRAMS, szFileName, _countof(szFileName)); int item = SendDlgItemMessage(hwndDlg, IDC_PROGRAMS, CB_FINDSTRINGEXACT, -1, (LPARAM)szFileName); SendDlgItemMessage(hwndDlg, IDC_PROGRAMS, CB_DELETESTRING, (WPARAM)item, 0); @@ -256,12 +256,12 @@ static INT_PTR CALLBACK DlgProcProcesses(HWND hwndDlg, UINT msg, WPARAM wParam, destroyProcessListAux(); ProcessListAux.count = SendDlgItemMessage(hwndDlg, IDC_PROGRAMS, CB_GETCOUNT, 0, 0); - ProcessListAux.szFileName = (TCHAR **)mir_alloc(ProcessListAux.count * sizeof(TCHAR *)); + ProcessListAux.szFileName = (wchar_t **)mir_alloc(ProcessListAux.count * sizeof(wchar_t *)); if (!ProcessListAux.szFileName) ProcessListAux.count = 0; else for (int i = 0; i < ProcessListAux.count; i++) { - TCHAR szFileNameAux[MAX_PATH + 1]; + wchar_t szFileNameAux[MAX_PATH + 1]; SendDlgItemMessage(hwndDlg, IDC_PROGRAMS, CB_GETLBTEXT, (WPARAM)i, (LPARAM)szFileNameAux); ProcessListAux.szFileName[i] = mir_tstrdup(szFileNameAux); @@ -337,7 +337,7 @@ static INT_PTR CALLBACK DlgProcXstatusList(HWND hwndDlg, UINT msg, WPARAM wParam tvis.item.pszText = TranslateT("None"); } else { - TCHAR szDefaultName[1024]; + wchar_t szDefaultName[1024]; CUSTOM_STATUS xstatus = { 0 }; xstatus.cbSize = sizeof(CUSTOM_STATUS); xstatus.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR; @@ -864,7 +864,7 @@ static INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wPar EnableWindow(GetDlgItem(hwndDlg, IDC_SEQORDER), FALSE); CheckDlgButton(hwndDlg, IDC_CUSTOM, bFlashEffect == FLASH_CUSTOM ? BST_CHECKED : BST_UNCHECKED); - TCHAR *szTheme; + wchar_t *szTheme; for (int i = 0; szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) { int index = SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)szTheme); mir_free(szTheme); @@ -1000,12 +1000,12 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara SendDlgItemMessage(hwndDlg, IDC_THEME, EM_LIMITTEXT, MAX_PATH, 0); SendDlgItemMessage(hwndDlg, IDC_CUSTOMSTRING, EM_LIMITTEXT, MAX_PATH, 0); - TCHAR *szTheme; + wchar_t *szTheme; for (int i = 0; szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) { int index = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)szTheme); mir_free(szTheme); if (index != CB_ERR && index != CB_ERRSPACE) { - TCHAR *str = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i)); + wchar_t *str = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i)); if (str) SendDlgItemMessage(hwndDlg, IDC_THEME, CB_SETITEMDATA, (WPARAM)index, (LPARAM)str); } @@ -1017,7 +1017,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara EnableWindow(GetDlgItem(hwndDlg, IDC_DELETE), FALSE); else { SendDlgItemMessage(hwndDlg, IDC_THEME, CB_SETCURSEL, (WPARAM)wCustomTheme, 0); - TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)wCustomTheme, 0); + wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)wCustomTheme, 0); if (str) SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str); } @@ -1033,7 +1033,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara switch (HIWORD(wParam)) { case CBN_SELENDOK: case CBN_SELCHANGE: { - TCHAR *str = (TCHAR *)SendMessage((HWND)lParam, CB_GETITEMDATA, (WPARAM)SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0), 0); + wchar_t *str = (wchar_t *)SendMessage((HWND)lParam, CB_GETITEMDATA, (WPARAM)SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0), 0); if (str) SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str); else @@ -1044,7 +1044,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara } break; case CBN_EDITCHANGE: - TCHAR theme[MAX_PATH + 1]; + wchar_t theme[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_THEME, theme, _countof(theme)); int item = SendMessage((HWND)lParam, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); if (item == CB_ERR) { @@ -1054,7 +1054,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara EnableWindow(GetDlgItem(hwndDlg, IDC_DELETE), FALSE); } else { - TCHAR *str = (TCHAR *)SendMessage((HWND)lParam, CB_GETITEMDATA, (WPARAM)item, 0); + wchar_t *str = (wchar_t *)SendMessage((HWND)lParam, CB_GETITEMDATA, (WPARAM)item, 0); if (str) SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str); else @@ -1068,13 +1068,13 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara return TRUE; case IDC_CUSTOMSTRING: if (HIWORD(wParam) == EN_CHANGE) { - TCHAR theme[MAX_PATH + 1], customAux[MAX_PATH + 1]; + wchar_t theme[MAX_PATH + 1], customAux[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_THEME, theme, _countof(theme)); int item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); if (item == CB_ERR) return TRUE; - TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); + wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); if (str) { GetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, customAux, _countof(customAux)); if (mir_wstrcmp(str, customAux)) @@ -1086,7 +1086,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara return TRUE; case IDC_TEST: { - TCHAR custom[MAX_PATH + 1]; + wchar_t custom[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, custom, _countof(custom)); SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, normalizeCustomString(custom)); @@ -1095,13 +1095,13 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara return TRUE; case IDC_ADD: { - TCHAR theme[MAX_PATH + 1]; + wchar_t theme[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_THEME, theme, _countof(theme)); if (!theme[0]) return TRUE; int item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_ADDSTRING, 0, (LPARAM)theme); - TCHAR *str = (TCHAR *)mir_alloc((MAX_PATH + 1)*sizeof(TCHAR)); + wchar_t *str = (wchar_t *)mir_alloc((MAX_PATH + 1)*sizeof(wchar_t)); if (str) { GetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str, MAX_PATH); SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, normalizeCustomString(str)); @@ -1115,11 +1115,11 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara return TRUE; case IDC_UPDATE: { - TCHAR theme[MAX_PATH + 1]; + wchar_t theme[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_THEME, theme, _countof(theme)); int item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); - TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); + wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); if (str) { GetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str, MAX_PATH); SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, normalizeCustomString(str)); @@ -1130,11 +1130,11 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara return TRUE; case IDC_DELETE: { - TCHAR theme[MAX_PATH + 1]; + wchar_t theme[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_THEME, theme, _countof(theme)); int item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); - TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); + wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); if (str) mir_free(str); SendDlgItemMessage(hwndDlg, IDC_THEME, CB_DELETESTRING, (WPARAM)item, 0); @@ -1145,7 +1145,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara } else { SendDlgItemMessage(hwndDlg, IDC_THEME, CB_SETCURSEL, 0, 0); - str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, 0, 0); + str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, 0, 0); if (str) SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str); } @@ -1155,10 +1155,10 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara return TRUE; case IDC_EXPORT: { - TCHAR path[MAX_PATH + 1], filter[MAX_PATH + 1], *pfilter; + wchar_t path[MAX_PATH + 1], filter[MAX_PATH + 1], *pfilter; OPENFILENAME ofn = { 0 }; - path[0] = _T('\0'); + path[0] = '\0'; ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = hwndDlg; ofn.hInstance = NULL; @@ -1171,7 +1171,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara pfilter = pfilter + mir_tstrlen(pfilter) + 1; mir_tstrcpy(pfilter, L"*.*"); pfilter = pfilter + mir_tstrlen(pfilter) + 1; - *pfilter = _T('\0'); + *pfilter = '\0'; ofn.lpstrFilter = filter; ofn.lpstrFile = path; ofn.Flags = OFN_HIDEREADONLY | OFN_NOCHANGEDIR | OFN_NOREADONLYRETURN | OFN_PATHMUSTEXIST; @@ -1183,10 +1183,10 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara return TRUE; case IDC_IMPORT: { - TCHAR path[MAX_PATH + 1], filter[MAX_PATH + 1], *pfilter; + wchar_t path[MAX_PATH + 1], filter[MAX_PATH + 1], *pfilter; OPENFILENAME ofn = { 0 }; - path[0] = _T('\0'); + path[0] = '\0'; ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = hwndDlg; ofn.hInstance = NULL; @@ -1199,7 +1199,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara pfilter = pfilter + mir_tstrlen(pfilter) + 1; mir_tstrcpy(pfilter, L"*.*"); pfilter = pfilter + mir_tstrlen(pfilter) + 1; - *pfilter = _T('\0'); + *pfilter = '\0'; ofn.lpstrFilter = filter; ofn.lpstrFile = path; ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR; @@ -1220,7 +1220,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara case WM_NOTIFY: { int count; - TCHAR theme[MAX_PATH + 1], themeAux[MAX_PATH + 1]; + wchar_t theme[MAX_PATH + 1], themeAux[MAX_PATH + 1]; // Here we have pressed either the OK or the APPLY button. switch (((LPNMHDR)lParam)->idFrom) { case 0: @@ -1231,7 +1231,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara mir_free(szTheme); } else - theme[0] = _T('\0'); + theme[0] = '\0'; // Here we will delete all the items in the theme combo on the Flashing tab: we will load them again later for (int i = 0; SendDlgItemMessage(hwndEffect, IDC_SCUSTOM, CB_DELETESTRING, 0, (LPARAM)i) != CB_ERR; i++); @@ -1240,7 +1240,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara for (int i = 0; i < count; i++) { SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETLBTEXT, (WPARAM)i, (LPARAM)themeAux); db_set_ts(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), themeAux); - TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)i, 0); + wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)i, 0); if (str) db_set_ts(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), str); else @@ -1274,7 +1274,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara int count = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETCOUNT, 0, 0); for (int item = 0; item < count; item++) { - TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); + wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); if (str) mir_free(str); } diff --git a/plugins/KeyboardNotify/src/utils.cpp b/plugins/KeyboardNotify/src/utils.cpp index 23b9408ff2..b7d59819b8 100644 --- a/plugins/KeyboardNotify/src/utils.cpp +++ b/plugins/KeyboardNotify/src/utils.cpp @@ -31,9 +31,9 @@ char *fmtDBSettingName(const char *fmt, ...) }
-TCHAR *getAbsoluteProfileName(TCHAR *absoluteProfileName, size_t maxLen)
+wchar_t *getAbsoluteProfileName(wchar_t *absoluteProfileName, size_t maxLen)
{
- TCHAR profilePath[MAX_PATH+1], profileName[MAX_PATH+1];
+ wchar_t profilePath[MAX_PATH+1], profileName[MAX_PATH+1];
profilePath[0] = profileName[0] = '\0';
CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)profilePath);
diff --git a/plugins/KeyboardNotify/src/utils.h b/plugins/KeyboardNotify/src/utils.h index 66917754ed..64e83feeb5 100644 --- a/plugins/KeyboardNotify/src/utils.h +++ b/plugins/KeyboardNotify/src/utils.h @@ -17,4 +17,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
char *fmtDBSettingName(const char *, ...);
-TCHAR *getAbsoluteProfileName(TCHAR *, size_t);
+wchar_t *getAbsoluteProfileName(wchar_t *, size_t);
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index a383681c07..6292695560 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -62,7 +62,7 @@ INT_PTR ListeningToEnabled(WPARAM wParam, LPARAM lParam); INT_PTR EnableListeningTo(WPARAM wParam, LPARAM lParam);
INT_PTR EnableListeningTo(char *proto = NULL, bool enabled = false);
INT_PTR GetTextFormat(WPARAM wParam, LPARAM lParam);
-TCHAR* GetParsedFormat(LISTENINGTOINFO *lti);
+wchar_t* GetParsedFormat(LISTENINGTOINFO *lti);
INT_PTR GetParsedFormat(WPARAM wParam, LPARAM lParam);
INT_PTR GetOverrideContactOption(WPARAM wParam, LPARAM lParam);
INT_PTR GetUnknownText(WPARAM wParam, LPARAM lParam);
@@ -73,21 +73,21 @@ INT_PTR HotkeysEnable(WPARAM wParam, LPARAM lParam); INT_PTR HotkeysDisable(WPARAM wParam, LPARAM lParam);
INT_PTR HotkeysToggle(WPARAM wParam, LPARAM lParam);
-TCHAR* VariablesParseInfo(ARGUMENTSINFO *ai);
-TCHAR* VariablesParseType(ARGUMENTSINFO *ai);
-TCHAR* VariablesParseArtist(ARGUMENTSINFO *ai);
-TCHAR* VariablesParseAlbum(ARGUMENTSINFO *ai);
-TCHAR* VariablesParseTitle(ARGUMENTSINFO *ai);
-TCHAR* VariablesParseTrack(ARGUMENTSINFO *ai);
-TCHAR* VariablesParseYear(ARGUMENTSINFO *ai);
-TCHAR* VariablesParseGenre(ARGUMENTSINFO *ai);
-TCHAR* VariablesParseLength(ARGUMENTSINFO *ai);
-TCHAR* VariablesParsePlayer(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseInfo(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseType(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseArtist(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseAlbum(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseTitle(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseTrack(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseYear(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseGenre(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseLength(ARGUMENTSINFO *ai);
+wchar_t* VariablesParsePlayer(ARGUMENTSINFO *ai);
#define XSTATUS_MUSIC 11
-#define UNKNOWN(_X_) ( _X_ == NULL || _X_[0] == _T('\0') ? opts.unknown : _X_ )
+#define UNKNOWN(_X_) ( _X_ == NULL || _X_[0] == '\0' ? opts.unknown : _X_ )
// Functions ////////////////////////////////////////////////////////////////////////////
@@ -185,7 +185,7 @@ void RebuildMenu() if (info->hMenu != NULL)
Menu_RemoveItem(info->hMenu);
- TCHAR text[512];
+ wchar_t text[512];
mir_sntprintf(text, TranslateT("Send to %s"), info->account);
CMenuItem mi;
@@ -193,7 +193,7 @@ void RebuildMenu() mi.root = hMainMenuGroup;
mi.position = 500080000 + i;
mi.pszService = MS_LISTENINGTO_MAINMENU;
- mi.name.t = text;
+ mi.name.w = text;
mi.flags = CMIF_TCHAR | CMIF_UNMOVABLE
| (ListeningToEnabled(info->proto, TRUE) ? CMIF_CHECKED : 0)
| (opts.enable_sending ? 0 : CMIF_GRAYED);
@@ -205,7 +205,7 @@ void RebuildMenu() UpdateGlobalStatusMenus();
}
-void RegisterProtocol(char *proto, TCHAR *account)
+void RegisterProtocol(char *proto, wchar_t *account)
{
if (!ProtoServiceExists(proto, PS_SET_LISTENINGTO) && !ProtoServiceExists(proto, PS_SETCUSTOMSTATUSEX) && !ProtoServiceExists(proto, PS_SETAWAYMSG))
return;
@@ -220,8 +220,8 @@ void RegisterProtocol(char *proto, TCHAR *account) proto_items[id].hMenu = NULL;
proto_items[id].old_xstatus = 0;
- proto_items[id].old_xstatus_name[0] = _T('\0');
- proto_items[id].old_xstatus_message[0] = _T('\0');
+ proto_items[id].old_xstatus_name[0] = '\0';
+ proto_items[id].old_xstatus_message[0] = '\0';
}
@@ -236,7 +236,7 @@ int AccListChanged(WPARAM wParam, LPARAM lParam) if (wParam == PRAC_UPGRADED || wParam == PRAC_CHANGED) {
mir_tstrncpy(info->account, proto->tszAccountName, _countof(info->account));
- TCHAR text[512];
+ wchar_t text[512];
mir_sntprintf(text, TranslateT("Send to %s"), info->account);
Menu_ModifyItem(info->hMenu, text);
}
@@ -286,7 +286,7 @@ int ModulesLoaded(WPARAM, LPARAM) CMenuItem mi;
SET_UID(mi, 0xe8e4e594, 0x255e, 0x434d, 0x83, 0x74, 0x79, 0x44, 0x1b, 0x4e, 0xe7, 0x16);
mi.position = 500080000;
- mi.name.t = LPGENT("Listening to");
+ mi.name.w = LPGENW("Listening to");
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = iconList[0].hIcolib;
hMainMenuGroup = Menu_AddMainMenuItem(&mi);
@@ -298,7 +298,7 @@ int ModulesLoaded(WPARAM, LPARAM) // Add all protos
SET_UID(mi, 0xc396a9dd, 0x9a00, 0x46af, 0x96, 0x2e, 0x5, 0x5a, 0xbc, 0x52, 0xfc, 0x9b);
- mi.name.t = LPGENT("Send to all protocols");
+ mi.name.w = LPGENW("Send to all protocols");
mi.flags = CMIF_TCHAR
| (ListeningToEnabled(NULL, true) ? CMIF_CHECKED : 0)
| (opts.enable_sending ? 0 : CMIF_GRAYED);
@@ -307,8 +307,8 @@ int ModulesLoaded(WPARAM, LPARAM) proto_items[0].proto[0] = 0;
proto_items[0].account[0] = 0;
proto_items[0].old_xstatus = 0;
- proto_items[0].old_xstatus_name[0] = _T('\0');
- proto_items[0].old_xstatus_message[0] = _T('\0');
+ proto_items[0].old_xstatus_name[0] = '\0';
+ proto_items[0].old_xstatus_message[0] = '\0';
// Add each proto
PROTOACCOUNT **protos;
@@ -529,8 +529,8 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL) ProtocolInfo *pi = GetProtoInfo(proto);
if (pi != NULL) {
pi->old_xstatus = 0;
- pi->old_xstatus_name[0] = _T('\0');
- pi->old_xstatus_message[0] = _T('\0');
+ pi->old_xstatus_name[0] = '\0';
+ pi->old_xstatus_message[0] = '\0';
}
}
return;
@@ -538,13 +538,13 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL) if (opts.xstatus_set == CHECK_XSTATUS_MUSIC) {
// Set text to nothing
- TCHAR *fr[] = {
+ wchar_t *fr[] = {
L"listening", opts.nothing
};
- Buffer<TCHAR> name;
+ Buffer<wchar_t> name;
ReplaceTemplate(&name, NULL, opts.xstatus_name, fr, _countof(fr));
- Buffer<TCHAR> msg;
+ Buffer<wchar_t> msg;
ReplaceTemplate(&msg, NULL, opts.xstatus_message, fr, _countof(fr));
ics.flags = CSSF_TCHAR | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE;
@@ -577,8 +577,8 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL) if (pi != NULL) {
pi->old_xstatus = 0;
- pi->old_xstatus_name[0] = _T('\0');
- pi->old_xstatus_message[0] = _T('\0');
+ pi->old_xstatus_name[0] = '\0';
+ pi->old_xstatus_message[0] = '\0';
}
}
}
@@ -610,7 +610,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL) }
}
- TCHAR *fr[] = {
+ wchar_t *fr[] = {
L"listening", GetParsedFormat(lti),
L"artist", UNKNOWN(lti->ptszArtist),
L"album", UNKNOWN(lti->ptszAlbum),
@@ -623,9 +623,9 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL) L"type", UNKNOWN(lti->ptszType)
};
- Buffer<TCHAR> name;
+ Buffer<wchar_t> name;
ReplaceTemplate(&name, NULL, opts.xstatus_name, fr, _countof(fr));
- Buffer<TCHAR> msg;
+ Buffer<wchar_t> msg;
ReplaceTemplate(&msg, NULL, opts.xstatus_message, fr, _countof(fr));
status = XSTATUS_MUSIC;
@@ -716,12 +716,12 @@ INT_PTR GetTextFormat(WPARAM, LPARAM) return (INT_PTR)mir_tstrdup(opts.templ);
}
-TCHAR *GetParsedFormat(LISTENINGTOINFO *lti)
+wchar_t *GetParsedFormat(LISTENINGTOINFO *lti)
{
if (lti == NULL)
return NULL;
- TCHAR *fr[] = {
+ wchar_t *fr[] = {
L"artist", UNKNOWN(lti->ptszArtist),
L"album", UNKNOWN(lti->ptszAlbum),
L"title", UNKNOWN(lti->ptszTitle),
@@ -733,7 +733,7 @@ TCHAR *GetParsedFormat(LISTENINGTOINFO *lti) L"type", UNKNOWN(lti->ptszType)
};
- Buffer<TCHAR> ret;
+ Buffer<wchar_t> ret;
ReplaceTemplate(&ret, NULL, opts.templ, fr, _countof(fr));
return ret.detach();
}
@@ -759,7 +759,7 @@ void SetListeningInfos(LISTENINGTOINFO *lti) for (unsigned int i = 1; i < proto_items.size(); ++i)
SetListeningInfo(proto_items[i].proto, lti);
- TCHAR *fr = NULL;
+ wchar_t *fr = NULL;
char *info = NULL;
if (lti) {
@@ -902,7 +902,7 @@ INT_PTR SetNewSong(WPARAM wParam, LPARAM lParam) return 0;
}
-TCHAR* VariablesParseInfo(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseInfo(ARGUMENTSINFO *ai)
{
if (ai->cbSize < sizeof(ARGUMENTSINFO))
return NULL;
@@ -913,7 +913,7 @@ TCHAR* VariablesParseInfo(ARGUMENTSINFO *ai) return mir_tstrdup(L"");
}
- TCHAR *fr[] = {
+ wchar_t *fr[] = {
L"artist", UNKNOWN(lti->ptszArtist),
L"album", UNKNOWN(lti->ptszAlbum),
L"title", UNKNOWN(lti->ptszTitle),
@@ -925,7 +925,7 @@ TCHAR* VariablesParseInfo(ARGUMENTSINFO *ai) L"type", UNKNOWN(lti->ptszType)
};
- Buffer<TCHAR> ret;
+ Buffer<wchar_t> ret;
ReplaceTemplate(&ret, NULL, opts.templ, fr, _countof(fr));
return ret.detach();
}
@@ -948,52 +948,52 @@ TCHAR* VariablesParseInfo(ARGUMENTSINFO *ai) else \
{ \
ai->flags = AIF_DONTPARSE; \
- TCHAR *ret = mir_tstrdup(lti->__field__); \
+ wchar_t *ret = mir_tstrdup(lti->__field__); \
return ret; \
}
-TCHAR* VariablesParseType(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseType(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszType);
}
-TCHAR* VariablesParseArtist(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseArtist(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszArtist);
}
-TCHAR* VariablesParseAlbum(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseAlbum(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszAlbum);
}
-TCHAR* VariablesParseTitle(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseTitle(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszTitle);
}
-TCHAR* VariablesParseTrack(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseTrack(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszTrack);
}
-TCHAR* VariablesParseYear(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseYear(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszYear);
}
-TCHAR* VariablesParseGenre(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseGenre(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszGenre);
}
-TCHAR* VariablesParseLength(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseLength(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszLength);
}
-TCHAR* VariablesParsePlayer(ARGUMENTSINFO *ai)
+wchar_t* VariablesParsePlayer(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszPlayer);
}
diff --git a/plugins/ListeningTo/src/options.cpp b/plugins/ListeningTo/src/options.cpp index 2e36c42b2a..121a5e5869 100644 --- a/plugins/ListeningTo/src/options.cpp +++ b/plugins/ListeningTo/src/options.cpp @@ -52,10 +52,10 @@ static OptPageControl optionsControls[] = { static OptPageControl formatControls[] = {
{ &opts.templ, CONTROL_TEXT, IDC_TEMPLATE, "Template", (ULONG_PTR)L"%artist% - %title%" },
- { &opts.unknown, CONTROL_TEXT, IDC_UNKNOWN, "Unknown", (ULONG_PTR)LPGENT("<Unknown>"), 0, 0, 128 },
- { &opts.xstatus_name, CONTROL_TEXT, IDC_XSTATUS_NAME, "XStatusName", (ULONG_PTR)LPGENT("Listening to") },
+ { &opts.unknown, CONTROL_TEXT, IDC_UNKNOWN, "Unknown", (ULONG_PTR)LPGENW("<Unknown>"), 0, 0, 128 },
+ { &opts.xstatus_name, CONTROL_TEXT, IDC_XSTATUS_NAME, "XStatusName", (ULONG_PTR)LPGENW("Listening to") },
{ &opts.xstatus_message, CONTROL_TEXT, IDC_XSTATUS_MESSAGE, "XStatusMessage", (ULONG_PTR)L"%listening%" },
- { &opts.nothing, CONTROL_TEXT, IDC_NOTHING, "Nothing", (ULONG_PTR)LPGENT("<Nothing is playing now>"), 0, 0, 128 }
+ { &opts.nothing, CONTROL_TEXT, IDC_NOTHING, "Nothing", (ULONG_PTR)LPGENW("<Nothing is playing now>"), 0, 0, 128 }
};
static OptPageControl playersControls[] = {
@@ -131,11 +131,11 @@ BOOL IsTypeEnabled(LISTENINGTOINFO *lti) return TRUE;
if (lti->dwFlags & LTI_UNICODE) {
- if (mir_tstrcmpi(lti->ptszType, LPGENT("Music")) == 0)
+ if (mir_tstrcmpi(lti->ptszType, LPGENW("Music")) == 0)
return opts.enable_music;
- if (mir_tstrcmpi(lti->ptszType, LPGENT("Radio")) == 0)
+ if (mir_tstrcmpi(lti->ptszType, LPGENW("Radio")) == 0)
return opts.enable_radio;
- if (mir_tstrcmpi(lti->ptszType, LPGENT("Video")) == 0)
+ if (mir_tstrcmpi(lti->ptszType, LPGENW("Video")) == 0)
return opts.enable_video;
return opts.enable_others;
}
@@ -192,9 +192,9 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_ADV_ICON, CB_ADDSTRING, 0, (LPARAM)L"2");
if (total > 0) {
- TCHAR tmp[10];
+ wchar_t tmp[10];
for (int i = first; i <= total; i++)
- SendDlgItemMessage(hwndDlg, IDC_ADV_ICON, CB_ADDSTRING, 0, (LPARAM)_itot(i - first + 3, tmp, 10));
+ SendDlgItemMessage(hwndDlg, IDC_ADV_ICON, CB_ADDSTRING, 0, (LPARAM)_itow(i - first + 3, tmp, 10));
}
}
diff --git a/plugins/ListeningTo/src/options.h b/plugins/ListeningTo/src/options.h index 0aff9030fd..002237cf17 100644 --- a/plugins/ListeningTo/src/options.h +++ b/plugins/ListeningTo/src/options.h @@ -48,8 +48,8 @@ struct Options { bool enable_video;
bool enable_others;
- TCHAR templ[1024];
- TCHAR unknown[128];
+ wchar_t templ[1024];
+ wchar_t unknown[128];
bool override_contact_template;
bool show_adv_icon;
@@ -61,9 +61,9 @@ struct Options { int time_to_pool;
WORD xstatus_set;
- TCHAR xstatus_name[1024];
- TCHAR xstatus_message[1024];
- TCHAR nothing[128];
+ wchar_t xstatus_name[1024];
+ wchar_t xstatus_message[1024];
+ wchar_t nothing[128];
};
extern Options opts;
diff --git a/plugins/ListeningTo/src/players/foobar.cpp b/plugins/ListeningTo/src/players/foobar.cpp index eb06043b11..8e9f14eaac 100644 --- a/plugins/ListeningTo/src/players/foobar.cpp +++ b/plugins/ListeningTo/src/players/foobar.cpp @@ -19,7 +19,7 @@ Boston, MA 02111-1307, USA. #include "../stdafx.h"
-static TCHAR *wcs[] = {
+static wchar_t *wcs[] = {
L"{DA7CD0DE-1602-45e6-89A1-C2CA151E008E}/1", // Foobar 0.9.1
L"{DA7CD0DE-1602-45e6-89A1-C2CA151E008E}",
L"{97E27FAA-C0B3-4b8e-A693-ED7881E99FC1}", // Foobar 0.9.5.3
diff --git a/plugins/ListeningTo/src/players/generic.cpp b/plugins/ListeningTo/src/players/generic.cpp index 62456fd480..551d0d2a5e 100644 --- a/plugins/ListeningTo/src/players/generic.cpp +++ b/plugins/ListeningTo/src/players/generic.cpp @@ -24,7 +24,7 @@ static HANDLE hLog = NULL; GenericPlayer *singleton = NULL;
-void m_log(const TCHAR *function, const TCHAR *fmt, ...)
+void m_log(const wchar_t *function, const wchar_t *fmt, ...)
{
if (hLog == NULL) {
hLog = mir_createLog(MODULE_NAME, L"ListeningTo log", L"c:\\temp\\listeningto.txt", 0);
@@ -80,7 +80,7 @@ GenericPlayer::GenericPlayer() RegisterClass(&wc);
- hWnd = CreateWindow(MIRANDA_WINDOWCLASS, LPGENT("Miranda ListeningTo receiver"),
+ hWnd = CreateWindow(MIRANDA_WINDOWCLASS, LPGENW("Miranda ListeningTo receiver"),
0, 0, 0, 0, 0, NULL, NULL, hInst, NULL);
}
@@ -118,14 +118,14 @@ void GenericPlayer::ProcessReceived() int pCount = 0;
WCHAR *p = received;
do {
- *p1 = _T('\0');
+ *p1 = '\0';
parts[pCount] = p;
pCount++;
p = p1 + 2;
p1 = wcsstr(p, L"\\0");
} while (p1 != NULL && pCount < 10);
if (p1 != NULL)
- *p1 = _T('\0');
+ *p1 = '\0';
parts[pCount] = p;
if (pCount < 5)
@@ -170,7 +170,7 @@ void GenericPlayer::ProcessReceived() if (parts[9] != NULL) {
long length = _wtoi(parts[9]);
if (length > 0) {
- li->ptszLength = (TCHAR*)mir_alloc(10 * sizeof(TCHAR));
+ li->ptszLength = (wchar_t*)mir_alloc(10 * sizeof(wchar_t));
int s = length % 60;
int m = (length / 60) % 60;
@@ -212,7 +212,7 @@ static VOID CALLBACK SendTimerProc(HWND, UINT, UINT_PTR, DWORD) void GenericPlayer::NewData(const WCHAR *data, size_t len)
{
- if (data[0] == _T('\0'))
+ if (data[0] == '\0')
return;
mir_cslock lck(cs);
diff --git a/plugins/ListeningTo/src/players/itunes.cpp b/plugins/ListeningTo/src/players/itunes.cpp index 79cea49a13..fa6f2478e6 100644 --- a/plugins/ListeningTo/src/players/itunes.cpp +++ b/plugins/ListeningTo/src/players/itunes.cpp @@ -103,14 +103,14 @@ BOOL ITunes::FillCache() CALL(track->get_Year(&lret));
if (lret > 0) {
- listening_info.ptszYear = (TCHAR*)mir_alloc(10 * sizeof(TCHAR));
- _itot(lret, listening_info.ptszYear, 10);
+ listening_info.ptszYear = (wchar_t*)mir_alloc(10 * sizeof(wchar_t));
+ _itow(lret, listening_info.ptszYear, 10);
}
CALL(track->get_TrackNumber(&lret));
if (lret > 0) {
- listening_info.ptszTrack = (TCHAR*)mir_alloc(10 * sizeof(TCHAR));
- _itot(lret, listening_info.ptszTrack, 10);
+ listening_info.ptszTrack = (wchar_t*)mir_alloc(10 * sizeof(wchar_t));
+ _itow(lret, listening_info.ptszTrack, 10);
}
CALL(track->get_Genre(&ret));
@@ -118,7 +118,7 @@ BOOL ITunes::FillCache() CALL(track->get_Duration(&lret));
if (lret > 0) {
- listening_info.ptszLength = (TCHAR*)mir_alloc(10 * sizeof(TCHAR));
+ listening_info.ptszLength = (wchar_t*)mir_alloc(10 * sizeof(wchar_t));
int s = lret % 60;
int m = (lret / 60) % 60;
@@ -142,9 +142,9 @@ BOOL ITunes::FillCache() listening_info.ptszTitle = mir_u2t(p);
- TCHAR *pt = _tcsrchr(listening_info.ptszTitle, '.');
+ wchar_t *pt = wcsrchr(listening_info.ptszTitle, '.');
if (pt != NULL)
- *p = _T('\0');
+ *p = '\0';
}
listening_info.ptszPlayer = mir_tstrdup(name);
diff --git a/plugins/ListeningTo/src/players/itunes.h b/plugins/ListeningTo/src/players/itunes.h index bce9318f1a..cc5c496910 100644 --- a/plugins/ListeningTo/src/players/itunes.h +++ b/plugins/ListeningTo/src/players/itunes.h @@ -38,7 +38,7 @@ protected: BOOL InitTempData();
void FreeTempData();
BOOL InitAndGetFilename();
- int GetMetadata(char *metadata, TCHAR **data);
+ int GetMetadata(char *metadata, wchar_t **data);
BOOL FillCache();
public:
diff --git a/plugins/ListeningTo/src/players/player.h b/plugins/ListeningTo/src/players/player.h index 83a14e3a69..f5505b7374 100644 --- a/plugins/ListeningTo/src/players/player.h +++ b/plugins/ListeningTo/src/players/player.h @@ -29,7 +29,7 @@ protected: public:
BOOL enabled;
BOOL needPoll;
- TCHAR *name;
+ wchar_t *name;
Player();
virtual ~Player();
@@ -48,7 +48,7 @@ public: class ExternalPlayer : public Player
{
protected:
- TCHAR **window_classes;
+ wchar_t **window_classes;
int num_window_classes;
BOOL found_window;
@@ -66,7 +66,7 @@ class CodeInjectionPlayer : public ExternalPlayer {
protected:
char *dll_name;
- TCHAR *message_window_class;
+ wchar_t *message_window_class;
DWORD next_request_time;
virtual void InjectCode();
diff --git a/plugins/ListeningTo/src/players/watrack.cpp b/plugins/ListeningTo/src/players/watrack.cpp index 3a7cd24a0f..d76b79571b 100644 --- a/plugins/ListeningTo/src/players/watrack.cpp +++ b/plugins/ListeningTo/src/players/watrack.cpp @@ -88,14 +88,14 @@ void WATrack::GetData() listening_info.ptszYear = DUP(si->year);
if (si->track > 0) {
- listening_info.ptszTrack = (TCHAR*)mir_alloc(10 * sizeof(TCHAR));
- _itot(si->track, listening_info.ptszTrack, 10);
+ listening_info.ptszTrack = (wchar_t*)mir_alloc(10 * sizeof(wchar_t));
+ _itow(si->track, listening_info.ptszTrack, 10);
}
listening_info.ptszGenre = DUP(si->genre);
if (si->total > 0) {
- listening_info.ptszLength = (TCHAR*)mir_alloc(10 * sizeof(TCHAR));
+ listening_info.ptszLength = (wchar_t*)mir_alloc(10 * sizeof(wchar_t));
int s = si->total % 60;
int m = (si->total / 60) % 60;
diff --git a/plugins/ListeningTo/src/players/winamp.cpp b/plugins/ListeningTo/src/players/winamp.cpp index 35bfde5cfe..685459fb63 100644 --- a/plugins/ListeningTo/src/players/winamp.cpp +++ b/plugins/ListeningTo/src/players/winamp.cpp @@ -19,7 +19,7 @@ Boston, MA 02111-1307, USA. #include "../stdafx.h"
-static TCHAR *wcs[] = {
+static wchar_t *wcs[] = {
L"Winamp v1.x"
};
diff --git a/plugins/ListeningTo/src/players/wmp.cpp b/plugins/ListeningTo/src/players/wmp.cpp index 639c384b40..c3131e8718 100644 --- a/plugins/ListeningTo/src/players/wmp.cpp +++ b/plugins/ListeningTo/src/players/wmp.cpp @@ -30,7 +30,7 @@ WindowsMediaPlayer *singleton = NULL; WindowsMediaPlayer::WindowsMediaPlayer()
{
name = L"WindowsMediaPlayer";
- received[0] = _T('\0');
+ received[0] = '\0';
singleton = this;
WNDCLASS wc = { 0 };
@@ -40,7 +40,7 @@ WindowsMediaPlayer::WindowsMediaPlayer() RegisterClass(&wc);
- hWnd = CreateWindow(WMP_WINDOWCLASS, LPGENT("Miranda ListeningTo WMP receiver"),
+ hWnd = CreateWindow(WMP_WINDOWCLASS, LPGENW("Miranda ListeningTo WMP receiver"),
0, 0, 0, 0, 0, NULL, NULL, hInst, NULL);
}
@@ -132,7 +132,7 @@ void WindowsMediaPlayer::NewData(const WCHAR *data, size_t len) len = min(len, 1023);
if (wcsncmp(received, data, len) != 0) {
wcsncpy(received, data, len);
- received[len] = _T('\0');
+ received[len] = '\0';
if (hTimer)
KillTimer(NULL, hTimer);
diff --git a/plugins/ListeningTo/src/stdafx.h b/plugins/ListeningTo/src/stdafx.h index 81ba49f016..535d581660 100644 --- a/plugins/ListeningTo/src/stdafx.h +++ b/plugins/ListeningTo/src/stdafx.h @@ -87,15 +87,15 @@ void StartTimer(); struct ProtocolInfo
{
char proto[128];
- TCHAR account[128];
+ wchar_t account[128];
HGENMENU hMenu;
int old_xstatus;
- TCHAR old_xstatus_name[1024];
- TCHAR old_xstatus_message[1024];
+ wchar_t old_xstatus_name[1024];
+ wchar_t old_xstatus_message[1024];
};
ProtocolInfo *GetProtoInfo(char *proto);
-void m_log(const TCHAR *function, const TCHAR *fmt, ...);
+void m_log(const wchar_t *function, const wchar_t *fmt, ...);
static bool IsEmpty(const char *str)
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index fdd573b3bb..062961e373 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -40,7 +40,7 @@ static UINT TID = (UINT)2006; char settingServer[MAX_SETTING_STR] = "", settingServerSec[MAX_SETTING_STR] = "", settingDatabase[MAX_SETTING_STR] = "",
settingCommand[MAX_SETTING_STR] = "", settingParameters[MAX_SETTING_STR] = "", settingPassword[MAX_SETTING_STR] = "";
-TCHAR settingFilterSubject[MAX_SETTING_STR] = TEXT(""), settingFilterSender[MAX_SETTING_STR] = TEXT(""), settingFilterTo[MAX_SETTING_STR] = TEXT("");
+wchar_t settingFilterSubject[MAX_SETTING_STR] = TEXT(""), settingFilterSender[MAX_SETTING_STR] = TEXT(""), settingFilterTo[MAX_SETTING_STR] = TEXT("");
COLORREF settingBgColor, settingFgColor;
int settingInterval = 0, settingInterval1 = 0;
@@ -57,12 +57,12 @@ BOOL isPopupWaiting = FALSE; int currentStatus = ID_STATUS_OFFLINE;
int diffstat = 0;
int startuperror = 0;
-TCHAR *startuperrors[] = {
- LPGENT("Unable to load all required Lotus API functions"),
- LPGENT("Lotus Notes Client not detected. Check plugin configuration description on install.txt"),
- LPGENT("Unable to initialize Notes."),
- LPGENT("Lotus Notes Extension Manager was not registered. Authentication function will not work properly"),
- LPGENT("In notes.ini file there is no required entry EXTMGR_ADDINS=plugindllnamewithout\".dll\"")
+wchar_t *startuperrors[] = {
+ LPGENW("Unable to load all required Lotus API functions"),
+ LPGENW("Lotus Notes Client not detected. Check plugin configuration description on install.txt"),
+ LPGENW("Unable to initialize Notes."),
+ LPGENW("Lotus Notes Extension Manager was not registered. Authentication function will not work properly"),
+ LPGENW("In notes.ini file there is no required entry EXTMGR_ADDINS=plugindllnamewithout\".dll\"")
};
@@ -262,30 +262,30 @@ BOOL strrep(char *src, char *needle, char *newstring) //check if given string contain filter string
//param field= 0-sender
// 1-subject
-BOOL checkFilters(TCHAR* str, int field)
+BOOL checkFilters(wchar_t* str, int field)
{
- TCHAR buff[512] = L"";
- TCHAR *strptr = NULL;
+ wchar_t buff[512] = L"";
+ wchar_t *strptr = NULL;
switch(field) {
case 0:
- _tcsncpy_s(buff, settingFilterSender, _TRUNCATE);
+ wcsncpy_s(buff, settingFilterSender, _TRUNCATE);
break;
case 1:
- _tcsncpy_s(buff, settingFilterSubject, _TRUNCATE);
+ wcsncpy_s(buff, settingFilterSubject, _TRUNCATE);
break;
case 2:
- _tcsncpy_s(buff, settingFilterTo, _TRUNCATE);
+ wcsncpy_s(buff, settingFilterTo, _TRUNCATE);
break;
}
- while(strptr = _tcschr(buff, ';'))
+ while(strptr = wcschr(buff, ';'))
{
- TCHAR tmp[512] = TEXT(""), *ptr;
- _tcsncpy_s(tmp, buff, (strptr-buff));
- _tcsncpy_s(buff, strptr + 1, _TRUNCATE);
+ wchar_t tmp[512] = TEXT(""), *ptr;
+ wcsncpy_s(tmp, buff, (strptr-buff));
+ wcsncpy_s(buff, strptr + 1, _TRUNCATE);
- if(_tcsstr(_tcslwr(ptr=_tcsdup(str)),_tcslwr(tmp)))
+ if(wcsstr(wcslwr(ptr=wcsdup(str)),wcslwr(tmp)))
{
free(ptr);
return TRUE;
@@ -436,7 +436,7 @@ BOOL checkNotesIniFile(BOOL bInfo) //popup plugin to show popup function
-void showMsg(TCHAR* sender,TCHAR* text, DWORD id, char *strUID)
+void showMsg(wchar_t* sender,wchar_t* text, DWORD id, char *strUID)
{
POPUPDATAT ppd;
@@ -452,8 +452,8 @@ void showMsg(TCHAR* sender,TCHAR* text, DWORD id, char *strUID) memset(&ppd, 0, sizeof(ppd)); //This is always a good thing to do.
ppd.lchContact = NULL; //(HANDLE)hContact; //Be sure to use a GOOD handle, since this will not be checked.
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON1));
- _tcscpy_s(ppd.lptzContactName, _countof(ppd.lptzContactName), sender);
- _tcscpy_s(ppd.lptzText, _countof(ppd.lptzText), text);
+ wcscpy_s(ppd.lptzContactName, _countof(ppd.lptzContactName), sender);
+ wcscpy_s(ppd.lptzText, _countof(ppd.lptzText), text);
if(settingSetColours)
{
ppd.colorBack = settingBgColor;
@@ -478,18 +478,18 @@ void showMsg(TCHAR* sender,TCHAR* text, DWORD id, char *strUID) //what to do with error msg
void ErMsgW(WCHAR* msg)
{
- TCHAR* msgT = mir_u2t(msg);
+ wchar_t* msgT = mir_u2t(msg);
ErMsgT(msgT);
mir_free(msgT);
}
-///TODO TCHAR->WCHAR and test
-void ErMsgT(TCHAR* msg)
+///TODO wchar_t->WCHAR and test
+void ErMsgT(wchar_t* msg)
{
log_p(L"Error: %S", msg);
if(settingShowError && !isPopupWaiting) {
- TCHAR buffer[256+14];
- _tcsncpy_s(buffer, L"LotusNotify: ", _TRUNCATE);
- _tcscat_s(buffer, msg);
+ wchar_t buffer[256+14];
+ wcsncpy_s(buffer, L"LotusNotify: ", _TRUNCATE);
+ wcscat_s(buffer, msg);
isPopupWaiting = TRUE;
PUShowMessageT(buffer, SM_WARNING);
isPopupWaiting = FALSE;
@@ -562,7 +562,7 @@ void checkthread(void*) char field_date[MAXALPHATIMEDATE + 1];
char field_lotus_LMBCS[MAX_FIELD];
- char field_lotus_UNICODEatCHAR[MAX_FIELD * sizeof(TCHAR)];
+ char field_lotus_UNICODEatCHAR[MAX_FIELD * sizeof(wchar_t)];
WCHAR field_from_UNICODE[MAX_FIELD], field_subject_UNICODE[MAX_FIELD], field_to_UNICODE[MAX_FIELD],field_copy_UNICODE[MAX_FIELD];
mir_cslock lck(checkthreadCS);
@@ -716,7 +716,7 @@ void checkthread(void*) field_len = NSFItemGetText1(note_handle, MAIL_FROM_ITEM, field_lotus_LMBCS, (WORD)sizeof(field_lotus_LMBCS));
OSTranslate1(OS_TRANSLATE_LMBCS_TO_UNICODE, field_lotus_LMBCS, field_len, field_lotus_UNICODEatCHAR, sizeof(field_lotus_UNICODEatCHAR));
- memcpy(field_from_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(TCHAR));
+ memcpy(field_from_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(wchar_t));
field_from_UNICODE[field_len] = '\0';
NSFItemGetTime1(note_handle, MAIL_POSTEDDATE_ITEM, &sendDate);
@@ -725,17 +725,17 @@ void checkthread(void*) field_len = NSFItemGetText1(note_handle, MAIL_SUBJECT_ITEM, field_lotus_LMBCS, (WORD)sizeof(field_lotus_LMBCS));
OSTranslate1(OS_TRANSLATE_LMBCS_TO_UNICODE, field_lotus_LMBCS, field_len, field_lotus_UNICODEatCHAR, sizeof(field_lotus_UNICODEatCHAR));
- memcpy(field_subject_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(TCHAR));
+ memcpy(field_subject_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(wchar_t));
field_subject_UNICODE[field_len] = '\0';
field_len = NSFItemGetText1(note_handle, MAIL_SENDTO_ITEM, field_lotus_LMBCS, (WORD)sizeof(field_lotus_LMBCS));
OSTranslate1(OS_TRANSLATE_LMBCS_TO_UNICODE, field_lotus_LMBCS, field_len, field_lotus_UNICODEatCHAR, sizeof(field_lotus_UNICODEatCHAR));
- memcpy(field_to_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(TCHAR));
+ memcpy(field_to_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(wchar_t));
field_to_UNICODE[field_len] = '\0';
field_len = NSFItemGetText1(note_handle, MAIL_COPYTO_ITEM, field_lotus_LMBCS, (WORD)sizeof(field_lotus_LMBCS));
OSTranslate1(OS_TRANSLATE_LMBCS_TO_UNICODE, field_lotus_LMBCS, field_len, field_lotus_UNICODEatCHAR, sizeof(field_lotus_UNICODEatCHAR));
- memcpy(field_copy_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(TCHAR));
+ memcpy(field_copy_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(wchar_t));
field_copy_UNICODE[field_len] = '\0';
@@ -744,9 +744,9 @@ void checkthread(void*) memset(msgSubject, 0, sizeof(msgSubject));
if (mir_wstrlen(field_from_UNICODE) < 512 && mir_wstrlen(field_from_UNICODE) > 3 && wcsstr(field_from_UNICODE, L"CN=") == field_from_UNICODE)
- _tcsncpy_s(msgFrom, &(field_from_UNICODE[3]), wcscspn(field_from_UNICODE, L"/") - 3);
+ wcsncpy_s(msgFrom, &(field_from_UNICODE[3]), wcscspn(field_from_UNICODE, L"/") - 3);
else
- _tcsncpy_s(msgFrom, field_from_UNICODE, _TRUNCATE);
+ wcsncpy_s(msgFrom, field_from_UNICODE, _TRUNCATE);
for (Att = 0; MailGetMessageAttachmentInfo1(note_handle, Att, &bhAttachment, NULL, &cSize, NULL, NULL, NULL, NULL); Att++)
attSize += cSize;
@@ -775,7 +775,7 @@ void checkthread(void*) if (attSize) {
WCHAR field_attachments_UNICODE[MAX_FIELD];
- mir_sntprintf(field_attachments_UNICODE, TranslateW(L"Attachments: %d bytes"), attSize);
+ mir_sntprintf(field_attachments_UNICODE, TranslateT("Attachments: %d bytes"), attSize);
mir_sntprintf(msgSubject, L"%S\n%s\n%s", field_date, field_subject_UNICODE, field_attachments_UNICODE);
}
else {
@@ -986,15 +986,15 @@ static void LoadSettings() }
if (!db_get_ts(NULL, PLUGINNAME, "LNFilterSender", &dbv)) {
- _tcsncpy_s(settingFilterSender, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(settingFilterSender, dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
if (!db_get_ts(NULL, PLUGINNAME, "LNFilterSubject", &dbv)) {
- _tcsncpy_s(settingFilterSubject, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(settingFilterSubject, dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
if (!db_get_ts(NULL, PLUGINNAME, "LNFilterTo", &dbv)) {
- _tcsncpy_s(settingFilterTo, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(settingFilterTo, dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
@@ -1051,28 +1051,28 @@ static void SaveSettings(HWND hwndDlg) settingFilterSender[0] = 0;
for (int i = 0; i < SendDlgItemMessage(hwndDlg, IDC_FILTER_SENDER, CB_GETCOUNT, 0, 0); i++) {
- TCHAR text[512] = TEXT("");
+ wchar_t text[512] = TEXT("");
SendDlgItemMessage(hwndDlg, IDC_FILTER_SENDER, CB_GETLBTEXT, (WPARAM)i, (LPARAM)text);
- _tcscat_s(settingFilterSender, _countof(settingFilterSender), text);
- _tcscat_s(settingFilterSender, _countof(settingFilterSender), TEXT(";"));
+ wcscat_s(settingFilterSender, _countof(settingFilterSender), text);
+ wcscat_s(settingFilterSender, _countof(settingFilterSender), TEXT(";"));
}
db_set_ts(NULL, PLUGINNAME, "LNFilterSender", settingFilterSender);
settingFilterSubject[0] = 0;
for (int i = 0; i < SendDlgItemMessage(hwndDlg, IDC_FILTER_SUBJECT, CB_GETCOUNT, 0, 0); i++) {
- TCHAR text[512] = TEXT("");
+ wchar_t text[512] = TEXT("");
SendDlgItemMessage(hwndDlg, IDC_FILTER_SUBJECT, CB_GETLBTEXT, (WPARAM)i, (LPARAM)text);
- _tcscat_s(settingFilterSubject, _countof(settingFilterSubject), text);
- _tcscat_s(settingFilterSubject, _countof(settingFilterSubject), TEXT(";"));
+ wcscat_s(settingFilterSubject, _countof(settingFilterSubject), text);
+ wcscat_s(settingFilterSubject, _countof(settingFilterSubject), TEXT(";"));
}
db_set_ts(NULL, PLUGINNAME, "LNFilterSubject", settingFilterSubject);
settingFilterTo[0] = 0;
for (int i = 0; i < SendDlgItemMessage(hwndDlg, IDC_FILTER_TO, CB_GETCOUNT, 0, 0); i++) {
- TCHAR text[512] = TEXT("");
+ wchar_t text[512] = TEXT("");
SendDlgItemMessage(hwndDlg, IDC_FILTER_TO, CB_GETLBTEXT, (WPARAM)i, (LPARAM)text);
- _tcscat_s(settingFilterTo, _countof(settingFilterTo), text);
- _tcscat_s(settingFilterTo, _countof(settingFilterTo), TEXT(";"));
+ wcscat_s(settingFilterTo, _countof(settingFilterTo), text);
+ wcscat_s(settingFilterTo, _countof(settingFilterTo), TEXT(";"));
}
db_set_ts(NULL, PLUGINNAME, "LNFilterTo", settingFilterTo);
}
@@ -1293,41 +1293,41 @@ static INT_PTR CALLBACK DlgProcLotusNotifyMiscOpts(HWND hwndDlg, UINT msg, WPARA {
static bool bInit = false;
- TCHAR* strptr;
+ wchar_t* strptr;
LVITEM lvI = { 0 };
LVCOLUMN lvc = { 0 };
switch (msg) {
case WM_INITDIALOG://initialize dialog, so set properties from db.
{
- TCHAR buff[512];
+ wchar_t buff[512];
bInit = true;
TranslateDialogDefault(hwndDlg);//translate miranda function
LoadSettings();
//fill filter combos
- _tcsncpy_s(buff, settingFilterSender, _TRUNCATE);
- while (strptr = _tcschr(buff, TEXT(';'))) {
- TCHAR tmp[512] = TEXT("");
- _tcsncpy_s(tmp, buff, (strptr - buff));
+ wcsncpy_s(buff, settingFilterSender, _TRUNCATE);
+ while (strptr = wcschr(buff, TEXT(';'))) {
+ wchar_t tmp[512] = TEXT("");
+ wcsncpy_s(tmp, buff, (strptr - buff));
SendDlgItemMessage(hwndDlg, IDC_FILTER_SENDER, CB_ADDSTRING, 0, (LPARAM)tmp);
- _tcsncpy_s(buff, strptr + 1, _TRUNCATE);
+ wcsncpy_s(buff, strptr + 1, _TRUNCATE);
}
- _tcsncpy_s(buff, settingFilterSubject, _TRUNCATE);
- while (strptr = _tcschr(buff, TEXT(';'))) {
- TCHAR tmp[512] = TEXT("");
- _tcsncpy_s(tmp, buff, (strptr - buff));
+ wcsncpy_s(buff, settingFilterSubject, _TRUNCATE);
+ while (strptr = wcschr(buff, TEXT(';'))) {
+ wchar_t tmp[512] = TEXT("");
+ wcsncpy_s(tmp, buff, (strptr - buff));
SendDlgItemMessage(hwndDlg, IDC_FILTER_SUBJECT, CB_ADDSTRING, 0, (LPARAM)tmp);
- _tcsncpy_s(buff, strptr + 1, _TRUNCATE);
+ wcsncpy_s(buff, strptr + 1, _TRUNCATE);
}
- _tcsncpy_s(buff, settingFilterTo, _TRUNCATE);
- while (strptr = _tcschr(buff, TEXT(';'))) {
- TCHAR tmp[512] = TEXT("");
- _tcsncpy_s(tmp, buff, (strptr - buff));
+ wcsncpy_s(buff, settingFilterTo, _TRUNCATE);
+ while (strptr = wcschr(buff, TEXT(';'))) {
+ wchar_t tmp[512] = TEXT("");
+ wcsncpy_s(tmp, buff, (strptr - buff));
SendDlgItemMessage(hwndDlg, IDC_FILTER_TO, CB_ADDSTRING, 0, (LPARAM)tmp);
- _tcsncpy_s(buff, strptr + 1, _TRUNCATE);
+ wcsncpy_s(buff, strptr + 1, _TRUNCATE);
}
// initialise and fill listbox
@@ -1455,21 +1455,21 @@ int LotusNotifyOptInit(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("Plugins");
- odp.ptszTitle = LPGENT(__PLUGIN_NAME);
+ odp.pwszGroup = LPGENW("Plugins");
+ odp.pwszTitle = _A2W(__PLUGIN_NAME);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszTab = LPGENT("Connection");
+ odp.pwszTab = LPGENW("Connection");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_LOTUS_CONECTION);
odp.pfnDlgProc = DlgProcLotusNotifyConnectionOpts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Popup");
+ odp.pwszTab = LPGENW("Popup");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_LOTUS_POPUP);
odp.pfnDlgProc = DlgProcLotusNotifyPopupOpts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Miscellaneous");
+ odp.pwszTab = LPGENW("Miscellaneous");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_LOTUS_MISC);
odp.pfnDlgProc = DlgProcLotusNotifyMiscOpts;
Options_AddPage(wParam, &odp);
@@ -1566,14 +1566,14 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam) }
-void checkEnvPath(TCHAR *path)
+void checkEnvPath(wchar_t *path)
{
log_p(L"checkEnvPath: [%s]", path);
- _tcslwr(path);
- TCHAR *cur = _tgetenv(L"PATH");
- _tcslwr(cur);
- TCHAR *found = _tcsstr(cur, path);
+ wcslwr(path);
+ wchar_t *cur = _tgetenv(L"PATH");
+ wcslwr(cur);
+ wchar_t *found = wcsstr(cur, path);
size_t len = mir_tstrlen(path);
if (found != NULL && (found[len] == ';' || found[len] == 0 || (found[len] == '\\' && (found[len + 1] == ';' || found[len + 1] == 0))))
return;
@@ -1593,13 +1593,13 @@ static INT_PTR GetStatus(WPARAM, LPARAM) static int modulesloaded(WPARAM, LPARAM)
{
int cnt;
- TCHAR path[255] = { 0 };
+ wchar_t path[255] = { 0 };
log(L"Modules loaded, lets start LN...");
GetLotusPath(path, sizeof(path));
checkEnvPath(path);
- _tcscat_s(path, _countof(path), L"nnotes.dll");
+ wcscat_s(path, _countof(path), L"nnotes.dll");
assert(mir_tstrlen(path) > 0);
log_p(L"Loading dll: %s", path);
@@ -1701,7 +1701,7 @@ extern "C" int __declspec(dllexport) Load(void) mi.position = -0x7FFFFFFF; //on top menu position
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON1));
- mi.name.t = LPGENT("&Check Lotus");
+ mi.name.w = LPGENW("&Check Lotus");
mi.pszService = "LotusNotify/MenuCommand"; //service name thet listning for menu call
hMenuHandle = Menu_AddMainMenuItem(&mi); //create menu pos.
@@ -1727,7 +1727,7 @@ extern "C" int __declspec(dllexport) Load(void) LoadSettings(); //read from db to variables
- SkinAddNewSoundExT("LotusNotify", LPGENT("Lotus Notify"), LPGENT("New Lotus document detected"));
+ SkinAddNewSoundExT("LotusNotify", LPGENW("Lotus Notify"), LPGENW("New Lotus document detected"));
hOptInit = HookEvent(ME_OPT_INITIALISE, LotusNotifyOptInit); //register service to hook option call
assert(hOptInit);
diff --git a/plugins/LotusNotify/src/LotusNotify.h b/plugins/LotusNotify/src/LotusNotify.h index daa9c417b4..9eec4a4c74 100644 --- a/plugins/LotusNotify/src/LotusNotify.h +++ b/plugins/LotusNotify/src/LotusNotify.h @@ -27,6 +27,6 @@ typedef struct { __declspec(dllexport) STATUS LNPUBLIC MainEntryPoint (void);
-void ErMsgT(TCHAR* msg);
+void ErMsgT(wchar_t* msg);
void checkthread(void*);
diff --git a/plugins/LotusNotify/src/lotusnotes.cpp b/plugins/LotusNotify/src/lotusnotes.cpp index 447efa0d0d..8c5d1d9ff9 100644 --- a/plugins/LotusNotify/src/lotusnotes.cpp +++ b/plugins/LotusNotify/src/lotusnotes.cpp @@ -66,7 +66,7 @@ BOOL HookLotusFunctions() ) ? TRUE : FALSE;
}
-void GetLotusPath(TCHAR *sTemp, DWORD size)
+void GetLotusPath(wchar_t *sTemp, DWORD size)
{
DWORD rc;
HKEY dmKey;
diff --git a/plugins/LotusNotify/src/lotusnotes.h b/plugins/LotusNotify/src/lotusnotes.h index 234952a746..436809c466 100644 --- a/plugins/LotusNotify/src/lotusnotes.h +++ b/plugins/LotusNotify/src/lotusnotes.h @@ -172,5 +172,5 @@ extern NOTESTERMTHREAD NotesTermThread1; BOOL HookLotusFunctions();
-void GetLotusPath(TCHAR *sTemp, DWORD size);
+void GetLotusPath(wchar_t *sTemp, DWORD size);
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 66d45d1059..ed5005e30d 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -30,16 +30,16 @@ int hLangpack; struct {
char *module;
char *name;
- TCHAR *fullName;
+ wchar_t *fullName;
char flag;
}
static const statusMsg[] = {
- { "CList", "StatusMsg", LPGENT("Status message"), 1 },
- { 0, "XStatusName", LPGENT("xStatus title"), 4 },
- { 0, "XStatusMsg", LPGENT("xStatus message"), 2 },
- { "AdvStatus", "tune/text", LPGENT("Listening to"), 8 },
- { "AdvStatus", "activity/title", LPGENT("Activity title"), 8 },
- { "AdvStatus", "activity/text", LPGENT("Activity text"), 8 }
+ { "CList", "StatusMsg", LPGENW("Status message"), 1 },
+ { 0, "XStatusName", LPGENW("xStatus title"), 4 },
+ { 0, "XStatusMsg", LPGENW("xStatus message"), 2 },
+ { "AdvStatus", "tune/text", LPGENW("Listening to"), 8 },
+ { "AdvStatus", "activity/title", LPGENW("Activity title"), 8 },
+ { "AdvStatus", "activity/text", LPGENW("Activity text"), 8 }
};
static IconItem iconList[] = {
@@ -61,19 +61,19 @@ static IconItem overlayIconList[] = { };
struct {
- TCHAR* name;
+ wchar_t* name;
int type;
int icon;
}
static const ii[] = {
- { LPGENT("All"), IGNOREEVENT_ALL, SKINICON_OTHER_FILLEDBLOB },
- { LPGENT("Messages"), IGNOREEVENT_MESSAGE, SKINICON_EVENT_MESSAGE },
- { LPGENT("URL"), IGNOREEVENT_URL, SKINICON_EVENT_URL },
- { LPGENT("Files"), IGNOREEVENT_FILE, SKINICON_EVENT_FILE },
- { LPGENT("User Online"), IGNOREEVENT_USERONLINE, SKINICON_OTHER_USERONLINE },
- { LPGENT("Authorization"), IGNOREEVENT_AUTHORIZATION, SKINICON_AUTH_REQUEST },
- { LPGENT("You Were Added"), IGNOREEVENT_YOUWEREADDED, SKINICON_AUTH_ADD },
- { LPGENT("Typing Notify"), IGNOREEVENT_TYPINGNOTIFY, SKINICON_OTHER_TYPING }
+ { LPGENW("All"), IGNOREEVENT_ALL, SKINICON_OTHER_FILLEDBLOB },
+ { LPGENW("Messages"), IGNOREEVENT_MESSAGE, SKINICON_EVENT_MESSAGE },
+ { LPGENW("URL"), IGNOREEVENT_URL, SKINICON_EVENT_URL },
+ { LPGENW("Files"), IGNOREEVENT_FILE, SKINICON_EVENT_FILE },
+ { LPGENW("User Online"), IGNOREEVENT_USERONLINE, SKINICON_OTHER_USERONLINE },
+ { LPGENW("Authorization"), IGNOREEVENT_AUTHORIZATION, SKINICON_AUTH_REQUEST },
+ { LPGENW("You Were Added"), IGNOREEVENT_YOUWEREADDED, SKINICON_AUTH_ADD },
+ { LPGENW("Typing Notify"), IGNOREEVENT_TYPINGNOTIFY, SKINICON_OTHER_TYPING }
};
PLUGININFOEX pluginInfoEx = {
@@ -203,10 +203,10 @@ void RenameDbProto(MCONTACT hContact, MCONTACT hContactNew, char* oldName, char* FreeModuleSettingLL(&settinglist);
} // end code from dbe++
-void ShowPopup(char* szText, TCHAR* tszText, MCONTACT hContact)
+void ShowPopup(char* szText, wchar_t* tszText, MCONTACT hContact)
{
POPUPDATAT ppd = { 0 };
- TCHAR* text = 0;
+ wchar_t* text = 0;
if (tszText)
text = mir_tstrdup(tszText);
@@ -216,8 +216,8 @@ void ShowPopup(char* szText, TCHAR* tszText, MCONTACT hContact) ppd.lchIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
ppd.lchContact = hContact;
- _tcsncpy(ppd.lptzContactName, pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME - 1);
- _tcsncpy(ppd.lptzText, text, MAX_SECONDLINE - 1);
+ wcsncpy(ppd.lptzContactName, pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME - 1);
+ wcsncpy(ppd.lptzText, text, MAX_SECONDLINE - 1);
ppd.iSeconds = -1;
PUAddPopupT(&ppd);
@@ -243,7 +243,7 @@ void CopyToClipboard(HWND, LPSTR pszMsg, LPTSTR ptszMsg) if (buf == 0)
return;
- HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(buf) + 1)*sizeof(TCHAR));
+ HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(buf) + 1)*sizeof(wchar_t));
LPTSTR lptstrCopy = (LPTSTR)GlobalLock(hglbCopy);
mir_tstrcpy(lptstrCopy, buf);
mir_free(buf);
@@ -401,7 +401,7 @@ INT_PTR CALLBACK AuthReqWndProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpara switch (LOWORD(wparam)) {
case IDOK:
{
- TCHAR tszReason[256] = { 0 };
+ wchar_t tszReason[256] = { 0 };
GetDlgItemText(hdlg, IDC_REASON, tszReason, _countof(tszReason));
ProtoChainSend(hcontact, PSS_AUTHREQUEST, 0, (LPARAM)tszReason);
} // fall through
@@ -497,7 +497,7 @@ void ModifyCopyID(MCONTACT hContact, BOOL bShowID, BOOL bTrimID) hIconCID = hIcon;
}
- TCHAR buffer[256];
+ wchar_t buffer[256];
char szID[256];
GetID(hContact, szProto, (LPSTR)&szID, _countof(szID));
if (szID[0]) {
@@ -510,7 +510,7 @@ void ModifyCopyID(MCONTACT hContact, BOOL bShowID, BOOL bTrimID) mir_sntprintf(buffer, L"%s [%S]", TranslateT("Copy ID"), szID);
Menu_ModifyItem(hmenuCopyID, buffer, hIconCID);
}
- else Menu_ModifyItem(hmenuCopyID, LPGENT("Copy ID"), hIconCID);
+ else Menu_ModifyItem(hmenuCopyID, LPGENW("Copy ID"), hIconCID);
}
else Menu_ShowItem(hmenuCopyID, false);
@@ -610,7 +610,7 @@ INT_PTR onCopyStatusMsg(WPARAM wparam, LPARAM lparam) {
MCONTACT hContact = (MCONTACT) wparam;
char par[32];
- TCHAR buffer[2048];
+ wchar_t buffer[2048];
DWORD flags = db_get_dw(NULL, MODULENAME, "flags", vf_default);
LPSTR module = GetContactProto((MCONTACT)wparam);
@@ -626,13 +626,13 @@ INT_PTR onCopyStatusMsg(WPARAM wparam, LPARAM lparam) LPTSTR msg = db_get_tsa(hContact, (statusMsg[i].module) ? statusMsg[i].module : module, par);
if (msg) {
- if (_tcsclen(msg)) {
+ if (wcslen(msg)) {
if (flags & VF_SMNAME) {
- mir_tstrncat(buffer, TranslateTS(statusMsg[i].fullName), (_countof(buffer) - _tcsclen(buffer) - 1));
- mir_tstrncat(buffer, L": ", (_countof(buffer) - _tcsclen(buffer) - 1));
+ mir_tstrncat(buffer, TranslateTS(statusMsg[i].fullName), (_countof(buffer) - wcslen(buffer) - 1));
+ mir_tstrncat(buffer, L": ", (_countof(buffer) - wcslen(buffer) - 1));
}
- mir_tstrncat(buffer, msg, (_countof(buffer) - _tcsclen(buffer) - 1));
- mir_tstrncat(buffer, L"\r\n", (_countof(buffer) - _tcsclen(buffer) - 1));
+ mir_tstrncat(buffer, msg, (_countof(buffer) - wcslen(buffer) - 1));
+ mir_tstrncat(buffer, L"\r\n", (_countof(buffer) - wcslen(buffer) - 1));
}
mir_free(msg);
}
@@ -733,12 +733,12 @@ INT_PTR onIgnore(WPARAM wparam, LPARAM lparam) return 0;
}
-static HGENMENU AddSubmenuItem(HGENMENU hRoot, TCHAR* name, HICON icon, DWORD flag, char* service, int pos, INT_PTR param)
+static HGENMENU AddSubmenuItem(HGENMENU hRoot, wchar_t* name, HICON icon, DWORD flag, char* service, int pos, INT_PTR param)
{
CMenuItem mi;
mi.root = hRoot;
mi.position = pos;
- mi.name.t = name;
+ mi.name.w = name;
mi.hIcolibItem = icon;
mi.flags = CMIF_UNICODE | CMIF_UNMOVABLE | flag;
mi.pszService = service;
@@ -779,9 +779,9 @@ int BuildMenu(WPARAM wparam, LPARAM) if (bEnabled) {
BYTE bHidden = db_get_b(hContact, "CList", "Hidden", 0);
if (bHidden)
- Menu_ModifyItem(hmenuHide, LPGENT("Show in list"), IcoLib_GetIcon("miex_showil"));
+ Menu_ModifyItem(hmenuHide, LPGENW("Show in list"), IcoLib_GetIcon("miex_showil"));
else
- Menu_ModifyItem(hmenuHide, LPGENT("Hide from list"), IcoLib_GetIcon("miex_hidefl"));
+ Menu_ModifyItem(hmenuHide, LPGENW("Hide from list"), IcoLib_GetIcon("miex_hidefl"));
}
bEnabled = bShowAll || (flags & VF_IGN);
@@ -903,7 +903,7 @@ static int TabsrmmButtonsInit(WPARAM, LPARAM) bbd.pszModuleName = MODULENAME;
bbd.dwButtonID = 0;
bbd.dwDefPos = 1000;
- bbd.ptszTooltip = LPGENT("Browse Received Files");
+ bbd.ptszTooltip = LPGENW("Browse Received Files");
bbd.bbbFlags = BBBF_ISLSIDEBUTTON | BBBF_CANBEHIDDEN;
bbd.hIcon = IcoLib_GetIconHandle("miex_recfiles");
CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
@@ -965,25 +965,25 @@ static int PluginInit(WPARAM, LPARAM) SET_UID(mi, 0x2616aa3f, 0x535a, 0x464c, 0xbd, 0x26, 0x1b, 0x15, 0xbe, 0xfa, 0x1f, 0xf);
mi.position = 120000;
- mi.name.t = LPGENT("Always visible");
+ mi.name.w = LPGENW("Always visible");
mi.pszService = MS_SETVIS;
hmenuVis = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x7d93de78, 0xb1c, 0x4c51, 0x8c, 0x88, 0x33, 0x72, 0x12, 0xb5, 0xb8, 0xe7);
mi.position++;
- mi.name.t = LPGENT("Never visible");
+ mi.name.w = LPGENW("Never visible");
mi.pszService = MS_SETINVIS;
hmenuOff = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x724f6ac0, 0x7f69, 0x407d, 0x85, 0x98, 0x9c, 0x80, 0x32, 0xdb, 0x66, 0x2d);
mi.position++;
- mi.name.t = LPGENT("Hide from list");
+ mi.name.w = LPGENW("Hide from list");
mi.pszService = MS_HIDE;
hmenuHide = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0xe09c04d4, 0xc6b1, 0x4048, 0x98, 0xd6, 0xbe, 0x11, 0xf6, 0x91, 0x15, 0xba);
mi.position++;
- mi.name.t = LPGENT("Ignore");
+ mi.name.w = LPGENW("Ignore");
mi.pszService = 0;
mi.hIcolibItem = IcoLib_GetIcon("miex_ignore");
hmenuIgnore = Menu_AddContactMenuItem(&mi);
@@ -997,11 +997,11 @@ static int PluginInit(WPARAM, LPARAM) ood.cbSize = sizeof(ood);
ood.pszGroup = "Contacts";
ood.pszPage = "Ignore";
- AddSubmenuItem(hmenuIgnore, LPGENT("Open ignore settings"), IcoLib_GetIcon("miex_ignore"), 0, "Opt/OpenOptions", pos, (INT_PTR)&ood);
+ AddSubmenuItem(hmenuIgnore, LPGENW("Open ignore settings"), IcoLib_GetIcon("miex_ignore"), 0, "Opt/OpenOptions", pos, (INT_PTR)&ood);
SET_UID(mi, 0x820f4637, 0xbcc4, 0x46b7, 0x9c, 0x67, 0xf9, 0x69, 0xed, 0xc2, 0x46, 0xa2);
mi.position++;
- mi.name.t = LPGENT("Copy to Account");
+ mi.name.w = LPGENW("Copy to Account");
mi.pszService = MS_PROTO;
mi.hIcolibItem = IcoLib_GetIcon("miex_protocol");
hmenuProto = Menu_AddContactMenuItem(&mi);
@@ -1012,47 +1012,47 @@ static int PluginInit(WPARAM, LPARAM) SET_UID(mi, 0x3f031688, 0xe947, 0x4aba, 0xa3, 0xc4, 0xa7, 0x2c, 0xd0, 0xda, 0x88, 0xb4);
mi.position++;
- mi.name.t = LPGENT("Send 'You were added'");
+ mi.name.w = LPGENW("Send 'You were added'");
mi.pszService = MS_ADDED;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_AUTH_ADD);
hmenuAdded = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x332c5564, 0x6283, 0x43ff, 0xa2, 0xfc, 0x58, 0x29, 0x27, 0x83, 0xea, 0x1a);
mi.position++;
- mi.name.t = LPGENT("Request authorization");
+ mi.name.w = LPGENW("Request authorization");
mi.pszService = MS_AUTHREQ;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_AUTH_REQUEST);
hmenuAuthReq = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x92826bf6, 0xd44c, 0x4dc2, 0xb2, 0xdd, 0xfe, 0xaf, 0x9b, 0x86, 0xe1, 0x53);
mi.position++;
- mi.name.t = LPGENT("Copy ID");
+ mi.name.w = LPGENW("Copy ID");
mi.pszService = MS_COPYID;
hmenuCopyID = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x54d45bf1, 0x1c6d, 0x49c9, 0xbd, 0xde, 0x63, 0xb2, 0x3d, 0xb0, 0x89, 0xbf);
mi.position++;
- mi.name.t = LPGENT("Browse Received Files");
+ mi.name.w = LPGENW("Browse Received Files");
mi.pszService = MS_RECVFILES;
mi.hIcolibItem = IcoLib_GetIcon("miex_recfiles");
hmenuRecvFiles = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0xf750f36b, 0x284f, 0x4841, 0x83, 0x18, 0xc7, 0x10, 0x4, 0x73, 0xea, 0x22);
mi.position++;
- mi.name.t = LPGENT("Copy Status Message");
+ mi.name.w = LPGENW("Copy Status Message");
mi.pszService = MS_STATUSMSG;
mi.hIcolibItem = NULL;
hmenuStatusMsg = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x3847bfcd, 0xfcd5, 0x4435, 0xa6, 0x54, 0x2e, 0x9, 0xc5, 0xba, 0xcf, 0x71);
mi.position++;
- mi.name.t = LPGENT("Copy IP");
+ mi.name.w = LPGENW("Copy IP");
mi.pszService = MS_COPYIP;
hmenuCopyIP = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x8c6ad48, 0x882d, 0x47ed, 0xa6, 0x6e, 0xba, 0x26, 0xa3, 0x50, 0x17, 0x82);
mi.position++;
- mi.name.t = LPGENT("Copy MirVer");
+ mi.name.w = LPGENW("Copy MirVer");
mi.pszService = MS_COPYMIRVER;
hmenuCopyMirVer = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/MenuItemEx/src/options.cpp b/plugins/MenuItemEx/src/options.cpp index e82e65b045..75e33c58a5 100644 --- a/plugins/MenuItemEx/src/options.cpp +++ b/plugins/MenuItemEx/src/options.cpp @@ -30,7 +30,7 @@ static const checkboxes[] = { INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
{
DWORD flags = db_get_dw(NULL, MODULENAME, "flags", vf_default);
- TCHAR buffer[64] = { 0 };
+ wchar_t buffer[64] = { 0 };
int i;
switch (msg) {
diff --git a/plugins/MessageState/src/messagestate.cpp b/plugins/MessageState/src/messagestate.cpp index 6f64d22273..2082f67ec5 100644 --- a/plugins/MessageState/src/messagestate.cpp +++ b/plugins/MessageState/src/messagestate.cpp @@ -9,12 +9,12 @@ IconItem Icons[] = { LPGEN("Unread clist extra icon"), "clist_unread_icon", IDI_EXTRA },
};
-const TCHAR* Tooltips[] =
+const wchar_t* Tooltips[] =
{
- LPGENT("Last message is not read"),
- LPGENT("Last message read"),
- LPGENT("Last message was not sent"),
- LPGENT("Sending...")
+ LPGENW("Last message is not read"),
+ LPGENW("Last message read"),
+ LPGENW("Last message was not sent"),
+ LPGENW("Sending...")
};
void SetSRMMIcon(MCONTACT hContact, SRMM_ICON_TYPE type, time_t time)
@@ -34,7 +34,7 @@ void SetSRMMIcon(MCONTACT hContact, SRMM_ICON_TYPE type, time_t time) {
if (db_get_dw(hContact, MODULENAME, DBKEY_MESSAGE_READ_TIME_TYPE, -1) == MRD_TYPE_READTIME)
{
- _tcsftime(tszTooltip.GetBuffer(64), 64, TranslateT("Last message read at %X %x"), localtime(&time));
+ wcsftime(tszTooltip.GetBuffer(64), 64, TranslateT("Last message read at %X %x"), localtime(&time));
tszTooltip.ReleaseBuffer();
}
else
diff --git a/plugins/MimCmd/src/commands.cpp b/plugins/MimCmd/src/commands.cpp index b9ba0b26ab..d066dab4af 100644 --- a/plugins/MimCmd/src/commands.cpp +++ b/plugins/MimCmd/src/commands.cpp @@ -35,18 +35,18 @@ char *GetMirandaFolder(char *mimFolder, int size) int ConnectToMiranda()
{
- TCHAR tszPath[MAX_PATH];
+ wchar_t tszPath[MAX_PATH];
GetModuleFileName(NULL, tszPath, _countof(tszPath));
- TCHAR *p = _tcsrchr(tszPath, '\\');
+ wchar_t *p = wcsrchr(tszPath, '\\');
if (p) p[1] = 0;
- _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);
delete[] ptszVal;
diff --git a/plugins/MirFox/src/MirandaOptions.cpp b/plugins/MirFox/src/MirandaOptions.cpp index b9dea187de..7ea8ece4f5 100644 --- a/plugins/MirFox/src/MirandaOptions.cpp +++ b/plugins/MirFox/src/MirandaOptions.cpp @@ -675,25 +675,25 @@ int OptInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 };
odp.position = -790000000;
odp.hInstance = hInst;
- odp.ptszTitle = LPGENT(PLUGIN_OPTIONS_NAME);
- odp.ptszGroup = LPGENT("Services");
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.pszTitle = LPGEN(PLUGIN_OPTIONS_NAME);
+ odp.pszGroup = LPGEN("Services");
+ odp.flags = ODPF_BOLDGROUPS;
//1 - options
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT1);
- odp.ptszTab = LPGENT("Options");
+ odp.pszTab = LPGEN("Options");
odp.pfnDlgProc = DlgProcOpts_Tab1;
Options_AddPage(wParam, &odp);
//2 - contacts
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT2);
- odp.ptszTab = LPGENT("Contacts");
+ odp.pszTab = LPGEN("Contacts");
odp.pfnDlgProc = DlgProcOpts_Tab2;
Options_AddPage(wParam, &odp);
//3 - accounts
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT3);
- odp.ptszTab = LPGENT("Accounts");
+ odp.pszTab = LPGEN("Accounts");
odp.pfnDlgProc = DlgProcOpts_Tab3;
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp index 06ea0e2092..b37be018a8 100644 --- a/plugins/MirFox/src/MirandaUtils.cpp +++ b/plugins/MirFox/src/MirandaUtils.cpp @@ -186,7 +186,7 @@ void MirandaUtils::sendMessage(ActionThreadArgStruct* args, MFENUM_SEND_MESSAGE_ MirandaContact* mirandaContact = args->mirfoxDataPtr->getMirandaContactPtrByHandle((UINT_PTR)args->targetHandle);
const wchar_t* contactNameW = NULL;
- TCHAR* tszAccountName = NULL;
+ wchar_t* tszAccountName = NULL;
if (mirandaContact){
contactNameW = mirandaContact->contactNameW.c_str();
MirandaAccount* mirandaAccount = mirandaContact->mirandaAccountPtr;
@@ -342,7 +342,7 @@ int MirandaUtils::on_hook_OpenMW(WPARAM wParam, LPARAM lParam) OnHookOpenMvStruct* param = (OnHookOpenMvStruct*)wParam;
if (param->msgBuffer != NULL){
- TCHAR *msgBuffer = mir_tstrdup(param->msgBuffer->c_str());
+ wchar_t *msgBuffer = mir_tstrdup(param->msgBuffer->c_str());
CallServiceSync(MS_MSG_SENDMESSAGET, (WPARAM)param->targetHandle, (LPARAM)msgBuffer);
mir_free(msgBuffer);
@@ -392,7 +392,7 @@ void MirandaUtils::setStatusOnAccount(ActionThreadArgStruct* args) result = CallProtoService(args->accountSzModuleName, PS_SETAWAYMSG, status, (LPARAM)args->userActionSelection);
MirandaAccount* mirandaAccount = args->mirfoxDataPtr->getMirandaAccountPtrBySzModuleName(args->accountSzModuleName);
- TCHAR* tszAccountName = NULL;
+ wchar_t* tszAccountName = NULL;
if (mirandaAccount)
tszAccountName = mirandaAccount->tszAccountName;
diff --git a/plugins/MirFox/src/MirfoxData.cpp b/plugins/MirFox/src/MirfoxData.cpp index 22eb70e504..c3369ac897 100644 --- a/plugins/MirFox/src/MirfoxData.cpp +++ b/plugins/MirFox/src/MirfoxData.cpp @@ -245,7 +245,7 @@ MirfoxData::getMirandaAccountPtrBySzModuleName(char* szModuleName) // refresh support
-void MirfoxData::refreshAccount_Add(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName, TCHAR* tszAccountName, char* szProtoName)
+void MirfoxData::refreshAccount_Add(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName, wchar_t* tszAccountName, char* szProtoName)
{
MFLogger* logger = MFLogger::getInstance();
logger->log_p(L"MirfoxData::refreshAccount_Add proto [%S]", szModuleName);
@@ -296,7 +296,7 @@ void MirfoxData::refreshAccount_Add(SharedMemoryUtils& sharedMemoryUtils, char* return;
}
-void MirfoxData::refreshAccount_Edit(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName, TCHAR* tszAccountName)
+void MirfoxData::refreshAccount_Edit(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName, wchar_t* tszAccountName)
{
MFLogger* logger = MFLogger::getInstance();
logger->log_p(L"MirfoxData::refreshAccount_Edit proto [%S]", szModuleName);
@@ -779,7 +779,7 @@ void MirfoxData::releaseMirfoxData() * class functions implementation
*/
-MirandaAccount::MirandaAccount(uint64_t idL, char* szModuleNameL, TCHAR* tszAccountNameL, char* szProtoNameL, int displayOrderL)
+MirandaAccount::MirandaAccount(uint64_t idL, char* szModuleNameL, wchar_t* tszAccountNameL, char* szProtoNameL, int displayOrderL)
{
accountState = MFENUM_MIRANDAACCOUNT_STATE_UNKNOWN;
id = idL;
diff --git a/plugins/MirFox/src/MirfoxData.h b/plugins/MirFox/src/MirfoxData.h index 4806745396..b06f614241 100644 --- a/plugins/MirFox/src/MirfoxData.h +++ b/plugins/MirFox/src/MirfoxData.h @@ -118,8 +118,8 @@ public: MirandaAccount* getMirandaAccountPtrBySzModuleName(char* szModuleName);
//refresh data support
- void refreshAccount_Add(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName, TCHAR* tszAccountName, char* szProtoName);
- void refreshAccount_Edit(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName, TCHAR* tszAccountName);
+ void refreshAccount_Add(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName, wchar_t* tszAccountName, char* szProtoName);
+ void refreshAccount_Edit(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName, wchar_t* tszAccountName);
void refreshAccount_Delete(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName);
void refreshContact_Add(SharedMemoryUtils& sharedMemoryUtils, MCONTACT hContact);
void refreshContact_Edit(SharedMemoryUtils& sharedMemoryUtils, MCONTACT hContact);
@@ -247,13 +247,13 @@ class MirandaAccount {
public:
- MirandaAccount(uint64_t idL, char* szModuleNameL, TCHAR* tszAccountNameL, char* szProtoNameL, int displayOrderL);
+ MirandaAccount(uint64_t idL, char* szModuleNameL, wchar_t* tszAccountNameL, char* szProtoNameL, int displayOrderL);
~MirandaAccount(void);
MirandaAccount* getObjectPtr();
uint64_t id; //selfgenerated id, used in sm
char* szModuleName; //unique string id of account
- TCHAR* tszAccountName; //account name
+ wchar_t* tszAccountName; //account name
char* szProtoName; //physical protocol name
int displayOrder; //presentation order - not used now
MFENUM_MIRANDAACCOUNT_STATE accountState; //state in options
diff --git a/plugins/MirLua/Modules/WinAPI/src/stdafx.h b/plugins/MirLua/Modules/WinAPI/src/stdafx.h index 1e67e7c313..4885e14c2f 100644 --- a/plugins/MirLua/Modules/WinAPI/src/stdafx.h +++ b/plugins/MirLua/Modules/WinAPI/src/stdafx.h @@ -52,7 +52,6 @@ #include <stddef.h>
#include <process.h>
#include <direct.h>
-#include <tchar.h>
#include <shlwapi.h>
#include <shlobj.h>
diff --git a/plugins/MirLua/Modules/WinAPI/src/winapi.cpp b/plugins/MirLua/Modules/WinAPI/src/winapi.cpp index b6d77a2973..8bb7ec0d8b 100644 --- a/plugins/MirLua/Modules/WinAPI/src/winapi.cpp +++ b/plugins/MirLua/Modules/WinAPI/src/winapi.cpp @@ -38,7 +38,7 @@ static int lua_ShellExecute(lua_State *L) static int lua_FindIterator(lua_State *L)
{
HANDLE hFind = lua_touserdata(L, lua_upvalueindex(1));
- TCHAR* path = (TCHAR*)lua_touserdata(L, lua_upvalueindex(2));
+ wchar_t* path = (wchar_t*)lua_touserdata(L, lua_upvalueindex(2));
WIN32_FIND_DATA ffd = { 0 };
if (hFind == NULL)
@@ -98,7 +98,7 @@ static int lua_FindIterator(lua_State *L) static int lua_Find(lua_State *L)
{
- TCHAR *path = mir_utf8decodeT(luaL_checkstring(L, 1));
+ wchar_t *path = mir_utf8decodeT(luaL_checkstring(L, 1));
lua_pushlightuserdata(L, NULL);
lua_pushlightuserdata(L, path);
@@ -137,7 +137,7 @@ static int lua_GetIniValue(lua_State *L) ptrT default(mir_utf8decodeT(lua_tostring(L, 4)));
- TCHAR value[MAX_PATH] = { 0 };
+ wchar_t value[MAX_PATH] = { 0 };
if (!::GetPrivateProfileString(section, key, default, value, _countof(value), path))
{
lua_pushvalue(L, 4);
@@ -218,7 +218,7 @@ static int lua_GetRegValue(lua_State *L) case REG_LINK:
case REG_EXPAND_SZ:
{
- ptrA str(Utf8EncodeT((TCHAR*)value));
+ ptrA str(Utf8EncodeT((wchar_t*)value));
lua_pushlstring(L, str, mir_strlen(str));
}
break;
@@ -274,7 +274,7 @@ static int lua_SetRegValue(lua_State *L) case LUA_TSTRING:
type = REG_SZ;
- length = mir_strlen(lua_tostring(L, 4)) * sizeof(TCHAR);
+ length = mir_strlen(lua_tostring(L, 4)) * sizeof(wchar_t);
value = (BYTE*)mir_utf8decodeT(lua_tostring(L, 4));
break;
@@ -1708,7 +1708,7 @@ static int global_GetOpenFileName(lua_State *L) {
_A2T tszExt(lua_tostring(L, 1));
- TCHAR buff[MAX_PATH] = L"";
+ wchar_t buff[MAX_PATH] = L"";
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
diff --git a/plugins/MirLua/Modules/m_variables/src/main.cpp b/plugins/MirLua/Modules/m_variables/src/main.cpp index 8eac605407..308325e202 100644 --- a/plugins/MirLua/Modules/m_variables/src/main.cpp +++ b/plugins/MirLua/Modules/m_variables/src/main.cpp @@ -11,7 +11,7 @@ static int lua_Parse(lua_State *L) ptrT format(mir_utf8decodeT(luaL_checkstring(L, 1)));
MCONTACT hContact = lua_tointeger(L, 2);
- TCHAR *res = variables_parse_ex(format, NULL, hContact, NULL, 0);
+ wchar_t *res = variables_parse_ex(format, NULL, hContact, NULL, 0);
lua_pushstring(L, T2Utf(res));
return 1;
diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp index 4c2b6e7a38..27d4cc7714 100644 --- a/plugins/MirLua/src/m_core.cpp +++ b/plugins/MirLua/src/m_core.cpp @@ -296,7 +296,7 @@ static int core_Parse(lua_State *L) static int core_GetFullPath(lua_State *L)
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetModuleFileName(NULL, path, MAX_PATH);
lua_pushstring(L, ptrA(mir_utf8encodeT(path)));
diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp index 64540804a0..78ed5343d6 100644 --- a/plugins/MirLua/src/m_genmenu.cpp +++ b/plugins/MirLua/src/m_genmenu.cpp @@ -18,7 +18,7 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi) lua_pop(L, 1);
lua_getfield(L, -1, "Name");
- mi.name.t = mir_utf8decodeT(luaL_checkstring(L, -1));
+ mi.name.w = mir_utf8decodeT(luaL_checkstring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Position");
diff --git a/plugins/MirLua/src/m_icolib.cpp b/plugins/MirLua/src/m_icolib.cpp index 019d1ccf25..8827cc749c 100644 --- a/plugins/MirLua/src/m_icolib.cpp +++ b/plugins/MirLua/src/m_icolib.cpp @@ -9,16 +9,16 @@ static int icolib_AddIcon(lua_State *L) if (filePath == NULL)
{
- filePath = (TCHAR*)mir_calloc(MAX_PATH + 1);
+ filePath = (wchar_t*)mir_calloc(MAX_PATH + 1);
GetModuleFileName(g_hInstance, filePath, MAX_PATH);
}
SKINICONDESC si = { 0 };
si.flags = SIDF_ALL_TCHAR;
si.pszName = mir_utf8decodeA(name);
- si.description.t = description;
- si.section.t = section;
- si.defaultFile.t = filePath;
+ si.description.w = description;
+ si.section.w = section;
+ si.defaultFile.w = filePath;
si.hDefaultIcon = GetIcon(IDI_SCRIPT);
int hScriptLangpack = CMLuaScript::GetScriptIdFromEnviroment(L);
diff --git a/plugins/MirLua/src/m_options.cpp b/plugins/MirLua/src/m_options.cpp index 149403ee44..d67106d247 100644 --- a/plugins/MirLua/src/m_options.cpp +++ b/plugins/MirLua/src/m_options.cpp @@ -54,15 +54,15 @@ void MakeOptionDialogPage(lua_State *L, OPTIONSDIALOGPAGE &odp) odp.flags |= ODPF_TCHAR;
lua_getfield(L, -1, "Group");
- odp.ptszGroup = mir_utf8decodeT(lua_tostring(L, -1));
+ odp.pwszGroup = mir_utf8decodeT(lua_tostring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Title");
- odp.ptszTitle = mir_utf8decodeT(luaL_checkstring(L, -1));
+ odp.pwszTitle = mir_utf8decodeT(luaL_checkstring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Tab");
- odp.ptszTab = mir_utf8decodeT(lua_tostring(L, -1));
+ odp.pwszTab = mir_utf8decodeT(lua_tostring(L, -1));
lua_pop(L, 1);
int onInitDialogRef = LUA_NOREF;
@@ -95,9 +95,9 @@ int opt_AddPage(lua_State *L) INT_PTR res = Options_AddPage(wParam, &odp);
lua_pushboolean(L, !res);
- mir_free(odp.ptszGroup);
- mir_free(odp.ptszTitle);
- mir_free(odp.ptszTab);
+ mir_free(odp.pwszGroup);
+ mir_free(odp.pwszTitle);
+ mir_free(odp.pwszTab);
return 1;
}
diff --git a/plugins/MirLua/src/main.cpp b/plugins/MirLua/src/main.cpp index 49b50190fd..ce2d3aa589 100644 --- a/plugins/MirLua/src/main.cpp +++ b/plugins/MirLua/src/main.cpp @@ -62,8 +62,8 @@ extern "C" int __declspec(dllexport) Load(void) NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_NOOPTIONS | NUF_UNICODE;
- nlu.ptszDescriptiveName = _T(MODULE);
+ nlu.flags = NUF_NOOPTIONS;
+ nlu.szDescriptiveName = MODULE;
nlu.szSettingsModule = MODULE;
hNetlib = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp index 2c67f32f3e..5386f364d1 100644 --- a/plugins/MirLua/src/mlua.cpp +++ b/plugins/MirLua/src/mlua.cpp @@ -23,7 +23,7 @@ CMLua::~CMLua() void CMLua::SetPaths()
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
lua_getglobal(L, "package");
diff --git a/plugins/MirLua/src/mlua_icons.cpp b/plugins/MirLua/src/mlua_icons.cpp index 175e5c62e8..92bcd1dcd5 100644 --- a/plugins/MirLua/src/mlua_icons.cpp +++ b/plugins/MirLua/src/mlua_icons.cpp @@ -1,17 +1,17 @@ #include "stdafx.h"
-IconItemT Icons[] =
+IconItem Icons[] =
{
- { LPGENT("Script"), "script", IDI_SCRIPT },
- { LPGENT("Loaded"), "loaded", IDI_LOADED },
- { LPGENT("Failed"), "failed", IDI_FAILED },
- { LPGENT("Open"), "open", IDI_OPEN },
- { LPGENT("Reload"), "reload", IDI_RELOAD },
+ { LPGEN("Script"), "script", IDI_SCRIPT },
+ { LPGEN("Loaded"), "loaded", IDI_LOADED },
+ { LPGEN("Failed"), "failed", IDI_FAILED },
+ { LPGEN("Open"), "open", IDI_OPEN },
+ { LPGEN("Reload"), "reload", IDI_RELOAD },
};
void InitIcons()
{
- Icon_RegisterT(g_hInstance, LPGENT(MODULE), Icons, _countof(Icons), MODULE);
+ Icon_Register(g_hInstance, MODULE, Icons, _countof(Icons), MODULE);
}
HICON GetIcon(int iconId)
diff --git a/plugins/MirLua/src/mlua_options.cpp b/plugins/MirLua/src/mlua_options.cpp index 6714d7ebed..cc902165d6 100644 --- a/plugins/MirLua/src/mlua_options.cpp +++ b/plugins/MirLua/src/mlua_options.cpp @@ -37,7 +37,7 @@ void CMLuaOptions::LoadScripts() for (int i = 0; i < g_mLua->Scripts.getCount(); i++)
{
CMLuaScript *script = g_mLua->Scripts[i];
- TCHAR *fileName = NEWTSTR_ALLOCA(script->GetFileName());
+ wchar_t *fileName = NEWWSTR_ALLOCA(script->GetFileName());
int iIcon = script->GetStatus() - 1;
int iItem = m_scripts.AddItem(fileName, iIcon, (LPARAM)script);
if (db_get_b(NULL, MODULE, _T2A(fileName), 1))
@@ -59,7 +59,7 @@ void CMLuaOptions::OnInitDialog() ImageList_AddIcon(hImageList, GetIcon(IDI_OPEN));
ImageList_AddIcon(hImageList, GetIcon(IDI_RELOAD));
- TCHAR scriptDir[MAX_PATH], relativeScriptDir[MAX_PATH], header[MAX_PATH + 100];
+ wchar_t scriptDir[MAX_PATH], relativeScriptDir[MAX_PATH], header[MAX_PATH + 100];
FoldersGetCustomPathT(g_hScriptsFolder, scriptDir, _countof(scriptDir), VARST(MIRLUA_PATHT));
PathToRelativeT(scriptDir, relativeScriptDir, NULL);
mir_sntprintf(header, L"%s (%s)", TranslateT("Common scripts"), relativeScriptDir);
@@ -78,7 +78,7 @@ void CMLuaOptions::OnApply() int count = m_scripts.GetItemCount();
for (int iItem = 0; iItem < count; iItem++)
{
- TCHAR fileName[MAX_PATH];
+ wchar_t fileName[MAX_PATH];
m_scripts.GetItemText(iItem, 0, fileName, _countof(fileName));
if (!m_scripts.GetCheckState(iItem))
db_set_b(NULL, MODULE, _T2A(fileName), 0);
@@ -115,7 +115,7 @@ void CMLuaOptions::OnScriptListClick(CCtrlListView::TEventInfo *evt) LVITEM lvi = { 0 };
lvi.iItem = evt->nmlvia->iItem;
if (lvi.iItem == -1) return;
- lvi.pszText = (LPTSTR)mir_calloc(MAX_PATH * sizeof(TCHAR));
+ lvi.pszText = (LPTSTR)mir_calloc(MAX_PATH * sizeof(wchar_t));
lvi.cchTextMax = MAX_PATH;
lvi.mask = LVIF_GROUPID | LVIF_TEXT | LVIF_PARAM;
evt->treeviewctrl->GetItem(&lvi);
@@ -161,9 +161,9 @@ int CMLuaOptions::OnOptionsInit(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_hInstance;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszGroup = LPGENT("Services");
- odp.ptszTitle = L"Lua";
- odp.ptszTab = LPGENT("Scripts");
+ odp.pwszGroup = LPGENW("Services");
+ odp.pwszTitle = L"Lua";
+ odp.pwszTab = LPGENW("Scripts");
odp.pDialog = CMLuaOptions::CreateOptionsPage();
Options_AddPage(wParam, &odp);
diff --git a/plugins/MirLua/src/mlua_script.cpp b/plugins/MirLua/src/mlua_script.cpp index d36f93b7a8..b84c3d978e 100644 --- a/plugins/MirLua/src/mlua_script.cpp +++ b/plugins/MirLua/src/mlua_script.cpp @@ -2,17 +2,17 @@ #define SCRIPT "Script"
-CMLuaScript::CMLuaScript(lua_State *L, const TCHAR *path)
+CMLuaScript::CMLuaScript(lua_State *L, const wchar_t *path)
: L(L), status(None), unloadRef(LUA_NOREF)
{
mir_tstrcpy(filePath, path);
- fileName = _tcsrchr(filePath, '\\') + 1;
- TCHAR *dot = _tcsrchr(fileName, '.');
+ fileName = wcsrchr(filePath, '\\') + 1;
+ wchar_t *dot = wcsrchr(fileName, '.');
size_t length = mir_tstrlen(fileName) - mir_tstrlen(dot) + 1;
- ptrT name((TCHAR*)mir_calloc(sizeof(TCHAR) * (length + 1)));
+ ptrT name((wchar_t*)mir_calloc(sizeof(wchar_t) * (length + 1)));
mir_tstrncpy(name, fileName, length);
moduleName = mir_utf8encodeT(name);
@@ -76,12 +76,12 @@ const char* CMLuaScript::GetModuleName() const return moduleName;
}
-const TCHAR* CMLuaScript::GetFilePath() const
+const wchar_t* CMLuaScript::GetFilePath() const
{
return filePath;
}
-const TCHAR* CMLuaScript::GetFileName() const
+const wchar_t* CMLuaScript::GetFileName() const
{
return fileName;
}
diff --git a/plugins/MirLua/src/mlua_script.h b/plugins/MirLua/src/mlua_script.h index c466e16c20..042e78dadf 100644 --- a/plugins/MirLua/src/mlua_script.h +++ b/plugins/MirLua/src/mlua_script.h @@ -17,13 +17,13 @@ private: int id;
int unloadRef;
char *moduleName;
- TCHAR *fileName;
- TCHAR filePath[MAX_PATH];
+ wchar_t *fileName;
+ wchar_t filePath[MAX_PATH];
Status status;
public:
- CMLuaScript(lua_State *L, const TCHAR *path);
+ CMLuaScript(lua_State *L, const wchar_t *path);
~CMLuaScript();
static CMLuaScript* GetScriptFromEnviroment(lua_State *L);
@@ -34,8 +34,8 @@ public: const char* GetModuleName() const;
- const TCHAR* GetFilePath() const;
- const TCHAR* GetFileName() const;
+ const wchar_t* GetFilePath() const;
+ const wchar_t* GetFileName() const;
const Status GetStatus() const;
diff --git a/plugins/MirLua/src/mlua_script_loader.cpp b/plugins/MirLua/src/mlua_script_loader.cpp index f95fdbfc78..a8efa32320 100644 --- a/plugins/MirLua/src/mlua_script_loader.cpp +++ b/plugins/MirLua/src/mlua_script_loader.cpp @@ -4,9 +4,9 @@ CMLuaScriptLoader::CMLuaScriptLoader(lua_State *L) : L(L) {
}
-void CMLuaScriptLoader::LoadScript(const TCHAR *scriptDir, const TCHAR *file)
+void CMLuaScriptLoader::LoadScript(const wchar_t *scriptDir, const wchar_t *file)
{
- TCHAR fullPath[MAX_PATH], path[MAX_PATH];
+ wchar_t fullPath[MAX_PATH], path[MAX_PATH];
mir_sntprintf(fullPath, L"%s\\%s", scriptDir, file);
PathToRelativeT(fullPath, path);
@@ -25,12 +25,12 @@ void CMLuaScriptLoader::LoadScript(const TCHAR *scriptDir, const TCHAR *file) void CMLuaScriptLoader::LoadScripts()
{
- TCHAR scriptDir[MAX_PATH];
+ wchar_t scriptDir[MAX_PATH];
FoldersGetCustomPathT(g_hScriptsFolder, scriptDir, _countof(scriptDir), VARST(MIRLUA_PATHT));
Log(L"Loading scripts from %s", scriptDir);
- TCHAR searchMask[MAX_PATH];
+ wchar_t searchMask[MAX_PATH];
mir_sntprintf(searchMask, L"%s\\%s", scriptDir, L"*.lua");
WIN32_FIND_DATA fd;
diff --git a/plugins/MirLua/src/mlua_script_loader.h b/plugins/MirLua/src/mlua_script_loader.h index 949f870fac..e455793adf 100644 --- a/plugins/MirLua/src/mlua_script_loader.h +++ b/plugins/MirLua/src/mlua_script_loader.h @@ -8,7 +8,7 @@ private: CMLuaScriptLoader(lua_State *L);
- void LoadScript(const TCHAR *scriptDir, const TCHAR *file);
+ void LoadScript(const wchar_t *scriptDir, const wchar_t *file);
void LoadScripts();
public:
diff --git a/plugins/MirOTR/src/dialogs.cpp b/plugins/MirOTR/src/dialogs.cpp index 0451367f84..cc3ab94d61 100644 --- a/plugins/MirOTR/src/dialogs.cpp +++ b/plugins/MirOTR/src/dialogs.cpp @@ -6,7 +6,7 @@ struct SmpData TrustLevel oldlevel; ConnContext *context; bool responder; - TCHAR *question; + wchar_t *question; }; typedef std::map<HANDLE, SmpData> SmpForContactMap; SmpForContactMap smp_for_contact; @@ -40,11 +40,11 @@ static INT_PTR CALLBACK DlgSMPUpdateProc(HWND hwndDlg, UINT msg, WPARAM wParam, smp_for_contact[context->app_data].responder = data->responder; mir_free(data); - TCHAR title[512], *proto = mir_a2t(GetContactProto(hContact)); - const TCHAR *name = contact_get_nameT(hContact); - mir_sntprintf(title, TranslateT(LANG_SMP_PROGRESS_TITLE), name, proto); + wchar_t title[512], *proto = mir_a2t(GetContactProto(hContact)); + const wchar_t *name = contact_get_nameT(hContact); + mir_sntprintf(title, TranslateW(LANG_SMP_PROGRESS_TITLE), name, proto); SetWindowText(hwndDlg, title); - mir_sntprintf(title, TranslateT(LANG_SMP_PROGRESS_DESC), name, proto); + mir_sntprintf(title, TranslateW(LANG_SMP_PROGRESS_DESC), name, proto); mir_free(proto); SetDlgItemText(hwndDlg, IDC_STC_SMP_HEADPRO, title); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)context); @@ -97,7 +97,7 @@ static INT_PTR CALLBACK DlgSMPUpdateProc(HWND hwndDlg, UINT msg, WPARAM wParam, case 0: EnableWindow(GetDlgItem(hwndDlg, IDCANCEL), false); EnableWindow(GetDlgItem(hwndDlg, IDOK), true); - SetDlgItemText(hwndDlg, IDC_STC_SMP_PROGRESS, TranslateT(LANG_SMP_ERROR)); + SetDlgItemText(hwndDlg, IDC_STC_SMP_PROGRESS, TranslateW(LANG_SMP_ERROR)); smp_for_contact.erase(context->app_data); break; case 100: @@ -107,14 +107,14 @@ static INT_PTR CALLBACK DlgSMPUpdateProc(HWND hwndDlg, UINT msg, WPARAM wParam, smp_for_contact.erase(context->app_data); if (context->smstate->sm_prog_state == OTRL_SMP_PROG_SUCCEEDED) { if (context->active_fingerprint->trust && context->active_fingerprint->trust[0]) { - SetDlgItemText(hwndDlg, IDC_STC_SMP_PROGRESS, TranslateT(LANG_SMP_SUCCESS)); + SetDlgItemText(hwndDlg, IDC_STC_SMP_PROGRESS, TranslateW(LANG_SMP_SUCCESS)); } else { - SetDlgItemText(hwndDlg, IDC_STC_SMP_PROGRESS, TranslateT(LANG_SMP_SUCCESS_VERIFY)); + SetDlgItemText(hwndDlg, IDC_STC_SMP_PROGRESS, TranslateW(LANG_SMP_SUCCESS_VERIFY)); } } else { - SetDlgItemText(hwndDlg, IDC_STC_SMP_PROGRESS, TranslateT(LANG_SMP_FAILED)); + SetDlgItemText(hwndDlg, IDC_STC_SMP_PROGRESS, TranslateW(LANG_SMP_FAILED)); } } break; @@ -183,25 +183,25 @@ static INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam smp_for_contact[context->app_data].oldlevel = data->oldlevel; smp_for_contact[context->app_data].responder = data->responder; - TCHAR buff[512], *proto = mir_a2t(GetContactProto(hContact)); - mir_sntprintf(buff, TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto); + wchar_t buff[512], *proto = mir_a2t(GetContactProto(hContact)); + mir_sntprintf(buff, TranslateW(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto); mir_free(proto); SetWindowText(hwndDlg, buff); SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, buff); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)context); if (data->question) { - mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_RESPOND_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_RESPOND_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD1, data->question); SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD1, EM_SETREADONLY, TRUE, 0); - SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateT(LANG_SMP_QUESTION)); + SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateW(LANG_SMP_QUESTION)); SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, L""); SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, EM_SETREADONLY, FALSE, 0); - SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateT(LANG_SMP_ANSWER)); + SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateW(LANG_SMP_ANSWER)); ShowWindow(GetDlgItem(hwndDlg, IDOK), SW_SHOWNA); @@ -211,7 +211,7 @@ static INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam mir_free(data->question); } else { - mir_sntprintf(buff, TranslateT(LANG_OTR_SMPPASSWORD_RESPOND_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_OTR_SMPPASSWORD_RESPOND_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -221,7 +221,7 @@ static INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, L""); SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, EM_SETREADONLY, FALSE, 0); - SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateT(LANG_SMP_PASSWORD)); + SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateW(LANG_SMP_PASSWORD)); ShowWindow(GetDlgItem(hwndDlg, IDOK), SW_SHOWNA); @@ -272,7 +272,7 @@ static INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam SMPInitUpdateDialog(context, true); { int len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, WM_GETTEXTLENGTH, 0, 0); - TCHAR *answer = new TCHAR[len + 1]; + wchar_t *answer = new wchar_t[len + 1]; GetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, answer, len + 1); T2Utf ans(answer); @@ -297,7 +297,7 @@ static INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam } /* -void SMPInitResponseDialog(ConnContext *context, const TCHAR *question) { +void SMPInitResponseDialog(ConnContext *context, const wchar_t *question) { if (!context) return; SmpData *data = (SmpData*)mir_calloc(sizeof(SmpData)); data->context = context; @@ -326,8 +326,8 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam } MCONTACT hContact = (UINT_PTR)context->app_data; - TCHAR title[512], *proto = mir_a2t(GetContactProto(hContact)); - mir_sntprintf(title, TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto); + wchar_t title[512], *proto = mir_a2t(GetContactProto(hContact)); + mir_sntprintf(title, TranslateW(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto); mir_free(proto); SetWindowText(hwndDlg, title); SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, title); @@ -366,10 +366,10 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam HWND cmb = GetDlgItem(hwndDlg, IDC_CBO_SMP_CHOOSE); - SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_SMPTYPE_QUESTION)); - SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_SMPTYPE_PASSWORD)); - SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_SMPTYPE_FINGERPRINT)); - SendMessage(cmb, CB_SELECTSTRING, -1, (WPARAM)TranslateT(LANG_SMPTYPE_QUESTION)); + SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_SMPTYPE_QUESTION)); + SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_SMPTYPE_PASSWORD)); + SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_SMPTYPE_FINGERPRINT)); + SendMessage(cmb, CB_SELECTSTRING, -1, (WPARAM)TranslateW(LANG_SMPTYPE_QUESTION)); EnableWindow(GetDlgItem(hwndDlg, IDC_CBO_SMP_CHOOSE), TRUE); @@ -378,21 +378,21 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam DestroyWindow(hwndDlg); return FALSE; } - TCHAR buff[1024]; + wchar_t buff[1024]; if (!fp->trust || fp->trust[0] == '\0') - mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact)); else - mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD1, L""); SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD1, EM_SETREADONLY, FALSE, 0); - SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateT(LANG_SMP_QUESTION)); + SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateW(LANG_SMP_QUESTION)); SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, L""); SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, EM_SETREADONLY, FALSE, 0); - SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateT(LANG_SMP_ANSWER)); + SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateW(LANG_SMP_ANSWER)); ShowWindow(GetDlgItem(hwndDlg, IDOK), SW_SHOWNA); @@ -409,27 +409,27 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam { ConnContext *context = (ConnContext*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); MCONTACT hContact = (UINT_PTR)context->app_data; - TCHAR szMsg[1024]; + wchar_t szMsg[1024]; switch (LOWORD(wParam)) { case IDCANCEL: DestroyWindow(hwndDlg); break; case IDOK: GetDlgItemText(hwndDlg, IDC_CBO_SMP_CHOOSE, szMsg, _countof(szMsg)); - if (_tcsncmp(szMsg, TranslateT(LANG_SMPTYPE_QUESTION), _countof(szMsg)) == 0) { + if (wcsncmp(szMsg, TranslateW(LANG_SMPTYPE_QUESTION), _countof(szMsg)) == 0) { if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) { - mir_sntprintf(szMsg, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); + mir_sntprintf(szMsg, TranslateW(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); ShowError(szMsg); } else { int len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD1, WM_GETTEXTLENGTH, 0, 0); - TCHAR *question = new TCHAR[len + 1]; + wchar_t *question = new wchar_t[len + 1]; GetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD1, question, len + 1); T2Utf quest(question); delete[] question; len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, WM_GETTEXTLENGTH, 0, 0); - TCHAR *answer = new TCHAR[len + 1]; + wchar_t *answer = new wchar_t[len + 1]; GetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, answer, len + 1); T2Utf ans(answer); delete[] answer; @@ -439,14 +439,14 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam } } - else if (_tcsncmp(szMsg, TranslateT(LANG_SMPTYPE_PASSWORD), _countof(szMsg)) == 0) { + else if (wcsncmp(szMsg, TranslateW(LANG_SMPTYPE_PASSWORD), _countof(szMsg)) == 0) { if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) { - mir_sntprintf(szMsg, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); + mir_sntprintf(szMsg, TranslateW(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); ShowError(szMsg); } else { int len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, WM_GETTEXTLENGTH, 0, 0); - TCHAR *answer = new TCHAR[len + 1]; + wchar_t *answer = new wchar_t[len + 1]; GetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, answer, len + 1); T2Utf ans(answer); delete[] answer; @@ -485,34 +485,34 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam BOOL trusted = false; if (fp->trust && fp->trust[0] != '\0') trusted = true; - TCHAR buff[512]; + wchar_t buff[512]; GetDlgItemText(hwndDlg, IDC_CBO_SMP_CHOOSE, buff, 255); - if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_QUESTION), 255) == 0) { + if (wcsncmp(buff, TranslateW(LANG_SMPTYPE_QUESTION), 255) == 0) { if (trusted) - mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact)); else - mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD1, L""); SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD1, EM_SETREADONLY, FALSE, 0); - SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateT(LANG_SMP_QUESTION)); + SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateW(LANG_SMP_QUESTION)); SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, L""); SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, EM_SETREADONLY, FALSE, 0); - SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateT(LANG_SMP_ANSWER)); + SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateW(LANG_SMP_ANSWER)); ShowWindow(GetDlgItem(hwndDlg, IDOK), SW_SHOWNA); ShowWindow(GetDlgItem(hwndDlg, IDYES), SW_HIDE); ShowWindow(GetDlgItem(hwndDlg, IDNO), SW_HIDE); } - else if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_PASSWORD), 255) == 0) { + else if (wcsncmp(buff, TranslateW(LANG_SMPTYPE_PASSWORD), 255) == 0) { if (trusted) - mir_sntprintf(buff, TranslateT(LANG_OTR_SMPPASSWORD_VERIFIED_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_OTR_SMPPASSWORD_VERIFIED_DESC), contact_get_nameT(hContact)); else - mir_sntprintf(buff, TranslateT(LANG_OTR_SMPPASSWORD_VERIFY_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_OTR_SMPPASSWORD_VERIFY_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -522,18 +522,18 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, L""); SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, EM_SETREADONLY, FALSE, 0); - SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateT(LANG_SMP_PASSWORD)); + SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateW(LANG_SMP_PASSWORD)); ShowWindow(GetDlgItem(hwndDlg, IDOK), SW_SHOWNA); ShowWindow(GetDlgItem(hwndDlg, IDYES), SW_HIDE); ShowWindow(GetDlgItem(hwndDlg, IDNO), SW_HIDE); } - else if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_FINGERPRINT), 255) == 0) { + else if (wcsncmp(buff, TranslateW(LANG_SMPTYPE_FINGERPRINT), 255) == 0) { if (trusted) - mir_sntprintf(buff, TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact)); else - mir_sntprintf(buff, TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -546,12 +546,12 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam otrl_privkey_hash_to_humanT(buff, hash); SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD1, buff); SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD1, EM_SETREADONLY, TRUE, 0); - SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateT(LANG_YOUR_PRIVKEY)); + SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateW(LANG_YOUR_PRIVKEY)); otrl_privkey_hash_to_humanT(buff, fp->fingerprint); SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, buff); SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, EM_SETREADONLY, TRUE, 0); - SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateT(LANG_CONTACT_FINGERPRINT)); + SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateW(LANG_CONTACT_FINGERPRINT)); ShowWindow(GetDlgItem(hwndDlg, IDOK), SW_HIDE); ShowWindow(GetDlgItem(hwndDlg, IDYES), SW_SHOWNA); @@ -626,8 +626,8 @@ static INT_PTR CALLBACK DlgBoxProcVerifyContext(HWND hwndDlg, UINT msg, WPARAM w EndDialog(hwndDlg, IDCANCEL); return FALSE; } - SetWindowText(hwndDlg, _T(LANG_OTR_FPVERIFY_TITLE)); - SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, _T(LANG_OTR_FPVERIFY_TITLE)); + SetWindowText(hwndDlg, LANG_OTR_FPVERIFY_TITLE); + SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, LANG_OTR_FPVERIFY_TITLE); TranslateDialogDefault(hwndDlg); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); @@ -669,11 +669,11 @@ static INT_PTR CALLBACK DlgBoxProcVerifyContext(HWND hwndDlg, UINT msg, WPARAM w EndDialog(hwndDlg, IDCANCEL); return FALSE; } - TCHAR buff[512]; + wchar_t buff[512]; if (!fp->trust || fp->trust[0] == '\0') - mir_sntprintf(buff, TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact)); else - mir_sntprintf(buff, TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -686,12 +686,12 @@ static INT_PTR CALLBACK DlgBoxProcVerifyContext(HWND hwndDlg, UINT msg, WPARAM w otrl_privkey_hash_to_humanT(buff, hash); SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD1, buff); SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD1, EM_SETREADONLY, TRUE, 0); - SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateT(LANG_YOUR_PRIVKEY)); + SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateW(LANG_YOUR_PRIVKEY)); otrl_privkey_hash_to_humanT(buff, fp->fingerprint); SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, buff); SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, EM_SETREADONLY, TRUE, 0); - SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateT(LANG_CONTACT_FINGERPRINT)); + SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateW(LANG_CONTACT_FINGERPRINT)); EnableWindow(GetDlgItem(hwndDlg, IDC_CBO_SMP_CHOOSE), FALSE); @@ -728,14 +728,14 @@ static unsigned int CALLBACK verify_context_thread(void *param) if (param) { ConnContext *context = (ConnContext *)param; MCONTACT hContact = (UINT_PTR)context->app_data; - TCHAR msg[1024]; + wchar_t msg[1024]; switch (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SMP_INPUT), 0, DlgBoxProcVerifyContext, (LPARAM)param)) { case IDOK: case IDYES: lib_cs_lock(); otrl_context_set_trust(context->active_fingerprint, "verified"); otrl_privkey_write_fingerprints(otr_user_state, _T2A(g_fingerprint_store_filename)); - mir_sntprintf(msg, TranslateT(LANG_FINGERPRINT_VERIFIED), contact_get_nameT(hContact)); + mir_sntprintf(msg, TranslateW(LANG_FINGERPRINT_VERIFIED), contact_get_nameT(hContact)); ShowMessage(hContact, msg); SetEncryptionStatus(hContact, otr_context_get_trust(context)); break; @@ -744,7 +744,7 @@ static unsigned int CALLBACK verify_context_thread(void *param) lib_cs_lock(); otrl_context_set_trust(context->active_fingerprint, NULL); otrl_privkey_write_fingerprints(otr_user_state, _T2A(g_fingerprint_store_filename)); - mir_sntprintf(msg, TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact)); + mir_sntprintf(msg, TranslateW(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact)); ShowMessage(hContact, msg); SetEncryptionStatus(hContact, otr_context_get_trust(context)); break; diff --git a/plugins/MirOTR/src/dllmain.cpp b/plugins/MirOTR/src/dllmain.cpp index 134c5d8114..d32244bdef 100644 --- a/plugins/MirOTR/src/dllmain.cpp +++ b/plugins/MirOTR/src/dllmain.cpp @@ -51,7 +51,7 @@ int ModulesLoaded(WPARAM, LPARAM) db_set_b(0, MODULENAME, "sim_warned", 1);
options.default_policy = OTRL_POLICY_MANUAL_MOD;
SaveOptions();
- MessageBox(0, TranslateT(LANG_OTR_SECUREIM_TEXT), TranslateT(LANG_OTR_SECUREIM_TITLE), 0x30);
+ MessageBox(0, TranslateW(LANG_OTR_SECUREIM_TEXT), TranslateW(LANG_OTR_SECUREIM_TITLE), 0x30);
}
return 0;
}
diff --git a/plugins/MirOTR/src/language.h b/plugins/MirOTR/src/language.h index ab93acfa5a..b191f1ab30 100644 --- a/plugins/MirOTR/src/language.h +++ b/plugins/MirOTR/src/language.h @@ -5,39 +5,39 @@ #define LANG_START_OTR LPGEN("Start OTR") #define LANG_STOP_OTR LPGEN("Stop OTR") -#define LANG_YES LPGEN("Yes") -#define LANG_NO LPGEN("No") +#define LANG_YES LPGENW("Yes") +#define LANG_NO LPGENW("No") #define LANG_OTR_TOOLTIP LPGEN("OTR status (Click for more options)") -#define LANG_STATUS_DISABLED LPGEN("OTR Encryption: Disabled") -#define LANG_STATUS_UNVERIFIED LPGEN("OTR Encryption: UNVERIFIED") -#define LANG_STATUS_PRIVATE LPGEN("OTR Encryption: Private") -#define LANG_STATUS_FINISHED LPGEN("OTR Encryption: Finished") - -#define LANG_MENU_START LPGENT("&Start OTR session") -#define LANG_MENU_REFRESH LPGENT("&Refresh OTR session") -#define LANG_MENU_STOP LPGENT("Sto&p OTR session") -#define LANG_MENU_VERIFY LPGENT("&Verify Fingerprint") -#define LANG_MENU_TOGGLEHTML LPGENT("&Convert HTML (for Pidgin)") - -#define LANG_SESSION_TERMINATED_OTR LPGEN("OTR encrypted session with '%s' has been terminated") -#define LANG_SESSION_REQUEST_OTR LPGEN("Requesting OTR encrypted session with '%s'") -#define LANG_SESSION_START_OTR LPGEN("Beginning OTR encrypted session with '%s'") -#define LANG_SESSION_START_OTR_VERIFY LPGEN("Beginning OTR encrypted session with '%s' (NOT VERIFIED)") -#define LANG_SESSION_TRY_CONTINUE_OTR LPGEN("Trying to refresh OTR encrypted session with '%s'") -#define LANG_SESSION_HAS_CONTINUE_OTR LPGEN("OTR encrypted session was refreshed by '%s'") -#define LANG_SESSION_HAS_CONTINUE_OTR_VERIFY LPGEN("OTR encrypted session was refreshed by '%s' (NOT VERIFIED)") -#define LANG_SESSION_CONTINUE_OTR LPGEN("OTR encrypted session with '%s' successfully refreshed") -#define LANG_SESSION_CONTINUE_OTR_VERIFY LPGEN("OTR encrypted session with '%s' successfully refreshed (NOT VERIFIED)") -#define LANG_SESSION_TERMINATED_BY_OTR LPGEN("OTR encrypted session has been terminated by '%s'. You should do that, too!") -#define LANG_SESSION_NOT_STARTED_OTR LPGEN("OTR encrypted session with '%s' could not be started") - -#define LANG_ENCRYPTION_ERROR LPGEN("OTR could not encrypt when sending message") +#define LANG_STATUS_DISABLED LPGENW("OTR Encryption: Disabled") +#define LANG_STATUS_UNVERIFIED LPGENW("OTR Encryption: UNVERIFIED") +#define LANG_STATUS_PRIVATE LPGENW("OTR Encryption: Private") +#define LANG_STATUS_FINISHED LPGENW("OTR Encryption: Finished") + +#define LANG_MENU_START LPGENW("&Start OTR session") +#define LANG_MENU_REFRESH LPGENW("&Refresh OTR session") +#define LANG_MENU_STOP LPGENW("Sto&p OTR session") +#define LANG_MENU_VERIFY LPGENW("&Verify Fingerprint") +#define LANG_MENU_TOGGLEHTML LPGENW("&Convert HTML (for Pidgin)") + +#define LANG_SESSION_TERMINATED_OTR LPGENW("OTR encrypted session with '%s' has been terminated") +#define LANG_SESSION_REQUEST_OTR LPGENW("Requesting OTR encrypted session with '%s'") +#define LANG_SESSION_START_OTR LPGENW("Beginning OTR encrypted session with '%s'") +#define LANG_SESSION_START_OTR_VERIFY LPGENW("Beginning OTR encrypted session with '%s' (NOT VERIFIED)") +#define LANG_SESSION_TRY_CONTINUE_OTR LPGENW("Trying to refresh OTR encrypted session with '%s'") +#define LANG_SESSION_HAS_CONTINUE_OTR LPGENW("OTR encrypted session was refreshed by '%s'") +#define LANG_SESSION_HAS_CONTINUE_OTR_VERIFY LPGENW("OTR encrypted session was refreshed by '%s' (NOT VERIFIED)") +#define LANG_SESSION_CONTINUE_OTR LPGENW("OTR encrypted session with '%s' successfully refreshed") +#define LANG_SESSION_CONTINUE_OTR_VERIFY LPGENW("OTR encrypted session with '%s' successfully refreshed (NOT VERIFIED)") +#define LANG_SESSION_TERMINATED_BY_OTR LPGENW("OTR encrypted session has been terminated by '%s'. You should do that, too!") +#define LANG_SESSION_NOT_STARTED_OTR LPGENW("OTR encrypted session with '%s' could not be started") + +#define LANG_ENCRYPTION_ERROR LPGENW("OTR could not encrypt when sending message") #define LANG_OTR_INFO LPGEN("OTR Information") -#define LANG_FINGERPRINT_VERIFIED LPGEN("OTR encrypted session with '%s' is now using a VERIFIED fingerprint") -#define LANG_FINGERPRINT_NOT_VERIFIED LPGEN("OTR encrypted session with '%s' is now using a NOT VERIFIED fingerprint") +#define LANG_FINGERPRINT_VERIFIED LPGENW("OTR encrypted session with '%s' is now using a VERIFIED fingerprint") +#define LANG_FINGERPRINT_NOT_VERIFIED LPGENW("OTR encrypted session with '%s' is now using a NOT VERIFIED fingerprint") #define LANG_ICON_UNVERIFIED LPGEN("OTR unverified") #define LANG_ICON_FINISHED LPGEN("OTR finished") @@ -46,66 +46,66 @@ #define LANG_ICON_OTR LPGEN("OTR") #define LANG_ICON_REFRESH LPGEN("Refresh") -#define LANG_GENERATE_KEY LPGEN("Generating new private key for protocol '%s'.\nPlease Wait...") - -#define LANG_OPT_GENERAL LPGENT("General") -#define LANG_OPT_PROTO LPGENT("Protocols") -#define LANG_OPT_CONTACTS LPGENT("Contacts") -#define LANG_OPT_FINGER LPGENT("Fingerprints") - -#define LANG_CONTACT LPGEN("Contact") -#define LANG_PROTO LPGEN("Account") -#define LANG_POLICY LPGEN("Policy") -#define LANG_VERIFIED LPGEN("Verified") -#define LANG_ACTIVE LPGEN("Active") -#define LANG_FINGERPRINT LPGEN("Fingerprint") -#define LANG_HTMLCONV LPGEN("Conv. HTML") - -#define LANG_POLICY_DEFAULT LPGEN("Default") -#define LANG_POLICY_ALWAYS LPGEN("Always") -#define LANG_POLICY_OPP LPGEN("Opportunistic") -#define LANG_POLICY_MANUAL LPGEN("Manual") -#define LANG_POLICY_NEVER LPGEN("Never") - -#define LANG_OTR_ASK_NEWKEY LPGEN("Generating new key for '%s'. Continue?") -#define LANG_OTR_ASK_REMOVEKEY LPGEN("Removing key for '%s'. Continue?") - -#define LANG_OTR_FPVERIFY_TITLE LPGEN("OTR Fingerprint Verification") -#define LANG_OTR_FPVERIFY_DESC LPGEN("OTR encrypted session with '%s'.\nThe OTR fingerprint used by your contact is NOT VERIFIED.\nDo you trust it?") -#define LANG_OTR_FPVERIFIED_DESC LPGEN("OTR encrypted session with '%s'.\nThe OTR fingerprint used by your contact is already verified.\nDo you still trust it?") -#define LANG_YOUR_PRIVKEY LPGEN("Your Fingerprint to tell your contact (use a trusted channel!)") -#define LANG_CONTACT_FINGERPRINT LPGEN("VERIFY: Fingerprint from contact") - -#define LANG_SMP_VERIFY_TITLE LPGEN("OTR Authenticate: %s (%s)") -#define LANG_SMPTYPE_QUESTION LPGEN("Challenge Question") -#define LANG_SMPTYPE_PASSWORD LPGEN("Known Password") -#define LANG_SMPTYPE_FINGERPRINT LPGEN("Manual fingerprint comparison") -#define LANG_SMP_ANSWER LPGEN("Secret Answer") -#define LANG_SMP_QUESTION LPGEN("Question") -#define LANG_SMP_PASSWORD LPGEN("Password") - -#define LANG_SMP_SUCCESS LPGEN("Authentication successful.") -#define LANG_SMP_SUCCESS_VERIFY LPGEN("Your contact authenticated you successfully. You can send your own request to authenticate him.") -#define LANG_SMP_ERROR LPGEN("Error during authentication.") -#define LANG_SMP_FAILED LPGEN("Authentication failed") -#define LANG_SMP_IN_PROGRESS LPGEN("Authentication for '%s' is already in progress.") - -#define LANG_SMP_PROGRESS_TITLE LPGEN("OTR Authenticating: %s (%s)") -#define LANG_SMP_PROGRESS_DESC LPGEN("Authenticating contact:\n%s (%s)") - -#define LANG_OTR_SMPQUESTION_VERIFY_DESC LPGEN("OTR encrypted session with '%s' (UNVERIFIED).\nUse a question only your partner can answer.") -#define LANG_OTR_SMPQUESTION_VERIFIED_DESC LPGEN("OTR encrypted session with '%s' (VERIFIED).\nVerify the session again using a question only your partner can answer.") - -#define LANG_OTR_SMPPASSWORD_VERIFY_DESC LPGEN("OTR encrypted session with '%s' (UNVERIFIED).\nUse a known password.") -#define LANG_OTR_SMPPASSWORD_VERIFIED_DESC LPGEN("OTR encrypted session with '%s' (VERIFIED).\nVerify the session again using a known password.") - -#define LANG_OTR_SMPQUESTION_RESPOND_DESC LPGEN("Your contact '%s' wants to verify your identity with a question only you can answer.") - -#define LANG_OTR_SMPPASSWORD_RESPOND_DESC LPGEN("Your contact '%s' wants to verify your identity with a secret password you should know.") - -#define LANG_FINGERPRINT_STILL_IN_USE LPGEN("Fingerprint '%s' still in use in conversation with '%s' (%s). You cannot delete it!") -#define LANG_FINGERPRINT_NOT_DELETED LPGEN("Fingerprint '%s' in use in conversation with '%s' (%s). It could not be deleted!") - -#define LANG_OTR_SECUREIM_STARTED LPGEN("Cannot start OTR for '%s'. SecureIM is already running") -#define LANG_OTR_SECUREIM_TITLE LPGEN("OTR: SecureIM installed") -#define LANG_OTR_SECUREIM_TEXT LPGEN("You are using SecureIM. MirOTR will only work for contacts with SecureIM disabled") +#define LANG_GENERATE_KEY LPGENW("Generating new private key for protocol '%s'.\nPlease Wait...") + +#define LANG_OPT_GENERAL LPGENW("General") +#define LANG_OPT_PROTO LPGENW("Protocols") +#define LANG_OPT_CONTACTS LPGENW("Contacts") +#define LANG_OPT_FINGER LPGENW("Fingerprints") + +#define LANG_CONTACT LPGENW("Contact") +#define LANG_PROTO LPGENW("Account") +#define LANG_POLICY LPGENW("Policy") +#define LANG_VERIFIED LPGENW("Verified") +#define LANG_ACTIVE LPGENW("Active") +#define LANG_FINGERPRINT LPGENW("Fingerprint") +#define LANG_HTMLCONV LPGENW("Conv. HTML") + +#define LANG_POLICY_DEFAULT LPGENW("Default") +#define LANG_POLICY_ALWAYS LPGENW("Always") +#define LANG_POLICY_OPP LPGENW("Opportunistic") +#define LANG_POLICY_MANUAL LPGENW("Manual") +#define LANG_POLICY_NEVER LPGENW("Never") + +#define LANG_OTR_ASK_NEWKEY LPGENW("Generating new key for '%s'. Continue?") +#define LANG_OTR_ASK_REMOVEKEY LPGENW("Removing key for '%s'. Continue?") + +#define LANG_OTR_FPVERIFY_TITLE LPGENW("OTR Fingerprint Verification") +#define LANG_OTR_FPVERIFY_DESC LPGENW("OTR encrypted session with '%s'.\nThe OTR fingerprint used by your contact is NOT VERIFIED.\nDo you trust it?") +#define LANG_OTR_FPVERIFIED_DESC LPGENW("OTR encrypted session with '%s'.\nThe OTR fingerprint used by your contact is already verified.\nDo you still trust it?") +#define LANG_YOUR_PRIVKEY LPGENW("Your Fingerprint to tell your contact (use a trusted channel!)") +#define LANG_CONTACT_FINGERPRINT LPGENW("VERIFY: Fingerprint from contact") + +#define LANG_SMP_VERIFY_TITLE LPGENW("OTR Authenticate: %s (%s)") +#define LANG_SMPTYPE_QUESTION LPGENW("Challenge Question") +#define LANG_SMPTYPE_PASSWORD LPGENW("Known Password") +#define LANG_SMPTYPE_FINGERPRINT LPGENW("Manual fingerprint comparison") +#define LANG_SMP_ANSWER LPGENW("Secret Answer") +#define LANG_SMP_QUESTION LPGENW("Question") +#define LANG_SMP_PASSWORD LPGENW("Password") + +#define LANG_SMP_SUCCESS LPGENW("Authentication successful.") +#define LANG_SMP_SUCCESS_VERIFY LPGENW("Your contact authenticated you successfully. You can send your own request to authenticate him.") +#define LANG_SMP_ERROR LPGENW("Error during authentication.") +#define LANG_SMP_FAILED LPGENW("Authentication failed") +#define LANG_SMP_IN_PROGRESS LPGENW("Authentication for '%s' is already in progress.") + +#define LANG_SMP_PROGRESS_TITLE LPGENW("OTR Authenticating: %s (%s)") +#define LANG_SMP_PROGRESS_DESC LPGENW("Authenticating contact:\n%s (%s)") + +#define LANG_OTR_SMPQUESTION_VERIFY_DESC LPGENW("OTR encrypted session with '%s' (UNVERIFIED).\nUse a question only your partner can answer.") +#define LANG_OTR_SMPQUESTION_VERIFIED_DESC LPGENW("OTR encrypted session with '%s' (VERIFIED).\nVerify the session again using a question only your partner can answer.") + +#define LANG_OTR_SMPPASSWORD_VERIFY_DESC LPGENW("OTR encrypted session with '%s' (UNVERIFIED).\nUse a known password.") +#define LANG_OTR_SMPPASSWORD_VERIFIED_DESC LPGENW("OTR encrypted session with '%s' (VERIFIED).\nVerify the session again using a known password.") + +#define LANG_OTR_SMPQUESTION_RESPOND_DESC LPGENW("Your contact '%s' wants to verify your identity with a question only you can answer.") + +#define LANG_OTR_SMPPASSWORD_RESPOND_DESC LPGENW("Your contact '%s' wants to verify your identity with a secret password you should know.") + +#define LANG_FINGERPRINT_STILL_IN_USE LPGENW("Fingerprint '%s' still in use in conversation with '%s' (%s). You cannot delete it!") +#define LANG_FINGERPRINT_NOT_DELETED LPGENW("Fingerprint '%s' in use in conversation with '%s' (%s). It could not be deleted!") + +#define LANG_OTR_SECUREIM_STARTED LPGENW("Cannot start OTR for '%s'. SecureIM is already running") +#define LANG_OTR_SECUREIM_TITLE LPGENW("OTR: SecureIM installed") +#define LANG_OTR_SECUREIM_TEXT LPGENW("You are using SecureIM. MirOTR will only work for contacts with SecureIM disabled") diff --git a/plugins/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/src/mirotrmenu.cpp index e4c214f823..23e7ecf35c 100644 --- a/plugins/MirOTR/src/mirotrmenu.cpp +++ b/plugins/MirOTR/src/mirotrmenu.cpp @@ -64,25 +64,25 @@ INT_PTR MirOTRMenuCheckService(WPARAM wParam, LPARAM) if (mi.flags & CMIF_NOTNOTPRIVATE && level == TRUST_NOT_PRIVATE) return FALSE; if (pcpp->MenuItemHandle == hStatusInfoItem) { - TCHAR text[128]; + wchar_t text[128]; switch (level) { case TRUST_PRIVATE: - mir_sntprintf(text, L"%s [v%i]", TranslateT(LANG_STATUS_PRIVATE), context->protocol_version); + mir_sntprintf(text, L"%s [v%i]", TranslateW(LANG_STATUS_PRIVATE), context->protocol_version); Menu_ModifyItem(hStatusInfoItem, text, IcoLib_GetIconHandle(ICON_PRIVATE)); break; case TRUST_UNVERIFIED: - mir_sntprintf(text, L"%s [v%i]", TranslateT(LANG_STATUS_UNVERIFIED), context->protocol_version); + mir_sntprintf(text, L"%s [v%i]", TranslateW(LANG_STATUS_UNVERIFIED), context->protocol_version); Menu_ModifyItem(hStatusInfoItem, text, IcoLib_GetIconHandle(ICON_UNVERIFIED)); break; case TRUST_FINISHED: - Menu_ModifyItem(hStatusInfoItem, TranslateT(LANG_STATUS_FINISHED), IcoLib_GetIconHandle(ICON_UNVERIFIED)); + Menu_ModifyItem(hStatusInfoItem, TranslateW(LANG_STATUS_FINISHED), IcoLib_GetIconHandle(ICON_UNVERIFIED)); break; default: - Menu_ModifyItem(hStatusInfoItem, TranslateT(LANG_STATUS_DISABLED), IcoLib_GetIconHandle(ICON_NOT_PRIVATE)); + Menu_ModifyItem(hStatusInfoItem, TranslateW(LANG_STATUS_DISABLED), IcoLib_GetIconHandle(ICON_NOT_PRIVATE)); } } else if (pcpp->MenuItemHandle == hHTMLConvMenuItem) @@ -168,36 +168,36 @@ void InitMirOTRMenu(void) // menu items CMenuItem mi; mi.flags = CMIF_DISABLED | CMIF_TCHAR; - mi.name.t = LPGENT("OTR Status"); + mi.name.w = LPGENW("OTR Status"); mi.position = 0; hStatusInfoItem = AddMirOTRMenuItem(&mi, NULL); mi.flags = CMIF_TCHAR | CMIF_NOTPRIVATE | CMIF_NOTUNVERIFIED; - mi.name.t = LANG_MENU_START; + mi.name.w = LANG_MENU_START; mi.position = 100001; mi.hIcolibItem = IcoLib_GetIconHandle(ICON_UNVERIFIED); AddMirOTRMenuItem(&mi, MS_OTR_MENUSTART); mi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE | CMIF_NOTFINISHED; - mi.name.t = LANG_MENU_REFRESH; + mi.name.w = LANG_MENU_REFRESH; mi.position = 100002; mi.hIcolibItem = IcoLib_GetIconHandle(ICON_FINISHED); AddMirOTRMenuItem(&mi, MS_OTR_MENUREFRESH); mi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE; - mi.name.t = LANG_MENU_STOP; + mi.name.w = LANG_MENU_STOP; mi.position = 100003; mi.hIcolibItem = IcoLib_GetIconHandle(ICON_NOT_PRIVATE); AddMirOTRMenuItem(&mi, MS_OTR_MENUSTOP); mi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE | CMIF_NOTFINISHED; - mi.name.t = LANG_MENU_VERIFY; + mi.name.w = LANG_MENU_VERIFY; mi.position = 200001; mi.hIcolibItem = IcoLib_GetIconHandle(ICON_PRIVATE); AddMirOTRMenuItem(&mi, MS_OTR_MENUVERIFY); mi.flags = CMIF_TCHAR | CMIF_CHECKED; - mi.name.t = LANG_MENU_TOGGLEHTML; + mi.name.w = LANG_MENU_TOGGLEHTML; mi.position = 300001; mi.hIcolibItem = 0; hHTMLConvMenuItem = AddMirOTRMenuItem(&mi, MS_OTR_MENUTOGGLEHTML); diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp index 6743a71079..246dbf71e9 100644 --- a/plugins/MirOTR/src/options.cpp +++ b/plugins/MirOTR/src/options.cpp @@ -3,19 +3,19 @@ extern "C"{ #include "otrlextensions.h" } -TCHAR g_private_key_filename[MAX_PATH]; -TCHAR g_fingerprint_store_filename[MAX_PATH]; -TCHAR g_instag_filename[MAX_PATH]; +wchar_t g_private_key_filename[MAX_PATH]; +wchar_t g_fingerprint_store_filename[MAX_PATH]; +wchar_t g_instag_filename[MAX_PATH]; HANDLE hPATH_MIROTR; Options options; #define DATA_DIRECTORY MIRANDA_USERDATAT L"\\" _T(MODULENAME) struct PROTOREGENKEYOPTIONS { HWND refresh; - TCHAR proto[129]; + wchar_t proto[129]; }; -void SetFilenames(const TCHAR *path) +void SetFilenames(const wchar_t *path) { if (!path || !path[0]) return; @@ -28,7 +28,7 @@ void SetFilenames(const TCHAR *path) int FoldersChanged(WPARAM, LPARAM) { - TCHAR path[MAX_PATH]; + wchar_t path[MAX_PATH]; if ( FoldersGetCustomPathT(hPATH_MIROTR, path, _countof(path), L"")) SetFilenames( VARST(DATA_DIRECTORY)); else @@ -130,7 +130,7 @@ void ReadPrivkeyFiles() static INT_PTR CALLBACK DlgProcMirOTROpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { static bool bInit = true; - TCHAR *prefix; + wchar_t *prefix; switch ( msg ) { case WM_INITDIALOG: bInit = false; @@ -214,7 +214,7 @@ static INT_PTR CALLBACK DlgProcMirOTROpts(HWND hwndDlg, UINT msg, WPARAM wParam, options.end_offline = (TRUE==IsDlgButtonChecked(hwndDlg, IDC_CHK_ENDOFFLINE)); options.end_window_close = (TRUE==IsDlgButtonChecked(hwndDlg, IDC_CHK_ENDCLOSE)); - prefix = (TCHAR*)_alloca(sizeof(TCHAR)*OPTIONS_PREFIXLEN); + prefix = (wchar_t*)_alloca(sizeof(wchar_t)*OPTIONS_PREFIXLEN); GetDlgItemText(hwndDlg, IDC_ED_PREFIX, prefix, OPTIONS_PREFIXLEN); T2Utf prefix_utf(prefix); @@ -236,9 +236,9 @@ static unsigned int CALLBACK regen_key_thread(void* param) { Thread_Push(0); PROTOREGENKEYOPTIONS *opts = (PROTOREGENKEYOPTIONS *)param; - TCHAR buff[512]; + wchar_t buff[512]; - mir_sntprintf(buff, TranslateT(LANG_OTR_ASK_NEWKEY), opts->proto); + mir_sntprintf(buff, TranslateW(LANG_OTR_ASK_NEWKEY), opts->proto); EnableWindow(opts->refresh, FALSE); if (IDYES == MessageBox(opts->refresh, buff, TranslateT(LANG_OTR_INFO), MB_ICONQUESTION|MB_YESNO)) { char* proto = mir_t2a(opts->proto); @@ -270,11 +270,11 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP TranslateDialogDefault(hwndDlg); { HWND cmb = GetDlgItem(hwndDlg, IDC_CMB_PROTO_POLICY); - SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_DEFAULT)); - SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_ALWAYS)); - SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_OPP)); - SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_MANUAL)); - SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_NEVER)); + SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_DEFAULT)); + SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_ALWAYS)); + SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_OPP)); + SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_MANUAL)); + SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_NEVER)); SendDlgItemMessage(hwndDlg, IDC_CMB_PROTO_POLICY, CB_SETCURSEL, (LPARAM)-1, 0); EnableWindow(GetDlgItem(hwndDlg, IDC_CMB_PROTO_POLICY), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_PROTO_NEWKEY), FALSE); @@ -292,17 +292,17 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP lvc.fmt = LVCFMT_LEFT; lvc.iSubItem = 0; - lvc.pszText = TranslateT(LANG_PROTO); + lvc.pszText = TranslateW(LANG_PROTO); lvc.cx = 85; // width of column in pixels ListView_InsertColumn(lv, 0, &lvc); lvc.iSubItem = 1; - lvc.pszText = TranslateT(LANG_POLICY); + lvc.pszText = TranslateW(LANG_POLICY); lvc.cx = 80; // width of column in pixels ListView_InsertColumn(lv, 1, &lvc); lvc.iSubItem = 2; - lvc.pszText = TranslateT(LANG_FINGERPRINT); + lvc.pszText = TranslateW(LANG_FINGERPRINT); lvc.cx = 275; // width of column in pixels ListView_InsertColumn(lv, 2, &lvc); } @@ -328,11 +328,11 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP item.lParam = (LPARAM)pppDesc[i]->szModuleName; int ilvItem = ListView_InsertItem(lv, &item); - ListView_SetItemText(lv, ilvItem, 1, (TCHAR*)policy_to_string(db_get_dw(0, MODULENAME"_ProtoPol", pppDesc[i]->szModuleName, CONTACT_DEFAULT_POLICY))); + ListView_SetItemText(lv, ilvItem, 1, (wchar_t*)policy_to_string(db_get_dw(0, MODULENAME"_ProtoPol", pppDesc[i]->szModuleName, CONTACT_DEFAULT_POLICY))); char fprint[45]; if (otrl_privkey_fingerprint(otr_user_state, fprint, pppDesc[i]->szModuleName, pppDesc[i]->szModuleName)) { - TCHAR *temp = mir_a2t(fprint); + wchar_t *temp = mir_a2t(fprint); ListView_SetItemText(lv, ilvItem, 2, temp); mir_free(temp); } @@ -357,10 +357,10 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP case IDC_BTN_PROTO_FORGET: sel = ListView_GetSelectionMark(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS)); if (sel != -1) { - TCHAR buff_proto[128]; + wchar_t buff_proto[128]; ListView_GetItemText(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS), sel, 0, buff_proto, _countof(buff_proto)); - TCHAR buff[512]; - mir_sntprintf(buff, TranslateT(LANG_OTR_ASK_REMOVEKEY), buff_proto); + wchar_t buff[512]; + mir_sntprintf(buff, TranslateW(LANG_OTR_ASK_REMOVEKEY), buff_proto); if (IDYES == MessageBox(hwndDlg, buff, TranslateT(LANG_OTR_INFO), MB_ICONQUESTION | MB_YESNO)) { char *proto = GetProtoName(lv, sel); if (proto == NULL) @@ -386,7 +386,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP if (sel == CB_ERR) break; int len = SendDlgItemMessage(hwndDlg, IDC_CMB_PROTO_POLICY, CB_GETLBTEXTLEN, sel, 0); if (len < 0) break; - TCHAR *text = new TCHAR[len + 1]; + wchar_t *text = new wchar_t[len + 1]; SendDlgItemMessage(hwndDlg, IDC_CMB_PROTO_POLICY, CB_GETLBTEXT, sel, (LPARAM)text); ListView_SetItemText(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS), proto, 1, text); delete[] text; @@ -412,14 +412,14 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP EnableWindow(GetDlgItem(hwndDlg, IDC_CMB_PROTO_POLICY), TRUE); EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_PROTO_NEWKEY), TRUE); EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_PROTO_FORGET), TRUE); - TCHAR buff[50]; + wchar_t buff[50]; ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, notif->iItem, 1, buff, _countof(buff)); SendDlgItemMessage(hwndDlg, IDC_CMB_PROTO_POLICY, CB_SELECTSTRING, (LPARAM)-1, (WPARAM)buff); } } else if (((LPNMHDR)lParam)->code == PSN_APPLY) { int cnt = ListView_GetItemCount(lv); - TCHAR policy[64]; + wchar_t policy[64]; for (int i = 0; i < cnt; ++i) { char *proto = GetProtoName(lv, i); if (proto == NULL) @@ -447,11 +447,11 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) new ContactPolicyMap()); HWND cmb = GetDlgItem(hwndDlg, IDC_CMB_CONT_POLICY); - SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_DEFAULT)); - SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_ALWAYS)); - SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_OPP)); - SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_MANUAL)); - SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_NEVER)); + SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_DEFAULT)); + SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_ALWAYS)); + SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_OPP)); + SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_MANUAL)); + SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_NEVER)); EnableWindow(GetDlgItem(hwndDlg, IDC_CMB_CONT_POLICY), FALSE); SendDlgItemMessage(hwndDlg, IDC_LV_CONT_CONTACTS, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);// | LVS_EX_CHECKBOXES); @@ -465,22 +465,22 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM lvc.fmt = LVCFMT_LEFT; lvc.iSubItem = 0; - lvc.pszText = TranslateT(LANG_CONTACT); + lvc.pszText = TranslateW(LANG_CONTACT); lvc.cx = 150; // width of column in pixels ListView_InsertColumn(lv, 0, &lvc); lvc.iSubItem = 1; - lvc.pszText = TranslateT(LANG_PROTO); + lvc.pszText = TranslateW(LANG_PROTO); lvc.cx = 100; // width of column in pixels ListView_InsertColumn(lv, 1, &lvc); lvc.iSubItem = 2; - lvc.pszText = TranslateT(LANG_POLICY); + lvc.pszText = TranslateW(LANG_POLICY); lvc.cx = 90; // width of column in pixels ListView_InsertColumn(lv, 2, &lvc); lvc.iSubItem = 3; - lvc.pszText = TranslateT(LANG_HTMLCONV); + lvc.pszText = TranslateW(LANG_HTMLCONV); lvc.cx = 80; // width of column in pixels ListView_InsertColumn(lv, 3, &lvc); } @@ -505,14 +505,14 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM lvI.iItem = 0; lvI.iSubItem = 0; lvI.lParam = hContact; - lvI.pszText = (TCHAR*)contact_get_nameT(hContact); + lvI.pszText = (wchar_t*)contact_get_nameT(hContact); lvI.iItem = ListView_InsertItem(lv, &lvI); PROTOACCOUNT *pa = Proto_GetAccount(proto); ListView_SetItemText(lv, lvI.iItem, 1, pa->tszAccountName); - ListView_SetItemText(lv, lvI.iItem, 2, (TCHAR*)policy_to_string((OtrlPolicy)db_get_dw(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY))); - ListView_SetItemText(lv, lvI.iItem, 3, (db_get_b(hContact, MODULENAME, "HTMLConv", 0)) ? TranslateT(LANG_YES) : TranslateT(LANG_NO)); + ListView_SetItemText(lv, lvI.iItem, 2, (wchar_t*)policy_to_string((OtrlPolicy)db_get_dw(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY))); + ListView_SetItemText(lv, lvI.iItem, 3, (db_get_b(hContact, MODULENAME, "HTMLConv", 0)) ? TranslateW(LANG_YES) : TranslateW(LANG_NO)); } } } @@ -529,7 +529,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM if (sel == CB_ERR) break; int len = SendDlgItemMessage(hwndDlg, IDC_CMB_CONT_POLICY, CB_GETLBTEXTLEN, sel, 0); if (len < 0) break; - TCHAR *text = new TCHAR[len + 1]; + wchar_t *text = new wchar_t[len + 1]; SendDlgItemMessage(hwndDlg, IDC_CMB_CONT_POLICY, CB_GETLBTEXT, sel, (LPARAM)text); ListView_SetItemText(GetDlgItem(hwndDlg, IDC_LV_CONT_CONTACTS), iUser, 2, text); OtrlPolicy policy = policy_from_string(text); @@ -574,7 +574,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM } else { EnableWindow(GetDlgItem(hwndDlg, IDC_CMB_CONT_POLICY), TRUE); - TCHAR buff[50]; + wchar_t buff[50]; ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, notif->iItem, 2, buff, _countof(buff)); SendDlgItemMessage(hwndDlg, IDC_CMB_CONT_POLICY, CB_SELECTSTRING, (LPARAM)-1, (WPARAM)buff); } @@ -590,15 +590,15 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM MCONTACT hContact = (MCONTACT)lvi.lParam; ContactPolicyMap *cp = (ContactPolicyMap *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - TCHAR buff[50]; + wchar_t buff[50]; ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, buff, _countof(buff)); - if (_tcsncmp(buff, TranslateT(LANG_YES), 50) == 0) { + if (wcsncmp(buff, TranslateW(LANG_YES), 50) == 0) { (*cp)[hContact].htmlconv = HTMLCONV_DISABLE; - ListView_SetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, TranslateT(LANG_NO)); + ListView_SetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, TranslateW(LANG_NO)); } else { (*cp)[hContact].htmlconv = HTMLCONV_ENABLE; - ListView_SetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, TranslateT(LANG_YES)); + ListView_SetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, TranslateW(LANG_YES)); } SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); } @@ -635,27 +635,27 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w lvc.fmt = LVCFMT_LEFT; lvc.iSubItem = 0; - lvc.pszText = TranslateT(LANG_CONTACT); + lvc.pszText = TranslateW(LANG_CONTACT); lvc.cx = 100; // width of column in pixels ListView_InsertColumn(lv, 0, &lvc); lvc.iSubItem = 1; - lvc.pszText = TranslateT(LANG_PROTO); + lvc.pszText = TranslateW(LANG_PROTO); lvc.cx = 90; // width of column in pixels ListView_InsertColumn(lv, 1, &lvc); lvc.iSubItem = 2; - lvc.pszText = TranslateT(LANG_ACTIVE); + lvc.pszText = TranslateW(LANG_ACTIVE); lvc.cx = 50; // width of column in pixels ListView_InsertColumn(lv, 2, &lvc); lvc.iSubItem = 3; - lvc.pszText = TranslateT(LANG_VERIFIED); + lvc.pszText = TranslateW(LANG_VERIFIED); lvc.cx = 50; // width of column in pixels ListView_InsertColumn(lv, 3, &lvc); lvc.iSubItem = 4; - lvc.pszText = TranslateT(LANG_FINGERPRINT); + lvc.pszText = TranslateW(LANG_FINGERPRINT); lvc.cx = 300; // width of column in pixels ListView_InsertColumn(lv, 4, &lvc); } @@ -673,10 +673,10 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w // items. lvI.mask = LVIF_TEXT | LVIF_PARAM;// | LVIF_NORECOMPUTE;// | LVIF_IMAGE; - TCHAR *user, hash[45] = { 0 }; + wchar_t *user, hash[45] = { 0 }; for (ConnContext *context = otr_user_state->context_root; context; context = context->next) { if (context->app_data) { - user = (TCHAR*)contact_get_nameT((UINT_PTR)context->app_data); + user = (wchar_t*)contact_get_nameT((UINT_PTR)context->app_data); if (user) { PROTOACCOUNT *pa = Proto_GetAccount(context->protocol); @@ -688,8 +688,8 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w int d = ListView_InsertItem(lv, &lvI); ListView_SetItemText(lv, d, 1, pa->tszAccountName); - ListView_SetItemText(lv, d, 2, (context->active_fingerprint == fp) ? TranslateT(LANG_YES) : TranslateT(LANG_NO)); - ListView_SetItemText(lv, d, 3, (fp->trust && fp->trust[0] != '\0') ? TranslateT(LANG_YES) : TranslateT(LANG_NO)); + ListView_SetItemText(lv, d, 2, (context->active_fingerprint == fp) ? TranslateW(LANG_YES) : TranslateW(LANG_NO)); + ListView_SetItemText(lv, d, 3, (fp->trust && fp->trust[0] != '\0') ? TranslateW(LANG_YES) : TranslateW(LANG_NO)); ListView_SetItemText(lv, d, 4, hash); } } @@ -713,7 +713,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w Fingerprint *fp = (Fingerprint*)lvi.lParam; FPModifyMap* fpm = (FPModifyMap*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); (*fpm)[fp] = FPM_NOTRUST; - ListView_SetItemText(GetDlgItem(hwndDlg, IDC_LV_FINGER_LIST), sel, 3, TranslateT(LANG_NO)); + ListView_SetItemText(GetDlgItem(hwndDlg, IDC_LV_FINGER_LIST), sel, 3, TranslateW(LANG_NO)); SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); } break; @@ -727,7 +727,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w Fingerprint *fp = (Fingerprint*)lvi.lParam; FPModifyMap* fpm = (FPModifyMap*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); (*fpm)[fp] = FPM_VERIFY; - ListView_SetItemText(GetDlgItem(hwndDlg, IDC_LV_FINGER_LIST), sel, 3, TranslateT(LANG_YES)); + ListView_SetItemText(GetDlgItem(hwndDlg, IDC_LV_FINGER_LIST), sel, 3, TranslateW(LANG_YES)); SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); } break; @@ -742,10 +742,10 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w Fingerprint *fp = (Fingerprint*)lvi.lParam; if (fp->context->active_fingerprint == fp) { MCONTACT hContact = (UINT_PTR)fp->context->app_data; - TCHAR buff[1024], hash[45]; + wchar_t buff[1024], hash[45]; otrl_privkey_hash_to_humanT(hash, fp->fingerprint); PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact)); - mir_sntprintf(buff, TranslateT(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT(hContact), pa->tszAccountName); + mir_sntprintf(buff, TranslateW(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT(hContact), pa->tszAccountName); ShowError(buff); } else { @@ -772,10 +772,10 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w case FPM_DELETE: if (it->first->context->active_fingerprint == it->first) { MCONTACT hContact = (UINT_PTR)it->first->context->app_data; - TCHAR buff[1024], hash[45]; + wchar_t buff[1024], hash[45]; otrl_privkey_hash_to_humanT(hash, it->first->fingerprint); PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact)); - mir_sntprintf(buff, TranslateT(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT(hContact), pa->tszAccountName); + mir_sntprintf(buff, TranslateW(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT(hContact), pa->tszAccountName); ShowError(buff); } else otrl_context_forget_fingerprint(it->first, 1); @@ -820,26 +820,26 @@ static int OpenOptions(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 }; odp.position = 100; odp.hInstance = hInst; - odp.ptszGroup = LPGENT("Services"); - odp.ptszTitle = L"OTR"; + odp.pwszGroup = LPGENW("Services"); + odp.pwszTitle = L"OTR"; odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; - odp.ptszTab = LANG_OPT_GENERAL; + odp.pwszTab = LANG_OPT_GENERAL; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GENERAL); odp.pfnDlgProc = DlgProcMirOTROpts; Options_AddPage(wParam, &odp); - odp.ptszTab = LANG_OPT_PROTO; + odp.pwszTab = LANG_OPT_PROTO; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_PROTO); odp.pfnDlgProc = DlgProcMirOTROptsProto; Options_AddPage(wParam, &odp); - odp.ptszTab = LANG_OPT_CONTACTS; + odp.pwszTab = LANG_OPT_CONTACTS; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CONTACTS); odp.pfnDlgProc = DlgProcMirOTROptsContacts; Options_AddPage(wParam, &odp); - odp.ptszTab = LANG_OPT_FINGER; + odp.pwszTab = LANG_OPT_FINGER; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FINGER); odp.pfnDlgProc = DlgProcMirOTROptsFinger; Options_AddPage(wParam, &odp); diff --git a/plugins/MirOTR/src/options.h b/plugins/MirOTR/src/options.h index d7f46344ea..1aca058985 100644 --- a/plugins/MirOTR/src/options.h +++ b/plugins/MirOTR/src/options.h @@ -5,9 +5,9 @@ #define FINGERPRINT_STORE_FILENAME "otr.fingerprints" #define INSTAG_FILENAME "otr.instag" -extern TCHAR g_fingerprint_store_filename[MAX_PATH]; -extern TCHAR g_private_key_filename[MAX_PATH]; -extern TCHAR g_instag_filename[MAX_PATH]; +extern wchar_t g_fingerprint_store_filename[MAX_PATH]; +extern wchar_t g_private_key_filename[MAX_PATH]; +extern wchar_t g_instag_filename[MAX_PATH]; #define CONTACT_DEFAULT_POLICY 0xFFFF diff --git a/plugins/MirOTR/src/otr.cpp b/plugins/MirOTR/src/otr.cpp index 8f2c9f0bb8..da2af8a178 100644 --- a/plugins/MirOTR/src/otr.cpp +++ b/plugins/MirOTR/src/otr.cpp @@ -56,9 +56,9 @@ INT_PTR CALLBACK GenKeyDlgBoxProc(HWND hWndDlg, UINT msg, WPARAM, LPARAM lParam) } TranslateDialogDefault(hWndDlg); SetClassLongPtr(hWndDlg, GCLP_HICON, (LONG_PTR)IcoLib_GetIcon(ICON_OTR, 1)); - TCHAR buff[256]; - TCHAR *proto = mir_a2t((char*)lParam); - mir_sntprintf(buff, TranslateT(LANG_GENERATE_KEY), proto); + wchar_t buff[256]; + wchar_t *proto = mir_a2t((char*)lParam); + mir_sntprintf(buff, TranslateW(LANG_GENERATE_KEY), proto); mir_free(proto); SetDlgItemText(hWndDlg, IDC_GENERATE, buff); GenKeyData *data = (GenKeyData *)mir_calloc(sizeof(GenKeyData)); @@ -175,20 +175,20 @@ extern "C" { MCONTACT hContact = (UINT_PTR)opdata; TrustLevel trusted = otr_context_get_trust(context); SetEncryptionStatus(hContact, trusted); - TCHAR buff[512]; + wchar_t buff[512]; if (trusted == TRUST_PRIVATE) { - mir_sntprintf(buff, TranslateT(LANG_SESSION_START_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_SESSION_START_OTR), contact_get_nameT(hContact)); } else if (trusted == TRUST_UNVERIFIED) { if (options.autoshow_verify) SMPInitDialog(context); //VerifyContextDialog(context); - mir_sntprintf(buff, TranslateT(LANG_SESSION_START_OTR_VERIFY), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_SESSION_START_OTR_VERIFY), contact_get_nameT(hContact)); } else { // should never happen - mir_sntprintf(buff, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); } if (context->protocol_version < MIROTR_PROTO_LATEST){ size_t remaining = mir_tstrlen(buff); - TCHAR *offset = buff + remaining; + wchar_t *offset = buff + remaining; remaining = _countof(buff) - remaining; mir_sntprintf(offset, remaining, TranslateT("\nusing older protocol version %i"), context->protocol_version); } @@ -200,8 +200,8 @@ extern "C" { void otr_gui_gone_insecure(void *opdata, ConnContext *context) { MCONTACT hContact = (UINT_PTR)opdata; DEBUGOUTA("OTR_GUI_GONE_INSECURE\n"); - TCHAR buff[512]; - mir_sntprintf(buff, TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(hContact)); + wchar_t buff[512]; + mir_sntprintf(buff, TranslateW(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(hContact)); //MessageBox(0, buff, Translate("OTR Information"), MB_OK); if (!Miranda_Terminated()) { ShowMessage(hContact, buff); @@ -218,30 +218,30 @@ extern "C" { DEBUGOUTA("OTR_GUI_STILL_SECURE\n"); TrustLevel trusted = otr_context_get_trust(context); SetEncryptionStatus(hContact, trusted); - TCHAR buff[1024]; + wchar_t buff[1024]; if (!is_reply) { if (trusted == TRUST_PRIVATE) { - mir_sntprintf(buff, TranslateT(LANG_SESSION_CONTINUE_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_SESSION_CONTINUE_OTR), contact_get_nameT(hContact)); } else if (trusted == TRUST_UNVERIFIED) { if (options.autoshow_verify) SMPInitDialog(context); //VerifyContextDialog(context); - mir_sntprintf(buff, TranslateT(LANG_SESSION_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_SESSION_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact)); } else { // should never happen - mir_sntprintf(buff, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); } // opdata is hContact ShowMessage(hContact, buff); } else { if (trusted == TRUST_PRIVATE) { - mir_sntprintf(buff, TranslateT(LANG_SESSION_HAS_CONTINUE_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_SESSION_HAS_CONTINUE_OTR), contact_get_nameT(hContact)); } else if (trusted == TRUST_UNVERIFIED) { - mir_sntprintf(buff, TranslateT(LANG_SESSION_HAS_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_SESSION_HAS_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact)); } else { // should never happen - mir_sntprintf(buff, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); } } @@ -313,12 +313,12 @@ extern "C" { void handle_msg_event(void *opdata, OtrlMessageEvent msg_event, ConnContext *, const char *message, gcry_error_t err) { DEBUGOUTA("HANDLE_MSG_EVENT\n"); MCONTACT hContact = (UINT_PTR)opdata; - const TCHAR* contact = contact_get_nameT(hContact); + const wchar_t* contact = contact_get_nameT(hContact); - typedef void(*msgfunc_t)(const MCONTACT, const TCHAR*); + typedef void(*msgfunc_t)(const MCONTACT, const wchar_t*); msgfunc_t msgfunc = ShowMessage; - // TCHAR* title = NULL; - TCHAR msg[512]; + // wchar_t* title = NULL; + wchar_t msg[512]; msg[0] = '\0'; switch (msg_event){ case OTRL_MSGEVENT_NONE: @@ -346,7 +346,7 @@ extern "C" { mir_snwprintf(msg, _countof(msg), TranslateT("Error setting up private conversation: %s"), TranslateT("Malformed message received")); break; default:{ - TCHAR* tmp = mir_utf8decodeT(gcry_strerror(err)); + wchar_t* tmp = mir_utf8decodeT(gcry_strerror(err)); mir_snwprintf(msg, _countof(msg), TranslateT("Error setting up private conversation: %s"), tmp); mir_free(tmp); } } @@ -373,14 +373,14 @@ extern "C" { break; case OTRL_MSGEVENT_RCVDMSG_GENERAL_ERR:{ // title = TranslateT("OTR Error"); - TCHAR* tmp = mir_utf8decodeT(message); + wchar_t* tmp = mir_utf8decodeT(message); mir_tstrncpy(msg, tmp, _countof(msg)); mir_free(tmp); break; } case OTRL_MSGEVENT_RCVDMSG_UNENCRYPTED:{ // title = TranslateT("Received unencrypted message"); msgfunc = ShowMessageInline; - TCHAR* tmp = mir_utf8decodeT(message); + wchar_t* tmp = mir_utf8decodeT(message); mir_snwprintf(msg, _countof(msg), TranslateT("The following message received from '%s' was NOT encrypted:\n\n%s"), contact, tmp); mir_free(tmp); ProtoChainSend(hContact, PSS_MESSAGE, PREF_BYPASS_OTR, (LPARAM)message); @@ -400,7 +400,7 @@ extern "C" { //void otr_create_instag(void *opdata, const char *accountname, const char *protocol) { void otr_create_instag(void *, const char *accountname, const char *protocol){ DEBUGOUTA("OTR_CREATE_INSTAG\n"); - FILE* instagf = _tfopen(g_instag_filename, L"w+b"); + FILE* instagf = _wfopen(g_instag_filename, L"w+b"); if (!instagf) return; otrl_instag_generate_FILEp(otr_user_state, instagf, accountname, protocol); diff --git a/plugins/MirOTR/src/otr.h b/plugins/MirOTR/src/otr.h index efa67f4aed..7746f2dd79 100644 --- a/plugins/MirOTR/src/otr.h +++ b/plugins/MirOTR/src/otr.h @@ -8,7 +8,7 @@ extern OtrlMessageAppOps ops; #define MIROTR_PROTO_HELLO "?OTRv23?" /* OTR link normally is https://otr.cypherpunks.ca/ but it's blocked by ICQ as of March 2015 (even something like "ot-r.cyp her_ pun ks. ca") It might be a good idea to use http://wikipedia.org/wiki/Off-the-Record_Messaging instead as it's not yet blocked by ICQ but might still help users to find a client/plugin */ -#define MIROTR_PROTO_HELLO_MSG LPGENT(" has requested an Off-the-Record private conversation. However, you do not have a plugin to support that.\nSee http://wikipedia.org/wiki/Off-the-Record_Messaging for more information.") +#define MIROTR_PROTO_HELLO_MSG LPGENW(" has requested an Off-the-Record private conversation. However, you do not have a plugin to support that.\nSee http://wikipedia.org/wiki/Off-the-Record_Messaging for more information.") extern "C" { diff --git a/plugins/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/src/svcs_menu.cpp index 15a139bef8..e21c05c762 100644 --- a/plugins/MirOTR/src/svcs_menu.cpp +++ b/plugins/MirOTR/src/svcs_menu.cpp @@ -19,22 +19,22 @@ int StartOTR(MCONTACT hContact) { otr_gui_inject_message((void*)hContact, proto, proto, uname, msg ? msg : MIROTR_PROTO_HELLO); free(msg); #else - TCHAR* nick=ProtoGetNickname(proto); + wchar_t* nick=ProtoGetNickname(proto); if(nick){ - TCHAR msg[1024]; - TCHAR* msgend = msg+_countof(msg)-1; - TCHAR* msgoff = msg; + wchar_t msg[1024]; + wchar_t* msgend = msg+_countof(msg)-1; + wchar_t* msgoff = msg; for(const char* c=MIROTR_PROTO_HELLO; *c; *msgoff++=*c++); *msgoff++ = '\n'; - for(const TCHAR* c=nick; *c && msgoff<msgend; *msgoff++=*c++); - for(const TCHAR* c=MIROTR_PROTO_HELLO_MSG; *c && msgoff<msgend; *msgoff++=*c++); + for(const wchar_t* c=nick; *c && msgoff<msgend; *msgoff++=*c++); + for(const wchar_t* c=MIROTR_PROTO_HELLO_MSG; *c && msgoff<msgend; *msgoff++=*c++); LCID langid = Langpack_GetDefaultLocale(); if(langid != 0x0409/*US*/ && langid != 0x1009/*CA*/ && langid != 0x0809/*GB*/){ // non english - const TCHAR* translated=TranslateTS(MIROTR_PROTO_HELLO_MSG); + const wchar_t* translated=TranslateTS(MIROTR_PROTO_HELLO_MSG); if(mir_tstrcmp(MIROTR_PROTO_HELLO_MSG,translated)){ *msgoff++ = '\n'; - for(const TCHAR* c=nick; *c && msgoff<msgend; *msgoff++=*c++); - for(const TCHAR* c=translated; *c && msgoff<msgend; *msgoff++=*c++); + for(const wchar_t* c=nick; *c && msgoff<msgend; *msgoff++=*c++); + for(const wchar_t* c=translated; *c && msgoff<msgend; *msgoff++=*c++); } } *msgoff='\0'; @@ -50,19 +50,19 @@ int StartOTR(MCONTACT hContact) { INT_PTR SVC_StartOTR(WPARAM hContact, LPARAM) { - TCHAR buff[512]; + wchar_t buff[512]; MCONTACT hSub = db_mc_getMostOnline(hContact); if(hSub != 0) hContact = hSub; if ( options.bHaveSecureIM && CallService("SecureIM/IsContactSecured", hContact, 0) != 0 ) { - mir_sntprintf(buff, TranslateT(LANG_OTR_SECUREIM_STARTED), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_OTR_SECUREIM_STARTED), contact_get_nameT(hContact)); ShowError(buff); return 0; } - mir_sntprintf(buff, TranslateT(LANG_SESSION_REQUEST_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_SESSION_REQUEST_OTR), contact_get_nameT(hContact)); ShowMessage(hContact, buff); return StartOTR(hContact); @@ -70,19 +70,19 @@ INT_PTR SVC_StartOTR(WPARAM hContact, LPARAM) INT_PTR SVC_RefreshOTR(WPARAM hContact, LPARAM) { - TCHAR buff[512]; + wchar_t buff[512]; MCONTACT hSub = db_mc_getMostOnline(hContact); if(hSub != 0) hContact = hSub; if ( options.bHaveSecureIM && CallService("SecureIM/IsContactSecured", hContact, 0) != 0 ) { - mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SECUREIM_STARTED), contact_get_nameT(hContact)); + mir_sntprintf(buff, 512, TranslateW(LANG_OTR_SECUREIM_STARTED), contact_get_nameT(hContact)); ShowError(buff); return 0; } - mir_sntprintf(buff, TranslateT(LANG_SESSION_TRY_CONTINUE_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateW(LANG_SESSION_TRY_CONTINUE_OTR), contact_get_nameT(hContact)); ShowMessage(hContact, buff); int res = StartOTR(hContact); @@ -115,8 +115,8 @@ INT_PTR SVC_StopOTR(WPARAM hContact, LPARAM) SetEncryptionStatus(hContact, TRUST_NOT_PRIVATE); - TCHAR buff[512]; - mir_sntprintf(buff, TranslateT(LANG_SESSION_TERMINATED_OTR), contact_get_nameT(hContact)); + wchar_t buff[512]; + mir_sntprintf(buff, TranslateW(LANG_SESSION_TERMINATED_OTR), contact_get_nameT(hContact)); ShowMessage(hContact, buff); return 0; } @@ -163,13 +163,13 @@ void InitMenu() mi.position = -400000; SET_UID(mi, 0xAB574FAD, 0x15D8, 0x49FF, 0xB7, 0x03, 0xDA, 0x2B, 0x45, 0x46, 0xC3, 0x56); - mi.name.t = _T(LANG_STOP_OTR); + mi.name.w = _T(LANG_STOP_OTR); mi.pszService = MS_OTR_MENUSTOP; mi.hIcolibItem = IcoLib_GetIconHandle(ICON_PRIVATE); hStopItem = Menu_AddContactMenuItem(&mi); mi.uid.d[7]++; - mi.name.t = _T(LANG_START_OTR); + mi.name.w = _T(LANG_START_OTR); mi.pszService = MS_OTR_MENUSTART; mi.hIcolibItem = IcoLib_GetIconHandle(ICON_NOT_PRIVATE); hStartItem = Menu_AddContactMenuItem(&mi); diff --git a/plugins/MirOTR/src/svcs_proto.cpp b/plugins/MirOTR/src/svcs_proto.cpp index 9aa72920d9..375484f775 100644 --- a/plugins/MirOTR/src/svcs_proto.cpp +++ b/plugins/MirOTR/src/svcs_proto.cpp @@ -45,7 +45,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){ if (err) { /* Be *sure* not to send out plaintext */ DEBUGOUTA("otrl_message_sending err"); - ShowError(TranslateT(LANG_ENCRYPTION_ERROR)); + ShowError(TranslateW(LANG_ENCRYPTION_ERROR)); otrl_message_free(newmessage); return 1; } @@ -110,8 +110,8 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam) OtrlTLV *tlv = otrl_tlv_find(tlvs, OTRL_TLV_DISCONNECTED); if (tlv && !Miranda_Terminated()) { /* Notify the user that the other side disconnected. */ - TCHAR buff[256]; - mir_sntprintf(buff, TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(ccs->hContact)); + wchar_t buff[256]; + mir_sntprintf(buff, TranslateW(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(ccs->hContact)); SetEncryptionStatus(ccs->hContact, otr_context_get_trust(context)); // required since libotr 4!? ShowMessage(ccs->hContact, buff); } diff --git a/plugins/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/src/svcs_srmm.cpp index 51ebb6145d..025b968610 100644 --- a/plugins/MirOTR/src/svcs_srmm.cpp +++ b/plugins/MirOTR/src/svcs_srmm.cpp @@ -40,22 +40,22 @@ void SetEncryptionStatus(MCONTACT hContact, TrustLevel level) switch (level) { case TRUST_FINISHED: sid.flags = 0; - button.ptszTooltip = TranslateT(LANG_STATUS_FINISHED); + button.ptszTooltip = TranslateW(LANG_STATUS_FINISHED); button.hIcon = IcoLib_GetIconHandle(ICON_FINISHED); break; case TRUST_UNVERIFIED: sid2.flags = MBF_DISABLED; - button.ptszTooltip = TranslateT(LANG_STATUS_UNVERIFIED); + button.ptszTooltip = TranslateW(LANG_STATUS_UNVERIFIED); button.hIcon = IcoLib_GetIconHandle(ICON_UNVERIFIED); break; case TRUST_PRIVATE: sid2.flags = 0; - button.ptszTooltip = TranslateT(LANG_STATUS_PRIVATE); + button.ptszTooltip = TranslateW(LANG_STATUS_PRIVATE); button.hIcon = IcoLib_GetIconHandle(ICON_PRIVATE); break; default: sid.flags = MBF_DISABLED; - button.ptszTooltip = TranslateT(LANG_STATUS_DISABLED); + button.ptszTooltip = TranslateW(LANG_STATUS_DISABLED); button.hIcon = IcoLib_GetIconHandle(ICON_NOT_PRIVATE); break; } diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp index 0fc9e6a450..f7471b9c98 100644 --- a/plugins/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/src/utils.cpp @@ -66,22 +66,22 @@ void VerifyFingerprint(ConnContext *context, bool verify) { void VerifyFingerprintMessage(ConnContext *context, bool verify) { MCONTACT hContact = (UINT_PTR)context->app_data; - TCHAR msg[1024]; - mir_sntprintf(msg, (verify)?TranslateT(LANG_FINGERPRINT_VERIFIED):TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact)); + wchar_t msg[1024]; + mir_snwprintf(msg, (verify) ? TranslateW(LANG_FINGERPRINT_VERIFIED) : TranslateW(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact)); ShowMessage(hContact, msg); SetEncryptionStatus(hContact, otr_context_get_trust(context)); } /* Convert a 20-byte hash value to a 45-byte human-readable value */ -void otrl_privkey_hash_to_humanT(TCHAR human[45], const unsigned char hash[20]) +void otrl_privkey_hash_to_humanT(wchar_t human[45], const unsigned char hash[20]) { int word, byte; - TCHAR *p = human; + wchar_t *p = human; for(word=0; word<5; ++word) { for(byte=0; byte<4; ++byte) { - _stprintf(p, L"%02X", hash[word*4+byte]); //!!!!!!!!!!!!!! + swprintf(p, L"%02X", hash[word*4+byte]); //!!!!!!!!!!!!!! p += 2; } *(p++) = ' '; @@ -100,26 +100,26 @@ char* contact_get_id(MCONTACT hContact, bool bNameOnError) return mir_t2a(pszUniqueID); } -__inline const TCHAR* contact_get_nameT(MCONTACT hContact) { +__inline const wchar_t* contact_get_nameT(MCONTACT hContact) { return pcli->pfnGetContactDisplayName(hContact, 0); } -TCHAR* ProtoGetNickname(const char* proto) +wchar_t* ProtoGetNickname(const char* proto) { - TCHAR *p = Contact_GetInfo(CNF_NICK, NULL, proto); + wchar_t *p = Contact_GetInfo(CNF_NICK, NULL, proto); return (p != NULL) ? p : mir_tstrdup(L""); } -void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const MCONTACT hContact) { +void ShowPopup(const wchar_t* line1, const wchar_t* line2, int timeout, const MCONTACT hContact) { if(CallService(MS_SYSTEM_TERMINATED, 0, 0)) return; if ( !options.bHavePopups) { - TCHAR title[256]; + wchar_t title[256]; mir_sntprintf(title, L"%s Message", _T(MODULENAME)); if(line1 && line2) { int size = int(mir_tstrlen(line1) + mir_tstrlen(line2) + 3); - TCHAR *message = new TCHAR[size]; // newline and null terminator + wchar_t *message = new wchar_t[size]; // newline and null terminator mir_sntprintf(message, size, L"%s\r\n%s", line1, line2); MessageBox( NULL, message, title, MB_OK | MB_ICONINFORMATION ); delete[] message; @@ -138,12 +138,12 @@ void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const MCONTA ppd.lchIcon = NULL; if(line1 && line2) { - _tcsncpy( ppd.lptzContactName, line1, MAX_CONTACTNAME-1 ); - _tcsncpy( ppd.lptzText, line2, MAX_SECONDLINE-1 ); + wcsncpy( ppd.lptzContactName, line1, MAX_CONTACTNAME-1 ); + wcsncpy( ppd.lptzText, line2, MAX_SECONDLINE-1 ); } else if(line1) - _tcsncpy( ppd.lptzText, line1, MAX_SECONDLINE-1 ); + wcsncpy( ppd.lptzText, line1, MAX_SECONDLINE-1 ); else if(line2) - _tcsncpy( ppd.lptzText, line2, MAX_SECONDLINE-1 ); + wcsncpy( ppd.lptzText, line2, MAX_SECONDLINE-1 ); ppd.iSeconds = timeout; @@ -154,8 +154,8 @@ void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const MCONTA } -void ShowWarning(TCHAR *msg) { - TCHAR buffer[512]; +void ShowWarning(wchar_t *msg) { + wchar_t buffer[512]; ErrorDisplay disp = options.err_method; // funny logic :) ... try to avoid message boxes // if want baloons but no balloons, try popups @@ -172,7 +172,7 @@ void ShowWarning(TCHAR *msg) { case ED_POP: { int size = int(mir_tstrlen(msg) + 515); - TCHAR *message = new TCHAR[size]; // newline and null terminator + wchar_t *message = new wchar_t[size]; // newline and null terminator mir_sntprintf(message, size, L"%s\r\n%s", buffer, msg); PUShowMessageT(message, SM_WARNING); delete[] message; @@ -200,8 +200,8 @@ void ShowWarning(TCHAR *msg) { } } -void ShowError(TCHAR *msg) { - TCHAR buffer[512]; +void ShowError(wchar_t *msg) { + wchar_t buffer[512]; ErrorDisplay disp = options.err_method; // funny logic :) ... try to avoid message boxes // if want baloons but no balloons, try popups @@ -214,12 +214,12 @@ void ShowError(TCHAR *msg) { mir_sntprintf(buffer, L"%s Error", _T(MODULENAME)); - TCHAR *message; + wchar_t *message; switch(disp) { case ED_POP: { int size = int(mir_tstrlen(msg) + 515); - message = new TCHAR[size]; // newline and null terminator + message = new wchar_t[size]; // newline and null terminator mir_sntprintf(message, size, L"%s\r\n%s", buffer, msg); PUShowMessageT(message, SM_WARNING); delete[] message; @@ -249,26 +249,26 @@ void ShowError(TCHAR *msg) { void ShowPopupUtf(const char* line1, const char* line2, int timeout, const MCONTACT hContact) { - TCHAR* l1 = (line1) ? mir_utf8decodeT(line1) : NULL; - TCHAR* l2 = (line2) ? mir_utf8decodeT(line2) : NULL; + wchar_t* l1 = (line1) ? mir_utf8decodeT(line1) : NULL; + wchar_t* l2 = (line2) ? mir_utf8decodeT(line2) : NULL; ShowPopup(l1, l2, timeout, hContact); if (l1) mir_free(l1); if (l2) mir_free(l2); } void ShowWarningUtf(char* msg) { - TCHAR* m = (msg) ? mir_utf8decodeT(msg) : NULL; + wchar_t* m = (msg) ? mir_utf8decodeT(msg) : NULL; ShowWarning(m); if (m) mir_free(m); } void ShowErrorUtf(char* msg) { - TCHAR* m = (msg) ? mir_utf8decodeT(msg) : NULL; + wchar_t* m = (msg) ? mir_utf8decodeT(msg) : NULL; ShowError(m); if (m) mir_free(m); } -void ShowMessageInline(const MCONTACT hContact, const TCHAR *msg) { - TCHAR buff[1024]; +void ShowMessageInline(const MCONTACT hContact, const wchar_t *msg) { + wchar_t buff[1024]; mir_sntprintf(buff, L"%s%s", _T(LANG_INLINE_PREFIX), msg); T2Utf utf(buff); @@ -297,37 +297,37 @@ void ShowMessageUtf(const MCONTACT hContact, const char *msg) { ShowPopupUtf(Translate(LANG_OTR_INFO), msg, 0, hContact); } -void ShowMessage(const MCONTACT hContact, const TCHAR *msg) { +void ShowMessage(const MCONTACT hContact, const wchar_t *msg) { if(options.msg_inline) ShowMessageInline(hContact, msg); if(options.msg_popup) ShowPopup(TranslateT(LANG_OTR_INFO), msg, 0, hContact); } -const TCHAR *policy_to_string(OtrlPolicy policy) { +const wchar_t *policy_to_string(OtrlPolicy policy) { switch (policy) { case OTRL_POLICY_NEVER: - return TranslateT(LANG_POLICY_NEVER); + return TranslateW(LANG_POLICY_NEVER); case OTRL_POLICY_OPPORTUNISTIC: - return TranslateT(LANG_POLICY_OPP); + return TranslateW(LANG_POLICY_OPP); case OTRL_POLICY_MANUAL: case OTRL_POLICY_MANUAL_MOD: - return TranslateT(LANG_POLICY_MANUAL); + return TranslateW(LANG_POLICY_MANUAL); case OTRL_POLICY_ALWAYS: - return TranslateT(LANG_POLICY_ALWAYS); + return TranslateW(LANG_POLICY_ALWAYS); default: - return TranslateT(LANG_POLICY_DEFAULT); + return TranslateW(LANG_POLICY_DEFAULT); } } -OtrlPolicy policy_from_string(const TCHAR *polstring) { - if (mir_tstrcmp(polstring, TranslateT(LANG_POLICY_NEVER)) == 0) +OtrlPolicy policy_from_string(const wchar_t *polstring) { + if (mir_tstrcmp(polstring, TranslateW(LANG_POLICY_NEVER)) == 0) return OTRL_POLICY_NEVER; - else if (mir_tstrcmp(polstring, TranslateT(LANG_POLICY_OPP)) == 0) + else if (mir_tstrcmp(polstring, TranslateW(LANG_POLICY_OPP)) == 0) return OTRL_POLICY_OPPORTUNISTIC; - else if (mir_tstrcmp(polstring, TranslateT(LANG_POLICY_MANUAL)) == 0) + else if (mir_tstrcmp(polstring, TranslateW(LANG_POLICY_MANUAL)) == 0) return OTRL_POLICY_MANUAL_MOD; - else if (mir_tstrcmp(polstring, TranslateT(LANG_POLICY_ALWAYS)) == 0) + else if (mir_tstrcmp(polstring, TranslateW(LANG_POLICY_ALWAYS)) == 0) return OTRL_POLICY_ALWAYS; else return CONTACT_DEFAULT_POLICY; diff --git a/plugins/MirOTR/src/utils.h b/plugins/MirOTR/src/utils.h index 633b5a0647..aec0e4a01a 100644 --- a/plugins/MirOTR/src/utils.h +++ b/plugins/MirOTR/src/utils.h @@ -19,28 +19,28 @@ TrustLevel otr_context_get_trust(ConnContext *context); void VerifyFingerprint(ConnContext *context, bool verify); void VerifyFingerprintMessage(ConnContext *context, bool verify); -void otrl_privkey_hash_to_humanT(TCHAR human[45], const unsigned char hash[20]); +void otrl_privkey_hash_to_humanT(wchar_t human[45], const unsigned char hash[20]); char* contact_get_id(MCONTACT hContact, bool bNameOnError=true); __inline const char* contact_get_account(MCONTACT hContact); -extern __inline const TCHAR* contact_get_nameT(MCONTACT hContact); +extern __inline const wchar_t* contact_get_nameT(MCONTACT hContact); -TCHAR* ProtoGetNickname(const char* proto); +wchar_t* ProtoGetNickname(const char* proto); -void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const MCONTACT hContact = NULL); -void ShowWarning(TCHAR* msg); -void ShowError(TCHAR* msg); +void ShowPopup(const wchar_t* line1, const wchar_t* line2, int timeout, const MCONTACT hContact = NULL); +void ShowWarning(wchar_t* msg); +void ShowError(wchar_t* msg); void ShowPopupUtf(const char* line1, const char* line2, int timeout, const MCONTACT hContact = NULL); void ShowWarningUtf(char* msg); void ShowErrorUtf(char* msg); -void ShowMessageInline(const MCONTACT hContact, const TCHAR *msg); +void ShowMessageInline(const MCONTACT hContact, const wchar_t *msg); void ShowMessageInlineUtf(const MCONTACT hContact, const char *msg); -void ShowMessage(const MCONTACT hContact, const TCHAR *msg); +void ShowMessage(const MCONTACT hContact, const wchar_t *msg); void ShowMessageUtf(const MCONTACT hContact, const char *msg); -const TCHAR *policy_to_string(OtrlPolicy policy); -OtrlPolicy policy_from_string(const TCHAR *polstring); +const wchar_t *policy_to_string(OtrlPolicy policy); +OtrlPolicy policy_from_string(const wchar_t *polstring); #endif diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index b1be837708..ddaaeef100 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -199,10 +199,10 @@ bool CAppletManager::Shutdown() //************************************************************************ // Translates the specified string, and inserts the parameters //************************************************************************ -tstring CAppletManager::TranslateString(TCHAR *szString, ...) +tstring CAppletManager::TranslateString(wchar_t *szString, ...) { - TCHAR out[1024]; - TCHAR *szTranslatedString = TranslateTS(szString); + wchar_t out[1024]; + wchar_t *szTranslatedString = TranslateTS(szString); va_list body; va_start(body, szString); @@ -532,19 +532,19 @@ tstring CAppletManager::GetFormattedTimestamp(tm *tm_time) time(&now); localtime_s(&tm_now, &now); - TCHAR buffer[128]; + wchar_t buffer[128]; if (tm_time->tm_mday != tm_now.tm_mday || tm_time->tm_mon != tm_now.tm_mon) { if (CConfig::GetBoolSetting(TIMESTAMP_SECONDS)) - _tcsftime(buffer, 128, L"[%x %H:%M:%S]", tm_time); + wcsftime(buffer, 128, L"[%x %H:%M:%S]", tm_time); else - _tcsftime(buffer, 128, L"[%x %H:%M]", tm_time); + wcsftime(buffer, 128, L"[%x %H:%M]", tm_time); } else { if (CConfig::GetBoolSetting(TIMESTAMP_SECONDS)) - _tcsftime(buffer, 128, L"[%H:%M:%S]", tm_time); + wcsftime(buffer, 128, L"[%H:%M:%S]", tm_time); else - _tcsftime(buffer, 128, L"[%H:%M]", tm_time); + wcsftime(buffer, 128, L"[%H:%M]", tm_time); } return toTstring(buffer); @@ -875,7 +875,7 @@ bool CAppletManager::TranslateDBEvent(CEvent *pEvent, WPARAM hContact, LPARAM hd pEvent->strValue = Utf8_Decode((char*)dbevent.pBlob); } else if ((int)dbevent.cbBlob == msglen * 3) { - pEvent->strValue = (TCHAR *)& dbevent.pBlob[msglen]; + pEvent->strValue = (wchar_t *)& dbevent.pBlob[msglen]; } else { pEvent->strValue = toTstring((char*)dbevent.pBlob); diff --git a/plugins/MirandaG15/src/CAppletManager.h b/plugins/MirandaG15/src/CAppletManager.h index a01b3268a1..f80b612c83 100644 --- a/plugins/MirandaG15/src/CAppletManager.h +++ b/plugins/MirandaG15/src/CAppletManager.h @@ -108,7 +108,7 @@ public: // checks if the patched IRC protocol is in place
bool IsIRCHookEnabled();
- static tstring TranslateString(TCHAR *szString,...);
+ static tstring TranslateString(wchar_t *szString,...);
private:
list<CIRCHistory*> m_LIRCHistorys;
diff --git a/plugins/MirandaG15/src/CChatScreen.cpp b/plugins/MirandaG15/src/CChatScreen.cpp index 34c228c697..12020a9630 100644 --- a/plugins/MirandaG15/src/CChatScreen.cpp +++ b/plugins/MirandaG15/src/CChatScreen.cpp @@ -178,7 +178,7 @@ void CChatScreen::UpdateLabels() m_iStatus = db_get_w(m_hContact,szProto,"Status",ID_STATUS_OFFLINE);
}
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(m_iStatus, 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(m_iStatus, 0);
if(szStatus != NULL)
strStatus = toTstring(szStatus);
diff --git a/plugins/MirandaG15/src/CContactList.cpp b/plugins/MirandaG15/src/CContactList.cpp index 6e6f42593b..69a7e1e972 100644 --- a/plugins/MirandaG15/src/CContactList.cpp +++ b/plugins/MirandaG15/src/CContactList.cpp @@ -109,7 +109,7 @@ void CContactList::AddContact(MCONTACT hContact) return;
int iStatus = db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE);
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(iStatus, 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(iStatus, 0);
CContactListEntry *psContact = new CContactListEntry();
@@ -721,7 +721,7 @@ void CContactList::OnStatusChange(MCONTACT hContact,int iStatus) int iOldStatus = pItemData->iStatus;
// Update the list entry
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(iStatus, 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(iStatus, 0);
if(szStatus != NULL)
pItemData->strStatus =toTstring(szStatus);
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp index 1ca9bd4378..2a121c22c1 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp @@ -101,7 +101,7 @@ bool CLCDInput::Draw(CLCDGfx *pGfx) int iLine = m_iLinePosition;
int iEndLine = m_iLinePosition + m_iLineCount;
int iLen = 0;
- TCHAR *pcOffset = NULL;
+ wchar_t *pcOffset = NULL;
while(iLine < iEndLine && iLine < m_vLineOffsets.size())
{
// Calculate the text length
@@ -115,7 +115,7 @@ bool CLCDInput::Draw(CLCDGfx *pGfx) else iLen = (int)m_strText.length() - m_vLineOffsets[iLine].iOffset;
// Draw the text
- pcOffset = (TCHAR*)m_strText.c_str() + m_vLineOffsets[iLine].iOffset;
+ pcOffset = (wchar_t*)m_strText.c_str() + m_vLineOffsets[iLine].iOffset;
DrawTextEx(pGfx->GetHDC(),
(LPTSTR)pcOffset,
iLen,
@@ -380,7 +380,7 @@ LRESULT CLCDInput::ProcessKeyEvent(int Code, WPARAM wParam, LPARAM lParam) {
#ifdef _UNICODE
- TCHAR output[4];
+ wchar_t output[4];
#else
unsigned char output[2];
#endif
@@ -419,9 +419,9 @@ LRESULT CLCDInput::ProcessKeyEvent(int Code, WPARAM wParam, LPARAM lParam) return 1;
if(m_bInsert || m_strText[m_Marker[0].iPosition] == '\r')
- m_strText.insert(m_Marker[0].iPosition,(TCHAR*)output,res);
+ m_strText.insert(m_Marker[0].iPosition,(wchar_t*)output,res);
else
- m_strText.replace(m_Marker[0].iPosition,res,(TCHAR*)output);
+ m_strText.replace(m_Marker[0].iPosition,res,(wchar_t*)output);
scroll = 1;
size = res;
@@ -601,7 +601,7 @@ void CLCDInput::UpdateOffsets(int iModified) // Initialize variables
int iLen = (int)m_strText.length();
int *piWidths = new int[iLen];
- TCHAR *pszText = (TCHAR*)m_strText.c_str();
+ wchar_t *pszText = (wchar_t*)m_strText.c_str();
tstring::size_type pos = 0;
int iMaxChars = 0;
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp index 2c0a0bd866..e416be2810 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp @@ -150,7 +150,7 @@ void CLCDLabel::UpdateCutOffIndex() if(m_bWordWrap && GetWidth() > 0)
{
int *piExtents = new int[m_strText.length()];
- TCHAR *szString = (TCHAR*)m_strText.c_str();
+ wchar_t *szString = (wchar_t*)m_strText.c_str();
int iMaxChars = 0;
tstring::size_type pos = 0;
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp index f0c30b78cf..bbb9b689df 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp @@ -304,7 +304,7 @@ void CLCDTextLog::WrapMessage(CLogEntry *pEntry) SIZE sizeLine = {0, 0};
int *piExtents = new int[strString.length()];
- TCHAR *szString = (TCHAR*)strString.c_str();
+ wchar_t *szString = (wchar_t*)strString.c_str();
int iMaxChars = 0;
tstring::size_type pos = 0;
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp index 56c2d9f68c..236cefc71b 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp @@ -108,7 +108,7 @@ void CLCDTextObject::SetFontFaceName(tstring strFontName) memset(&lf, 0, sizeof(lf));
GetObject(m_hFont, sizeof(LOGFONT), &lf);
- _tcsncpy(lf.lfFaceName, strFontName.c_str(), LF_FACESIZE);
+ wcsncpy(lf.lfFaceName, strFontName.c_str(), LF_FACESIZE);
SetFont(lf);
}
diff --git a/plugins/MirandaG15/src/LCDFramework/debug.cpp b/plugins/MirandaG15/src/LCDFramework/debug.cpp index abca919bfe..1eb18013c7 100644 --- a/plugins/MirandaG15/src/LCDFramework/debug.cpp +++ b/plugins/MirandaG15/src/LCDFramework/debug.cpp @@ -25,9 +25,9 @@ }
#endif
-void _trace(TCHAR *fmt, ...)
+void _trace(wchar_t *fmt, ...)
{
- TCHAR out[1024];
+ wchar_t out[1024];
va_list body;
va_start(body, fmt);
#ifdef _UNICODE
diff --git a/plugins/MirandaG15/src/LCDFramework/debug.h b/plugins/MirandaG15/src/LCDFramework/debug.h index 55bb8719e5..b9d49bf17f 100644 --- a/plugins/MirandaG15/src/LCDFramework/debug.h +++ b/plugins/MirandaG15/src/LCDFramework/debug.h @@ -12,7 +12,7 @@ extern void UnInitDebug(); #include "ConStream.h"
#endif
#define TRACE _trace
-extern void _trace(TCHAR *fmt, ...);
+extern void _trace(wchar_t *fmt, ...);
#else
inline void _trace(LPCTSTR, ...) { }
#define TRACE 1 ? (void)0 : _trace
diff --git a/plugins/MirandaG15/src/LCDFramework/misc.cpp b/plugins/MirandaG15/src/LCDFramework/misc.cpp index 968bb5ce6c..339b88e393 100644 --- a/plugins/MirandaG15/src/LCDFramework/misc.cpp +++ b/plugins/MirandaG15/src/LCDFramework/misc.cpp @@ -7,7 +7,7 @@ tstring tstringprintf(tstring strFormat,...) { va_start(vlist, strFormat);
int mlen = (int)strFormat.length()+128;
- TCHAR *text = (TCHAR*)malloc(mlen*sizeof(TCHAR));
+ wchar_t *text = (wchar_t*)malloc(mlen*sizeof(wchar_t));
_vsntprintf(text,mlen,strFormat.c_str(),vlist);
va_end(vlist);
@@ -122,7 +122,7 @@ tstring Utf8_Decode(const char *str) size_t len = mir_strlen(str);
- if ((wszTemp = (WCHAR *) malloc(sizeof(TCHAR) * (len + 2))) == NULL)
+ if ((wszTemp = (WCHAR *) malloc(sizeof(wchar_t) * (len + 2))) == NULL)
return strRes;
p = (char *) str;
@@ -140,7 +140,7 @@ tstring Utf8_Decode(const char *str) wszTemp[i++] |= (*(p++) & 0x3f);
}
}
- wszTemp[i] = (TCHAR)'\0';
+ wszTemp[i] = (wchar_t)'\0';
strRes = wszTemp;
free(wszTemp);
diff --git a/plugins/MirandaG15/src/LCDFramework/misc.h b/plugins/MirandaG15/src/LCDFramework/misc.h index 0dd4494f0c..c5f2bb4f06 100644 --- a/plugins/MirandaG15/src/LCDFramework/misc.h +++ b/plugins/MirandaG15/src/LCDFramework/misc.h @@ -30,11 +30,11 @@ inline std::string toNarrowString( const std::string& str ) #ifdef _UNICODE
#define tstring wstring
- inline TCHAR toTchar( char ch )
+ inline wchar_t toTchar( char ch )
{
return (wchar_t)ch ;
}
- inline TCHAR toTchar( wchar_t ch )
+ inline wchar_t toTchar( wchar_t ch )
{
return ch ;
}
@@ -61,11 +61,11 @@ inline std::string toNarrowString( const std::string& str ) extern string Utf8_Encode(const WCHAR *str);
#else
#define tstring string
- inline TCHAR toTchar( char ch )
+ inline wchar_t toTchar( char ch )
{
return ch ;
}
- inline TCHAR toTchar( wchar_t ch )
+ inline wchar_t toTchar( wchar_t ch )
{
return (ch >= 0 && ch <= 0xFF) ? (char)ch : '?' ;
}
diff --git a/plugins/MirandaG15/src/LCDFramework/stdafx.h b/plugins/MirandaG15/src/LCDFramework/stdafx.h index 2195cdf02e..2ae74c24b1 100644 --- a/plugins/MirandaG15/src/LCDFramework/stdafx.h +++ b/plugins/MirandaG15/src/LCDFramework/stdafx.h @@ -6,7 +6,6 @@ #define ASSERT assert
#include <Windows.h>
-#include <tchar.h>
#include <string>
#include <vector>
#include <queue>
diff --git a/plugins/MirandaG15/src/StdAfx.h b/plugins/MirandaG15/src/StdAfx.h index 176f52cdb6..64723b62b2 100644 --- a/plugins/MirandaG15/src/StdAfx.h +++ b/plugins/MirandaG15/src/StdAfx.h @@ -8,7 +8,6 @@ #include <Windows.h>
#include <CommCtrl.h>
-#include <tchar.h>
#include <time.h>
#include <string>
#include <vector>
diff --git a/plugins/MobileState/src/clients.h b/plugins/MobileState/src/clients.h index b9c87ae6e5..a7f6041ff2 100644 --- a/plugins/MobileState/src/clients.h +++ b/plugins/MobileState/src/clients.h @@ -19,7 +19,7 @@ #pragma once
-static const TCHAR *clients[] = {
+static const wchar_t *clients[] = {
L"android",
L"mobile",
L"pda",
diff --git a/plugins/MobileState/src/main.cpp b/plugins/MobileState/src/main.cpp index 7b1b1ebceb..b18452a7d8 100644 --- a/plugins/MobileState/src/main.cpp +++ b/plugins/MobileState/src/main.cpp @@ -57,11 +57,11 @@ bool hasMobileClient(MCONTACT hContact, LPARAM) ptrT client(db_get_tsa(hContact, proto, "MirVer"));
if (client) {
// Make client lower-case
- _tcslwr(client);
+ wcslwr(client);
// Find whether this client contain something from clients list
for (size_t i = 0; i < _countof(clients); i++)
- if (_tcsstr(client, clients[i]))
+ if (wcsstr(client, clients[i]))
return true;
}
diff --git a/plugins/ModernOpt/src/modernopt.cpp b/plugins/ModernOpt/src/modernopt.cpp index 8eb3a1b369..8ef64ff744 100644 --- a/plugins/ModernOpt/src/modernopt.cpp +++ b/plugins/ModernOpt/src/modernopt.cpp @@ -69,15 +69,15 @@ static void ModernOptUI_SelectSection(HWND hwndDlg, struct ModernOptionsData *da // Main option pages
struct ModernOptMainPageInfo g_ModernOptPages[MODERNOPT_PAGE_COUNT] =
{
- {0, FALSE, IDI_MIRANDA, LPGENT("Home"), LPGENT("Miranda NG configuration center")},
- {IDC_BTN_ACCOUNTS, TRUE, IDI_BIG_NETWORK, LPGENT("Accounts"), LPGENT("Setup your account information to start messaging.")},
- {IDC_BTN_SKINS, TRUE, IDI_BIG_SKINS, LPGENT("Style"), LPGENT("Change the look of Miranda NG according to your taste.")},
- {IDC_BTN_CLIST, TRUE, IDI_BIG_BUDDYLIST, LPGENT("Contacts"), LPGENT("Configure behavior of your contact list.")},
- {IDC_BTN_MESSAGING, TRUE, IDI_BIG_MESSAGE, LPGENT("Chats"), LPGENT("Customize look&&feel of your chat windows here.")},
- {IDC_BTN_IGNORE, TRUE, IDI_BIG_IGNORE, LPGENT("Ignore"), LPGENT("Ban those users and events, you are annoyed with.")},
- {IDC_BTN_STATUS, TRUE, IDI_BIG_STATUS, LPGENT("Status"), LPGENT("Set your status messages and idle reporting.")},
- {IDC_BTN_ADVANCED, TRUE, IDI_BIG_ADVANCED, LPGENT("Advanced"), LPGENT("")},
- {IDC_BTN_PLUGINS, TRUE, IDI_BIG_MODULES, LPGENT("Plugins"), LPGENT("Miranda NG is all about plugins. Manage all the plugins you have here.")},
+ {0, FALSE, IDI_MIRANDA, LPGENW("Home"), LPGENW("Miranda NG configuration center")},
+ {IDC_BTN_ACCOUNTS, TRUE, IDI_BIG_NETWORK, LPGENW("Accounts"), LPGENW("Setup your account information to start messaging.")},
+ {IDC_BTN_SKINS, TRUE, IDI_BIG_SKINS, LPGENW("Style"), LPGENW("Change the look of Miranda NG according to your taste.")},
+ {IDC_BTN_CLIST, TRUE, IDI_BIG_BUDDYLIST, LPGENW("Contacts"), LPGENW("Configure behavior of your contact list.")},
+ {IDC_BTN_MESSAGING, TRUE, IDI_BIG_MESSAGE, LPGENW("Chats"), LPGENW("Customize look&&feel of your chat windows here.")},
+ {IDC_BTN_IGNORE, TRUE, IDI_BIG_IGNORE, LPGENW("Ignore"), LPGENW("Ban those users and events, you are annoyed with.")},
+ {IDC_BTN_STATUS, TRUE, IDI_BIG_STATUS, LPGENW("Status"), LPGENW("Set your status messages and idle reporting.")},
+ {IDC_BTN_ADVANCED, TRUE, IDI_BIG_ADVANCED, LPGENW("Advanced"), LPGENW("")},
+ {IDC_BTN_PLUGINS, TRUE, IDI_BIG_MODULES, LPGENW("Plugins"), LPGENW("Miranda NG is all about plugins. Manage all the plugins you have here.")},
};
////////////////////////////////////////////////////////////////////////////////
@@ -371,7 +371,7 @@ static HWND ModernOptUI_ShowPage_Impl(HWND hwndDlg, struct ModernOptionsData *da return obj->hwnd;
}
-static int lstrcmp_null(TCHAR *p1, TCHAR *p2)
+static int lstrcmp_null(wchar_t *p1, wchar_t *p2)
{
if (!p1 && !p2) return 0;
if (!p1) return -1;
diff --git a/plugins/ModernOpt/src/modernopt.h b/plugins/ModernOpt/src/modernopt.h index 0fe6bce59f..12dc27c5c3 100644 --- a/plugins/ModernOpt/src/modernopt.h +++ b/plugins/ModernOpt/src/modernopt.h @@ -32,8 +32,8 @@ struct ModernOptMainPageInfo int idcButton;
BOOL bShowTab;
int iIcon;
- TCHAR *lpzTitle;
- TCHAR *lpzDescription;
+ wchar_t *lpzTitle;
+ wchar_t *lpzDescription;
int iPageType;
BOOL bShow;
};
diff --git a/plugins/ModernOpt/src/mopt_selector.cpp b/plugins/ModernOpt/src/mopt_selector.cpp index 7c669dd656..5e97984584 100644 --- a/plugins/ModernOpt/src/mopt_selector.cpp +++ b/plugins/ModernOpt/src/mopt_selector.cpp @@ -26,18 +26,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-static void sttApplySkin(MODERNOPTOBJECT *obj, TCHAR *fn)
+static void sttApplySkin(MODERNOPTOBJECT *obj, wchar_t *fn)
{
CallProtoService(obj->lpzThemeModuleName, TS_SKIN_APPLY, NULL, (LPARAM)fn);
}
-static TCHAR *sttGetActiveSkin(MODERNOPTOBJECT *obj)
+static wchar_t *sttGetActiveSkin(MODERNOPTOBJECT *obj)
{
return ProtoServiceExists(obj->lpzThemeModuleName, TS_SKIN_ACTIVE) ?
- (TCHAR*)CallProtoService(obj->lpzThemeModuleName, TS_SKIN_ACTIVE, 0, 0) : 0;
+ (wchar_t*)CallProtoService(obj->lpzThemeModuleName, TS_SKIN_ACTIVE, 0, 0) : 0;
}
-static void sttPreviewSkin(MODERNOPTOBJECT *obj, TCHAR *fn, LPDRAWITEMSTRUCT lps)
+static void sttPreviewSkin(MODERNOPTOBJECT *obj, wchar_t *fn, LPDRAWITEMSTRUCT lps)
{
if (!fn) return;
@@ -75,24 +75,24 @@ static void sttPreviewSkin(MODERNOPTOBJECT *obj, TCHAR *fn, LPDRAWITEMSTRUCT lps struct TSkinListItem
{
- TCHAR *path;
- TCHAR *title;
- TCHAR *filename;
+ wchar_t *path;
+ wchar_t *title;
+ wchar_t *filename;
- TSkinListItem(TCHAR *fn)
+ TSkinListItem(wchar_t *fn)
{
title = mir_tstrdup(fn);
- if (TCHAR *p = _tcsrchr(title, _T('.')))
+ if (wchar_t *p = wcsrchr(title, '.'))
*p = 0;
- TCHAR curPath[MAX_PATH];
+ wchar_t curPath[MAX_PATH];
GetCurrentDirectory(_countof(curPath), curPath);
- path = (TCHAR *)mir_alloc(MAX_PATH * sizeof(TCHAR));
+ path = (wchar_t *)mir_alloc(MAX_PATH * sizeof(wchar_t));
PathToRelativeT(curPath, path);
size_t length = mir_tstrlen(curPath) + mir_tstrlen(fn) + 2;
- filename = (TCHAR *)mir_alloc(length * sizeof(TCHAR));
+ filename = (wchar_t *)mir_alloc(length * sizeof(wchar_t));
mir_sntprintf(filename, length, L"%s\\%s", curPath, fn);
}
@@ -107,7 +107,7 @@ struct TSkinListItem struct TSelectorData
{
MODERNOPTOBJECT *obj;
- TCHAR *active;
+ wchar_t *active;
HBITMAP hbmpPreview;
TSelectorData()
@@ -121,18 +121,18 @@ struct TSelectorData }
};
-static bool CheckExt(TCHAR *fn, TCHAR *ext, int n)
+static bool CheckExt(wchar_t *fn, wchar_t *ext, int n)
{
size_t l = mir_tstrlen(fn);
return (l > n) && !mir_tstrcmp(fn + l - n, ext);
}
-static void BuildSkinList(HWND hwndList, TCHAR *szExt, int nExtLength = -1, bool start = true)
+static void BuildSkinList(HWND hwndList, wchar_t *szExt, int nExtLength = -1, bool start = true)
{
if (start) {
- static TCHAR mirPath[MAX_PATH];
+ static wchar_t mirPath[MAX_PATH];
GetModuleFileName(NULL, mirPath, _countof(mirPath));
- if (TCHAR *p = _tcsrchr(mirPath, _T('\\'))) *p = 0;
+ if (wchar_t *p = wcsrchr(mirPath, '\\')) *p = 0;
SetCurrentDirectory(mirPath);
SendMessage(hwndList, LB_RESETCONTENT, 0, 0);
nExtLength = (int)mir_tstrlen(szExt);
@@ -168,7 +168,7 @@ static void BuildSkinList(HWND hwndList, TCHAR *szExt, int nExtLength = -1, bool }
}
-static void CreatePreview(TSelectorData *sd, TCHAR *fn, LPDRAWITEMSTRUCT lps)
+static void CreatePreview(TSelectorData *sd, wchar_t *fn, LPDRAWITEMSTRUCT lps)
{
HDC hdc = CreateCompatibleDC(lps->hDC);
sd->hbmpPreview = CreateCompatibleBitmap(lps->hDC, lps->rcItem.right - lps->rcItem.left, lps->rcItem.bottom - lps->rcItem.top);
diff --git a/plugins/MsgPopup/src/main.cpp b/plugins/MsgPopup/src/main.cpp index ee5b3e254a..56f1d5b2cc 100644 --- a/plugins/MsgPopup/src/main.cpp +++ b/plugins/MsgPopup/src/main.cpp @@ -132,7 +132,7 @@ void HookOnImport(HMODULE hModule, char *lpszImpModName, PVOID lpOrigFunc, PVOID if (!VirtualProtect((LPVOID)ppfn, sizeof(void*), PAGE_EXECUTE_READWRITE, &oldProtect)) {
if (!g_HookError) {
- TCHAR buf[200];
+ wchar_t buf[200];
g_HookError = TRUE;
mir_sntprintf(buf, TranslateT("VirtualProtect failed. Code %d\nTry to call the author"), GetLastError());
@@ -186,8 +186,8 @@ int HookedOptions(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.ptszTitle = LPGENT("MessagePopup");
- odp.ptszGroup = LPGENT("Popups");
+ odp.pwszTitle = LPGENW("MessagePopup");
+ odp.pwszGroup = LPGENW("Popups");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = OptionsDlgProc;
Options_AddPage(wParam, &odp);
diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp index 40ca0e112f..ecc4f8305c 100755 --- a/plugins/Msg_Export/src/FileViewer.cpp +++ b/plugins/Msg_Export/src/FileViewer.cpp @@ -108,7 +108,7 @@ public: HWND hFindDlg;
FINDREPLACE fr;
- TCHAR acFindStr[100];
+ wchar_t acFindStr[100];
bool bFirstLoad;
bool bUtf8File;
@@ -419,7 +419,7 @@ int CLStreamRTFInfo::nLoadFileStream(LPBYTE pbBuff, LONG cb) // Developer : KN
/////////////////////////////////////////////////////////////////////
-void UpdateFileViews(const TCHAR *pszFile)
+void UpdateFileViews(const wchar_t *pszFile)
{
mir_cslock lck(csHistoryList);
@@ -469,11 +469,11 @@ bool bOpenExternaly(MCONTACT hContact) STARTUPINFO sStartupInfo = { 0 };
GetStartupInfo(&sStartupInfo); // we parse oure owne info on
- sStartupInfo.lpTitle = (TCHAR*)sFileViewerPrg.c_str();
+ sStartupInfo.lpTitle = (wchar_t*)sFileViewerPrg.c_str();
PROCESS_INFORMATION stProcesses = { 0 };
if (!CreateProcess(NULL,
- (TCHAR*)sTmp.c_str(),
+ (wchar_t*)sTmp.c_str(),
NULL,
NULL,
FALSE,
@@ -483,7 +483,7 @@ bool bOpenExternaly(MCONTACT hContact) &sStartupInfo,
&stProcesses))
{
- DisplayLastError(LPGENT("Failed to execute external file view"));
+ DisplayLastError(LPGENW("Failed to execute external file view"));
}
return true;
}
@@ -528,7 +528,7 @@ bool bUseInternalViewer(bool bNew) hRichEditDll = LoadLibraryA("Msftedit.dll");
if (!hRichEditDll)
{
- DisplayLastError(LPGENT("Failed to load Rich Edit (Msftedit.dll)"));
+ DisplayLastError(LPGENW("Failed to load Rich Edit (Msftedit.dll)"));
return false;
}
}
@@ -618,7 +618,7 @@ bool bLoadFile(HWND hwndDlg, CLHistoryDlg * pclDlg) OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
int nDBCount = db_event_count(pclDlg->hContact);
- TCHAR szTmp[1500];
+ wchar_t szTmp[1500];
if (nDBCount == -1)
mir_sntprintf(szTmp, TranslateT("Failed to open file\r\n%s\r\n\r\nContact handle is invalid"), pclDlg->sPath.c_str());
@@ -669,7 +669,7 @@ bool bLoadFile(HWND hwndDlg, CLHistoryDlg * pclDlg) }
CloseHandle(hFile);
- TCHAR szTmp[100];
+ wchar_t szTmp[100];
mir_sntprintf(szTmp, L"File open time %d\n", GetTickCount() - dwStart);
OutputDebugString(szTmp);
@@ -710,15 +710,15 @@ bool bAdvancedCopy(HWND hwnd) if (OpenClipboard(NULL)) {
EmptyClipboard();
- TCHAR *pszSrcBuf = new TCHAR[nSelLenght];
+ wchar_t *pszSrcBuf = new wchar_t[nSelLenght];
pszSrcBuf[0] = 0;
SendMessage(hwnd, EM_GETSELTEXT, 0, (LPARAM)pszSrcBuf);
HANDLE hDecMem = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, nSelLenght);
- TCHAR *pszCurDec = (TCHAR*)GlobalLock(hDecMem);
+ wchar_t *pszCurDec = (wchar_t*)GlobalLock(hDecMem);
bool bInSpaces = false;
- for (TCHAR *pszCur = pszSrcBuf; pszCur[0]; pszCur++) {
+ for (wchar_t *pszCur = pszSrcBuf; pszCur[0]; pszCur++) {
if (bInSpaces) {
if (pszCur[0] == ' ')
continue;
@@ -953,19 +953,19 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, HMENU hSysMenu = GetSystemMenu(hwndDlg, FALSE);
InsertMenu(hSysMenu, 0, MF_SEPARATOR | MF_BYPOSITION, 0, 0);
- InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION, ID_FV_SAVE_AS_RTF, LPGENT("Save as RTF"));
+ InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION, ID_FV_SAVE_AS_RTF, LPGENW("Save as RTF"));
InsertMenu(hSysMenu, 0, MF_SEPARATOR | MF_BYPOSITION, 0, 0);
BYTE bUseCC = (BYTE)db_get_b(NULL, MODULE, szFileViewDB "UseCC", 0);
- InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION | (bUseCC ? MF_CHECKED : 0), ID_FV_COLOR, LPGENT("Color..."));
+ InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION | (bUseCC ? MF_CHECKED : 0), ID_FV_COLOR, LPGENW("Color..."));
if (bUseCC)
SendMessage(hRichEdit, EM_SETBKGNDCOLOR, 0, db_get_dw(NULL, MODULE, szFileViewDB "CustomC", RGB(255, 255, 255)));
- InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION, ID_FV_FONT, LPGENT("Font..."));
+ InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION, ID_FV_FONT, LPGENW("Font..."));
bool bUseSyntaxHL = db_get_b(NULL, MODULE, szFileViewDB "UseSyntaxHL", 1) != 0;
- InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION | (bUseSyntaxHL ? MF_CHECKED : 0), ID_FV_SYNTAX_HL, LPGENT("Syntax highlight"));
+ InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION | (bUseSyntaxHL ? MF_CHECKED : 0), ID_FV_SYNTAX_HL, LPGENW("Syntax highlight"));
SetRichEditFont(hRichEdit, bUseSyntaxHL);
@@ -979,10 +979,10 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, bLoadFile(hwndDlg, pclDlg);
- TCHAR szFormat[200];
- TCHAR szTitle[200];
+ wchar_t szFormat[200];
+ wchar_t szTitle[200];
if (GetWindowText(hwndDlg, szFormat, _countof(szFormat))) {
- const TCHAR *pszNick = pcli->pfnGetContactDisplayName(pclDlg->hContact, 0);
+ const wchar_t *pszNick = pcli->pfnGetContactDisplayName(pclDlg->hContact, 0);
tstring sPath = pclDlg->sPath;
string::size_type n = sPath.find_last_of('\\');
if (n != sPath.npos)
@@ -1107,7 +1107,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
- DisplayLastError(LPGENT("Failed to create file"));
+ DisplayLastError(LPGENW("Failed to create file"));
return TRUE;
}
@@ -1155,7 +1155,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, if (((NMHDR*)lParam)->code == EN_LINK) {
ENLINK* pstLink = (ENLINK*)lParam;
if (pstLink->msg == WM_LBUTTONUP) {
- TCHAR szUrl[500];
+ wchar_t szUrl[500];
if ((pstLink->chrg.cpMax - pstLink->chrg.cpMin) > (sizeof(szUrl) - 2))
return FALSE;
@@ -1209,7 +1209,7 @@ bool bShowFileViewer(MCONTACT hContact) ShowWindow(pcl->hWnd, SW_SHOWNORMAL);
return true;
}
- DisplayLastError(LPGENT("Failed to create history dialog"));
+ DisplayLastError(LPGENW("Failed to create history dialog"));
delete pcl;
return false;
}
diff --git a/plugins/Msg_Export/src/FileViewer.h b/plugins/Msg_Export/src/FileViewer.h index e074df6843..de58099d6d 100755 --- a/plugins/Msg_Export/src/FileViewer.h +++ b/plugins/Msg_Export/src/FileViewer.h @@ -19,7 +19,7 @@ #ifndef MSG_EXP_FILE_VIEWER
#define MSG_EXP_FILE_VIEWER
-void UpdateFileViews(const TCHAR *pszFile);
+void UpdateFileViews(const wchar_t *pszFile);
bool bOpenExternaly(MCONTACT hContact);
bool bShowFileViewer(MCONTACT hContact);
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 41251ca214..bbcd2d8513 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -271,7 +271,7 @@ void SetToDefault(HWND hParent) if (!hMapUser || nContacts <= 0)
return;
- TCHAR szTemp[500];
+ wchar_t szTemp[500];
if (!GetDlgItemText(hParent, IDC_DEFAULT_FILE, szTemp, _countof(szTemp)))
return;
@@ -291,7 +291,7 @@ void SetToDefault(HWND hParent) ReplaceTimeVariables(sFileName);
sItem.mask = LVIF_TEXT;
- sItem.pszText = (TCHAR*)sFileName.c_str();
+ sItem.pszText = (wchar_t*)sFileName.c_str();
ListView_SetItem(hMapUser, &sItem);
if (!bUnaplyedChanges) {
@@ -318,7 +318,7 @@ BOOL bApplyChanges(HWND hwndDlg) {
BOOL bTrans;
BOOL bRet = true;
- TCHAR szTemp[500];
+ wchar_t szTemp[500];
int nTmp = GetDlgItemInt(hwndDlg, IDC_MAX_CLOUMN_WIDTH, &bTrans, TRUE);
if (!bTrans || nTmp < 5) {
@@ -431,7 +431,7 @@ void ClearAllFileNames(HWND hwndDlg) void AutoFindeFileNames(HWND hwndDlg)
{
- TCHAR szDefaultFile[500];
+ wchar_t szDefaultFile[500];
GetDlgItemText(hwndDlg, IDC_DEFAULT_FILE, szDefaultFile, _countof(szDefaultFile));
LVITEM sItem = { 0 };
@@ -439,7 +439,7 @@ void AutoFindeFileNames(HWND hwndDlg) HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST);
int nCount = ListView_GetItemCount(hMapUser);
for (int nCur = 0; nCur < nCount; nCur++) {
- TCHAR szSearch[100];
+ wchar_t szSearch[100];
sItem.pszText = szSearch;
sItem.mask = LVIF_TEXT;
sItem.iItem = nCur;
@@ -454,7 +454,7 @@ void AutoFindeFileNames(HWND hwndDlg) for (int nSubCur = 0; nSubCur < nCount; nSubCur++) {
if (nSubCur == nCur)
continue;
- TCHAR szSubCur[100];
+ wchar_t szSubCur[100];
sItem.mask = LVIF_TEXT | LVIF_PARAM;
sItem.iItem = nSubCur;
sItem.iSubItem = 1;
@@ -462,7 +462,7 @@ void AutoFindeFileNames(HWND hwndDlg) sItem.cchTextMax = _countof(szSubCur);
if (ListView_GetItem(hMapUser, &sItem)) {
size_t nLen = mir_tstrlen(szSubCur);
- if (_tcsncicmp(szSubCur, szSearch, nLen) == 0) {
+ if (wcsnicmp(szSubCur, szSearch, nLen) == 0) {
if (nLen < (size_t)nShortestMatch) {
nShortestMatch = (int)nLen;
nStortestIndex = nSubCur;
@@ -493,10 +493,10 @@ void AutoFindeFileNames(HWND hwndDlg) }
if (!bPriHasFileName)
- ListView_SetItemText(hMapUser, nCur, 0, (TCHAR*)sFileName.c_str());
+ ListView_SetItemText(hMapUser, nCur, 0, (wchar_t*)sFileName.c_str());
if (!bSubHasFileName)
- ListView_SetItemText(hMapUser, nStortestIndex, 0, (TCHAR*)sFileName.c_str());
+ ListView_SetItemText(hMapUser, nStortestIndex, 0, (wchar_t*)sFileName.c_str());
if (!bUnaplyedChanges) {
bUnaplyedChanges = TRUE;
@@ -521,7 +521,7 @@ void AutoFindeFileNames(HWND hwndDlg) void OpenHelp(HWND hwndDlg)
{
- TCHAR szPath[MAX_PATH];
+ wchar_t szPath[MAX_PATH];
if (GetModuleFileName(hInstance, szPath, _countof(szPath))) {
size_t nLen = mir_tstrlen(szPath);
if (nLen > 3) {
@@ -629,7 +629,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar sItem.lParam = hContact;
sTmp = _DBGetString(hContact, MODULE, "FileName", L"");
- sItem.pszText = (TCHAR*)sTmp.c_str();
+ sItem.pszText = (wchar_t*)sTmp.c_str();
ListView_InsertItem(hMapUser, &sItem);
sItem.mask = LVIF_TEXT;
@@ -642,7 +642,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar ListView_SetItem(hMapUser, &sItem);
DWORD dwUIN = db_get_dw(hContact, pa->szModuleName, "UIN", 0);
- TCHAR szTmp[50];
+ wchar_t szTmp[50];
mir_sntprintf(szTmp, L"%d", dwUIN);
sItem.iSubItem = 3;
sItem.pszText = szTmp;
@@ -789,10 +789,10 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar return TRUE;
case IDC_FILE_VIEWER_BROWSE:
- TCHAR szFile[260]; // buffer for file name
+ wchar_t szFile[260]; // buffer for file name
GetDlgItemText(hwndDlg, IDC_FILE_VIEWER, szFile, _countof(szFile));
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
mir_sntprintf(buf, L"%s (*.exe;*.com;*.bat;*.cmd)%c*.exe;*.com;*.bat;*.cmd%c%s (*.*)%c*.*%c%c", TranslateT("Executable files"), 0, 0, TranslateT("All files"), 0, 0, 0);
{
OPENFILENAME ofn = {}; // common dialog box structure
@@ -823,7 +823,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar }
// Allocate the Dest Dir buffer to receive browse info
- TCHAR *lpDestDir = (TCHAR *)pMalloc->Alloc(MAX_PATH + 100);
+ wchar_t *lpDestDir = (wchar_t *)pMalloc->Alloc(MAX_PATH + 100);
if (!lpDestDir) {
pMalloc->Release();
MessageBox(hwndDlg, TranslateT("Failed to Allocate buffer space"), MSG_BOX_TITEL, MB_OK);
@@ -1227,16 +1227,16 @@ int OptionsInitialize(WPARAM wParam, LPARAM /*lParam*/) odp.hInstance = hInstance;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSGEXPORT);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszTitle = LPGENT("Message export");
- odp.ptszGroup = LPGENT("History");
- odp.ptszTab = LPGENT("General");
+ odp.pwszTitle = LPGENW("Message export");
+ odp.pwszGroup = LPGENW("History");
+ odp.pwszTab = LPGENW("General");
odp.groupPosition = 100000000;
odp.pfnDlgProc = DlgProcMsgExportOpts;
Options_AddPage(wParam, &odp);
odp.position = 100000001;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSGEXPORT2);
- odp.ptszTab = LPGENT("Additional");
+ odp.pwszTab = LPGENW("Additional");
odp.pfnDlgProc = DlgProcMsgExportOpts2;
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 6ef31c4135..c485229adc 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -19,11 +19,11 @@ #include "stdafx.h"
// Default error string used upon errors
-const TCHAR *pszGroupError = LPGENT("No_Group");
-const TCHAR *pszDbPathError = L".";
+const wchar_t *pszGroupError = LPGENW("No_Group");
+const wchar_t *pszDbPathError = L".";
// Replacement for chareteres not alowed in file names.
-const TCHAR cBadCharReplace = _T('_');
+const wchar_t cBadCharReplace = '_';
// sTimeFormat
tstring sTimeFormat;
@@ -49,7 +49,7 @@ map<tstring, string::size_type, less<tstring> > clFileTo1ColWidth; // default line width
int nMaxLineWidth = 80;
-const TCHAR *pszReplaceList[] =
+const wchar_t *pszReplaceList[] =
{
L"%FirstName%",
L"%LastName%",
@@ -137,7 +137,7 @@ void ShowDebugInfo() // Developer : KN
/////////////////////////////////////////////////////////////////////
-int nGetFormatCount(const TCHAR *pszToCheck)
+int nGetFormatCount(const wchar_t *pszToCheck)
{
if (!pszToCheck || pszToCheck[0] == 0)
return 0;
@@ -192,12 +192,12 @@ tstring sGetErrorString() return sGetErrorString(GetLastError());
}
-void DisplayLastError(const TCHAR *pszError)
+void DisplayLastError(const wchar_t *pszError)
{
tstring sError = pszError;
DWORD error = GetLastError();
- TCHAR szTemp[50];
+ wchar_t szTemp[50];
mir_sntprintf(szTemp, L"\r\nErrorCode: %d\r\n", error);
sError += szTemp;
sError += sGetErrorString(error);
@@ -220,7 +220,7 @@ void DisplayLastError(const TCHAR *pszError) // Developer : KN
/////////////////////////////////////////////////////////////////////
-tstring _DBGetStringW(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *pszError)
+tstring _DBGetStringW(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *pszError)
{
tstring ret;
DBVARIANT dbv = { 0 };
@@ -230,7 +230,7 @@ tstring _DBGetStringW(MCONTACT hContact, const char *szModule, const char *szSet MessageBox(NULL, TranslateT("Database: Attempt to get wrong type of value, string"), MSG_BOX_TITEL, MB_OK);
ret = pszError;
}
- else ret = (TCHAR*)dbv.pszVal;
+ else ret = (wchar_t*)dbv.pszVal;
}
else ret = pszError;
@@ -270,7 +270,7 @@ string _DBGetStringA(MCONTACT hContact, const char *szModule, const char *szSett // Developer : KN
/////////////////////////////////////////////////////////////////////
-void ReplaceAll(tstring &sSrc, const TCHAR *pszReplace, const tstring &sNew)
+void ReplaceAll(tstring &sSrc, const wchar_t *pszReplace, const tstring &sNew)
{
string::size_type nCur = 0;
while ((nCur = sSrc.find(pszReplace, nCur)) != sSrc.npos) {
@@ -279,7 +279,7 @@ void ReplaceAll(tstring &sSrc, const TCHAR *pszReplace, const tstring &sNew) }
}
-void ReplaceAll(tstring &sSrc, const TCHAR *pszReplace, const TCHAR *pszNew)
+void ReplaceAll(tstring &sSrc, const wchar_t *pszReplace, const wchar_t *pszNew)
{
tstring sNew = pszNew;
ReplaceAll(sSrc, pszReplace, sNew);
@@ -364,10 +364,10 @@ bool bWriteToFile(HANDLE hFile, const char *pszSrc, int nLen = -1) // Developer : KN
/////////////////////////////////////////////////////////////////////
-static bool bWriteTextToFile(HANDLE hFile, const TCHAR *pszSrc, bool bUtf8File, int nLen = -1)
+static bool bWriteTextToFile(HANDLE hFile, const wchar_t *pszSrc, bool bUtf8File, int nLen = -1)
{
if (nLen != -1) {
- TCHAR *tmp = (TCHAR*)alloca(sizeof(TCHAR)*(nLen + 1));
+ wchar_t *tmp = (wchar_t*)alloca(sizeof(wchar_t)*(nLen + 1));
mir_tstrncpy(tmp, pszSrc, nLen + 1);
pszSrc = tmp;
}
@@ -463,7 +463,7 @@ bool bWriteHexToFile(HANDLE hFile, void * pData, int nSize) bool bReadMirandaDirAndPath()
{
- TCHAR szDBPath[MAX_PATH], tmp[MAX_PATH];
+ wchar_t szDBPath[MAX_PATH], tmp[MAX_PATH];
mir_tstrcpy(szDBPath, pszDbPathError);
PathToAbsoluteT(L"miranda32.exe", tmp);
sMirandaPath = tmp;
@@ -537,7 +537,7 @@ tstring GetFilePathFromUser(MCONTACT hContact) // Here we will try to avoide the (Unknown Contact) in cases where the protocol for
// this user has been removed.
- if (bNickUsed && (_tcsstr(pcli->pfnGetContactDisplayName(hContact, 0), LPGENT("(Unknown Contact)")) != 0))
+ if (bNickUsed && (wcsstr(pcli->pfnGetContactDisplayName(hContact, 0), LPGENW("(Unknown Contact)")) != 0))
return sPrevFileName; // Then the filename must have changed from a correct path to one including the (Unknown Contact)
// file name has changed
@@ -555,7 +555,7 @@ tstring GetFilePathFromUser(MCONTACT hContact) if (hPrevFile != INVALID_HANDLE_VALUE) {
CloseHandle(hPrevFile);
- TCHAR szTemp[500];
+ wchar_t szTemp[500];
// There is a previous file we can move
// ask user ?
bool bTryRename;
@@ -640,10 +640,10 @@ tstring FileNickFromHandle(MCONTACT hContact) // Developer : KN
/////////////////////////////////////////////////////////////////////
-void ReplaceAllNoColon(tstring &sSrc, const TCHAR *pszReplace, tstring &sNew)
+void ReplaceAllNoColon(tstring &sSrc, const wchar_t *pszReplace, tstring &sNew)
{
tstring::size_type nCur = 0;
- while ((nCur = sNew.find_first_of(_T(':'), nCur)) != sNew.npos)
+ while ((nCur = sNew.find_first_of(':', nCur)) != sNew.npos)
sNew[nCur] = cBadCharReplace;
ReplaceAll(sSrc, pszReplace, sNew);
}
@@ -678,7 +678,7 @@ void ReplaceDefines(MCONTACT hContact, tstring & sTarget) DWORD dwUIN = db_get_dw(hContact, sProto.c_str(), "UIN", 0);
tstring sReplaceUin;
if (dwUIN) {
- TCHAR sTmp[20];
+ wchar_t sTmp[20];
mir_sntprintf(sTmp, L"%d", dwUIN);
sReplaceUin = sTmp;
}
@@ -759,7 +759,7 @@ void ReplaceTimeVariables(tstring &sRet) sRet.find(L"%day%") != string::npos) {
SYSTEMTIME stTime;
GetLocalTime(&stTime);
- TCHAR sTmp[20];
+ wchar_t sTmp[20];
mir_sntprintf(sTmp, L"%d", stTime.wYear);
ReplaceAll(sRet, L"%year%", sTmp);
@@ -810,7 +810,7 @@ void UpdateFileToColWidth() // Developer : KN
/////////////////////////////////////////////////////////////////////
-void DisplayErrorDialog(const TCHAR *pszError, tstring& sFilePath, DBEVENTINFO * dbei)
+void DisplayErrorDialog(const wchar_t *pszError, tstring& sFilePath, DBEVENTINFO * dbei)
{
tstring sError = TranslateTS(pszError);
sError += sFilePath;
@@ -820,7 +820,7 @@ void DisplayErrorDialog(const TCHAR *pszError, tstring& sFilePath, DBEVENTINFO * sError += TranslateT("Do you wish to save debug information?");
if (MessageBox(NULL, sError.c_str(), MSG_BOX_TITEL, MB_YESNO) == IDYES) {
OPENFILENAME ofn; // common dialog box structure
- TCHAR szFile[260]; // buffer for file name
+ wchar_t szFile[260]; // buffer for file name
mir_tstrcpy(szFile, L"DebugInfo.txt");
// Initialize OPENFILENAME
@@ -879,7 +879,7 @@ void DisplayErrorDialog(const TCHAR *pszError, tstring& sFilePath, DBEVENTINFO * void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei)
{
- TCHAR szTemp[500];
+ wchar_t szTemp[500];
tstring sFilePath = GetFilePathFromUser(hContact);
GetLastError();// Clear last error !!
@@ -894,7 +894,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) }
if (hFile == INVALID_HANDLE_VALUE) {
- DisplayErrorDialog(LPGENT("Failed to open or create file :\n"), sFilePath, NULL);
+ DisplayErrorDialog(LPGENW("Failed to open or create file :\n"), sFilePath, NULL);
return;
}
@@ -931,7 +931,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) if (dwPtr == INVALID_SET_FILE_POINTER) {
// we need to aborte mission here because if we continue we risk
// overwriting old log.
- DisplayErrorDialog(LPGENT("Failed to move to the end of the file :\n"), sFilePath, NULL);
+ DisplayErrorDialog(LPGENW("Failed to move to the end of the file :\n"), sFilePath, NULL);
CloseHandle(hFile);
return;
}
@@ -940,27 +940,27 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) bWriteUTF8Format = bUseUtf8InNewFiles;
if (bWriteUTF8Format) {
if (!bWriteToFile(hFile, szUtf8ByteOrderHeader, sizeof(szUtf8ByteOrderHeader) - 1)) {
- DisplayErrorDialog(LPGENT("Failed to UTF8 byte order code to file :\n"), sFilePath, NULL);
+ DisplayErrorDialog(LPGENW("Failed to UTF8 byte order code to file :\n"), sFilePath, NULL);
CloseHandle(hFile);
return;
}
}
tstring output = L"------------------------------------------------\r\n"
- LPGENT(" History for\r\n")
- LPGENT("User : %User%\r\n")
- LPGENT("Protocol : %Proto%\r\n")
- LPGENT("UIN : %UIN%\r\n")
- LPGENT("FirstName : %FirstName%\r\n")
- LPGENT("LastName : %LastName%\r\n")
- LPGENT("Age : %Age%\r\n")
- LPGENT("Gender : %Gender%\r\n")
- LPGENT("e-mail : %e-mail%\r\n")
- LPGENT("Nick : %Nick%\r\n")
- LPGENT("City : %City%\r\n")
- LPGENT("State : %State%\r\n")
- LPGENT("Phone : %Phone%\r\n")
- LPGENT("Homepage : %Homepage%\r\n")
- LPGENT("- About -\r\n%About%\r\n")
+ LPGENW(" History for\r\n")
+ LPGENW("User : %User%\r\n")
+ LPGENW("Protocol : %Proto%\r\n")
+ LPGENW("UIN : %UIN%\r\n")
+ LPGENW("FirstName : %FirstName%\r\n")
+ LPGENW("LastName : %LastName%\r\n")
+ LPGENW("Age : %Age%\r\n")
+ LPGENW("Gender : %Gender%\r\n")
+ LPGENW("e-mail : %e-mail%\r\n")
+ LPGENW("Nick : %Nick%\r\n")
+ LPGENW("City : %City%\r\n")
+ LPGENW("State : %State%\r\n")
+ LPGENW("Phone : %Phone%\r\n")
+ LPGENW("Homepage : %Homepage%\r\n")
+ LPGENW("- About -\r\n%About%\r\n")
L"------------------------------------------------\r\n";
// This is written this way because I expect this will become a string the user may set
@@ -980,12 +980,12 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) mir_sntprintf(szTemp, L"%d", db_get_w(hContact, sProto.c_str(), "Age", 0));
ReplaceAll(output, L"%Age%", szTemp);
- szTemp[0] = (TCHAR)db_get_b(hContact, sProto.c_str(), "Gender", 0);
+ szTemp[0] = (wchar_t)db_get_b(hContact, sProto.c_str(), "Gender", 0);
szTemp[1] = 0;
ReplaceAll(output, L"%Gender%", szTemp);
if (!bWriteTextToFile(hFile, output.data(), bWriteUTF8Format, (int)output.size())) {
- DisplayErrorDialog(LPGENT("Failed to write user details to file :\n"), sFilePath, NULL);
+ DisplayErrorDialog(LPGENW("Failed to write user details to file :\n"), sFilePath, NULL);
CloseHandle(hFile);
return;
}
@@ -1002,7 +1002,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) // Write first part of line with name and timestamp
if (!bWriteTextToFile(hFile, szTemp, bWriteUTF8Format, nIndent)) {
- DisplayErrorDialog(LPGENT("Failed to write timestamp and username to file :\n"), sFilePath, &dbei);
+ DisplayErrorDialog(LPGENW("Failed to write timestamp and username to file :\n"), sFilePath, &dbei);
CloseHandle(hFile);
return;
}
@@ -1013,9 +1013,9 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) switch (dbei.eventType) {
case EVENTTYPE_MESSAGE:
{
- TCHAR *msg = DbGetEventTextT(&dbei, CP_ACP);
+ wchar_t *msg = DbGetEventTextT(&dbei, CP_ACP);
if (!bWriteIndentedToFile(hFile, nIndent, msg, bWriteUTF8Format)) {
- DisplayErrorDialog(LPGENT("Failed to write message to the file :\n"), sFilePath, &dbei);
+ DisplayErrorDialog(LPGENW("Failed to write message to the file :\n"), sFilePath, &dbei);
}
mir_free(msg);
}
@@ -1024,15 +1024,15 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) case EVENTTYPE_URL:
case EVENTTYPE_FILE:
{
- const TCHAR *pszType;
+ const wchar_t *pszType;
const char *pszData;
if (dbei.eventType == EVENTTYPE_URL) {
- pszType = LPGENT("URL: ");
+ pszType = LPGENW("URL: ");
pszData = (char *)dbei.pBlob;
}
else {
- pszType = LPGENT("File: ");
+ pszType = LPGENW("File: ");
pszData = (char *)(dbei.pBlob + sizeof(DWORD));
}
@@ -1050,7 +1050,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) nLen = (int)mir_strlen(pszData);
if ((pszData - (char *)dbei.pBlob) + nLen < (int)dbei.cbBlob) {
if (bWriteNewLine(hFile, nIndent) &&
- bWriteTextToFile(hFile, LPGENT("Description: "), bWriteUTF8Format) &&
+ bWriteTextToFile(hFile, LPGENW("Description: "), bWriteUTF8Format) &&
bWriteIndentedToFile(hFile, nIndent, pszData, bWriteUTF8Format)) {
bWriteOk = true;
}
@@ -1060,48 +1060,48 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) }
if (!bWriteOk)
- DisplayErrorDialog(LPGENT("Failed to write URL/File to the file :\n"), sFilePath, &dbei);
+ DisplayErrorDialog(LPGENW("Failed to write URL/File to the file :\n"), sFilePath, &dbei);
}
break;
case EVENTTYPE_AUTHREQUEST:
case EVENTTYPE_ADDED:
{
- const TCHAR *pszTypes[] = {
- LPGENT("Nick :"),
- LPGENT("FirstName :"),
- LPGENT("LastName :"),
- LPGENT("e-mail :"),
- LPGENT("Reason :") };
+ const wchar_t *pszTypes[] = {
+ LPGENW("Nick :"),
+ LPGENW("FirstName :"),
+ LPGENW("LastName :"),
+ LPGENW("e-mail :"),
+ LPGENW("Reason :") };
if (dbei.cbBlob < 8 || dbei.cbBlob > 5000) {
int n = mir_sntprintf(szTemp, TranslateT("Invalid Database event received. Type %d, size %d"), dbei.eventType, dbei.cbBlob);
if (!bWriteTextToFile(hFile, szTemp, bWriteUTF8Format, n))
- DisplayErrorDialog(LPGENT("Failed to write Invalid Database event the file :\n"), sFilePath, &dbei);
+ DisplayErrorDialog(LPGENW("Failed to write Invalid Database event the file :\n"), sFilePath, &dbei);
break;
}
bool bWriteOk = false;
int nStringCount;
- const TCHAR *pszTitle;
+ const wchar_t *pszTitle;
char *pszCurBlobPos;
if (dbei.eventType == EVENTTYPE_AUTHREQUEST) { // request
//blob is: uin(DWORD), hContact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ)
nStringCount = 5;
pszCurBlobPos = (char *)dbei.pBlob + sizeof(DWORD) * 2;
- pszTitle = LPGENT("The following user made an authorization request:");
+ pszTitle = LPGENW("The following user made an authorization request:");
}
else { // Added
//blob is: uin(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ)
pszCurBlobPos = (char *)dbei.pBlob + sizeof(DWORD);
nStringCount = 4;
- pszTitle = LPGENT("The following user added you to their contact list:");
+ pszTitle = LPGENW("The following user added you to their contact list:");
}
if (bWriteTextToFile(hFile, pszTitle, bWriteUTF8Format) &&
bWriteNewLine(hFile, nIndent) &&
- bWriteTextToFile(hFile, LPGENT("UIN :"), bWriteUTF8Format)) {
+ bWriteTextToFile(hFile, LPGENW("UIN :"), bWriteUTF8Format)) {
DWORD uin = *((PDWORD)(dbei.pBlob));
int n = mir_sntprintf(szTemp, L"%d", uin);
if (bWriteTextToFile(hFile, szTemp, bWriteUTF8Format, n)) {
@@ -1122,7 +1122,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) }
if (!bWriteOk)
- DisplayErrorDialog(LPGENT("Failed to write AUTHREQUEST or ADDED to the file :\n"), sFilePath, &dbei);
+ DisplayErrorDialog(LPGENW("Failed to write AUTHREQUEST or ADDED to the file :\n"), sFilePath, &dbei);
}
break;
@@ -1145,9 +1145,9 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) const char* pszStr = (const char*)dbei.pBlob;
if (dbei.eventType == ICQEVENTTYPE_EMAILEXPRESS)
- bWriteTextToFile(hFile, LPGENT("EmailExpress from:"), bWriteUTF8Format);
+ bWriteTextToFile(hFile, LPGENW("EmailExpress from:"), bWriteUTF8Format);
else
- bWriteTextToFile(hFile, LPGENT("WebPager from:"), bWriteUTF8Format);
+ bWriteTextToFile(hFile, LPGENW("WebPager from:"), bWriteUTF8Format);
bWriteNewLine(hFile, nIndent);
@@ -1163,24 +1163,24 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) bWriteTextToFile(hFile, L">", bWriteUTF8Format);
}
}
- else bWriteTextToFile(hFile, LPGENT("No from address"), bWriteUTF8Format);
+ else bWriteTextToFile(hFile, LPGENW("No from address"), bWriteUTF8Format);
if (!bWriteNewLine(hFile, nIndent) ||
!bWriteIndentedToFile(hFile, nIndent, pszStr, bWriteUTF8Format)) {
- DisplayErrorDialog(LPGENT("Failed to write EmailExpress to the file :\n"), sFilePath, &dbei);
+ DisplayErrorDialog(LPGENW("Failed to write EmailExpress to the file :\n"), sFilePath, &dbei);
}
}
break;
case ICQEVENTTYPE_SMS:
if (!bWriteIndentedToFile(hFile, nIndent, (const char*)dbei.pBlob, bWriteUTF8Format))
- DisplayErrorDialog(LPGENT("Failed to write SMS to the file :\n"), sFilePath, &dbei);
+ DisplayErrorDialog(LPGENW("Failed to write SMS to the file :\n"), sFilePath, &dbei);
break;
default:
int n = mir_sntprintf(szTemp, TranslateT("Unknown event type %d, size %d"), dbei.eventType, dbei.cbBlob);
if (!bWriteTextToFile(hFile, szTemp, bWriteUTF8Format, n))
- DisplayErrorDialog(LPGENT("Failed to write Unknown event to the file :\n"), sFilePath, &dbei);
+ DisplayErrorDialog(LPGENW("Failed to write Unknown event to the file :\n"), sFilePath, &dbei);
break;
}
}
@@ -1267,7 +1267,7 @@ bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const char *pszSrc, bool bU // Developer : KN
/////////////////////////////////////////////////////////////////////
-bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const TCHAR *pszSrc, bool bUtf8File)
+bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const wchar_t *pszSrc, bool bUtf8File)
{
if (pszSrc == NULL)
return true;
@@ -1278,14 +1278,14 @@ bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const TCHAR *pszSrc, bool b while (*pszSrc) { // first we will scan forward in string to finde either new line or "max line with"
int nLineLen = 0;
do {
- if (pszSrc[nLineLen] == _T('\n') || pszSrc[nLineLen] == _T('\r'))
+ if (pszSrc[nLineLen] == '\n' || pszSrc[nLineLen] == '\r')
break;
if (nLineLen >= nMaxLineWidth) { // ok the line was not broken. we need to force a break
// we will scan backwards again to finde a space !!
// then we will look for a ? and so on.
- const TCHAR ac[] = { _T(' '), _T('?'), _T('-'), _T('.'), _T(',') };
+ const wchar_t ac[] = { ' ', '?', '-', '.', ',' };
for (int y = 0; y < _countof(ac); y++) {
for (int n = nLineLen; n > 0; n--) {
if (pszSrc[n] == ac[y]) {
@@ -1319,9 +1319,9 @@ bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const TCHAR *pszSrc, bool b // skip any noice chars, MAC style '\r' '\r' '\n'
// and excess spaces
- const TCHAR *pszPrev = pszSrc;
+ const wchar_t *pszPrev = pszSrc;
pszSrc += nLineLen;
- while (*pszSrc == _T(' ') || *pszSrc == _T('\n') || *pszSrc == _T('\r'))
+ while (*pszSrc == ' ' || *pszSrc == '\n' || *pszSrc == '\r')
pszSrc++;
if (pszPrev == pszSrc) {
@@ -1379,7 +1379,7 @@ int nContactDeleted(WPARAM wparam, LPARAM /*lparam*/) if (hPrevFile != INVALID_HANDLE_VALUE) {
CloseHandle(hPrevFile);
- TCHAR szTemp[500];
+ wchar_t szTemp[500];
mir_sntprintf(szTemp, L"%s\r\n%s",
TranslateT("User has been deleted. Do you want to delete the file?"), sFilePath.c_str());
@@ -1431,8 +1431,8 @@ void SaveSettings() /////////////////////////////////////////////////////////////////////
-TCHAR* GetMyOwnNick(MCONTACT hContact)
+wchar_t* GetMyOwnNick(MCONTACT hContact)
{
- TCHAR *p = Contact_GetInfo(CNF_DISPLAY, NULL, GetContactProto(hContact));
+ wchar_t *p = Contact_GetInfo(CNF_DISPLAY, NULL, GetContactProto(hContact));
return (p != NULL) ? p : mir_tstrdup(TranslateT("No_Nick"));
}
diff --git a/plugins/Msg_Export/src/utils.h b/plugins/Msg_Export/src/utils.h index ac567f8808..f7bf70efc8 100755 --- a/plugins/Msg_Export/src/utils.h +++ b/plugins/Msg_Export/src/utils.h @@ -47,9 +47,9 @@ extern bool bReplaceHistory; tstring sGetErrorString(DWORD dwError);
tstring sGetErrorString();
-void DisplayLastError(const TCHAR *pszError);
+void DisplayLastError(const wchar_t *pszError);
-TCHAR *CheckedTranslate(const TCHAR *szEng, int nFormatCount = -1);
+wchar_t *CheckedTranslate(const wchar_t *szEng, int nFormatCount = -1);
void SaveSettings();
void ShowDebugInfo();
@@ -57,13 +57,13 @@ void ShowDebugInfo(); int nExportEvent(WPARAM wparam, LPARAM lparam);
int nContactDeleted(WPARAM wparam, LPARAM lparam);
-TCHAR* GetMyOwnNick(MCONTACT hContact);
+wchar_t* GetMyOwnNick(MCONTACT hContact);
-tstring __inline _DBGetStringW(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *pszError);
+tstring __inline _DBGetStringW(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *pszError);
string __inline _DBGetStringA(MCONTACT hContact, const char *szModule, const char *szSetting, const char *pszError);
-void ReplaceAll(tstring &sSrc, const TCHAR *pszReplace, const tstring &sNew);
-void ReplaceAll(tstring &sSrc, const TCHAR *pszReplace, const TCHAR *pszNew);
+void ReplaceAll(tstring &sSrc, const wchar_t *pszReplace, const tstring &sNew);
+void ReplaceAll(tstring &sSrc, const wchar_t *pszReplace, const wchar_t *pszNew);
void UpdateFileToColWidth();
@@ -76,7 +76,7 @@ void ReplaceTimeVariables(tstring &sRet); bool bCreatePathToFile(tstring sFilePath);
bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const char *pszSrc, bool bUtf8File);
-bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const TCHAR *pszSrc, bool bUtf8File);
+bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const wchar_t *pszSrc, bool bUtf8File);
bool bWriteNewLine(HANDLE hFile, DWORD dwIndent);
bool bIsUtf8Header(BYTE * pucByteOrder);
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index 838c398f46..c9b2a1b0ea 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -52,7 +52,7 @@ void DeInitProtocolData() // Protocol Class ///////////////////////////////////////////////////////////////////////////////////////////
-Protocol::Protocol(const char *aName, const TCHAR *descr)
+Protocol::Protocol(const char *aName, const wchar_t *descr)
{
mir_strncpy(name, aName, _countof(name));
mir_tstrncpy(description, descr, _countof(description));
@@ -84,7 +84,7 @@ Protocol::~Protocol() {
}
-void Protocol::lcopystr(TCHAR *dest, TCHAR *src, size_t maxlen)
+void Protocol::lcopystr(wchar_t *dest, wchar_t *src, size_t maxlen)
{
if (mir_tstrcmp(dest, src) != 0) {
data_changed = true;
@@ -110,7 +110,7 @@ int Protocol::GetStatus() // check if protocol supports custom status
CUSTOM_STATUS css = { sizeof(css) };
- TCHAR tszXStatusName[256], tszXStatusMessage[1024];
+ wchar_t tszXStatusName[256], tszXStatusMessage[1024];
if (ProtoServiceExists(name, PS_GETCUSTOMSTATUSEX)) {
// check if custom status is set
css.flags = CSSF_TCHAR | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE | CSSF_DEFAULT_NAME;
@@ -128,11 +128,11 @@ int Protocol::GetStatus() custom_status = 0;
if (custom_status == 0) {
- TCHAR *tmp = pcli->pfnGetStatusModeDescription(status, 0);
+ wchar_t *tmp = pcli->pfnGetStatusModeDescription(status, 0);
lcopystr(status_name, tmp, _countof(status_name));
}
else {
- TCHAR *p = (tszXStatusName[0] != 0) ? TranslateTS(tszXStatusName) : TranslateT("<no status name>");
+ wchar_t *p = (tszXStatusName[0] != 0) ? TranslateTS(tszXStatusName) : TranslateT("<no status name>");
if (tszXStatusMessage[0])
mir_sntprintf(status_name, L"%s: %s", p, tszXStatusMessage);
else
@@ -168,7 +168,7 @@ void Protocol::SetStatus(int aStatus) pse[0]->status = aStatus;
pse[0]->szName = name;
- TCHAR status_msg[256];
+ wchar_t status_msg[256];
GetStatusMsg(aStatus, status_msg, _countof(status_msg));
pse[0]->szMsg = status_msg;
@@ -182,7 +182,7 @@ void Protocol::SetStatus(int aStatus) CallProtoService(name, PS_SETSTATUS, aStatus, 0);
if (CanSetStatusMsg(aStatus)) {
- TCHAR status_msg[MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE];
+ wchar_t status_msg[MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE];
GetStatusMsg(aStatus, status_msg, _countof(status_msg));
SetStatusMsg(aStatus, status_msg);
}
@@ -209,32 +209,32 @@ bool Protocol::CanSetStatusMsg(int aStatus) return CanGetStatusMsg(aStatus);
}
-void Protocol::GetStatusMsg(int aStatus, TCHAR *msg, size_t msg_size)
+void Protocol::GetStatusMsg(int aStatus, wchar_t *msg, size_t msg_size)
{
if (!CanGetStatusMsg())
lcopystr(msg, L"", msg_size);
else if (aStatus == status && ProtoServiceExists(name, PS_GETMYAWAYMSG)) {
- ptrT tmp((TCHAR *)CallProtoService(name, PS_GETMYAWAYMSG, 0, SGMA_TCHAR));
+ ptrT tmp((wchar_t *)CallProtoService(name, PS_GETMYAWAYMSG, 0, SGMA_TCHAR));
lcopystr(msg, tmp == NULL ? L"" : tmp, msg_size);
}
else if (ServiceExists(MS_AWAYMSG_GETSTATUSMSGT)) {
- ptrT tmp((TCHAR *)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)aStatus, (LPARAM)name));
+ ptrT tmp((wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)aStatus, (LPARAM)name));
lcopystr(msg, tmp == NULL ? L"" : tmp, msg_size);
}
}
-TCHAR* Protocol::GetStatusMsg()
+wchar_t* Protocol::GetStatusMsg()
{
GetStatusMsg(status, status_message, _countof(status_message));
return status_message;
}
-void Protocol::SetStatusMsg(const TCHAR *message)
+void Protocol::SetStatusMsg(const wchar_t *message)
{
SetStatusMsg(GetStatus(), message);
}
-void Protocol::SetStatusMsg(int aStatus, const TCHAR *message)
+void Protocol::SetStatusMsg(int aStatus, const wchar_t *message)
{
if (!CanSetStatusMsg(aStatus))
return;
@@ -284,7 +284,7 @@ int Protocol::GetNickMaxLength() return ret;
}
-TCHAR* Protocol::GetNick()
+wchar_t* Protocol::GetNick()
{
ptrT nick(Contact_GetInfo(CNF_DISPLAY, NULL, name));
lcopystr(nickname, (nick != NULL) ? nick : L"", _countof(nickname));
@@ -296,7 +296,7 @@ bool Protocol::CanSetNick() return can_set_nick;
}
-void Protocol::SetNick(const TCHAR *nick)
+void Protocol::SetNick(const wchar_t *nick)
{
// See if can get one
if (!CanSetNick())
@@ -314,7 +314,7 @@ bool Protocol::CanSetAvatar() return g_bAvsExist && CallService(MS_AV_CANSETMYAVATAR, (WPARAM)name, 0);
}
-void Protocol::SetAvatar(const TCHAR *file_name)
+void Protocol::SetAvatar(const wchar_t *file_name)
{
if (CanSetAvatar())
CallService(MS_AV_SETMYAVATART, (WPARAM)name, (LPARAM)file_name);
@@ -335,7 +335,7 @@ bool Protocol::ListeningToEnabled() return CanSetListeningTo() && CallService(MS_LISTENINGTO_ENABLED, (WPARAM)name, 0) != 0;
}
-TCHAR *Protocol::GetListeningTo()
+wchar_t *Protocol::GetListeningTo()
{
if (!CanGetListeningTo()) {
lcopystr(listening_to, L"", _countof(listening_to));
@@ -445,7 +445,7 @@ bool ProtocolArray::CanSetAvatars() return g_bAvsExist;
}
-void ProtocolArray::SetAvatars(const TCHAR *file_name)
+void ProtocolArray::SetAvatars(const wchar_t *file_name)
{
if (!CanSetAvatars())
return;
@@ -453,7 +453,7 @@ void ProtocolArray::SetAvatars(const TCHAR *file_name) CallService(MS_AV_SETMYAVATART, NULL, (WPARAM)file_name);
}
-void ProtocolArray::SetNicks(const TCHAR *nick)
+void ProtocolArray::SetNicks(const wchar_t *nick)
{
if (nick == NULL || nick[0] == '\0')
return;
@@ -472,13 +472,13 @@ void ProtocolArray::SetStatus(int aStatus) CallService(MS_CLIST_SETSTATUSMODE, aStatus, 0);
}
-void ProtocolArray::SetStatusMsgs(const TCHAR *message)
+void ProtocolArray::SetStatusMsgs(const wchar_t *message)
{
for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_IDLE; i++)
SetStatusMsgs(i, message);
}
-void ProtocolArray::SetStatusMsgs(int status, const TCHAR *message)
+void ProtocolArray::SetStatusMsgs(int status, const wchar_t *message)
{
db_set_ts(NULL, "SRAway", StatusModeToDbSetting(status, "Msg"), message);
@@ -509,19 +509,19 @@ void ProtocolArray::GetDefaultAvatar() default_avatar_file[0] = '\0';
}
-TCHAR *ProtocolArray::GetDefaultStatusMsg()
+wchar_t *ProtocolArray::GetDefaultStatusMsg()
{
return GetDefaultStatusMsg(CallService(MS_CLIST_GETSTATUSMODE, 0, 0));
}
-TCHAR *ProtocolArray::GetDefaultStatusMsg(int status)
+wchar_t *ProtocolArray::GetDefaultStatusMsg(int status)
{
default_status_message[0] = '\0';
if (status == ID_STATUS_CONNECTING)
status = ID_STATUS_OFFLINE;
- TCHAR *tmp = (TCHAR *)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)status, 0);
+ wchar_t *tmp = (wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)status, 0);
if (tmp != NULL) {
mir_tstrncpy(default_status_message, tmp, _countof(default_status_message));
mir_free(tmp);
diff --git a/plugins/MyDetails/src/data.h b/plugins/MyDetails/src/data.h index 6af422d56d..5f70525f38 100644 --- a/plugins/MyDetails/src/data.h +++ b/plugins/MyDetails/src/data.h @@ -34,18 +34,18 @@ protected: bool can_have_listening_to;
int PF3;
- void lcopystr(TCHAR *dest, TCHAR *src, size_t maxlen);
+ void lcopystr(wchar_t *dest, wchar_t *src, size_t maxlen);
public:
// Name of protocol
char name[256];
- TCHAR description[256];
- TCHAR nickname[256];
- TCHAR status_name[256];
- TCHAR status_message[1024];
- TCHAR listening_to[1024];
+ wchar_t description[256];
+ wchar_t nickname[256];
+ wchar_t status_name[256];
+ wchar_t status_message[1024];
+ wchar_t listening_to[1024];
AVATARCACHEENTRY *ace;
- TCHAR avatar_file[1024];
+ wchar_t avatar_file[1024];
HBITMAP avatar_bmp;
int status;
int custom_status;
@@ -57,7 +57,7 @@ public: // Methods ///////////////
- Protocol(const char *name, const TCHAR *descr);
+ Protocol(const char *name, const wchar_t *descr);
~Protocol();
bool IsValid();
@@ -70,27 +70,27 @@ public: void GetAvatar(); // Copy to cache
bool CanSetAvatar();
- void SetAvatar(const TCHAR *file_name);
+ void SetAvatar(const wchar_t *file_name);
//void SetAvatar(const char *file_name, HBITMAP hBmp);
- TCHAR *GetNick(); // Copy to cache and return a copy
+ wchar_t *GetNick(); // Copy to cache and return a copy
int GetNickMaxLength();
bool CanSetNick();
- void SetNick(const TCHAR *nick);
+ void SetNick(const wchar_t *nick);
bool CanGetListeningTo();
bool CanSetListeningTo();
bool ListeningToEnabled();
- TCHAR *GetListeningTo(); // Copy to cache and return a copy
+ wchar_t *GetListeningTo(); // Copy to cache and return a copy
bool CanGetStatusMsg();
bool CanGetStatusMsg(int aStatus);
- TCHAR *GetStatusMsg(); // Copy to cache and return a copy
- void GetStatusMsg(int aStatus, TCHAR *msg, size_t msg_size);
+ wchar_t *GetStatusMsg(); // Copy to cache and return a copy
+ void GetStatusMsg(int aStatus, wchar_t *msg, size_t msg_size);
bool CanSetStatusMsg();
bool CanSetStatusMsg(int aStatus);
- void SetStatusMsg(const TCHAR *message);
- void SetStatusMsg(int aStatus, const TCHAR *message);
+ void SetStatusMsg(const wchar_t *message);
+ void SetStatusMsg(int aStatus, const wchar_t *message);
};
@@ -103,9 +103,9 @@ protected: int buffer_len;
public:
- TCHAR default_nick[256];
- TCHAR default_avatar_file[256];
- TCHAR default_status_message[256];
+ wchar_t default_nick[256];
+ wchar_t default_avatar_file[256];
+ wchar_t default_status_message[256];
// Methods ///////////////
@@ -120,14 +120,14 @@ public: void GetAvatars();
bool CanSetAvatars();
- void SetAvatars(const TCHAR *file);
+ void SetAvatars(const wchar_t *file);
- void SetNicks(const TCHAR *nick);
+ void SetNicks(const wchar_t *nick);
void SetStatus(int aStatus);
- void SetStatusMsgs(const TCHAR *message);
- void SetStatusMsgs(int status, const TCHAR *message);
+ void SetStatusMsgs(const wchar_t *message);
+ void SetStatusMsgs(int status, const wchar_t *message);
void GetStatusMsgs();
void GetStatuses();
@@ -137,8 +137,8 @@ public: void GetDefaultNick(); // Copy to cache
void GetDefaultAvatar(); // Copy to cache
- TCHAR *GetDefaultStatusMsg(); // Copy to cache
- TCHAR *GetDefaultStatusMsg(int status);
+ wchar_t *GetDefaultStatusMsg(); // Copy to cache
+ wchar_t *GetDefaultStatusMsg(int status);
bool CanSetListeningTo();
bool ListeningToEnabled();
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index e5a19095d5..2778f655b9 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -68,7 +68,7 @@ COLORREF font_colour[NUM_FONTS]; // Defaults
char *font_settings[] = { "NicknameFont", "AccountFont", "StatusFont", "StatusMessageFont", "ListeningToFont" };
-TCHAR *font_names[] = { LPGENT("Nickname"), LPGENT("Account"), LPGENT("Status"), LPGENT("Status message"), LPGENT("Listening to") };
+wchar_t *font_names[] = { LPGENW("Nickname"), LPGENW("Account"), LPGENW("Status"), LPGENW("Status message"), LPGENW("Listening to") };
char font_sizes[] = { 13, 8, 8, 8, 8 };
BYTE font_styles[] = { DBFONTF_BOLD, 0, 0, DBFONTF_ITALIC, DBFONTF_ITALIC };
COLORREF font_colors[] = { RGB(0, 0, 0), RGB(0, 0, 0), RGB(0, 0, 0), RGB(150, 150, 150), RGB(150, 150, 150) };
@@ -234,11 +234,11 @@ int CreateFrame() memset(&font_id[i], 0, sizeof(font_id[i]));
font_id[i].cbSize = sizeof(FontIDT);
- mir_tstrncpy(font_id[i].group, LPGENT("My details"), _countof(font_id[i].group));
+ mir_tstrncpy(font_id[i].group, LPGENW("My details"), _countof(font_id[i].group));
mir_tstrncpy(font_id[i].name, font_names[i], _countof(font_id[i].name));
mir_strncpy(font_id[i].dbSettingsGroup, MODULE_NAME, _countof(font_id[i].dbSettingsGroup));
- mir_tstrncpy(font_id[i].backgroundName, LPGENT("Background"), _countof(font_id[i].backgroundName));
- mir_tstrncpy(font_id[i].backgroundGroup, LPGENT("My details"), _countof(font_id[i].backgroundGroup));
+ mir_tstrncpy(font_id[i].backgroundName, LPGENW("Background"), _countof(font_id[i].backgroundName));
+ mir_tstrncpy(font_id[i].backgroundGroup, LPGENW("My details"), _countof(font_id[i].backgroundGroup));
mir_strncpy(font_id[i].prefix, font_settings[i], _countof(font_id[i].prefix));
@@ -328,14 +328,14 @@ int CreateFrame() // Create menu item
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("My details"), 500010000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("My details"), 500010000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "8C1C981C-4F28-4C4C-9121-544156210CE9");
SET_UID(mi, 0x69a43f1d, 0x6ebd, 0x4e41, 0xa6, 0xbd, 0x18, 0xea, 0xc4, 0x3, 0x90, 0x35);
mi.flags = CMIF_TCHAR;
mi.position = 1;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_USERDETAILS);
- mi.name.t = LPGENT("Show my details");
+ mi.name.w = LPGENW("Show my details");
mi.pszService = MODULE_NAME"/ShowHideMyDetails";
hMenuShowHideFrame = Menu_AddMainMenuItem(&mi);
Menu_ConfigureItem(hMenuShowHideFrame, MCI_OPT_EXECPARAM, -0x7FFFFFFF);
@@ -477,10 +477,10 @@ RECT GetRect(HDC hdc, RECT rc, SIZE s, UINT uFormat, int next_top, int text_left return r;
}
-RECT GetRect(HDC hdc, RECT rc, const TCHAR *text, const TCHAR *def_text, Protocol *proto, UINT uFormat,
+RECT GetRect(HDC hdc, RECT rc, const wchar_t *text, const wchar_t *def_text, Protocol *proto, UINT uFormat,
int next_top, int text_left, bool smileys = true, bool frame = true, bool end_elipsis_on_frame = true)
{
- const TCHAR *tmp;
+ const wchar_t *tmp;
if (text[0] == '\0')
tmp = TranslateTS(def_text);
@@ -493,11 +493,11 @@ RECT GetRect(HDC hdc, RECT rc, const TCHAR *text, const TCHAR *def_text, Protoco RECT r_tmp = rc;
// Only first line
- TCHAR *tmp2 = mir_tstrdup(tmp);
- TCHAR *pos = _tcschr(tmp2, '\r');
+ wchar_t *tmp2 = mir_tstrdup(tmp);
+ wchar_t *pos = wcschr(tmp2, '\r');
if (pos != NULL)
pos[0] = '\0';
- pos = _tcschr(tmp2, '\n');
+ pos = wcschr(tmp2, '\n');
if (pos != NULL)
pos[0] = '\0';
@@ -1021,20 +1021,20 @@ void EraseBackground(HWND hwnd, HDC hdc) }
}
-void DrawTextWithRect(HDC hdc, const TCHAR *text, const TCHAR *def_text, RECT rc, UINT uFormat, bool mouse_over, Protocol *proto)
+void DrawTextWithRect(HDC hdc, const wchar_t *text, const wchar_t *def_text, RECT rc, UINT uFormat, bool mouse_over, Protocol *proto)
{
- const TCHAR *tmp;
+ const wchar_t *tmp;
if (text[0] == '\0')
tmp = TranslateTS(def_text);
else
tmp = text;
// Only first line
- TCHAR *tmp2 = mir_tstrdup(tmp);
- TCHAR *pos = _tcsrchr(tmp2, '\r');
+ wchar_t *tmp2 = mir_tstrdup(tmp);
+ wchar_t *pos = wcsrchr(tmp2, '\r');
if (pos != NULL)
pos[0] = '\0';
- pos = _tcschr(tmp2, '\n');
+ pos = wcschr(tmp2, '\n');
if (pos != NULL)
pos[0] = '\0';
@@ -1418,7 +1418,7 @@ void ShowProtocolStatusMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto if (mii.cch != 0) {
mii.cch++;
- mii.dwTypeData = (TCHAR *)malloc(sizeof(TCHAR) * mii.cch);
+ mii.dwTypeData = (wchar_t *)malloc(sizeof(wchar_t) * mii.cch);
GetMenuItemInfo(menu, i, TRUE, &mii);
if (mir_tstrcmp(mii.dwTypeData, proto->description) == 0)
@@ -1477,7 +1477,7 @@ void ShowListeningToMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto, P TranslateMenu(submenu);
// Add this proto to menu
- TCHAR tmp[128];
+ wchar_t tmp[128];
mir_sntprintf(tmp, TranslateT("Enable listening to for %s"), proto->description);
MENUITEMINFO mii = { 0 };
@@ -1715,7 +1715,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar TranslateMenu(submenu);
// Add this proto to menu
- TCHAR tmp[128];
+ wchar_t tmp[128];
mir_sntprintf(tmp, TranslateT("Set my avatar for %s..."), proto->description);
MENUITEMINFO mii = { 0 };
@@ -1755,7 +1755,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar TranslateMenu(submenu);
// Add this proto to menu
- TCHAR tmp[128];
+ wchar_t tmp[128];
mir_sntprintf(tmp, TranslateT("Set my nickname for %s..."), proto->description);
MENUITEMINFO mii = { 0 };
@@ -1796,7 +1796,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar // In status message?
else if (data->draw_away_msg && InsideRect(&p, &data->away_msg_rect)) {
- TCHAR tmp[128];
+ wchar_t tmp[128];
HMENU menu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_MENU1));
HMENU submenu = GetSubMenu(menu, 3);
@@ -1885,7 +1885,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar RemoveMenu(submenu, ID_DONT_CYCLE_THROUGH_PROTOS, MF_BYCOMMAND);
// Add this proto to menu
- TCHAR tmp[128];
+ wchar_t tmp[128];
mir_sntprintf(tmp, TranslateT("Enable listening to for %s"), proto->description);
MENUITEMINFO mii = { 0 };
@@ -2231,7 +2231,7 @@ INT_PTR HideFrameFunc(WPARAM, LPARAM) void FixMainMenu()
{
- Menu_ModifyItem(hMenuShowHideFrame, MyDetailsFrameVisible() ? LPGENT("Hide my details") : LPGENT("Show my details"));
+ Menu_ModifyItem(hMenuShowHideFrame, MyDetailsFrameVisible() ? LPGENW("Hide my details") : LPGENW("Show my details"));
}
#include <math.h>
diff --git a/plugins/MyDetails/src/mydetails.cpp b/plugins/MyDetails/src/mydetails.cpp index c82cfac707..7688d7c586 100644 --- a/plugins/MyDetails/src/mydetails.cpp +++ b/plugins/MyDetails/src/mydetails.cpp @@ -92,7 +92,7 @@ static int MainInit(WPARAM, LPARAM) mi.position = 500050000;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_USERDETAILS);
- mi.name.t = LPGENT("My details");
+ mi.name.w = LPGENW("My details");
HGENMENU hMenuRoot = Menu_AddMainMenuItem(&mi);
mi.flags = CMIF_TCHAR;
@@ -102,7 +102,7 @@ static int MainInit(WPARAM, LPARAM) if (protocols->CanSetAvatars()) {
SET_UID(mi, 0xe5b2d79e, 0xd25a, 0x4f72, 0xa4, 0x1a, 0x21, 0xfd, 0x48, 0x6b, 0xb5, 0x6);
mi.position = 100001;
- mi.name.t = LPGENT("Set my avatar...");
+ mi.name.w = LPGENW("Set my avatar...");
CreateServiceFunction("MENU_" MS_MYDETAILS_SETMYAVATARUI, Menu_SetMyAvatarUI);
mi.pszService = "MENU_" MS_MYDETAILS_SETMYAVATARUI;
Menu_AddMainMenuItem(&mi);
@@ -110,14 +110,14 @@ static int MainInit(WPARAM, LPARAM) SET_UID(mi, 0xa327838f, 0xea6, 0x4ba5, 0x95, 0x92, 0xd8, 0xc4, 0x80, 0x84, 0x3, 0x50);
mi.position = 100002;
- mi.name.t = LPGENT("Set my nickname...");
+ mi.name.w = LPGENW("Set my nickname...");
CreateServiceFunction("MENU_" MS_MYDETAILS_SETMYNICKNAMEUI, Menu_SetMyNicknameUI);
mi.pszService = "MENU_" MS_MYDETAILS_SETMYNICKNAMEUI;
Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x57c0d407, 0x61e1, 0x4c08, 0x8f, 0xcb, 0x65, 0x6a, 0x73, 0x3e, 0x20, 0xa8);
mi.position = 100003;
- mi.name.t = LPGENT("Set my status message...");
+ mi.name.w = LPGENW("Set my status message...");
CreateServiceFunction("MENU_" MS_MYDETAILS_SETMYSTATUSMESSAGEUI, Menu_SetMyStatusMessageUI);
mi.pszService = "MENU_" MS_MYDETAILS_SETMYSTATUSMESSAGEUI;
Menu_AddMainMenuItem(&mi);
@@ -125,7 +125,7 @@ static int MainInit(WPARAM, LPARAM) // Set protocols to show frame
SET_UID(mi, 0x248530a2, 0xfc37, 0x413a, 0x87, 0x62, 0xb1, 0xd1, 0xa8, 0x87, 0x39, 0x5c);
mi.position = 200001;
- mi.name.t = LPGENT("Show next account");
+ mi.name.w = LPGENW("Show next account");
mi.pszService = MS_MYDETAILS_SHOWNEXTPROTOCOL;
Menu_AddMainMenuItem(&mi);
diff --git a/plugins/MyDetails/src/options.cpp b/plugins/MyDetails/src/options.cpp index 0bc92981c0..c9be969e5c 100644 --- a/plugins/MyDetails/src/options.cpp +++ b/plugins/MyDetails/src/options.cpp @@ -166,8 +166,8 @@ int InitOptionsCallback(WPARAM wParam, LPARAM) odp.hInstance = hInst;
odp.pfnDlgProc = DlgProcOpts;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTS);
- odp.ptszGroup = LPGENT("Contact list");
- odp.ptszTitle = LPGENT("My details");
+ odp.pwszGroup = LPGENW("Contact list");
+ odp.pwszTitle = LPGENW("My details");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/MyDetails/src/services.cpp b/plugins/MyDetails/src/services.cpp index 16fcf7eb93..30be916a0f 100644 --- a/plugins/MyDetails/src/services.cpp +++ b/plugins/MyDetails/src/services.cpp @@ -48,7 +48,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam // All protos have the same nick?
if (protocols->GetSize() > 0) {
- TCHAR *nick = protocols->Get(0)->nickname;
+ wchar_t *nick = protocols->Get(0)->nickname;
bool foundDefNick = true;
for (int i = 1; foundDefNick && i < protocols->GetSize(); i++) {
@@ -69,7 +69,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam else {
Protocol *proto = protocols->Get(proto_num);
- TCHAR tmp[128];
+ wchar_t tmp[128];
mir_sntprintf(tmp, TranslateT("Set my nickname for %s"), proto->description);
SetWindowText(hwndDlg, tmp);
@@ -92,7 +92,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam switch (wParam) {
case IDOK:
{
- TCHAR tmp[MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE];
+ wchar_t tmp[MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE];
GetDlgItemText(hwndDlg, IDC_NICKNAME, tmp, _countof(tmp));
LONG_PTR proto_num = GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
@@ -168,7 +168,7 @@ INT_PTR PluginCommand_SetMyNickname(WPARAM wParam, LPARAM lParam) if (!protocols->Get(i)->CanSetNick())
return -2;
- protocols->Get(i)->SetNick((TCHAR *)lParam);
+ protocols->Get(i)->SetNick((wchar_t *)lParam);
return 0;
}
}
@@ -176,13 +176,13 @@ INT_PTR PluginCommand_SetMyNickname(WPARAM wParam, LPARAM lParam) return -1;
}
- protocols->SetNicks((TCHAR *)lParam);
+ protocols->SetNicks((wchar_t *)lParam);
return 0;
}
INT_PTR PluginCommand_GetMyNickname(WPARAM wParam, LPARAM lParam)
{
- TCHAR *ret = (TCHAR *)lParam;
+ wchar_t *ret = (wchar_t *)lParam;
if (ret == NULL)
return -1;
@@ -242,7 +242,7 @@ INT_PTR PluginCommand_SetMyAvatar(WPARAM wParam, LPARAM lParam) if (!protocols->Get(i)->CanSetAvatar())
return -2;
- protocols->Get(i)->SetAvatar((TCHAR *)lParam);
+ protocols->Get(i)->SetAvatar((wchar_t *)lParam);
return 0;
}
}
@@ -250,13 +250,13 @@ INT_PTR PluginCommand_SetMyAvatar(WPARAM wParam, LPARAM lParam) return -1;
}
- protocols->SetAvatars((TCHAR *)lParam);
+ protocols->SetAvatars((wchar_t *)lParam);
return 0;
}
INT_PTR PluginCommand_GetMyAvatar(WPARAM wParam, LPARAM lParam)
{
- TCHAR *ret = (TCHAR *)lParam;
+ wchar_t *ret = (wchar_t *)lParam;
char *proto = (char *)wParam;
if (ret == NULL)
@@ -332,7 +332,7 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w DestroyIcon(hIcon);
}
- TCHAR title[256];
+ wchar_t title[256];
mir_sntprintf(title, TranslateT("Set my status message for %s"), proto->description);
SetWindowText(hwndDlg, title);
@@ -341,7 +341,7 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w else if (data->status != 0) {
Window_SetProtoIcon_IcoLib(hwndDlg, NULL, data->status);
- TCHAR title[256];
+ wchar_t title[256];
mir_sntprintf(title, TranslateT("Set my status message for %s"), pcli->pfnGetStatusModeDescription(data->status, 0));
SetWindowText(hwndDlg, title);
@@ -359,7 +359,7 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w switch (wParam) {
case IDOK:
{
- TCHAR tmp[MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE];
+ wchar_t tmp[MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE];
GetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, tmp, _countof(tmp));
SetStatusMessageData *data = (SetStatusMessageData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
diff --git a/plugins/NewAwaySysMod/src/AwayOpt.cpp b/plugins/NewAwaySysMod/src/AwayOpt.cpp index dff4fa7a04..d6e0213ac0 100644 --- a/plugins/NewAwaySysMod/src/AwayOpt.cpp +++ b/plugins/NewAwaySysMod/src/AwayOpt.cpp @@ -115,13 +115,13 @@ static Dlg1DefMsgDlgItems[] = { struct {
int DlgItem, IconIndex;
- TCHAR* Text;
+ wchar_t* Text;
}
static Dlg1Buttons[] = {
- IDC_MESSAGEDLG_NEWMSG, ILI_NEWMESSAGE, LPGENT("Create new message"),
- IDC_MESSAGEDLG_NEWCAT, ILI_NEWCATEGORY, LPGENT("Create new category"),
- IDC_MESSAGEDLG_DEL, ILI_DELETE, LPGENT("Delete"),
- IDC_MESSAGEDLG_VARS, ILI_NOICON, LPGENT("Open Variables help dialog"),
+ IDC_MESSAGEDLG_NEWMSG, ILI_NEWMESSAGE, LPGENW("Create new message"),
+ IDC_MESSAGEDLG_NEWCAT, ILI_NEWCATEGORY, LPGENW("Create new category"),
+ IDC_MESSAGEDLG_DEL, ILI_DELETE, LPGENW("Delete"),
+ IDC_MESSAGEDLG_VARS, ILI_NOICON, LPGENW("Open Variables help dialog"),
};
static INT_PTR CALLBACK MessagesOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -192,7 +192,7 @@ static INT_PTR CALLBACK MessagesOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LP TCString Msg;
GetDlgItemText(hwndDlg, IDC_MESSAGEDLG_MSGDATA, Msg.GetBuffer(AWAY_MSGDATA_MAX), AWAY_MSGDATA_MAX);
Msg.ReleaseBuffer();
- if (((CTreeItem*)pnm->ItemOld)->User_Str1 != (const TCHAR*)Msg) {
+ if (((CTreeItem*)pnm->ItemOld)->User_Str1 != (const wchar_t*)Msg) {
((CTreeItem*)pnm->ItemOld)->User_Str1 = Msg;
MsgTree->SetModified(true);
}
@@ -515,7 +515,7 @@ INT_PTR CALLBACK AutoreplyOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l HWND hCombo = GetDlgItem(hwndDlg, IDC_REPLYDLG_ONLYIDLEREPLY_COMBO);
struct {
- TCHAR *Text;
+ wchar_t *Text;
int Meaning;
}
static IdleComboValues[] = {
@@ -544,13 +544,13 @@ INT_PTR CALLBACK AutoreplyOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l // init tooltips
struct {
int m_dlgItemID;
- TCHAR *Text;
+ wchar_t *Text;
}
Tooltips[] = {
- IDC_REPLYDLG_RESETCOUNTERWHENSAMEICON, LPGENT("When this checkbox is ticked, NewAwaySys counts \"send times\" starting from the last status message change, even if status mode didn't change.\nWhen the checkbox isn't ticked, \"send times\" are counted from last status mode change (i.e., disabled state is more restrictive)."),
- IDC_MOREOPTDLG_EVNTMSG, LPGENT("Message"),
- IDC_MOREOPTDLG_EVNTURL, LPGENT("URL"),
- IDC_MOREOPTDLG_EVNTFILE, LPGENT("File")
+ IDC_REPLYDLG_RESETCOUNTERWHENSAMEICON, LPGENW("When this checkbox is ticked, NewAwaySys counts \"send times\" starting from the last status message change, even if status mode didn't change.\nWhen the checkbox isn't ticked, \"send times\" are counted from last status mode change (i.e., disabled state is more restrictive)."),
+ IDC_MOREOPTDLG_EVNTMSG, LPGENW("Message"),
+ IDC_MOREOPTDLG_EVNTURL, LPGENW("URL"),
+ IDC_MOREOPTDLG_EVNTFILE, LPGENW("File")
};
hWndTooltips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, L"", WS_POPUP | TTS_NOPREFIX, 0, 0, 0, 0, NULL, NULL, GetModuleHandleA("mir_app.mir"), NULL);
TOOLINFO ti = { 0 };
@@ -669,13 +669,13 @@ Dlg4DefMsgDlgItems[] = { static struct {
int DlgItem, IconIndex;
- TCHAR* Text;
+ wchar_t* Text;
}
Dlg4Buttons[] = {
- IDC_MESSAGEDLG_NEWMSG, ILI_NEWMESSAGE, LPGENT("Create new message"),
- IDC_MESSAGEDLG_NEWCAT, ILI_NEWCATEGORY, LPGENT("Create new category"),
- IDC_MESSAGEDLG_DEL, ILI_DELETE, LPGENT("Delete"),
- IDC_MESSAGEDLG_VARS, ILI_NOICON, LPGENT("Open Variables help dialog"),
+ IDC_MESSAGEDLG_NEWMSG, ILI_NEWMESSAGE, LPGENW("Create new message"),
+ IDC_MESSAGEDLG_NEWCAT, ILI_NEWCATEGORY, LPGENW("Create new category"),
+ IDC_MESSAGEDLG_DEL, ILI_DELETE, LPGENW("Delete"),
+ IDC_MESSAGEDLG_VARS, ILI_NOICON, LPGENW("Open Variables help dialog"),
};
INT_PTR CALLBACK MessagesModernOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -747,7 +747,7 @@ INT_PTR CALLBACK MessagesModernOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPA TCString Msg;
GetDlgItemText(hwndDlg, IDC_MESSAGEDLG_MSGDATA, Msg.GetBuffer(AWAY_MSGDATA_MAX), AWAY_MSGDATA_MAX);
Msg.ReleaseBuffer();
- if (((CTreeItem*)pnm->ItemOld)->User_Str1 != (const TCHAR*)Msg) {
+ if (((CTreeItem*)pnm->ItemOld)->User_Str1 != (const wchar_t*)Msg) {
((CTreeItem*)pnm->ItemOld)->User_Str1 = Msg;
MsgTree->SetModified(true);
}
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index f5f291c59b..7a86594b43 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -119,7 +119,7 @@ TCString GetDynamicStatMsg(MCONTACT hContact, char *szProto, DWORD UIN, int iSta VarParseData.UIN = UIN;
VarParseData.Flags = 0;
if (ServiceExists(MS_VARS_FORMATSTRING) && !g_SetAwayMsgPage.GetDBValueCopy(IDS_SAWAYMSG_DISABLEVARIABLES)) {
- TCHAR *szResult = variables_parse(VarParseData.Message, 0, hContact);
+ wchar_t *szResult = variables_parse(VarParseData.Message, 0, hContact);
if (szResult) {
VarParseData.Message = szResult;
mir_free(szResult);
@@ -312,7 +312,7 @@ int PreBuildContactMenu(WPARAM hContact, LPARAM) int iMode = szProto ? CallProtoService(szProto, PS_GETSTATUS, 0, 0) : 0;
int Flag1 = szProto ? CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) : 0;
int iContactMode = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
- TCHAR szSetStr[256], szReadStr[256];
+ wchar_t szSetStr[256], szReadStr[256];
szSetStr[0] = szReadStr[0] = 0;
HICON hReadMsgIcon = NULL;
@@ -466,7 +466,7 @@ static int IconsChanged(WPARAM, LPARAM) struct
{
- TCHAR *Name;
+ wchar_t *Name;
char *Descr;
int Flags;
}
@@ -501,7 +501,7 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) }
else if (!mir_tstrcmp(ai->targv[0], VAR_MYNICK)) {
if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_MYNICKPERPROTO) && VarParseData.szProto)
- Result = db_get_s(NULL, VarParseData.szProto, "Nick", (TCHAR*)NULL);
+ Result = db_get_s(NULL, VarParseData.szProto, "Nick", (wchar_t*)NULL);
if (Result == NULL)
Result = pcli->pfnGetContactDisplayName(NULL, 0);
@@ -562,7 +562,7 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) if (Result == NULL) // if we didn't find a message with specified title
return NULL; // return it now, as later we change NULL to ""
}
- TCHAR *szResult = (TCHAR*)malloc((Result.GetLen() + 1) * sizeof(TCHAR));
+ wchar_t *szResult = (wchar_t*)malloc((Result.GetLen() + 1) * sizeof(wchar_t));
if (!szResult)
return NULL;
@@ -635,7 +635,7 @@ int MirandaLoaded(WPARAM, LPARAM) mi.position = 1000020000;
mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE;
mi.hIcolibItem = iconList[SendOnEvent ? 1 : 0].hIcolib;
- mi.name.t = SendOnEvent ? DISABLE_SOE_COMMAND : ENABLE_SOE_COMMAND;
+ mi.name.w = SendOnEvent ? DISABLE_SOE_COMMAND : ENABLE_SOE_COMMAND;
mi.pszService = MS_AWAYSYS_AUTOREPLY_TOGGLE;
g_hToggleSOEMenuItem = Menu_AddMainMenuItem(&mi);
@@ -643,7 +643,7 @@ int MirandaLoaded(WPARAM, LPARAM) SET_UID(mi, 0xd3282acc, 0x9ff1, 0x4ede, 0x8a, 0x1e, 0x36, 0x72, 0x3f, 0x44, 0x4f, 0x84);
mi.position = -2000005000;
mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE | CMIF_HIDDEN;
- mi.name.t = LPGENT("Read status message"); // never seen...
+ mi.name.w = LPGENW("Read status message"); // never seen...
mi.pszService = MS_AWAYMSG_SHOWAWAYMSG;
g_hReadStatMenuItem = Menu_AddContactMenuItem(&mi);
@@ -651,7 +651,7 @@ int MirandaLoaded(WPARAM, LPARAM) memset(&mi, 0, sizeof(mi));
SET_UID(mi, 0xc42a4fdb, 0x51b8, 0x4bbe, 0x83, 0xee, 0x2d, 0x32, 0x29, 0x5c, 0x2, 0xb3);
mi.flags = CMIF_TCHAR | CMIF_HIDDEN;
- mi.name.t = LPGENT("Set status message"); // will never be shown
+ mi.name.w = LPGENW("Set status message"); // will never be shown
mi.position = 1000020000;
mi.hIcolibItem = iconList[8].hIcolib;
mi.pszService = MS_AWAYSYS_SETCONTACTSTATMSG;
@@ -662,7 +662,7 @@ int MirandaLoaded(WPARAM, LPARAM) mi.flags = CMIF_TCHAR;
mi.hIcolibItem = NULL;
mi.position = 1000020000;
- mi.name.t = LPGENT("Autoreply");
+ mi.name.w = LPGENW("Autoreply");
g_hToggleSOEContactMenuItem = Menu_AddContactMenuItem(&mi);
UNSET_UID(mi);
@@ -671,17 +671,17 @@ int MirandaLoaded(WPARAM, LPARAM) mi.position = 1000020000;
mi.hIcolibItem = iconList[1].hIcolib;
- mi.name.t = LPGENT("On");
+ mi.name.w = LPGENW("On");
mi.pszService = MS_AWAYSYS_AUTOREPLY_ON;
g_hAutoreplyOnContactMenuItem = Menu_AddContactMenuItem(&mi);
mi.hIcolibItem = iconList[0].hIcolib;
- mi.name.t = LPGENT("Off");
+ mi.name.w = LPGENW("Off");
mi.pszService = MS_AWAYSYS_AUTOREPLY_OFF;
g_hAutoreplyOffContactMenuItem = Menu_AddContactMenuItem(&mi);
mi.hIcolibItem = iconList[5].hIcolib;
- mi.name.t = LPGENT("Use the default setting");
+ mi.name.w = LPGENW("Use the default setting");
mi.pszService = MS_AWAYSYS_AUTOREPLY_USEDEFAULT;
g_hAutoreplyUseDefaultContactMenuItem = Menu_AddContactMenuItem(&mi);
}
diff --git a/plugins/NewAwaySysMod/src/CString.cpp b/plugins/NewAwaySysMod/src/CString.cpp index ebfefce299..c35e6bbeef 100644 --- a/plugins/NewAwaySysMod/src/CString.cpp +++ b/plugins/NewAwaySysMod/src/CString.cpp @@ -267,7 +267,7 @@ TString<T>& TString<T>::operator = (const T *pStr) return *this;
}
-template class TString<TCHAR>;
+template class TString<wchar_t>;
template class TString<char>;
template class TString<WCHAR>;
@@ -277,13 +277,13 @@ CString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, return CString(p == NULL ? szDefaultValue : p);
}
-TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue)
+TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue)
{
ptrT p( db_get_tsa(hContact, szModule, szSetting));
return TCString(p == NULL ? szDefaultValue : p);
}
-TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue)
+TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue)
{ // also converts numeric values to a string
DBVARIANT dbv = {0};
int iRes = db_get_ws(hContact, szModule, szSetting, &dbv);
diff --git a/plugins/NewAwaySysMod/src/CString.h b/plugins/NewAwaySysMod/src/CString.h index 9218a6459d..decedaaac7 100644 --- a/plugins/NewAwaySysMod/src/CString.h +++ b/plugins/NewAwaySysMod/src/CString.h @@ -20,7 +20,6 @@ #pragma once
#include <windows.h>
-#include <tchar.h>
#include <crtdbg.h>
#ifdef CHARARRAY_CONVERT
#include "TMyArray.h"
@@ -97,7 +96,7 @@ private: };
-typedef TString<TCHAR> TCString;
+typedef TString<wchar_t> TCString;
typedef TString<char> CString;
typedef TString<WCHAR> WCString;
@@ -164,9 +163,9 @@ __inline CHARARRAY WCHAR2UTF8(WCString Str) #undef db_get_s
CString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const char *szDefaultValue);
-TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue);
+TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue);
int db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
-TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue); // also converts numeric values to a string
+TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue); // also converts numeric values to a string
// various string helpers. their return values are valid only while the class is visible
class UTF8Encode
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp index 84c365fbb2..dbee9f8da2 100644 --- a/plugins/NewAwaySysMod/src/Client.cpp +++ b/plugins/NewAwaySysMod/src/Client.cpp @@ -47,7 +47,7 @@ void __cdecl UpdateMsgsThreadProc(void *) }
if (CallProtoService(p->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(Status) && g_ProtoStates[p->szModuleName].CurStatusMsg.GetUpdateTimeDifference() >= MinUpdateTimeDifference) {
TCString CurMsg(GetDynamicStatMsg(INVALID_CONTACT_ID, p->szModuleName));
- if ((TCString)g_ProtoStates[p->szModuleName].CurStatusMsg != (const TCHAR*)CurMsg) { // if the message has changed
+ if ((TCString)g_ProtoStates[p->szModuleName].CurStatusMsg != (const wchar_t*)CurMsg) { // if the message has changed
g_ProtoStates[p->szModuleName].CurStatusMsg = CurMsg;
CallAllowedPS_SETAWAYMSG(p->szModuleName, Status, CurMsg);
}
@@ -179,7 +179,7 @@ TCString VariablesEscape(TCString Str) };
eState State = ST_QUOTE;
TCString Result(L"`");
- const TCHAR *p = Str;
+ const wchar_t *p = Str;
while (*p) {
if (*p == '`') {
if (State == ST_TEXT) {
diff --git a/plugins/NewAwaySysMod/src/ContactList.cpp b/plugins/NewAwaySysMod/src/ContactList.cpp index 1f7d3dd17d..12889aaa21 100644 --- a/plugins/NewAwaySysMod/src/ContactList.cpp +++ b/plugins/NewAwaySysMod/src/ContactList.cpp @@ -393,7 +393,7 @@ HTREEITEM CCList::AddGroup(TCString GroupName) TVINSERTSTRUCT tvIns = { 0 };
tvIns.hParent = TVI_ROOT;
- tvIns.item.pszText = _tcsrchr(GroupName, '\\');
+ tvIns.item.pszText = wcsrchr(GroupName, '\\');
if (tvIns.item.pszText) {
TCString ParentGroupName(L"");
tvIns.hParent = AddGroup(ParentGroupName.DiffCat(GroupName, tvIns.item.pszText));
diff --git a/plugins/NewAwaySysMod/src/GroupCheckbox.cpp b/plugins/NewAwaySysMod/src/GroupCheckbox.cpp index e4d30f9408..913edfe261 100644 --- a/plugins/NewAwaySysMod/src/GroupCheckbox.cpp +++ b/plugins/NewAwaySysMod/src/GroupCheckbox.cpp @@ -94,7 +94,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l }
else {
SIZE size;
- TCHAR *szText = (TCHAR*)_alloca(Len * sizeof(TCHAR));
+ wchar_t *szText = (wchar_t*)_alloca(Len * sizeof(wchar_t));
GetWindowText(hWnd, szText, Len);
GetTextExtentPoint32(hdc, szText, (int)mir_tstrlen(szText), &size);
rcText.right = size.cx;
@@ -274,7 +274,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l rc.left += CG_CHECKBOX_INDENT + CG_CHECKBOX_WIDTH + CG_TEXT_INDENT;
int Len = GetWindowTextLength(hWnd) + 1;
- TCHAR *szTextT = (TCHAR*)_alloca(Len * sizeof(TCHAR));
+ wchar_t *szTextT = (wchar_t*)_alloca(Len * sizeof(wchar_t));
GetWindowText(hWnd, szTextT, Len);
HFONT hOldFont = (HFONT)SelectObject(hdcMem, dat->hFont);
diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp index 5efa887ed5..bb9faf5125 100644 --- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp +++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp @@ -233,7 +233,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) GetDynamicStatMsg(hContact); // it updates VarParseData.Message needed for %extratext% in the format
TCString Reply(*(TCString*)AutoreplyOptData.GetValue(IDC_REPLYDLG_PREFIX));
if (Reply != NULL && ServiceExists(MS_VARS_FORMATSTRING) && !g_SetAwayMsgPage.GetDBValueCopy(IDS_SAWAYMSG_DISABLEVARIABLES)) {
- TCHAR *szResult = variables_parse(Reply, VarParseData.Message, hContact);
+ wchar_t *szResult = variables_parse(Reply, VarParseData.Message, hContact);
if (szResult != NULL) {
Reply = szResult;
mir_free(szResult);
diff --git a/plugins/NewAwaySysMod/src/MsgTree.cpp b/plugins/NewAwaySysMod/src/MsgTree.cpp index 60ec54710c..57720cc77f 100644 --- a/plugins/NewAwaySysMod/src/MsgTree.cpp +++ b/plugins/NewAwaySysMod/src/MsgTree.cpp @@ -302,7 +302,7 @@ LRESULT CALLBACK MsgTreeSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM if (NewMsg.IsEmpty())
NewMsg = L"";
- if (OldTitle != (const TCHAR*)NewTitle || OldMsg != (const TCHAR*)NewMsg) {
+ if (OldTitle != (const wchar_t*)NewTitle || OldMsg != (const wchar_t*)NewMsg) {
// probably it's better to leave nm.ItemOld = NULL, to prevent accidental rewriting of it with old data from an edit control etc.
nm.hdr.code = MTN_SELCHANGED;
nm.hdr.hwndFrom = hWnd;
@@ -571,7 +571,7 @@ void CMsgTree::UpdateItem(int ID) // updates item title, and expanded/collapsed tvi.pszText = NewTitle.GetBuffer(TREEITEMTITLE_MAXLEN);
tvi.cchTextMax = TREEITEMTITLE_MAXLEN;
TreeView_GetItem(hTreeView, &tvi);
- if (TreeItem->Title != (const TCHAR*)tvi.pszText) {
+ if (TreeItem->Title != (const wchar_t*)tvi.pszText) {
TreeCtrl->SetModified(true);
NMMSGTREE nm = { 0 };
nm.ItemNew = TreeItem;
diff --git a/plugins/NewAwaySysMod/src/Notification.cpp b/plugins/NewAwaySysMod/src/Notification.cpp index fdf0b5ebe0..3aaee466f0 100644 --- a/plugins/NewAwaySysMod/src/Notification.cpp +++ b/plugins/NewAwaySysMod/src/Notification.cpp @@ -21,7 +21,7 @@ #include "Path.h"
#include "Properties.h"
-void ShowMsg(TCHAR *FirstLine, TCHAR *SecondLine, bool IsErrorMsg, int Timeout)
+void ShowMsg(wchar_t *FirstLine, wchar_t *SecondLine, bool IsErrorMsg, int Timeout)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
POPUPDATAT ppd = { 0 };
@@ -53,7 +53,7 @@ static int CALLBACK MenuWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar static VOID CALLBACK ShowContactMenu(MCONTACT hContact)
{
POINT pt;
- HWND hMenuWnd = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", _T(MOD_NAME)L"_MenuWindow", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, g_hInstance, NULL);
+ HWND hMenuWnd = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", MOD_NAMEW L"_MenuWindow", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, g_hInstance, NULL);
SetWindowLongPtr(hMenuWnd, GWLP_WNDPROC, (LONG_PTR)MenuWndProc);
HMENU hMenu = Menu_BuildContactMenu(hContact);
GetCursorPos(&pt);
@@ -68,7 +68,7 @@ void ShowLog(TCString &LogFilePath) {
INT_PTR Result = (INT_PTR)ShellExecute(NULL, L"open", LogFilePath, NULL, NULL, SW_SHOW);
if (Result <= 32) {
- TCHAR szError[64];
+ wchar_t szError[64];
mir_sntprintf(szError, TranslateT("Error #%d"), Result);
ShowMsg(szError, TranslateT("Can't open log file ") + LogFilePath, true);
}
diff --git a/plugins/NewAwaySysMod/src/Options.cpp b/plugins/NewAwaySysMod/src/Options.cpp index aea2556676..62463ea611 100644 --- a/plugins/NewAwaySysMod/src/Options.cpp +++ b/plugins/NewAwaySysMod/src/Options.cpp @@ -286,7 +286,7 @@ int TreeReadEnum(const char *szSetting, LPARAM lParam) pItem.Title = db_get_s(NULL, pData->sModule, *pData->sDBSettingPrefix + szSetting, L"");
pItem.User_Str1 = (pData->TreeCtrl->User_Str1_DBName == NULL) ? NULL :
db_get_s(NULL, pData->sModule,
- *pData->sDBSettingPrefix + pData->TreeCtrl->sDBSetting + pData->TreeCtrl->User_Str1_DBName + (szSetting + Len), (TCHAR*)NULL);
+ *pData->sDBSettingPrefix + pData->TreeCtrl->sDBSetting + pData->TreeCtrl->User_Str1_DBName + (szSetting + Len), (wchar_t*)NULL);
}
}
return 0;
@@ -722,7 +722,7 @@ void COptItem_ListCtrl::MemToWnd(HWND hWnd) SendMessage(hListView, LB_RESETCONTENT, 0, 0);
for (int i = 0; i < m_value.GetSize(); i++)
- SendMessage(hListView, LB_INSERTSTRING, -1, (LPARAM)(TCHAR*)m_value[i].Text);
+ SendMessage(hListView, LB_INSERTSTRING, -1, (LPARAM)(wchar_t*)m_value[i].Text);
SendMessage(hListView, WM_SETREDRAW, true, 0);
COptItem::MemToWnd(hWnd);
@@ -794,7 +794,7 @@ void COptItem_ListCtrl::ModifyItem(HWND hWnd, int ID, CListItem &Item) int TopIndex = SendMessage(hListView, LB_GETTOPINDEX, 0, 0);
int Res = SendMessage(hListView, LB_DELETESTRING, ID, 0);
_ASSERT(Res != LB_ERR);
- Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(TCHAR*)(Item.Text));
+ Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(wchar_t*)(Item.Text));
_ASSERT(Res != LB_ERR && Res != LB_ERRSPACE);
SendMessage(hListView, LB_SETCURSEL, CurSel, 0);
SendMessage(hListView, LB_SETTOPINDEX, TopIndex, 0);
@@ -808,7 +808,7 @@ CListItem* COptItem_ListCtrl::InsertItem(HWND hWnd, int ID, CListItem &Item) // ID is position at which to insert the item; -1 = add to the end of the list
{
HWND hListView = GetDlgItem(hWnd, m_dlgItemID);
- int Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(TCHAR*)(Item.Text)); // LB_INSERTSTRING doesn't sort the lists even with LBS_SORT style
+ int Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(wchar_t*)(Item.Text)); // LB_INSERTSTRING doesn't sort the lists even with LBS_SORT style
_ASSERT(Res != LB_ERR && Res != LB_ERRSPACE);
int i = m_value.AddElem(Item);
m_bModified = true;
diff --git a/plugins/NewAwaySysMod/src/Options.h b/plugins/NewAwaySysMod/src/Options.h index b22a0b902b..aac3e9d1c0 100644 --- a/plugins/NewAwaySysMod/src/Options.h +++ b/plugins/NewAwaySysMod/src/Options.h @@ -92,7 +92,7 @@ class COptItem_Edit : public COptItem {
public:
COptItem_Edit() {}
- COptItem_Edit(int m_dlgItemID, char *szDBSetting, int nMaxLen, TCHAR *szDefValue, int lParam = 0, bool m_bReadOnly = false)
+ COptItem_Edit(int m_dlgItemID, char *szDBSetting, int nMaxLen, wchar_t *szDefValue, int lParam = 0, bool m_bReadOnly = false)
: COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue)
{}
@@ -323,7 +323,7 @@ class COptItem_StrDBSetting : public COptItem {
public:
COptItem_StrDBSetting() {}
- COptItem_StrDBSetting(int m_dlgItemID, char *szDBSetting, int nMaxLen, TCHAR *szDefValue, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue) {}
+ COptItem_StrDBSetting(int m_dlgItemID, char *szDBSetting, int nMaxLen, wchar_t *szDefValue, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue) {}
void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { sValue = GetStrDBVal(sModule, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetStrDBVal(sModule, sValue, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { COptItem::WndToMem(hWnd); }
diff --git a/plugins/NewAwaySysMod/src/Properties.cpp b/plugins/NewAwaySysMod/src/Properties.cpp index 8056306df5..6e1914257c 100644 --- a/plugins/NewAwaySysMod/src/Properties.cpp +++ b/plugins/NewAwaySysMod/src/Properties.cpp @@ -109,7 +109,7 @@ void CContactSettings::SetMsgFormat(int Flags, TCString Message) if (Flags & SMF_PERSONAL) { // set a personal message for a contact. also it's used to set global status message (hContact = NULL).
// if Message == NULL, then the function deletes the message.
CString DBSetting(StatusToDBSetting(Status, DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPERSONAL));
- if (g_AutoreplyOptPage.GetDBValueCopy(IDC_REPLYDLG_RESETCOUNTERWHENSAMEICON) && GetMsgFormat(SMF_PERSONAL) != (const TCHAR*)Message)
+ if (g_AutoreplyOptPage.GetDBValueCopy(IDC_REPLYDLG_RESETCOUNTERWHENSAMEICON) && GetMsgFormat(SMF_PERSONAL) != (const wchar_t*)Message)
ResetContactSettingsOnStatusChange(m_hContact);
if (Message != NULL)
@@ -135,7 +135,7 @@ TCString CContactSettings::GetMsgFormat(int Flags, int *pOrder, char *szProtoOve *pOrder = -1;
if (Flags & GMF_PERSONAL) // try getting personal message (it overrides global)
- Message = db_get_s(m_hContact, MOD_NAME, StatusToDBSetting(Status, DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPERSONAL), (TCHAR*)NULL);
+ Message = db_get_s(m_hContact, MOD_NAME, StatusToDBSetting(Status, DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPERSONAL), (wchar_t*)NULL);
if (Flags & (GMF_LASTORDEFAULT | GMF_PROTOORGLOBAL | GMF_TEMPORARY) && Message.IsEmpty()) {
char *szProto = szProtoOverride ? szProtoOverride : (m_hContact ? GetContactProto(m_hContact) : NULL);
@@ -154,7 +154,7 @@ TCString CContactSettings::GetMsgFormat(int Flags, int *pOrder, char *szProtoOve void CProtoSettings::SetMsgFormat(int Flags, TCString Message)
{
- if (Flags & (SMF_TEMPORARY | SMF_PERSONAL) && g_AutoreplyOptPage.GetDBValueCopy(IDC_REPLYDLG_RESETCOUNTERWHENSAMEICON) && GetMsgFormat(Flags & (SMF_TEMPORARY | SMF_PERSONAL)) != (const TCHAR*)Message)
+ if (Flags & (SMF_TEMPORARY | SMF_PERSONAL) && g_AutoreplyOptPage.GetDBValueCopy(IDC_REPLYDLG_RESETCOUNTERWHENSAMEICON) && GetMsgFormat(Flags & (SMF_TEMPORARY | SMF_PERSONAL)) != (const wchar_t*)Message)
ResetSettingsOnStatusChange(szProto);
if (Flags & SMF_TEMPORARY) {
@@ -190,7 +190,7 @@ void CProtoSettings::SetMsgFormat(int Flags, TCString Message) // or at least if we'll find an identical message somewhere else, then we'll use its title for our new message
TCString Title(L"");
for (i = 0; i < TreeCtrl->m_value.GetSize(); i++) {
- if (!(TreeCtrl->m_value[i].Flags & TIF_GROUP) && TreeCtrl->m_value[i].User_Str1 == (const TCHAR*)Message) {
+ if (!(TreeCtrl->m_value[i].Flags & TIF_GROUP) && TreeCtrl->m_value[i].User_Str1 == (const wchar_t*)Message) {
if (TreeCtrl->m_value[i].ParentID == RecentGroupID) { // found it in the same group
int GroupOrder = TreeCtrl->IDToOrder(RecentGroupID);
TreeCtrl->m_value.MoveElem(i, (GroupOrder >= 0) ? (GroupOrder + 1) : 0); // now move it to the top of recent messages list
@@ -208,9 +208,9 @@ void CProtoSettings::SetMsgFormat(int Flags, TCString Message) else
Title = Message;
- TCHAR *p = Title.GetBuffer();
+ wchar_t *p = Title.GetBuffer();
while (*p) { // remove "garbage"
- if (!(p = _tcspbrk(p, L"\r\n\t")))
+ if (!(p = wcspbrk(p, L"\r\n\t")))
break;
*p++ = ' ';
@@ -266,7 +266,7 @@ TCString CProtoSettings::GetMsgFormat(int Flags, int *pOrder) }
}
if (Flags & GMF_PERSONAL && Message == NULL) // try getting personal message (it overrides global)
- Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (TCHAR*)NULL);
+ Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (wchar_t*)NULL);
if (Flags & GMF_PROTOORGLOBAL && Message == NULL) {
Message = CProtoSettings().GetMsgFormat(GMF_PERSONAL | (Flags & GMF_TEMPORARY), pOrder);
@@ -279,7 +279,7 @@ TCString CProtoSettings::GetMsgFormat(int Flags, int *pOrder) TreeCtrl->DBToMem(CString(MOD_NAME));
Message = NULL;
if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_USELASTMSG)) { // if using last message by default...
- Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (TCHAR*)NULL); // try per-protocol message first
+ Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (wchar_t*)NULL); // try per-protocol message first
if (Message.IsEmpty()) {
Message = NULL; // to be sure it's NULL, not "" - as we're checking 'Message == NULL' later
int RecentGroupID = GetRecentGroupID(Status);
diff --git a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp index a095882f72..bc8398e62e 100644 --- a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp @@ -62,10 +62,10 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam awayData->hSeq = (HANDLE)ProtoChainSend(awayData->hContact, PSS_GETAWAYMSG, 0, 0);
WindowList_Add(g_hReadWndList, hwndDlg, awayData->hContact);
- TCHAR str[256], format[128];
- TCHAR *contactName = pcli->pfnGetContactDisplayName(awayData->hContact, 0);
+ wchar_t str[256], format[128];
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(awayData->hContact, 0);
char *szProto = GetContactProto(awayData->hContact);
- TCHAR *status = pcli->pfnGetStatusModeDescription(db_get_w(awayData->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
+ wchar_t *status = pcli->pfnGetStatusModeDescription(db_get_w(awayData->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
GetWindowText(hwndDlg, format, _countof(format));
mir_sntprintf(str, format, status, contactName);
SetWindowText(hwndDlg, str);
@@ -88,7 +88,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam UnhookEvent(awayData->hAwayMsgEvent);
awayData->hAwayMsgEvent = NULL;
}
- const TCHAR *ptszStatusMsg = (const TCHAR*)ack->lParam;
+ const wchar_t *ptszStatusMsg = (const wchar_t*)ack->lParam;
SetDlgItemText(hwndDlg, IDC_READAWAYMSG_MSG, ptszStatusMsg);
ShowWindow(GetDlgItem(hwndDlg, IDC_READAWAYMSG_RETRIEVE), SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDC_READAWAYMSG_MSG), SW_SHOW);
diff --git a/plugins/NewAwaySysMod/src/Services.cpp b/plugins/NewAwaySysMod/src/Services.cpp index 46399f0b97..f961e23d84 100644 --- a/plugins/NewAwaySysMod/src/Services.cpp +++ b/plugins/NewAwaySysMod/src/Services.cpp @@ -29,7 +29,7 @@ struct NAS_PROTOINFOv1 union {
char *szMsg;
WCHAR *wszMsg;
- TCHAR *tszMsg;
+ wchar_t *tszMsg;
};
WORD status;
};
@@ -68,7 +68,7 @@ INT_PTR SetStatusMode(WPARAM wParam, LPARAM lParam) // called by GamerStatus and _ASSERT(!g_fNoProcessing && g_ProtoStates[(char*)NULL].m_status == wParam);
g_fNoProcessing = false;
- CProtoSettings(NULL, wParam).SetMsgFormat(SMF_TEMPORARY, lParam ? (TCHAR*)_A2T((char*)lParam) : CProtoSettings(NULL, wParam).GetMsgFormat(GMF_LASTORDEFAULT));
+ CProtoSettings(NULL, wParam).SetMsgFormat(SMF_TEMPORARY, lParam ? (wchar_t*)_A2T((char*)lParam) : CProtoSettings(NULL, wParam).GetMsgFormat(GMF_LASTORDEFAULT));
ChangeProtoMessages(NULL, wParam, TCString());
return 0;
}
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index 6d124b2157..9d0346a124 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -78,9 +78,9 @@ static LRESULT CALLBACK MsgEditSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, SendMessage(hWnd, WM_KEYDOWN, VK_LEFT, 0);
SendMessage(hWnd, EM_GETSEL, (WPARAM)&start, NULL);
int nLen = GetWindowTextLength(hWnd);
- TCHAR *text = (TCHAR*)_alloca((nLen + 1) * sizeof(TCHAR));
+ wchar_t *text = (wchar_t*)_alloca((nLen + 1) * sizeof(wchar_t));
GetWindowText(hWnd, text, nLen + 1);
- memmove(text + start, text + end, sizeof(TCHAR)* (mir_tstrlen(text) + 1 - end));
+ memmove(text + start, text + end, sizeof(wchar_t)* (mir_tstrlen(text) + 1 - end));
SetWindowText(hWnd, text);
SendMessage(hWnd, EM_SETSEL, start, start);
@@ -439,24 +439,24 @@ HICON g_LoadIconEx(const char* name, bool big) struct {
int DlgItem, IconIndex;
- TCHAR* Text;
+ wchar_t* Text;
}
static Buttons[] =
{
- { IDC_SAWAYMSG_SAVEMSG, ILI_SAVE, LPGENT("Save, replacing the selected message") },
- { IDC_SAWAYMSG_SAVEASNEW, ILI_SAVEASNEW, LPGENT("Save as a new message") },
- { IDC_SAWAYMSG_NEWCATEGORY, ILI_NEWCATEGORY, LPGENT("Create new category") },
- { IDC_SAWAYMSG_DELETE, ILI_DELETE, LPGENT("Delete") },
- { IDC_SAWAYMSG_VARS, ILI_NOICON, LPGENT("Open Variables help dialog") },
- { IDC_SAWAYMSG_OPTIONS, ILI_SETTINGS, LPGENT("Show settings menu") }
+ { IDC_SAWAYMSG_SAVEMSG, ILI_SAVE, LPGENW("Save, replacing the selected message") },
+ { IDC_SAWAYMSG_SAVEASNEW, ILI_SAVEASNEW, LPGENW("Save as a new message") },
+ { IDC_SAWAYMSG_NEWCATEGORY, ILI_NEWCATEGORY, LPGENW("Create new category") },
+ { IDC_SAWAYMSG_DELETE, ILI_DELETE, LPGENW("Delete") },
+ { IDC_SAWAYMSG_VARS, ILI_NOICON, LPGENW("Open Variables help dialog") },
+ { IDC_SAWAYMSG_OPTIONS, ILI_SETTINGS, LPGENW("Show settings menu") }
};
struct {
int m_dlgItemID;
- TCHAR* Text;
+ wchar_t* Text;
} Tooltips[] = {
- IDC_SAWAYMSG_IGNOREREQ, LPGENT("Don't send the status message to selected contact(s)"),
- IDC_SAWAYMSG_SENDMSG, LPGENT("Send an autoreply to selected contact(s)"),
+ IDC_SAWAYMSG_IGNOREREQ, LPGENW("Don't send the status message to selected contact(s)"),
+ IDC_SAWAYMSG_SENDMSG, LPGENW("Send an autoreply to selected contact(s)"),
};
INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -727,7 +727,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (Message == NULL)
Message = CurMessage;
- else if (CurMessage != (const TCHAR*)Message) {
+ else if (CurMessage != (const wchar_t*)Message) {
Message = L"";
BtnTitle = TranslateT("Apply");
MessageDetermined = true;
@@ -842,7 +842,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA SendMessage(hwndDlg, UM_SAM_APPLYANDCLOSE, 0, 0);
return true;
}
- TCHAR BtnTitle[64];
+ wchar_t BtnTitle[64];
mir_sntprintf(BtnTitle, TranslateT("Closing in %d"), Countdown);
SetDlgItemText(hwndDlg, IDC_OK, BtnTitle);
Countdown--;
@@ -1016,7 +1016,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA switch (HIWORD(wParam)) {
case EN_CHANGE:
if (LOWORD(wParam) == IDC_SAWAYMSG_MSGDATA)
- SetDlgItemText(hwndDlg, IDC_OK, TranslateTS((GetSelContactsNum(CList) > 1) ? LPGENT("Apply") : LPGENT("OK")));
+ SetDlgItemText(hwndDlg, IDC_OK, TranslateTS((GetSelContactsNum(CList) > 1) ? LPGENW("Apply") : LPGENW("OK")));
break;
case EN_KILLFOCUS:
@@ -1127,7 +1127,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA TCString NewMsg;
GetDlgItemText(hwndDlg, IDC_SAWAYMSG_MSGDATA, NewMsg.GetBuffer(AWAY_MSGDATA_MAX), AWAY_MSGDATA_MAX);
NewMsg.ReleaseBuffer();
- if (((CTreeItem*)TreeItem)->User_Str1 != (const TCHAR*)NewMsg) {
+ if (((CTreeItem*)TreeItem)->User_Str1 != (const wchar_t*)NewMsg) {
((CTreeItem*)TreeItem)->User_Str1 = NewMsg;
MsgTree->SetModified(true);
}
@@ -1166,7 +1166,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA GetDlgItemText(hwndDlg, IDC_OK, BtnTitle.GetBuffer(64), 64);
BtnTitle.ReleaseBuffer();
ApplySelContactsMessage(dat, CList);
- if (BtnTitle != (const TCHAR*)TranslateT("Apply"))
+ if (BtnTitle != (const wchar_t*)TranslateT("Apply"))
SendMessage(hwndDlg, UM_SAM_APPLYANDCLOSE, 0, 0);
}
}
diff --git a/plugins/NewAwaySysMod/src/stdafx.h b/plugins/NewAwaySysMod/src/stdafx.h index d22135d6a1..1c2966b9be 100644 --- a/plugins/NewAwaySysMod/src/stdafx.h +++ b/plugins/NewAwaySysMod/src/stdafx.h @@ -34,7 +34,6 @@ #include <time.h>
#include <shellapi.h>
#include <crtdbg.h>
-#include <tchar.h>
#include <stdarg.h>
#include "newpluginapi.h"
@@ -137,13 +136,15 @@ #define WRITE_INTERPRET 4
#define WRITE_CMSG 8
-#define TOGGLE_SOE_COMMAND LPGENT("Toggle autoreply on/off")
-#define DISABLE_SOE_COMMAND LPGENT("Toggle autoreply off")
-#define ENABLE_SOE_COMMAND LPGENT("Toggle autoreply on")
+#define TOGGLE_SOE_COMMAND LPGENW("Toggle autoreply on/off")
+#define DISABLE_SOE_COMMAND LPGENW("Toggle autoreply off")
+#define ENABLE_SOE_COMMAND LPGENW("Toggle autoreply on")
#define STR_XSTATUSDESC TranslateT("extended status")
#define MOD_NAME "NewAwaySys"
+#define MOD_NAMEW L"NewAwaySys"
+
#define LOG_ID MOD_NAME // LogService log ID
#define LOG_PREFIX MOD_NAME ": " // netlib.log prefix for all NAS' messages
@@ -198,7 +199,7 @@ #define VPF_XSTATUS 1 // use "extended status" instead of the usual status description in %nas_statdesc%, and XStatus message in %nas_message%
// options dialog
-#define OPT_TITLE LPGENT("Away System")
+#define OPT_TITLE LPGENW("Away System")
#define OPT_MAINGROUP LPGEN("Status")
#define OPT_POPUPGROUP LPGEN("Popups")
@@ -300,7 +301,7 @@ void InitOptions(); // called once when plugin is loaded //int ShowPopupNotification(COptPage &PopupNotifyData, MCONTACT hContact, int iStatusMode);
void ShowLog(TCString &LogFilePath);
-void ShowMsg(TCHAR *szFirstLine, TCHAR *szSecondLine = L"", bool IsErrorMsg = false, int Timeout = 0);
+void ShowMsg(wchar_t *szFirstLine, wchar_t *szSecondLine = L"", bool IsErrorMsg = false, int Timeout = 0);
#define AWAYSYS_STATUSMSGREQUEST_SOUND "AwaySysStatusMsgRequest"
#define ME_AWAYSYS_WORKAROUND "AwaySys/_CallService"
@@ -323,7 +324,7 @@ static __inline int LogMessage(const char *Format, ...) return CallService(MS_NETLIB_LOG, NULL, (LPARAM)szText);
}
-__inline int CallAllowedPS_SETAWAYMSG(const char *szProto, int iMode, const TCHAR *szMsg)
+__inline int CallAllowedPS_SETAWAYMSG(const char *szProto, int iMode, const wchar_t *szMsg)
{ // we must use this function everywhere we want to call PS_SETAWAYMSG, otherwise NAS won't allow to change the message!
LogMessage("PS_SETAWAYMSG called by NAS. szProto=%s, Status=%d, Msg:\n%S", szProto, iMode, szMsg ? szMsg : L"NULL");
return CallProtoService(szProto, PS_SETAWAYMSG, iMode, (LPARAM)szMsg);
diff --git a/plugins/NewEventNotify/src/menuitem.cpp b/plugins/NewEventNotify/src/menuitem.cpp index 9b4b74abc1..8f32bb2949 100644 --- a/plugins/NewEventNotify/src/menuitem.cpp +++ b/plugins/NewEventNotify/src/menuitem.cpp @@ -50,7 +50,7 @@ int MenuitemInit(BOOL bStatus) {
CreateServiceFunction(MS_NEN_MENUNOTIFY, MenuitemNotifyCmd);
- HGENMENU hRoot = Menu_CreateRoot(MO_MAIN, LPGENT("Popups"), 0);
+ HGENMENU hRoot = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 0);
CMenuItem mi;
SET_UID(mi, 0x7aed93f7, 0x835, 0x4ff6, 0xb1, 0x34, 0xae, 0x0, 0x21, 0x2a, 0xd7, 0x81);
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp index 2202d1de62..41b792d5c6 100644 --- a/plugins/NewEventNotify/src/popup.cpp +++ b/plugins/NewEventNotify/src/popup.cpp @@ -168,10 +168,10 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA return DefWindowProc(hWnd, message, wParam, lParam);
}
-static TCHAR* GetEventPreview(DBEVENTINFO *dbei)
+static wchar_t* GetEventPreview(DBEVENTINFO *dbei)
{
- TCHAR *comment1 = NULL;
- TCHAR *comment2 = NULL;
+ wchar_t *comment1 = NULL;
+ wchar_t *comment2 = NULL;
char *commentFix = NULL;
//now get text
@@ -182,9 +182,9 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) // utf-8 in blob
comment1 = mir_utf8decodeT((char*)dbei->pBlob);
}
- else if (dbei->cbBlob == (mir_tstrlen((TCHAR *)dbei->pBlob)+1)*(sizeof(TCHAR)+1)) {
+ else if (dbei->cbBlob == (mir_tstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
// wchar in blob (the old hack)
- comment1 = mir_tstrdup((TCHAR*)dbei->pBlob);
+ comment1 = mir_tstrdup((wchar_t*)dbei->pBlob);
}
else comment1 = mir_a2t((char *)dbei->pBlob);
}
@@ -220,7 +220,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) char* pcBlob = (char *)dbei->pBlob;
char* pcEnd = (char *)(dbei->pBlob + dbei->cbBlob);
int nContacts;
- TCHAR szBuf[512];
+ wchar_t szBuf[512];
for (nContacts = 1; ; nContacts++) {
// Nick
@@ -247,8 +247,8 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) case EVENTTYPE_ADDED:
if (dbei->pBlob) {
char szUin[16];
- TCHAR szBuf[2048];
- TCHAR* szNick = NULL;
+ wchar_t szBuf[2048];
+ wchar_t* szNick = NULL;
char *pszNick = (char *)dbei->pBlob + 8;
char *pszFirst = pszNick + mir_strlen(pszNick) + 1;
char *pszLast = pszFirst + mir_strlen(pszFirst) + 1;
@@ -283,8 +283,8 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) case EVENTTYPE_AUTHREQUEST:
if (dbei->pBlob) {
char szUin[16];
- TCHAR szBuf[2048];
- TCHAR* szNick = NULL;
+ wchar_t szBuf[2048];
+ wchar_t* szNick = NULL;
char *pszNick = (char *)dbei->pBlob + 8;
char *pszFirst = pszNick + mir_strlen(pszNick) + 1;
char *pszLast = pszFirst + mir_strlen(pszFirst) + 1;
@@ -342,9 +342,9 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) // utf-8 in blob
comment1 = mir_utf8decodeT((char*)dbei->pBlob);
}
- else if (dbei->cbBlob == (mir_tstrlen((TCHAR *)dbei->pBlob)+1)*(sizeof(TCHAR)+1)) {
+ else if (dbei->cbBlob == (mir_tstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
// wchar in blob (the old hack)
- comment1 = mir_tstrdup((TCHAR*)dbei->pBlob);
+ comment1 = mir_tstrdup((wchar_t*)dbei->pBlob);
}
else comment1 = mir_a2t((char *)dbei->pBlob);
}
@@ -359,9 +359,9 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) // utf-8 in blob
comment1 = mir_utf8decodeT((char*)dbei->pBlob);
}
- else if (dbei->cbBlob == (mir_tstrlen((TCHAR *)dbei->pBlob)+1)*(sizeof(TCHAR)+1)) {
+ else if (dbei->cbBlob == (mir_tstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
// wchar in blob (the old hack)
- comment1 = mir_tstrdup((TCHAR*)dbei->pBlob);
+ comment1 = mir_tstrdup((wchar_t*)dbei->pBlob);
}
else comment1 = mir_a2t((char *)dbei->pBlob);
}
@@ -374,7 +374,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) // support for custom database event types
if (pei && dbei->pBlob) {
DBEVENTGETTEXT svc = {dbei, DBVT_TCHAR, CP_ACP};
- TCHAR *pet = (TCHAR*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&svc);
+ wchar_t *pet = (wchar_t*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&svc);
if (pet) {
// we've got event text, move to our memory space
comment1 = mir_tstrdup(pet);
@@ -402,7 +402,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, MEVENT hEvent, UINT eventType)
{
- TCHAR* sampleEvent;
+ wchar_t* sampleEvent;
long iSeconds;
//there has to be a maximum number of popups shown at the same time
@@ -490,12 +490,12 @@ int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, MEVENT hEvent, U // if hContact is NULL, && hEvent is NULL then popup is only Test
if ((hContact == NULL) && (hEvent == NULL)) {
- _tcsncpy(pudw.lptzContactName, TranslateT("Plugin Test"), MAX_CONTACTNAME);
- _tcsncpy(pudw.lptzText, TranslateTS(sampleEvent), MAX_SECONDLINE);
+ wcsncpy(pudw.lptzContactName, TranslateT("Plugin Test"), MAX_CONTACTNAME);
+ wcsncpy(pudw.lptzText, TranslateTS(sampleEvent), MAX_SECONDLINE);
}
else { // get the needed event data
- _tcsncpy(pudw.lptzContactName, (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
- _tcsncpy(pudw.lptzText, ptrT(GetEventPreview(&dbe)), MAX_SECONDLINE);
+ wcsncpy(pudw.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
+ wcsncpy(pudw.lptzText, ptrT(GetEventPreview(&dbe)), MAX_SECONDLINE);
}
PopupCount++;
@@ -538,7 +538,7 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent) SetTimer(pdata->hWnd, TIMER_TO_ACTION, pdata->iSeconds * 1000, NULL);
}
- TCHAR lpzText[MAX_SECONDLINE*2] = L"\0\0";
+ wchar_t lpzText[MAX_SECONDLINE*2] = L"\0\0";
if (pdata->pluginOptions->bShowHeaders)
mir_sntprintf(lpzText, TranslateT("[b]Number of new message(s): %d[/b]\n"), pdata->countEvent);
@@ -570,19 +570,19 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent) db_event_get(eventData->hEvent, &dbe);
if (pdata->pluginOptions->bShowDate || pdata->pluginOptions->bShowTime) {
- TCHAR timestamp[MAX_DATASIZE];
- TCHAR formatTime[MAX_DATASIZE];
+ wchar_t timestamp[MAX_DATASIZE];
+ wchar_t formatTime[MAX_DATASIZE];
if (pdata->pluginOptions->bShowDate)
- _tcsncpy(formatTime, L"%Y.%m.%d", _countof(formatTime));
+ wcsncpy(formatTime, L"%Y.%m.%d", _countof(formatTime));
else if (pdata->pluginOptions->bShowTime)
mir_tstrncat(formatTime, L" %H:%M", _countof(formatTime) - mir_tstrlen(formatTime));
time_t localTime = dbe.timestamp;
- _tcsftime(timestamp, _countof(timestamp), formatTime, localtime(&localTime));
+ wcsftime(timestamp, _countof(timestamp), formatTime, localtime(&localTime));
mir_sntprintf(lpzText, L"%s[b][i]%s[/i][/b]\n", lpzText, timestamp);
}
// prepare event preview
- TCHAR* szEventPreview = GetEventPreview(&dbe);
+ wchar_t* szEventPreview = GetEventPreview(&dbe);
mir_sntprintf(lpzText, L"%s%s", lpzText, szEventPreview);
mir_free(szEventPreview);
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index d43a0677fb..ee0aae304d 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -23,7 +23,7 @@ void PreviewSound(HWND hList)
{
- TCHAR buff[MAX_PATH], stzSoundPath[MAX_PATH];
+ wchar_t buff[MAX_PATH], stzSoundPath[MAX_PATH];
LVITEM lvi = { 0 };
lvi.mask = LVIF_PARAM;
@@ -33,7 +33,7 @@ void PreviewSound(HWND hList) int hlpStatus = lvi.lParam;
ListView_GetItemText(hList, lvi.iItem, 1, buff, _countof(buff));
- if (!mir_tstrcmp(buff, TranslateT(DEFAULT_SOUND))) {
+ if (!mir_tstrcmp(buff, TranslateTS(DEFAULT_SOUND))) {
if (hlpStatus < ID_STATUS_MIN)
SkinPlaySound(StatusListEx[hlpStatus].lpzSkinSoundName);
else
@@ -51,26 +51,26 @@ BOOL RemoveSoundFromList(HWND hList) if (iSel != -1) {
iSel = -1;
while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
- ListView_SetItemText(hList, iSel, 1, TranslateT(DEFAULT_SOUND));
+ ListView_SetItemText(hList, iSel, 1, TranslateTS(DEFAULT_SOUND));
return TRUE;
}
return FALSE;
}
-TCHAR *SelectSound(HWND hwndDlg, TCHAR *buff, size_t bufflen)
+wchar_t *SelectSound(HWND hwndDlg, wchar_t *buff, size_t bufflen)
{
OPENFILENAME ofn = { 0 };
HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST);
ListView_GetItemText(hList, ListView_GetNextItem(hList, -1, LVNI_SELECTED), 1, buff, (DWORD)bufflen);
- if (!mir_tstrcmp(buff, TranslateT(DEFAULT_SOUND)))
+ if (!mir_tstrcmp(buff, TranslateTS(DEFAULT_SOUND)))
buff = NULL;
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = GetParent(hwndDlg);
ofn.hInstance = hInst;
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
if (GetModuleHandle(L"bass_interface.dll"))
mir_sntprintf(filter, L"%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%s (*.*)%c*%c", TranslateT("Sound files"), 0, 0, TranslateT("All files"), 0, 0);
else
@@ -132,7 +132,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (szProto) {
DBVARIANT dbv;
- TCHAR buff[MAX_PATH];
+ wchar_t buff[MAX_PATH];
for (int i = ID_STATUS_MAX; i >= ID_STATUS_MIN; i--) {
int flags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_2, 0);
@@ -153,8 +153,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA mir_tstrcpy(buff, dbv.ptszVal);
db_free(&dbv);
}
- else
- mir_tstrcpy(buff, TranslateT(DEFAULT_SOUND));
+ else mir_tstrcpy(buff, TranslateTS(DEFAULT_SOUND));
ListView_SetItemText(hList, lvi.iItem, 1, buff);
}
@@ -171,11 +170,10 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA lvi.iItem = ListView_InsertItem(hList, &lvi);
if (!db_get_ts(hContact, MODULE, StatusList[i].lpzSkinSoundName, &dbv)) {
- _tcsncpy(buff, dbv.ptszVal, _countof(buff)-1);
+ wcsncpy(buff, dbv.ptszVal, _countof(buff)-1);
db_free(&dbv);
}
- else
- _tcsncpy(buff, TranslateT(DEFAULT_SOUND), _countof(buff)-1);
+ else wcsncpy(buff, TranslateTS(DEFAULT_SOUND), _countof(buff)-1);
ListView_SetItemText(hList, lvi.iItem, 1, buff);
}
@@ -202,7 +200,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA {
int iSel = ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_INDSNDLIST), -1, LVNI_SELECTED);
if (iSel != -1) {
- TCHAR stzFilePath[MAX_PATH];
+ wchar_t stzFilePath[MAX_PATH];
if (SelectSound(hwndDlg, stzFilePath, MAX_PATH - 1) != NULL) {
iSel = -1;
while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
@@ -229,7 +227,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- TCHAR buff[MAX_PATH];
+ wchar_t buff[MAX_PATH];
LVITEM lvi = { 0 };
lvi.mask = LVIF_PARAM;
@@ -238,14 +236,14 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ListView_GetItem(hList, &lvi);
ListView_GetItemText(hList, lvi.iItem, 1, buff, _countof(buff));
- if (!mir_tstrcmp(buff, TranslateT(DEFAULT_SOUND))) {
+ if (!mir_tstrcmp(buff, TranslateTS(DEFAULT_SOUND))) {
if (lvi.lParam < ID_STATUS_MIN)
db_unset(hContact, MODULE, StatusListEx[lvi.lParam].lpzSkinSoundName);
else
db_unset(hContact, MODULE, StatusList[Index(lvi.lParam)].lpzSkinSoundName);
}
else {
- TCHAR stzSoundPath[MAX_PATH] = { 0 };
+ wchar_t stzSoundPath[MAX_PATH] = { 0 };
PathToRelativeT(buff, stzSoundPath);
if (lvi.lParam < ID_STATUS_MIN)
db_set_ws(hContact, MODULE, StatusListEx[lvi.lParam].lpzSkinSoundName, stzSoundPath);
@@ -261,7 +259,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA switch (hlpControlID) {
case IDC_INDSNDLIST:
if (((LPNMHDR)lParam)->code == NM_DBLCLK) {
- TCHAR stzFilePath[MAX_PATH];
+ wchar_t stzFilePath[MAX_PATH];
if (SelectSound(hwndDlg, stzFilePath, MAX_PATH - 1) != NULL) {
int iSel = -1;
while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
diff --git a/plugins/NewXstatusNotify/src/indsnd.h b/plugins/NewXstatusNotify/src/indsnd.h index e3d0245e4a..784f107018 100644 --- a/plugins/NewXstatusNotify/src/indsnd.h +++ b/plugins/NewXstatusNotify/src/indsnd.h @@ -34,7 +34,7 @@ #define STATUS_COLUMN 110
-#define DEFAULT_SOUND LPGEN("(default sound)")
+#define DEFAULT_SOUND LPGENW("(default sound)")
int UserInfoInitialise(WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgProcFiltering(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index fbf5aac0a4..db07011b5c 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -182,16 +182,16 @@ static int CompareStatusMsg(STATUSMSGINFO *smi, DBCONTACTWRITESETTING *cws_new, return ret;
}
-TCHAR* GetStr(STATUSMSGINFO *n, const TCHAR *tmplt)
+wchar_t* GetStr(STATUSMSGINFO *n, const wchar_t *tmplt)
{
- if (n == NULL || tmplt == NULL || tmplt[0] == _T('\0'))
+ if (n == NULL || tmplt == NULL || tmplt[0] == '\0')
return NULL;
CMString res;
size_t len = mir_tstrlen(tmplt);
for (size_t i = 0; i < len; i++) {
- if (tmplt[i] == _T('%')) {
+ if (tmplt[i] == '%') {
i++;
switch (tmplt[i]) {
case 'n':
@@ -202,7 +202,7 @@ TCHAR* GetStr(STATUSMSGINFO *n, const TCHAR *tmplt) break;
case 'o':
- if (n->oldstatusmsg == NULL || n->oldstatusmsg[0] == _T('\0') || mir_tstrcmp(n->oldstatusmsg, TranslateT("<no status message>")) == 0)
+ if (n->oldstatusmsg == NULL || n->oldstatusmsg[0] == '\0' || mir_tstrcmp(n->oldstatusmsg, TranslateT("<no status message>")) == 0)
res.Append(TranslateT("<no status message>"));
else
AddCR(res, n->oldstatusmsg);
@@ -228,7 +228,7 @@ TCHAR* GetStr(STATUSMSGINFO *n, const TCHAR *tmplt) break;
}
}
- else if (tmplt[i] == _T('\\')) {
+ else if (tmplt[i] == '\\') {
i++;
switch (tmplt[i]) {
case 'n':
@@ -260,7 +260,7 @@ bool SkipHiddenContact(MCONTACT hContact) return (!opt.HiddenContactsToo && (db_get_b(hContact, "CList", "Hidden", 0) == 1));
}
-void LogSMsgToDB(STATUSMSGINFO *smi, const TCHAR *tmplt)
+void LogSMsgToDB(STATUSMSGINFO *smi, const wchar_t *tmplt)
{
ptrT str(GetStr(smi, tmplt));
T2Utf blob(str);
@@ -284,32 +284,32 @@ void LogSMsgToDB(STATUSMSGINFO *smi, const TCHAR *tmplt) }
}
-void GetStatusText(MCONTACT hContact, WORD newStatus, WORD oldStatus, TCHAR *stzStatusText)
+void GetStatusText(MCONTACT hContact, WORD newStatus, WORD oldStatus, wchar_t *stzStatusText)
{
if (opt.UseAlternativeText) {
switch (GetGender(hContact)) {
case GENDER_MALE:
- _tcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzMStatusText, MAX_STATUSTEXT);
+ wcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzMStatusText, MAX_STATUSTEXT);
break;
case GENDER_FEMALE:
- _tcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzFStatusText, MAX_STATUSTEXT);
+ wcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzFStatusText, MAX_STATUSTEXT);
break;
case GENDER_UNSPECIFIED:
- _tcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzUStatusText, MAX_STATUSTEXT);
+ wcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzUStatusText, MAX_STATUSTEXT);
break;
}
}
else
- _tcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzStandardText, MAX_STATUSTEXT);
+ wcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzStandardText, MAX_STATUSTEXT);
if (opt.ShowPreviousStatus) {
- TCHAR buff[MAX_STATUSTEXT];
+ wchar_t buff[MAX_STATUSTEXT];
mir_sntprintf(buff, TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(oldStatus)].lpzStandardText);
mir_tstrcat(mir_tstrcat(stzStatusText, L" "), buff);
}
}
-void BlinkIcon(MCONTACT hContact, HICON hIcon, TCHAR *stzText)
+void BlinkIcon(MCONTACT hContact, HICON hIcon, wchar_t *stzText)
{
CLISTEVENT cle = {};
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
@@ -325,15 +325,15 @@ void PlayChangeSound(MCONTACT hContact, const char *name) {
if (opt.UseIndSnd) {
DBVARIANT dbv;
- TCHAR stzSoundFile[MAX_PATH] = { 0 };
+ wchar_t stzSoundFile[MAX_PATH] = { 0 };
if (!db_get_ts(hContact, MODULE, name, &dbv)) {
- _tcsncpy(stzSoundFile, dbv.ptszVal, _countof(stzSoundFile)-1);
+ wcsncpy(stzSoundFile, dbv.ptszVal, _countof(stzSoundFile)-1);
db_free(&dbv);
}
if (stzSoundFile[0]) {
//Now make path to IndSound absolute, as it isn't registered
- TCHAR stzSoundPath[MAX_PATH];
+ wchar_t stzSoundPath[MAX_PATH];
PathToAbsoluteT(stzSoundFile, stzSoundPath);
SkinPlaySoundFile(stzSoundPath);
return;
@@ -347,7 +347,7 @@ void PlayChangeSound(MCONTACT hContact, const char *name) int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus)
{
if (opt.LogToDB && (!opt.LogToDB_WinOpen || CheckMsgWnd(hContact))) {
- TCHAR stzStatusText[MAX_SECONDLINE] = { 0 };
+ wchar_t stzStatusText[MAX_SECONDLINE] = { 0 };
GetStatusText(hContact, newStatus, oldStatus, stzStatusText);
T2Utf blob(stzStatusText);
@@ -423,7 +423,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) if (bEnablePopup && db_get_b(hContact, MODULE, "EnablePopups", 1) && !opt.TempDisabled) {
WORD wStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
- TCHAR str[MAX_SECONDLINE] = { 0 };
+ wchar_t str[MAX_SECONDLINE] = { 0 };
if (opt.ShowStatus)
GetStatusText(hContact, newStatus, oldStatus, str);
@@ -440,7 +440,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) if (opt.BlinkIcon && !opt.TempDisabled) {
HICON hIcon = opt.BlinkIcon_Status ? Skin_LoadProtoIcon(szProto, newStatus) : Skin_LoadIcon(SKINICON_OTHER_USERONLINE);
- TCHAR str[256];
+ wchar_t str[256];
mir_sntprintf(str, TranslateT("%s is now %s"), pcli->pfnGetContactDisplayName(hContact, 0), StatusList[Index(newStatus)].lpzStandardText);
BlinkIcon(hContact, hIcon, str);
}
@@ -453,7 +453,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) }
if (opt.LogToFile) {
- TCHAR stzDate[MAX_STATUSTEXT], stzTime[MAX_STATUSTEXT], stzText[MAX_TEXT_LEN];
+ wchar_t stzDate[MAX_STATUSTEXT], stzTime[MAX_STATUSTEXT], stzText[MAX_TEXT_LEN];
GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, L"HH':'mm", stzTime, _countof(stzTime));
GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, L"dd/MM/yyyy", stzDate, _countof(stzDate));
@@ -628,7 +628,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) //don't show popup when mradio connecting and disconnecting
if (_stricmp(szProto, "mRadio") == 0 && !cws->value.type == DBVT_DELETED) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
mir_sntprintf(buf, L" (%s)", TranslateT("connecting"));
T2Utf pszUtf(buf);
mir_sntprintf(buf, L" (%s)", TranslateT("aborting"));
@@ -680,17 +680,17 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) if (bEnablePopup && db_get_b(hContact, MODULE, "EnablePopups", 1) && !opt.TempDisabled) {
// cut message if needed
- TCHAR *copyText = NULL;
+ wchar_t *copyText = NULL;
if (opt.PSMsgTruncate && (opt.PSMsgLen > 0) && smi.newstatusmsg && (mir_tstrlen(smi.newstatusmsg) > opt.PSMsgLen)) {
- TCHAR buff[MAX_TEXT_LEN + 3];
+ wchar_t buff[MAX_TEXT_LEN + 3];
copyText = mir_tstrdup(smi.newstatusmsg);
- _tcsncpy(buff, smi.newstatusmsg, opt.PSMsgLen);
+ wcsncpy(buff, smi.newstatusmsg, opt.PSMsgLen);
buff[opt.PSMsgLen] = 0;
mir_tstrcat(buff, L"...");
replaceStrT(smi.newstatusmsg, buff);
}
- TCHAR *str;
+ wchar_t *str;
if (smi.compare == COMPARE_DEL) {
char protoname[MAX_PATH];
mir_snprintf(protoname, "%s_TPopupSMsgRemoved", szProto);
@@ -730,7 +730,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) if (opt.BlinkIcon && opt.BlinkIcon_ForMsgs && !opt.TempDisabled) {
HICON hIcon = opt.BlinkIcon_Status ? Skin_LoadProtoIcon(szProto, db_get_w(hContact, szProto, "Status", ID_STATUS_ONLINE)) : Skin_LoadIcon(SKINICON_OTHER_USERONLINE);
- TCHAR str[256];
+ wchar_t str[256];
mir_sntprintf(str, TranslateT("%s changed status message to %s"), pcli->pfnGetContactDisplayName(hContact, 0), smi.newstatusmsg);
BlinkIcon(hContact, hIcon, str);
}
@@ -747,12 +747,12 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) LogSMsgToDB(&smi, smi.compare == COMPARE_DEL ? templates.LogSMsgRemoved : templates.LogSMsgChanged);
if (opt.SMsgLogToFile && db_get_b(hContact, MODULE, "EnableSMsgLogging", 1)) {
- TCHAR stzDate[MAX_STATUSTEXT], stzTime[MAX_STATUSTEXT], stzText[MAX_TEXT_LEN];
+ wchar_t stzDate[MAX_STATUSTEXT], stzTime[MAX_STATUSTEXT], stzText[MAX_TEXT_LEN];
GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, L"HH':'mm", stzTime, _countof(stzTime));
GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, L"dd/MM/yyyy", stzDate, _countof(stzDate));
- TCHAR *str;
+ wchar_t *str;
if (smi.compare == COMPARE_DEL)
str = GetStr(&smi, templates.LogSMsgRemoved);
else
@@ -855,7 +855,7 @@ void InitStatusList() mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) is back online!"), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Online"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOnline", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Online"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Online"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"global.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40072bg", COLOR_BG_AVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40072tx", COLOR_TX_DEFAULT);
@@ -867,7 +867,7 @@ void InitStatusList() mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) went offline! :("), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Offline"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOffline", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Offline"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Offline"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"offline.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40071bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40071tx", COLOR_TX_DEFAULT);
@@ -879,7 +879,7 @@ void InitStatusList() mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) hides in shadows..."), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Invisible"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserInvisible", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Invisible"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Invisible"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"invisible.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40078bg", COLOR_BG_AVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40078tx", COLOR_TX_DEFAULT);
@@ -891,7 +891,7 @@ void InitStatusList() mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) feels talkative!"), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Free for chat"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserFreeForChat", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Free for chat"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Free for chat"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"free4chat.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40077bg", COLOR_BG_AVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40077tx", COLOR_TX_DEFAULT);
@@ -903,7 +903,7 @@ void InitStatusList() mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) went away"), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Away"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserAway", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Away"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Away"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"away.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40073bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40073tx", COLOR_TX_DEFAULT);
@@ -915,7 +915,7 @@ void InitStatusList() mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) isn't there anymore!"), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Not available"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserNA", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Not available"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Not available"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"na.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40075bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40075tx", COLOR_TX_DEFAULT);
@@ -927,7 +927,7 @@ void InitStatusList() mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) has something else to do"), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Occupied"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOccupied", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Occupied"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Occupied"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"occupied.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40076bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40076tx", COLOR_TX_DEFAULT);
@@ -939,7 +939,7 @@ void InitStatusList() mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) doesn't want to be disturbed!"), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Do not disturb"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserDND", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Do not disturb"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Do not disturb"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"dnd.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40074bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40074tx", COLOR_TX_DEFAULT);
@@ -951,7 +951,7 @@ void InitStatusList() mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) is eating something"), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Out to lunch"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOutToLunch", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Out to lunch"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Out to lunch"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"lunch.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40080bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40080tx", COLOR_TX_DEFAULT);
@@ -963,7 +963,7 @@ void InitStatusList() mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) had to answer the phone"), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("On the phone"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOnThePhone", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: On the phone"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: On the phone"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"phone.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40079bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40079tx", COLOR_TX_DEFAULT);
@@ -981,37 +981,37 @@ void InitStatusList() //From offline
index = ID_STATUS_FROMOFFLINE;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, "UserFromOffline", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("User: from offline (has priority!)"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("User: from offline (has priority!)"), MAX_SKINSOUNDDESC);
//Status message removed
index = ID_STATUS_SMSGREMOVED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, "StatusMsgRemoved", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Status message removed"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Status message removed"), MAX_SKINSOUNDDESC);
//Status message changed
index = ID_STATUS_SMSGCHANGED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, "StatusMsgChanged", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Status message changed"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Status message changed"), MAX_SKINSOUNDDESC);
//Extra status removed
index = ID_STATUS_XREMOVED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_REMOVED, MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Extra status removed"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Extra status removed"), MAX_SKINSOUNDDESC);
//Extra status message changed
index = ID_STATUS_XMSGCHANGED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_MSGCHANGED, MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Extra status message changed"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Extra status message changed"), MAX_SKINSOUNDDESC);
//Extra status changed
index = ID_STATUS_XCHANGED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_CHANGED, MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Extra status changed"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Extra status changed"), MAX_SKINSOUNDDESC);
//Extra status message removed
index = ID_STATUS_XMSGREMOVED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_MSGREMOVED, MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Extra status message removed"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Extra status message removed"), MAX_SKINSOUNDDESC);
}
void CALLBACK ConnectionTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD)
@@ -1060,9 +1060,9 @@ INT_PTR EnableDisableMenuCommand(WPARAM, LPARAM) db_set_b(0, MODULE, "TempDisable", opt.TempDisabled = !opt.TempDisabled);
if (opt.TempDisabled)
- Menu_ModifyItem(hEnableDisableMenu, LPGENT("Enable status notification"), GetIconHandle(ICO_NOTIFICATION_OFF));
+ Menu_ModifyItem(hEnableDisableMenu, LPGENW("Enable status notification"), GetIconHandle(ICO_NOTIFICATION_OFF));
else
- Menu_ModifyItem(hEnableDisableMenu, LPGENT("Disable status notification"), GetIconHandle(ICO_NOTIFICATION_ON));
+ Menu_ModifyItem(hEnableDisableMenu, LPGENW("Disable status notification"), GetIconHandle(ICO_NOTIFICATION_ON));
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hToolbarButton, opt.TempDisabled ? 0 : TTBST_PUSHED);
return 0;
@@ -1074,7 +1074,7 @@ void InitMainMenuItem() SET_UID(mi, 0x22b7b4db, 0xa9a1, 0x4d43, 0x88, 0x80, 0x4c, 0x23, 0x20, 0x31, 0xc6, 0xa0);
mi.flags = CMIF_TCHAR;
if (ServiceExists(MS_POPUP_ADDPOPUPT))
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Popups"), 0);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 0);
mi.pszService = MS_STATUSCHANGE_MENUCOMMAND;
hEnableDisableMenu = Menu_AddMainMenuItem(&mi);
@@ -1096,10 +1096,10 @@ void InitIcolib() void InitSound()
{
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++)
- SkinAddNewSoundExT(StatusList[Index(i)].lpzSkinSoundName, LPGENT("Status Notify"), StatusList[Index(i)].lpzSkinSoundDesc);
+ SkinAddNewSoundExT(StatusList[Index(i)].lpzSkinSoundName, LPGENW("Status Notify"), StatusList[Index(i)].lpzSkinSoundDesc);
for (int i = 0; i <= ID_STATUSEX_MAX; i++)
- SkinAddNewSoundExT(StatusListEx[i].lpzSkinSoundName, LPGENT("Status Notify"), StatusListEx[i].lpzSkinSoundDesc);
+ SkinAddNewSoundExT(StatusListEx[i].lpzSkinSoundName, LPGENW("Status Notify"), StatusListEx[i].lpzSkinSoundDesc);
}
int InitTopToolbar(WPARAM, LPARAM)
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index f981556d39..61ca3ad9a7 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -246,7 +246,7 @@ INT_PTR CALLBACK DlgProcGeneralOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA break;
case IDC_BT_CHOOSELOGFILE:
{
- TCHAR buff[MAX_PATH];
+ wchar_t buff[MAX_PATH];
OPENFILENAME ofn = { 0 };
GetDlgItemText(hwndDlg, IDC_LOGFILE, buff, _countof(buff));
@@ -255,7 +255,7 @@ INT_PTR CALLBACK DlgProcGeneralOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ofn.lpstrFile = buff;
ofn.nMaxFile = MAX_PATH;
ofn.hwndOwner = hwndDlg;
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s (*.*)%c*.*%c%s (*.log)%c*.log%c%s (*.txt)%c*.txt%c", TranslateT("All Files"), 0, 0, TranslateT("Log"), 0, 0, TranslateT("Text"), 0, 0);
ofn.lpstrFilter = filter;
ofn.nFilterIndex = 2;
@@ -379,18 +379,18 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM break;
case IDC_PREVIEW:
{
- TCHAR str[MAX_SECONDLINE] = { 0 };
+ wchar_t str[MAX_SECONDLINE] = { 0 };
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++) {
- _tcsncpy(str, L"", _countof(str));
+ wcsncpy(str, L"", _countof(str));
if (opt.ShowStatus) {
if (opt.UseAlternativeText == 1)
- _tcsncpy(str, StatusList[Index(i)].lpzUStatusText, _countof(str));
+ wcsncpy(str, StatusList[Index(i)].lpzUStatusText, _countof(str));
else
- _tcsncpy(str, StatusList[Index(i)].lpzStandardText, _countof(str));
+ wcsncpy(str, StatusList[Index(i)].lpzStandardText, _countof(str));
if (opt.ShowPreviousStatus) {
- TCHAR buff[MAX_STATUSTEXT];
+ wchar_t buff[MAX_STATUSTEXT];
mir_sntprintf(buff, TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(i)].lpzStandardText);
mir_tstrcat(str, L" ");
mir_tstrcat(str, buff);
@@ -405,9 +405,9 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ShowChangePopup(NULL, Skin_LoadProtoIcon(NULL, i), i, str);
}
- _tcsncpy(str, TranslateT("This is extra status"), _countof(str));
+ wcsncpy(str, TranslateT("This is extra status"), _countof(str));
ShowChangePopup(NULL, Skin_LoadProtoIcon(NULL, ID_STATUS_ONLINE), ID_STATUS_EXTRASTATUS, str);
- _tcsncpy(str, TranslateT("This is status message"), _countof(str));
+ wcsncpy(str, TranslateT("This is status message"), _countof(str));
ShowChangePopup(NULL, Skin_LoadProtoIcon(NULL, ID_STATUS_ONLINE), ID_STATUS_STATUSMSG, str);
return FALSE;
@@ -557,12 +557,12 @@ INT_PTR CALLBACK DlgProcXPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hwndDlg, IDC_ED_TREMOVEMSG), templates.PopupXFlags & NOTIFY_REMOVE_MESSAGE);
// Buttons
- SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Show available variables"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show available variables"), BATF_TCHAR);
HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_VARIABLES));
SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
- SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Reset all templates to default"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset all templates to default"), BATF_TCHAR);
hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESET));
SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
@@ -691,12 +691,12 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA EnableWindow(GetDlgItem(hwndDlg, IDC_ED_TSMSGREMOVE), templates.PopupSMsgFlags & NOTIFY_REMOVE_MESSAGE);
// Buttons
- SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Show available variables"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show available variables"), BATF_TCHAR);
HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_VARIABLES));
SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
- SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Reset all templates to default"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset all templates to default"), BATF_TCHAR);
hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESET));
SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
@@ -731,17 +731,17 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA char protoname[MAX_PATH] = { 0 };
mir_snprintf(protoname, "%s_TPopupSMsgChanged", protos[i]->szModuleName);
if (db_get_ts(NULL, MODULE, protoname, &dbVar))
- _tcsncpy(prototemplate->ProtoTemplateMsg, DEFAULT_POPUP_SMSGCHANGED, _countof(prototemplate->ProtoTemplateMsg));
+ wcsncpy(prototemplate->ProtoTemplateMsg, DEFAULT_POPUP_SMSGCHANGED, _countof(prototemplate->ProtoTemplateMsg));
else {
- _tcsncpy(prototemplate->ProtoTemplateMsg, dbVar.ptszVal, _countof(prototemplate->ProtoTemplateMsg));
+ wcsncpy(prototemplate->ProtoTemplateMsg, dbVar.ptszVal, _countof(prototemplate->ProtoTemplateMsg));
db_free(&dbVar);
}
mir_snprintf(protoname, "%s_TPopupSMsgRemoved", protos[i]->szModuleName);
if (db_get_ts(NULL, MODULE, protoname, &dbVar))
- _tcsncpy(prototemplate->ProtoTemplateRemoved, DEFAULT_POPUP_SMSGREMOVED, _countof(prototemplate->ProtoTemplateRemoved));
+ wcsncpy(prototemplate->ProtoTemplateRemoved, DEFAULT_POPUP_SMSGREMOVED, _countof(prototemplate->ProtoTemplateRemoved));
else {
- _tcsncpy(prototemplate->ProtoTemplateRemoved, dbVar.ptszVal, _countof(prototemplate->ProtoTemplateRemoved));
+ wcsncpy(prototemplate->ProtoTemplateRemoved, dbVar.ptszVal, _countof(prototemplate->ProtoTemplateRemoved));
db_free(&dbVar);
}
diff --git a/plugins/NewXstatusNotify/src/options.h b/plugins/NewXstatusNotify/src/options.h index 1753401455..adf561dd00 100644 --- a/plugins/NewXstatusNotify/src/options.h +++ b/plugins/NewXstatusNotify/src/options.h @@ -49,7 +49,7 @@ typedef struct tagOPTIONS { BYTE BlinkIcon;
BYTE BlinkIcon_Status;
BYTE BlinkIcon_ForMsgs;
- TCHAR LogFilePath[MAX_PATH];
+ wchar_t LogFilePath[MAX_PATH];
// IDD_AUTODISABLE
BYTE OnlyGlobalChanges;
BYTE DisableSoundGlobally;
@@ -86,18 +86,18 @@ typedef struct tagTEMPLATES { BYTE PopupSMsgFlags;
BYTE LogXFlags;
BYTE LogSMsgFlags;
- TCHAR PopupXstatusChanged[256];
- TCHAR PopupXstatusRemoved[256];
- TCHAR PopupXMsgChanged[256];
- TCHAR PopupXMsgRemoved[256];
- TCHAR LogXstatusChanged[256];
- TCHAR LogXstatusRemoved[256];
- TCHAR LogXMsgChanged[256];
- TCHAR LogXMsgRemoved[256];
- TCHAR LogXstatusOpening[256];
- TCHAR LogSMsgChanged[256];
- TCHAR LogSMsgRemoved[256];
- TCHAR LogSMsgOpening[256];
+ wchar_t PopupXstatusChanged[256];
+ wchar_t PopupXstatusRemoved[256];
+ wchar_t PopupXMsgChanged[256];
+ wchar_t PopupXMsgRemoved[256];
+ wchar_t LogXstatusChanged[256];
+ wchar_t LogXstatusRemoved[256];
+ wchar_t LogXMsgChanged[256];
+ wchar_t LogXMsgRemoved[256];
+ wchar_t LogXstatusOpening[256];
+ wchar_t LogSMsgChanged[256];
+ wchar_t LogSMsgRemoved[256];
+ wchar_t LogSMsgOpening[256];
} TEMPLATES;
int OptionsInitialize(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp index c4aad62f4f..a6346e67d9 100644 --- a/plugins/NewXstatusNotify/src/popup.cpp +++ b/plugins/NewXstatusNotify/src/popup.cpp @@ -21,7 +21,7 @@ #include "stdafx.h"
-void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const TCHAR *stzText, PLUGINDATA *pdp)
+void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const wchar_t *stzText, PLUGINDATA *pdp)
{
POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
@@ -34,9 +34,9 @@ void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const TCHAR if (tszGroup)
buf.AppendFormat(L" (%s)", tszGroup);
}
- _tcsncpy_s(ppd.lptzContactName, buf, _TRUNCATE);
+ wcsncpy_s(ppd.lptzContactName, buf, _TRUNCATE);
- _tcsncpy(ppd.lptzText, stzText, _countof(ppd.lptzText));
+ wcsncpy(ppd.lptzText, stzText, _countof(ppd.lptzText));
switch (opt.Colors) {
case POPUP_COLOR_OWN:
@@ -79,15 +79,15 @@ static int AwayMsgHook(WPARAM, LPARAM lParam, LPARAM pObj) MCONTACT hContact = PUGetContact(pdp->hWnd);
ptrT pstzLast(db_get_tsa(hContact, MODULE, "LastPopupText"));
- TCHAR *tszStatus = (TCHAR *)ack->lParam;
+ wchar_t *tszStatus = (wchar_t *)ack->lParam;
if (tszStatus == NULL || *tszStatus == 0)
return 0;
- TCHAR stzText[1024];
+ wchar_t stzText[1024];
if (pstzLast)
mir_sntprintf(stzText, L"%s\n%s", pstzLast, tszStatus);
else
- _tcsncpy(stzText, tszStatus, _countof(stzText));
+ wcsncpy(stzText, tszStatus, _countof(stzText));
SendMessage(pdp->hWnd, WM_SETREDRAW, FALSE, 0);
PUChangeTextT(pdp->hWnd, stzText);
SendMessage(pdp->hWnd, WM_SETREDRAW, TRUE, 0);
diff --git a/plugins/NewXstatusNotify/src/popup.h b/plugins/NewXstatusNotify/src/popup.h index 5bcce77072..1ffc9b7875 100644 --- a/plugins/NewXstatusNotify/src/popup.h +++ b/plugins/NewXstatusNotify/src/popup.h @@ -35,7 +35,7 @@ #define PCA_OPENHISTORY 4 // open contact history
#define PCA_DONOTHING 5 // do nothing
-#define STRING_SHOWPREVIOUSSTATUS LPGENT("(was %s)")
+#define STRING_SHOWPREVIOUSSTATUS LPGENW("(was %s)")
typedef struct tagPLUGINDATA
{
@@ -47,18 +47,18 @@ typedef struct tagPLUGINDATA } PLUGINDATA;
static struct {
- TCHAR *Text;
+ wchar_t *Text;
int Action;
} PopupActions[] = {
- LPGENT("Open message window"), PCA_OPENMESSAGEWND,
- LPGENT("Close popup"), PCA_CLOSEPOPUP,
- LPGENT("Open contact details window"), PCA_OPENDETAILS,
- LPGENT("Open contact menu"), PCA_OPENMENU,
- LPGENT("Open contact history"), PCA_OPENHISTORY,
- LPGENT("Do nothing"), PCA_DONOTHING
+ LPGENW("Open message window"), PCA_OPENMESSAGEWND,
+ LPGENW("Close popup"), PCA_CLOSEPOPUP,
+ LPGENW("Open contact details window"), PCA_OPENDETAILS,
+ LPGENW("Open contact menu"), PCA_OPENMENU,
+ LPGENW("Open contact history"), PCA_OPENHISTORY,
+ LPGENW("Do nothing"), PCA_DONOTHING
};
-void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const TCHAR *stzText, PLUGINDATA *pdp = NULL);
+void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const wchar_t *stzText, PLUGINDATA *pdp = NULL);
LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
#endif
\ No newline at end of file diff --git a/plugins/NewXstatusNotify/src/stdafx.h b/plugins/NewXstatusNotify/src/stdafx.h index 5b6218084f..32feb569d4 100644 --- a/plugins/NewXstatusNotify/src/stdafx.h +++ b/plugins/NewXstatusNotify/src/stdafx.h @@ -109,21 +109,21 @@ typedef struct tagSTATUS
{
- TCHAR lpzMStatusText[MAX_STATUSTEXT];
- TCHAR lpzFStatusText[MAX_STATUSTEXT];
- TCHAR lpzUStatusText[MAX_STATUSTEXT];
- TCHAR lpzStandardText[MAX_STANDARDTEXT];
+ wchar_t lpzMStatusText[MAX_STATUSTEXT];
+ wchar_t lpzFStatusText[MAX_STATUSTEXT];
+ wchar_t lpzUStatusText[MAX_STATUSTEXT];
+ wchar_t lpzStandardText[MAX_STANDARDTEXT];
char lpzSkinSoundName[MAX_SKINSOUNDNAME];
- TCHAR lpzSkinSoundDesc[MAX_SKINSOUNDDESC];
- TCHAR lpzSkinSoundFile[MAX_PATH];
+ wchar_t lpzSkinSoundDesc[MAX_SKINSOUNDDESC];
+ wchar_t lpzSkinSoundFile[MAX_PATH];
COLORREF colorBack;
COLORREF colorText;
} STATUS;
typedef struct {
MCONTACT hContact;
- TCHAR *oldstatusmsg;
- TCHAR *newstatusmsg;
+ wchar_t *oldstatusmsg;
+ wchar_t *newstatusmsg;
char *proto;
int compare;
} STATUSMSGINFO;
@@ -150,8 +150,8 @@ extern HGENMENU hEnableDisableMenu; extern STATUS StatusList[STATUS_COUNT];
extern STATUS StatusListEx[STATUSEX_COUNT];
-TCHAR* GetStr(STATUSMSGINFO *n, const TCHAR *tmplt);
-void LogSMsgToDB(STATUSMSGINFO *smi, const TCHAR *tmplt);
-void BlinkIcon(MCONTACT hContact, HICON hIcon, TCHAR *stzText);
+wchar_t* GetStr(STATUSMSGINFO *n, const wchar_t *tmplt);
+void LogSMsgToDB(STATUSMSGINFO *smi, const wchar_t *tmplt);
+void BlinkIcon(MCONTACT hContact, HICON hIcon, wchar_t *stzText);
void PlayChangeSound(MCONTACT hContact, const char *name);
#endif //COMMON_H
diff --git a/plugins/NewXstatusNotify/src/utils.cpp b/plugins/NewXstatusNotify/src/utils.cpp index 3a72826c56..f06b12914c 100644 --- a/plugins/NewXstatusNotify/src/utils.cpp +++ b/plugins/NewXstatusNotify/src/utils.cpp @@ -41,20 +41,20 @@ bool CheckMsgWnd(MCONTACT hContact) return false;
}
-int DBGetStringDefault(MCONTACT hContact, const char *szModule, const char *szSetting, TCHAR *setting, int size, const TCHAR *defaultValue)
+int DBGetStringDefault(MCONTACT hContact, const char *szModule, const char *szSetting, wchar_t *setting, int size, const wchar_t *defaultValue)
{
DBVARIANT dbv;
if (!db_get_ts(hContact, szModule, szSetting, &dbv)) {
- _tcsncpy(setting, dbv.ptszVal, size);
+ wcsncpy(setting, dbv.ptszVal, size);
db_free(&dbv);
return 0;
}
- _tcsncpy(setting, defaultValue, size);
+ wcsncpy(setting, defaultValue, size);
return 1;
}
-void ShowLog(TCHAR *file)
+void ShowLog(wchar_t *file)
{
INT_PTR res = (INT_PTR)ShellExecute(NULL, L"open", file, NULL, NULL, SW_SHOW);
if (res <= 32) // error
@@ -83,16 +83,16 @@ BOOL StatusHasAwayMessage(char *szProto, int status) }
}
-void LogToFile(TCHAR *stzText)
+void LogToFile(wchar_t *stzText)
{
- FILE *fp = _tfopen(opt.LogFilePath, L"a+b, ccs=UTF-8");
+ FILE *fp = _wfopen(opt.LogFilePath, L"a+b, ccs=UTF-8");
if (fp) {
fprintf(fp, T2Utf(stzText));
fclose(fp);
}
}
-void AddCR(CMString &str, const TCHAR *stzText)
+void AddCR(CMString &str, const wchar_t *stzText)
{
if (stzText == NULL)
return;
diff --git a/plugins/NewXstatusNotify/src/utils.h b/plugins/NewXstatusNotify/src/utils.h index d7496edf30..bdc32806fb 100644 --- a/plugins/NewXstatusNotify/src/utils.h +++ b/plugins/NewXstatusNotify/src/utils.h @@ -23,10 +23,10 @@ #define UTILS_H
bool CheckMsgWnd(MCONTACT hContact);
-int DBGetStringDefault(MCONTACT hContact, const char *szModule, const char *szSetting, TCHAR *setting, int size, const TCHAR *defaultValue);
-void ShowLog(TCHAR *file);
+int DBGetStringDefault(MCONTACT hContact, const char *szModule, const char *szSetting, wchar_t *setting, int size, const wchar_t *defaultValue);
+void ShowLog(wchar_t *file);
BOOL StatusHasAwayMessage(char *szProto, int status);
-void LogToFile(TCHAR *stzText);
-void AddCR(CMString &str, const TCHAR *statusmsg);
+void LogToFile(wchar_t *stzText);
+void AddCR(CMString &str, const wchar_t *statusmsg);
#endif
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index 13c6e07f8d..5640113053 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -19,7 +19,7 @@ #include "stdafx.h"
-XSTATUSCHANGE *NewXSC(MCONTACT hContact, char *szProto, int xstatusType, int action, TCHAR *stzTitle, TCHAR *stzText)
+XSTATUSCHANGE *NewXSC(MCONTACT hContact, char *szProto, int xstatusType, int action, wchar_t *stzTitle, wchar_t *stzText)
{
XSTATUSCHANGE *xsc = (XSTATUSCHANGE *)mir_alloc(sizeof(XSTATUSCHANGE));
xsc->hContact = hContact;
@@ -76,7 +76,7 @@ void RemoveLoggedEventsSMsg(MCONTACT hContact) }
}
-TCHAR* GetStatusTypeAsString(int type, TCHAR *buff)
+wchar_t* GetStatusTypeAsString(int type, wchar_t *buff)
{
switch (type) {
case TYPE_JABBER_MOOD:
@@ -90,32 +90,32 @@ TCHAR* GetStatusTypeAsString(int type, TCHAR *buff) }
}
-CMString ReplaceVars(XSTATUSCHANGE *xsc, const TCHAR *tmplt)
+CMString ReplaceVars(XSTATUSCHANGE *xsc, const wchar_t *tmplt)
{
- if (xsc == NULL || tmplt == NULL || tmplt[0] == _T('\0'))
+ if (xsc == NULL || tmplt == NULL || tmplt[0] == '\0')
return CMString();
size_t len = mir_tstrlen(tmplt);
CMString res;
for (size_t i = 0; i < len; i++) {
- if (tmplt[i] == _T('%')) {
+ if (tmplt[i] == '%') {
i++;
switch (tmplt[i]) {
case 'n':
- TCHAR stzType[32];
+ wchar_t stzType[32];
res.Append(GetStatusTypeAsString(xsc->type, stzType));
break;
case 't':
- if (xsc->stzTitle == NULL || xsc->stzTitle[0] == _T('\0'))
+ if (xsc->stzTitle == NULL || xsc->stzTitle[0] == '\0')
res.Append(TranslateT("<no title>"));
else
res.Append(xsc->stzTitle);
break;
case 'm':
- if (xsc->stzText == NULL || xsc->stzText[0] == _T('\0'))
+ if (xsc->stzText == NULL || xsc->stzText[0] == '\0')
res.Append(TranslateT("<no status message>"));
else
AddCR(res, xsc->stzText);
@@ -134,7 +134,7 @@ CMString ReplaceVars(XSTATUSCHANGE *xsc, const TCHAR *tmplt) break;
}
}
- else if (tmplt[i] == _T('\\')) {
+ else if (tmplt[i] == '\\') {
i++;
switch (tmplt[i]) {
case 'n':
@@ -188,17 +188,17 @@ void ShowXStatusPopup(XSTATUSCHANGE *xsc) hIcon = Skin_LoadProtoIcon(xsc->szProto, db_get_w(xsc->hContact, xsc->szProto, "Status", ID_STATUS_ONLINE));
// cut message if needed
- TCHAR *copyText = NULL;
+ wchar_t *copyText = NULL;
if (opt.PXMsgTruncate && (opt.PXMsgLen > 0) && xsc->stzText && (mir_tstrlen(xsc->stzText) > opt.PXMsgLen)) {
- TCHAR buff[MAX_TEXT_LEN + 3];
+ wchar_t buff[MAX_TEXT_LEN + 3];
copyText = mir_tstrdup(xsc->stzText);
- _tcsncpy(buff, xsc->stzText, opt.PXMsgLen);
+ wcsncpy(buff, xsc->stzText, opt.PXMsgLen);
buff[opt.PXMsgLen] = 0;
mir_tstrcat(buff, L"...");
replaceStrT(xsc->stzText, buff);
}
- TCHAR *Template = L"";
+ wchar_t *Template = L"";
switch (xsc->action) {
case NOTIFY_NEW_XSTATUS:
Template = templates.PopupXstatusChanged; break;
@@ -224,8 +224,8 @@ void BlinkXStatusIcon(XSTATUSCHANGE *xsc) return;
HICON hIcon = NULL;
- TCHAR str[256] = { 0 };
- TCHAR stzType[32];
+ wchar_t str[256] = { 0 };
+ wchar_t stzType[32];
mir_sntprintf(str, TranslateT("%s changed %s"), pcli->pfnGetContactDisplayName(xsc->hContact, 0), GetStatusTypeAsString(xsc->type, stzType));
if (opt.BlinkIcon_Status) {
@@ -273,7 +273,7 @@ void LogChangeToDB(XSTATUSCHANGE *xsc) if (xsc == NULL || (opt.XLogToDB_WinOpen && !CheckMsgWnd(xsc->hContact)))
return;
- TCHAR *Template = L"";
+ wchar_t *Template = L"";
switch (xsc->action) {
case NOTIFY_NEW_XSTATUS:
Template = templates.LogXstatusChanged; break;
@@ -287,7 +287,7 @@ void LogChangeToDB(XSTATUSCHANGE *xsc) Template = templates.LogXstatusOpening; break;
}
- TCHAR stzLastLog[2 * MAX_TEXT_LEN];
+ wchar_t stzLastLog[2 * MAX_TEXT_LEN];
CMString stzLogText(ReplaceVars(xsc, Template));
DBGetStringDefault(xsc->hContact, MODULE, DB_LASTLOG, stzLastLog, _countof(stzLastLog), L"");
@@ -320,12 +320,12 @@ void LogChangeToFile(XSTATUSCHANGE *xsc) if (xsc == NULL)
return;
- TCHAR stzDate[32], stzTime[32], stzText[MAX_TEXT_LEN];
+ wchar_t stzDate[32], stzTime[32], stzText[MAX_TEXT_LEN];
GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, L"HH':'mm", stzTime, _countof(stzTime));
GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, L"dd/MM/yyyy", stzDate, _countof(stzDate));
- TCHAR *Template = L"";
+ wchar_t *Template = L"";
switch (xsc->action) {
case NOTIFY_NEW_XSTATUS:
Template = templates.LogXstatusChanged; break;
@@ -409,9 +409,9 @@ void ExtraStatusChanged(XSTATUSCHANGE *xsc) FreeXSC(xsc);
}
-TCHAR* GetDefaultXstatusName(int statusID, char *szProto, TCHAR *buff, int bufflen)
+wchar_t* GetDefaultXstatusName(int statusID, char *szProto, wchar_t *buff, int bufflen)
{
- TCHAR nameBuff[64];
+ wchar_t nameBuff[64];
buff[0] = 0;
CUSTOM_STATUS xstatus = { 0 };
@@ -420,12 +420,12 @@ TCHAR* GetDefaultXstatusName(int statusID, char *szProto, TCHAR *buff, int buffl xstatus.ptszName = nameBuff;
xstatus.wParam = (WPARAM*)&statusID;
if (!CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus))
- _tcsncpy_s(buff, bufflen, TranslateTS(nameBuff), _TRUNCATE);
+ wcsncpy_s(buff, bufflen, TranslateTS(nameBuff), _TRUNCATE);
return buff;
}
-TCHAR* GetIcqXStatus(MCONTACT hContact, char *szProto, char *szValue, TCHAR *buff, int bufflen)
+wchar_t* GetIcqXStatus(MCONTACT hContact, char *szProto, char *szValue, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
buff[0] = 0;
@@ -436,7 +436,7 @@ TCHAR* GetIcqXStatus(MCONTACT hContact, char *szProto, char *szValue, TCHAR *buf if ((mir_strcmp(szValue, "XStatusName") == 0) && dbv.ptszVal[0] == 0)
GetDefaultXstatusName(statusID, szProto, buff, bufflen);
else
- _tcsncpy(buff, dbv.ptszVal, bufflen);
+ wcsncpy(buff, dbv.ptszVal, bufflen);
buff[bufflen - 1] = 0;
db_free(&dbv);
@@ -446,7 +446,7 @@ TCHAR* GetIcqXStatus(MCONTACT hContact, char *szProto, char *szValue, TCHAR *buf return buff;
}
-TCHAR* GetJabberAdvStatusText(MCONTACT hContact, char *szProto, char *szSlot, char *szValue, TCHAR *buff, int bufflen)
+wchar_t* GetJabberAdvStatusText(MCONTACT hContact, char *szProto, char *szSlot, char *szValue, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSetting[128];
@@ -454,7 +454,7 @@ TCHAR* GetJabberAdvStatusText(MCONTACT hContact, char *szProto, char *szSlot, ch mir_snprintf(szSetting, "%s/%s/%s", szProto, szSlot, szValue);
if (!db_get_ts(hContact, "AdvStatus", szSetting, &dbv)) {
- _tcsncpy(buff, dbv.ptszVal, bufflen);
+ wcsncpy(buff, dbv.ptszVal, bufflen);
buff[bufflen - 1] = 0;
db_free(&dbv);
}
@@ -462,7 +462,7 @@ TCHAR* GetJabberAdvStatusText(MCONTACT hContact, char *szProto, char *szSlot, ch return buff;
}
-void LogXstatusChange(MCONTACT hContact, char *szProto, int xstatusType, TCHAR *stzTitle, TCHAR *stzText)
+void LogXstatusChange(MCONTACT hContact, char *szProto, int xstatusType, wchar_t *stzTitle, wchar_t *stzText)
{
XSTATUSCHANGE *xsc = NewXSC(hContact, szProto, xstatusType, NOTIFY_OPENING_ML, stzTitle[0] ? mir_tstrdup(stzTitle) : NULL, stzText[0] ? mir_tstrdup(stzText) : NULL);
@@ -478,7 +478,7 @@ void AddXStatusEventThread(void *arg) if (szProto == NULL)
return;
- TCHAR stzTitle[MAX_TITLE_LEN], stzText[MAX_TEXT_LEN];
+ wchar_t stzTitle[MAX_TITLE_LEN], stzText[MAX_TEXT_LEN];
if (ProtoServiceExists(szProto, JS_PARSE_XMPP_URI)) {
GetJabberAdvStatusText(hContact, szProto, "mood", "title", stzTitle, _countof(stzTitle));
if (stzTitle[0]) {
diff --git a/plugins/NewXstatusNotify/src/xstatus.h b/plugins/NewXstatusNotify/src/xstatus.h index 1c82461245..403400caba 100644 --- a/plugins/NewXstatusNotify/src/xstatus.h +++ b/plugins/NewXstatusNotify/src/xstatus.h @@ -88,8 +88,8 @@ typedef struct tagXSTATUSCHANGE char *szProto;
int type;
int action;
- TCHAR *stzTitle;
- TCHAR *stzText;
+ wchar_t *stzTitle;
+ wchar_t *stzText;
} XSTATUSCHANGE;
typedef struct tagDBEVENT
@@ -101,12 +101,12 @@ typedef struct tagDBEVENT typedef struct tagPROTOTEMPLATE
{
char *ProtoName;
- TCHAR ProtoTemplateMsg[MAX_PATH];
- TCHAR ProtoTemplateRemoved[MAX_PATH];
+ wchar_t ProtoTemplateMsg[MAX_PATH];
+ wchar_t ProtoTemplateRemoved[MAX_PATH];
} PROTOTEMPLATE;
-TCHAR *GetDefaultXstatusName(int statusID, char *szProto, TCHAR *buff, int bufflen);
-XSTATUSCHANGE *NewXSC(MCONTACT hContact, char *szProto, int xstatusType, int action, TCHAR *stzTitle, TCHAR *stzText);
+wchar_t *GetDefaultXstatusName(int statusID, char *szProto, wchar_t *buff, int bufflen);
+XSTATUSCHANGE *NewXSC(MCONTACT hContact, char *szProto, int xstatusType, int action, wchar_t *stzTitle, wchar_t *stzText);
void ExtraStatusChanged(XSTATUSCHANGE *xsc);
void FreeXSC(XSTATUSCHANGE *xsc);
int OnWindowEvent(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/New_GPG/src/globals.h b/plugins/New_GPG/src/globals.h index a895bfd977..4a8c6f2cb5 100644 --- a/plugins/New_GPG/src/globals.h +++ b/plugins/New_GPG/src/globals.h @@ -17,7 +17,7 @@ #ifndef GLOBALS_H
#define GLOBALS_H
extern bool bAppendTags, bPresenceSigning, bStripTags, gpg_valid, gpg_keyexist, tabsrmm_used, bSameAction, bFileTransfers, bDebugLog;
-extern TCHAR *inopentag, *inclosetag, *outopentag, *outclosetag;
+extern wchar_t *inopentag, *inclosetag, *outopentag, *outclosetag;
extern logtofile debuglog;
extern map<int, MCONTACT> user_data;
diff --git a/plugins/New_GPG/src/gpg_wrapper.cpp b/plugins/New_GPG/src/gpg_wrapper.cpp index 1e2fcfce97..ef52cbe196 100755 --- a/plugins/New_GPG/src/gpg_wrapper.cpp +++ b/plugins/New_GPG/src/gpg_wrapper.cpp @@ -25,7 +25,7 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae extern logtofile debuglog; - TCHAR *bin_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L""); + wchar_t *bin_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L""); { if(!boost::filesystem::exists(bin_path)) { @@ -48,7 +48,7 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae env.push_back(L"LC_ALL=English"); env.push_back(L"LANG=C"); argv.push_back(bin_path); - TCHAR *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); if(mir_tstrlen(home_dir)) //this check are required for first run gpg binary validation { argv.push_back(L"--homedir"); @@ -80,7 +80,7 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae file_descriptor_sink sout(pout.sink, close_handle); file_descriptor_sink serr(perr.sink, close_handle); - TCHAR *mir_path = new TCHAR [MAX_PATH]; + wchar_t *mir_path = new wchar_t [MAX_PATH]; PathToAbsoluteW(L"\\", mir_path); c = new child(execute(set_args(argv), bind_stdout(sout), bind_stderr(serr), close_stdin(),/*bind_stdin(sin),*/ show_window(SW_HIDE), hide_console(), inherit_env(), set_env(env), start_in_dir(mir_path))); @@ -175,7 +175,7 @@ pxResult pxExecute_passwd_change(std::vector<std::wstring> &aargv, pxResult *res return pxNotConfigured; extern logtofile debuglog; - TCHAR *bin_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L""); + wchar_t *bin_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L""); { if(!boost::filesystem::exists(bin_path)) { @@ -197,7 +197,7 @@ pxResult pxExecute_passwd_change(std::vector<std::wstring> &aargv, pxResult *res env.push_back(L"LC_ALL=English"); argv.push_back(bin_path); argv.push_back(L"--homedir"); - TCHAR *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); argv.push_back(home_dir); mir_free(home_dir); argv.push_back(L"--display-charset"); diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index 9a84c466ee..a2dee64295 100644 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -18,7 +18,7 @@ //global variables
bool bAppendTags = false, bDebugLog = false, bJabberAPI = false, bPresenceSigning = false, bIsMiranda09 = false, bFileTransfers = false, bSameAction = false, bAutoExchange = false, bStripTags = false, tabsrmm_used = false;
-TCHAR *inopentag = NULL, *inclosetag = NULL, *outopentag = NULL, *outclosetag = NULL, *password = NULL;
+wchar_t *inopentag = NULL, *inclosetag = NULL, *outopentag = NULL, *outclosetag = NULL, *password = NULL;
list <JabberAccount*> Accounts;
@@ -186,35 +186,35 @@ extern "C" int __declspec(dllexport) Load() mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mi.name.t = LPGENT("Load GPG public key");
+ mi.name.w = LPGENW("Load GPG public key");
mi.pszService = "/LoadPubKey";
hLoadPubKey = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0xc8008193, 0x56a9, 0x414a, 0x82, 0x98, 0x78, 0xe8, 0xa8, 0x84, 0x20, 0x67);
mi.position = -0x7FFFFFFe;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mi.name.t = LPGENT("Toggle GPG encryption");
+ mi.name.w = LPGENW("Toggle GPG encryption");
mi.pszService = "/ToggleEncryption";
hToggleEncryption = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x42bb535f, 0xd58e, 0x4edb, 0xbf, 0x2c, 0xfa, 0x9a, 0xbf, 0x1e, 0xb8, 0x69);
mi.position = -0x7FFFFFFd;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mi.name.t = LPGENT("Send public key");
+ mi.name.w = LPGENW("Send public key");
mi.pszService = "/SendKey";
hSendKey = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x33a204b2, 0xe3c0, 0x413b, 0xbf, 0xd8, 0x8b, 0x2e, 0x3d, 0xa0, 0xef, 0xa4);
mi.position = -0x7FFFFFFe;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mi.name.t = LPGENT("Export GPG Public keys");
+ mi.name.w = LPGENW("Export GPG Public keys");
mi.pszService = "/ExportGPGKeys";
hExportGpgKeys = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x627fcfc1, 0x4e60, 0x4428, 0xaf, 0x96, 0x11, 0x42, 0x24, 0xeb, 0x7, 0xea);
mi.position = -0x7FFFFFFF;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mi.name.t = LPGENT("Import GPG Public keys");
+ mi.name.w = LPGENW("Import GPG Public keys");
mi.pszService = "/ImportGPGKeys";
hImportGpgKeys = Menu_AddMainMenuItem(&mi);
diff --git a/plugins/New_GPG/src/jabber_account.cpp b/plugins/New_GPG/src/jabber_account.cpp index 879e6c7a48..29f561d5e2 100644 --- a/plugins/New_GPG/src/jabber_account.cpp +++ b/plugins/New_GPG/src/jabber_account.cpp @@ -16,7 +16,7 @@ #include "stdafx.h"
-void JabberAccount::setAccountName(TCHAR *Name)
+void JabberAccount::setAccountName(wchar_t *Name)
{
AccountName = Name;
}
@@ -42,7 +42,7 @@ void JabberAccount::setMessageHandler(HJHANDLER hHandler) }
-TCHAR *JabberAccount::getAccountName()
+wchar_t *JabberAccount::getAccountName()
{
return AccountName;
}
diff --git a/plugins/New_GPG/src/jabber_account.h b/plugins/New_GPG/src/jabber_account.h index b643ed1636..8086c0ea6a 100644 --- a/plugins/New_GPG/src/jabber_account.h +++ b/plugins/New_GPG/src/jabber_account.h @@ -18,14 +18,14 @@ class JabberAccount
{
public:
- void setAccountName(TCHAR *Name);
+ void setAccountName(wchar_t *Name);
void setAccountNumber(int Number);
void setJabberInterface(IJabberInterface *JIf);
void setSendHandler(HJHANDLER hHandler);
void setPrescenseHandler(HJHANDLER hHandler);
void setMessageHandler(HJHANDLER hHandler);
- TCHAR *getAccountName();
+ wchar_t *getAccountName();
int getAccountNumber();
IJabberInterface *getJabberInterface();
HJHANDLER getSendHandler();
@@ -34,7 +34,7 @@ public: ~JabberAccount();
JabberAccount();
private:
- TCHAR *AccountName;
+ wchar_t *AccountName;
int AccountNumber;
IJabberInterface *JabberInterface;
HJHANDLER hSendHandler, hPrescenseHandler, hMessageHandler;
diff --git a/plugins/New_GPG/src/log.cpp b/plugins/New_GPG/src/log.cpp index 87c72605da..362344c46f 100644 --- a/plugins/New_GPG/src/log.cpp +++ b/plugins/New_GPG/src/log.cpp @@ -17,7 +17,7 @@ #include "stdafx.h"
-logtofile& logtofile::operator<<(TCHAR *buf)
+logtofile& logtofile::operator<<(wchar_t *buf)
{
if(_bDebugLog != bDebugLog)
init();
diff --git a/plugins/New_GPG/src/log.h b/plugins/New_GPG/src/log.h index 9d1dcb39e6..9bb7a0dae9 100644 --- a/plugins/New_GPG/src/log.h +++ b/plugins/New_GPG/src/log.h @@ -19,7 +19,7 @@ class logtofile { public: - logtofile& operator<<(TCHAR *buf); + logtofile& operator<<(wchar_t *buf); logtofile& operator<<(char *buf); logtofile& operator<<(string buf); logtofile& operator<<(wstring buf); @@ -28,7 +28,7 @@ public: logtofile(); private: fstream log; - TCHAR *path; + wchar_t *path; boost::mutex log_mutex; bool _bDebugLog; }; diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index 8e50ba8998..d3e7d1679b 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -30,14 +30,14 @@ int itemnum = 0; HWND hwndList_g = NULL; BOOL CheckStateStoreDB(HWND hwndDlg, int idCtrl, const char* szSetting); -TCHAR key_id_global[17] = { 0 }; +wchar_t key_id_global[17] = { 0 }; static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { HWND hwndList = GetDlgItem(hwndDlg, IDC_KEY_LIST); hwndList_g = hwndList; LVITEM item = { 0 }; - TCHAR fp[16] = { 0 }; + wchar_t fp[16] = { 0 }; switch (uMsg) { case WM_INITDIALOG: { @@ -124,7 +124,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, break; stop = p; p2 = out.find("/", p) - 1; - TCHAR *key_len = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str()), *creation_date = NULL, *expire_date = NULL; + wchar_t *key_len = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str()), *creation_date = NULL, *expire_date = NULL; p2 += 2; p = out.find(" ", p2); std::wstring key_id = toUTF16(out.substr(p2, p - p2)); @@ -149,19 +149,19 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, bool expired = false; { boost::posix_time::ptime now = boost::posix_time::second_clock::local_time(); - TCHAR buf[5]; - _tcsncpy_s(buf, expire_date, _TRUNCATE); - int year = _ttoi(buf); + wchar_t buf[5]; + wcsncpy_s(buf, expire_date, _TRUNCATE); + int year = _wtoi(buf); if (year < now.date().year()) expired = true; else if (year == now.date().year()) { - _tcsncpy_s(buf, (expire_date + 5), _TRUNCATE); - int month = _ttoi(buf); + wcsncpy_s(buf, (expire_date + 5), _TRUNCATE); + int month = _wtoi(buf); if (month < now.date().month()) expired = true; else if (month == now.date().month()) { - _tcsncpy_s(buf, (expire_date + 8), _TRUNCATE); - unsigned day = _ttoi(buf); + wcsncpy_s(buf, (expire_date + 8), _TRUNCATE); + unsigned day = _wtoi(buf); if (day <= now.date().day_number()) expired = true; } @@ -191,19 +191,19 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, } ListView_SetItemText(hwndList, iRow, 5, key_len); mir_free(key_len); - ListView_SetItemText(hwndList, iRow, 0, (TCHAR*)key_id.c_str()); + ListView_SetItemText(hwndList, iRow, 0, (wchar_t*)key_id.c_str()); p = out.find("uid ", p); p2 = out.find_first_not_of(" ", p + 5); p = out.find("<", p2); wstring tmp = toUTF16(out.substr(p2, p - p2)); - ListView_SetItemText(hwndList, iRow, 2, (TCHAR*)tmp.c_str()); + ListView_SetItemText(hwndList, iRow, 2, (wchar_t*)tmp.c_str()); p++; p2 = out.find(">", p); tmp = toUTF16(out.substr(p, p2 - p)); - ListView_SetItemText(hwndList, iRow, 1, (TCHAR*)tmp.c_str()); + ListView_SetItemText(hwndList, iRow, 1, (wchar_t*)tmp.c_str()); // get accounts int count = 0; @@ -216,7 +216,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, setting += accounts[n]->szModuleName; setting += ")"; setting += "_KeyID"; - TCHAR *str = UniGetContactSettingUtf(NULL, szGPGModuleName, setting.c_str(), L""); + wchar_t *str = UniGetContactSettingUtf(NULL, szGPGModuleName, setting.c_str(), L""); if (key_id == str) { if (!accs.empty()) accs += L","; @@ -224,7 +224,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, } mir_free(str); } - ListView_SetItemText(hwndList, iRow, 6, (TCHAR*)accs.c_str()); + ListView_SetItemText(hwndList, iRow, 6, (wchar_t*)accs.c_str()); } i++; @@ -274,10 +274,10 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, case ID_OK: { ListView_GetItemText(hwndList, itemnum, 0, fp, _countof(fp)); - TCHAR *name = new TCHAR[64]; + wchar_t *name = new wchar_t[64]; ListView_GetItemText(hwndList, itemnum, 2, name, 64); { - if (_tcschr(name, _T('('))) { + if (wcschr(name, '(')) { wstring str = name; wstring::size_type p = str.find(L"(") - 1; mir_tstrcpy(name, str.substr(0, p).c_str()); @@ -329,7 +329,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, SetWindowText(hwndCurKey_p, keyinfo.c_str()); } } - TCHAR passwd[64]; + wchar_t passwd[64]; GetDlgItemText(hwndDlg, IDC_KEY_PASSWORD, passwd, _countof(passwd)); if (passwd[0]) { string dbsetting = "szKey_"; @@ -386,7 +386,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, break; stop = p; p2 = out.find("/", p) - 1; - TCHAR *tmp = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str()); + wchar_t *tmp = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str()); item.pszText = tmp; iRow = ListView_InsertItem(hwndList, &item); ListView_SetItemText(hwndList, iRow, 4, tmp); @@ -445,7 +445,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, string::size_type s = out.find("Key fingerprint = "); s += mir_strlen("Key fingerprint = "); string::size_type s2 = out.find("\n", s); - TCHAR *str = NULL; + wchar_t *str = NULL; { string tmp = out.substr(s, s2 - s - 1).c_str(); string::size_type p = 0; @@ -505,7 +505,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, wstring path; { // generating key file - TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); path = tmp; mir_free(tmp); path.append(L"\\new_key"); @@ -660,7 +660,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, } char *szKey = (char*)GlobalLock(hMem); if (!szKey) { - TCHAR msg[64]; + wchar_t msg[64]; mir_sntprintf(msg, TranslateT("Failed to lock memory with error %d"), GetLastError()); MessageBox(0, msg, TranslateT("Error"), MB_OK); GlobalFree(hMem); @@ -671,7 +671,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, GlobalUnlock(hMem); if (!SetClipboardData(CF_OEMTEXT, hMem)) { GlobalFree(hMem); - TCHAR msg[64]; + wchar_t msg[64]; mir_sntprintf(msg, TranslateT("Failed write to clipboard with error %d"), GetLastError()); MessageBox(0, msg, TranslateT("Error"), MB_OK); } @@ -681,7 +681,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, case IDC_EXPORT_PRIVATE: { - TCHAR *p = GetFilePath(L"Choose file to export key", L"*", L"Any file", true); + wchar_t *p = GetFilePath(L"Choose file to export key", L"*", L"Any file", true); if (!p || !p[0]) { delete[] p; //TODO: handle error @@ -787,7 +787,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); { - TCHAR *path = (TCHAR*)mir_alloc(sizeof(TCHAR) * MAX_PATH); + wchar_t *path = (wchar_t*)mir_alloc(sizeof(wchar_t) * MAX_PATH); bool gpg_exists = false, lang_exists = false; { ptrA mir_path((char*)mir_alloc(sizeof(char) * MAX_PATH)); @@ -817,7 +817,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, if (!gpg_exists) { tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", (SHGetValue(HKEY_CURRENT_USER, L"Software\\GNU\\GnuPG", L"gpgProgram", 0, path, &len) == ERROR_SUCCESS) ? path : L""); if (tmp[0]) - if (!boost::filesystem::exists((TCHAR*)tmp)) + if (!boost::filesystem::exists((wchar_t*)tmp)) MessageBox(0, TranslateT("Wrong GPG binary location found in system.\nPlease choose another location"), TranslateT("Warning"), MB_OK); } else tmp = mir_wstrdup(path); @@ -887,7 +887,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case IDC_SET_BIN_PATH: { GetFilePath(L"Choose gpg.exe", "szGpgBinPath", L"*.exe", L"EXE Executables"); - TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"gpg.exe"); + wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"gpg.exe"); SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp); char mir_path[MAX_PATH]; char *atmp = mir_t2a(tmp); @@ -904,7 +904,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case IDC_SET_HOME_DIR: { GetFolderPath(L"Set home directory", "szHomePath"); - TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); SetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp); char mir_path[MAX_PATH]; char *atmp = mir_t2a(tmp); @@ -920,7 +920,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, break; case ID_OK: { - TCHAR tmp[512]; + wchar_t tmp[512]; GetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp, _countof(tmp)); if (tmp[0]) { char *mir_path = new char[MAX_PATH]; @@ -975,7 +975,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, } db_set_ts(NULL, szGPGModuleName, "szHomePath", tmp); { - TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); DWORD dwFileAttr = GetFileAttributes(path); if (dwFileAttr != INVALID_FILE_ATTRIBUTES) { dwFileAttr &= ~FILE_ATTRIBUTE_READONLY; @@ -991,7 +991,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, break; case IDC_GENERATE_RANDOM: { - TCHAR tmp[512]; + wchar_t tmp[512]; GetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp, _countof(tmp)); if (tmp[0]) { char *mir_path = new char[MAX_PATH]; @@ -1046,7 +1046,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, } db_set_ts(NULL, szGPGModuleName, "szHomePath", tmp); { - TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); DWORD dwFileAttr = GetFileAttributes(path); if (dwFileAttr != INVALID_FILE_ATTRIBUTES) { dwFileAttr &= ~FILE_ATTRIBUTE_READONLY; @@ -1058,7 +1058,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, { wstring path; { //generating key file - TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); path = tmp; mir_free(tmp); path.append(L"\\new_key"); @@ -1190,13 +1190,13 @@ static INT_PTR CALLBACK DlgProcNewKeyDialog(HWND hwndDlg, UINT msg, WPARAM wPara //new_key_hcnt_mutex.unlock(); SetWindowPos(hwndDlg, 0, new_key_rect.left, new_key_rect.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW); TranslateDialogDefault(hwndDlg); - TCHAR *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L""); + wchar_t *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L""); SetDlgItemText(hwndDlg, IDC_MESSAGE, tmp[0] ? TranslateT("There is existing key for contact, would you like to replace it with new key?") : TranslateT("New public key was received, do you want to import it?")); EnableWindow(GetDlgItem(hwndDlg, IDC_IMPORT_AND_USE), db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0) ? 0 : 1); SetDlgItemText(hwndDlg, ID_IMPORT, tmp[0] ? TranslateT("Replace") : TranslateT("Accept")); mir_free(tmp); - tmp = new TCHAR[256]; - mir_sntprintf(tmp, 255 * sizeof(TCHAR), TranslateT("Received key from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); + tmp = new wchar_t[256]; + mir_sntprintf(tmp, 255 * sizeof(wchar_t), TranslateT("Received key from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); SetDlgItemText(hwndDlg, IDC_KEY_FROM, tmp); delete[] tmp; } @@ -1267,7 +1267,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara { wstring path; { //data sanity checks - TCHAR *tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 5); + wchar_t *tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 5); GetDlgItemText(hwndDlg, IDC_KEY_TYPE, tmp, 5); if (mir_tstrlen(tmp) < 3) { mir_free(tmp); tmp = NULL; @@ -1276,15 +1276,15 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara } if (tmp) mir_free(tmp); - tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 6); + tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 6); GetDlgItemText(hwndDlg, IDC_KEY_LENGTH, tmp, 5); - int length = _ttoi(tmp); + int length = _wtoi(tmp); mir_free(tmp); if (length < 1024 || length > 4096) { MessageBox(0, TranslateT("Key length must be of length from 1024 to 4096 bits"), TranslateT("Error"), MB_OK); break; } - tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 12); + tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 12); GetDlgItemText(hwndDlg, IDC_KEY_EXPIRE_DATE, tmp, 11); if (mir_tstrlen(tmp) != 10 && tmp[0] != '0') { MessageBox(0, TranslateT("Invalid date"), TranslateT("Error"), MB_OK); @@ -1292,22 +1292,22 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara break; } mir_free(tmp); - tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 128); + tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 128); GetDlgItemText(hwndDlg, IDC_KEY_REAL_NAME, tmp, 127); if (mir_tstrlen(tmp) < 5) { MessageBox(0, TranslateT("Name must contain at least 5 characters"), TranslateT("Error"), MB_OK); mir_free(tmp); break; } - else if (_tcschr(tmp, _T('(')) || _tcschr(tmp, _T(')'))) { + else if (wcschr(tmp, '(') || wcschr(tmp, ')')) { MessageBox(0, TranslateT("Name cannot contain '(' or ')'"), TranslateT("Error"), MB_OK); mir_free(tmp); break; } mir_free(tmp); - tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 128); + tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 128); GetDlgItemText(hwndDlg, IDC_KEY_EMAIL, tmp, 128); - if ((mir_tstrlen(tmp)) < 5 || (!_tcschr(tmp, _T('@'))) || (!_tcschr(tmp, _T('.')))) { + if ((mir_tstrlen(tmp)) < 5 || (!wcschr(tmp, '@')) || (!wcschr(tmp, '.'))) { MessageBox(0, TranslateT("Invalid Email"), TranslateT("Error"), MB_OK); mir_free(tmp); break; @@ -1315,7 +1315,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara mir_free(tmp); } { //generating key file - TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); char *tmp2;// = mir_t2a(tmp); path = tmp; mir_free(tmp); @@ -1327,7 +1327,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara break; } f << "Key-Type: "; - tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 5); + tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 5); GetDlgItemText(hwndDlg, IDC_KEY_TYPE, tmp, 5); tmp2 = mir_t2a(tmp); mir_free(tmp); @@ -1340,9 +1340,9 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara mir_free(tmp2); f << "\n"; f << "Key-Length: "; - tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 5); + tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 5); GetDlgItemText(hwndDlg, IDC_KEY_LENGTH, tmp, 5); - int length = _ttoi(tmp); + int length = _wtoi(tmp); mir_free(tmp); f << length; f << "\n"; @@ -1353,7 +1353,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara f << subkeytype; mir_free(subkeytype); f << "\n"; - tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 64); //i hope this is enough for password + tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 64); //i hope this is enough for password GetDlgItemText(hwndDlg, IDC_KEY_PASSWD, tmp, 64); if (tmp[0]) { f << "Passphrase: "; @@ -1364,14 +1364,14 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara } mir_free(tmp); f << "Name-Real: "; - tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 128); + tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 128); GetDlgItemText(hwndDlg, IDC_KEY_REAL_NAME, tmp, 128); tmp2 = mir_strdup(toUTF8(tmp).c_str()); f << tmp2; mir_free(tmp2); mir_free(tmp); f << "\n"; - tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 512); + tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 512); GetDlgItemText(hwndDlg, IDC_KEY_COMMENT, tmp, 512); if (tmp[0]) { tmp2 = mir_strdup(toUTF8(tmp).c_str()); @@ -1382,7 +1382,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara mir_free(tmp2); mir_free(tmp); f << "Name-Email: "; - tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 128); + tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 128); GetDlgItemText(hwndDlg, IDC_KEY_EMAIL, tmp, 128); tmp2 = mir_strdup(toUTF8(tmp).c_str()); f << tmp2; @@ -1390,7 +1390,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara mir_free(tmp); f << "\n"; f << "Expire-Date: "; - tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 12); + tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 12); GetDlgItemText(hwndDlg, IDC_KEY_EXPIRE_DATE, tmp, 12); tmp2 = mir_strdup(toUTF8(tmp).c_str()); f << tmp2; @@ -1462,7 +1462,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara break; stop = p; p2 = out.find("/", p) - 1; - TCHAR *tmp = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str()); + wchar_t *tmp = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str()); item.pszText = tmp; iRow = ListView_InsertItem(hwndList_g, &item); ListView_SetItemText(hwndList_g, iRow, 4, tmp); @@ -1540,7 +1540,7 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg, UINT msg, WPARAM wP LVCOLUMN col = { 0 }; LVITEM item = { 0 }; NMLISTVIEW * hdr = (NMLISTVIEW *)lParam; - TCHAR id[16] = { 0 }; + wchar_t id[16] = { 0 }; switch (msg) { case WM_INITDIALOG: { @@ -1614,7 +1614,7 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg, UINT msg, WPARAM wP break; stop = p; p2 = out.find("/", p) - 1; - TCHAR *tmp = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str()); + wchar_t *tmp = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str()); item.pszText = tmp; iRow = ListView_InsertItem(hwndList, &item); ListView_SetItemText(hwndList, iRow, 5, tmp); @@ -1714,7 +1714,7 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg, UINT msg, WPARAM wP if (p2 != std::string::npos) { p2 += mir_strlen("-----END PGP PUBLIC KEY BLOCK-----"); out = out.substr(p1, p2 - p1); - TCHAR *tmp = mir_a2t(out.c_str()); + wchar_t *tmp = mir_a2t(out.c_str()); SetWindowText(hPubKeyEdit, tmp); mir_free(tmp); } @@ -1786,7 +1786,7 @@ static INT_PTR CALLBACK DlgProcImportKeyDialog(HWND hwndDlg, UINT msg, WPARAM wP DWORD code; std::vector<wstring> cmd; cmd.push_back(L"--keyserver"); - TCHAR *server = new TCHAR[128]; + wchar_t *server = new wchar_t[128]; GetDlgItemText(hwndDlg, IDC_KEYSERVER, server, 128); cmd.push_back(server); delete[] server; @@ -1875,13 +1875,13 @@ void InitCheck() { { // parse gpg output - TCHAR *current_home = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *current_home = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); db_set_ts(NULL, szGPGModuleName, "szHomePath", L""); //we do not need home for gpg binary validation gpg_valid = isGPGValid(); db_set_ts(NULL, szGPGModuleName, "szHomePath", current_home); //return current home dir back mir_free(current_home); bool home_dir_access = false, temp_access = false; - TCHAR *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); std::wstring test_path = home_dir; mir_free(home_dir); test_path += L"/"; @@ -1908,8 +1908,8 @@ void InitCheck() boost::filesystem::remove(test_path); } if (!home_dir_access || !temp_access || !gpg_valid) { - TCHAR buf[4096]; - _tcsncpy(buf, gpg_valid ? TranslateT("GPG binary is set and valid (this is good).\n") : TranslateT("GPG binary unset or invalid (plugin will not work).\n"), _countof(buf)); + wchar_t buf[4096]; + wcsncpy(buf, gpg_valid ? TranslateT("GPG binary is set and valid (this is good).\n") : TranslateT("GPG binary unset or invalid (plugin will not work).\n"), _countof(buf)); mir_tstrncat(buf, home_dir_access ? TranslateT("Home dir write access granted (this is good).\n") : TranslateT("Home dir has no write access (plugin most probably will not work).\n"), _countof(buf) - mir_tstrlen(buf)); mir_tstrncat(buf, temp_access ? TranslateT("Temp dir write access granted (this is good).\n") : TranslateT("Temp dir has no write access (plugin should work, but may have some problems, file transfers will not work)."), _countof(buf) - mir_tstrlen(buf)); if (!gpg_valid) @@ -1977,23 +1977,23 @@ void InitCheck() p += mir_strlen("expires:"); p++; p2 = out.find("]", p); - TCHAR *expire_date = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str()); + wchar_t *expire_date = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str()); bool expired = false; { boost::posix_time::ptime now = boost::posix_time::second_clock::local_time(); - TCHAR buf[5]; - _tcsncpy_s(buf, expire_date, _TRUNCATE); - int year = _ttoi(buf); + wchar_t buf[5]; + wcsncpy_s(buf, expire_date, _TRUNCATE); + int year = _wtoi(buf); if (year < now.date().year()) expired = true; else if (year == now.date().year()) { - _tcsncpy_s(buf, (expire_date + 5), _TRUNCATE); - int month = _ttoi(buf); + wcsncpy_s(buf, (expire_date + 5), _TRUNCATE); + int month = _wtoi(buf); if (month < now.date().month()) expired = true; else if (month == now.date().month()) { - _tcsncpy_s(buf, (expire_date + 8), _TRUNCATE); - unsigned day = _ttoi(buf); + wcsncpy_s(buf, (expire_date + 8), _TRUNCATE); + unsigned day = _wtoi(buf); if (day <= now.date().day_number()) expired = true; } @@ -2037,23 +2037,23 @@ void InitCheck() p += mir_strlen("expires:"); p++; p2 = out.find("]", p); - TCHAR *expire_date = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str()); + wchar_t *expire_date = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str()); bool expired = false; { boost::posix_time::ptime now = boost::posix_time::second_clock::local_time(); - TCHAR buf[5]; - _tcsncpy_s(buf, expire_date, _TRUNCATE); - int year = _ttoi(buf); + wchar_t buf[5]; + wcsncpy_s(buf, expire_date, _TRUNCATE); + int year = _wtoi(buf); if (year < now.date().year()) expired = true; else if (year == now.date().year()) { - _tcsncpy_s(buf, (expire_date + 5), _TRUNCATE); - int month = _ttoi(buf); + wcsncpy_s(buf, (expire_date + 5), _TRUNCATE); + int month = _wtoi(buf); if (month < now.date().month()) expired = true; else if (month == now.date().month()) { - _tcsncpy_s(buf, (expire_date + 8), _TRUNCATE); - unsigned day = _ttoi(buf); + wcsncpy_s(buf, (expire_date + 8), _TRUNCATE); + unsigned day = _wtoi(buf); if (day <= now.date().day_number()) expired = true; } @@ -2072,7 +2072,7 @@ void InitCheck() mir_free(key); } { - TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); DWORD dwFileAttr = GetFileAttributes(path); if (dwFileAttr != INVALID_FILE_ATTRIBUTES) { dwFileAttr &= ~FILE_ATTRIBUTE_READONLY; @@ -2135,9 +2135,9 @@ void ImportKey() // gpg execute block std::vector<wstring> cmd; - TCHAR tmp2[MAX_PATH] = { 0 }; + wchar_t tmp2[MAX_PATH] = { 0 }; { - _tcsncpy(tmp2, ptrT(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"")), MAX_PATH - 1); + wcsncpy(tmp2, ptrT(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"")), MAX_PATH - 1); mir_tstrncat(tmp2, L"\\", _countof(tmp2) - mir_tstrlen(tmp2)); mir_tstrncat(tmp2, L"temporary_exported.asc", _countof(tmp2) - mir_tstrlen(tmp2)); boost::filesystem::remove(tmp2); diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index de5940cb32..7ea7e6f1eb 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -105,14 +105,14 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR mir_free(tmp); f.close(); } - extern TCHAR *password; + extern wchar_t *password; string out; DWORD code; std::vector<wstring> cmd; cmd.push_back(L"--batch"); { char *inkeyid = UniGetContactSettingUtf(db_mc_isMeta(hContact) ? metaGetMostOnline(hContact) : hContact, szGPGModuleName, "InKeyID", ""); - TCHAR *pass = NULL; + wchar_t *pass = NULL; if (inkeyid[0]) { string dbsetting = "szKey_"; dbsetting += inkeyid; @@ -422,7 +422,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) db_set_ts(ccs->hContact, szGPGModuleName, "GPGPubKey", str.substr(s1, s2 - s1).c_str()); { //gpg execute block std::vector<wstring> cmd; - TCHAR tmp2[MAX_PATH] = { 0 }; + wchar_t tmp2[MAX_PATH] = { 0 }; string output; DWORD exitcode; { @@ -430,7 +430,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) mir_tstrcpy(tmp2, ptmp); mir_free(ptmp); mir_tstrcat(tmp2, L"\\"); - TCHAR *tmp3 = mir_a2t(get_random(5).c_str()); + wchar_t *tmp3 = mir_a2t(get_random(5).c_str()); mir_tstrcat(tmp2, tmp3); mir_tstrcat(tmp2, L".asc"); mir_free(tmp3); @@ -460,7 +460,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) } } ptmp = UniGetContactSettingUtf(ccs->hContact, szGPGModuleName, "GPGPubKey", L""); - f << (TCHAR*)ptmp; + f << (wchar_t*)ptmp; f.close(); cmd.push_back(L"--batch"); cmd.push_back(L"--import"); @@ -613,14 +613,14 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) } else { - TCHAR *jid = UniGetContactSettingUtf(ccs->hContact, proto, "jid", L""); + wchar_t *jid = UniGetContactSettingUtf(ccs->hContact, proto, "jid", L""); if (jid[0]) { extern list <JabberAccount*> Accounts; list<JabberAccount*>::iterator end = Accounts.end(); for (list<JabberAccount*>::iterator p = Accounts.begin(); p != end; p++) { - TCHAR *caps = (*p)->getJabberInterface()->GetResourceFeatures(jid); + wchar_t *caps = (*p)->getJabberInterface()->GetResourceFeatures(jid); if (caps) { wstring str1; @@ -666,7 +666,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags) std::vector<std::wstring> cmd; extern bool bJabberAPI, bIsMiranda09; { - TCHAR *tmp2; + wchar_t *tmp2; { char *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", ""); if (!tmp[0]) { @@ -695,7 +695,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags) mir_free(tmp2); } { - TCHAR *tmp2 = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *tmp2 = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); path = tmp2; cmd.push_back(std::wstring(tmp2) + L"\\tmp\\" + file); mir_free(tmp2); @@ -813,7 +813,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags) str.clear(); if (f.is_open()) { std::wifstream::pos_type size = f.tellg(); - TCHAR *tmp = new TCHAR[(std::ifstream::pos_type)size + (std::ifstream::pos_type)1]; + wchar_t *tmp = new wchar_t[(std::ifstream::pos_type)size + (std::ifstream::pos_type)1]; f.seekg(0, std::ios::beg); f.read(tmp, size); tmp[size] = '\0'; @@ -887,7 +887,7 @@ int HookSendMsg(WPARAM w, LPARAM l) return 0; MCONTACT hContact = (MCONTACT)w; if (dbei->flags & DBEF_SENT) { - if (isContactSecured(hContact) && strstr((char*)dbei->pBlob, "-----BEGIN PGP MESSAGE-----")) //our service data, can be double added by metacontacts e.t.c. + if (isContactSecured(hContact) && strstr((char*)dbei->pBlob, "-----BEGIN PGP MESSAGE-----")) //our service data, can be double added by metacontacts e.w.c. { if (bDebugLog) debuglog << std::string(time_str() + ": info(send handler): block pgp message event, name: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); @@ -933,14 +933,14 @@ int HookSendMsg(WPARAM w, LPARAM l) } } else { - TCHAR *jid = UniGetContactSettingUtf(hContact, proto, "jid", L""); + wchar_t *jid = UniGetContactSettingUtf(hContact, proto, "jid", L""); if (jid[0]) { if (bDebugLog) debuglog << std::string(time_str() + ": info(autoexchange): protocol looks like jabber, name: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); extern list <JabberAccount*> Accounts; list<JabberAccount*>::iterator end = Accounts.end(); for (list<JabberAccount*>::iterator p = Accounts.begin(); p != end; p++) { - TCHAR *caps = (*p)->getJabberInterface()->GetResourceFeatures(jid); + wchar_t *caps = (*p)->getJabberInterface()->GetResourceFeatures(jid); if (caps) { wstring str; for (int i = 0;; i++) { @@ -1024,10 +1024,10 @@ static INT_PTR CALLBACK DlgProcKeyPassword(HWND hwndDlg, UINT msg, WPARAM wParam switch (LOWORD(wParam)) { case IDOK: { - TCHAR tmp[64]; + wchar_t tmp[64]; GetDlgItemText(hwndDlg, IDC_KEY_PASSWORD, tmp, _countof(tmp)); if (tmp[0]) { - extern TCHAR *password; + extern wchar_t *password; if (IsDlgButtonChecked(hwndDlg, IDC_SAVE_PASSWORD)) { inkeyid = UniGetContactSettingUtf(new_key_hcnt, szGPGModuleName, "InKeyID", ""); if (inkeyid && inkeyid[0] && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DEFAULT_PASSWORD)) { @@ -1040,7 +1040,7 @@ static INT_PTR CALLBACK DlgProcKeyPassword(HWND hwndDlg, UINT msg, WPARAM wParam } if (password) mir_free(password); - password = (TCHAR*)mir_alloc(sizeof(TCHAR)*(mir_tstrlen(tmp) + 1)); + password = (wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_tstrlen(tmp) + 1)); mir_tstrcpy(password, tmp); } mir_free(inkeyid); diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index 2b4caf0911..68595f9ce9 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -43,25 +43,25 @@ int GpgOptInit(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GPG);
- odp.ptszTitle = _T(szGPGModuleName);
- odp.ptszGroup = LPGENT("Services");
- odp.ptszTab = LPGENT("Main");
+ odp.pwszTitle = _T(szGPGModuleName);
+ odp.pwszGroup = LPGENW("Services");
+ odp.pwszTab = LPGENW("Main");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = DlgProcGpgOpts;
Options_AddPage(wParam, &odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GPG_BIN);
- odp.ptszTab = LPGENT("GnuPG Variables");
+ odp.pwszTab = LPGENW("GnuPG Variables");
odp.pfnDlgProc = DlgProcGpgBinOpts;
Options_AddPage(wParam, &odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GPG_MESSAGES);
- odp.ptszTab = LPGENT("Messages");
+ odp.pwszTab = LPGENW("Messages");
odp.pfnDlgProc = DlgProcGpgMsgOpts;
Options_AddPage(wParam, &odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GPG_ADVANCED);
- odp.ptszTab = LPGENT("Advanced");
+ odp.pwszTab = LPGENW("Advanced");
odp.pfnDlgProc = DlgProcGpgAdvOpts;
Options_AddPage(wParam, &odp);
return 0;
@@ -120,7 +120,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L int i = 1, iRow = 0;
for (MCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) {
if (isContactHaveKey(hContact)) {
- TCHAR *name = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = pcli->pfnGetContactDisplayName(hContact, 0);
item.mask = LVIF_TEXT;
item.iItem = i;
item.iSubItem = 0;
@@ -128,7 +128,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L iRow = ListView_InsertItem(hwndList, &item);
ListView_SetItemText(hwndList, iRow, 0, name);
- TCHAR *tmp = mir_a2t(GetContactProto(hContact));
+ wchar_t *tmp = mir_a2t(GetContactProto(hContact));
ListView_SetItemText(hwndList, iRow, 4, tmp);
mir_free(tmp);
@@ -168,7 +168,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L i++;
}
}
- TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szLogFilePath", L"");
+ wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szLogFilePath", L"");
SetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, (mir_tstrlen(tmp) > 1) ? tmp : L"c:\\GPGdebug.log");
mir_free(tmp);
CheckStateLoadDB(hwndDlg, IDC_DEBUG_LOG, "bDebugLog", 0);
@@ -195,7 +195,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L void setClistIcon(MCONTACT hContact);
void setSrmmIcon(MCONTACT hContact);
{ //gpg execute block
- TCHAR *ptmp;
+ wchar_t *ptmp;
char *tmp;
bool keep = false;
bool ismetacontact = false;
@@ -304,7 +304,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L case IDC_SAVE_KEY_BUTTON:
{
- TCHAR *tmp = GetFilePath(TranslateT("Export public key"), L"*", TranslateT(".asc pubkey file"), true);
+ wchar_t *tmp = GetFilePath(TranslateT("Export public key"), L"*", TranslateT(".asc pubkey file"), true);
if (tmp) {
wstring str(ptrT(UniGetContactSettingUtf(user_data[item_num + 1], szGPGModuleName, "GPGPubKey", L"")));
wstring::size_type s = 0;
@@ -332,7 +332,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L }
szKey = (char*)GlobalLock(hMem);
if (!szKey) {
- TCHAR msg[64];
+ wchar_t msg[64];
mir_sntprintf(msg, TranslateT("Failed to lock memory with error %d"), GetLastError());
MessageBox(0, msg, TranslateT("Error"), MB_OK);
GlobalFree(hMem);
@@ -345,7 +345,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L GlobalUnlock(hMem);
if (!SetClipboardData(CF_OEMTEXT, hMem)) {
GlobalFree(hMem);
- TCHAR msg[64];
+ wchar_t msg[64];
mir_sntprintf(msg, TranslateT("Failed write to clipboard with error %d"), GetLastError());
MessageBox(0, msg, TranslateT("Error"), MB_OK);
}
@@ -353,7 +353,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L }
}
else {
- TCHAR msg[64];
+ wchar_t msg[64];
mir_sntprintf(msg, TranslateT("Failed to open clipboard with error %d"), GetLastError());
MessageBox(0, msg, TranslateT("Error"), MB_OK);
}
@@ -397,7 +397,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L }
bAutoExchange = CheckStateStoreDB(hwndDlg, IDC_AUTO_EXCHANGE, "bAutoExchange") != 0;
{
- TCHAR tmp[512];
+ wchar_t tmp[512];
GetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szLogFilePath", tmp);
}
@@ -424,7 +424,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case IDC_SET_BIN_PATH:
{
GetFilePath(TranslateT("Choose gpg.exe"), "szGpgBinPath", L"*.exe", TranslateT("EXE Executables"));
- TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"gpg.exe");
+ wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"gpg.exe");
SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp);
bool gpg_exists = false;
{
@@ -432,7 +432,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, gpg_exists = true;
if (gpg_exists) {
bool bad_version = false;
- TCHAR *tmp_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"");
+ wchar_t *tmp_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"");
db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
string out;
DWORD code;
@@ -478,7 +478,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case IDC_SET_HOME_DIR:
{
GetFolderPath(TranslateT("Set home directory"), "szHomePath");
- TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
SetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp);
char mir_path[MAX_PATH];
char *atmp = mir_t2a(tmp);
@@ -503,7 +503,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- TCHAR tmp[512];
+ wchar_t tmp[512];
GetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, _countof(tmp));
@@ -526,7 +526,7 @@ static INT_PTR CALLBACK DlgProcGpgMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, CheckStateLoadDB(hwndDlg, IDC_APPEND_TAGS, "bAppendTags", 0);
CheckStateLoadDB(hwndDlg, IDC_STRIP_TAGS, "bStripTags", 0);
{
- TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szInOpenTag", L"<GPGdec>");
+ wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szInOpenTag", L"<GPGdec>");
SetDlgItemText(hwndDlg, IDC_IN_OPEN_TAG, tmp);
mir_free(tmp);
tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szInCloseTag", L"</GPGdec>");
@@ -565,26 +565,26 @@ static INT_PTR CALLBACK DlgProcGpgMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, bAppendTags = CheckStateStoreDB(hwndDlg, IDC_APPEND_TAGS, "bAppendTags") != 0;
bStripTags = CheckStateStoreDB(hwndDlg, IDC_STRIP_TAGS, "bStripTags") != 0;
{
- TCHAR tmp[128];
+ wchar_t tmp[128];
GetDlgItemText(hwndDlg, IDC_IN_OPEN_TAG, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szInOpenTag", tmp);
mir_free(inopentag);
- inopentag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (mir_tstrlen(tmp) + 1));
+ inopentag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_tstrlen(tmp) + 1));
mir_tstrcpy(inopentag, tmp);
GetDlgItemText(hwndDlg, IDC_IN_CLOSE_TAG, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szInCloseTag", tmp);
mir_free(inclosetag);
- inclosetag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (mir_tstrlen(tmp) + 1));
+ inclosetag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_tstrlen(tmp) + 1));
mir_tstrcpy(inclosetag, tmp);
GetDlgItemText(hwndDlg, IDC_OUT_OPEN_TAG, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szOutOpenTag", tmp);
mir_free(outopentag);
- outopentag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (mir_tstrlen(tmp) + 1));
+ outopentag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_tstrlen(tmp) + 1));
mir_tstrcpy(outopentag, tmp);
GetDlgItemText(hwndDlg, IDC_OUT_CLOSE_TAG, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szOutCloseTag", tmp);
mir_free(outclosetag);
- outclosetag = (TCHAR*)mir_alloc(sizeof(TCHAR)*(mir_tstrlen(tmp) + 1));
+ outclosetag = (wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_tstrlen(tmp) + 1));
mir_tstrcpy(outclosetag, tmp);
}
return TRUE;
@@ -679,7 +679,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa CheckDlgButton(hwndDlg, IDC_ENABLE_ENCRYPTION, BST_CHECKED);
}
if (hcnt) {
- TCHAR *tmp = UniGetContactSettingUtf(hcnt, szGPGModuleName, "GPGPubKey", L"");
+ wchar_t *tmp = UniGetContactSettingUtf(hcnt, szGPGModuleName, "GPGPubKey", L"");
wstring str = tmp;
mir_free(tmp); tmp = NULL;
if (!str.empty()) {
@@ -713,7 +713,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa if ((out.find("-----BEGIN PGP PUBLIC KEY BLOCK-----") != string::npos) && (out.find("-----END PGP PUBLIC KEY BLOCK-----") != string::npos)) {
boost::algorithm::replace_all(out, "\n", "\r\n");
- TCHAR *tmp3 = mir_a2t(out.c_str());
+ wchar_t *tmp3 = mir_a2t(out.c_str());
str.clear();
str.append(tmp3);
mir_free(tmp3);
@@ -747,8 +747,8 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa switch (LOWORD(wParam)) {
case ID_OK:
{
- TCHAR *tmp = new TCHAR[40960];
- TCHAR *begin, *end;
+ wchar_t *tmp = new wchar_t[40960];
+ wchar_t *begin, *end;
GetDlgItemText(hwndDlg, IDC_PUBLIC_KEY_EDIT, tmp, 40960);
key_buf.append(tmp);
key_buf.append(L"\n"); //no new line at end of file )
@@ -758,15 +758,15 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa }
ws1 = 0;
if (((ws2 = key_buf.find(L"-----END PGP PUBLIC KEY BLOCK-----")) != wstring::npos) && ((ws1 = key_buf.find(L"-----BEGIN PGP PUBLIC KEY BLOCK-----")) != wstring::npos)) {
- begin = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(L"-----BEGIN PGP PUBLIC KEY BLOCK-----") + 1));
+ begin = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(L"-----BEGIN PGP PUBLIC KEY BLOCK-----") + 1));
mir_tstrcpy(begin, L"-----BEGIN PGP PUBLIC KEY BLOCK-----");
- end = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(L"-----END PGP PUBLIC KEY BLOCK-----") + 1));
+ end = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(L"-----END PGP PUBLIC KEY BLOCK-----") + 1));
mir_tstrcpy(end, L"-----END PGP PUBLIC KEY BLOCK-----");
}
else if (((ws2 = key_buf.find(L"-----END PGP PRIVATE KEY BLOCK-----")) != wstring::npos) && ((ws1 = key_buf.find(L"-----BEGIN PGP PRIVATE KEY BLOCK-----")) != wstring::npos)) {
- begin = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(L"-----BEGIN PGP PRIVATE KEY BLOCK-----") + 1));
+ begin = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(L"-----BEGIN PGP PRIVATE KEY BLOCK-----") + 1));
mir_tstrcpy(begin, L"-----BEGIN PGP PRIVATE KEY BLOCK-----");
- end = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(L"-----END PGP PRIVATE KEY BLOCK-----") + 1));
+ end = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(L"-----END PGP PRIVATE KEY BLOCK-----") + 1));
mir_tstrcpy(end, L"-----END PGP PRIVATE KEY BLOCK-----");
}
else {
@@ -790,18 +790,18 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa }
else db_set_ts(hContact, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str());
}
- tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * (key_buf.length() + 1));
+ tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * (key_buf.length() + 1));
mir_tstrcpy(tmp, key_buf.substr(ws1, ws2 - ws1).c_str());
{ //gpg execute block
std::vector<wstring> cmd;
- TCHAR tmp2[MAX_PATH] = { 0 };
- TCHAR *ptmp;
+ wchar_t tmp2[MAX_PATH] = { 0 };
+ wchar_t *ptmp;
string output;
DWORD exitcode;
{
MCONTACT hcnt = db_mc_tryMeta(hContact);
ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
- _tcsncpy(tmp2, ptmp, MAX_PATH - 1);
+ wcsncpy(tmp2, ptmp, MAX_PATH - 1);
mir_free(ptmp);
mir_tstrncat(tmp2, L"\\", _countof(tmp2) - mir_tstrlen(tmp2));
mir_tstrncat(tmp2, L"temporary_exported.asc", _countof(tmp2) - mir_tstrlen(tmp2));
@@ -1004,7 +1004,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa }
}
if (!hContact) {
- TCHAR *fp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", L"");
+ wchar_t *fp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", L"");
{
string out;
DWORD code;
@@ -1069,7 +1069,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa break;
case ID_LOAD_FROM_FILE:
{
- TCHAR *tmp = GetFilePath(TranslateT("Set file containing GPG public key"), L"*", TranslateT("GPG public key file"));
+ wchar_t *tmp = GetFilePath(TranslateT("Set file containing GPG public key"), L"*", TranslateT("GPG public key file"));
if (!tmp)
break;
@@ -1081,7 +1081,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa }
if (f.is_open()) {
std::wifstream::pos_type size = f.tellg();
- TCHAR *temp = new TCHAR[(std::ifstream::pos_type)size + (std::ifstream::pos_type)1];
+ wchar_t *temp = new wchar_t[(std::ifstream::pos_type)size + (std::ifstream::pos_type)1];
f.seekg(0, std::ios::beg);
f.read(temp, size);
temp[size] = '\0';
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 4de5fc75a8..1a169bbcb3 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -24,10 +24,10 @@ extern HINSTANCE hInst; extern HANDLE hLoadPublicKey; extern HGENMENU hToggleEncryption, hSendKey; -TCHAR* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule, const char* szSetting, TCHAR* szDef) +wchar_t* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule, const char* szSetting, wchar_t* szDef) { DBVARIANT dbv = { DBVT_DELETED }; - TCHAR* szRes = NULL; + wchar_t* szRes = NULL; if (db_get_ts(hContact, szModule, szSetting, &dbv)) return mir_tstrdup(szDef); else if (dbv.pszVal) @@ -53,22 +53,22 @@ char* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule, return szRes; } -void GetFilePath(TCHAR *WindowTittle, char *szSetting, TCHAR *szExt, TCHAR *szExtDesc) +void GetFilePath(wchar_t *WindowTittle, char *szSetting, wchar_t *szExt, wchar_t *szExtDesc) { - TCHAR str[MAX_PATH + 2] = { 0 }, *tmp; + wchar_t str[MAX_PATH + 2] = { 0 }, *tmp; OPENFILENAME ofn = { 0 }; - TCHAR filter[512], *pfilter; + wchar_t filter[512], *pfilter; ofn.lStructSize = CDSIZEOF_STRUCT(OPENFILENAME, lpTemplateName); ofn.Flags = OFN_EXPLORER; ofn.lpstrTitle = TranslateW(WindowTittle); - _tcsncpy(filter, TranslateW(szExtDesc), _countof(filter) - 1); + wcsncpy(filter, TranslateW(szExtDesc), _countof(filter) - 1); pfilter = filter + mir_tstrlen(filter) + 1; mir_tstrcpy(pfilter, szExt); pfilter[mir_tstrlen(pfilter) + 1] = '\0'; pfilter[mir_tstrlen(pfilter) + 2] = '\0'; ofn.lpstrFilter = filter; tmp = UniGetContactSettingUtf(0, szGPGModuleName, szSetting, L""); - _tcsncpy(str, tmp, _countof(str) - 1); + wcsncpy(str, tmp, _countof(str) - 1); mir_free(tmp); if (mir_tstrlen(str) < 2) str[0] = '\0'; @@ -80,11 +80,11 @@ void GetFilePath(TCHAR *WindowTittle, char *szSetting, TCHAR *szExt, TCHAR *szEx db_set_ts(0, szGPGModuleName, szSetting, str); } -TCHAR *GetFilePath(TCHAR *WindowTittle, TCHAR *szExt, TCHAR *szExtDesc, bool save_file) +wchar_t *GetFilePath(wchar_t *WindowTittle, wchar_t *szExt, wchar_t *szExtDesc, bool save_file) { - TCHAR *str = new TCHAR[MAX_PATH + 2]; + wchar_t *str = new wchar_t[MAX_PATH + 2]; OPENFILENAME ofn = { 0 }; - TCHAR filter[512], *pfilter; + wchar_t filter[512], *pfilter; ofn.lStructSize = CDSIZEOF_STRUCT(OPENFILENAME, lpTemplateName); ofn.Flags = OFN_EXPLORER; ofn.lpstrTitle = TranslateW(WindowTittle); @@ -115,14 +115,14 @@ TCHAR *GetFilePath(TCHAR *WindowTittle, TCHAR *szExt, TCHAR *szExtDesc, bool sav return str; } -void GetFolderPath(TCHAR *WindowTittle, char*) +void GetFolderPath(wchar_t *WindowTittle, char*) { BROWSEINFO pbi = { 0 }; pbi.lpszTitle = WindowTittle; pbi.ulFlags = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_SHAREABLE; LPITEMIDLIST pidl = SHBrowseForFolder(&pbi); if (pidl != 0) { - TCHAR path[MAX_PATH]; + wchar_t path[MAX_PATH]; if (SHGetPathFromIDList(pidl, path)) { db_set_ts(NULL, szGPGModuleName, "szHomePath", path); } @@ -213,7 +213,7 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM) setSrmmIcon(hContact); setClistIcon(hContact); - Menu_ModifyItem(hToggleEncryption, enc ? LPGENT("Turn off GPG encryption") : LPGENT("Turn on GPG encryption")); + Menu_ModifyItem(hToggleEncryption, enc ? LPGENW("Turn off GPG encryption") : LPGENW("Turn on GPG encryption")); return 0; } @@ -237,14 +237,14 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM) mir_free(keyid); keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", ""); } - TCHAR buf[128] = { 0 }; + wchar_t buf[128] = { 0 }; mir_sntprintf(buf, L"%s: %s", TranslateT("Send public key"), toUTF16(keyid).c_str()); mir_free(keyid); Menu_ModifyItem(hSendKey, buf); } int flags; - TCHAR *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L""); + wchar_t *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L""); if (!tmp[0]) { db_unset(hContact, szGPGModuleName, "GPGEncryption"); flags = CMIF_GRAYED; @@ -276,7 +276,7 @@ int onProtoAck(WPARAM, LPARAM l) break; PROTOFILETRANSFERSTATUS *f = (PROTOFILETRANSFERSTATUS*)ack->hProcess; if ((f->flags & PFTS_SENDING) != PFTS_SENDING) { - TCHAR *filename = NULL; + wchar_t *filename = NULL; if (f->flags & PFTS_UNICODE) { if (f->tszCurrentFile && f->tszCurrentFile[0]) filename = mir_wstrdup(f->tszCurrentFile); @@ -289,7 +289,7 @@ int onProtoAck(WPARAM, LPARAM l) if (!filename) return 0; } - if (_tcsstr(filename, L".gpg")) //decrypt it + if (wcsstr(filename, L".gpg")) //decrypt it { //process encrypted file if (!bFileTransfers && !bSameAction) { void ShowEncryptedFileMsgBox(); @@ -316,9 +316,9 @@ int onProtoAck(WPARAM, LPARAM l) } cmd.push_back(file); boost::filesystem::remove(file); - extern TCHAR *password; + extern wchar_t *password; { // password - TCHAR *pass = NULL; + wchar_t *pass = NULL; char *keyid = UniGetContactSettingUtf(ack->hContact, szGPGModuleName, "KeyID", ""); if (mir_strlen(keyid) > 0) { string dbsetting = "szKey_"; @@ -421,7 +421,7 @@ int onProtoAck(WPARAM, LPARAM l) return 0; } -std::wstring encrypt_file(MCONTACT hContact, TCHAR *filename) +std::wstring encrypt_file(MCONTACT hContact, wchar_t *filename) { string out; DWORD code; @@ -432,13 +432,13 @@ std::wstring encrypt_file(MCONTACT hContact, TCHAR *filename) cmd.push_back(L"--tes"); cmd.push_back(L"-r"); char *keyid = UniGetContactSettingUtf(hcnt, szGPGModuleName, "KeyID", ""); - TCHAR *szKeyid = mir_a2t(keyid); - TCHAR *name = _tcsrchr(filename, _T('\\')); + wchar_t *szKeyid = mir_a2t(keyid); + wchar_t *name = wcsrchr(filename, '\\'); if (!name) name = filename; else name++; - TCHAR *file_out = new TCHAR[mir_tstrlen(name) + mir_tstrlen(L".gpg") + 1]; + wchar_t *file_out = new wchar_t[mir_tstrlen(name) + mir_tstrlen(L".gpg") + 1]; mir_sntprintf(file_out, mir_tstrlen(name) + mir_tstrlen(L".gpg") + 1, L"%s.gpg", name); cmd.push_back(szKeyid); if (db_get_b(hcnt, szGPGModuleName, "bAlwaysTrust", 0)) { @@ -448,7 +448,7 @@ std::wstring encrypt_file(MCONTACT hContact, TCHAR *filename) mir_free(szKeyid); mir_free(keyid); cmd.push_back(L"-o"); - TCHAR *temp = _tgetenv(L"TEMP"); + wchar_t *temp = _tgetenv(L"TEMP"); cmd.push_back(wstring(temp) + L"\\" + file_out); wstring path_out = temp; path_out += L"\\"; @@ -501,12 +501,12 @@ INT_PTR onSendFile(WPARAM w, LPARAM l) } } else { - TCHAR *jid = UniGetContactSettingUtf(ccs->hContact, proto, "jid", L""); + wchar_t *jid = UniGetContactSettingUtf(ccs->hContact, proto, "jid", L""); if (jid[0]) { extern list <JabberAccount*> Accounts; list<JabberAccount*>::iterator end = Accounts.end(); for (list<JabberAccount*>::iterator p = Accounts.begin(); p != end; p++) { - TCHAR *caps = (*p)->getJabberInterface()->GetResourceFeatures(jid); + wchar_t *caps = (*p)->getJabberInterface()->GetResourceFeatures(jid); if (caps) { supported_proto = true; wstring str; @@ -534,11 +534,11 @@ INT_PTR onSendFile(WPARAM w, LPARAM l) } HistoryLog(ccs->hContact, db_event(Translate("encrypting file for transfer"), 0, 0, DBEF_SENT)); if (StriStr(ccs->szProtoService, "/sendfilew")) { - TCHAR **file = (TCHAR **)ccs->lParam; + wchar_t **file = (wchar_t **)ccs->lParam; for (int i = 0; file[i]; i++) { if (!boost::filesystem::exists(file[i])) return 0; //we do not want to send file unencrypted (sometimes ack have wrong info) - if (_tcsstr(file[i], L".gpg")) + if (wcsstr(file[i], L".gpg")) continue; std::wstring path_out = encrypt_file(ccs->hContact, file[i]); mir_free(file[i]); @@ -553,7 +553,7 @@ INT_PTR onSendFile(WPARAM w, LPARAM l) return 0; //we do not want to send file unencrypted (sometimes ack have wrong info) if (strstr(file[i], ".gpg")) continue; - TCHAR *tmp = mir_utf8decodeT(file[i]); + wchar_t *tmp = mir_utf8decodeT(file[i]); std::wstring path_out = encrypt_file(ccs->hContact, tmp); mir_free(tmp); char* tmp2 = mir_utf8encodeW(path_out.c_str()); @@ -583,14 +583,14 @@ void HistoryLog(MCONTACT hContact, db_event evt) db_event_add(hContact, &Event); } -static int ControlAddStringUtf(HWND ctrl, DWORD msg, const TCHAR *szString) +static int ControlAddStringUtf(HWND ctrl, DWORD msg, const wchar_t *szString) { int item = -1; item = SendMessage(ctrl, msg, 0, (LPARAM)szString); return item; } -int ComboBoxAddStringUtf(HWND hCombo, const TCHAR *szString, DWORD data) +int ComboBoxAddStringUtf(HWND hCombo, const wchar_t *szString, DWORD data) { int item = ControlAddStringUtf(hCombo, CB_ADDSTRING, szString); SendMessage(hCombo, CB_SETITEMDATA, item, data); @@ -618,11 +618,11 @@ int GetJabberInterface(WPARAM, LPARAM) //get interface for all jabber accounts, if (JIftmp) { (*p)->setJabberInterface(JIftmp); if (accounts[i]->tszAccountName) { - TCHAR* tmp = mir_tstrdup(accounts[i]->tszAccountName); + wchar_t* tmp = mir_tstrdup(accounts[i]->tszAccountName); (*p)->setAccountName(tmp); } else { - TCHAR *tmp = mir_a2t(accounts[i]->szModuleName); + wchar_t *tmp = mir_a2t(accounts[i]->szModuleName); (*p)->setAccountName(tmp); } (*p)->setAccountNumber(a); @@ -654,7 +654,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*) continue; // TODO: make following block more readable - if (_tcsstr(str, L"-----BEGIN PGP MESSAGE-----") && _tcsstr(str, L"-----END PGP MESSAGE-----")) { + if (wcsstr(str, L"-----BEGIN PGP MESSAGE-----") && wcsstr(str, L"-----END PGP MESSAGE-----")) { wstring data = str; xmlSetText(local_node, L"This message is encrypted."); wstring::size_type p1 = data.find(L"-----BEGIN PGP MESSAGE-----") + mir_tstrlen(L"-----BEGIN PGP MESSAGE-----"); @@ -681,8 +681,8 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*) break; } - if (bPresenceSigning && nodename && _tcsstr(nodename, L"status")) { - TCHAR *path_c = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + if (bPresenceSigning && nodename && wcsstr(nodename, L"status")) { + wchar_t *path_c = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); wstring path_out = path_c; wstring file = toUTF16(get_random(10)); mir_free(path_c); @@ -698,7 +698,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*) break; } - extern TCHAR *password; + extern wchar_t *password; string out; DWORD code; std::vector<wstring> cmd; @@ -763,7 +763,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*) wstring data; if (f.is_open()) { std::wifstream::pos_type size = f.tellg(); - TCHAR *tmp = new TCHAR[(std::ifstream::pos_type)size + (std::ifstream::pos_type)1]; + wchar_t *tmp = new wchar_t[(std::ifstream::pos_type)size + (std::ifstream::pos_type)1]; f.seekg(0, std::ios::beg); f.read(tmp, size); tmp[size] = '\0'; @@ -822,16 +822,16 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface*, HXML node, void*) for (int n = 0; n <= xmlGetChildCount(node); n++) { LPCTSTR nodename = xmlGetName(local_node); if (nodename) { - if (_tcsstr(nodename, L"x")) { + if (wcsstr(nodename, L"x")) { for (int i = 0; i < xmlGetAttrCount(local_node); i++) { LPCTSTR name = xmlGetAttrName(local_node, i); LPCTSTR value = xmlGetAttrValue(local_node, name); - if (_tcsstr(value, L"jabber:x:signed")) { + if (wcsstr(value, L"jabber:x:signed")) { std::wstring status_str; HXML local_node2 = node; for (int k = 0; k <= xmlGetChildCount(node); k++) { LPCTSTR nodename2 = xmlGetName(local_node2); - if (_tcsstr(nodename2, L"status")) { + if (wcsstr(nodename2, L"status")) { LPCTSTR status = xmlGetText(local_node2); if (status) status_str = status; @@ -844,7 +844,7 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface*, HXML node, void*) wstring file = toUTF16(get_random(10)), status_file = toUTF16(get_random(10)); sign += data; sign += L"\n-----END PGP SIGNATURE-----\n"; - TCHAR *path_c = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *path_c = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); wstring path_out = path_c, status_file_out = path_c; mir_free(path_c); path_out += L"\\tmp\\"; @@ -961,7 +961,7 @@ bool isContactSecured(MCONTACT hContact) return false; } if (!db_mc_isMeta(hContact)) { - TCHAR *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L""); + wchar_t *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L""); if (!key[0]) { mir_free(key); if (bDebugLog) @@ -977,7 +977,7 @@ bool isContactSecured(MCONTACT hContact) bool isContactHaveKey(MCONTACT hContact) { - TCHAR *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L""); + wchar_t *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L""); if (mir_tstrlen(key) > 0) { mir_free(key); return true; @@ -988,7 +988,7 @@ bool isContactHaveKey(MCONTACT hContact) bool isGPGKeyExist() { - TCHAR *id = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", L""); + wchar_t *id = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", L""); char *key = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", ""); if (id[0] && key[0]) { mir_free(id); @@ -1001,7 +1001,7 @@ bool isGPGKeyExist() } bool isGPGValid() { - TCHAR *tmp = NULL; + wchar_t *tmp = NULL; bool gpg_exists = false, is_valid = true; tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L""); boost::filesystem::path p(tmp); @@ -1011,14 +1011,14 @@ bool isGPGValid() else { mir_free(tmp); tmp = NULL; - TCHAR *path = (TCHAR*)mir_alloc(sizeof(TCHAR)*MAX_PATH); - TCHAR *mir_path = (TCHAR*)mir_alloc(MAX_PATH * sizeof(TCHAR)); + wchar_t *path = (wchar_t*)mir_alloc(sizeof(wchar_t)*MAX_PATH); + wchar_t *mir_path = (wchar_t*)mir_alloc(MAX_PATH * sizeof(wchar_t)); PathToAbsoluteW(L"\\", mir_path); SetCurrentDirectoryW(mir_path); tmp = mir_tstrdup(mir_path); mir_free(mir_path); - //mir_realloc(path, (mir_tstrlen(path)+64)*sizeof(TCHAR)); - TCHAR *gpg_path = (TCHAR*)mir_alloc(sizeof(TCHAR)*MAX_PATH); + //mir_realloc(path, (mir_tstrlen(path)+64)*sizeof(wchar_t)); + wchar_t *gpg_path = (wchar_t*)mir_alloc(sizeof(wchar_t)*MAX_PATH); mir_tstrcpy(gpg_path, tmp); mir_tstrcat(gpg_path, L"\\GnuPG\\gpg.exe"); mir_free(tmp); @@ -1061,7 +1061,7 @@ bool isGPGValid() { wstring path_ = _wgetenv(L"APPDATA"); path_ += L"\\GnuPG"; - tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", (TCHAR*)path_.c_str()); + tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", (wchar_t*)path_.c_str()); } if(tmp) mir_free(tmp); */ @@ -1248,7 +1248,7 @@ bool isTabsrmmUsed() void ExportGpGKeysFunc(int type) { - TCHAR *p = GetFilePath(L"Choose file to export keys", L"*", L"Any file", true); + wchar_t *p = GetFilePath(L"Choose file to export keys", L"*", L"Any file", true); if (!p || !p[0]) { delete[] p; //TODO: handle error @@ -1412,7 +1412,7 @@ void ExportGpGKeysFunc(int type) } if (file.is_open()) file.close(); - TCHAR msg[512]; + wchar_t msg[512]; if (type == 2) mir_sntprintf(msg, TranslateT("We have successfully exported %d public keys and all private keys."), exported_keys); else if (type == 1) @@ -1430,7 +1430,7 @@ INT_PTR ExportGpGKeys(WPARAM, LPARAM) INT_PTR ImportGpGKeys(WPARAM, LPARAM) { - TCHAR *p = GetFilePath(L"Choose file to import keys from", L"*", L"Any file"); + wchar_t *p = GetFilePath(L"Choose file to import keys from", L"*", L"Any file"); if (!p || !p[0]) { delete[] p; //TODO: handle error @@ -1612,7 +1612,7 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM) if (found) { wstring path; std::vector<std::wstring> cmd; - TCHAR *ptmp; + wchar_t *ptmp; string output; DWORD exitcode; { @@ -1716,13 +1716,13 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM) } if (strstr(line, "-----END PGP PRIVATE KEY BLOCK-----")) { std::vector<wstring> cmd; - TCHAR tmp2[MAX_PATH] = { 0 }; - TCHAR *ptmp; + wchar_t tmp2[MAX_PATH] = { 0 }; + wchar_t *ptmp; string output; DWORD exitcode; { ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); - _tcsncpy(tmp2, ptmp, MAX_PATH - 1); + wcsncpy(tmp2, ptmp, MAX_PATH - 1); mir_free(ptmp); mir_tstrncat(tmp2, L"\\", _countof(tmp2) - mir_tstrlen(tmp2)); mir_tstrncat(tmp2, L"temporary_exported.asc", _countof(tmp2) - mir_tstrlen(tmp2)); @@ -1750,7 +1750,7 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM) } if (file.is_open()) file.close(); - TCHAR msg[512]; + wchar_t msg[512]; if (processed_private_keys) mir_sntprintf(msg, TranslateT("We have successfully processed %d public keys and some private keys."), processed_keys); else @@ -1896,8 +1896,8 @@ static INT_PTR CALLBACK DlgProcChangePasswd(HWND hwndDlg, UINT msg, WPARAM wPara //TODO: show some prgress { std::string old_pass, new_pass; - extern TCHAR key_id_global[17]; - TCHAR buf[256] = { 0 }; + extern wchar_t key_id_global[17]; + wchar_t buf[256] = { 0 }; GetDlgItemText(hwndDlg, IDC_NEW_PASSWD1, buf, _countof(buf)); new_pass = toUTF8(buf); GetDlgItemText(hwndDlg, IDC_NEW_PASSWD2, buf, _countof(buf)); @@ -1909,7 +1909,7 @@ static INT_PTR CALLBACK DlgProcChangePasswd(HWND hwndDlg, UINT msg, WPARAM wPara GetDlgItemText(hwndDlg, IDC_OLD_PASSWD, buf, _countof(buf)); old_pass = toUTF8(buf); bool old_pass_match = false; - TCHAR *pass = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", L""); + wchar_t *pass = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", L""); if (!mir_tstrcmp(pass, buf)) old_pass_match = true; mir_free(pass); @@ -1968,7 +1968,7 @@ static INT_PTR CALLBACK DlgProcChangePasswd(HWND hwndDlg, UINT msg, WPARAM wPara break; case WM_DESTROY: - extern TCHAR key_id_global[17]; + extern wchar_t key_id_global[17]; key_id_global[0] = 0; break; } @@ -1991,7 +1991,7 @@ void clean_temp_dir() wstring path = toUTF16(mir_path); SetCurrentDirectoryA(mir_path); delete[] mir_path; - TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); path += tmp; mir_free(tmp); path += L"\\tmp"; diff --git a/plugins/New_GPG/src/utilities.h b/plugins/New_GPG/src/utilities.h index 2042864468..d677ff400d 100644 --- a/plugins/New_GPG/src/utilities.h +++ b/plugins/New_GPG/src/utilities.h @@ -16,11 +16,11 @@ #ifndef UTILITIES_H
#define UTILITIES_H
-TCHAR* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, TCHAR* szDef);
+wchar_t* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, wchar_t* szDef);
char* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, char* szDef);
-void GetFilePath(TCHAR *WindowTittle, char *szSetting, TCHAR *szExt, TCHAR *szExtDesc);
-TCHAR *GetFilePath(TCHAR *WindowTittle, TCHAR *szExt, TCHAR *szExtDesc, bool save_file = false);
-void GetFolderPath(TCHAR *WindowTittle, char *szSetting);
+void GetFilePath(wchar_t *WindowTittle, char *szSetting, wchar_t *szExt, wchar_t *szExtDesc);
+wchar_t *GetFilePath(wchar_t *WindowTittle, wchar_t *szExt, wchar_t *szExtDesc, bool save_file = false);
+void GetFolderPath(wchar_t *WindowTittle, char *szSetting);
void storeOutput(HANDLE ahandle, string *output);
@@ -29,7 +29,7 @@ void setClistIcon(MCONTACT); void send_encrypted_msgs_thread(void*);
-int ComboBoxAddStringUtf(HWND hCombo, const TCHAR *szString, DWORD data);
+int ComboBoxAddStringUtf(HWND hCombo, const wchar_t *szString, DWORD data);
bool isContactSecured(MCONTACT hContact);
bool isContactHaveKey(MCONTACT hContact);
bool isTabsrmmUsed();
diff --git a/plugins/NewsAggregator/Src/Authentication.cpp b/plugins/NewsAggregator/Src/Authentication.cpp index c2f23cc1f1..f72bee89fc 100644 --- a/plugins/NewsAggregator/Src/Authentication.cpp +++ b/plugins/NewsAggregator/Src/Authentication.cpp @@ -21,13 +21,13 @@ Boston, MA 02111-1307, USA. void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg)
{
- TCHAR *tlogin = NULL, *tpass = NULL;
+ wchar_t *tlogin = NULL, *tpass = NULL;
if (hContact && db_get_b(hContact, MODULE, "UseAuth", 0)) {
tlogin = db_get_tsa(hContact, MODULE, "Login");
tpass = db_get_tsa(hContact, MODULE, "Password");
}
else if (hwndDlg && IsDlgButtonChecked(hwndDlg, IDC_USEAUTH)) {
- TCHAR buf[MAX_PATH] = {0};
+ wchar_t buf[MAX_PATH] = {0};
GetDlgItemText(hwndDlg, IDC_LOGIN, buf, _countof(buf));
tlogin = mir_tstrdup(buf);
GetDlgItemText(hwndDlg, IDC_PASSWORD, buf, _countof(buf));
@@ -55,7 +55,7 @@ INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)&SelItem);
if (SelItem.hwndList) {
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
if (GetDlgItemText(SelItem.hwndList, IDC_FEEDTITLE, str, _countof(str)))
SetDlgItemText(hwndDlg, IDC_FEEDNAME, str);
else {
@@ -64,13 +64,13 @@ INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
}
else if (SelItem.hContact) {
- TCHAR *ptszNick = db_get_tsa(SelItem.hContact, MODULE, "Nick");
+ wchar_t *ptszNick = db_get_tsa(SelItem.hContact, MODULE, "Nick");
if (ptszNick) {
SetDlgItemText(hwndDlg, IDC_FEEDNAME, ptszNick);
mir_free(ptszNick);
}
else {
- TCHAR *ptszURL = db_get_tsa(SelItem.hContact, MODULE, "URL");
+ wchar_t *ptszURL = db_get_tsa(SelItem.hContact, MODULE, "URL");
if (ptszURL) {
SetDlgItemText(hwndDlg, IDC_FEEDNAME, ptszURL);
mir_free(ptszURL);
@@ -85,7 +85,7 @@ INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDOK:
{
ItemInfo &SelItem = *(ItemInfo*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- TCHAR username[MAX_PATH];
+ wchar_t username[MAX_PATH];
char passw[MAX_PATH];
if (!GetDlgItemText(hwndDlg, IDC_FEEDUSERNAME, username, _countof(username))) {
MessageBox(hwndDlg, TranslateT("Enter your username"), TranslateT("Error"), MB_OK | MB_ICONERROR);
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index c9967ba341..4abe1c0395 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -19,13 +19,13 @@ Boston, MA 02111-1307, USA. #include "stdafx.h"
-LPCTSTR CheckFeed(TCHAR *tszURL, HWND hwndDlg)
+LPCTSTR CheckFeed(wchar_t *tszURL, HWND hwndDlg)
{
Netlib_LogfT(hNetlibUser, L"Started validating feed %s.", tszURL);
char *szData = NULL;
GetNewsData(tszURL, &szData, NULL, hwndDlg);
if (szData) {
- TCHAR *tszData = mir_utf8decodeT(szData);
+ wchar_t *tszData = mir_utf8decodeT(szData);
if (!tszData)
tszData = mir_a2t(szData);
int bytesParsed = 0;
@@ -56,11 +56,11 @@ LPCTSTR CheckFeed(TCHAR *tszURL, HWND hwndDlg) for (int j = 0; j < xmlGetChildCount(chan); j++) {
HXML child = xmlGetChild(chan, j);
if (!mir_tstrcmpi(xmlGetName(child), L"title")) {
- TCHAR mes[MAX_PATH];
+ wchar_t mes[MAX_PATH];
mir_sntprintf(mes, TranslateT("%s\nis a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
return mir_tstrdup(buf);
}
@@ -73,11 +73,11 @@ LPCTSTR CheckFeed(TCHAR *tszURL, HWND hwndDlg) for (int j = 0; j < xmlGetChildCount(node); j++) {
HXML child = xmlGetChild(node, j);
if (!mir_tstrcmpi(xmlGetName(child), L"title")) {
- TCHAR mes[MAX_PATH];
+ wchar_t mes[MAX_PATH];
mir_sntprintf(mes, TranslateT("%s\nis a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
return mir_tstrdup(buf);
}
@@ -92,7 +92,7 @@ LPCTSTR CheckFeed(TCHAR *tszURL, HWND hwndDlg) xmlDestroyNode(hXml);
}
Netlib_LogfT(hNetlibUser, L"%s is not a valid feed's address.", tszURL);
- TCHAR mes[MAX_PATH];
+ wchar_t mes[MAX_PATH];
mir_sntprintf(mes, TranslateT("%s\nis not a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONERROR);
return NULL;
@@ -183,7 +183,7 @@ void CheckCurrentFeed(MCONTACT hContact) if (!db_get_b(hContact, MODULE, "CheckState", 1) != 0)
return;
- TCHAR *szURL = db_get_tsa(hContact, MODULE, "URL");
+ wchar_t *szURL = db_get_tsa(hContact, MODULE, "URL");
if (szURL == NULL)
return;
@@ -194,7 +194,7 @@ void CheckCurrentFeed(MCONTACT hContact) mir_free(szURL);
if (szData) {
- TCHAR *tszData = mir_utf8decodeT(szData);
+ wchar_t *tszData = mir_utf8decodeT(szData);
if (!tszData)
tszData = mir_a2t(szData);
int bytesParsed = 0;
@@ -228,7 +228,7 @@ void CheckCurrentFeed(MCONTACT hContact) for (int i = 0; i < xmlGetAttrCount(node); i++) {
LPCTSTR szAttrName = xmlGetAttrName(node, i);
if (!mir_tstrcmpi(szAttrName, L"version")) {
- TCHAR ver[MAX_PATH];
+ wchar_t ver[MAX_PATH];
mir_sntprintf(ver, L"RSS %s", xmlGetAttrValue(node, szAttrName));
db_set_ts(hContact, MODULE, "MirVer", ver);
break;
@@ -245,7 +245,7 @@ void CheckCurrentFeed(MCONTACT hContact) if (!mir_tstrcmpi(childName, L"title")) {
LPCTSTR szChildText = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
}
@@ -257,7 +257,7 @@ void CheckCurrentFeed(MCONTACT hContact) else if (!mir_tstrcmpi(childName, L"link")) {
LPCTSTR szChildText = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
}
@@ -269,7 +269,7 @@ void CheckCurrentFeed(MCONTACT hContact) else if (!mir_tstrcmpi(childName, L"description")) {
LPCTSTR szChildText = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
}
@@ -284,7 +284,7 @@ void CheckCurrentFeed(MCONTACT hContact) else if (!mir_tstrcmpi(childName, L"language")) {
LPCTSTR szChildText = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
}
@@ -296,7 +296,7 @@ void CheckCurrentFeed(MCONTACT hContact) else if (!mir_tstrcmpi(childName, L"managingEditor")) {
LPCTSTR szChildText = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
}
@@ -308,7 +308,7 @@ void CheckCurrentFeed(MCONTACT hContact) else if (!mir_tstrcmpi(childName, L"category")) {
LPCTSTR szChildText = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
}
@@ -320,7 +320,7 @@ void CheckCurrentFeed(MCONTACT hContact) else if (!mir_tstrcmpi(childName, L"copyright")) {
LPCTSTR szChildText = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
}
@@ -339,9 +339,9 @@ void CheckCurrentFeed(MCONTACT hContact) PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
- TCHAR *szNick = db_get_tsa(hContact, MODULE, "Nick");
+ wchar_t *szNick = db_get_tsa(hContact, MODULE, "Nick");
if (szNick) {
- TCHAR *ext = _tcsrchr((TCHAR *)url, _T('.')) + 1;
+ wchar_t *ext = wcsrchr((wchar_t *)url, '.') + 1;
ai.format = ProtoGetAvatarFormat(url);
CMString filename = szNick;
@@ -362,7 +362,7 @@ void CheckCurrentFeed(MCONTACT hContact) else if (!mir_tstrcmpi(childName, L"lastBuildDate")) {
LPCTSTR szChildText = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
}
@@ -387,7 +387,7 @@ void CheckCurrentFeed(MCONTACT hContact) LPCTSTR itemName = xmlGetName(itemval);
LPCTSTR value = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(itemval)), -1, buf, _countof(buf));
value = buf;
}
@@ -483,10 +483,10 @@ void CheckCurrentFeed(MCONTACT hContact) if (szNick) {
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
- TCHAR *ext = _tcsrchr((TCHAR *)url, _T('.')) + 1;
+ wchar_t *ext = wcsrchr((wchar_t *)url, '.') + 1;
ai.format = ProtoGetAvatarFormat(ext);
- TCHAR *filename = szNick;
+ wchar_t *filename = szNick;
mir_sntprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
@@ -501,7 +501,7 @@ void CheckCurrentFeed(MCONTACT hContact) else if (!mir_tstrcmpi(szChildName, L"updated")) {
LPCTSTR szChildText = xmlGetText(child);
if (szChildText) {
- TCHAR *lastupdtime = (TCHAR *)szChildText;
+ wchar_t *lastupdtime = (wchar_t *)szChildText;
time_t stamp = DateToUnixTime(lastupdtime, 1);
double deltaupd = difftime(time(NULL), stamp);
double deltacheck = difftime(time(NULL), (time_t)db_get_dw(hContact, MODULE, "LastCheck", 0));
@@ -587,7 +587,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) if (!db_get_b(hContact, MODULE, "CheckState", 1))
return;
- TCHAR *szURL = db_get_tsa(hContact, MODULE, "URL");
+ wchar_t *szURL = db_get_tsa(hContact, MODULE, "URL");
if (szURL == NULL)
return;
@@ -598,7 +598,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) if (szData == NULL)
return;
- TCHAR *tszData = mir_utf8decodeT(szData);
+ wchar_t *tszData = mir_utf8decodeT(szData);
if (!tszData)
tszData = mir_a2t(szData);
int bytesParsed = 0;
@@ -626,12 +626,12 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
- TCHAR *szNick = db_get_tsa(hContact, MODULE, "Nick");
+ wchar_t *szNick = db_get_tsa(hContact, MODULE, "Nick");
if (szNick) {
- TCHAR *ext = _tcsrchr((TCHAR *)url, _T('.')) + 1;
+ wchar_t *ext = wcsrchr((wchar_t *)url, '.') + 1;
ai.format = ProtoGetAvatarFormat(ext);
- TCHAR *filename = szNick;
+ wchar_t *filename = szNick;
mir_sntprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
@@ -661,10 +661,10 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
- TCHAR *ext = _tcsrchr((TCHAR *)url, _T('.')) + 1;
+ wchar_t *ext = wcsrchr((wchar_t *)url, '.') + 1;
ai.format = ProtoGetAvatarFormat(ext);
- TCHAR *filename = szNick;
+ wchar_t *filename = szNick;
mir_sntprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp index cbaac0f4b3..0943dcd303 100644 --- a/plugins/NewsAggregator/Src/ExportImport.cpp +++ b/plugins/NewsAggregator/Src/ExportImport.cpp @@ -40,7 +40,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM switch (LOWORD(wParam)) {
case IDOK:
{
- TCHAR FileName[MAX_PATH];
+ wchar_t FileName[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_IMPORTFILEPATH, FileName, _countof(FileName));
int bytesParsed = 0;
HXML hXml = xmlParseFile(FileName, &bytesParsed, NULL);
@@ -56,7 +56,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM while (node) {
int outlineAttr = xmlGetAttrCount(node);
int outlineChildsCount = xmlGetChildCount(node);
- TCHAR *xmlUrl = (TCHAR *)xmlGetAttrValue(node, L"xmlUrl");
+ wchar_t *xmlUrl = (wchar_t *)xmlGetAttrValue(node, L"xmlUrl");
if (!xmlUrl && !outlineChildsCount) {
HXML tmpnode = node;
node = xmlGetNextNode(node);
@@ -74,19 +74,19 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM else if (!xmlUrl && outlineChildsCount)
node = xmlGetFirstChild(node);
else if (xmlUrl) {
- TCHAR *text = NULL, *url = NULL, *siteurl = NULL, *group = NULL;
+ wchar_t *text = NULL, *url = NULL, *siteurl = NULL, *group = NULL;
BYTE NeedToImport = FALSE;
for (int i = 0; i < outlineAttr; i++) {
if (!mir_tstrcmpi(xmlGetAttrName(node, i), L"text")) {
text = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
if (!text) {
isTextUTF = 0;
- text = (TCHAR *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
+ text = (wchar_t *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
} else
isTextUTF = 1;
for (int j = 0; j < count; j++) {
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsImportList, LB_GETTEXT, (WPARAM)j, (LPARAM)item);
if (!mir_tstrcmpi(item, text)) {
NeedToImport = TRUE;
@@ -99,7 +99,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM url = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
if ( !url) {
isURLUTF = false;
- url = (TCHAR *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
+ url = (wchar_t *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
} else
isURLUTF = true;
if (GetContactByURL(url) && NeedToImport) {
@@ -112,7 +112,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM siteurl = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
if ( !siteurl) {
isSiteURLUTF = false;
- siteurl = (TCHAR *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
+ siteurl = (wchar_t *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
} else
isSiteURLUTF = true;
continue;
@@ -123,12 +123,12 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (NeedToImport) {
HXML parent = xmlGetParent(node);
- TCHAR tmpgroup[1024];
+ wchar_t tmpgroup[1024];
while (mir_tstrcmpi(xmlGetName(parent), L"body")) {
for (int i = 0; i < xmlGetAttrCount(parent); i++) {
if (!mir_tstrcmpi(xmlGetAttrName(parent, i), L"text")) {
if ( !group)
- group = (TCHAR *)xmlGetAttrValue(parent, xmlGetAttrName(parent, i));
+ group = (wchar_t *)xmlGetAttrValue(parent, xmlGetAttrName(parent, i));
else {
mir_sntprintf(tmpgroup, L"%s\\%s", xmlGetAttrValue(parent, xmlGetAttrName(parent, i)), group);
group = tmpgroup;
@@ -139,7 +139,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM parent = xmlGetParent(parent);
}
- TCHAR *ptszGroup = NULL;
+ wchar_t *ptszGroup = NULL;
if (group) {
ptszGroup = mir_utf8decodeT(_T2A(group));
if ( !ptszGroup) {
@@ -193,7 +193,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM DeleteAllItems(hwndList);
UpdateList(hwndList);
}
- TCHAR mes[MAX_PATH];
+ wchar_t mes[MAX_PATH];
if (DUPES)
mir_sntprintf(mes, TranslateT("Imported %d feed(s)\r\nNot imported %d duplicate(s)."), count - DUPES, DUPES);
else
@@ -208,12 +208,12 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_BROWSEIMPORTFILE:
{
- TCHAR FileName[MAX_PATH];
+ wchar_t FileName[MAX_PATH];
VARST tszMirDir(L"%miranda_path%");
OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
mir_sntprintf(tmp, L"%s (*.opml, *.xml)%c*.opml;*.xml%c%c", TranslateT("OPML files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
@@ -236,7 +236,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM while (node) {
int outlineAttr = xmlGetAttrCount(node);
int outlineChildsCount = xmlGetChildCount(node);
- TCHAR *xmlUrl = (TCHAR *)xmlGetAttrValue(node, L"xmlUrl");
+ wchar_t *xmlUrl = (wchar_t *)xmlGetAttrValue(node, L"xmlUrl");
if (!xmlUrl && !outlineChildsCount) {
HXML tmpnode = node;
node = xmlGetNextNode(node);
@@ -256,11 +256,11 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM else if (xmlUrl) {
for (int i = 0; i < outlineAttr; i++) {
if (!mir_tstrcmpi(xmlGetAttrName(node, i), L"text")) {
- TCHAR *text = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
+ wchar_t *text = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
bool isTextUTF;
if (!text) {
isTextUTF = false;
- text = (TCHAR *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
+ text = (wchar_t *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
} else
isTextUTF = true;
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)text);
@@ -310,7 +310,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDOK)))
EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
int cursel = (int)SendMessage(FeedsList, LB_GETCURSEL, 0, 0);
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsList, LB_GETTEXT, (WPARAM)cursel, (LPARAM)item);
SendMessage(FeedsImportList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsList, LB_DELETESTRING, (WPARAM)cursel, 0);
@@ -328,7 +328,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS)))
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), TRUE);
int cursel = (int)SendMessage(FeedsImportList, LB_GETCURSEL, 0, 0);
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsImportList, LB_GETTEXT, (WPARAM)cursel, (LPARAM)item);
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsImportList, LB_DELETESTRING, (WPARAM)cursel, 0);
@@ -351,7 +351,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
int count = (int)SendMessage(FeedsList, LB_GETCOUNT, 0, 0);
for (int i = 0; i < count; i++) {
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsList, LB_GETTEXT, (WPARAM)i, (LPARAM)item);
SendMessage(FeedsImportList, LB_ADDSTRING, 0, (LPARAM)item);
}
@@ -370,7 +370,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), TRUE);
int count = (int)SendMessage(FeedsImportList, LB_GETCOUNT, 0, 0);
for (int i = 0; i < count; i++) {
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsImportList, LB_GETTEXT, (WPARAM)i, (LPARAM)item);
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)item);
}
@@ -393,7 +393,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDOK)))
EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
int cursel = (int)SendMessage(FeedsList, LB_GETCURSEL, 0, 0);
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsList, LB_GETTEXT, (WPARAM)cursel, (LPARAM)item);
SendMessage(FeedsImportList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsList, LB_DELETESTRING, (WPARAM)cursel, 0);
@@ -414,7 +414,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS)))
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), TRUE);
int cursel = (int)SendMessage(FeedsImportList, LB_GETCURSEL, 0, 0);
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsImportList, LB_GETTEXT, (WPARAM)cursel, (LPARAM)item);
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsImportList, LB_DELETESTRING, (WPARAM)cursel, 0);
@@ -452,7 +452,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TranslateDialogDefault(hwndDlg);
Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, MODULE, "ExportDlg");
for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
- TCHAR *message = db_get_tsa(hContact, MODULE, "Nick");
+ wchar_t *message = db_get_tsa(hContact, MODULE, "Nick");
if (message != NULL) {
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)message);
mir_free(message);
@@ -471,12 +471,12 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM switch (LOWORD(wParam)) {
case IDOK:
{
- TCHAR FileName[MAX_PATH];
+ wchar_t FileName[MAX_PATH];
VARST tszMirDir(L"%miranda_path%");
OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
mir_sntprintf(tmp, L"%s (*.opml)%c*.opml%c%c", TranslateT("OPML files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
@@ -497,10 +497,10 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM int count = (int)SendMessage(FeedsExportList, LB_GETCOUNT, 0, 0);
for (int i = 0; i < count; i++) {
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsExportList, LB_GETTEXT, (WPARAM)i, (LPARAM)item);
MCONTACT hContact = GetContactByNick(item);
- TCHAR
+ wchar_t
*title = db_get_tsa(hContact, MODULE, "Nick"),
*url = db_get_tsa(hContact, MODULE, "URL"),
*siteurl = db_get_tsa(hContact, MODULE, "Homepage"),
@@ -509,7 +509,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM HXML elem = header;
if (group)
{
- TCHAR *section = _tcstok(group, L"\\");
+ wchar_t *section = wcstok(group, L"\\");
while (section != NULL)
{
HXML existgroup = xmlGetChildByAttrValue(header, L"outline", L"title", section);
@@ -521,7 +521,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM } else {
elem = existgroup;
}
- section = _tcstok(NULL, L"\\");
+ section = wcstok(NULL, L"\\");
}
elem = xmlAddChild(elem, L"outline", NULL);
}
@@ -556,7 +556,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDOK)))
EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
int cursel = (int)SendMessage(FeedsList, LB_GETCURSEL, 0, 0);
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsList, LB_GETTEXT, (WPARAM)cursel, (LPARAM)item);
SendMessage(FeedsExportList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsList, LB_DELETESTRING, (WPARAM)cursel, 0);
@@ -574,7 +574,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS)))
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), TRUE);
int cursel = (int)SendMessage(FeedsExportList, LB_GETCURSEL, 0, 0);
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsExportList, LB_GETTEXT, (WPARAM)cursel, (LPARAM)item);
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsExportList, LB_DELETESTRING, (WPARAM)cursel, 0);
@@ -597,7 +597,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
int count = (int)SendMessage(FeedsList, LB_GETCOUNT, 0, 0);
for (int i = 0; i < count; i++) {
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsList, LB_GETTEXT, (WPARAM)i, (LPARAM)item);
SendMessage(FeedsExportList, LB_ADDSTRING, 0, (LPARAM)item);
}
@@ -616,7 +616,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), TRUE);
int count = (int)SendMessage(FeedsExportList, LB_GETCOUNT, 0, 0);
for (int i = 0; i < count; i++) {
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsExportList, LB_GETTEXT, (WPARAM)i, (LPARAM)item);
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)item);
}
@@ -639,7 +639,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDOK)))
EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
int cursel = (int)SendMessage(FeedsList, LB_GETCURSEL, 0, 0);
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsList, LB_GETTEXT, (WPARAM)cursel, (LPARAM)item);
SendMessage(FeedsExportList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsList, LB_DELETESTRING, (WPARAM)cursel, 0);
@@ -660,7 +660,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS)))
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), TRUE);
int cursel = (int)SendMessage(FeedsExportList, LB_GETCURSEL, 0, 0);
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsExportList, LB_GETTEXT, (WPARAM)cursel, (LPARAM)item);
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsExportList, LB_DELETESTRING, (WPARAM)cursel, 0);
diff --git a/plugins/NewsAggregator/Src/Menus.cpp b/plugins/NewsAggregator/Src/Menus.cpp index 6733becea1..44aaf21532 100644 --- a/plugins/NewsAggregator/Src/Menus.cpp +++ b/plugins/NewsAggregator/Src/Menus.cpp @@ -25,43 +25,43 @@ void InitMenu() {
CMenuItem mi;
mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("News Aggregator"), 500099000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("News Aggregator"), 500099000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "D9733E4F-1946-4390-8EB3-591E8687222E");
SET_UID(mi, 0x3ec91864, 0xefa7, 0x4994, 0xb7, 0x75, 0x6c, 0x96, 0xcb, 0x29, 0x2f, 0x93);
mi.position = 10100001;
if (db_get_b(NULL, MODULE, "AutoUpdate", 1))
- mi.name.t = LPGENT("Auto Update Enabled");
+ mi.name.w = LPGENW("Auto Update Enabled");
else
- mi.name.t = LPGENT("Auto Update Disabled");
+ mi.name.w = LPGENW("Auto Update Disabled");
mi.hIcolibItem = GetIconHandle("main");
mi.pszService = MS_NEWSAGGREGATOR_ENABLED;
hService2[0] = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x8076bb4d, 0x1e44, 0x43af, 0x97, 0x1e, 0x31, 0xd8, 0xa4, 0xe9, 0xb8, 0x37);
mi.position = 20100001;
- mi.name.t = LPGENT("Check All Feeds");
+ mi.name.w = LPGENW("Check All Feeds");
mi.pszService = MS_NEWSAGGREGATOR_CHECKALLFEEDS;
hService2[1] = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0xb876484d, 0x28aa, 0x4e03, 0x9e, 0x98, 0xed, 0xbc, 0xd1, 0xcf, 0x31, 0x80);
mi.position = 20100002;
mi.hIcolibItem = GetIconHandle("addfeed");
- mi.name.t = LPGENT("Add Feed");
+ mi.name.w = LPGENW("Add Feed");
mi.pszService = MS_NEWSAGGREGATOR_ADDFEED;
hService2[2] = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x600bf2c2, 0xa974, 0x44d3, 0x98, 0xf9, 0xe6, 0x65, 0x7c, 0x1f, 0x63, 0x37);
mi.position = 20100003;
mi.hIcolibItem = GetIconHandle("importfeeds");
- mi.name.t = LPGENT("Import Feeds");
+ mi.name.w = LPGENW("Import Feeds");
mi.pszService = MS_NEWSAGGREGATOR_IMPORTFEEDS;
hService2[3] = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0xc09c8119, 0x64c2, 0x49bd, 0x81, 0xf, 0x54, 0x20, 0x69, 0xd7, 0x30, 0xcf);
mi.position = 20100004;
mi.hIcolibItem = GetIconHandle("exportfeeds");
- mi.name.t = LPGENT("Export Feeds");
+ mi.name.w = LPGENW("Export Feeds");
mi.pszService = MS_NEWSAGGREGATOR_EXPORTFEEDS;
hService2[4] = Menu_AddMainMenuItem(&mi);
@@ -70,12 +70,12 @@ void InitMenu() mi.root = NULL;
mi.position = -0x7FFFFFFA;
mi.hIcolibItem = GetIconHandle("checkfeed");
- mi.name.t = LPGENT("Check feed");
+ mi.name.w = LPGENW("Check feed");
mi.pszService = MS_NEWSAGGREGATOR_CHECKFEED;
hService2[5] = Menu_AddContactMenuItem(&mi, MODULE);
SET_UID(mi, 0x41a70fbc, 0x9241, 0x44c0, 0x90, 0x90, 0x87, 0xd2, 0xc5, 0x9f, 0xc9, 0xac);
- mi.name.t = LPGENT("Change feed");
+ mi.name.w = LPGENW("Change feed");
mi.pszService = MS_NEWSAGGREGATOR_CHANGEFEED;
hService2[6] = Menu_AddContactMenuItem(&mi, MODULE);
diff --git a/plugins/NewsAggregator/Src/NewsAggregator.cpp b/plugins/NewsAggregator/Src/NewsAggregator.cpp index ecfd2009ec..8d040fdcc0 100644 --- a/plugins/NewsAggregator/Src/NewsAggregator.cpp +++ b/plugins/NewsAggregator/Src/NewsAggregator.cpp @@ -25,7 +25,7 @@ int hLangpack; HANDLE hPrebuildMenuHook = NULL;
HWND hAddFeedDlg;
MWindowList hChangeFeedDlgList = NULL;
-TCHAR tszRoot[MAX_PATH] = {0};
+wchar_t tszRoot[MAX_PATH] = {0};
HANDLE hUpdateMutex;
PLUGININFOEX pluginInfoEx = {
@@ -92,8 +92,8 @@ extern "C" __declspec(dllexport) int Load(void) HOTKEYDESC hkd = { sizeof(hkd) };
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "NewsAggregator/CheckAllFeeds";
- hkd.ptszDescription = LPGENT("Check All Feeds");
- hkd.ptszSection = LPGENT("News Aggregator");
+ hkd.ptszDescription = LPGENW("Check All Feeds");
+ hkd.ptszSection = LPGENW("News Aggregator");
hkd.pszService = MS_NEWSAGGREGATOR_CHECKALLFEEDS;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL+HKCOMB_A, 'O') | HKF_MIRANDA_LOCAL;
Hotkey_Register(&hkd);
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index 74fdfc6f71..e27cd761d9 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -37,7 +37,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
char passw[MAX_PATH];
{
if (!GetDlgItemText(hwndDlg, IDC_FEEDTITLE, str, _countof(str))) {
@@ -94,7 +94,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA break;
case IDC_TAGHELP:
- TCHAR tszTagHelp[1024];
+ wchar_t tszTagHelp[1024];
mir_sntprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
L"#<title>#", TranslateT("The title of the item."),
L"#<description>#", TranslateT("The item synopsis."),
@@ -114,10 +114,10 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_DISCOVERY:
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE);
SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait..."));
- TCHAR tszURL[MAX_PATH] = { 0 };
- TCHAR *tszTitle = NULL;
+ wchar_t tszURL[MAX_PATH] = { 0 };
+ wchar_t *tszTitle = NULL;
if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, L"http://") != 0)
- tszTitle = (TCHAR*)CheckFeed(tszURL, hwndDlg);
+ tszTitle = (wchar_t*)CheckFeed(tszURL, hwndDlg);
else
MessageBox(hwndDlg, TranslateT("Enter Feed URL"), TranslateT("Error"), MB_OK);
SetDlgItemText(hwndDlg, IDC_FEEDTITLE, tszTitle);
@@ -167,7 +167,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetDlgItemText(hwndDlg, IDC_FEEDTITLE, SelItem.nick);
SetDlgItemInt(hwndDlg, IDC_CHECKTIME, db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME), TRUE);
- TCHAR *szMsgFormat = db_get_tsa(hContact, MODULE, "MsgFormat");
+ wchar_t *szMsgFormat = db_get_tsa(hContact, MODULE, "MsgFormat");
if (szMsgFormat) {
SetDlgItemText(hwndDlg, IDC_TAGSEDIT, szMsgFormat);
mir_free(szMsgFormat);
@@ -177,7 +177,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg, IDC_LOGIN), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_PASSWORD), TRUE);
- TCHAR *szLogin = db_get_tsa(hContact, MODULE, "Login");
+ wchar_t *szLogin = db_get_tsa(hContact, MODULE, "Login");
if (szLogin) {
SetDlgItemText(hwndDlg, IDC_LOGIN, szLogin);
mir_free(szLogin);
@@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
{
ItemInfo *SelItem = (ItemInfo*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
char passw[MAX_PATH];
@@ -254,7 +254,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
case IDC_TAGHELP:
- TCHAR tszTagHelp[1024];
+ wchar_t tszTagHelp[1024];
mir_sntprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
L"#<title>#", TranslateT("The title of the item."),
L"#<description>#", TranslateT("The item synopsis."),
@@ -272,11 +272,11 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
case IDC_DISCOVERY:
- TCHAR tszURL[MAX_PATH] = { 0 };
+ wchar_t tszURL[MAX_PATH] = { 0 };
if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, L"http://") != 0) {
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE);
SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait..."));
- TCHAR *tszTitle = (TCHAR*)CheckFeed(tszURL, hwndDlg);
+ wchar_t *tszTitle = (wchar_t*)CheckFeed(tszURL, hwndDlg);
SetDlgItemText(hwndDlg, IDC_FEEDTITLE, tszTitle);
mir_free(tszTitle);
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), TRUE);
@@ -314,13 +314,13 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP WindowList_Add(hChangeFeedDlgList, hwndDlg, hContact);
Utils_RestoreWindowPositionNoSize(hwndDlg, hContact, MODULE, "ChangeDlg");
- TCHAR *ptszNick = db_get_tsa(hContact, MODULE, "Nick");
+ wchar_t *ptszNick = db_get_tsa(hContact, MODULE, "Nick");
if (ptszNick) {
SetDlgItemText(hwndDlg, IDC_FEEDTITLE, ptszNick);
mir_free(ptszNick);
}
- TCHAR *ptszURL = db_get_tsa(hContact, MODULE, "URL");
+ wchar_t *ptszURL = db_get_tsa(hContact, MODULE, "URL");
if (ptszNick) {
SetDlgItemText(hwndDlg, IDC_FEEDURL, ptszURL);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
@@ -329,7 +329,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetDlgItemInt(hwndDlg, IDC_CHECKTIME, db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME), TRUE);
- TCHAR *ptszMsgFormat = db_get_tsa(hContact, MODULE, "MsgFormat");
+ wchar_t *ptszMsgFormat = db_get_tsa(hContact, MODULE, "MsgFormat");
if (ptszMsgFormat) {
SetDlgItemText(hwndDlg, IDC_TAGSEDIT, ptszMsgFormat);
mir_free(ptszMsgFormat);
@@ -339,7 +339,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP CheckDlgButton(hwndDlg, IDC_USEAUTH, BST_CHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_LOGIN), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_PASSWORD), TRUE);
- TCHAR *ptszLogin = db_get_tsa(hContact, MODULE, "Login");
+ wchar_t *ptszLogin = db_get_tsa(hContact, MODULE, "Login");
if (ptszLogin) {
SetDlgItemText(hwndDlg, IDC_LOGIN, ptszLogin);
mir_free(ptszLogin);
@@ -353,7 +353,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
{
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
char passw[MAX_PATH];
@@ -410,7 +410,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
case IDC_TAGHELP:
- TCHAR tszTagHelp[1024];
+ wchar_t tszTagHelp[1024];
mir_sntprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
L"#<title>#", TranslateT("The title of the item."),
L"#<description>#", TranslateT("The item synopsis."),
@@ -428,11 +428,11 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
case IDC_DISCOVERY:
- TCHAR tszURL[MAX_PATH] = { 0 };
+ wchar_t tszURL[MAX_PATH] = { 0 };
if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, L"http://") != 0) {
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE);
SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait..."));
- TCHAR *tszTitle = (TCHAR*)CheckFeed(tszURL, hwndDlg);
+ wchar_t *tszTitle = (wchar_t*)CheckFeed(tszURL, hwndDlg);
SetDlgItemText(hwndDlg, IDC_FEEDTITLE, tszTitle);
mir_free(tszTitle);
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), TRUE);
@@ -492,7 +492,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA case IDC_REMOVE:
if (MessageBox(hwndDlg, TranslateT("Are you sure?"), TranslateT("Contact deleting"), MB_YESNO | MB_ICONWARNING) == IDYES) {
- TCHAR nick[MAX_PATH], url[MAX_PATH];
+ wchar_t nick[MAX_PATH], url[MAX_PATH];
sel = ListView_GetSelectionMark(hwndList);
ListView_GetItemText(hwndList, sel, 0, nick, _countof(nick));
ListView_GetItemText(hwndList, sel, 1, url, _countof(url));
diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index bc2d5dabe6..d3cdfb6839 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -37,10 +37,10 @@ int OnFoldersChanged(WPARAM, LPARAM) int NewsAggrInit(WPARAM, LPARAM)
{
- if (hNewsAggregatorFolder = FoldersRegisterCustomPathT(LPGEN("Avatars"), LPGEN("News Aggregator"), MIRANDA_USERDATAT L"\\Avatars\\" DEFAULT_AVATARS_FOLDER))
+ if (hNewsAggregatorFolder = FoldersRegisterCustomPathT(LPGEN("Avatars"), LPGEN("News Aggregator"), MIRANDA_USERDATAT L"\\Avatars\\" _A2W(DEFAULT_AVATARS_FOLDER)))
FoldersGetCustomPathT(hNewsAggregatorFolder, tszRoot, MAX_PATH, L"");
else
- mir_tstrncpy(tszRoot, VARST(L"%miranda_userdata%\\Avatars\\" DEFAULT_AVATARS_FOLDER), _countof(tszRoot));
+ mir_tstrncpy(tszRoot, VARST(L"%miranda_userdata%\\Avatars\\" _A2W(DEFAULT_AVATARS_FOLDER)), _countof(tszRoot));
for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
if (!db_get_b(NULL, MODULE, "StartupRetrieve", 1))
@@ -211,7 +211,7 @@ INT_PTR NewsAggrGetAvatarInfo(WPARAM wParam, LPARAM lParam) if (db_get_b(NULL, MODULE, "AutoUpdate", 1) != 0 && !ThreadRunning)
mir_forkthread(UpdateThreadProc, (void *)TRUE);
- TCHAR *ptszImageURL = db_get_tsa(pai->hContact, MODULE, "ImageURL");
+ wchar_t *ptszImageURL = db_get_tsa(pai->hContact, MODULE, "ImageURL");
if(ptszImageURL == NULL)
return GAIR_NOAVATAR;
@@ -228,9 +228,9 @@ INT_PTR NewsAggrRecvMessage(WPARAM, LPARAM lParam) void UpdateMenu(bool State)
{
if (!State) // to enable auto-update
- Menu_ModifyItem(hService2[0], LPGENT("Auto Update Enabled"), GetIconHandle("enabled"));
+ Menu_ModifyItem(hService2[0], LPGENW("Auto Update Enabled"), GetIconHandle("enabled"));
else // to disable auto-update
- Menu_ModifyItem(hService2[0], LPGENT("Auto Update Disabled"), GetIconHandle("disabled"));
+ Menu_ModifyItem(hService2[0], LPGENW("Auto Update Disabled"), GetIconHandle("disabled"));
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTBButton, State ? TTBST_PUSHED : 0);
db_set_b(NULL, MODULE, "AutoUpdate", !State);
diff --git a/plugins/NewsAggregator/Src/Utils.cpp b/plugins/NewsAggregator/Src/Utils.cpp index d79697cbc4..6a7558ba34 100644 --- a/plugins/NewsAggregator/Src/Utils.cpp +++ b/plugins/NewsAggregator/Src/Utils.cpp @@ -43,7 +43,7 @@ void NetlibUnInit() hNetlibUser = NULL;
}
-void GetNewsData(TCHAR *tszUrl, char **szData, MCONTACT hContact, HWND hwndDlg)
+void GetNewsData(wchar_t *tszUrl, char **szData, MCONTACT hContact, HWND hwndDlg)
{
Netlib_LogfT(hNetlibUser, L"Getting feed data %s.", tszUrl);
NETLIBHTTPREQUEST nlhr = { 0 };
@@ -52,7 +52,7 @@ void GetNewsData(TCHAR *tszUrl, char **szData, MCONTACT hContact, HWND hwndDlg) nlhr.cbSize = sizeof(nlhr);
nlhr.requestType = REQUEST_GET;
nlhr.flags = NLHRF_DUMPASTEXT | NLHRF_HTTP11 | NLHRF_REDIRECT;
- if (_tcsstr(tszUrl, L"https://") != NULL)
+ if (wcsstr(tszUrl, L"https://") != NULL)
nlhr.flags |= NLHRF_SSL;
char *szUrl = mir_t2a(tszUrl);
nlhr.szUrl = szUrl;
@@ -142,14 +142,14 @@ void UpdateList(HWND hwndList) UpdateListFlag = TRUE;
lvI.mask = LVIF_TEXT;
lvI.iSubItem = 0;
- TCHAR *ptszNick = db_get_tsa(hContact, MODULE, "Nick");
+ wchar_t *ptszNick = db_get_tsa(hContact, MODULE, "Nick");
if (ptszNick) {
lvI.pszText = ptszNick;
lvI.iItem = i;
ListView_InsertItem(hwndList, &lvI);
lvI.iSubItem = 1;
- TCHAR *ptszURL = db_get_tsa(hContact, MODULE, "URL");
+ wchar_t *ptszURL = db_get_tsa(hContact, MODULE, "URL");
if (ptszURL) {
lvI.pszText = ptszURL;
ListView_SetItem(hwndList, &lvI);
@@ -168,35 +168,35 @@ void DeleteAllItems(HWND hwndList) ListView_DeleteAllItems(hwndList);
}
-time_t __stdcall DateToUnixTime(const TCHAR *stamp, bool FeedType)
+time_t __stdcall DateToUnixTime(const wchar_t *stamp, bool FeedType)
{
struct tm timestamp;
- TCHAR date[9];
+ wchar_t date[9];
int i, y;
time_t t;
if (stamp == NULL)
return 0;
- TCHAR *p = NEWTSTR_ALLOCA(stamp);
+ wchar_t *p = NEWWSTR_ALLOCA(stamp);
if (FeedType) {
// skip '-' chars
int si = 0, sj = 0;
while (true) {
- if (p[si] == _T('-'))
+ if (p[si] == '-')
si++;
else if (!(p[sj++] = p[si++]))
break;
}
}
else {
- TCHAR *weekday, monthstr[4], timezonesign[2];
+ wchar_t *weekday, monthstr[4], timezonesign[2];
int day, month = 0, year, hour, min, sec, timezoneh, timezonem;
- if (_tcsstr(p, L",")) {
- weekday = _tcstok(p, L",");
- p = _tcstok(NULL, L",");
- _stscanf(p + 1, L"%d %3s %d %d:%d:%d %1s%02d%02d", &day, &monthstr, &year, &hour, &min, &sec, &timezonesign, &timezoneh, &timezonem);
+ if (wcsstr(p, L",")) {
+ weekday = wcstok(p, L",");
+ p = wcstok(NULL, L",");
+ swscanf(p + 1, L"%d %3s %d %d:%d:%d %1s%02d%02d", &day, &monthstr, &year, &hour, &min, &sec, &timezonesign, &timezoneh, &timezonem);
if (!mir_tstrcmpi(monthstr, L"Jan"))
month = 1;
if (!mir_tstrcmpi(monthstr, L"Feb"))
@@ -230,13 +230,13 @@ time_t __stdcall DateToUnixTime(const TCHAR *stamp, bool FeedType) else
mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec);
}
- else if (_tcsstr(p, L"T")) {
- _stscanf(p, L"%d-%d-%dT%d:%d:%d", &year, &month, &day, &hour, &min, &sec);
+ else if (wcsstr(p, L"T")) {
+ swscanf(p, L"%d-%d-%dT%d:%d:%d", &year, &month, &day, &hour, &min, &sec);
mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec);
}
else
{
- _stscanf(p, L"%d-%d-%d %d:%d:%d %1s%02d%02d", &year, &month, &day, &hour, &min, &sec, &timezonesign, &timezoneh, &timezonem);
+ swscanf(p, L"%d-%d-%d %d:%d:%d %1s%02d%02d", &year, &month, &day, &hour, &min, &sec, &timezonesign, &timezoneh, &timezonem);
if (!mir_tstrcmp(timezonesign, L"+"))
mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour - timezoneh, min - timezonem, sec);
else if (!mir_tstrcmp(timezonesign, L"-"))
@@ -273,7 +273,7 @@ time_t __stdcall DateToUnixTime(const TCHAR *stamp, bool FeedType) for (; *p != '\0' && !isdigit(*p); p++);
// Parse time
- if (_stscanf(p, L"%d:%d:%d", ×tamp.tm_hour, ×tamp.tm_min, ×tamp.tm_sec) != 3)
+ if (swscanf(p, L"%d:%d:%d", ×tamp.tm_hour, ×tamp.tm_min, ×tamp.tm_sec) != 3)
return 0;
timestamp.tm_isdst = 0; // DST is already present in _timezone below
@@ -320,16 +320,16 @@ bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal) }
}
if (date != NULL && size != NULL) {
- TCHAR *tdate = mir_a2t(date);
- TCHAR *tsize = mir_a2t(size);
+ wchar_t *tdate = mir_a2t(date);
+ wchar_t *tsize = mir_a2t(size);
struct _stat buf;
- int fh = _topen(tszLocal, _O_RDONLY);
+ int fh = _wopen(tszLocal, _O_RDONLY);
if (fh != -1) {
_fstat(fh, &buf);
time_t modtime = DateToUnixTime(tdate, 0);
time_t filemodtime = mktime(localtime(&buf.st_atime));
- if (modtime > filemodtime && buf.st_size != _ttoi(tsize)) {
+ if (modtime > filemodtime && buf.st_size != _wtoi(tsize)) {
DWORD dwBytes;
HANDLE hFile = CreateFile(tszLocal, GENERIC_READ | GENERIC_WRITE, NULL, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
WriteFile(hFile, pReply->pData, (DWORD)pReply->dataLength, &dwBytes, NULL);
@@ -451,7 +451,7 @@ HRESULT TestDocumentText(IHTMLDocument3 *pHtmlDoc, BSTR &message) return hr;
}
-LPCTSTR ClearText(CMString &result, const TCHAR *message)
+LPCTSTR ClearText(CMString &result, const wchar_t *message)
{
BSTR bstrHtml = SysAllocString(message), bstrRes = SysAllocString(L"");
HRESULT hr = TestMarkupServices(bstrHtml, &TestDocumentText, bstrRes);
@@ -465,7 +465,7 @@ LPCTSTR ClearText(CMString &result, const TCHAR *message) return result;
}
-MCONTACT GetContactByNick(const TCHAR *nick)
+MCONTACT GetContactByNick(const wchar_t *nick)
{
MCONTACT hContact = NULL;
@@ -477,7 +477,7 @@ MCONTACT GetContactByNick(const TCHAR *nick) return hContact;
}
-MCONTACT GetContactByURL(const TCHAR *url)
+MCONTACT GetContactByURL(const wchar_t *url)
{
MCONTACT hContact = NULL;
diff --git a/plugins/NewsAggregator/Src/stdafx.h b/plugins/NewsAggregator/Src/stdafx.h index b4787929cb..6640bcb4ca 100644 --- a/plugins/NewsAggregator/Src/stdafx.h +++ b/plugins/NewsAggregator/Src/stdafx.h @@ -62,14 +62,14 @@ extern UINT_PTR timerId; // check if Feeds is currently updating
extern bool ThreadRunning;
extern bool UpdateListFlag;
-extern TCHAR tszRoot[MAX_PATH];
+extern wchar_t tszRoot[MAX_PATH];
struct ItemInfo
{
HWND hwndList;
MCONTACT hContact;
int SelNumber;
- TCHAR nick[MAX_PATH];
- TCHAR url[MAX_PATH];
+ wchar_t nick[MAX_PATH];
+ wchar_t url[MAX_PATH];
};
//============ STRUCT USED TO MAKE AN UPDATE LIST ============
@@ -125,24 +125,24 @@ void CALLBACK timerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime void CALLBACK timerProc2(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
bool IsMyContact(MCONTACT hContact);
-void GetNewsData(TCHAR *szUrl, char **szData, MCONTACT hContact, HWND hwndDlg);
+void GetNewsData(wchar_t *szUrl, char **szData, MCONTACT hContact, HWND hwndDlg);
void CreateList(HWND hwndList);
void UpdateList(HWND hwndList);
void DeleteAllItems(HWND hwndList);
-time_t __stdcall DateToUnixTime(const TCHAR *stamp, bool FeedType);
+time_t __stdcall DateToUnixTime(const wchar_t *stamp, bool FeedType);
void CheckCurrentFeed(MCONTACT hContact);
void CheckCurrentFeedAvatar(MCONTACT hContact);
-LPCTSTR CheckFeed(TCHAR* tszURL, HWND hwndDlg);
+LPCTSTR CheckFeed(wchar_t* tszURL, HWND hwndDlg);
void UpdateMenu(bool State);
int ImportFeedsDialog();
-LPCTSTR ClearText(CMString &value, const TCHAR *message);
+LPCTSTR ClearText(CMString &value, const wchar_t *message);
bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal);
void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg);
INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-MCONTACT GetContactByNick(const TCHAR *nick);
-MCONTACT GetContactByURL(const TCHAR *url);
+MCONTACT GetContactByNick(const wchar_t *nick);
+MCONTACT GetContactByURL(const wchar_t *url);
// =============== NewsAggregator SERVICES ================
// Check all Feeds info
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp index 038a5cec5c..20afcf6e2e 100644 --- a/plugins/NoHistory/src/dllmain.cpp +++ b/plugins/NoHistory/src/dllmain.cpp @@ -150,9 +150,9 @@ int PrebuildContactMenu(WPARAM hContact, LPARAM) Menu_ShowItem(hMenuToggle, false);
else {
if (remove)
- Menu_ModifyItem(hMenuToggle, LPGENT("Enable History"), hIconKeep);
+ Menu_ModifyItem(hMenuToggle, LPGENW("Enable History"), hIconKeep);
else
- Menu_ModifyItem(hMenuToggle, LPGENT("Disable History"), hIconRemove);
+ Menu_ModifyItem(hMenuToggle, LPGENW("Disable History"), hIconRemove);
}
Menu_ShowItem(hMenuClear, !chat_room && db_event_count(hContact) > 0);
@@ -250,14 +250,14 @@ int ModulesLoaded(WPARAM, LPARAM) SET_UID(mi, 0xede12697, 0x3e9d, 0x47ca, 0x83, 0xe0, 0xc1, 0x40, 0x69, 0xbf, 0x2d, 0xab);
mi.position = -300010;
- mi.name.t = LPGENT("Disable History");
+ mi.name.w = LPGENW("Disable History");
mi.pszService = MS_NOHISTORY_TOGGLE;
mi.hIcolibItem = hIconRemove;
hMenuToggle = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x1c4b1c21, 0xc0d1, 0x44d1, 0xb5, 0x3c, 0xc7, 0x8d, 0xcf, 0x96, 0x51, 0xd7);
mi.position = -300005;
- mi.name.t = LPGENT("Clear History");
+ mi.name.w = LPGENW("Clear History");
mi.pszService = MS_NOHISTORY_CLEAR;
mi.hIcolibItem = hIconClear;
hMenuClear = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/NoHistory/src/options.cpp b/plugins/NoHistory/src/options.cpp index b680e150ae..11f2d04a00 100644 --- a/plugins/NoHistory/src/options.cpp +++ b/plugins/NoHistory/src/options.cpp @@ -223,9 +223,9 @@ int OptInit(WPARAM wParam, LPARAM) odp.position = -790000000;
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT);
- odp.ptszTitle = LPGENT("No History");
- odp.ptszGroup = LPGENT("History");
- odp.ptszTab = LPGENT("Logging");
+ odp.pwszTitle = LPGENW("No History");
+ odp.pwszGroup = LPGENW("History");
+ odp.pwszTab = LPGENW("Logging");
odp.pfnDlgProc = DlgProcOpts;
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp index 7e4e27a535..07bd984377 100644 --- a/plugins/Non-IM Contact/src/contactinfo.cpp +++ b/plugins/Non-IM Contact/src/contactinfo.cpp @@ -131,7 +131,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP }
/* group*/
- TCHAR *szGroup;
+ wchar_t *szGroup;
for (int i = 1; (szGroup = Clist_GroupGetName(i, NULL)) != NULL; i++)
SendDlgItemMessage(hwnd, IDC_GROUP, CB_INSERTSTRING, 0, LPARAM(szGroup));
@@ -154,8 +154,8 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (db_get_w(hContact, MODNAME, "Timer", 15)) {
CheckDlgButton(hwnd, CHK_USE_TIMER, BST_CHECKED);
EnableWindow(GetDlgItem(hwnd, IDC_TIMER), 1);
- TCHAR string[512];
- SetDlgItemText(hwnd, IDC_TIMER, _itot(db_get_w(hContact, MODNAME, "Timer", 15), string, 10));
+ wchar_t string[512];
+ SetDlgItemText(hwnd, IDC_TIMER, _itow(db_get_w(hContact, MODNAME, "Timer", 15), string, 10));
if (!db_get_w(NULL, MODNAME, "Timer", 1))
SetDlgItemText(hwnd, IDC_TIMER_INTERVAL_MSG, TranslateT("Non-IM Contact protocol timer is Disabled"));
else {
@@ -234,7 +234,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP else db_unset(hContact, MODNAME, "ProgramParamsString");
if (GetWindowTextLength(GetDlgItem(hwnd, IDC_GROUP))) {
- TCHAR text[512];
+ wchar_t text[512];
GetDlgItemText(hwnd, IDC_GROUP, text, _countof(text));
Clist_GroupCreate(NULL, text);
db_set_ts(hContact, "CList", "Group", text);
@@ -253,9 +253,9 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (IsDlgButtonChecked(hwnd, CHK_USE_TIMER)) {
if (GetWindowTextLength(GetDlgItem(hwnd, IDC_TIMER))) {
- TCHAR text[512];
+ wchar_t text[512];
GetDlgItemText(hwnd, IDC_TIMER, text, _countof(text));
- db_set_w(hContact, MODNAME, "Timer", (WORD)_ttoi(text));
+ db_set_w(hContact, MODNAME, "Timer", (WORD)_wtoi(text));
}
else db_set_w(hContact, MODNAME, "Timer", 15);
}
diff --git a/plugins/Non-IM Contact/src/dialog.cpp b/plugins/Non-IM Contact/src/dialog.cpp index 48f4dd5b43..243bc3b761 100644 --- a/plugins/Non-IM Contact/src/dialog.cpp +++ b/plugins/Non-IM Contact/src/dialog.cpp @@ -17,7 +17,7 @@ filename(0) <- will display the filename of the 0th file\r\nfile(0)wholeline( INT_PTR CALLBACK DlgProcNimcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR tmp[5];
+ wchar_t tmp[5];
switch (msg) {
case WM_INITDIALOG:
@@ -25,7 +25,7 @@ INT_PTR CALLBACK DlgProcNimcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar CheckDlgButton(hwnd, IDC_AWAYISNOTONLINE, db_get_b(NULL, MODNAME, "AwayAsStatus", 0) ? BST_CHECKED : BST_UNCHECKED);
if (db_get_w(NULL, MODNAME, "Timer", 1)) {
EnableWindow(GetDlgItem(hwnd, IDC_TIMER_INT), 1);
- SetDlgItemText(hwnd, IDC_TIMER_INT, _itot(db_get_w(NULL, MODNAME, "Timer", 1), tmp, 10));
+ SetDlgItemText(hwnd, IDC_TIMER_INT, _itow(db_get_w(NULL, MODNAME, "Timer", 1), tmp, 10));
EnableWindow(GetDlgItem(hwnd, IDC_TIMER_TEXT), 1);
}
else {
@@ -61,7 +61,7 @@ INT_PTR CALLBACK DlgProcNimcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar db_set_b(NULL, MODNAME, "AwayAsStatus", (BYTE)IsDlgButtonChecked(hwnd, IDC_AWAYISNOTONLINE));
if (BST_UNCHECKED == IsDlgButtonChecked(hwnd, IDC_DISABLETIMER) && GetWindowTextLength(GetDlgItem(hwnd, IDC_TIMER_INT))) {
GetDlgItemText(hwnd, IDC_TIMER_INT, tmp, _countof(tmp));
- db_set_w(NULL, MODNAME, "Timer", (WORD)_ttoi(tmp));
+ db_set_w(NULL, MODNAME, "Timer", (WORD)_wtoi(tmp));
}
else db_set_w(NULL, MODNAME, "Timer", 0);
return TRUE;
diff --git a/plugins/Non-IM Contact/src/files.cpp b/plugins/Non-IM Contact/src/files.cpp index aa5302f74b..d1596e2c50 100644 --- a/plugins/Non-IM Contact/src/files.cpp +++ b/plugins/Non-IM Contact/src/files.cpp @@ -293,9 +293,9 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) char string[1000];
mir_snprintf(fn, "fn%d", i);
if (GetWindowTextLength(GetDlgItem(hwnd, IDC_WWW_TIMER))) {
- TCHAR text[5];
+ wchar_t text[5];
GetDlgItemText(hwnd, IDC_WWW_TIMER, text, _countof(text));
- timer = _ttoi(text);
+ timer = _wtoi(text);
}
else timer = 60;
diff --git a/plugins/Non-IM Contact/src/main.cpp b/plugins/Non-IM Contact/src/main.cpp index 87a0194420..24d05d97c3 100644 --- a/plugins/Non-IM Contact/src/main.cpp +++ b/plugins/Non-IM Contact/src/main.cpp @@ -144,7 +144,7 @@ extern "C" __declspec(dllexport) int Load() CreateServiceFunction("NIM_Contact/DoubleClick", doubleClick);
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("&Non-IM Contact"), 600090000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("&Non-IM Contact"), 600090000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "D7CE61C5-1178-41BA-B2ED-5A711BB21AE9");
SET_UID(mi, 0x73c11266, 0x153c, 0x4da4, 0x9b, 0x82, 0x5c, 0xce, 0xca, 0x86, 0xd, 0x41);
diff --git a/plugins/NotesAndReminders/src/globals.h b/plugins/NotesAndReminders/src/globals.h index ce75e5cbd7..b918255061 100644 --- a/plugins/NotesAndReminders/src/globals.h +++ b/plugins/NotesAndReminders/src/globals.h @@ -122,7 +122,7 @@ extern int g_Transparency; extern char *g_RemindSMS;
-extern TCHAR *g_lpszAltBrowser;
+extern char *g_lpszAltBrowser;
extern int g_reminderListGeom[4];
extern int g_reminderListColGeom[2];
diff --git a/plugins/NotesAndReminders/src/hotkeys.cpp b/plugins/NotesAndReminders/src/hotkeys.cpp index 052e8d4dfd..2e96dd1608 100644 --- a/plugins/NotesAndReminders/src/hotkeys.cpp +++ b/plugins/NotesAndReminders/src/hotkeys.cpp @@ -15,32 +15,32 @@ void RegisterKeyBindings() memset(&desc, 0, sizeof(desc));
desc.cbSize = sizeof(desc);
- desc.ptszSection = _T(SECTIONNAME);
+ desc.ptszSection = _A2W(SECTIONNAME);
desc.dwFlags = HKD_TCHAR;
desc.pszName = MODULENAME"/NewNote";
- desc.ptszDescription = LPGENT("New Note");
+ desc.ptszDescription = LPGENW("New Note");
desc.lParam = KB_NEW_NOTE;
desc.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, VK_INSERT);
desc.pszService = MODULENAME"/MenuCommandAddNew";
Hotkey_Register(&desc);
desc.pszName = MODULENAME"/ToggleNotesVis";
- desc.ptszDescription = LPGENT("Toggle Notes Visibility");
+ desc.ptszDescription = LPGENW("Toggle Notes Visibility");
desc.lParam = KB_TOGGLE_NOTES;
desc.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, VK_ADD);
desc.pszService = MODULENAME"/MenuCommandShowHide";
Hotkey_Register(&desc);
desc.pszName = MODULENAME"/BringNotesFront";
- desc.ptszDescription = LPGENT("Bring All Notes to Front");
+ desc.ptszDescription = LPGENW("Bring All Notes to Front");
desc.lParam = KB_TOGGLE_NOTES;
desc.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, VK_HOME);
desc.pszService = MODULENAME"/MenuCommandBringAllFront";
Hotkey_Register(&desc);
desc.pszName = MODULENAME"/NewReminder";
- desc.ptszDescription = LPGENT("New Reminder");
+ desc.ptszDescription = LPGENW("New Reminder");
desc.lParam = KB_NEW_REMINDER;
desc.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, VK_SUBTRACT);
desc.pszService = MODULENAME"/MenuCommandNewReminder";
diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp index 30ee8282a4..ca2511778d 100644 --- a/plugins/NotesAndReminders/src/main.cpp +++ b/plugins/NotesAndReminders/src/main.cpp @@ -47,7 +47,7 @@ INT_PTR PluginMenuCommandAddNew(WPARAM w, LPARAM l) INT_PTR PluginMenuCommandDeleteAll(WPARAM w, LPARAM l)
{
- if (g_Stickies && MessageBox(NULL, TranslateT("Are you sure you want to delete all notes?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK)
+ if (g_Stickies && MessageBox(NULL, Translate("Are you sure you want to delete all notes?"), Translate(SECTIONNAME), MB_OKCANCEL) == IDOK)
DeleteNotes();
return 0;
}
@@ -84,7 +84,7 @@ INT_PTR PluginMenuCommandViewReminders(WPARAM w, LPARAM l) INT_PTR PluginMenuCommandDeleteReminders(WPARAM w, LPARAM l)
{
- if (RemindersList && MessageBox(NULL, TranslateT("Are you sure you want to delete all reminders?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK)
+ if (RemindersList && MessageBox(NULL, Translate("Are you sure you want to delete all reminders?"), Translate(SECTIONNAME), MB_OKCANCEL) == IDOK)
DeleteReminders();
return 0;
}
@@ -120,8 +120,8 @@ int OnOptInitialise(WPARAM w, LPARAM L) odp.position = 900002000;
odp.hInstance = hinstance;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_STNOTEOPTIONS);
- odp.ptszTitle = SECTIONNAME;
- odp.ptszGroup = LPGENT("Plugins");
+ odp.pszTitle = SECTIONNAME;
+ odp.pszGroup = LPGEN("Plugins");
odp.pfnDlgProc = DlgProcOptions;
odp.flags = ODPF_TCHAR;
Options_AddPage(w, &odp);
@@ -151,9 +151,9 @@ static void InitServices() {
// register sounds
- SkinAddNewSoundExT("AlertReminder", LPGENT("Alerts"), LPGENT("Reminder triggered"));
- SkinAddNewSoundExT("AlertReminder2", LPGENT("Alerts"), LPGENT("Reminder triggered (Alternative 1)"));
- SkinAddNewSoundExT("AlertReminder3", LPGENT("Alerts"), LPGENT("Reminder triggered (Alternative 2)"));
+ SkinAddNewSoundEx("AlertReminder", LPGEN("Alerts"), LPGEN("Reminder triggered"));
+ SkinAddNewSoundEx("AlertReminder2", LPGEN("Alerts"), LPGEN("Reminder triggered (Alternative 1)"));
+ SkinAddNewSoundEx("AlertReminder3", LPGEN("Alerts"), LPGEN("Reminder triggered (Alternative 2)"));
// register menu command services
@@ -202,49 +202,49 @@ int OnModulesLoaded(WPARAM wparam, LPARAM lparam) mi.position = 1600000000;
mi.hIcolibItem = iconList[2].hIcolib;
- mi.name.t = LPGENT("New &Note");
+ mi.name.w = LPGENW("New &Note");
mi.pszService = MODULENAME"/MenuCommandAddNew";
addMenuItem(mi);
mi.position = 1600000001;
mi.hIcolibItem = iconList[0].hIcolib;
- mi.name.t = LPGENT("New &Reminder");
+ mi.name.w = LPGENW("New &Reminder");
mi.pszService = MODULENAME"/MenuCommandNewReminder";
addMenuItem(mi);
mi.position = 1600100000;
mi.hIcolibItem = iconList[3].hIcolib;
- mi.name.t = LPGENT("&Show / Hide Notes");
+ mi.name.w = LPGENW("&Show / Hide Notes");
mi.pszService = MODULENAME"/MenuCommandShowHide";
addMenuItem(mi);
mi.position = 1600100001;
mi.hIcolibItem = iconList[13].hIcolib;
- mi.name.t = LPGENT("Vie&w Notes");
+ mi.name.w = LPGENW("Vie&w Notes");
mi.pszService = MODULENAME"/MenuCommandViewNotes";
addMenuItem(mi);
mi.position = 1600100002;
mi.hIcolibItem = iconList[1].hIcolib;
- mi.name.t = LPGENT("&Delete All Notes");
+ mi.name.w = LPGENW("&Delete All Notes");
mi.pszService = MODULENAME"/MenuCommandDeleteAll";
addMenuItem(mi);
mi.position = 1600100003;
mi.hIcolibItem = iconList[11].hIcolib;
- mi.name.t = LPGENT("&Bring All to Front");
+ mi.name.w = LPGENW("&Bring All to Front");
mi.pszService = MODULENAME"/MenuCommandBringAllFront";
addMenuItem(mi);
mi.position = 1600200000;
mi.hIcolibItem = iconList[6].hIcolib;
- mi.name.t = LPGENT("&View Reminders");
+ mi.name.w = LPGENW("&View Reminders");
mi.pszService = MODULENAME"/MenuCommandViewReminders";
addMenuItem(mi);
mi.position = 1600200001;
mi.hIcolibItem = iconList[5].hIcolib;
- mi.name.t = LPGENT("D&elete All Reminders");
+ mi.name.w = LPGENW("D&elete All Reminders");
mi.pszService = MODULENAME"/MenuCommandDeleteReminders";
addMenuItem(mi);
@@ -310,7 +310,7 @@ extern "C" __declspec(dllexport) int Load(void) hRichedDll = LoadLibrary("Msftedit.dll");
if (!hRichedDll) {
- if (MessageBox(0, TranslateT("Miranda could not load the Notes & Reminders plugin, Msftedit.dll is missing. If you are using WINE, please make sure you have Msftedit.dll installed. Press 'Yes' to continue loading Miranda."), _T(SECTIONNAME), MB_YESNO | MB_ICONINFORMATION) != IDYES)
+ if (MessageBox(0, Translate("Miranda could not load the Notes & Reminders plugin, Msftedit.dll is missing. If you are using WINE, please make sure you have Msftedit.dll installed. Press 'Yes' to continue loading Miranda."), SECTIONNAME, MB_YESNO | MB_ICONINFORMATION) != IDYES)
return 1;
return 0;
}
diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp index 8b752336ed..706e245013 100644 --- a/plugins/NotesAndReminders/src/notes.cpp +++ b/plugins/NotesAndReminders/src/notes.cpp @@ -59,29 +59,29 @@ static HWND LV; struct ColorPreset { - TCHAR *szName; + char *szName; COLORREF color; }; static struct ColorPreset clrPresets[] = { - {LPGENT("Black"), RGB(0,0,0)}, - {LPGENT("Maroon"), RGB(128,0,0)}, - {LPGENT("Green"), RGB(0,128,0)}, - {LPGENT("Olive"), RGB(128,128,0)}, - {LPGENT("Navy"), RGB(0,0,128)}, - {LPGENT("Purple"), RGB(128,0,128)}, - {LPGENT("Teal"), RGB(0,128,128)}, - {LPGENT("Gray"), RGB(128,128,128)}, - {LPGENT("Silver"), RGB(192,192,192)}, - {LPGENT("Red"), RGB(255,0,0)}, - {LPGENT("Orange"), RGB(255,155,0)}, - {LPGENT("Lime"), RGB(0,255,0)}, - {LPGENT("Yellow"), RGB(255,255,0)}, - {LPGENT("Blue"), RGB(0,0,255)}, - {LPGENT("Fuchsia"), RGB(255,0,255)}, - {LPGENT("Aqua"), RGB(0,255,255)}, - {LPGENT("White"), RGB(255,255,255)} + { LPGEN("Black"), RGB(0,0,0) }, + { LPGEN("Maroon"), RGB(128,0,0) }, + { LPGEN("Green"), RGB(0,128,0) }, + { LPGEN("Olive"), RGB(128,128,0) }, + { LPGEN("Navy"), RGB(0,0,128) }, + { LPGEN("Purple"), RGB(128,0,128) }, + { LPGEN("Teal"), RGB(0,128,128) }, + { LPGEN("Gray"), RGB(128,128,128) }, + { LPGEN("Silver"), RGB(192,192,192) }, + { LPGEN("Red"), RGB(255,0,0) }, + { LPGEN("Orange"), RGB(255,155,0) }, + { LPGEN("Lime"), RGB(0,255,0) }, + { LPGEN("Yellow"), RGB(255,255,0) }, + { LPGEN("Blue"), RGB(0,0,255) }, + { LPGEN("Fuchsia"), RGB(255,0,255) }, + { LPGEN("Aqua"), RGB(0,255,255) }, + { LPGEN("White"), RGB(255,255,255) } }; @@ -701,7 +701,7 @@ void PurgeNotes(void) void OnDeleteNote(HWND hdlg, STICKYNOTE *SN) { - if (MessageBox(hdlg, TranslateT("Are you sure you want to delete this note?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK) + if (MessageBoxW(hdlg, TranslateT("Are you sure you want to delete this note?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK) { if (SN->SNHwnd) DestroyWindow(SN->SNHwnd); @@ -975,7 +975,7 @@ __inline void JustSaveNotes(void) static int FindMenuItem(HMENU h, LPTSTR lpszName) { UINT i; - TCHAR s[128]; + char s[128]; int n = GetMenuItemCount(h); @@ -1040,7 +1040,7 @@ static BOOL DoContextMenu(HWND AhWnd,WPARAM wParam,LPARAM lParam) static void MeasureColorPresetMenuItem(HWND hdlg, LPMEASUREITEMSTRUCT lpMeasureItem, struct ColorPreset *clrPresets) { HDC hdc = GetDC(hdlg); - LPTSTR lpsz = TranslateTS(clrPresets->szName); + LPSTR lpsz = TranslateTS(clrPresets->szName); SIZE sz; GetTextExtentPoint32(hdc, lpsz, (int)mir_tstrlen(lpsz), &sz); ReleaseDC(hdlg, hdc); @@ -1567,7 +1567,7 @@ INT_PTR CALLBACK StickyNoteWndProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM l SN->pCustomFont = NULL; } - // clear text first to force a reformatting w.r.t scrollbar + // clear text first to force a reformatting w.r.w scrollbar SetWindowText(H, ""); SendMessage(H, WM_SETFONT, (WPARAM)(SN->pCustomFont ? SN->pCustomFont->hFont : hBodyFont), FALSE); SetNoteTextControl(SN); @@ -1604,7 +1604,7 @@ INT_PTR CALLBACK StickyNoteWndProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM l free(SN->pCustomFont); SN->pCustomFont = NULL; - // clear text first to force a reformatting w.r.t scrollbar + // clear text first to force a reformatting w.r.w scrollbar SetWindowText(H, ""); SendMessage(H, WM_SETFONT, (WPARAM)hBodyFont, FALSE); SetNoteTextControl(SN); @@ -1873,7 +1873,7 @@ INT_PTR CALLBACK DlgProcViewNotes(HWND Dialog,UINT Message,WPARAM wParam,LPARAM { LV_COLUMN lvCol; NMLISTVIEW *NM; - TCHAR *S; + char *S; int I; switch (Message) @@ -1923,7 +1923,7 @@ INT_PTR CALLBACK DlgProcViewNotes(HWND Dialog,UINT Message,WPARAM wParam,LPARAM { Window_SetIcon_IcoLib(Dialog, iconList[13].hIcolib); - SetWindowText(Dialog, LPGENT("Notes")); + SetWindowText(Dialog, LPGEN("Notes")); TranslateDialogDefault(Dialog); @@ -1932,25 +1932,25 @@ INT_PTR CALLBACK DlgProcViewNotes(HWND Dialog,UINT Message,WPARAM wParam,LPARAM HWND H = GetDlgItem(Dialog,IDC_LISTREMINDERS); lvCol.mask = LVCF_TEXT | LVCF_WIDTH; - S = TranslateT("Note text"); + S = Translate("Note text"); lvCol.pszText = S; lvCol.cx = g_notesListColGeom[3]; ListView_InsertColumn(H,0,&lvCol); lvCol.mask = LVCF_TEXT | LVCF_WIDTH; - S = TranslateT("Top"); + S = Translate("Top"); lvCol.pszText = S; lvCol.cx = g_notesListColGeom[2]; ListView_InsertColumn(H,0,&lvCol); lvCol.mask = LVCF_TEXT | LVCF_WIDTH; - S = TranslateT("Visible"); + S = Translate("Visible"); lvCol.pszText = S; lvCol.cx = g_notesListColGeom[1]; ListView_InsertColumn(H,0,&lvCol); lvCol.mask = LVCF_TEXT | LVCF_WIDTH; - S = TranslateT("Date/Title"); + S = Translate("Date/Title"); lvCol.pszText = S; lvCol.cx = g_notesListColGeom[0]; ListView_InsertColumn(H,0,&lvCol); diff --git a/plugins/NotesAndReminders/src/options.cpp b/plugins/NotesAndReminders/src/options.cpp index d8c013fa40..a4e498823b 100644 --- a/plugins/NotesAndReminders/src/options.cpp +++ b/plugins/NotesAndReminders/src/options.cpp @@ -19,7 +19,7 @@ int g_NoteWidth,g_NoteHeight; int g_Transparency;
char *g_RemindSMS = NULL;
-TCHAR *g_lpszAltBrowser = NULL;
+char *g_lpszAltBrowser = NULL;
int g_reminderListGeom[4] = {0};
int g_reminderListColGeom[2] = { 150, 205 };
@@ -72,32 +72,32 @@ static timeFormats[] = struct FontOptionsList
{
- TCHAR *szDescr;
+ char *szDescr;
COLORREF defColour;
- TCHAR *szDefFace;
+ char *szDefFace;
BYTE defStyle;
- char defSize;
- TCHAR *szBkgName;
+ int defSize;
+ char *szBkgName;
}
static fontOptionsList[] =
{
- {LPGENT("Sticky Note Caption"), RGB(0,0,0), "Small Fonts", 0, 7, LPGENT("Sticky Note Background Color")},
- //{LPGENT("Sticky Note Caption"), RGB(0,0,0), L"Terminal", 0, 6, LPGENT("Sticky Note Background Color")},
- //{LPGENT("Sticky Note Caption"), RGB(0,0,0), L"MS Serif", 0, 7, LPGENT("Sticky Note Background Color")},
- //{LPGENT("Sticky Note Body"), RGB(0,0,0), L"Tahoma", 0, 8, LPGENT("Sticky Note Background Color")},
- {LPGENT("Sticky Note Body"), RGB(0,0,0), "System", DBFONTF_BOLD, 10, LPGENT("Sticky Note Background Color")},
+ { LPGEN("Sticky Note Caption"), RGB(0,0,0), "Small Fonts", 0, 7, LPGEN("Sticky Note Background Color")},
+// { LPGEN("Sticky Note Caption"), RGB(0,0,0), L"Terminal", 0, 6, LPGEN("Sticky Note Background Color")},
+// { LPGEN("Sticky Note Caption"), RGB(0,0,0), L"MS Serif", 0, 7, LPGEN("Sticky Note Background Color")},
+// { LPGEN("Sticky Note Body"), RGB(0,0,0), L"Tahoma", 0, 8, LPGEN("Sticky Note Background Color")},
+ { LPGEN("Sticky Note Body"), RGB(0,0,0), "System", DBFONTF_BOLD, 10, LPGEN("Sticky Note Background Color")},
};
struct ColourOptionsList
{
- TCHAR *szName;
+ char *szName;
char *szSettingName;
COLORREF defColour;
}
static colourOptionsList[] =
{
- {LPGENT("Sticky Note Background Color"), "BodyColor", NRCDEFAULT_BODYCLR}
+ { LPGEN("Sticky Note Background Color"), "BodyColor", NRCDEFAULT_BODYCLR}
};
@@ -112,7 +112,7 @@ LPCSTR GetTimeFormatStr() }
#if defined( _UNICODE )
-static BYTE MsgDlgGetFontDefaultCharset(const TCHAR* szFont)
+static BYTE MsgDlgGetFontDefaultCharset(const wchar_t* szFont)
{
return DEFAULT_CHARSET;
}
@@ -161,12 +161,12 @@ static int CALLBACK EnumFontFamExProc(const LOGFONT *lpelfe, const TEXTMETRIC *l }
// get font charset according to current CP, if available for specified font
-static BYTE MsgDlgGetFontDefaultCharset(const TCHAR* szFont)
+static BYTE MsgDlgGetFontDefaultCharset(const char *szFont)
{
LOGFONT lf = {0};
int found = 0;
- mir_tstrcpy(lf.lfFaceName, szFont);
+ mir_strcpy(lf.lfFaceName, szFont);
lf.lfCharSet = MsgDlgGetCPDefaultCharset();
// check if the font supports specified charset
@@ -227,11 +227,11 @@ void RegisterFontServiceFonts() {
char szTemp[100];
- FontIDT fontid = {0};
+ FontID fontid = { 0 };
fontid.cbSize = sizeof(FontIDT);
- _tcsncpy(fontid.group, _T(SECTIONNAME), _countof(fontid.group));
- _tcsncpy(fontid.backgroundGroup, _T(SECTIONNAME), _countof(fontid.backgroundGroup) );
+ strncpy(fontid.group, _T(SECTIONNAME), _countof(fontid.group));
+ strncpy(fontid.backgroundGroup, _T(SECTIONNAME), _countof(fontid.backgroundGroup));
strncpy(fontid.dbSettingsGroup, MODULENAME, _countof(fontid.dbSettingsGroup));
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID | FIDF_SAVEPOINTSIZE;
@@ -239,12 +239,11 @@ void RegisterFontServiceFonts() int nFontScale = GetDeviceCaps(hDC, LOGPIXELSY);
ReleaseDC(NULL, hDC);
- for (int i = 0; i < _countof(fontOptionsList); i++)
- {
+ for (int i = 0; i < _countof(fontOptionsList); i++) {
fontid.order = i;
mir_snprintf(szTemp, "Font%d", i);
strncpy(fontid.prefix, szTemp, _countof(fontid.prefix));
- _tcsncpy(fontid.name, fontOptionsList[i].szDescr, _countof(fontid.name));
+ strncpy(fontid.name, fontOptionsList[i].szDescr, _countof(fontid.name));
fontid.deffontsettings.colour = fontOptionsList[i].defColour;
fontid.deffontsettings.size = (char)-MulDiv(fontOptionsList[i].defSize, nFontScale, 72);
@@ -252,23 +251,22 @@ void RegisterFontServiceFonts() fontid.deffontsettings.style = fontOptionsList[i].defStyle;
fontid.deffontsettings.charset = MsgDlgGetFontDefaultCharset(fontOptionsList[i].szDefFace);
- _tcsncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fontid.deffontsettings.szFace));
- _tcsncpy(fontid.backgroundName, fontOptionsList[i].szBkgName, _countof(fontid.backgroundName));
+ strncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fontid.deffontsettings.szFace));
+ strncpy(fontid.backgroundName, fontOptionsList[i].szBkgName, _countof(fontid.backgroundName));
FontRegisterT(&fontid);
}
- ColourIDT colorid = {0};
+ ColourIDT colorid = { 0 };
colorid.cbSize = sizeof(ColourIDT);
- _tcsncpy(colorid.group, _T(SECTIONNAME), _countof(colorid.group));
+ strncpy(colorid.group, _T(SECTIONNAME), _countof(colorid.group));
strncpy(colorid.dbSettingsGroup, MODULENAME, _countof(fontid.dbSettingsGroup));
colorid.flags = 0;
- for (int i = 0; i < _countof(colourOptionsList); i++)
- {
+ for (int i = 0; i < _countof(colourOptionsList); i++) {
colorid.order = i;
- _tcsncpy(colorid.name, colourOptionsList[i].szName, _countof(colorid.name));
+ strncpy(colorid.name, colourOptionsList[i].szName, _countof(colorid.name));
colorid.defcolour = colourOptionsList[i].defColour;
strncpy(colorid.setting, colourOptionsList[i].szSettingName, _countof(colorid.setting));
@@ -281,101 +279,94 @@ void RegisterFontServiceFonts() void LoadNRFont(int i, LOGFONT *lf, COLORREF *colour)
{
- FontIDT fontid = {0};
+ FontIDT fontid = { 0 };
- fontid.cbSize = sizeof(fontid);
- _tcsncpy(fontid.group, LPGENT(SECTIONNAME), _countof(fontid.group));
- _tcsncpy(fontid.name, fontOptionsList[i].szDescr, _countof(fontid.name));
-
- COLORREF col = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)lf);
+ fontid.cbSize = sizeof(fontid);
+ strncpy(fontid.group, LPGEN(SECTIONNAME), _countof(fontid.group));
+ strncpy(fontid.name, fontOptionsList[i].szDescr, _countof(fontid.name));
+ COLORREF col = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)lf);
if (colour)
- {
*colour = col;
- }
}
-static void TrimString(TCHAR *s)
+static void TrimString(char *s)
{
if (!s || !*s)
return;
- TCHAR *start = s;
- UINT n = UINT(mir_tstrlen(s) - 1);
+ char *start = s;
+ UINT n = UINT(mir_strlen(s) - 1);
- TCHAR *end = s + n;
+ char *end = s + n;
- if (!_istspace(*start) && !_istspace(*end))
- {
+ if (!iswspace(*start) && !iswspace(*end)) {
// nothing to trim
return;
}
// scan past leading spaces
- while (*start && _istspace(*start)) start++;
+ while (*start && iswspace(*start)) start++;
- if (!*start)
- {
+ if (!*start) {
// empty string
*s = 0;
return;
}
// trim trailing spaces
- while ( _istspace(*end) ) end--;
+ while (iswspace(*end)) end--;
end[1] = 0;
- if (start > s)
- {
+ if (start > s) {
// remove leading spaces
- memmove(s, start, ((UINT)(end-start)+2)*sizeof(TCHAR));
+ memmove(s, start, ((UINT)(end - start) + 2) * sizeof(wchar_t));
}
}
-INT_PTR CALLBACK DlgProcOptions(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK DlgProcOptions(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
{
BOOL LB;
WORD SzT;
void *P;
int i;
- switch (message)
- {
- case WM_INITDIALOG:
+ switch (message) {
+ case WM_INITDIALOG:
{
TranslateDialogDefault(hdlg);
- SendDlgItemMessage(hdlg,IDC_SLIDER_TRANSPARENCY,TBM_SETRANGE,TRUE,MAKELONG(0,255-MIN_ALPHA));
- SendDlgItemMessage(hdlg,IDC_SLIDER_TRANSPARENCY,TBM_SETPOS,TRUE,255-g_Transparency);
-
+ SendDlgItemMessage(hdlg, IDC_SLIDER_TRANSPARENCY, TBM_SETRANGE, TRUE, MAKELONG(0, 255 - MIN_ALPHA));
+ SendDlgItemMessage(hdlg, IDC_SLIDER_TRANSPARENCY, TBM_SETPOS, TRUE, 255 - g_Transparency);
+
CheckDlgButton(hdlg, IDC_CHECK_HIDENOTES, !g_ShowNotesAtStart ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, IDC_CHECK_MENUS, g_AddContListMI ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, IDC_CHECK_BUTTONS, g_ShowNoteButtons ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, IDC_CHECK_SCROLLBARS, g_ShowScrollbar ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, IDC_CHECK_CLOSE, g_CloseAfterAddReminder ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, IDC_CHECK_MSI, !g_UseDefaultPlaySound ? BST_CHECKED : BST_UNCHECKED);
- SetDlgItemInt(hdlg,IDC_EDIT_WIDTH,g_NoteWidth,FALSE);
- SetDlgItemInt(hdlg,IDC_EDIT_HEIGHT,g_NoteHeight,FALSE);
-
- SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_RESETCONTENT,0,0);
- SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_RESETCONTENT,0,0);
- for (i=0; i<_countof(dateFormats); i++)
- SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_ADDSTRING,0,(LPARAM)dateFormats[i].lpszUI);
- for (i=0; i<_countof(timeFormats); i++)
- SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_ADDSTRING,0,(LPARAM)timeFormats[i].lpszUI);
- SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_ADDSTRING,0,(LPARAM)Translate("None"));
- SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_ADDSTRING,0,(LPARAM)Translate("None"));
-
- SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_SETCURSEL,(WPARAM)(g_NoteTitleDate ? g_NoteTitleDate-1 : SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_GETCOUNT,0,0)-1),0);
- SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_SETCURSEL,(WPARAM)(g_NoteTitleTime ? g_NoteTitleTime-1 : SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_GETCOUNT,0,0)-1),0);
-
- if (g_RemindSMS)
- SetDlgItemText(hdlg,IDC_EDIT_EMAILSMS,g_RemindSMS);
- else
- SetDlgItemText(hdlg,IDC_EDIT_EMAILSMS,"");
-
- SetDlgItemText(hdlg,IDC_EDIT_ALTBROWSER,g_lpszAltBrowser ? g_lpszAltBrowser : "");
+ SetDlgItemInt(hdlg, IDC_EDIT_WIDTH, g_NoteWidth, FALSE);
+ SetDlgItemInt(hdlg, IDC_EDIT_HEIGHT, g_NoteHeight, FALSE);
+
+ SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_RESETCONTENT, 0, 0);
+ SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_RESETCONTENT, 0, 0);
+ for (i = 0; i < _countof(dateFormats); i++)
+ SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_ADDSTRING, 0, (LPARAM)dateFormats[i].lpszUI);
+ for (i = 0; i < _countof(timeFormats); i++)
+ SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_ADDSTRING, 0, (LPARAM)timeFormats[i].lpszUI);
+ SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_ADDSTRING, 0, (LPARAM)Translate("None"));
+ SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_ADDSTRING, 0, (LPARAM)Translate("None"));
+
+ SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_SETCURSEL, (WPARAM)(g_NoteTitleDate ? g_NoteTitleDate - 1 : SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_GETCOUNT, 0, 0) - 1), 0);
+ SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_SETCURSEL, (WPARAM)(g_NoteTitleTime ? g_NoteTitleTime - 1 : SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_GETCOUNT, 0, 0) - 1), 0);
+
+ if (g_RemindSMS)
+ SetDlgItemText(hdlg, IDC_EDIT_EMAILSMS, g_RemindSMS);
+ else
+ SetDlgItemText(hdlg, IDC_EDIT_EMAILSMS, "");
+
+ SetDlgItemText(hdlg, IDC_EDIT_ALTBROWSER, g_lpszAltBrowser ? g_lpszAltBrowser : "");
return TRUE;
}
case WM_HSCROLL:
@@ -384,99 +375,90 @@ INT_PTR CALLBACK DlgProcOptions(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPar return TRUE;
}
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == PSN_APPLY)
- {
- g_ShowNotesAtStart = !(BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_HIDENOTES);
- g_ShowNoteButtons = (BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_BUTTONS);
- g_ShowScrollbar = (BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_SCROLLBARS);
- g_AddContListMI = (BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_MENUS);
- g_NoteWidth = GetDlgItemInt(hdlg,IDC_EDIT_WIDTH,&LB,FALSE);
- g_NoteHeight = GetDlgItemInt(hdlg,IDC_EDIT_HEIGHT,&LB,FALSE);
- g_Transparency = 255-SendDlgItemMessage(hdlg,IDC_SLIDER_TRANSPARENCY,TBM_GETPOS,0,0);
- g_CloseAfterAddReminder = (BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_CLOSE);
- g_UseDefaultPlaySound = !(BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_MSI);
- g_NoteTitleDate = (SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_GETCURSEL,0,0) + 1) % SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_GETCOUNT,0,0);
- g_NoteTitleTime = (SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_GETCURSEL,0,0) + 1) % SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_GETCOUNT,0,0);
- if (g_NoteWidth < 179)
- {
+ if (((LPNMHDR)lParam)->code == PSN_APPLY) {
+ g_ShowNotesAtStart = !(BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_HIDENOTES);
+ g_ShowNoteButtons = (BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_BUTTONS);
+ g_ShowScrollbar = (BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_SCROLLBARS);
+ g_AddContListMI = (BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_MENUS);
+ g_NoteWidth = GetDlgItemInt(hdlg, IDC_EDIT_WIDTH, &LB, FALSE);
+ g_NoteHeight = GetDlgItemInt(hdlg, IDC_EDIT_HEIGHT, &LB, FALSE);
+ g_Transparency = 255 - SendDlgItemMessage(hdlg, IDC_SLIDER_TRANSPARENCY, TBM_GETPOS, 0, 0);
+ g_CloseAfterAddReminder = (BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_CLOSE);
+ g_UseDefaultPlaySound = !(BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_MSI);
+ g_NoteTitleDate = (SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_GETCURSEL, 0, 0) + 1) % SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_GETCOUNT, 0, 0);
+ g_NoteTitleTime = (SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_GETCURSEL, 0, 0) + 1) % SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_GETCOUNT, 0, 0);
+ if (g_NoteWidth < 179) {
g_NoteWidth = 179;
- SetDlgItemInt(hdlg,IDC_EDIT_WIDTH,g_NoteWidth,FALSE);
+ SetDlgItemInt(hdlg, IDC_EDIT_WIDTH, g_NoteWidth, FALSE);
}
- if (g_NoteHeight < 35)
- {
+ if (g_NoteHeight < 35) {
g_NoteHeight = 35;
- SetDlgItemInt(hdlg,IDC_EDIT_HEIGHT,g_NoteHeight,FALSE);
+ SetDlgItemInt(hdlg, IDC_EDIT_HEIGHT, g_NoteHeight, FALSE);
}
- SzT = (WORD)SendDlgItemMessage(hdlg,IDC_EDIT_EMAILSMS,WM_GETTEXTLENGTH,0,0);
- if (SzT != 0)
- {
+ SzT = (WORD)SendDlgItemMessage(hdlg, IDC_EDIT_EMAILSMS, WM_GETTEXTLENGTH, 0, 0);
+ if (SzT != 0) {
g_RemindSMS = (char*)realloc(g_RemindSMS, SzT + 1);
GetDlgItemText(hdlg, IDC_EDIT_EMAILSMS, g_RemindSMS, SzT + 1);
}
P = g_RemindSMS;
- db_set_blob(0,MODULENAME,"RemindEmail",P,SzT);
+ db_set_blob(0, MODULENAME, "RemindEmail", P, SzT);
- SzT = (WORD)SendDlgItemMessage(hdlg,IDC_EDIT_ALTBROWSER,WM_GETTEXTLENGTH,0,0);
- if (SzT != 0)
- {
- g_lpszAltBrowser = (TCHAR*)mir_realloc(g_lpszAltBrowser, SzT + 1);
+ SzT = (WORD)SendDlgItemMessage(hdlg, IDC_EDIT_ALTBROWSER, WM_GETTEXTLENGTH, 0, 0);
+ if (SzT != 0) {
+ g_lpszAltBrowser = (char*)mir_realloc(g_lpszAltBrowser, SzT + 1);
GetDlgItemText(hdlg, IDC_EDIT_ALTBROWSER, g_lpszAltBrowser, SzT + 1);
TrimString(g_lpszAltBrowser);
- if (!*g_lpszAltBrowser)
- {
+ if (!*g_lpszAltBrowser) {
mir_free(g_lpszAltBrowser);
g_lpszAltBrowser = NULL;
}
}
- else if (g_lpszAltBrowser)
- {
+ else if (g_lpszAltBrowser) {
mir_free(g_lpszAltBrowser);
g_lpszAltBrowser = NULL;
}
- SetDlgItemText(hdlg,IDC_EDIT_ALTBROWSER,g_lpszAltBrowser ? g_lpszAltBrowser : "");
+ SetDlgItemText(hdlg, IDC_EDIT_ALTBROWSER, g_lpszAltBrowser ? g_lpszAltBrowser : "");
if (g_lpszAltBrowser)
- db_set_s(0,MODULENAME,"AltBrowser",g_lpszAltBrowser);
+ db_set_s(0, MODULENAME, "AltBrowser", g_lpszAltBrowser);
else
- db_unset(0,MODULENAME,"AltBrowser");
-
- db_set_dw(0,MODULENAME,"ShowNotesAtStart",g_ShowNotesAtStart);
- db_set_dw(0,MODULENAME,"ShowNoteButtons",g_ShowNoteButtons);
- db_set_dw(0,MODULENAME,"ShowScrollbar",g_ShowScrollbar);
- db_set_dw(0,MODULENAME,"AddContactMenuItems",g_AddContListMI);
- db_set_dw(0,MODULENAME,"NoteWidth",g_NoteWidth);
- db_set_dw(0,MODULENAME,"NoteHeight",g_NoteHeight);
- db_set_dw(0,MODULENAME,"Transparency",g_Transparency);
- db_set_dw(0,MODULENAME,"NoteTitleDate",g_NoteTitleDate);
- db_set_dw(0,MODULENAME,"NoteTitleTime",g_NoteTitleTime);
- db_set_dw(0,MODULENAME,"CloseAfterAddReminder",g_CloseAfterAddReminder);
- db_set_dw(0,MODULENAME,"UseMCI",!g_UseDefaultPlaySound);
+ db_unset(0, MODULENAME, "AltBrowser");
+
+ db_set_dw(0, MODULENAME, "ShowNotesAtStart", g_ShowNotesAtStart);
+ db_set_dw(0, MODULENAME, "ShowNoteButtons", g_ShowNoteButtons);
+ db_set_dw(0, MODULENAME, "ShowScrollbar", g_ShowScrollbar);
+ db_set_dw(0, MODULENAME, "AddContactMenuItems", g_AddContListMI);
+ db_set_dw(0, MODULENAME, "NoteWidth", g_NoteWidth);
+ db_set_dw(0, MODULENAME, "NoteHeight", g_NoteHeight);
+ db_set_dw(0, MODULENAME, "Transparency", g_Transparency);
+ db_set_dw(0, MODULENAME, "NoteTitleDate", g_NoteTitleDate);
+ db_set_dw(0, MODULENAME, "NoteTitleTime", g_NoteTitleTime);
+ db_set_dw(0, MODULENAME, "CloseAfterAddReminder", g_CloseAfterAddReminder);
+ db_set_dw(0, MODULENAME, "UseMCI", !g_UseDefaultPlaySound);
SaveNotes();
LoadNotes(FALSE);
return TRUE;
}
break;
case WM_COMMAND:
- switch (LOWORD(wParam))
- {
+ switch (LOWORD(wParam)) {
case IDC_BTN_BROWSEBROWSER:
{
- TCHAR s[MAX_PATH];
+ char s[MAX_PATH];
- OPENFILENAME ofn = {0};
+ OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hdlg;
- ofn.lpstrFilter = TranslateT("Executable Files\0*.exe\0All Files\0*.*\0\0");
+ ofn.lpstrFilter = Translate("Executable Files\0*.exe\0All Files\0*.*\0\0");
ofn.lpstrFile = s;
ofn.nMaxFile = _countof(s);
- ofn.lpstrTitle = TranslateT("Select Executable");
+ ofn.lpstrTitle = Translate("Select Executable");
ofn.lpstrInitialDir = ".";
ofn.Flags = OFN_FILEMUSTEXIST | OFN_LONGNAMES | OFN_ENABLESIZING | OFN_DONTADDTORECENT;
GetDlgItemText(hdlg, IDC_EDIT_ALTBROWSER, s, ofn.nMaxFile);
- if ( GetOpenFileName(&ofn) )
- {
- SetDlgItemText(hdlg,IDC_EDIT_ALTBROWSER,s);
+ if (GetOpenFileName(&ofn)) {
+ SetDlgItemText(hdlg, IDC_EDIT_ALTBROWSER, s);
SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
}
}
@@ -485,8 +467,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPar {
SAFE_FREE((void**)&g_RemindSMS);
SetDlgItemText(hdlg, IDC_EDIT_EMAILSMS, "");
- if (g_lpszAltBrowser)
- {
+ if (g_lpszAltBrowser) {
mir_free(g_lpszAltBrowser);
g_lpszAltBrowser = NULL;
}
@@ -505,16 +486,16 @@ INT_PTR CALLBACK DlgProcOptions(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPar CheckDlgButton(hdlg, IDC_CHECK_BUTTONS, g_ShowNoteButtons ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, IDC_CHECK_CLOSE, g_CloseAfterAddReminder ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, IDC_CHECK_MSI, !g_UseDefaultPlaySound ? BST_CHECKED : BST_UNCHECKED);
- SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_SETCURSEL,(WPARAM)(g_NoteTitleDate-1),0);
- SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_SETCURSEL,(WPARAM)(g_NoteTitleTime-1),0);
+ SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_SETCURSEL, (WPARAM)(g_NoteTitleDate - 1), 0);
+ SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_SETCURSEL, (WPARAM)(g_NoteTitleTime - 1), 0);
g_NoteWidth = 179;
g_NoteHeight = 35;
- SetDlgItemInt(hdlg,IDC_EDIT_WIDTH,g_NoteWidth,FALSE);
- SetDlgItemInt(hdlg,IDC_EDIT_HEIGHT,g_NoteHeight,FALSE);
+ SetDlgItemInt(hdlg, IDC_EDIT_WIDTH, g_NoteWidth, FALSE);
+ SetDlgItemInt(hdlg, IDC_EDIT_HEIGHT, g_NoteHeight, FALSE);
g_Transparency = 255;
- SendDlgItemMessage(hdlg,IDC_SLIDER_TRANSPARENCY,TBM_SETPOS,TRUE,0);
+ SendDlgItemMessage(hdlg, IDC_SLIDER_TRANSPARENCY, TBM_SETPOS, TRUE, 0);
SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0); // JK optim
- return TRUE;
+ return TRUE;
}
case IDC_EDIT_ALTBROWSER:
case IDC_EDIT_EMAILSMS:
@@ -549,34 +530,33 @@ void InitSettings(void) Sz1 = MAX_PATH; P = NULL;
ReadSettingBlob(0, MODULENAME, "RemindEmail", (WORD*)&Sz1, &P);
- if (!(Sz1 && P))
+ if (!(Sz1 && P))
g_RemindSMS = NULL;
- else
- {
+ else {
g_RemindSMS = (char*)malloc(Sz1 + 1);
memcpy(g_RemindSMS, P, Sz1);
g_RemindSMS[Sz1] = 0;
FreeSettingBlob(Sz1, P);
}
- g_lpszAltBrowser = db_get_sa(0,MODULENAME,"AltBrowser");
-
- g_ShowNotesAtStart = (BOOL)db_get_dw(0,MODULENAME,"ShowNotesAtStart",1);
- g_ShowNoteButtons = (BOOL)db_get_dw(0,MODULENAME,"ShowNoteButtons",1);
- g_ShowScrollbar = (BOOL)db_get_dw(0,MODULENAME,"ShowScrollbar",1);
- g_AddContListMI = (BOOL)db_get_dw(0,MODULENAME,"AddContactMenuItems",1);
- g_NoteWidth = db_get_dw(0,MODULENAME,"NoteWidth",179);
- g_NoteHeight = db_get_dw(0,MODULENAME,"NoteHeight",50);
- g_Transparency = db_get_dw(0,MODULENAME,"Transparency",255);
- g_NoteTitleDate = db_get_dw(0,MODULENAME,"NoteTitleDate",1);
- g_NoteTitleTime = db_get_dw(0,MODULENAME,"NoteTitleTime",1);
- g_CloseAfterAddReminder = (BOOL)db_get_dw(0,MODULENAME,"CloseAfterAddReminder",1);
- g_UseDefaultPlaySound = !(BOOL)db_get_dw(0,MODULENAME,"UseMCI",1);
-
- ReadSettingIntArray(0,MODULENAME,"ReminderListGeom",g_reminderListGeom,_countof(g_reminderListGeom));
- ReadSettingIntArray(0,MODULENAME,"ReminderListColGeom",g_reminderListColGeom,_countof(g_reminderListColGeom));
- ReadSettingIntArray(0,MODULENAME,"NotesListGeom",g_notesListGeom,_countof(g_notesListGeom));
- ReadSettingIntArray(0,MODULENAME,"NotesListColGeom",g_notesListColGeom,_countof(g_notesListColGeom));
+ g_lpszAltBrowser = db_get_sa(0, MODULENAME, "AltBrowser");
+
+ g_ShowNotesAtStart = (BOOL)db_get_dw(0, MODULENAME, "ShowNotesAtStart", 1);
+ g_ShowNoteButtons = (BOOL)db_get_dw(0, MODULENAME, "ShowNoteButtons", 1);
+ g_ShowScrollbar = (BOOL)db_get_dw(0, MODULENAME, "ShowScrollbar", 1);
+ g_AddContListMI = (BOOL)db_get_dw(0, MODULENAME, "AddContactMenuItems", 1);
+ g_NoteWidth = db_get_dw(0, MODULENAME, "NoteWidth", 179);
+ g_NoteHeight = db_get_dw(0, MODULENAME, "NoteHeight", 50);
+ g_Transparency = db_get_dw(0, MODULENAME, "Transparency", 255);
+ g_NoteTitleDate = db_get_dw(0, MODULENAME, "NoteTitleDate", 1);
+ g_NoteTitleTime = db_get_dw(0, MODULENAME, "NoteTitleTime", 1);
+ g_CloseAfterAddReminder = (BOOL)db_get_dw(0, MODULENAME, "CloseAfterAddReminder", 1);
+ g_UseDefaultPlaySound = !(BOOL)db_get_dw(0, MODULENAME, "UseMCI", 1);
+
+ ReadSettingIntArray(0, MODULENAME, "ReminderListGeom", g_reminderListGeom, _countof(g_reminderListGeom));
+ ReadSettingIntArray(0, MODULENAME, "ReminderListColGeom", g_reminderListColGeom, _countof(g_reminderListColGeom));
+ ReadSettingIntArray(0, MODULENAME, "NotesListGeom", g_notesListGeom, _countof(g_notesListGeom));
+ ReadSettingIntArray(0, MODULENAME, "NotesListColGeom", g_notesListColGeom, _countof(g_notesListColGeom));
BodyColor = db_get_dw(NULL, MODULENAME, colourOptionsList[0].szSettingName, colourOptionsList[0].defColour);
@@ -592,19 +572,16 @@ void InitSettings(void) void TermSettings(void)
{
- if (g_reminderListGeom[2] > 0 && g_reminderListGeom[3] > 0)
- {
- WriteSettingIntArray(0,MODULENAME,"ReminderListGeom",g_reminderListGeom,_countof(g_reminderListGeom));
- WriteSettingIntArray(0,MODULENAME,"ReminderListColGeom",g_reminderListColGeom,_countof(g_reminderListColGeom));
+ if (g_reminderListGeom[2] > 0 && g_reminderListGeom[3] > 0) {
+ WriteSettingIntArray(0, MODULENAME, "ReminderListGeom", g_reminderListGeom, _countof(g_reminderListGeom));
+ WriteSettingIntArray(0, MODULENAME, "ReminderListColGeom", g_reminderListColGeom, _countof(g_reminderListColGeom));
}
- if (g_notesListGeom[2] > 0 && g_notesListGeom[3] > 0)
- {
- WriteSettingIntArray(0,MODULENAME,"NotesListGeom",g_notesListGeom,_countof(g_notesListGeom));
- WriteSettingIntArray(0,MODULENAME,"NotesListColGeom",g_notesListColGeom,_countof(g_notesListColGeom));
+ if (g_notesListGeom[2] > 0 && g_notesListGeom[3] > 0) {
+ WriteSettingIntArray(0, MODULENAME, "NotesListGeom", g_notesListGeom, _countof(g_notesListGeom));
+ WriteSettingIntArray(0, MODULENAME, "NotesListColGeom", g_notesListColGeom, _countof(g_notesListColGeom));
}
- if (g_lpszAltBrowser)
- {
+ if (g_lpszAltBrowser) {
mir_free(g_lpszAltBrowser);
g_lpszAltBrowser = NULL;
}
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index f0a141fd44..cf4e43f807 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -1786,7 +1786,7 @@ INT_PTR CALLBACK DlgProcNotifyReminder(HWND Dialog,UINT Message,WPARAM wParam,LP m += h * 60;
if (!m)
{
- MessageBox(Dialog, TranslateT("The specified time offset is invalid."), _T(SECTIONNAME), MB_OK | MB_ICONWARNING);
+ MessageBox(Dialog, Translate("The specified time offset is invalid."), _T(SECTIONNAME), MB_OK | MB_ICONWARNING);
return TRUE;
}
@@ -1881,8 +1881,8 @@ INT_PTR CALLBACK DlgProcNewReminder(HWND Dialog,UINT Message,WPARAM wParam,LPARA if (NewReminderVisible == 2)
{
// opening the edit reminder dialog (uses same dialog resource as add reminder)
- SetWindowText(Dialog, TranslateT("Reminder"));
- SetDlgItemText(Dialog, IDC_ADDREMINDER, TranslateT("&Update Reminder"));
+ SetWindowText(Dialog, Translate("Reminder"));
+ SetDlgItemText(Dialog, IDC_ADDREMINDER, Translate("&Update Reminder"));
ShowWindow(GetDlgItem(Dialog, IDC_VIEWREMINDERS), SW_HIDE);
li = pEditReminder->When;
@@ -2510,7 +2510,7 @@ INT_PTR CALLBACK DlgProcViewReminders(HWND Dialog,UINT Message,WPARAM wParam,LPA return TRUE;
}
case IDM_DELETEALLREMINDERS:
- if (RemindersList && MessageBox(Dialog, TranslateT("Are you sure you want to delete all reminders?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK)
+ if (RemindersList && MessageBox(Dialog, Translate("Are you sure you want to delete all reminders?"), Translate(SECTIONNAME), MB_OKCANCEL) == IDOK)
{
SetDlgItemText(Dialog, IDC_REMINDERDATA, "");
DeleteReminders();
@@ -2526,7 +2526,7 @@ INT_PTR CALLBACK DlgProcViewReminders(HWND Dialog,UINT Message,WPARAM wParam,LPA {
I = ListView_GetSelectionMark(H);
if (I != -1
- && MessageBox(Dialog, TranslateT("Are you sure you want to delete this reminder?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK)
+ && MessageBox(Dialog, Translate("Are you sure you want to delete this reminder?"), Translate(SECTIONNAME), MB_OKCANCEL) == IDOK)
{
SetDlgItemText(Dialog, IDC_REMINDERDATA, "");
DeleteReminder((REMINDERDATA*)TreeGetAt(RemindersList, I));
diff --git a/plugins/NotifyAnything/src/main.cpp b/plugins/NotifyAnything/src/main.cpp index cd35e85564..78bdfb9411 100644 --- a/plugins/NotifyAnything/src/main.cpp +++ b/plugins/NotifyAnything/src/main.cpp @@ -1,16 +1,16 @@ #include "stdafx.h"
-void cslog(const TCHAR *what, const TCHAR *file, int line)
+void cslog(const wchar_t *what, const wchar_t *file, int line)
{
if (g_settings.log_to_file) {
time_t t_;
time(&t_);
tm *t = localtime(&t_);
//FILE *f = fopen("na.log", "a");
- FILE *f = _tfopen(g_settings.log_filename.c_str(), L"a");
+ FILE *f = _wfopen(g_settings.log_filename.c_str(), L"a");
if (f) {
//fprintf(f, "%s: %s:%i\n", what, file, line);
- _ftprintf(f, L"[%04i-%02i-%02i %02i:%02i:%02i cs] %s: %s:%i\n",
+ fwprintf(f, L"[%04i-%02i-%02i %02i:%02i:%02i cs] %s: %s:%i\n",
int(t->tm_year + 1900), int(t->tm_mon), int(t->tm_mday),
int(t->tm_hour), int(t->tm_min), int(t->tm_sec), what, file, line);
fclose(f);
@@ -21,7 +21,7 @@ void cslog(const TCHAR *what, const TCHAR *file, int line) HANDLE g_udp_thread, g_tcp_thread;
SOCKET g_udp_socket, g_tcp_socket;
volatile bool g_exit_threads, g_firstrun;
-std::tstring g_mirandaDir;
+std::wstring g_mirandaDir;
mir_cs g_wsocklock;
HINSTANCE hInst;
@@ -56,7 +56,7 @@ enum replace_mode_t { };
struct popup_t {
- std::tstring id, icon, sound, passwd, contact, message, left, right, opened, closed;
+ std::wstring id, icon, sound, passwd, contact, message, left, right, opened, closed;
COLORREF foreground, background;
int delay;
bool beep;
@@ -64,13 +64,13 @@ struct popup_t { HWND hwnd;
};
-typedef std::map<std::tstring, popup_t *> popups_t;
+typedef std::map<std::wstring, popup_t *> popups_t;
typedef std::set<popup_t *> anon_popups_t;
popups_t g_popups;
anon_popups_t g_anon_popups;
mir_cs g_popups_cs;
-std::tstring strip(std::tstring str)
+std::wstring strip(std::wstring str)
{
while (!str.empty() && isspace(str[0]))
str.erase(0, 1);
@@ -79,7 +79,7 @@ std::tstring strip(std::tstring str) return str;
}
-void dbg_msg(std::tstring str, int type)
+void dbg_msg(std::wstring str, int type)
{
str = strip(str);
@@ -91,9 +91,9 @@ void dbg_msg(std::tstring str, int type) time_t t_;
time(&t_);
tm *t = localtime(&t_);
- FILE *f = _tfopen(g_settings.log_filename.c_str(), L"a");
+ FILE *f = _wfopen(g_settings.log_filename.c_str(), L"a");
if (f) {
- _ftprintf(f, L"[%04i-%02i-%02i %02i:%02i:%02i dbg_msg] %s\n",
+ fwprintf(f, L"[%04i-%02i-%02i %02i:%02i:%02i dbg_msg] %s\n",
int(t->tm_year + 1900), int(t->tm_mon), int(t->tm_mday),
int(t->tm_hour), int(t->tm_min), int(t->tm_sec), str.c_str());
fclose(f);
@@ -109,7 +109,7 @@ void showLastError() FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL);
- dbg_msg((TCHAR *)lpMsgBuf, SM_WARNING);
+ dbg_msg((wchar_t *)lpMsgBuf, SM_WARNING);
LocalFree(lpMsgBuf);
}
@@ -131,31 +131,31 @@ BOOL CALLBACK enum_icons_func(HMODULE, LPCTSTR, LPTSTR name, LONG_PTR data) return TRUE;
}
-void registerSound(const std::tstring &name)
+void registerSound(const std::wstring &name)
{
- static std::set<std::tstring> sset;
+ static std::set<std::wstring> sset;
if (sset.find(name) != sset.end())
return;
sset.insert(name);
- std::tstring id = L"NotifyAnything_" + name;
- std::tstring desc = L"NotifyAnything: " + name;
- std::tstring file = name + L".wav";
+ std::wstring id = L"NotifyAnything_" + name;
+ std::wstring desc = L"NotifyAnything: " + name;
+ std::wstring file = name + L".wav";
SKINSOUNDDESCEX ssd = { 0 };
ssd.cbSize = sizeof(ssd);
ssd.dwFlags = SSDF_TCHAR;
ssd.pszName = _T2A(id.c_str());
- ssd.ptszSection = LPGENT("Notify Anything");
+ ssd.ptszSection = LPGENW("Notify Anything");
ssd.ptszDescription = desc.c_str();
ssd.ptszDefaultFile = file.c_str();
Skin_AddSound(&ssd);
}
-HICON getIcon(const std::tstring &name)
+HICON getIcon(const std::wstring &name)
{
- static std::map<std::tstring, HICON> icons;
+ static std::map<std::wstring, HICON> icons;
static HICON deficon;
static bool init;
if (!init) {
@@ -185,7 +185,7 @@ HICON getIcon(const std::tstring &name) icons[L"file"] = Skin_LoadIcon(SKINICON_EVENT_FILE);
}
- std::map<std::tstring, HICON>::iterator i = icons.find(name);
+ std::map<std::wstring, HICON>::iterator i = icons.find(name);
if (i != icons.end())
return i->second;
@@ -200,9 +200,9 @@ HICON getIcon(const std::tstring &name) return deficon;
}
- std::tstring file((TCHAR*)name.c_str(), 0, p);
+ std::wstring file((wchar_t*)name.c_str(), 0, p);
- std::tstring rname(file.c_str(), p + 1);
+ std::wstring rname(file.c_str(), p + 1);
if (rname.empty()) {
dbg_msg(L"No resource name given.", SM_WARNING);
return deficon;
@@ -218,7 +218,7 @@ HICON getIcon(const std::tstring &name) if (isdigit(rname[0])) {
enum_icons_t info;
info.found = false;
- info.nr = _ttoi(rname.c_str());
+ info.nr = _wtoi(rname.c_str());
if (info.nr <= 0) {
dbg_msg(L"Icon indices start at 1.", SM_WARNING);
return deficon;
@@ -249,7 +249,7 @@ HICON getIcon(const std::tstring &name) return icons[name] = (HICON)icon;
}
-bool getNext(std::tstring &out, std::tstring &in, TCHAR sep)
+bool getNext(std::wstring &out, std::wstring &in, wchar_t sep)
{
while (!in.empty() && in[0] == ' ')
in.erase(0, 1);
@@ -289,7 +289,7 @@ bool getNext(std::tstring &out, std::tstring &in, TCHAR sep) return false;
}
-std::tstring unquote(std::tstring str)
+std::wstring unquote(std::wstring str)
{
size_t p;
while ((p = str.find('\"')) != str.npos)
@@ -297,9 +297,9 @@ std::tstring unquote(std::tstring str) return str;
}
-void getAll(std::vector<std::tstring> &out, std::tstring &in, TCHAR sep, bool unquote_)
+void getAll(std::vector<std::wstring> &out, std::wstring &in, wchar_t sep, bool unquote_)
{
- std::tstring arg;
+ std::wstring arg;
while (getNext(arg, in, sep))
if (!arg.empty()) {
if (unquote_)
@@ -308,12 +308,12 @@ void getAll(std::vector<std::tstring> &out, std::tstring &in, TCHAR sep, bool un }
}
-const TCHAR *decode_se_arg(std::tstring &str)
+const wchar_t *decode_se_arg(std::wstring &str)
{
return (str.empty()) ? 0 : str.c_str();
}
-void processSingleAction(const std::tstring &what, bool &closeflag)
+void processSingleAction(const std::wstring &what, bool &closeflag)
{
if (!what.compare(0, 7, L"system:")) {
if (!g_settings.allow_execute) {
@@ -321,7 +321,7 @@ void processSingleAction(const std::tstring &what, bool &closeflag) return;
}
- std::tstring argstr(what, 7);
+ std::wstring argstr(what, 7);
if (_tsystem(argstr.c_str()) == -1)
dbg_msg(L"Failed to execute: " + argstr, SM_WARNING);
@@ -332,16 +332,16 @@ void processSingleAction(const std::tstring &what, bool &closeflag) return;
}
- std::tstring argstr(what, 4);
- std::vector<std::tstring> args;
+ std::wstring argstr(what, 4);
+ std::vector<std::wstring> args;
getAll(args, argstr, ' ', true);
if (args.empty())
throw L"Insufficient arguments: " + what;
- std::vector<const TCHAR *> cargs;
- for (std::vector<std::tstring>::iterator i = args.begin(), e = args.end(); i != e; ++i)
+ std::vector<const wchar_t *> cargs;
+ for (std::vector<std::wstring>::iterator i = args.begin(), e = args.end(); i != e; ++i)
cargs.push_back(i->c_str());
cargs.push_back(0);
@@ -355,15 +355,15 @@ void processSingleAction(const std::tstring &what, bool &closeflag) return;
}
- std::tstring argstr(what, 5);
+ std::wstring argstr(what, 5);
- std::tstring file, args;
+ std::wstring file, args;
if (!getNext(file, argstr, ' '))
throw L"No filename provided: " + what;
file = strip(file);
args = strip(argstr);
- const TCHAR *cargs = decode_se_arg(args);
+ const wchar_t *cargs = decode_se_arg(args);
if ((INT_PTR)ShellExecute(0, L"open", file.c_str(), cargs, 0, SW_SHOWNORMAL) <= 32)
throw L"Failed to open: " + file + L" " + args;
@@ -375,9 +375,9 @@ void processSingleAction(const std::tstring &what, bool &closeflag) return;
}
- std::tstring argstr(what, 6);
+ std::wstring argstr(what, 6);
- std::tstring verb, file, args, dir;
+ std::wstring verb, file, args, dir;
if (!getNext(verb, argstr, ':'))
throw L"No verb provided: " + what;
if (!getNext(file, argstr, ','))
@@ -398,19 +398,19 @@ void processSingleAction(const std::tstring &what, bool &closeflag) throw L"Action not recognized: " + what;
}
-void processAction(const std::tstring &what, bool &closeflag)
+void processAction(const std::wstring &what, bool &closeflag)
{
try
{
- std::tstring argstr = what;
- std::vector<std::tstring> actions;
+ std::wstring argstr = what;
+ std::vector<std::wstring> actions;
- std::tstring action;
+ std::wstring action;
while (getNext(action, argstr, ';'))
if (!action.empty())
processSingleAction(action, closeflag);
}
- catch (std::tstring err) {
+ catch (std::wstring err) {
dbg_msg(err, SM_WARNING);
}
}
@@ -425,7 +425,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA case WM_COMMAND:
{
mir_cslock lck(g_popups_cs);
- std::tstring left;
+ std::wstring left;
if (pd)
left = pd->left;
@@ -443,7 +443,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA case WM_CONTEXTMENU:
{
mir_cslock lck(g_popups_cs);
- std::tstring right;
+ std::wstring right;
if (pd)
right = pd->right;
@@ -468,7 +468,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA case UM_FREEPLUGINDATA:
{
mir_cslock lck(g_popups_cs);
- std::tstring closed;
+ std::wstring closed;
if (pd)
closed = pd->closed;
@@ -489,8 +489,8 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA int showMessage(const popup_t &msg)
{
POPUPDATAT ppd = { 0 };
- _tcsncpy(ppd.lptzText, strip(msg.message).c_str(), MAX_SECONDLINE);
- _tcsncpy(ppd.lptzContactName, msg.contact.c_str(), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzText, strip(msg.message).c_str(), MAX_SECONDLINE);
+ wcsncpy(ppd.lptzContactName, msg.contact.c_str(), MAX_CONTACTNAME);
ppd.colorBack = msg.background;
ppd.colorText = msg.foreground;
ppd.lchIcon = getIcon(msg.icon);
@@ -557,7 +557,7 @@ inline int dehex(int c) { return 0;
}
-COLORREF parseColor(const std::tstring &buf, bool &ok)
+COLORREF parseColor(const std::wstring &buf, bool &ok)
{
ok = false;
for (int i = 0; i != buf.size(); ++i)
@@ -615,7 +615,7 @@ void loadDefaults(popup_t &msg, char ch) }
}
-bool parseSimpleMessage(const std::tstring &buf, popup_t &msg, char sep)
+bool parseSimpleMessage(const std::wstring &buf, popup_t &msg, char sep)
{
size_t p = buf.find(sep);
if (p == buf.npos)
@@ -627,18 +627,18 @@ bool parseSimpleMessage(const std::tstring &buf, popup_t &msg, char sep) return true;
}
-bool parseComplexMessage(const std::tstring &buf, popup_t &msg, char sep)
+bool parseComplexMessage(const std::wstring &buf, popup_t &msg, char sep)
{
- const TCHAR *p = buf.c_str();
- const TCHAR *npos = _tcschr(p, sep);
+ const wchar_t *p = buf.c_str();
+ const wchar_t *npos = wcschr(p, sep);
bool passok = false;
while ((p = npos)) {
++p;
- const TCHAR *cpos = _tcschr(p, ':');
- npos = _tcschr(p, sep);
+ const wchar_t *cpos = wcschr(p, ':');
+ npos = wcschr(p, sep);
- const TCHAR *wend = cpos;
+ const wchar_t *wend = cpos;
if (!wend || npos && npos < wend)
wend = npos;
if (!wend) {
@@ -646,8 +646,8 @@ bool parseComplexMessage(const std::tstring &buf, popup_t &msg, char sep) return false;
}
- std::tstring what(p, wend);
- std::tstring arg;
+ std::wstring what(p, wend);
+ std::wstring arg;
if (wend == cpos && wend && npos)
arg.assign(cpos + 1, npos);
else if (!cpos)
@@ -714,7 +714,7 @@ bool parseComplexMessage(const std::tstring &buf, popup_t &msg, char sep) msg.closed = arg;
}
else if (what == L"delay") {
- msg.delay = _ttoi(arg.c_str());
+ msg.delay = _wtoi(arg.c_str());
}
else if (what == L"id") {
msg.id = arg;
@@ -753,21 +753,21 @@ bool parseComplexMessage(const std::tstring &buf, popup_t &msg, char sep) return true;
}
-bool parseMessage(const std::tstring &abuf, popup_t &msg)
+bool parseMessage(const std::wstring &abuf, popup_t &msg)
{
if (abuf.empty()) {
dbg_msg(L"Empty message ignored.", SM_NOTIFY);
return false;
}
- std::tstring buf = abuf;
+ std::wstring buf = abuf;
char sep = '#';
if (buf.size() >= 3 && !isalnum(buf[0]) && buf[0] == buf[1] && buf[1] == buf[2]) {
sep = buf[0];
buf.erase(0, 3);
}
- if (_tcschr(L"*!%", buf[0]) && sep != buf[0]) {
+ if (wcschr(L"*!%", buf[0]) && sep != buf[0]) {
if (buf.size() < 2) return false;
loadDefaults(msg, buf[0]);
buf.erase(0, 1);
@@ -783,15 +783,15 @@ bool parseMessage(const std::tstring &abuf, popup_t &msg) return false;
}
-void processMessage(std::tstring buf)
+void processMessage(std::wstring buf)
{
if (g_settings.log_to_file) {
time_t t_;
time(&t_);
tm *t = localtime(&t_);
- FILE *f = _tfopen(g_settings.log_filename.c_str(), L"a");
+ FILE *f = _wfopen(g_settings.log_filename.c_str(), L"a");
if (f) {
- bool err = _ftprintf(f, L"[%04i-%02i-%02i %02i:%02i:%02i] %s\n",
+ bool err = fwprintf(f, L"[%04i-%02i-%02i %02i:%02i:%02i] %s\n",
int(t->tm_year + 1900), int(t->tm_mon + 1), int(t->tm_mday),
int(t->tm_hour), int(t->tm_min), int(t->tm_sec), buf.c_str()) < 0;
if (fclose(f) == EOF || err)
@@ -822,7 +822,7 @@ void processMessage(std::tstring buf) if (g_settings.use_pcspeaker)
Beep(650, 50);
else {
- std::tstring sname = L"NotifyAnything_" + msg.sound;
+ std::wstring sname = L"NotifyAnything_" + msg.sound;
SkinPlaySound(_T2A(sname.c_str()));
}
}
@@ -891,7 +891,7 @@ void __cdecl udptcpThreadFunc(void *useUdp) buf[err] = '\0';
if (err > 0)
- processMessage((TCHAR*)_A2T(buf));
+ processMessage((wchar_t*)_A2T(buf));
}
}
else {
@@ -923,7 +923,7 @@ void __cdecl udptcpThreadFunc(void *useUdp) }
}
if (!totalbuf.empty())
- processMessage((TCHAR*)_A2T(buf));
+ processMessage((wchar_t*)_A2T(buf));
}
}
return;
@@ -981,7 +981,7 @@ extern "C" int __declspec(dllexport) Load() g_firstrun = true;
mir_getLP(&pluginInfo);
- TCHAR buf[MAX_PATH + 1];
+ wchar_t buf[MAX_PATH + 1];
mir_tstrcpy(buf, L".");
g_mirandaDir = _tgetcwd(buf, MAX_PATH);
diff --git a/plugins/NotifyAnything/src/options.cpp b/plugins/NotifyAnything/src/options.cpp index 238354357b..42ca149146 100644 --- a/plugins/NotifyAnything/src/options.cpp +++ b/plugins/NotifyAnything/src/options.cpp @@ -25,9 +25,9 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara }
{
- TCHAR buf[10];
+ wchar_t buf[10];
SetDlgItemText(hwndDlg, NA_LOG_FILENAME, g_settings.log_filename.c_str());
- SetDlgItemText(hwndDlg, NA_PORT, _itot(g_settings.port, buf, 10));
+ SetDlgItemText(hwndDlg, NA_PORT, _itow(g_settings.port, buf, 10));
SetDlgItemText(hwndDlg, NA_PASSWORD, g_settings.password.c_str());
UINT state;
switch (g_settings.sound) {
@@ -56,7 +56,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
case NA_LOG_BROWSE:
if (HIWORD(wParam) == BN_CLICKED) {
- TCHAR szTemp[MAX_PATH + 1], szTemp1[MAX_PATH + 1], szProfileDir[MAX_PATH + 1];
+ wchar_t szTemp[MAX_PATH + 1], szTemp1[MAX_PATH + 1], szProfileDir[MAX_PATH + 1];
GetDlgItemText(hwndDlg, NA_LOG_FILENAME, szTemp, _countof(szTemp));
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
@@ -107,10 +107,10 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara s.use_pcspeaker = IsDlgButtonChecked(hwndDlg, NA_PCSPEAKER_CHECK) != BST_UNCHECKED;
s.allow_execute = IsDlgButtonChecked(hwndDlg, NA_ALLOW_EXECUTE) != BST_UNCHECKED;
- TCHAR buf[1000];
+ wchar_t buf[1000];
if (!GetDlgItemText(hwndDlg, NA_PORT, buf, _countof(buf)))
buf[0] = '\0';
- int port = _ttoi(buf);
+ int port = _wtoi(buf);
if (port <= 0 || port > 65535)
MessageBox(0, TranslateT("Invalid port number"), TranslateT("NotifyAnything"), MB_ICONWARNING | MB_OK);
else
diff --git a/plugins/NotifyAnything/src/stdafx.h b/plugins/NotifyAnything/src/stdafx.h index ee5af5344a..497a5666f0 100644 --- a/plugins/NotifyAnything/src/stdafx.h +++ b/plugins/NotifyAnything/src/stdafx.h @@ -33,7 +33,7 @@ struct NASettings { bool local_only, debug_messages, log_to_file, use_pcspeaker, allow_execute;
sound_t sound;
int port;
- std::tstring password, log_filename;
+ std::wstring password, log_filename;
};
extern NASettings g_settings;
@@ -46,5 +46,5 @@ void load_settings(); int OptionsInitialize(WPARAM wParam, LPARAM lParam);
-extern std::tstring g_mirandaDir;
+extern std::wstring g_mirandaDir;
#define LOG_ID LPGEN("NotifyAnything")
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index 0c8bff05f9..c474591f69 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -50,7 +50,7 @@ INT_PTR NudgeSend(WPARAM hContact, LPARAM lParam) char *protoName = GetContactProto(hContact);
int diff = time(NULL) - db_get_dw(hContact, "Nudge", "LastSent", time(NULL) - 30);
if (diff < GlobalNudge.sendTimeSec) {
- TCHAR msg[500];
+ wchar_t msg[500];
mir_sntprintf(msg, TranslateT("You are not allowed to send too much nudge (only 1 each %d sec, %d sec left)"), GlobalNudge.sendTimeSec, 30 - diff);
if (GlobalNudge.useByProtocol) {
for (int i = 0; i < arNudges.getCount(); i++) {
@@ -250,7 +250,7 @@ static int TabsrmmButtonInit(WPARAM, LPARAM) {
BBButton bbd = { sizeof(bbd) };
bbd.pszModuleName = "Nudge";
- bbd.ptszTooltip = LPGENT("Send Nudge");
+ bbd.ptszTooltip = LPGENW("Send Nudge");
bbd.dwDefPos = 300;
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISLSIDEBUTTON | BBBF_CANBEHIDDEN;
bbd.hIcon = iconList[0].hIcolib;
@@ -341,7 +341,7 @@ extern "C" int __declspec(dllexport) Load(void) mi.flags = CMIF_NOTOFFLINE | CMIF_TCHAR;
mi.position = -500050004;
mi.hIcolibItem = iconList[0].hIcolib;
- mi.name.t = LPGENT("Send &Nudge");
+ mi.name.w = LPGENW("Send &Nudge");
mi.pszService = MS_NUDGE_SEND;
g_hContactMenu = Menu_AddContactMenuItem(&mi);
@@ -393,7 +393,7 @@ void LoadPopupClass() POPUPCLASS ppc = { sizeof(ppc) };
ppc.flags = PCF_TCHAR;
ppc.pszName = "Nudge";
- ppc.ptszDescription = LPGENT("Show Nudge");
+ ppc.ptszDescription = LPGENW("Show Nudge");
ppc.hIcon = IcoLib_GetIconByHandle(iconList[0].hIcolib);
ppc.colorBack = NULL;
ppc.colorText = NULL;
@@ -442,17 +442,17 @@ int Preview() return 0;
}
-void Nudge_ShowPopup(CNudgeElement*, MCONTACT hContact, TCHAR * Message)
+void Nudge_ShowPopup(CNudgeElement*, MCONTACT hContact, wchar_t * Message)
{
hContact = db_mc_tryMeta(hContact);
- TCHAR *lpzContactName = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *lpzContactName = (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0);
if (ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
POPUPDATACLASS NudgePopup = { 0 };
NudgePopup.cbSize = sizeof(NudgePopup);
NudgePopup.hContact = hContact;
- NudgePopup.ptszText = Message;
- NudgePopup.ptszTitle = lpzContactName;
+ NudgePopup.pwszText = Message;
+ NudgePopup.pwszTitle = lpzContactName;
NudgePopup.pszClassName = "nudge";
CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&NudgePopup);
}
@@ -466,8 +466,8 @@ void Nudge_ShowPopup(CNudgeElement*, MCONTACT hContact, TCHAR * Message) NudgePopup.PluginWindowProc = NudgePopupProc;
NudgePopup.PluginData = (void *)1;
- _tcscpy_s(NudgePopup.lptzText, Message);
- _tcscpy_s(NudgePopup.lptzContactName, lpzContactName);
+ wcscpy_s(NudgePopup.lptzText, Message);
+ wcscpy_s(NudgePopup.lptzContactName, lpzContactName);
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&NudgePopup, 0);
}
@@ -517,14 +517,14 @@ void Nudge_AddAccount(PROTOACCOUNT *proto) mir_snprintf(p->NudgeSoundname, "%s: Nudge", proto->szModuleName);
strcpy_s(p->ProtocolName, proto->szModuleName);
- _tcscpy_s(p->AccountName, proto->tszAccountName);
+ wcscpy_s(p->AccountName, proto->tszAccountName);
p->Load();
p->hEvent = hevent;
- TCHAR soundDesc[MAXMODULELABELLENGTH + 10];
- mir_sntprintf(soundDesc, LPGENT("Nudge for %s"), proto->tszAccountName);
- SkinAddNewSoundExT(p->NudgeSoundname, LPGENT("Nudge"), soundDesc);
+ wchar_t soundDesc[MAXMODULELABELLENGTH + 10];
+ mir_sntprintf(soundDesc, LPGENW("Nudge for %s"), proto->tszAccountName);
+ SkinAddNewSoundExT(p->NudgeSoundname, LPGENW("Nudge"), soundDesc);
arNudges.insert(p);
}
diff --git a/plugins/Nudge/src/nudge.cpp b/plugins/Nudge/src/nudge.cpp index 1e0d6a0576..7c0ac3646b 100644 --- a/plugins/Nudge/src/nudge.cpp +++ b/plugins/Nudge/src/nudge.cpp @@ -82,19 +82,19 @@ void CNudgeElement::Load(void) mir_snprintf(SectionName, "%s-recText", ProtocolName);
if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) {
- _tcsncpy(this->recText, dbv.ptszVal, TEXT_LEN);
- if (_tcsclen(this->recText) < 1)
- _tcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
+ wcsncpy(this->recText, dbv.ptszVal, TEXT_LEN);
+ if (wcslen(this->recText) < 1)
+ wcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
db_free(&dbv);
}
- else _tcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
+ else wcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
mir_snprintf(SectionName, "%s-senText", ProtocolName);
if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) {
- _tcsncpy(this->senText, dbv.ptszVal, TEXT_LEN);
- if (_tcsclen(this->senText) < 1)
- _tcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
+ wcsncpy(this->senText, dbv.ptszVal, TEXT_LEN);
+ if (wcslen(this->senText) < 1)
+ wcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
db_free(&dbv);
}
- else _tcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
+ else wcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
}
diff --git a/plugins/Nudge/src/nudge.h b/plugins/Nudge/src/nudge.h index 71b3bcd366..d1fd358795 100644 --- a/plugins/Nudge/src/nudge.h +++ b/plugins/Nudge/src/nudge.h @@ -31,10 +31,10 @@ struct CNudge struct CNudgeElement : public MZeroedObject
{
char ProtocolName[64];
- TCHAR AccountName[128];
+ wchar_t AccountName[128];
char NudgeSoundname[100];
- TCHAR recText[TEXT_LEN];
- TCHAR senText[TEXT_LEN];
+ wchar_t recText[TEXT_LEN];
+ wchar_t senText[TEXT_LEN];
bool showPopup;
bool showStatus;
bool openMessageWindow;
diff --git a/plugins/Nudge/src/options.cpp b/plugins/Nudge/src/options.cpp index eca4c9d061..57dcaf9c0a 100644 --- a/plugins/Nudge/src/options.cpp +++ b/plugins/Nudge/src/options.cpp @@ -93,7 +93,7 @@ static INT_PTR CALLBACK DlgProcShakeOpt(HWND hwnd,UINT msg,WPARAM wParam,LPARAM case WM_INITDIALOG:
TranslateDialogDefault(hwnd);
{
- TCHAR szBuf[20];
+ wchar_t szBuf[20];
mir_sntprintf(szBuf, L"%d", shake.nMoveClist);
SetDlgItemText(hwnd, IDC_LNUMBER_CLIST, szBuf);
mir_sntprintf(szBuf, L"%d", shake.nMoveChat);
@@ -130,7 +130,7 @@ static INT_PTR CALLBACK DlgProcShakeOpt(HWND hwnd,UINT msg,WPARAM wParam,LPARAM if ((HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CLIST) || (HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CHAT)
|| (HWND)lParam == GetDlgItem(hwnd, IDC_SSCALE_CLIST) || (HWND)lParam == GetDlgItem(hwnd, IDC_SSCALE_CHAT))
{
- TCHAR szBuf[20];
+ wchar_t szBuf[20];
DWORD dwPos = SendMessage((HWND)lParam, TBM_GETPOS, 0, 0);
mir_sntprintf(szBuf, L"%d", dwPos);
if ((HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CLIST))
diff --git a/plugins/Nudge/src/stdafx.h b/plugins/Nudge/src/stdafx.h index 80422dd571..0ee06f2245 100644 --- a/plugins/Nudge/src/stdafx.h +++ b/plugins/Nudge/src/stdafx.h @@ -42,7 +42,7 @@ int Preview(); /*
*
****************************/
-void Nudge_ShowPopup(CNudgeElement*, MCONTACT, TCHAR *);
+void Nudge_ShowPopup(CNudgeElement*, MCONTACT, wchar_t *);
/*
*
diff --git a/plugins/OpenFolder/src/openFolder.cpp b/plugins/OpenFolder/src/openFolder.cpp index ed9cb35cf4..8c6e7e62ad 100644 --- a/plugins/OpenFolder/src/openFolder.cpp +++ b/plugins/OpenFolder/src/openFolder.cpp @@ -29,9 +29,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) static INT_PTR MenuCommand_OpenFolder(WPARAM, LPARAM)
{
- TCHAR szMirandaPath[MAX_PATH];
+ wchar_t szMirandaPath[MAX_PATH];
GetModuleFileName(GetModuleHandle(NULL), szMirandaPath, _countof(szMirandaPath));
- TCHAR *p = _tcsrchr(szMirandaPath, '\\');
+ wchar_t *p = wcsrchr(szMirandaPath, '\\');
if (p)
p[1] = 0;
@@ -91,8 +91,8 @@ extern "C" int __declspec(dllexport) Load() hotkey.cbSize = sizeof(hotkey);
hotkey.dwFlags = HKD_TCHAR;
hotkey.pszName = "Open Folder";
- hotkey.ptszDescription = LPGENT("Open Folder");
- hotkey.ptszSection = LPGENT("Main");
+ hotkey.ptszDescription = LPGENW("Open Folder");
+ hotkey.ptszSection = LPGENW("Main");
hotkey.pszService = MS_OPENFOLDER_OPEN;
hotkey.DefHotKey = MAKEWORD( 'O', HOTKEYF_SHIFT | HOTKEYF_ALT );
Hotkey_Register(&hotkey);
@@ -102,7 +102,7 @@ extern "C" int __declspec(dllexport) Load() mi.position = 0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = icon.hIcolib;
- mi.name.t = LPGENT("Open Folder");
+ mi.name.w = LPGENW("Open Folder");
mi.pszService = MS_OPENFOLDER_OPEN;
Menu_AddMainMenuItem(&mi);
diff --git a/plugins/OpenSSL/src/ssl_openssl.cpp b/plugins/OpenSSL/src/ssl_openssl.cpp index d9bcdbd89b..158c7d7c5b 100644 --- a/plugins/OpenSSL/src/ssl_openssl.cpp +++ b/plugins/OpenSSL/src/ssl_openssl.cpp @@ -126,7 +126,7 @@ static void ReportSslError(SECURITY_STATUS scRet, int line, bool = false) break; default: - TCHAR szMsgBuf[256]; + wchar_t szMsgBuf[256]; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, scRet, LANG_USER_DEFAULT, szMsgBuf, _countof(szMsgBuf), NULL); tszMsg += szMsgBuf; } diff --git a/plugins/OpenSSL/src/stdafx.h b/plugins/OpenSSL/src/stdafx.h index e577d911df..966baded3b 100644 --- a/plugins/OpenSSL/src/stdafx.h +++ b/plugins/OpenSSL/src/stdafx.h @@ -27,7 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct SslHandle *HSSL; -#include <tchar.h> #include <shlobj.h> #include <delayimp.h> #include <security.h> diff --git a/plugins/PackUpdater/Src/Events.cpp b/plugins/PackUpdater/Src/Events.cpp index ad126ec69b..bc12d5359b 100644 --- a/plugins/PackUpdater/Src/Events.cpp +++ b/plugins/PackUpdater/Src/Events.cpp @@ -29,8 +29,8 @@ int ModulesLoaded(WPARAM, LPARAM) hkd.cbSize = sizeof(hkd);
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "Check for pack updates";
- hkd.ptszDescription = LPGENT("Check for pack updates");
- hkd.ptszSection = LPGENT("Pack Updater");
+ hkd.ptszDescription = LPGENW("Check for pack updates");
+ hkd.ptszSection = LPGENW("Pack Updater");
hkd.pszService = MODNAME"/CheckUpdates";
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, VK_F10) | HKF_MIRANDA_LOCAL;
hkd.lParam = FALSE;
diff --git a/plugins/PackUpdater/Src/Notifications.cpp b/plugins/PackUpdater/Src/Notifications.cpp index 9bb3df6958..b22066e480 100644 --- a/plugins/PackUpdater/Src/Notifications.cpp +++ b/plugins/PackUpdater/Src/Notifications.cpp @@ -326,8 +326,8 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam {
vector<FILEINFO> &todo = *(vector<FILEINFO> *)GetWindowLongPtr(hDlg, GWLP_USERDATA);
ShowWindow(hDlg, SW_HIDE);
- TCHAR tszBuff[2048] = { 0 }, tszFileDest[MAX_PATH] = { 0 }, tszFilePathDest[MAX_PATH] = { 0 }, tszFilePathBack[MAX_PATH] = { 0 }, tszFileName[MAX_PATH] = { 0 };
- TCHAR* tszExt = NULL;
+ wchar_t tszBuff[2048] = { 0 }, tszFileDest[MAX_PATH] = { 0 }, tszFilePathDest[MAX_PATH] = { 0 }, tszFilePathBack[MAX_PATH] = { 0 }, tszFileName[MAX_PATH] = { 0 };
+ wchar_t* tszExt = NULL;
char szKey[64] = { 0 };
vector<int> arFileType;
vector<tString> arFilePath;
@@ -426,10 +426,10 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam rc = MessageBox(NULL, tszBuff, Title, MB_YESNO | MB_ICONQUESTION);
if (rc == IDYES) {
for (int i = 0; i < UpdatesCount; i++) {
- TCHAR* tszUtilRootPlug = NULL;
- TCHAR* tszUtilRootIco = NULL;
- TCHAR* tszUtilRoot = NULL;
- TCHAR tszCurrentDir[MAX_PATH];
+ wchar_t* tszUtilRootPlug = NULL;
+ wchar_t* tszUtilRootIco = NULL;
+ wchar_t* tszUtilRoot = NULL;
+ wchar_t tszCurrentDir[MAX_PATH];
switch (arFileType[i]) {
case 0:
@@ -441,8 +441,8 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam memset(&pi, 0, sizeof(PROCESS_INFORMATION));
si.cb = sizeof(STARTUPINFO);
{
- _tcsncpy_s(tszCurrentDir, arFilePath[i].c_str(), _TRUNCATE);
- TCHAR *p = _tcsrchr(tszCurrentDir, '\\');
+ wcsncpy_s(tszCurrentDir, arFilePath[i].c_str(), _TRUNCATE);
+ wchar_t *p = wcsrchr(tszCurrentDir, '\\');
if (p) *p = 0;
}
CreateProcess(arFilePath[i].c_str(), L"", NULL, NULL, FALSE, NULL, NULL, tszCurrentDir, &si, &pi);
diff --git a/plugins/PackUpdater/Src/Notifications.h b/plugins/PackUpdater/Src/Notifications.h index 6a92fb41b9..125e77f98b 100644 --- a/plugins/PackUpdater/Src/Notifications.h +++ b/plugins/PackUpdater/Src/Notifications.h @@ -64,9 +64,9 @@ typedef struct tagMYOPTIONS { } MYOPTIONS;
static struct {
- TCHAR *Text;
+ wchar_t *Text;
int Action;
} PopupActions[] = {
- LPGENT("Close popup"), PCA_CLOSEPOPUP,
- LPGENT("Do nothing"), PCA_DONOTHING
+ LPGENW("Close popup"), PCA_CLOSEPOPUP,
+ LPGENW("Do nothing"), PCA_DONOTHING
};
diff --git a/plugins/PackUpdater/Src/Options.cpp b/plugins/PackUpdater/Src/Options.cpp index 143cde8828..ef4e41fd39 100644 --- a/plugins/PackUpdater/Src/Options.cpp +++ b/plugins/PackUpdater/Src/Options.cpp @@ -390,15 +390,15 @@ int OptInit(WPARAM wParam, LPARAM) odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_UPDATENOTIFY);
- odp.ptszGroup = LPGENT("Services");
- odp.ptszTitle = LPGENT("Pack Updater");
+ odp.pwszGroup = LPGENW("Services");
+ odp.pwszTitle = LPGENW("Pack Updater");
odp.pfnDlgProc = UpdateNotifyOptsProc;
Options_AddPage(wParam, &odp);
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUP);
- odp.ptszGroup = LPGENT("Popups");
- odp.ptszTitle = LPGENT("Pack Updater");
+ odp.pwszGroup = LPGENW("Popups");
+ odp.pwszTitle = LPGENW("Pack Updater");
odp.pfnDlgProc = DlgPopupOpts;
Options_AddPage(wParam, &odp);
}
diff --git a/plugins/PackUpdater/Src/PackUpdater.cpp b/plugins/PackUpdater/Src/PackUpdater.cpp index c4e3a97cad..eabc12dbba 100644 --- a/plugins/PackUpdater/Src/PackUpdater.cpp +++ b/plugins/PackUpdater/Src/PackUpdater.cpp @@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA. HINSTANCE hInst = NULL;
HANDLE hPackUpdaterFolder = NULL;
-TCHAR tszRoot[MAX_PATH] = { 0 };
+wchar_t tszRoot[MAX_PATH] = { 0 };
int hLangpack;
PLUGININFOEX pluginInfoEx = {
@@ -54,7 +54,7 @@ extern "C" __declspec(dllexport) int Load(void) {
mir_getLP(&pluginInfoEx);
- TCHAR *tszFolder = Utils_ReplaceVarsT(L"%miranda_userdata%\\" DEFAULT_UPDATES_FOLDER);
+ wchar_t *tszFolder = Utils_ReplaceVarsT(L"%miranda_userdata%\\" DEFAULT_UPDATES_FOLDER);
mir_tstrncpy(tszRoot, tszFolder, _countof(tszRoot));
hPackUpdaterFolder = FoldersRegisterCustomPathT(MODULEA, LPGEN("Pack Updater"), MIRANDA_USERDATAT L"\\" DEFAULT_UPDATES_FOLDER);
@@ -75,7 +75,7 @@ extern "C" __declspec(dllexport) int Load(void) mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = IcoLib_GetIcon("check_update");
- mi.name.t = LPGENT("Check for pack updates");
+ mi.name.w = LPGENW("Check for pack updates");
mi.pszService = MODNAME"/CheckUpdates";
Menu_AddMainMenuItem(&mi);
// Add empty updates folder menu item
@@ -85,7 +85,7 @@ extern "C" __declspec(dllexport) int Load(void) mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = IcoLib_GetIcon("empty_folder");
- mi.name.t = LPGENT("Clear pack updates folder");
+ mi.name.w = LPGENW("Clear pack updates folder");
mi.pszService = MODNAME"/EmptyFolder";
Menu_AddMainMenuItem(&mi);
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp index 622ee25cab..62fa5d83e1 100644 --- a/plugins/PackUpdater/Src/Utils.cpp +++ b/plugins/PackUpdater/Src/Utils.cpp @@ -25,7 +25,7 @@ INT FileCount = 0, CurrentFile = 0, Number = 0; BYTE Reminder, AutoUpdate;
BYTE UpdateOnStartup, UpdateOnPeriod, OnlyOnceADay, PeriodMeasure;
INT Period;
-TCHAR tszDialogMsg[2048] = { 0 };
+wchar_t tszDialogMsg[2048] = { 0 };
FILEINFO* pFileInfo = NULL;
FILEURL* pFileUrl = NULL;
HANDLE hCheckThread = NULL, hNetlibUser = NULL;
@@ -162,7 +162,7 @@ BOOL Exists(LPCTSTR strName) return GetFileAttributes(strName) != INVALID_FILE_ATTRIBUTES;
}
-BOOL IsPluginDisabled(TCHAR* filename)
+BOOL IsPluginDisabled(wchar_t* filename)
{
char* fname = mir_t2a(filename);
int res = db_get_b(NULL, "PluginDisable", fname, 0);
@@ -170,16 +170,16 @@ BOOL IsPluginDisabled(TCHAR* filename) return res;
}
-size_t getVer(const TCHAR* verStr)
+size_t getVer(const wchar_t* verStr)
{
int v1 = 0, v2 = 0, v3 = 0, v4 = 0;
- _stscanf(verStr, L"%d.%d.%d.%d", &v1, &v2, &v3, &v4);
+ swscanf(verStr, L"%d.%d.%d.%d", &v1, &v2, &v3, &v4);
return v1 * 10000000 + v2 * 100000 + v3 * 1000 + v4;
}
static void CheckUpdates(void *)
{
- TCHAR tszBuff[2048] = { 0 }, tszFileInfo[30] = { 0 }, tszTmpIni[MAX_PATH] = { 0 };
+ wchar_t tszBuff[2048] = { 0 }, tszFileInfo[30] = { 0 }, tszTmpIni[MAX_PATH] = { 0 };
char szKey[64] = { 0 };
vector<FILEINFO> UpdateFiles;
@@ -246,7 +246,7 @@ static void CheckUpdates(void *) GetPrivateProfileString(tszFileInfo, L"Descr", L"", Files[CurrentFile].tszDescr, _countof(Files[CurrentFile].tszDescr), tszTmpIni);
GetPrivateProfileString(tszFileInfo, L"DiskFileName", L"", tszBuff, MAX_PATH, tszTmpIni);
- if (_tcsstr(tszBuff, L"\\")) { //check update name
+ if (wcsstr(tszBuff, L"\\")) { //check update name
Title = TranslateT("Pack Updater");
Text = TranslateT("Name of Update's file is not supported.");
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups1", DEFAULT_POPUP_ENABLED)) {
@@ -268,7 +268,7 @@ static void CheckUpdates(void *) mir_sntprintf(tszBuff, L"Plugins\\%s", Files[CurrentFile].File.tszDiskPath);
else
mir_sntprintf(tszBuff, L"Plugins\\%s\\%s", Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
- TCHAR pluginFolderName[MAX_PATH];
+ wchar_t pluginFolderName[MAX_PATH];
PathToAbsoluteT(tszBuff, pluginFolderName);
if (!Files[CurrentFile].Force && (IsPluginDisabled(Files[CurrentFile].File.tszDiskPath) || !Exists(pluginFolderName))) //check if plugin disabled or not exists
continue;
@@ -278,7 +278,7 @@ static void CheckUpdates(void *) VARST tszSysRoot(L"%SystemRoot%");
VARST tszProgFiles(L"%ProgramFiles%");
- if (Files[CurrentFile].FileType != 1 && !IsUserAnAdmin() && (_tcsstr(tszRoot, tszSysRoot) || _tcsstr(tszRoot, tszProgFiles))) {
+ if (Files[CurrentFile].FileType != 1 && !IsUserAnAdmin() && (wcsstr(tszRoot, tszSysRoot) || wcsstr(tszRoot, tszProgFiles))) {
MessageBox(NULL, TranslateT("Update is not possible!\nYou have no Administrator's rights.\nPlease run Miranda NG with Administrator's rights."), Title, MB_ICONINFORMATION);
DeleteFile(tszTmpIni);
hCheckThread = NULL;
@@ -286,7 +286,7 @@ static void CheckUpdates(void *) } // user have not admin's rights
//äîáàâèòü ïðîâåðêó íà ñóùåñòâîâàíèå ôàéëà
- TCHAR tszFilePathDest[MAX_PATH] = { 0 };
+ wchar_t tszFilePathDest[MAX_PATH] = { 0 };
switch (Files[CurrentFile].FileType) {
case 0:
case 1:
@@ -309,7 +309,7 @@ static void CheckUpdates(void *) break;
case 4:
case 5: {
- TCHAR *tszUtilRoot = VARST(L"%miranda_path%");
+ wchar_t *tszUtilRoot = VARST(L"%miranda_path%");
if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, L"") == 0)
mir_sntprintf(tszFilePathDest, L"%s\\%s", tszUtilRoot, Files[CurrentFile].File.tszDiskPath);
else
diff --git a/plugins/PackUpdater/Src/stdafx.h b/plugins/PackUpdater/Src/stdafx.h index 4c8786e114..e1c681cc64 100644 --- a/plugins/PackUpdater/Src/stdafx.h +++ b/plugins/PackUpdater/Src/stdafx.h @@ -51,19 +51,19 @@ typedef std::wstring tString; struct FILEURL
{
- TCHAR tszDownloadURL[2048];
- TCHAR tszDiskPath[MAX_PATH];
+ wchar_t tszDownloadURL[2048];
+ wchar_t tszDiskPath[MAX_PATH];
};
struct FILEINFO
{
- TCHAR tszCurVer[16];
- TCHAR tszNewVer[16];
- TCHAR tszLastVer[16];
- TCHAR tszAdvFolder[256];
- TCHAR tszInfoURL[2048];
- TCHAR tszMessage[5000];
- TCHAR tszDescr[256];
+ wchar_t tszCurVer[16];
+ wchar_t tszNewVer[16];
+ wchar_t tszLastVer[16];
+ wchar_t tszAdvFolder[256];
+ wchar_t tszInfoURL[2048];
+ wchar_t tszMessage[5000];
+ wchar_t tszDescr[256];
FILEURL File;
BOOL enabled;
BYTE FileType;
@@ -91,7 +91,7 @@ extern HINSTANCE hInst; extern INT FileCount, CurrentFile, Number, UpdatesCount, Period;
extern BOOL Silent, DlgDld;
extern BYTE Reminder, UpdateOnStartup, UpdateOnPeriod, OnlyOnceADay, PeriodMeasure;
-extern TCHAR tszRoot[MAX_PATH], tszDialogMsg[2048];
+extern wchar_t tszRoot[MAX_PATH], tszDialogMsg[2048];
extern FILEINFO* pFileInfo;
extern FILEURL* pFileUrl;
extern HANDLE hCheckThread;
diff --git a/plugins/PasteIt/src/Options.cpp b/plugins/PasteIt/src/Options.cpp index 61d4c27130..628fdd9182 100644 --- a/plugins/PasteIt/src/Options.cpp +++ b/plugins/PasteIt/src/Options.cpp @@ -23,30 +23,30 @@ Options *Options::instance; struct TCpTable
{
UINT cpId;
- TCHAR *cpName;
+ wchar_t *cpName;
}
cpTable[] = {
- { CP_ACP, LPGENT("Use default codepage") },
- { CP_UTF8, LPGENT("UTF-8") },
- { 874, LPGENT("Thai") },
- { 932, LPGENT("Japanese") },
- { 936, LPGENT("Simplified Chinese") },
- { 949, LPGENT("Korean") },
- { 950, LPGENT("Traditional Chinese") },
- { 1250, LPGENT("Central European") },
- { 1251, LPGENT("Cyrillic") },
- { 20866, LPGENT("Cyrillic KOI8-R") },
- { 1252, LPGENT("Latin I") },
- { 1253, LPGENT("Greek") },
- { 1254, LPGENT("Turkish") },
- { 1255, LPGENT("Hebrew") },
- { 1256, LPGENT("Arabic") },
- { 1257, LPGENT("Baltic") },
- { 1258, LPGENT("Vietnamese") },
- { 1361, LPGENT("Korean (Johab)") },
- { CP_UTF7, LPGENT("UTF-7") },
- { 1200, LPGENT("UTF-16") },
- { 1201, LPGENT("UTF-16BE") }
+ { CP_ACP, LPGENW("Use default codepage") },
+ { CP_UTF8, LPGENW("UTF-8") },
+ { 874, LPGENW("Thai") },
+ { 932, LPGENW("Japanese") },
+ { 936, LPGENW("Simplified Chinese") },
+ { 949, LPGENW("Korean") },
+ { 950, LPGENW("Traditional Chinese") },
+ { 1250, LPGENW("Central European") },
+ { 1251, LPGENW("Cyrillic") },
+ { 20866, LPGENW("Cyrillic KOI8-R") },
+ { 1252, LPGENW("Latin I") },
+ { 1253, LPGENW("Greek") },
+ { 1254, LPGENW("Turkish") },
+ { 1255, LPGENW("Hebrew") },
+ { 1256, LPGENW("Arabic") },
+ { 1257, LPGENW("Baltic") },
+ { 1258, LPGENW("Vietnamese") },
+ { 1361, LPGENW("Korean (Johab)") },
+ { CP_UTF7, LPGENW("UTF-7") },
+ { 1200, LPGENW("UTF-16") },
+ { 1201, LPGENW("UTF-16BE") }
};
Options::Options()
@@ -209,7 +209,7 @@ void GetPagesSettings(HWND hwndDlg, OptsPagesData* optsPagesData) optsPagesData->webOptions[selected]->pastebinUserKey = L"";
}
else {
- TCHAR buf[100];
+ wchar_t buf[100];
Edit_GetText(GetDlgItem(hwndDlg, IDC_PASTEBIN_KEY), buf, 100);
optsPagesData->webOptions[selected]->pastebinUserKey = buf;
}
@@ -584,7 +584,7 @@ INT_PTR CALLBACK Options::DlgProcOptsLogin(HWND hwndDlg, UINT msg, WPARAM wParam {
if (HIWORD(wParam) == BN_CLICKED) {
if (LOWORD(wParam) == IDOK) {
- TCHAR buf[100];
+ wchar_t buf[100];
OptsLoginData* optsLoginData = (OptsLoginData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
Edit_GetText(GetDlgItem(hwndDlg, IDC_PASTEBIN_USER), buf, 100);
optsLoginData->user = buf;
@@ -611,10 +611,10 @@ unsigned int Options::GetCodepageCB(HWND hwndCB, bool errorReport, unsigned int {
int selCpIdx = ComboBox_GetCurSel(hwndCB);
if (selCpIdx < 0) {
- TCHAR text[128];
+ wchar_t text[128];
ComboBox_GetText(hwndCB, text, 128);
- TCHAR * stopOn = NULL;
- long cp = _tcstol(text, &stopOn, 10);
+ wchar_t * stopOn = NULL;
+ long cp = wcstol(text, &stopOn, 10);
if (errorReport && (stopOn == text || *stopOn != '\0' || cp < 0 || cp > 0xffff)) {
MessageBox(GetParent(hwndCB), TranslateT("You've entered invalid codepage. Select codepage from combo box or enter correct number."), TranslateT("Invalid codepage"), MB_OK | MB_ICONERROR);
SetFocus(hwndCB);
@@ -645,7 +645,7 @@ void Options::InitCodepageCB(HWND hwndCB, unsigned int codepage) }
if (selCpIdx == -1) {
- TCHAR buf[10];
+ wchar_t buf[10];
mir_sntprintf(buf, L"%d", codepage);
ComboBox_SetText(hwndCB, buf);
}
@@ -666,7 +666,7 @@ void Options::SetCodepageCB(HWND hwndCB, unsigned int codepage) }
if (selCpIdx == -1) {
- TCHAR buf[10];
+ wchar_t buf[10];
mir_sntprintf(buf, L"%d", codepage);
ComboBox_SetText(hwndCB, buf);
}
@@ -681,15 +681,15 @@ int Options::InitOptions(WPARAM wParam, LPARAM) odp.position = 100000000;
odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszTitle = LPGENT("Paste It");
- odp.ptszGroup = LPGENT("Services");
+ odp.pwszTitle = LPGENW("Paste It");
+ odp.pwszGroup = LPGENW("Services");
- odp.ptszTab = LPGENT("Main");
+ odp.pwszTab = LPGENW("Main");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MAIN);
odp.pfnDlgProc = Options::DlgProcOptsMain;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Web page");
+ odp.pwszTab = LPGENW("Web page");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_PAGES);
odp.pfnDlgProc = Options::DlgProcOptsPages;
Options_AddPage(wParam, &odp);
@@ -705,7 +705,7 @@ void Options::Save() db_set_b(0, MODULE, "autoSend", autoSend ? 1 : 0);
for (int i = 0; i < PasteToWeb::pages; ++i) {
char buf[256];
- TCHAR* name = pasteToWebs[i]->GetName();
+ wchar_t* name = pasteToWebs[i]->GetName();
int j = 0;
while (name[j]) {
buf[j] = (char)name[j];
@@ -766,7 +766,7 @@ void Options::Load() char buf[256];
int j = 0;
{
- TCHAR *name = pasteToWebs[i]->GetName();
+ wchar_t *name = pasteToWebs[i]->GetName();
while (name[j]) {
buf[j] = (char)name[j];
++j;
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index d852b79f42..6c96d4d1ba 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -70,10 +70,10 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda std::wstring GetFile()
{
- TCHAR filter[512];
+ wchar_t filter[512];
mir_tstrncpy(filter, TranslateT("All Files (*.*)"), _countof(filter));
- memcpy(filter + mir_tstrlen(filter), L"\0*.*\0", 6 * sizeof(TCHAR));
- TCHAR stzFilePath[1024];
+ memcpy(filter + mir_tstrlen(filter), L"\0*.*\0", 6 * sizeof(wchar_t));
+ wchar_t stzFilePath[1024];
stzFilePath[0] = 0;
stzFilePath[1] = 0;
OPENFILENAME ofn = { 0 };
@@ -297,7 +297,7 @@ void InitMenuItems() mi.flags = CMIF_TCHAR;
mi.hIcolibItem = icon.hIcolib;
mi.position = 3000090005;
- mi.name.t = LPGENT("Paste It");
+ mi.name.w = LPGENW("Paste It");
hContactMenu = Menu_AddContactMenuItem(&mi);
memset(&mi, 0, sizeof(mi));
@@ -305,15 +305,15 @@ void InitMenuItems() mi.flags = CMIF_TCHAR;
mi.pszService = MS_PASTEIT_CONTACTMENU;
mi.root = hContactMenu;
- mi.name.t = LPGENT("Paste from clipboard");
+ mi.name.w = LPGENW("Paste from clipboard");
Menu_ConfigureItem(Menu_AddContactMenuItem(&mi), MCI_OPT_EXECPARAM, FROM_CLIPBOARD);
SET_UID(mi, 0x7af7c3cb, 0xedc4, 0x4f3e, 0xb5, 0xe1, 0x42, 0x64, 0x5b, 0x7d, 0xd8, 0x1e);
- mi.name.t = LPGENT("Paste from file");
+ mi.name.w = LPGENW("Paste from file");
Menu_ConfigureItem(Menu_AddContactMenuItem(&mi), MCI_OPT_EXECPARAM, FROM_FILE);
SET_UID(mi, 0xe58410ad, 0xa723, 0x48b9, 0xab, 0x7e, 0x5e, 0x42, 0x8b, 0x8, 0x32, 0x2f);
- mi.name.t = LPGENT("Default web page");
+ mi.name.w = LPGENW("Default web page");
HGENMENU hDefWebMenu = Menu_AddContactMenuItem(&mi);
Menu_ConfigureItem(hDefWebMenu, MCI_OPT_EXECPARAM, DEF_PAGES_START - 1);
@@ -325,7 +325,7 @@ void InitMenuItems() mi2.flags = CMIF_TCHAR | CMIF_UNMOVABLE;
if (Options::instance->defWeb == i)
mi2.flags |= CMIF_CHECKED;
- mi2.name.t = pasteToWebs[i]->GetName();
+ mi2.name.w = pasteToWebs[i]->GetName();
hWebPageMenus[i] = Menu_AddContactMenuItem(&mi2);
Menu_ConfigureItem(hWebPageMenus[i], MCI_OPT_EXECPARAM, mi2.position = DEF_PAGES_START + i);
}
diff --git a/plugins/PasteIt/src/PasteToWeb.h b/plugins/PasteIt/src/PasteToWeb.h index 51e2141790..fdedc388ac 100644 --- a/plugins/PasteIt/src/PasteToWeb.h +++ b/plugins/PasteIt/src/PasteToWeb.h @@ -30,14 +30,14 @@ protected: virtual void SendToServer(std::wstring str, std::wstring fileName, std::wstring format) = 0;
wchar_t* SendToWeb(char* url, std::map<std::string, std::string>& headers, std::wstring content);
PasteToWeb();
- TCHAR bufErr[1024];
+ wchar_t bufErr[1024];
public:
virtual ~PasteToWeb();
char szFileLink[256];
- TCHAR* error;
+ wchar_t* error;
void FromClipboard();
void FromFile(std::wstring file);
- virtual TCHAR* GetName() = 0;
+ virtual wchar_t* GetName() = 0;
virtual void ConfigureSettings() = 0;
int pageIndex;
virtual std::list<PasteFormat> GetFormats() = 0;
diff --git a/plugins/PasteIt/src/PasteToWeb1.h b/plugins/PasteIt/src/PasteToWeb1.h index 79c9f7dc06..50f835af4f 100644 --- a/plugins/PasteIt/src/PasteToWeb1.h +++ b/plugins/PasteIt/src/PasteToWeb1.h @@ -28,7 +28,7 @@ protected: public:
PasteToWeb1();
virtual ~PasteToWeb1();
- virtual TCHAR* GetName()
+ virtual wchar_t* GetName()
{
return L"pastebin.com";
}
diff --git a/plugins/PasteIt/src/PasteToWeb2.h b/plugins/PasteIt/src/PasteToWeb2.h index 6bbee7b455..891c92223f 100644 --- a/plugins/PasteIt/src/PasteToWeb2.h +++ b/plugins/PasteIt/src/PasteToWeb2.h @@ -27,7 +27,7 @@ protected: public:
PasteToWeb2();
virtual ~PasteToWeb2();
- virtual TCHAR* GetName()
+ virtual wchar_t* GetName()
{
return L"wklej.to";
}
diff --git a/plugins/Ping/src/log.cpp b/plugins/Ping/src/log.cpp index 59538f577e..01bb07e671 100644 --- a/plugins/Ping/src/log.cpp +++ b/plugins/Ping/src/log.cpp @@ -2,7 +2,7 @@ INT_PTR Log(WPARAM wParam, LPARAM) {
- TCHAR buf[1024], tbuf[512], dbuf[512];
+ wchar_t buf[1024], tbuf[512], dbuf[512];
CallService(PLUG "/GetLogFilename", (WPARAM)1024, (LPARAM)buf);
//char TBcapt[255];
@@ -13,15 +13,15 @@ INT_PTR Log(WPARAM wParam, LPARAM) { GetTimeFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, tbuf, 512);
GetDateFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, dbuf, 512);
- TCHAR *line = (TCHAR *)wParam;
+ wchar_t *line = (wchar_t *)wParam;
- FILE *f = _tfopen(buf, L"a+");
+ FILE *f = _wfopen(buf, L"a+");
if (f) {
if (options.log_csv) {
- _ftprintf(f, L"%s, %s, %s\n", dbuf, tbuf, line);
+ fwprintf(f, L"%s, %s, %s\n", dbuf, tbuf, line);
}
else {
- _ftprintf(f, L"%s, %s: %s\n", dbuf, tbuf, line);
+ fwprintf(f, L"%s, %s: %s\n", dbuf, tbuf, line);
}
fclose(f);
}
@@ -31,7 +31,7 @@ INT_PTR Log(WPARAM wParam, LPARAM) { INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv;
- TCHAR *filename = (TCHAR *)lParam;
+ wchar_t *filename = (wchar_t *)lParam;
if (db_get_ts(0, PLUG, "LogFilename", &dbv)) {
CallService(MS_DB_GETPROFILEPATHT, wParam, (LPARAM)filename);
mir_tstrncat(filename, L"\\ping_log.txt", wParam - mir_tstrlen(filename));
@@ -41,18 +41,18 @@ INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) { db_free(&dbv);
}
- ((TCHAR *)lParam)[wParam - 1] = 0;
+ ((wchar_t *)lParam)[wParam - 1] = 0;
return 0;
}
INT_PTR SetLogFilename(WPARAM, LPARAM lParam) {
- db_set_ts(0, PLUG, "LogFilename", (TCHAR *)lParam);
+ db_set_ts(0, PLUG, "LogFilename", (wchar_t *)lParam);
return 0;
}
INT_PTR ViewLogData(WPARAM wParam, LPARAM) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
CallService(PLUG "/GetLogFilename", (WPARAM)MAX_PATH, (LPARAM)buf);
return (INT_PTR)ShellExecute((HWND)wParam, L"edit", buf, L"", L"", SW_SHOW);
}
diff --git a/plugins/Ping/src/menu.cpp b/plugins/Ping/src/menu.cpp index 4d886697dc..1fd1ce70dd 100644 --- a/plugins/Ping/src/menu.cpp +++ b/plugins/Ping/src/menu.cpp @@ -8,20 +8,20 @@ void InitMenus() // main menu
CMenuItem mi;
mi.flags = CMIF_TCHAR;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Ping"), 500099900);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Ping"), 500099900);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "FF273885-6AEC-4C8A-B8BC-9247D920F223");
SET_UID(mi, 0xc9a4d17a, 0xd5fa, 0x40d9, 0xbe, 0x7b, 0x9e, 0x2e, 0x5b, 0xbf, 0x8, 0x59);
mi.position = 2000060000;
mi.hIcolibItem = hIconResponding;
- mi.name.t = LPGENT("Enable all pings");
+ mi.name.w = LPGENW("Enable all pings");
mi.pszService = PLUG "/EnableAll";
Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x1dac6ea6, 0x116e, 0x41a3, 0xa6, 0xe8, 0x42, 0xdf, 0xf7, 0x27, 0xc4, 0x7c);
mi.position = 2000060001;
mi.hIcolibItem = hIconDisabled;
- mi.name.t = LPGENT("Disable all pings");
+ mi.name.w = LPGENW("Disable all pings");
mi.pszService = PLUG "/DisableAll";
Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp index 56e501ee40..853473e3cc 100644 --- a/plugins/Ping/src/options.cpp +++ b/plugins/Ping/src/options.cpp @@ -81,7 +81,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA break;
case IDC_BTN_LOGBROWSE:
{
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s%c*.txt%c%s%c*.*%c", TranslateT("Text Files (*.txt)"), 0, 0, TranslateT("All Files"), 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
@@ -169,7 +169,7 @@ INT_PTR CALLBACK DlgProcDestEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM) case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
- TCHAR *ret = pcli->pfnGetStatusModeDescription(i, 0);
+ wchar_t *ret = pcli->pfnGetStatusModeDescription(i, 0);
SendDlgItemMessage(hwndDlg, IDC_COMBO_DESTSTAT, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)ret);
SendDlgItemMessage(hwndDlg, IDC_COMBO_DESTSTAT2, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)ret);
}
@@ -506,15 +506,15 @@ int PingOptInit(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTitle = LPGENT("Ping");
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTitle = LPGENW("Ping");
- odp.ptszTab = LPGENT("Settings");
+ odp.pwszTab = LPGENW("Settings");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG1);
odp.pfnDlgProc = DlgProcOpts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Hosts");
+ odp.pwszTab = LPGENW("Hosts");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG2);
odp.pfnDlgProc = DlgProcOpts2;
Options_AddPage(wParam, &odp);
diff --git a/plugins/Ping/src/pinggraph.cpp b/plugins/Ping/src/pinggraph.cpp index bb9b2f94b3..a303aae062 100644 --- a/plugins/Ping/src/pinggraph.cpp +++ b/plugins/Ping/src/pinggraph.cpp @@ -187,7 +187,7 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar SetBkMode(hdc, TRANSPARENT);
SetTextColor(hdc, GetSysColor(COLOR_3DDKSHADOW));
- TCHAR buff[64];
+ wchar_t buff[64];
if (wd->show_grid)
{
mir_sntprintf(buff, TranslateT("%d ms"), MARK_TIME);
@@ -275,11 +275,11 @@ INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) { wndclass.lpszClassName = _T(PLUG) L"GraphWindow";
RegisterClass(&wndclass);
- TCHAR title[256];
+ wchar_t title[256];
mir_tstrncpy(title, TranslateT("Ping Graph"), _countof(title));
if (lParam) {
mir_tstrncat(title, L" - ", _countof(title) - mir_tstrlen(title));
- mir_tstrncat(title, (TCHAR *)lParam, _countof(title) - mir_tstrlen(title));
+ mir_tstrncat(title, (wchar_t *)lParam, _countof(title) - mir_tstrlen(title));
}
HWND parent = 0;
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 16a160387b..76fab1eb0e 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -55,7 +55,7 @@ void set_list_changed(bool f) list_changed = f;
}
-void SetProtoStatus(TCHAR *pszLabel, char *pszProto, int if_status, int new_status)
+void SetProtoStatus(wchar_t *pszLabel, char *pszProto, int if_status, int new_status)
{
if (mir_strcmp(pszProto, Translate("<all>")) == 0) {
int num_protocols;
@@ -69,7 +69,7 @@ void SetProtoStatus(TCHAR *pszLabel, char *pszProto, int if_status, int new_stat if (ProtoServiceExists(pszProto, PS_GETSTATUS)) {
if (CallProtoService(pszProto, PS_GETSTATUS, 0, 0) == if_status) {
if (options.logging) {
- TCHAR buf[1024];
+ wchar_t buf[1024];
mir_sntprintf(buf, TranslateT("%s - setting status of protocol '%S' (%d)"), pszLabel, pszProto, new_status);
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
@@ -194,7 +194,7 @@ void __cdecl sttCheckStatusThreadProc(void*) }
}
if (pa.miss_count == -1 - options.retries && options.logging) {
- TCHAR buf[512];
+ wchar_t buf[512];
mir_sntprintf(buf, TranslateT("%s - reply, %d"), pa.pszLabel, pa.round_trip_time);
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
@@ -208,7 +208,7 @@ void __cdecl sttCheckStatusThreadProc(void*) ShowPopup(TranslateT("Ping Timeout"), pa.pszLabel, 0);
}
if (pa.miss_count == 1 + options.retries && options.logging) {
- TCHAR buf[512];
+ wchar_t buf[512];
mir_sntprintf(buf, TranslateT("%s - timeout"), pa.pszLabel);
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
@@ -306,7 +306,7 @@ INT_PTR PingPlugShowWindow(WPARAM, LPARAM) void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
{
if (frame_id != -1 && ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
- TCHAR TBcapt[255];
+ wchar_t TBcapt[255];
if (total > 0)
mir_sntprintf(TBcapt, L"Ping (%d/%d)", upCount, total);
else
@@ -388,7 +388,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar TextOut(dis->hDC, dis->rcItem.left + 16 + 4, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, itemData.pszLabel, (int)mir_tstrlen(itemData.pszLabel));
if (itemData.status != PS_DISABLED) {
- TCHAR buf[256];
+ wchar_t buf[256];
if (itemData.responding) {
mir_sntprintf(buf, TranslateT("%d ms"), itemData.round_trip_time);
GetTextExtentPoint32(dis->hDC, buf, (int)mir_tstrlen(buf), &textSize);
@@ -716,7 +716,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (wake) SetEvent(hWakeEvent);
if (options.logging) {
- TCHAR buf[1024];
+ wchar_t buf[1024];
mir_sntprintf(buf, L"%s - %s", pItemData->pszLabel, (wake ? TranslateT("enabled") : TranslateT("double clicked")));
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
@@ -902,13 +902,13 @@ void InitList() CreateServiceFunction(PLUG "/ShowWindow", PingPlugShowWindow);
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Ping"), 1000200001);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Ping"), 1000200001);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "7CFBF239-86B5-48B2-8D5B-39E09A7DB514");
SET_UID(mi, 0x4adbd753, 0x27d6, 0x457a, 0xa6, 0x6, 0xdf, 0x4f, 0x2c, 0xd8, 0xb9, 0x3b);
mi.flags = CMIF_TCHAR;
mi.position = 3000320001;
- mi.name.t = LPGENT("Show/Hide &Ping Window");
+ mi.name.w = LPGENW("Show/Hide &Ping Window");
mi.pszService = PLUG "/ShowWindow";
Menu_AddMainMenuItem(&mi);
@@ -917,8 +917,8 @@ void InitList() }
font_id.cbSize = sizeof(FontIDT);
- mir_tstrncpy(font_id.group, LPGENT("Ping"), _countof(font_id.group));
- mir_tstrncpy(font_id.name, LPGENT("List"), _countof(font_id.name));
+ mir_tstrncpy(font_id.group, LPGENW("Ping"), _countof(font_id.group));
+ mir_tstrncpy(font_id.name, LPGENW("List"), _countof(font_id.name));
mir_strncpy(font_id.dbSettingsGroup, "PING", _countof(font_id.dbSettingsGroup));
mir_strncpy(font_id.prefix, "Font", _countof(font_id.prefix));
mir_tstrncpy(font_id.backgroundGroup, L"Ping", _countof(font_id.backgroundGroup));
diff --git a/plugins/Ping/src/stdafx.h b/plugins/Ping/src/stdafx.h index 746a2d596b..1e92a443d8 100644 --- a/plugins/Ping/src/stdafx.h +++ b/plugins/Ping/src/stdafx.h @@ -56,7 +56,7 @@ typedef struct {
int ping_period, ping_timeout;
bool show_popup, show_popup2, block_reps, logging;
- TCHAR log_filename[MAX_PATH];
+ wchar_t log_filename[MAX_PATH];
bool no_test_icon;
int row_height;
int indent;
@@ -83,16 +83,16 @@ typedef LinkedList< HistPair > HistoryList; struct PINGADDRESS {
int cbSize; //size in bytes of this structure
DWORD item_id;
- TCHAR pszName[MAX_PINGADDRESS_STRING_LENGTH]; //IP address or domain name
- TCHAR pszLabel[MAX_PINGADDRESS_STRING_LENGTH];
+ wchar_t pszName[MAX_PINGADDRESS_STRING_LENGTH]; //IP address or domain name
+ wchar_t pszLabel[MAX_PINGADDRESS_STRING_LENGTH];
bool responding;
int status;
short round_trip_time;
int miss_count;
int port; // -1 for ICMP, non-zero for TCP
char pszProto[MAX_PINGADDRESS_STRING_LENGTH];
- TCHAR pszCommand[MAX_PATH];
- TCHAR pszParams[MAX_PATH];
+ wchar_t pszCommand[MAX_PATH];
+ wchar_t pszParams[MAX_PATH];
unsigned int get_status; // on success, if status equals this
unsigned int set_status; // set it to this
int index;
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index dedd9cf470..c5f99d431d 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -26,7 +26,7 @@ void CALLBACK sttMainThreadCallback(ULONG_PTR dwParam) free(ppd);
}
-void __stdcall ShowPopup(TCHAR *line1, TCHAR *line2, int flags)
+void __stdcall ShowPopup(wchar_t *line1, wchar_t *line2, int flags)
{
if (CallService(MS_SYSTEM_TERMINATED, 0, 0)) return;
diff --git a/plugins/Ping/src/utils.h b/plugins/Ping/src/utils.h index f3be0598b6..d084a4ae9a 100644 --- a/plugins/Ping/src/utils.h +++ b/plugins/Ping/src/utils.h @@ -1,7 +1,7 @@ #ifndef _PING_UTILS
#define _PING_UTILS
-void __stdcall ShowPopup(TCHAR *line1, TCHAR *line2, int flags);
+void __stdcall ShowPopup(wchar_t *line1, wchar_t *line2, int flags);
INT_PTR PluginPing(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/PluginUpdater/pu_stub/pu_stub.cpp b/plugins/PluginUpdater/pu_stub/pu_stub.cpp index 8167c32d83..e7d346533d 100644 --- a/plugins/PluginUpdater/pu_stub/pu_stub.cpp +++ b/plugins/PluginUpdater/pu_stub/pu_stub.cpp @@ -7,38 +7,37 @@ #include <stdlib.h>
#include <malloc.h>
#include <memory.h>
-#include <tchar.h>
#include <varargs.h>
#include <stdio.h>
// Global Variables:
HINSTANCE hInst; // current instance
-void log(const TCHAR *tszFormat, ...)
+void log(const wchar_t *tszFormat, ...)
{
#if defined(_DEBUG)
- FILE *out = fopen("c:\\temp\\pu.log", "a");
- if (out) {
- va_list params;
- va_start(params, tszFormat);
- _vftprintf(out, tszFormat, params);
- va_end(params);
- fputc('\n', out);
- fclose(out);
- }
+ FILE *out = fopen("c:\\temp\\pu.log", "a");
+ if (out) {
+ va_list params;
+ va_start(params, tszFormat);
+ vfwprintf(out, tszFormat, params);
+ va_end(params);
+ fputc('\n', out);
+ fclose(out);
+ }
#endif
}
int CreateDirectoryTreeW(const WCHAR* szDir)
{
- DWORD dwAttributes;
- WCHAR* pszLastBackslash, szTestDir[ MAX_PATH ];
-
+ wchar_t szTestDir[MAX_PATH];
lstrcpynW(szTestDir, szDir, MAX_PATH);
- if ((dwAttributes = GetFileAttributesW(szTestDir)) != INVALID_FILE_ATTRIBUTES && (dwAttributes & FILE_ATTRIBUTE_DIRECTORY))
+
+ DWORD dwAttributes = GetFileAttributesW(szTestDir);
+ if (dwAttributes != INVALID_FILE_ATTRIBUTES && (dwAttributes & FILE_ATTRIBUTE_DIRECTORY))
return 0;
- pszLastBackslash = wcsrchr(szTestDir, '\\');
+ WCHAR *pszLastBackslash = wcsrchr(szTestDir, '\\');
if (pszLastBackslash == NULL)
return 0;
@@ -59,42 +58,42 @@ void CreatePathToFileW(WCHAR* wszFilePath) *pszLastBackslash = '\\';
}
-int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR lpCmdLine, int)
+int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR lpCmdLine, int)
{
DWORD dwError;
hInst = hInstance;
- TCHAR tszPipeName[MAX_PATH];
+ wchar_t tszPipeName[MAX_PATH];
#if _MSC_VER < 1400
- _stprintf(tszPipeName, L"\\\\.\\pipe\\Miranda_Pu_%s", lpCmdLine);
+ swprintf(tszPipeName, L"\\\\.\\pipe\\Miranda_Pu_%s", lpCmdLine);
#else
- _stprintf_s(tszPipeName, MAX_PATH, L"\\\\.\\pipe\\Miranda_Pu_%s", lpCmdLine);
+ swprintf_s(tszPipeName, L"\\\\.\\pipe\\Miranda_Pu_%s", lpCmdLine);
#endif
- log( L"Opening pipe %s...", tszPipeName);
+ log(L"Opening pipe %s...", tszPipeName);
HANDLE hPipe = CreateFile(tszPipeName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
if (hPipe == INVALID_HANDLE_VALUE) {
dwError = GetLastError();
- log( L"Failed to open a pipe: error %d", dwError);
+ log(L"Failed to open a pipe: error %d", dwError);
return dwError;
}
- log( L"Entering the reading cycle...");
+ log(L"Entering the reading cycle...");
BYTE szReadBuffer[1024] = { 0 };
DWORD dwBytes;
- while ( ReadFile(hPipe, szReadBuffer, sizeof(szReadBuffer), &dwBytes, NULL)) {
+ while (ReadFile(hPipe, szReadBuffer, sizeof(szReadBuffer), &dwBytes, NULL)) {
DWORD dwAction = *(DWORD*)szReadBuffer;
- TCHAR *ptszFile1 = (TCHAR*)(szReadBuffer + sizeof(DWORD));
- TCHAR *ptszFile2 = ptszFile1 + _tcslen(ptszFile1)+1;
- log( L"Received command: %d <%s> <%s>", dwAction, ptszFile1, ptszFile2);
- switch(dwAction) {
+ wchar_t *ptszFile1 = (wchar_t*)(szReadBuffer + sizeof(DWORD));
+ wchar_t *ptszFile2 = ptszFile1 + wcslen(ptszFile1) + 1;
+ log(L"Received command: %d <%s> <%s>", dwAction, ptszFile1, ptszFile2);
+ switch (dwAction) {
case 1: // copy
dwError = CopyFile(ptszFile1, ptszFile2, FALSE);
break;
case 2: // move
DeleteFile(ptszFile2);
- if ( MoveFile(ptszFile1, ptszFile2) == 0) // use copy on error
+ if (MoveFile(ptszFile1, ptszFile2) == 0) // use copy on error
dwError = CopyFile(ptszFile1, ptszFile2, FALSE);
else
dwError = 0;
@@ -122,7 +121,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR lpCmdLine, int) }
dwError = GetLastError();
- log( L"Pipe is closed (%d), exiting", dwError);
+ log(L"Pipe is closed (%d), exiting", dwError);
CloseHandle(hPipe);
return 0;
}
diff --git a/plugins/PluginUpdater/src/DlgListNew.cpp b/plugins/PluginUpdater/src/DlgListNew.cpp index 3d6b7ed772..89ccf41904 100644 --- a/plugins/PluginUpdater/src/DlgListNew.cpp +++ b/plugins/PluginUpdater/src/DlgListNew.cpp @@ -53,7 +53,7 @@ static void ApplyDownloads(void *param) HWND hwndList = GetDlgItem(hDlg, IDC_LIST_UPDATES);
OBJLIST<FILEINFO> &todo = *(OBJLIST<FILEINFO> *)GetWindowLongPtr(hDlg, GWLP_USERDATA);
//create needed folders after escalating priviledges. Folders creates when we actually install updates
- TCHAR tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
+ wchar_t tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
mir_sntprintf(tszFileBack, L"%s\\Backups", g_tszRoot);
SafeCreateDirectory(tszFileBack);
@@ -111,11 +111,11 @@ static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LP if (ListView_GetItem(hwnd, &lvi) && lvi.iGroupId == 1) {
FILEINFO *info = (FILEINFO *)lvi.lParam;
- TCHAR tszFileName[MAX_PATH];
- _tcscpy(tszFileName, _tcsrchr(info->tszNewName, L'\\') + 1);
- TCHAR *p = _tcschr(tszFileName, L'.'); *p = 0;
+ wchar_t tszFileName[MAX_PATH];
+ wcscpy(tszFileName, wcsrchr(info->tszNewName, L'\\') + 1);
+ wchar_t *p = wcschr(tszFileName, L'.'); *p = 0;
- TCHAR link[MAX_PATH];
+ wchar_t link[MAX_PATH];
mir_sntprintf(link, PLUGIN_INFO_URL, tszFileName);
Utils_OpenUrlT(link);
}
@@ -165,10 +165,10 @@ INT_PTR CALLBACK DlgList(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) if (GetVersionEx(&osver) && osver.dwMajorVersion >= 6) {
wchar_t szPath[MAX_PATH];
GetModuleFileName(NULL, szPath, _countof(szPath));
- TCHAR *ext = _tcsrchr(szPath, '.');
+ wchar_t *ext = wcsrchr(szPath, '.');
if (ext != NULL)
*ext = '\0';
- _tcscat(szPath, L".test");
+ wcscat(szPath, L".test");
HANDLE hFile = CreateFile(szPath, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
// Running Windows Vista or later (major version >= 6).
@@ -229,8 +229,8 @@ INT_PTR CALLBACK DlgList(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) lvi.mask = LVIF_PARAM | LVIF_GROUPID | LVIF_TEXT | LVIF_IMAGE;
int groupId = 4;
- if (_tcschr(todo[i].tszOldName, L'\\') != NULL)
- groupId = (_tcsstr(todo[i].tszOldName, L"Plugins") != NULL) ? 1 : ((_tcsstr(todo[i].tszOldName, L"Languages") != NULL) ? 3 : 2);
+ if (wcschr(todo[i].tszOldName, L'\\') != NULL)
+ groupId = (wcsstr(todo[i].tszOldName, L"Plugins") != NULL) ? 1 : ((wcsstr(todo[i].tszOldName, L"Languages") != NULL) ? 3 : 2);
lvi.iItem = i;
lvi.lParam = (LPARAM)&todo[i];
@@ -344,27 +344,27 @@ static void __stdcall LaunchListDialog(void *param) hwndDialog = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_LIST), GetDesktopWindow(), DlgList, (LPARAM)param);
}
-static FILEINFO* ServerEntryToFileInfo(const ServListEntry &hash, const TCHAR* tszBaseUrl, const TCHAR* tszPath)
+static FILEINFO* ServerEntryToFileInfo(const ServListEntry &hash, const wchar_t* tszBaseUrl, const wchar_t* tszPath)
{
FILEINFO *FileInfo = new FILEINFO;
FileInfo->bDeleteOnly = FALSE;
// copy the relative old name
- _tcsncpy(FileInfo->tszOldName, hash.m_name, _countof(FileInfo->tszOldName));
- _tcsncpy(FileInfo->tszNewName, hash.m_name, _countof(FileInfo->tszNewName));
+ wcsncpy(FileInfo->tszOldName, hash.m_name, _countof(FileInfo->tszOldName));
+ wcsncpy(FileInfo->tszNewName, hash.m_name, _countof(FileInfo->tszNewName));
- TCHAR tszFileName[MAX_PATH];
- _tcsncpy(tszFileName, _tcsrchr(tszPath, L'\\') + 1, _countof(tszFileName));
- TCHAR *tp = _tcschr(tszFileName, L'.'); if (tp) *tp = 0;
+ wchar_t tszFileName[MAX_PATH];
+ wcsncpy(tszFileName, wcsrchr(tszPath, L'\\') + 1, _countof(tszFileName));
+ wchar_t *tp = wcschr(tszFileName, L'.'); if (tp) *tp = 0;
- TCHAR tszRelFileName[MAX_PATH];
- _tcsncpy(tszRelFileName, hash.m_name, MAX_PATH);
- tp = _tcsrchr(tszRelFileName, L'.'); if (tp) *tp = 0;
- tp = _tcschr(tszRelFileName, L'\\'); if (tp) tp++; else tp = tszRelFileName;
- _tcslwr(tp);
+ wchar_t tszRelFileName[MAX_PATH];
+ wcsncpy(tszRelFileName, hash.m_name, MAX_PATH);
+ tp = wcsrchr(tszRelFileName, L'.'); if (tp) *tp = 0;
+ tp = wcschr(tszRelFileName, L'\\'); if (tp) tp++; else tp = tszRelFileName;
+ wcslwr(tp);
mir_sntprintf(FileInfo->File.tszDiskPath, L"%s\\Temp\\%s.zip", g_tszRoot, tszFileName);
mir_sntprintf(FileInfo->File.tszDownloadURL, L"%s/%s.zip", tszBaseUrl, tszRelFileName);
- for (tp = _tcschr(FileInfo->File.tszDownloadURL, '\\'); tp != 0; tp = _tcschr(tp, '\\'))
+ for (tp = wcschr(FileInfo->File.tszDownloadURL, '\\'); tp != 0; tp = wcschr(tp, '\\'))
*tp++ = '/';
FileInfo->File.CRCsum = hash.m_crc;
// Load list of checked Plugins from database
@@ -380,7 +380,7 @@ static void GetList(void *) {
Thread_SetName("PluginUpdater: GetList");
- TCHAR tszTempPath[MAX_PATH];
+ wchar_t tszTempPath[MAX_PATH];
DWORD dwLen = GetTempPath(_countof(tszTempPath), tszTempPath);
if (tszTempPath[dwLen-1] == '\\')
tszTempPath[dwLen-1] = 0;
@@ -398,7 +398,7 @@ static void GetList(void *) for (int i=0; i < hashes.getCount(); i++) {
ServListEntry &hash = hashes[i];
- TCHAR tszPath[MAX_PATH];
+ wchar_t tszPath[MAX_PATH];
mir_sntprintf(tszPath, L"%s\\%s", dirname, hash.m_name);
if (GetFileAttributes(tszPath) == INVALID_FILE_ATTRIBUTES) {
@@ -450,21 +450,21 @@ void UnloadListNew() static INT_PTR ParseUriService(WPARAM, LPARAM lParam)
{
- TCHAR *arg = (TCHAR *)lParam;
+ wchar_t *arg = (wchar_t *)lParam;
if (arg == NULL)
return 1;
- TCHAR uri[1024];
- _tcsncpy_s(uri, arg, _TRUNCATE);
+ wchar_t uri[1024];
+ wcsncpy_s(uri, arg, _TRUNCATE);
- TCHAR *p = _tcschr(uri, _T(':'));
+ wchar_t *p = wcschr(uri, ':');
if (p == NULL)
return 1;
- TCHAR pluginPath[MAX_PATH];
+ wchar_t pluginPath[MAX_PATH];
mir_tstrcpy(pluginPath, p + 1);
- p = _tcschr(pluginPath, _T('/'));
- if (p) *p = _T('\\');
+ p = wcschr(pluginPath, '/');
+ if (p) *p = '\\';
if (GetFileAttributes(pluginPath) != INVALID_FILE_ATTRIBUTES)
return 0;
@@ -481,7 +481,7 @@ static INT_PTR ParseUriService(WPARAM, LPARAM lParam) return 0;
VARST dirName(L"%miranda_path%");
- TCHAR tszPath[MAX_PATH];
+ wchar_t tszPath[MAX_PATH];
mir_sntprintf(tszPath, L"%s\\%s", dirName, hash->m_name);
FILEINFO *fileInfo = ServerEntryToFileInfo(*hash, baseUrl, tszPath);
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 38e3646421..f09070bd43 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -36,7 +36,7 @@ static void SelectAll(HWND hDlg, bool bEnable) }
}
-static void SetStringText(HWND hWnd, size_t i, TCHAR *ptszText)
+static void SetStringText(HWND hWnd, size_t i, wchar_t *ptszText)
{
ListView_SetItemText(hWnd, i, 1, ptszText);
}
@@ -60,7 +60,7 @@ static void ApplyUpdates(void *param) AutoHandle pipe(hPipe);
HWND hwndList = GetDlgItem(hDlg, IDC_LIST_UPDATES);
//create needed folders after escalating priviledges. Folders creates when we actually install updates
- TCHAR tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
+ wchar_t tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
mir_sntprintf(tszFileBack, L"%s\\Backups", g_tszRoot);
SafeCreateDirectory(tszFileBack);
mir_sntprintf(tszFileTemp, L"%s\\Temp", g_tszRoot);
@@ -102,7 +102,7 @@ static void ApplyUpdates(void *param) if (p.bEnabled) {
if (p.bDeleteOnly) {
// we need only to backup the old file
- TCHAR *ptszRelPath = p.tszNewName + _tcslen(tszMirandaPath) + 1, tszBackFile[MAX_PATH];
+ wchar_t *ptszRelPath = p.tszNewName + wcslen(tszMirandaPath) + 1, tszBackFile[MAX_PATH];
mir_sntprintf(tszBackFile, L"%s\\%s", tszFileBack, ptszRelPath);
BackupFile(p.tszNewName, tszBackFile);
}
@@ -110,7 +110,7 @@ static void ApplyUpdates(void *param) // if file name differs, we also need to backup the old file here
// otherwise it would be replaced by unzip
if ( _tcsicmp(p.tszOldName, p.tszNewName)) {
- TCHAR tszSrcPath[MAX_PATH], tszBackFile[MAX_PATH];
+ wchar_t tszSrcPath[MAX_PATH], tszBackFile[MAX_PATH];
mir_sntprintf(tszSrcPath, L"%s\\%s", tszMirandaPath, p.tszOldName);
mir_sntprintf(tszBackFile, L"%s\\%s", tszFileBack, p.tszOldName);
BackupFile(tszSrcPath, tszBackFile);
@@ -136,7 +136,7 @@ static void ApplyUpdates(void *param) CallService(MS_AB_BACKUP);
if (opts.bChangePlatform) {
- TCHAR mirandaPath[MAX_PATH];
+ wchar_t mirandaPath[MAX_PATH];
GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath));
db_set_ts(NULL, MODNAME, "OldBin2", mirandaPath);
@@ -162,7 +162,7 @@ static void ApplyUpdates(void *param) #if MIRANDA_VER >= 0x0A00
BOOL bRestartCurrentProfile = db_get_b(NULL, MODNAME, "RestartCurrentProfile", 1) ? 1 : 0;
if (opts.bChangePlatform) {
- TCHAR mirstartpath[MAX_PATH];
+ wchar_t mirstartpath[MAX_PATH];
#ifdef _WIN64
mir_sntprintf(mirstartpath, L"%s\\miranda32.exe", tszMirandaPath);
@@ -207,10 +207,10 @@ static INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM {
wchar_t szPath[MAX_PATH];
GetModuleFileName(NULL, szPath, _countof(szPath));
- TCHAR *ext = _tcsrchr(szPath, '.');
+ wchar_t *ext = wcsrchr(szPath, '.');
if (ext != NULL)
*ext = '\0';
- _tcscat(szPath, L".test");
+ wcscat(szPath, L".test");
HANDLE hFile = CreateFile(szPath, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
// Running Windows Vista or later (major version >= 6).
@@ -268,9 +268,9 @@ static INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM for (int i = 0; i < todo.getCount(); ++i) {
LVITEM lvI = {0};
lvI.mask = LVIF_TEXT | LVIF_PARAM | LVIF_GROUPID | LVIF_NORECOMPUTE;
- lvI.iGroupId = (_tcsstr(todo[i].tszOldName, L"Plugins") != NULL) ? 1 :
- ((_tcsstr(todo[i].tszOldName, L"Languages") != NULL) ? 3 :
- ((_tcsstr(todo[i].tszOldName, L"Icons") != NULL) ? 4 : 2));
+ lvI.iGroupId = (wcsstr(todo[i].tszOldName, L"Plugins") != NULL) ? 1 :
+ ((wcsstr(todo[i].tszOldName, L"Languages") != NULL) ? 3 :
+ ((wcsstr(todo[i].tszOldName, L"Icons") != NULL) ? 4 : 2));
lvI.iSubItem = 0;
lvI.lParam = (LPARAM)&todo[i];
lvI.pszText = todo[i].tszOldName;
@@ -410,7 +410,7 @@ static void DlgUpdateSilent(void *param) AutoHandle pipe(hPipe);
//create needed folders after escalating priviledges. Folders creates when we actually install updates
- TCHAR tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
+ wchar_t tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
mir_sntprintf(tszFileBack, L"%s\\Backups", g_tszRoot);
SafeCreateDirectory(tszFileBack);
@@ -452,7 +452,7 @@ static void DlgUpdateSilent(void *param) if (p.bEnabled) {
if (p.bDeleteOnly) {
// we need only to backup the old file
- TCHAR *ptszRelPath = p.tszNewName + _tcslen(tszMirandaPath) + 1, tszBackFile[MAX_PATH];
+ wchar_t *ptszRelPath = p.tszNewName + wcslen(tszMirandaPath) + 1, tszBackFile[MAX_PATH];
mir_sntprintf(tszBackFile, L"%s\\%s", tszFileBack, ptszRelPath);
BackupFile(p.tszNewName, tszBackFile);
}
@@ -460,7 +460,7 @@ static void DlgUpdateSilent(void *param) // if file name differs, we also need to backup the old file here
// otherwise it would be replaced by unzip
if (_tcsicmp(p.tszOldName, p.tszNewName)) {
- TCHAR tszSrcPath[MAX_PATH], tszBackFile[MAX_PATH];
+ wchar_t tszSrcPath[MAX_PATH], tszBackFile[MAX_PATH];
mir_sntprintf(tszSrcPath, L"%s\\%s", tszMirandaPath, p.tszOldName);
mir_sntprintf(tszBackFile, L"%s\\%s", tszFileBack, p.tszOldName);
BackupFile(tszSrcPath, tszBackFile);
@@ -492,7 +492,7 @@ static void DlgUpdateSilent(void *param) db_set_b(NULL, MODNAME, DB_SETTING_NEED_RESTART, 1);
// 5) Prepare Restart
- TCHAR tszTitle[100];
+ wchar_t tszTitle[100];
mir_sntprintf(tszTitle, TranslateT("%d component(s) was updated"), count);
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1)) {
@@ -514,7 +514,7 @@ static void DlgUpdateSilent(void *param) if (!notified) {
// Error, let's try to show MessageBox as last way to inform user about successful update
- TCHAR tszText[200];
+ wchar_t tszText[200];
mir_sntprintf(tszText, L"%s\n\n%s", TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
if (MessageBox(NULL, tszText, tszTitle, MB_ICONINFORMATION | MB_YESNO) == IDYES)
@@ -540,7 +540,7 @@ static void __stdcall LaunchDialog(void *param) struct
{
- TCHAR *oldName, *newName;
+ wchar_t *oldName, *newName;
}
static renameTable[] =
{
@@ -603,18 +603,18 @@ static renameTable[] = // Checks if file needs to be renamed and copies it in pNewName
// Returns true if smth. was copied
-static bool CheckFileRename(const TCHAR *ptszOldName, TCHAR *pNewName)
+static bool CheckFileRename(const wchar_t *ptszOldName, wchar_t *pNewName)
{
for (int i = 0; i < _countof(renameTable); i++) {
if (wildcmpit(ptszOldName, renameTable[i].oldName)) {
- TCHAR *ptszDest = renameTable[i].newName;
+ wchar_t *ptszDest = renameTable[i].newName;
if (ptszDest == NULL)
*pNewName = 0;
else {
- _tcsncpy_s(pNewName, MAX_PATH, ptszDest, _TRUNCATE);
- size_t cbLen = _tcslen(ptszDest) - 1;
+ wcsncpy_s(pNewName, MAX_PATH, ptszDest, _TRUNCATE);
+ size_t cbLen = wcslen(ptszDest) - 1;
if (pNewName[cbLen] == '*')
- _tcsncpy_s(pNewName + cbLen, MAX_PATH - cbLen, ptszOldName, _TRUNCATE);
+ wcsncpy_s(pNewName + cbLen, MAX_PATH - cbLen, ptszOldName, _TRUNCATE);
}
return true;
}
@@ -625,23 +625,23 @@ static bool CheckFileRename(const TCHAR *ptszOldName, TCHAR *pNewName) /////////////////////////////////////////////////////////////////////////////////////////
// We only update ".dll", ".exe" and ".ico"
-static bool isValidExtension(const TCHAR *ptszFileName)
+static bool isValidExtension(const wchar_t *ptszFileName)
{
- const TCHAR *pExt = _tcsrchr(ptszFileName, '.');
+ const wchar_t *pExt = wcsrchr(ptszFileName, '.');
return (pExt != NULL) && (!_tcsicmp(pExt, L".dll") || !_tcsicmp(pExt, L".exe") || !_tcsicmp(pExt, L".txt"));
}
// We only scan subfolders "Plugins", "Icons", "Languages", "Libs", "Core"
-static bool isValidDirectory(const TCHAR *ptszDirName)
+static bool isValidDirectory(const wchar_t *ptszDirName)
{
return !_tcsicmp(ptszDirName, L"Plugins") || !_tcsicmp(ptszDirName, L"Icons") || !_tcsicmp(ptszDirName, L"Languages") || !_tcsicmp(ptszDirName, L"Libs") || !_tcsicmp(ptszDirName, L"Core");
}
// Scans folders recursively
-static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, const TCHAR *tszBaseUrl, SERVLIST& hashes, OBJLIST<FILEINFO> *UpdateFiles, int level = 0)
+static int ScanFolder(const wchar_t *tszFolder, size_t cbBaseLen, const wchar_t *tszBaseUrl, SERVLIST& hashes, OBJLIST<FILEINFO> *UpdateFiles, int level = 0)
{
- TCHAR tszBuf[MAX_PATH];
+ wchar_t tszBuf[MAX_PATH];
mir_sntprintf(tszBuf, L"%s\\*", tszFolder);
WIN32_FIND_DATA ffd;
@@ -662,7 +662,7 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, const TCHAR *tsz }
else if (isValidExtension(ffd.cFileName)) {
// calculate the current file's relative name and store it into tszNewName
- TCHAR tszNewName[MAX_PATH];
+ wchar_t tszNewName[MAX_PATH];
if (CheckFileRename(ffd.cFileName, tszNewName)) {
Netlib_LogfT(hNetlibUser, L"File %s will be renamed to %s.", ffd.cFileName, tszNewName);
// Yes, we need the old file name, because this will be hashed later
@@ -671,7 +671,7 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, const TCHAR *tsz else {
if (level == 0) {
// Rename Miranda*.exe
- _tcsncpy_s(tszNewName, opts.bChangePlatform && !mir_tstrcmpi(ffd.cFileName, OLD_FILENAME) ? NEW_FILENAME : ffd.cFileName, _TRUNCATE);
+ wcsncpy_s(tszNewName, opts.bChangePlatform && !mir_tstrcmpi(ffd.cFileName, OLD_FILENAME) ? NEW_FILENAME : ffd.cFileName, _TRUNCATE);
mir_sntprintf(tszBuf, L"%s\\%s", tszFolder, tszNewName);
}
else {
@@ -680,17 +680,17 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, const TCHAR *tsz }
}
- TCHAR *ptszUrl;
+ wchar_t *ptszUrl;
int MyCRC;
bool bDeleteOnly = (tszNewName[0] == 0);
// this file is not marked for deletion
if (!bDeleteOnly) {
- TCHAR *pName = tszNewName;
+ wchar_t *pName = tszNewName;
ServListEntry *item = hashes.find((ServListEntry*)&pName);
// Not in list? Check for trailing 'W' or 'w'
if (item == NULL) {
- TCHAR *p = _tcsrchr(tszNewName, '.');
+ wchar_t *p = wcsrchr(tszNewName, '.');
if (p[-1] != 'w' && p[-1] != 'W') {
Netlib_LogfT(hNetlibUser, L"File %s: Not found on server, skipping", ffd.cFileName);
continue;
@@ -744,26 +744,26 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, const TCHAR *tsz // Yeah, we've got new version.
FILEINFO *FileInfo = new FILEINFO;
// copy the relative old name
- _tcsncpy(FileInfo->tszOldName, tszBuf + cbBaseLen, _countof(FileInfo->tszOldName));
+ wcsncpy(FileInfo->tszOldName, tszBuf + cbBaseLen, _countof(FileInfo->tszOldName));
FileInfo->bDeleteOnly = bDeleteOnly;
if (FileInfo->bDeleteOnly) {
// save the full old name for deletion
- _tcsncpy(FileInfo->tszNewName, tszBuf, _countof(FileInfo->tszNewName));
+ wcsncpy(FileInfo->tszNewName, tszBuf, _countof(FileInfo->tszNewName));
}
else {
- _tcsncpy(FileInfo->tszNewName, ptszUrl, _countof(FileInfo->tszNewName));
+ wcsncpy(FileInfo->tszNewName, ptszUrl, _countof(FileInfo->tszNewName));
}
- _tcsncpy(tszBuf, ptszUrl, _countof(tszBuf));
- TCHAR *p = _tcsrchr(tszBuf, '.');
+ wcsncpy(tszBuf, ptszUrl, _countof(tszBuf));
+ wchar_t *p = wcsrchr(tszBuf, '.');
if (p) *p = 0;
- p = _tcsrchr(tszBuf, '\\');
+ p = wcsrchr(tszBuf, '\\');
p = (p) ? p + 1 : tszBuf;
- _tcslwr(p);
+ wcslwr(p);
mir_sntprintf(FileInfo->File.tszDiskPath, L"%s\\Temp\\%s.zip", g_tszRoot, p);
mir_sntprintf(FileInfo->File.tszDownloadURL, L"%s/%s.zip", tszBaseUrl, tszBuf);
- for (p = _tcschr(FileInfo->File.tszDownloadURL, '\\'); p != 0; p = _tcschr(p, '\\'))
+ for (p = wcschr(FileInfo->File.tszDownloadURL, '\\'); p != 0; p = wcschr(p, '\\'))
*p++ = '/';
// remember whether the user has decided not to update this component with this particular new version
@@ -789,7 +789,7 @@ static void CheckUpdates(void *) Netlib_LogfT(hNetlibUser, L"Checking for updates");
Thread_SetName("PluginUpdater: CheckUpdates");
- TCHAR tszTempPath[MAX_PATH];
+ wchar_t tszTempPath[MAX_PATH];
DWORD dwLen = GetTempPath(_countof(tszTempPath), tszTempPath);
if (tszTempPath[dwLen - 1] == '\\')
tszTempPath[dwLen - 1] = 0;
diff --git a/plugins/PluginUpdater/src/Events.cpp b/plugins/PluginUpdater/src/Events.cpp index 1afbe741cc..ea4c6e8ddf 100644 --- a/plugins/PluginUpdater/src/Events.cpp +++ b/plugins/PluginUpdater/src/Events.cpp @@ -24,7 +24,7 @@ HANDLE hPluginUpdaterFolder; int OnFoldersChanged(WPARAM, LPARAM)
{
FoldersGetCustomPathT(hPluginUpdaterFolder, g_tszRoot, MAX_PATH, L"");
- size_t len = _tcslen(g_tszRoot);
+ size_t len = wcslen(g_tszRoot);
if (g_tszRoot[len-1] == '\\' || g_tszRoot[len-1] == '/')
g_tszRoot[len-1] = 0;
return 0;
diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp index f21dd3481f..5741de81bd 100644 --- a/plugins/PluginUpdater/src/Notifications.cpp +++ b/plugins/PluginUpdater/src/Notifications.cpp @@ -70,7 +70,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hPopup, UINT uMsg, WPARAM wParam, LPAR static void _stdcall RestartPrompt(void *)
{
- TCHAR tszText[200];
+ wchar_t tszText[200];
mir_sntprintf(tszText, L"%s\n\n%s", TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
if (MessageBox(0, tszText, TranslateT("Plugin Updater"), MB_YESNO | MB_ICONQUESTION | MB_TOPMOST) == IDYES)
diff --git a/plugins/PluginUpdater/src/Notifications.h b/plugins/PluginUpdater/src/Notifications.h index 1d8544ba63..2819baf04b 100644 --- a/plugins/PluginUpdater/src/Notifications.h +++ b/plugins/PluginUpdater/src/Notifications.h @@ -60,9 +60,9 @@ extern struct POPUP_OPTIONS { } PopupOptions;
static struct {
- TCHAR *Text;
+ wchar_t *Text;
int Action;
} PopupActions[] = {
- LPGENT("Close popup"), PCA_CLOSEPOPUP,
- LPGENT("Do nothing"), PCA_DONOTHING
+ LPGENW("Close popup"), PCA_CLOSEPOPUP,
+ LPGENW("Do nothing"), PCA_DONOTHING
};
diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index 4586df734a..1e379e7264 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -34,7 +34,7 @@ static int GetUpdateMode() // Check if there is url for custom mode
if (UpdateMode == UPDATE_MODE_CUSTOM) {
ptrT url(db_get_tsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
- if (url == NULL || !_tcslen(url)) {
+ if (url == NULL || !wcslen(url)) {
// No url for custom mode, reset that setting so it will be determined automatically
db_unset(NULL, MODNAME, DB_SETTING_UPDATE_MODE);
UpdateMode = -1;
@@ -51,9 +51,9 @@ static int GetUpdateMode() return UpdateMode;
}
-TCHAR* GetDefaultUrl()
+wchar_t* GetDefaultUrl()
{
- TCHAR url[MAX_PATH];
+ wchar_t url[MAX_PATH];
switch (GetUpdateMode()) {
case UPDATE_MODE_STABLE:
mir_sntprintf(url, _T(DEFAULT_UPDATE_URL), opts.bChangePlatform ? DEFAULT_OPP_BITS : DEFAULT_BITS);
@@ -71,7 +71,7 @@ TCHAR* GetDefaultUrl() static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR defurl[MAX_PATH];
+ wchar_t defurl[MAX_PATH];
switch (msg) {
case WM_INITDIALOG:
@@ -98,7 +98,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar if (ServiceExists(MS_AB_BACKUP)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_BACKUP), TRUE);
- SetDlgItemText(hwndDlg, IDC_BACKUP, LPGENT("Backup database before update"));
+ SetDlgItemText(hwndDlg, IDC_BACKUP, LPGENW("Backup database before update"));
if(opts.bBackup)
CheckDlgButton(hwndDlg, IDC_BACKUP, BST_CHECKED);
}
@@ -111,7 +111,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar int UpdateMode = db_get_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE);
if (UpdateMode == UPDATE_MODE_STABLE)
db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK);
- SetDlgItemText(hwndDlg,IDC_STABLE,LPGENT("Stable version (incompatible with current development version)"));
+ SetDlgItemText(hwndDlg,IDC_STABLE,LPGENW("Stable version (incompatible with current development version)"));
}
TranslateDialogDefault(hwndDlg);
@@ -266,9 +266,9 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar db_set_b(NULL, MODNAME, "PeriodMeasure", opts.bPeriodMeasure = ComboBox_GetCurSel(GetDlgItem(hwndDlg, IDC_PERIODMEASURE)));
db_set_b(NULL, MODNAME, "SilentMode", opts.bSilentMode = IsDlgButtonChecked(hwndDlg, IDC_SILENTMODE));
db_set_b(NULL, MODNAME, "Backup", opts.bBackup = IsDlgButtonChecked(hwndDlg, IDC_BACKUP));
- TCHAR buffer[3] = {0};
+ wchar_t buffer[3] = {0};
Edit_GetText(GetDlgItem(hwndDlg, IDC_PERIOD), buffer, _countof(buffer));
- db_set_dw(NULL, MODNAME, "Period", opts.Period = _ttoi(buffer));
+ db_set_dw(NULL, MODNAME, "Period", opts.Period = _wtoi(buffer));
mir_forkthread(InitTimer, (void*)1);
@@ -293,7 +293,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar }
}
else {
- TCHAR tszUrl[100];
+ wchar_t tszUrl[100];
GetDlgItemText(hwndDlg, IDC_CUSTOMURL, tszUrl, _countof(tszUrl));
db_set_ts(NULL, MODNAME, DB_SETTING_UPDATE_URL, tszUrl);
db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_CUSTOM);
@@ -512,15 +512,15 @@ static int OptInit(WPARAM wParam, LPARAM) odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_UPDATENOTIFY);
- odp.ptszGroup = LPGENT("Services");
- odp.ptszTitle = LPGENT("Plugin Updater");
+ odp.pwszGroup = LPGENW("Services");
+ odp.pwszTitle = LPGENW("Plugin Updater");
odp.pfnDlgProc = UpdateNotifyOptsProc;
Options_AddPage(wParam, &odp);
if ( ServiceExists(MS_POPUP_ADDPOPUPT)) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUP);
- odp.ptszGroup = LPGENT("Popups");
- odp.ptszTitle = LPGENT("Plugin Updater");
+ odp.pwszGroup = LPGENW("Popups");
+ odp.pwszTitle = LPGENW("Plugin Updater");
odp.pfnDlgProc = DlgPopupOpts;
Options_AddPage(wParam, &odp);
}
diff --git a/plugins/PluginUpdater/src/PluginUpdater.cpp b/plugins/PluginUpdater/src/PluginUpdater.cpp index 4a07853828..a10066806b 100644 --- a/plugins/PluginUpdater/src/PluginUpdater.cpp +++ b/plugins/PluginUpdater/src/PluginUpdater.cpp @@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. #include "stdafx.h"
HINSTANCE hInst = NULL;
-TCHAR g_tszRoot[MAX_PATH] = {0}, g_tszTempPath[MAX_PATH];
+wchar_t g_tszRoot[MAX_PATH] = {0}, g_tszTempPath[MAX_PATH];
int hLangpack;
DWORD g_mirandaVersion;
diff --git a/plugins/PluginUpdater/src/Services.cpp b/plugins/PluginUpdater/src/Services.cpp index 4111fca483..bd12b68f17 100644 --- a/plugins/PluginUpdater/src/Services.cpp +++ b/plugins/PluginUpdater/src/Services.cpp @@ -29,7 +29,7 @@ static INT_PTR srvParseHashes(WPARAM wParam, LPARAM lParam) SERVLIST *pList = new SERVLIST(50, CompareHashes);
ptrT baseUrl;
if ( ParseHashes(ptszUrl, baseUrl, *pList)) {
- _tcsncpy(ptszBaseUrl, baseUrl, MAX_PATH);
+ wcsncpy(ptszBaseUrl, baseUrl, MAX_PATH);
return (INT_PTR)pList;
}
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index 2d3923b7cd..b298f38345 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -43,9 +43,9 @@ void LoadOptions() #if MIRANDA_VER >= 0x0A00
IconItemT iconList[] =
{
- { LPGENT("Check for updates"),"check_update", IDI_MENU },
- { LPGENT("Plugin info"), "info", IDI_INFO },
- { LPGENT("Component list"),"plg_list", IDI_PLGLIST }
+ { LPGENW("Check for updates"),"check_update", IDI_MENU },
+ { LPGENW("Plugin info"), "info", IDI_INFO },
+ { LPGENW("Component list"),"plg_list", IDI_PLGLIST }
};
void InitIcoLib()
@@ -128,17 +128,17 @@ int CompareHashes(const ServListEntry *p1, const ServListEntry *p2) return _tcsicmp(p1->m_name, p2->m_name);
}
-bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes)
+bool ParseHashes(const wchar_t *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes)
{
REPLACEVARSARRAY vars[2];
#if MIRANDA_VER >=0x0A00
- vars[0].key.t = L"platform";
+ vars[0].key.w = L"platform";
#ifdef _WIN64
- vars[0].value.t = L"64";
+ vars[0].value.w = L"64";
#else
- vars[0].value.t = L"32";
+ vars[0].value.w = L"32";
#endif
- vars[1].key.t = vars[1].value.t = 0;
+ vars[1].key.w = vars[1].value.w = 0;
#else
vars[0].lptzKey = L"platform";
#ifdef _WIN64
@@ -176,9 +176,9 @@ bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes) DeleteFile(pFileUrl.tszDiskPath);
- TCHAR tszTmpIni[MAX_PATH] = {0};
+ wchar_t tszTmpIni[MAX_PATH] = {0};
mir_sntprintf(tszTmpIni, L"%s\\hashes.txt", g_tszTempPath);
- FILE *fp = _tfopen(tszTmpIni, L"r");
+ FILE *fp = _wfopen(tszTmpIni, L"r");
if (!fp) {
Netlib_LogfT(hNetlibUser,L"Opening %s failed", g_tszTempPath);
ShowPopup(TranslateT("Plugin Updater"), TranslateT("An error occurred while checking for new updates."), POPUP_TYPE_ERROR);
@@ -284,7 +284,7 @@ bool DownloadFile(FILEURL *pFileURL, HANDLE &nlc) }
else {
// try to write it via PU stub
- TCHAR tszTempFile[MAX_PATH];
+ wchar_t tszTempFile[MAX_PATH];
mir_sntprintf(tszTempFile, L"%s\\pulocal.tmp", g_tszTempPath);
hFile = CreateFile(tszTempFile, GENERIC_READ | GENERIC_WRITE, NULL, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
@@ -482,12 +482,12 @@ Cleanup: bool PrepareEscalation()
{
// First try to create a file near Miranda32.exe
- TCHAR szPath[MAX_PATH];
+ wchar_t szPath[MAX_PATH];
GetModuleFileName(NULL, szPath, _countof(szPath));
- TCHAR *ext = _tcsrchr(szPath, '.');
+ wchar_t *ext = wcsrchr(szPath, '.');
if (ext != NULL)
*ext = '\0';
- _tcscat(szPath, L".test");
+ wcscat(szPath, L".test");
HANDLE hFile = CreateFile(szPath, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
// we are admins or UAC is disable, cool
@@ -501,17 +501,17 @@ bool PrepareEscalation() }
else {
// Elevate the process. Create a pipe for a stub first
- TCHAR tszPipeName[MAX_PATH];
+ wchar_t tszPipeName[MAX_PATH];
mir_sntprintf(tszPipeName, L"\\\\.\\pipe\\Miranda_Pu_%d", GetCurrentProcessId());
hPipe = CreateNamedPipe(tszPipeName, PIPE_ACCESS_DUPLEX, PIPE_READMODE_BYTE | PIPE_WAIT, 1, 1024, 1024, NMPWAIT_USE_DEFAULT_WAIT, NULL);
if (hPipe == INVALID_HANDLE_VALUE) {
hPipe = NULL;
}
else {
- TCHAR cmdLine[100], *p;
+ wchar_t cmdLine[100], *p;
GetModuleFileName(NULL, szPath, ARRAYSIZE(szPath));
- if ((p = _tcsrchr(szPath, '\\')) != 0)
- _tcscpy(p+1, L"pu_stub.exe");
+ if ((p = wcsrchr(szPath, '\\')) != 0)
+ wcscpy(p+1, L"pu_stub.exe");
mir_sntprintf(cmdLine, L"%d", GetCurrentProcessId());
// Launch a stub
@@ -540,7 +540,7 @@ bool PrepareEscalation() /////////////////////////////////////////////////////////////////////////////////////////
-int TransactPipe(int opcode, const TCHAR *p1, const TCHAR *p2)
+int TransactPipe(int opcode, const wchar_t *p1, const wchar_t *p2)
{
BYTE buf[1024];
DWORD l1 = lstrlen(p1), l2 = lstrlen(p2);
@@ -548,7 +548,7 @@ int TransactPipe(int opcode, const TCHAR *p1, const TCHAR *p2) return 0;
*(DWORD*)buf = opcode;
- TCHAR *dst = (TCHAR*)&buf[sizeof(DWORD)];
+ wchar_t *dst = (wchar_t*)&buf[sizeof(DWORD)];
lstrcpy(dst, p1);
dst += l1+1;
if (p2) {
@@ -568,7 +568,7 @@ int TransactPipe(int opcode, const TCHAR *p1, const TCHAR *p2) return dwError == ERROR_SUCCESS;
}
-int SafeCopyFile(const TCHAR *pSrc, const TCHAR *pDst)
+int SafeCopyFile(const wchar_t *pSrc, const wchar_t *pDst)
{
if (hPipe == NULL)
return CopyFile(pSrc, pDst, FALSE);
@@ -576,7 +576,7 @@ int SafeCopyFile(const TCHAR *pSrc, const TCHAR *pDst) return TransactPipe(1, pSrc, pDst);
}
-int SafeMoveFile(const TCHAR *pSrc, const TCHAR *pDst)
+int SafeMoveFile(const wchar_t *pSrc, const wchar_t *pDst)
{
if (hPipe == NULL) {
DeleteFile(pDst);
@@ -588,7 +588,7 @@ int SafeMoveFile(const TCHAR *pSrc, const TCHAR *pDst) return TransactPipe(2, pSrc, pDst);
}
-int SafeDeleteFile(const TCHAR *pFile)
+int SafeDeleteFile(const wchar_t *pFile)
{
if (hPipe == NULL)
return DeleteFile(pFile);
@@ -596,7 +596,7 @@ int SafeDeleteFile(const TCHAR *pFile) return TransactPipe(3, pFile, NULL);
}
-int SafeCreateDirectory(const TCHAR *pFolder)
+int SafeCreateDirectory(const wchar_t *pFolder)
{
if (hPipe == NULL)
return CreateDirectoryTreeT(pFolder);
@@ -604,7 +604,7 @@ int SafeCreateDirectory(const TCHAR *pFolder) return TransactPipe(4, pFolder, NULL);
}
-int SafeCreateFilePath(TCHAR *pFolder)
+int SafeCreateFilePath(wchar_t *pFolder)
{
if (hPipe == NULL) {
CreatePathToFileT(pFolder);
@@ -614,7 +614,7 @@ int SafeCreateFilePath(TCHAR *pFolder) return TransactPipe(5, pFolder, NULL);
}
-void BackupFile(TCHAR *ptszSrcFileName, TCHAR *ptszBackFileName)
+void BackupFile(wchar_t *ptszSrcFileName, wchar_t *ptszBackFileName)
{
SafeCreateFilePath(ptszBackFileName);
SafeMoveFile(ptszSrcFileName, ptszBackFileName);
diff --git a/plugins/PluginUpdater/src/checksum.cpp b/plugins/PluginUpdater/src/checksum.cpp index 48d2d9ee26..ba895515b4 100644 --- a/plugins/PluginUpdater/src/checksum.cpp +++ b/plugins/PluginUpdater/src/checksum.cpp @@ -23,7 +23,7 @@ struct MFileMapping PBYTE ptr;
HANDLE hMap, hFile;
- MFileMapping(const TCHAR* ptszFileName)
+ MFileMapping(const wchar_t* ptszFileName)
{
ptr = NULL;
hMap = NULL;
@@ -69,7 +69,7 @@ static void PatchResourcesDirectory(PIMAGE_RESOURCE_DIRECTORY pIRD, PBYTE pBase) PatchResourceEntry(pIRDE, pBase);
}
-int CalculateModuleHash(const TCHAR *filename, char *szDest)
+int CalculateModuleHash(const wchar_t *filename, char *szDest)
{
MFileMapping map(filename);
if (map.hFile == INVALID_HANDLE_VALUE)
diff --git a/plugins/PluginUpdater/src/stdafx.h b/plugins/PluginUpdater/src/stdafx.h index 501363d3e2..179f0c4879 100644 --- a/plugins/PluginUpdater/src/stdafx.h +++ b/plugins/PluginUpdater/src/stdafx.h @@ -70,14 +70,14 @@ Boston, MA 02111-1307, USA. struct FILEURL
{
- TCHAR tszDownloadURL[2048];
- TCHAR tszDiskPath[MAX_PATH];
+ wchar_t tszDownloadURL[2048];
+ wchar_t tszDiskPath[MAX_PATH];
int CRCsum;
};
struct FILEINFO
{
- TCHAR tszOldName[MAX_PATH], tszNewName[MAX_PATH];
+ wchar_t tszOldName[MAX_PATH], tszNewName[MAX_PATH];
FILEURL File;
BOOL bEnabled, bDeleteOnly;
};
@@ -158,7 +158,7 @@ using namespace std; extern HINSTANCE hInst;
extern DWORD g_mirandaVersion;
-extern TCHAR g_tszRoot[MAX_PATH], g_tszTempPath[MAX_PATH];
+extern wchar_t g_tszRoot[MAX_PATH], g_tszTempPath[MAX_PATH];
extern aPopups PopupsList[POPUPS];
extern HANDLE hPipe, hNetlibUser;
#if MIRANDA_VER >= 0x0A00
@@ -199,7 +199,7 @@ struct ServListEntry mir_free(m_name);
}
- TCHAR *m_name;
+ wchar_t *m_name;
DWORD m_crc;
char m_szHash[32+1];
};
@@ -223,12 +223,12 @@ void UnloadCheck(); void UnloadListNew();
void UnloadNetlib();
-void BackupFile(TCHAR *ptszSrcFileName, TCHAR *ptszBackFileName);
+void BackupFile(wchar_t *ptszSrcFileName, wchar_t *ptszBackFileName);
-bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes);
+bool ParseHashes(const wchar_t *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes);
int CompareHashes(const ServListEntry *p1, const ServListEntry *p2);
-TCHAR* GetDefaultUrl();
+wchar_t* GetDefaultUrl();
bool DownloadFile(FILEURL *pFileURL, HANDLE &nlc);
void ShowPopup(LPCTSTR Title, LPCTSTR Text, int Number);
@@ -237,19 +237,19 @@ void __stdcall OpenPluginOptions(void*); void CheckUpdateOnStartup();
void InitTimer(void *type);
-bool unzip(const TCHAR *ptszZipFile, TCHAR *ptszDestPath, TCHAR *ptszBackPath,bool ch);
+bool unzip(const wchar_t *ptszZipFile, wchar_t *ptszDestPath, wchar_t *ptszBackPath,bool ch);
///////////////////////////////////////////////////////////////////////////////
-int CalculateModuleHash(const TCHAR *tszFileName, char *dest);
+int CalculateModuleHash(const wchar_t *tszFileName, char *dest);
BOOL IsProcessElevated();
bool PrepareEscalation();
-int SafeCreateDirectory(const TCHAR *ptszDirName);
-int SafeCopyFile(const TCHAR *ptszSrc, const TCHAR *ptszDst);
-int SafeMoveFile(const TCHAR *ptszSrc, const TCHAR *ptszDst);
-int SafeDeleteFile(const TCHAR *ptszSrc);
-int SafeCreateFilePath(TCHAR *pFolder);
+int SafeCreateDirectory(const wchar_t *ptszDirName);
+int SafeCopyFile(const wchar_t *ptszSrc, const wchar_t *ptszDst);
+int SafeMoveFile(const wchar_t *ptszSrc, const wchar_t *ptszDst);
+int SafeDeleteFile(const wchar_t *ptszSrc);
+int SafeCreateFilePath(wchar_t *pFolder);
char *StrToLower(char *str);
diff --git a/plugins/PluginUpdater/src/unzipfile.cpp b/plugins/PluginUpdater/src/unzipfile.cpp index 2a64019ada..979dcd289e 100644 --- a/plugins/PluginUpdater/src/unzipfile.cpp +++ b/plugins/PluginUpdater/src/unzipfile.cpp @@ -30,16 +30,16 @@ extern "C" void fill_fopen64_filefunc(zlib_filefunc64_def *pzlib_filefunc_def);
}
-static void PrepareFileName(TCHAR *dest, size_t destSize, const TCHAR *ptszPath, const TCHAR *ptszFileName)
+static void PrepareFileName(wchar_t *dest, size_t destSize, const wchar_t *ptszPath, const wchar_t *ptszFileName)
{
mir_sntprintf(dest, destSize, L"%s\\%s", ptszPath, ptszFileName);
- for (TCHAR *p = dest; *p; ++p)
+ for (wchar_t *p = dest; *p; ++p)
if (*p == '/')
*p = '\\';
}
-bool extractCurrentFile(unzFile uf, TCHAR *ptszDestPath, TCHAR *ptszBackPath, bool ch)
+bool extractCurrentFile(unzFile uf, wchar_t *ptszDestPath, wchar_t *ptszBackPath, bool ch)
{
unz_file_info64 file_info;
char filename[MAX_PATH], buf[8192];
@@ -56,8 +56,8 @@ bool extractCurrentFile(unzFile uf, TCHAR *ptszDestPath, TCHAR *ptszBackPath, bo if (ch && !db_get_b(NULL, DB_MODULE_FILES, StrToLower(ptrA(mir_strdup(filename))), 1))
return true;
- TCHAR tszDestFile[MAX_PATH], tszBackFile[MAX_PATH];
- TCHAR *ptszNewName = mir_utf8decodeT(filename);
+ wchar_t tszDestFile[MAX_PATH], tszBackFile[MAX_PATH];
+ wchar_t *ptszNewName = mir_utf8decodeT(filename);
if (ptszNewName == NULL)
ptszNewName = mir_a2t(filename);
@@ -77,11 +77,11 @@ bool extractCurrentFile(unzFile uf, TCHAR *ptszDestPath, TCHAR *ptszBackPath, bo PrepareFileName(tszDestFile, _countof(tszDestFile), ptszDestPath, ptszNewName);
SafeCreateFilePath(tszDestFile);
- TCHAR *ptszFile2unzip;
+ wchar_t *ptszFile2unzip;
if (hPipe == NULL) // direct mode
ptszFile2unzip = tszDestFile;
else {
- TCHAR tszTempPath[MAX_PATH];
+ wchar_t tszTempPath[MAX_PATH];
GetTempPath( _countof(tszTempPath), tszTempPath);
GetTempFileName(tszTempPath, L"PUtemp", GetCurrentProcessId(), tszBackFile);
ptszFile2unzip = tszBackFile;
@@ -120,7 +120,7 @@ bool extractCurrentFile(unzFile uf, TCHAR *ptszDestPath, TCHAR *ptszBackPath, bo return true;
}
-bool unzip(const TCHAR *ptszZipFile, TCHAR *ptszDestPath, TCHAR *ptszBackPath,bool ch)
+bool unzip(const wchar_t *ptszZipFile, wchar_t *ptszDestPath, wchar_t *ptszBackPath,bool ch)
{
bool bResult = true;
diff --git a/plugins/Popup/src/bitmap_funcs.cpp b/plugins/Popup/src/bitmap_funcs.cpp index 547ab99a0f..9e2c094464 100644 --- a/plugins/Popup/src/bitmap_funcs.cpp +++ b/plugins/Popup/src/bitmap_funcs.cpp @@ -55,7 +55,7 @@ MyBitmap::MyBitmap(int w, int h) allocate(w, h);
}
-MyBitmap::MyBitmap(const TCHAR *fn)
+MyBitmap::MyBitmap(const wchar_t *fn)
{
dcBmp = 0;
hBmp = 0;
@@ -594,7 +594,7 @@ void MyBitmap::DrawIcon(HICON hic, int x, int y, int w, int h) DeleteObject(info.hbmMask);
}
-void MyBitmap::Draw_Text(TCHAR *str, int x, int y)
+void MyBitmap::Draw_Text(wchar_t *str, int x, int y)
{
SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_tstrlen(str), &sz);
RECT rc; SetRect(&rc, x, y, x + 10000, y + 10000);
@@ -676,11 +676,11 @@ static int hex2dec(char hex) return 0;
}
-bool MyBitmap::loadFromFile_pixel(const TCHAR *fn)
+bool MyBitmap::loadFromFile_pixel(const wchar_t *fn)
{
allocate(1, 1);
int r, g, b, a = 255;
- const TCHAR *p = fn + mir_tstrlen(L"pixel:");
+ const wchar_t *p = fn + mir_tstrlen(L"pixel:");
r = (hex2dec(p[0]) << 4) + hex2dec(p[1]);
g = (hex2dec(p[2]) << 4) + hex2dec(p[3]);
b = (hex2dec(p[4]) << 4) + hex2dec(p[5]);
@@ -688,9 +688,9 @@ bool MyBitmap::loadFromFile_pixel(const TCHAR *fn) return true;
}
-bool MyBitmap::loadFromFile_gradient(const TCHAR *fn)
+bool MyBitmap::loadFromFile_gradient(const wchar_t *fn)
{
- const TCHAR *p = fn + mir_tstrlen(L"gradient:");
+ const wchar_t *p = fn + mir_tstrlen(L"gradient:");
if (*p == 'h') allocate(256, 1);
else allocate(1, 256);
@@ -720,14 +720,14 @@ bool MyBitmap::loadFromFile_gradient(const TCHAR *fn) return true;
}
-bool MyBitmap::loadFromFile(const TCHAR *fn)
+bool MyBitmap::loadFromFile(const wchar_t *fn)
{
if (bits) freemem();
- if (!_tcsncmp(fn, L"pixel:", mir_tstrlen(L"pixel:")))
+ if (!wcsncmp(fn, L"pixel:", mir_tstrlen(L"pixel:")))
return loadFromFile_pixel(fn);
- if (!_tcsncmp(fn, L"gradient:", mir_tstrlen(L"gradient:")))
+ if (!wcsncmp(fn, L"gradient:", mir_tstrlen(L"gradient:")))
return loadFromFile_gradient(fn);
SIZE sz;
diff --git a/plugins/Popup/src/bitmap_funcs.h b/plugins/Popup/src/bitmap_funcs.h index 64150200ee..bc1ab377eb 100644 --- a/plugins/Popup/src/bitmap_funcs.h +++ b/plugins/Popup/src/bitmap_funcs.h @@ -43,18 +43,18 @@ private: void freemem();
- bool loadFromFile_pixel(const TCHAR *fn);
- bool loadFromFile_gradient(const TCHAR *fn);
+ bool loadFromFile_pixel(const wchar_t *fn);
+ bool loadFromFile_gradient(const wchar_t *fn);
void premultipleChannels();
public:
MyBitmap();
MyBitmap(int w, int h);
- MyBitmap(const TCHAR *fn);
+ MyBitmap(const wchar_t *fn);
~MyBitmap();
void allocate(int w, int h);
- bool loadFromFile(const TCHAR *fn);
+ bool loadFromFile(const wchar_t *fn);
int getWidth() { return width; }
int getHeight() { return height; }
@@ -87,7 +87,7 @@ public: // void DrawPartColorized(MyBitmap *bmp, int x, int y, int w, int h, COLOR32 color);
void DrawIcon(HICON hic, int x, int y, int w = 0, int h = 0);
- void Draw_Text(TCHAR *str, int x, int y);
+ void Draw_Text(wchar_t *str, int x, int y);
__forceinline COLOR32 *getBits() { return bits; }
__forceinline COLOR32 *getRow(int row) { return bits + row * width; }
diff --git a/plugins/Popup/src/config.cpp b/plugins/Popup/src/config.cpp index 29178f9182..233fcdf811 100644 --- a/plugins/Popup/src/config.cpp +++ b/plugins/Popup/src/config.cpp @@ -89,12 +89,12 @@ void LoadOptions() void PopupPreview()
{
- TCHAR *lptzTitle1Eng = TranslateT("The Jabberwocky");
- TCHAR *lptzText1Eng = TranslateT("`Twas brillig, and the slithy toves\r\nDid gyre and gimble in the wabe:\r\nAll mimsy were the borogoves,\r\nAnd the mome raths outgrabe.\r\n\t[b][i]Lewis Carroll, 1855[/i][/b]");
+ wchar_t *lptzTitle1Eng = TranslateT("The Jabberwocky");
+ wchar_t *lptzText1Eng = TranslateT("`Twas brillig, and the slithy toves\r\nDid gyre and gimble in the wabe:\r\nAll mimsy were the borogoves,\r\nAnd the mome raths outgrabe.\r\n\t[b][i]Lewis Carroll, 1855[/i][/b]");
- TCHAR *lptzTitle2 = TranslateT("Test preview for the popup plugin settings. This is supposed to be long enough not to fit in one line...");
- TCHAR *lptzText2 = TranslateTS(
- LPGENT("This is a special test preview for the popup plugin settings. The text and title are quite long so you can tweak your skin and plugin settings to best fit your needs :)")
+ wchar_t *lptzTitle2 = TranslateT("Test preview for the popup plugin settings. This is supposed to be long enough not to fit in one line...");
+ wchar_t *lptzText2 = TranslateTS(
+ LPGENW("This is a special test preview for the popup plugin settings. The text and title are quite long so you can tweak your skin and plugin settings to best fit your needs :)")
);
POPUPDATA2 ppd = { 0 };
diff --git a/plugins/Popup/src/config.h b/plugins/Popup/src/config.h index 60af91a679..34bc824053 100644 --- a/plugins/Popup/src/config.h +++ b/plugins/Popup/src/config.h @@ -193,7 +193,7 @@ typedef struct TestStruct{ } TESTSIZE;
// Generic Message Box for Errors
-#define MSGERROR(text) MessageBox(NULL, text, _T(MODULNAME_LONG), MB_OK | MB_ICONERROR)
-#define MSGINFO (text) MessageBox(NULL, text, _T(MODULNAME_LONG), MB_OK | MB_ICONINFORMATION)
+#define MSGERROR(text) MessageBox(NULL, text, MODULNAME_LONG, MB_OK | MB_ICONERROR)
+#define MSGINFO (text) MessageBox(NULL, text, MODULNAME_LONG, MB_OK | MB_ICONINFORMATION)
#endif // __config_h__
diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp index 5c76722063..56b9c26eca 100644 --- a/plugins/Popup/src/font.cpp +++ b/plugins/Popup/src/font.cpp @@ -30,44 +30,44 @@ void InitFonts() // Fonts
FontIDT fid = { 0 };
fid.cbSize = sizeof(FontIDT);
- mir_tstrncpy(fid.group, _T(PU_FNT_AND_COLOR), _countof(fid.group));
+ mir_tstrncpy(fid.group, PU_FNT_AND_COLORW, _countof(fid.group));
mir_strncpy(fid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, _countof(fid.dbSettingsGroup));
fid.flags = FIDF_DEFAULTVALID;
fid.deffontsettings.charset = DEFAULT_CHARSET;
fid.deffontsettings.size = -11;
- mir_tstrncpy(fid.backgroundGroup, _T(PU_FNT_AND_COLOR), _countof(fid.backgroundGroup));
+ mir_tstrncpy(fid.backgroundGroup, PU_FNT_AND_COLORW, _countof(fid.backgroundGroup));
mir_tstrncpy(fid.backgroundName, PU_COL_BACK_NAME, _countof(fid.backgroundName));
mir_tstrncpy(fid.deffontsettings.szFace, L"Tahoma", _countof(fid.deffontsettings.szFace));
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TITLE), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_TITLE, _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_TITLE);
fid.deffontsettings.style = DBFONTF_BOLD;
fid.deffontsettings.colour = RGB(0, 0, 0);
FontRegisterT(&fid);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_CLOCK), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_CLOCK, _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
FontRegisterT(&fid);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_TEXT, _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_TEXT);
fid.deffontsettings.style = 0;
FontRegisterT(&fid);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_ACTION), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_ACTION, _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_ACTION);
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
fid.deffontsettings.colour = RGB(0, 0, 255);
FontRegisterT(&fid);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_HOVERED_ACTION, _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION);
fid.deffontsettings.style = DBFONTF_UNDERLINE;
FontRegisterT(&fid);
ColourIDT cid = { 0 };
cid.cbSize = sizeof(ColourIDT);
- mir_tstrncpy(cid.group, _T(PU_FNT_AND_COLOR), _countof(cid.group));
+ mir_tstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group));
mir_strncpy(cid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, _countof(cid.dbSettingsGroup));
mir_tstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
@@ -95,35 +95,35 @@ void ReloadFonts() LOGFONT lf = { 0 };
FontIDT fid = { 0 };
fid.cbSize = sizeof(FontIDT);
- mir_tstrncpy(fid.group, _T(PU_FNT_AND_COLOR), _countof(fid.name));
+ mir_tstrncpy(fid.group, PU_FNT_AND_COLORW, _countof(fid.name));
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TITLE), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_TITLE, _countof(fid.name));
fonts.clTitle = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.title = CreateFontIndirect(&lf);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_CLOCK), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_CLOCK, _countof(fid.name));
fonts.clClock = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.clock = CreateFontIndirect(&lf);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_TEXT, _countof(fid.name));
fonts.clText = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.text = CreateFontIndirect(&lf);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_ACTION), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_ACTION, _countof(fid.name));
fonts.clAction = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.action = CreateFontIndirect(&lf);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_HOVERED_ACTION, _countof(fid.name));
fonts.clActionHover = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.actionHover = CreateFontIndirect(&lf);
ColourIDT cid = { 0 };
cid.cbSize = sizeof(ColourIDT);
- mir_tstrncpy(cid.group, _T(PU_FNT_AND_COLOR), _countof(cid.group));
+ mir_tstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group));
mir_tstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
fonts.clBack = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf);
- mir_tstrncpy(cid.group, _T(PU_FNT_AND_COLOR), _countof(cid.group));
+ mir_tstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group));
mir_tstrncpy(cid.name, PU_COL_AVAT_NAME, _countof(cid.name));
fonts.clAvatarBorder = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf);
diff --git a/plugins/Popup/src/font.h b/plugins/Popup/src/font.h index 0b6c53a307..0967bb4c12 100644 --- a/plugins/Popup/src/font.h +++ b/plugins/Popup/src/font.h @@ -25,26 +25,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define __font_h__
//basic constants for all popup plugins
-#define PU_FNT_AND_COLOR LPGEN("Popups") //common main group for customice\font&color
-#define PU_FNT_AND_COLOR_DB MODULNAME //use eg mir_strcpy(fid.dbSettingsGroup, PU_FNT_GROUP_DB);
+#define PU_FNT_AND_COLOR LPGEN("Popups") //common main group for customice\font&color
+#define PU_FNT_AND_COLORW LPGENW("Popups") //common main group for customice\font&color
+#define PU_FNT_AND_COLOR_DB MODULNAME //use eg mir_strcpy(fid.dbSettingsGroup, PU_FNT_GROUP_DB);
#define PU_FNT_PREFIX "fnt%s" //use eg mir_snprintf(fid.prefix, _countof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_....);
-#define PU_FNT_NAME_TITLE LPGEN("Title") //use eg mir_tstrcpy(fid.name, _T(FNT_NAME_....)) for FontIDT
-#define PU_FNT_NAME_CLOCK LPGEN("Clock")
-#define PU_FNT_NAME_TEXT LPGEN("Text")
-#define PU_FNT_NAME_ACTION LPGEN("Action")
-#define PU_FNT_NAME_HOVERED_ACTION LPGEN("Hovered action")
-
-#define PU_COL_BACK_NAME LPGENT("Background")
-#define PU_COL_BACK_SETTING "ColourBg"
-#define PU_COL_BORD_NAME LPGENT("Border")
-#define PU_COL_BORD_SETTING "ColourBorder"
-#define PU_COL_SIDE_NAME LPGENT("Sidebar")
-#define PU_COL_SIDE_SETTING "ColourSidebar"
-#define PU_COL_LINE_NAME LPGENT("Title underline")
-#define PU_COL_LINE_SETTING "ColourUnderline"
-#define PU_COL_AVAT_NAME LPGENT("Avatar border")
-#define PU_COL_AVAT_SETTING "ColourAvatarBorder"
+#define PU_FNT_NAME_TITLE LPGENW("Title") //use eg mir_tstrcpy(fid.name, _T(FNT_NAME_....)) for FontIDT
+#define PU_FNT_NAME_CLOCK LPGENW("Clock")
+#define PU_FNT_NAME_TEXT LPGENW("Text")
+#define PU_FNT_NAME_ACTION LPGENW("Action")
+#define PU_FNT_NAME_HOVERED_ACTION LPGENW("Hovered action")
+
+#define PU_COL_BACK_NAME LPGENW("Background")
+#define PU_COL_BACK_SETTING "ColourBg"
+#define PU_COL_BORD_NAME LPGENW("Border")
+#define PU_COL_BORD_SETTING "ColourBorder"
+#define PU_COL_SIDE_NAME LPGENW("Sidebar")
+#define PU_COL_SIDE_SETTING "ColourSidebar"
+#define PU_COL_LINE_NAME LPGENW("Title underline")
+#define PU_COL_LINE_SETTING "ColourUnderline"
+#define PU_COL_AVAT_NAME LPGENW("Avatar border")
+#define PU_COL_AVAT_SETTING "ColourAvatarBorder"
struct PopupFonts
{
diff --git a/plugins/Popup/src/formula.cpp b/plugins/Popup/src/formula.cpp index c328f32503..601d0e6cca 100644 --- a/plugins/Popup/src/formula.cpp +++ b/plugins/Popup/src/formula.cpp @@ -28,7 +28,7 @@ static inline bool myisspace(char ch) return (ch >= 0) && (ch <= 32);
}
-int Formula::eval_neq(TCHAR *&s, Args *args, bool *vars) const
+int Formula::eval_neq(wchar_t *&s, Args *args, bool *vars) const
{
int left = eval_sum(s, args, vars);
while (*s) {
@@ -50,7 +50,7 @@ int Formula::eval_neq(TCHAR *&s, Args *args, bool *vars) const return left;
}
-int Formula::eval_sum(TCHAR *&s, Args *args, bool *vars) const
+int Formula::eval_sum(wchar_t *&s, Args *args, bool *vars) const
{
int left = eval_mul(s, args, vars);
while (*s) {
@@ -68,7 +68,7 @@ int Formula::eval_sum(TCHAR *&s, Args *args, bool *vars) const return left;
}
-int Formula::eval_mul(TCHAR *&s, Args *args, bool *vars) const
+int Formula::eval_mul(wchar_t *&s, Args *args, bool *vars) const
{
int left = eval_atom(s, args, vars);
while (*s) {
@@ -91,7 +91,7 @@ int Formula::eval_mul(TCHAR *&s, Args *args, bool *vars) const return left;
}
-int Formula::eval_atom(TCHAR *&s, Args *args, bool *vars) const
+int Formula::eval_atom(wchar_t *&s, Args *args, bool *vars) const
{
while (*s) {
if (myisspace(*s)) {
@@ -137,7 +137,7 @@ int Formula::eval_atom(TCHAR *&s, Args *args, bool *vars) const int Formula::eval(Args *args, bool *vars) const
{
if (vars) *vars = false;
- TCHAR *s = m_str;
+ wchar_t *s = m_str;
int res = eval_neq(s, args, vars);
return res;
}
diff --git a/plugins/Popup/src/formula.h b/plugins/Popup/src/formula.h index a73908dd77..0abbc50565 100644 --- a/plugins/Popup/src/formula.h +++ b/plugins/Popup/src/formula.h @@ -72,17 +72,17 @@ public: };
private:
- TCHAR *m_str;
- int eval_neq(TCHAR *&s, Args *args, bool *vars) const;
- int eval_sum(TCHAR *&s, Args *args, bool *vars) const;
- int eval_mul(TCHAR *&s, Args *args, bool *vars) const;
- int eval_atom(TCHAR *&s, Args *args, bool *vars) const;
+ wchar_t *m_str;
+ int eval_neq(wchar_t *&s, Args *args, bool *vars) const;
+ int eval_sum(wchar_t *&s, Args *args, bool *vars) const;
+ int eval_mul(wchar_t *&s, Args *args, bool *vars) const;
+ int eval_atom(wchar_t *&s, Args *args, bool *vars) const;
public:
Formula() :m_str(mir_tstrdup(L"")) {}
- Formula(TCHAR *s) :m_str(mir_tstrdup(s)) {}
+ Formula(wchar_t *s) :m_str(mir_tstrdup(s)) {}
~Formula() { mir_free(m_str); }
- void set(TCHAR *s){ mir_free(m_str); m_str = mir_tstrdup(s); }
+ void set(wchar_t *s){ mir_free(m_str); m_str = mir_tstrdup(s); }
int eval(Args *args, bool *vars = 0) const;
};
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index 39e20dae06..ff38a8977a 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -148,14 +148,14 @@ INT_PTR svcEnableDisableMenuCommand(WPARAM, LPARAM) // The action to do is "disable popups" (show disabled) and we must write "enable popup" in the new item.
PopupOptions.ModuleIsEnabled = FALSE;
db_set_b(NULL, "Popup", "ModuleIsEnabled", FALSE);
- Menu_ModifyItem(hMenuItem, LPGENT("Enable Popups"), hIcon = GetIconHandle(IDI_NOPOPUP));
+ Menu_ModifyItem(hMenuItem, LPGENW("Enable Popups"), hIcon = GetIconHandle(IDI_NOPOPUP));
}
else {
// The module is disabled.
// The action to do is enable popups (show enabled), then write "disable popup" in the new item.
PopupOptions.ModuleIsEnabled = TRUE;
db_set_b(NULL, "Popup", "ModuleIsEnabled", TRUE);
- Menu_ModifyItem(hMenuItem, LPGENT("Disable Popups"), hIcon = GetIconHandle(IDI_POPUP));
+ Menu_ModifyItem(hMenuItem, LPGENW("Disable Popups"), hIcon = GetIconHandle(IDI_POPUP));
}
Menu_ModifyItem(hMenuRoot, NULL, hIcon);
@@ -180,14 +180,14 @@ void InitMenuItems(void) HANDLE hIcon = GetIconHandle(PopupOptions.ModuleIsEnabled ? IDI_POPUP : IDI_NOPOPUP);
// Build main menu
- hMenuRoot = mi.root = Menu_CreateRoot(MO_MAIN, LPGENT(MODULNAME_PLU), -1000000000, hIcon);
+ hMenuRoot = mi.root = Menu_CreateRoot(MO_MAIN, MODULNAME_PLUW, -1000000000, hIcon);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "3F5B5AB5-46D8-469E-8951-50B287C59037");
// Add item to main menu
SET_UID(mi, 0x4353d44e, 0x177, 0x4843, 0x88, 0x30, 0x25, 0x5d, 0x91, 0xad, 0xdf, 0x3f);
mi.pszService = MENUCOMMAND_SVC;
CreateServiceFunction(mi.pszService, svcEnableDisableMenuCommand);
- mi.name.t = PopupOptions.ModuleIsEnabled ? LPGENT("Disable Popups") : LPGENT("Enable Popups");
+ mi.name.w = PopupOptions.ModuleIsEnabled ? LPGENW("Disable Popups") : LPGENW("Enable Popups");
mi.hIcolibItem = hIcon;
hMenuItem = Menu_AddMainMenuItem(&mi);
@@ -196,7 +196,7 @@ void InitMenuItems(void) mi.pszService = MENUCOMMAND_HISTORY;
CreateServiceFunction(mi.pszService, svcShowHistory);
mi.position = 1000000000;
- mi.name.t = LPGENT("Popup History");
+ mi.name.w = LPGENW("Popup History");
mi.hIcolibItem = GetIconHandle(IDI_HISTORY);
hMenuItemHistory = Menu_AddMainMenuItem(&mi);
}
@@ -213,14 +213,14 @@ void LoadHotkey() HOTKEYDESC hk = { sizeof(hk) };
hk.dwFlags = HKD_TCHAR;
hk.pszName = "Toggle Popups";
- hk.ptszDescription = LPGENT("Toggle Popups");
- hk.ptszSection = LPGENT(MODULNAME_PLU);
+ hk.ptszDescription = LPGENW("Toggle Popups");
+ hk.ptszSection = MODULNAME_PLUW;
hk.pszService = MENUCOMMAND_SVC;
Hotkey_Register(&hk);
// 'Popup History' Hotkey
hk.pszName = "Popup History";
- hk.ptszDescription = LPGENT("Popup History");
+ hk.ptszDescription = LPGENW("Popup History");
hk.pszService = MENUCOMMAND_HISTORY;
Hotkey_Register(&hk);
}
@@ -339,7 +339,7 @@ MIRAPI int Load(void) PopupHistoryLoad();
LoadPopupThread();
if (!LoadPopupWnd2()) {
- MessageBox(0, TranslateT("Error: I could not register the Popup Window class.\r\nThe plugin will not operate."), _T(MODULNAME_LONG), MB_ICONSTOP | MB_OK);
+ MessageBox(0, TranslateT("Error: I could not register the Popup Window class.\r\nThe plugin will not operate."), MODULNAME_LONG, MB_ICONSTOP | MB_OK);
return 0; // We couldn't register our Window Class, don't hook any event: the plugin will act as if it was disabled.
}
RegisterOptPrevBox();
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index be9c78a595..9958db8c7d 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -87,7 +87,7 @@ void UnloadTreeData() gTreeData.destroy();
}
-void SaveNotificationSettings(POPUPTREEDATA *ptd, char* szModul)
+void SaveNotificationSettings(POPUPTREEDATA *ptd, char *szModul)
{
if (ptd->typ == 1) {
char setting[2 * MAXMODULELABELLENGTH];
@@ -137,7 +137,6 @@ void LoadNotificationSettings(POPUPTREEDATA *ptd, char* szModul) {
if (ptd->typ == 1) {
char setting[2 * MAXMODULELABELLENGTH];
- char *szTmp = NULL;
mir_snprintf(setting, "{%s/%s}enabled", ptd->notification.lpzGroup, ptd->notification.lpzName);
ptd->enabled =
@@ -157,7 +156,7 @@ void LoadNotificationSettings(POPUPTREEDATA *ptd, char* szModul) db_get_b(NULL, szModul, setting, 0);
mir_snprintf(setting, "{%s/%s}leftAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
- szTmp = db_get_s(NULL, szModul, setting, ptd->notification.lpzLAction);
+ char *szTmp = db_get_s(NULL, szModul, setting, ptd->notification.lpzLAction);
mir_strncpy(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
mir_free(szTmp); szTmp = NULL;
@@ -186,7 +185,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) FontID fontid = { 0 };
fontid.cbSize = sizeof(fontid);
- mir_snprintf(fontid.group, PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
+ mir_snprintf(fontid.group, PU_FNT_AND_COLOR "/%s", notification->lpzGroup);
mir_strcpy(fontid.dbSettingsGroup, "PopupNotifications");
fontid.flags = FIDF_DEFAULTVALID;
fontid.deffontsettings.charset = DEFAULT_CHARSET;
@@ -297,7 +296,7 @@ bool PerformAction(HANDLE hNotification, HWND hwnd, UINT message, WPARAM wparam, }
for (int i = 0; i < ptd->notification.actionCount; ++i) {
- if (!(ptd->notification.lpActions[i].dwFlags&PNAF_CALLBACK))
+ if (!(ptd->notification.lpActions[i].dwFlags & PNAF_CALLBACK))
continue;
if (mir_strcmp(ptd->notification.lpActions[i].lpzTitle, lpzAction))
continue;
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp index 48c3c75b59..323bd1ce7b 100644 --- a/plugins/Popup/src/opt_adv.cpp +++ b/plugins/Popup/src/opt_adv.cpp @@ -29,7 +29,7 @@ LRESULT CALLBACK AvatarTrackBarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP LRESULT CALLBACK AlphaTrackBarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
// effekt name for drop down box
-LIST<TCHAR> g_lstPopupVfx(5, _tcsicmp);
+LIST<wchar_t> g_lstPopupVfx(5, wcsicmp);
void OptAdv_RegisterVfx(char *name)
{
g_lstPopupVfx.insert(mir_a2t(name));
@@ -78,7 +78,7 @@ void LoadOption_AdvOpts() INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR tstr[64];
+ wchar_t tstr[64];
static bool bDlgInit = false; // some controls send WM_COMMAND before or during WM_INITDIALOG
UINT idCtrl;
@@ -88,7 +88,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM {
hwndBox = CreateWindowEx(
WS_EX_TOOLWINDOW | WS_EX_TOPMOST, // dwStyleEx
- _T(BOXPREVIEW_WNDCLASS), // Class name
+ BOXPREVIEW_WNDCLASS, // Class name
NULL, // Title
DS_SETFONT | DS_FIXEDSYS | WS_POPUP, // dwStyle
CW_USEDEFAULT, // x
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp index abfb394d88..170603d799 100644 --- a/plugins/Popup/src/opt_class.cpp +++ b/plugins/Popup/src/opt_class.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //---------------------------------------------------------------------------
// Workaround for MS bug ComboBox_SelectItemData
-int ComboBox_SelectItem(HWND hwndCtl, char* data) {
+int ComboBox_SelectItem(HWND hwndCtl, char *data) {
int i = 0;
for (i; i < ComboBox_GetCount(hwndCtl); i++) {
if (mir_strcmp(data, (char*)ComboBox_GetItemData(hwndCtl, i)) == 0) {
@@ -186,7 +186,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l for (i = 0; i < gTreeData.getCount(); ++i) {
POPUPTREEDATA *p = gTreeData[i];
- TCHAR itemName[MAXMODULELABELLENGTH];
+ wchar_t itemName[MAXMODULELABELLENGTH];
int iconIndex;
if (p->typ == 1) { // Treeview part for typ 1 (notification)
@@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l }
else { // Treeview part typ 2 (popup class api)
iconIndex = ImageList_ReplaceIcon(hImgLst, -1, p->pupClass.hIcon);
- mir_sntprintf(itemName, L"%s/%s", LPGENT("CLASS Plugins"), p->pszDescription);
+ mir_sntprintf(itemName, L"%s/%s", LPGENW("CLASS Plugins"), p->pszDescription);
}
OptTree_AddItem(hwndTree, itemName, (LPARAM)p, iconIndex);
}
@@ -396,14 +396,14 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l switch (idCtrl) {
case IDC_LACTION:
mir_strncpy(ptd->leftAction,
- (char *)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)),
- sizeof(ptd->leftAction));
+ (char*)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)),
+ _countof(ptd->leftAction));
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
case IDC_RACTION:
mir_strncpy(ptd->rightAction,
- (char *)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)),
- sizeof(ptd->rightAction));
+ (char*)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)),
+ _countof(ptd->rightAction));
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
}
@@ -490,8 +490,6 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l void LoadClassSettings(POPUPTREEDATA *ptd, char* szModul)
{
char setting[2 * MAXMODULELABELLENGTH];
- char *szTmp = NULL;
-
mir_snprintf(setting, "%s/enabled", ptd->pupClass.pszName);
ptd->enabled =
(signed char)db_get_b(NULL, szModul, setting, TRUE);
@@ -506,14 +504,14 @@ void LoadClassSettings(POPUPTREEDATA *ptd, char* szModul) ptd->pupClass.iSeconds ? ptd->pupClass.iSeconds : PopupOptions.Seconds);
mir_snprintf(setting, "%s/leftAction", ptd->pupClass.pszName);
- szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_NOTHING); // standart ??
- mir_strncpy(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
- mir_free(szTmp); szTmp = NULL;
+ char *szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_NOTHING); // standart ??
+ mir_strncpy(ptd->leftAction, szTmp, _countof(ptd->leftAction));
+ mir_free(szTmp);
mir_snprintf(setting, "%s/rightAction", ptd->pupClass.pszName);
szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_DISMISS); // standart ??
- mir_strncpy(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
- mir_free(szTmp); szTmp = NULL;
+ mir_strncpy(ptd->rightAction, szTmp, _countof(ptd->rightAction));
+ mir_free(szTmp);
}
void SaveClassSettings(POPUPTREEDATA *ptd, char* szModul)
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index d10a95f507..70272f8176 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -47,7 +47,7 @@ int AddStatusMode(OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flag) if (!flag) return pos;
options[pos].dwFlag = flag;
options[pos].groupId = OPTTREE_CHECK;
- options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR) * mir_tstrlen(prefix) + 32);
+ options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(wchar_t) * mir_tstrlen(prefix) + 32);
options[pos].pszSettingName = mir_tstrdup(prefix);
options[pos].iconIndex = 0;
@@ -55,16 +55,16 @@ int AddStatusMode(OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flag) mir_tstrcat(options[pos].pszOptionName, L"/");
switch (flag)
{
- case PF2_IDLE: mir_tstrcat(options[pos].pszOptionName, LPGENT("Offline")); break;
- case PF2_ONLINE: mir_tstrcat(options[pos].pszOptionName, LPGENT("Online")); break;
- case PF2_INVISIBLE: mir_tstrcat(options[pos].pszOptionName, LPGENT("Invisible")); break;
- case PF2_SHORTAWAY: mir_tstrcat(options[pos].pszOptionName, LPGENT("Away")); break;
- case PF2_LONGAWAY: mir_tstrcat(options[pos].pszOptionName, LPGENT("Not available")); break;
- case PF2_LIGHTDND: mir_tstrcat(options[pos].pszOptionName, LPGENT("Occupied")); break;
- case PF2_HEAVYDND: mir_tstrcat(options[pos].pszOptionName, LPGENT("Do not disturb")); break;
- case PF2_FREECHAT: mir_tstrcat(options[pos].pszOptionName, LPGENT("Free for chat")); break;
- case PF2_OUTTOLUNCH: mir_tstrcat(options[pos].pszOptionName, LPGENT("Out to lunch")); break;
- case PF2_ONTHEPHONE: mir_tstrcat(options[pos].pszOptionName, LPGENT("On the phone")); break;
+ case PF2_IDLE: mir_tstrcat(options[pos].pszOptionName, LPGENW("Offline")); break;
+ case PF2_ONLINE: mir_tstrcat(options[pos].pszOptionName, LPGENW("Online")); break;
+ case PF2_INVISIBLE: mir_tstrcat(options[pos].pszOptionName, LPGENW("Invisible")); break;
+ case PF2_SHORTAWAY: mir_tstrcat(options[pos].pszOptionName, LPGENW("Away")); break;
+ case PF2_LONGAWAY: mir_tstrcat(options[pos].pszOptionName, LPGENW("Not available")); break;
+ case PF2_LIGHTDND: mir_tstrcat(options[pos].pszOptionName, LPGENW("Occupied")); break;
+ case PF2_HEAVYDND: mir_tstrcat(options[pos].pszOptionName, LPGENW("Do not disturb")); break;
+ case PF2_FREECHAT: mir_tstrcat(options[pos].pszOptionName, LPGENW("Free for chat")); break;
+ case PF2_OUTTOLUNCH: mir_tstrcat(options[pos].pszOptionName, LPGENW("Out to lunch")); break;
+ case PF2_ONTHEPHONE: mir_tstrcat(options[pos].pszOptionName, LPGENW("On the phone")); break;
}
return pos + 1;
}
@@ -151,7 +151,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM // Dynamic Resize
CheckDlgButton(hwnd, IDC_DYNAMICRESIZE, PopupOptions.DynamicResize ? BST_CHECKED : BST_UNCHECKED);
- SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.DynamicResize ? LPGENT("Maximum width") : LPGENT("Width"));
+ SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.DynamicResize ? LPGENW("Maximum width") : LPGENW("Width"));
// Minimum Width
CheckDlgButton(hwnd, IDC_USEMINIMUMWIDTH, PopupOptions.UseMinimumWidth ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwnd, IDC_MINIMUMWIDTH_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_MAXIMUMWIDTH_MAX, SETTING_MINIMUMWIDTH_MIN));
@@ -217,15 +217,15 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM statusOptions = new OPTTREE_OPTION[statusOptionsCount];
- int pos = AddStatusModes(statusOptions, 0, LPGENT("Global Status"), globalFlags);
+ int pos = AddStatusModes(statusOptions, 0, LPGENW("Global Status"), globalFlags);
for (int i = 0; i < protocolCount; ++i) {
if (!protocols[i]->bIsVirtual) {
DWORD protoFlags = CallProtoService(protocols[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0);
if (!CountStatusModes(protoFlags))
continue;
- TCHAR prefix[128];
- mir_sntprintf(prefix, LPGENT("Protocol Status")L"/%s", protocols[i]->tszAccountName);
+ wchar_t prefix[128];
+ mir_sntprintf(prefix, LPGENW("Protocol Status")L"/%s", protocols[i]->tszAccountName);
pos = AddStatusModes(statusOptions, pos, prefix, protoFlags);
}
}
@@ -242,12 +242,12 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM char prefix[128];
mir_snprintf(prefix, "Protocol Status/%s", protocols[i]->szModuleName);
- TCHAR pszSettingName[256];
- mir_sntprintf(pszSettingName, LPGENT("Protocol Status")L"/%s", protocols[i]->tszAccountName);
+ wchar_t pszSettingName[256];
+ mir_sntprintf(pszSettingName, LPGENW("Protocol Status")L"/%s", protocols[i]->tszAccountName);
OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, prefix, 0), pszSettingName);
}
}
- OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, "Global Status", 0), LPGENT("Global Status"));
+ OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, "Global Status", 0), LPGENW("Global Status"));
}
TranslateDialogDefault(hwnd); // do it on end of WM_INITDIALOG
@@ -528,7 +528,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM char prefix[128];
mir_snprintf(prefix, "Protocol Status/%s", protocols[i]->szModuleName);
- TCHAR pszSettingName[256];
+ wchar_t pszSettingName[256];
mir_sntprintf(pszSettingName, L"Protocol Status/%s", protocols[i]->tszAccountName);
db_set_dw(NULL, MODULNAME, prefix, OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, pszSettingName));
}
@@ -580,7 +580,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM void ErrorMSG(int minValue, int maxValue)
{
- TCHAR str[128];
+ wchar_t str[128];
mir_sntprintf(str, TranslateT("You cannot specify a value lower than %d and higher than %d."), minValue, maxValue);
MSGERROR(str);
}
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp index 867d70319b..a86b82c380 100644 --- a/plugins/Popup/src/opt_skins.cpp +++ b/plugins/Popup/src/opt_skins.cpp @@ -42,12 +42,12 @@ void RegisterOptPrevBox() wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
wcl.hbrBackground = NULL; // (HBRUSH)GetStockObject(LTGRAY_BRUSH);
wcl.lpszMenuName = NULL;
- wcl.lpszClassName = _T(BOXPREVIEW_WNDCLASS);
+ wcl.lpszClassName = BOXPREVIEW_WNDCLASS;
wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
g_wndClass.cPopupPreviewBoxWndclass = RegisterClassEx(&wcl);
err = GetLastError();
if (!g_wndClass.cPopupPreviewBoxWndclass) {
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
@@ -61,7 +61,7 @@ void RegisterOptPrevBox() g_wndClass.cPopupPlusDlgBox = RegisterClassEx(&wcl);
err = GetLastError();
if (!g_wndClass.cPopupPlusDlgBox) {
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
@@ -185,7 +185,7 @@ int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos options[pos].groupId = OPTTREE_CHECK;
options[pos].iconIndex = 0;
options[pos].pszSettingName = mir_tstrdup(L"Skin options");
- options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*(
+ options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(wchar_t)*(
mir_tstrlen(options[pos].pszSettingName) +
mir_strlen(skin->getFlagName(i)) + 10));
wsprintf(options[pos].pszOptionName, L"%s/%hs", options[pos].pszSettingName, skin->getFlagName(i)); // !!!!!!!!!!!!!
@@ -201,12 +201,12 @@ int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos /////////////////////////////////////////////////////////////////////////////////////////
static LPTSTR mainOption[] = {
- LPGENT("Show clock"),
- LPGENT("Drop shadow effect"),
- LPGENT("Drop shadow effect") L"/" LPGENT("non rectangular"),
- LPGENT("Enable Aero Glass (Vista+)"),
- LPGENT("Use Windows colors"),
- LPGENT("Use advanced text render") };
+ LPGENW("Show clock"),
+ LPGENW("Drop shadow effect"),
+ LPGENW("Drop shadow effect") L"/" LPGENW("non rectangular"),
+ LPGENW("Enable Aero Glass (Vista+)"),
+ LPGENW("Use Windows colors"),
+ LPGENW("Use advanced text render") };
int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos, DWORD *dwGlobalOptions)
{
@@ -245,8 +245,8 @@ int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos, options[pos].dwFlag = (1 << i);
options[pos].groupId = OPTTREE_CHECK;
options[pos].iconIndex = 0;
- options[pos].pszSettingName = mir_tstrdup(LPGENT("Global settings"));
- options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*(
+ options[pos].pszSettingName = mir_tstrdup(LPGENW("Global settings"));
+ options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(wchar_t)*(
mir_tstrlen(options[pos].pszSettingName) +
mir_tstrlen(mainOption[i]) + 10));
wsprintf(options[pos].pszOptionName, L"%s/%s", options[pos].pszSettingName, mainOption[i]); // !!!!!!!!!!!!!
@@ -403,7 +403,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR break;
case IDC_BTN_RELOAD:
- LPTSTR pszOldSkin = NEWTSTR_ALLOCA(PopupOptions.SkinPack);
+ LPTSTR pszOldSkin = NEWWSTR_ALLOCA(PopupOptions.SkinPack);
skins.load();
hCtrl = GetDlgItem(hwndDlg, IDC_SKINLIST);
ListBox_ResetContent(hCtrl);
@@ -414,7 +414,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR ListBox_SetCurSel(hCtrl, ListBox_FindString(hCtrl, 0, PopupOptions.SkinPack));
// make shure we have select skin (ListBox_SetCurSel may be fail)
- TCHAR szNewSkin[128];
+ wchar_t szNewSkin[128];
ListBox_GetText(hCtrl, ListBox_GetCurSel(hCtrl), &szNewSkin);
if (mir_tstrcmp(pszOldSkin, szNewSkin) != 0) {
mir_free(PopupOptions.SkinPack);
@@ -440,7 +440,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR {
// Skin list change
mir_free(PopupOptions.SkinPack);
- PopupOptions.SkinPack = mir_tstrdup((TCHAR *)SendDlgItemMessage(
+ PopupOptions.SkinPack = mir_tstrdup((wchar_t *)SendDlgItemMessage(
hwndDlg,
IDC_SKINLIST,
LB_GETITEMDATA,
@@ -550,12 +550,12 @@ static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode) rc.left += 30; // 10+16+4 -- icon
rc.right -= (rc.right - rc.left) / 3;
rc.bottom -= (rc.bottom - rc.top) / 3;
- DrawText(mydc, _T(MODULNAME_LONG), -1, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
+ DrawText(mydc, MODULNAME_LONG, -1, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
GetClientRect(hwnd, &rc);
rc.left += 30; // 10+16+4 -- icon
rc.left += (rc.right - rc.left) / 3;
rc.top += (rc.bottom - rc.top) / 3;
- DrawText(mydc, _T(MODULNAME_LONG), -1, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
+ DrawText(mydc, MODULNAME_LONG, -1, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
GetClientRect(hwnd, &rc);
FrameRect(mydc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
SelectObject(mydc, hfnt);
diff --git a/plugins/Popup/src/opt_skins.h b/plugins/Popup/src/opt_skins.h index 6179ad35fb..e6200d6e25 100644 --- a/plugins/Popup/src/opt_skins.h +++ b/plugins/Popup/src/opt_skins.h @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef CS_DROPSHADOW
#define CS_DROPSHADOW 0x00020000
#endif
-#define BOXPREVIEW_WNDCLASS "PopupPreviewBoxWndclass"
+#define BOXPREVIEW_WNDCLASS L"PopupPreviewBoxWndclass"
void RegisterOptPrevBox();
diff --git a/plugins/Popup/src/opttree.cpp b/plugins/Popup/src/opttree.cpp index 1bacdf0212..c86ec17fb2 100644 --- a/plugins/Popup/src/opttree.cpp +++ b/plugins/Popup/src/opttree.cpp @@ -27,7 +27,7 @@ enum { IMG_GROUP, IMG_CHECK, IMG_NOCHECK, IMG_RCHECK, IMG_NORCHECK, IMG_GRPOPEN, static void OptTree_TranslateItem(HWND hwndTree, HTREEITEM hItem)
{
- TCHAR buf[64];
+ wchar_t buf[64];
TVITEM tvi = { 0 };
tvi.mask = TVIF_HANDLE | TVIF_TEXT;
@@ -65,10 +65,10 @@ void OptTree_Translate(HWND hwndTree) }
}
-HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHAR *name)
+HTREEITEM OptTree_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);
@@ -95,9 +95,9 @@ HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHA HTREEITEM OptTree_AddItem(HWND hwndTree, LPTSTR name, LPARAM lParam, int iconIndex)
{
- TCHAR itemName[1024];
+ wchar_t itemName[1024];
- TCHAR *sectionName;
+ wchar_t *sectionName;
int sectionLevel = 0;
HTREEITEM hSection = NULL, result = NULL;
@@ -106,10 +106,10 @@ HTREEITEM OptTree_AddItem(HWND hwndTree, LPTSTR name, LPARAM lParam, int iconInd 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;
sectionName++;
@@ -154,7 +154,7 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, int *res case WM_INITDIALOG:
{
int indx;
- TCHAR itemName[1024];
+ wchar_t itemName[1024];
HIMAGELIST hImgLst;
TreeView_SelectItem(hwndTree, NULL);
@@ -172,7 +172,7 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, int *res /* build options tree. based on code from IcoLib */
for (indx = 0; indx < optionCount; indx++) {
- TCHAR *sectionName;
+ wchar_t *sectionName;
int sectionLevel = 0;
HTREEITEM hSection = NULL;
@@ -181,10 +181,10 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, int *res 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;
sectionName++;
diff --git a/plugins/Popup/src/popup_gdiplus.cpp b/plugins/Popup/src/popup_gdiplus.cpp index 0f6212d7e9..4c788a0679 100644 --- a/plugins/Popup/src/popup_gdiplus.cpp +++ b/plugins/Popup/src/popup_gdiplus.cpp @@ -99,7 +99,7 @@ HBITMAP SkinEngine_CreateDIB32(int cx, int cy) }
-BOOL GDIPlus_IsAnimatedGIF(TCHAR * szName)
+BOOL GDIPlus_IsAnimatedGIF(wchar_t * szName)
{
int nFrameCount = 0;
Image image(szName);
@@ -118,7 +118,7 @@ BOOL GDIPlus_IsAnimatedGIF(TCHAR * szName) return (BOOL)(nFrameCount > 1) && image.GetWidth() && image.GetHeight();
}
-void GDIPlus_GetGIFSize(TCHAR *szName, int *width, int *height)
+void GDIPlus_GetGIFSize(wchar_t *szName, int *width, int *height)
{
Image image(szName);
@@ -126,7 +126,7 @@ void GDIPlus_GetGIFSize(TCHAR *szName, int *width, int *height) *height = image.GetHeight();
}
-void GDIPlus_ExtractAnimatedGIF(TCHAR *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar)
+void GDIPlus_ExtractAnimatedGIF(wchar_t *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar)
{
int nFrameCount = 0;
Bitmap image(szName);
diff --git a/plugins/Popup/src/popup_gdiplus.h b/plugins/Popup/src/popup_gdiplus.h index bd67c5efd2..a398e686f9 100644 --- a/plugins/Popup/src/popup_gdiplus.h +++ b/plugins/Popup/src/popup_gdiplus.h @@ -26,8 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void LoadGDIPlus();
void UnloadGDIPlus();
-BOOL GDIPlus_IsAnimatedGIF(TCHAR * szName);
-void GDIPlus_GetGIFSize(TCHAR * szName, int * width, int * height);
-void GDIPlus_ExtractAnimatedGIF(TCHAR *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar);
+BOOL GDIPlus_IsAnimatedGIF(wchar_t * szName);
+void GDIPlus_GetGIFSize(wchar_t * szName, int * width, int * height);
+void GDIPlus_ExtractAnimatedGIF(wchar_t *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar);
#endif // __popup_gdiplus_h__
diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp index 6b2a5e70bd..a2a42b263d 100644 --- a/plugins/Popup/src/popup_thread.cpp +++ b/plugins/Popup/src/popup_thread.cpp @@ -231,7 +231,7 @@ static unsigned __stdcall PopupThread(void *) g_wndClass.cPopupThreadManagerWnd = RegisterClassEx(&wcl);
err = GetLastError();
if (!g_wndClass.cPopupThreadManagerWnd) {
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index 1527c641de..b64c225c26 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "bitmap_funcs.h"
#include <math.h>
-#define POPUP_WNDCLASS "PopupWnd2"
+#define POPUP_WNDCLASS L"PopupWnd2"
#ifndef CS_DROPSHADOW
#define CS_DROPSHADOW 0x00020000
@@ -54,15 +54,15 @@ bool LoadPopupWnd2() wcl.hInstance = hInst;
wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
- wcl.lpszClassName = _T(POPUP_WNDCLASS);
+ wcl.lpszClassName = POPUP_WNDCLASS;
wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
g_wndClass.cPopupWnd2 = RegisterClassEx(&wcl);
DWORD err = GetLastError();
if (!g_wndClass.cPopupWnd2) {
res = false;
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
- MessageBox(NULL, msg, _T(MODULNAME_LONG), MB_ICONSTOP | MB_OK);
+ MessageBox(NULL, msg, MODULNAME_LONG, MB_ICONSTOP | MB_OK);
}
WNDCLASSEX wclw = { 0 };
@@ -75,7 +75,7 @@ bool LoadPopupWnd2() g_wndClass.cPopupEditBox = RegisterClassEx(&wclw);
err = GetLastError();
if (!g_wndClass.cPopupEditBox) {
- TCHAR msg[2048];
+ wchar_t msg[2048];
mir_sntprintf(msg, TranslateT("Failed to register custom edit box window class.\r\n\r\ncbSize: %i\r\nstyle: %p\r\nlpfnWndProc: %i\r\ncbClsExtra: %i\r\ncbWndExtra: %i\r\nhInstance: %i\r\nhIcon: %i\r\nhCursor: %i\r\nhbrBackground: %i\r\nlpszMenuName: %s\r\nlpszClassName: %s\r\nhIconSm: %i\r\n"),
wclw.cbSize, wclw.style, wclw.lpfnWndProc, wclw.cbClsExtra, wclw.cbWndExtra, wclw.hInstance, wclw.hIcon, wclw.hCursor,
wclw.hbrBackground, wclw.lpszMenuName, wclw.lpszClassName, wclw.hIconSm);
@@ -100,7 +100,7 @@ bool LoadPopupWnd2() err = GetLastError();
if (!g_wndClass.cPopupMenuHostWnd) {
res = false;
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
@@ -166,7 +166,7 @@ void PopupWnd2::create() m_hwnd = CreateWindowEx(
WS_EX_TRANSPARENT | // prevents unwanted clicks
WS_EX_TOOLWINDOW | WS_EX_TOPMOST, // dwStyleEx
- _T(POPUP_WNDCLASS), // Class name
+ POPUP_WNDCLASS, // Class name
NULL, // Title
DS_SETFONT | DS_FIXEDSYS | WS_POPUP, // dwStyle
CW_USEDEFAULT, // x
@@ -485,7 +485,7 @@ void PopupWnd2::hide() // hwnd = 0;
}
-bool __forceinline isTextEmpty(TCHAR *text)
+bool __forceinline isTextEmpty(wchar_t *text)
{
if (!text)
return true;
@@ -765,7 +765,7 @@ void PopupWnd2::buildMText() }
}
-void PopupWnd2::updateText(TCHAR *text)
+void PopupWnd2::updateText(wchar_t *text)
{
if (m_lptzText) {
replaceStrT(m_lptzText, text);
@@ -775,7 +775,7 @@ void PopupWnd2::updateText(TCHAR *text) m_bTextEmpty = ::isTextEmpty(m_lptzText);
}
-void PopupWnd2::updateTitle(TCHAR *title)
+void PopupWnd2::updateTitle(wchar_t *title)
{
if (m_lptzTitle) {
replaceStrT(m_lptzTitle, title);
@@ -831,7 +831,7 @@ LRESULT CALLBACK ReplyEditWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM case WM_KEYDOWN:
switch (wParam) {
case VK_RETURN:
- TCHAR msg[2048];
+ wchar_t msg[2048];
GetWindowText(hwnd, msg, _countof(msg));
if (mir_wstrlen(msg) == 0) {
DestroyWindow(hwnd);
@@ -983,8 +983,8 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara if (OpenClipboard(m_hwnd)) {
EmptyClipboard();
- HGLOBAL clipbuffer = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, (tszText.GetLength() + 1) * sizeof(TCHAR));
- TCHAR *buffer = (TCHAR *)GlobalLock(clipbuffer);
+ HGLOBAL clipbuffer = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, (tszText.GetLength() + 1) * sizeof(wchar_t));
+ wchar_t *buffer = (wchar_t *)GlobalLock(clipbuffer);
mir_tstrcpy(buffer, tszText);
GlobalUnlock(clipbuffer);
SetClipboardData(CF_UNICODETEXT, clipbuffer);
@@ -1132,8 +1132,8 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara case UM_CHANGEPOPUP:
switch (wParam) {
- case CPT_TEXTW: updateText((TCHAR *)lParam); mir_free((void *)lParam); break;
- case CPT_TITLEW: updateTitle((TCHAR *)lParam); mir_free((void *)lParam); break;
+ case CPT_TEXTW: updateText((wchar_t *)lParam); mir_free((void *)lParam); break;
+ case CPT_TITLEW: updateTitle((wchar_t *)lParam); mir_free((void *)lParam); break;
case CPT_DATAW: updateData((POPUPDATAW_V2 *)lParam); mir_free((void *)lParam); break;
}
update();
diff --git a/plugins/Popup/src/popup_wnd2.h b/plugins/Popup/src/popup_wnd2.h index 7e0af55bd4..96bf23ff97 100644 --- a/plugins/Popup/src/popup_wnd2.h +++ b/plugins/Popup/src/popup_wnd2.h @@ -54,13 +54,13 @@ private: // content
TextType m_textType;
- TCHAR *m_lptzTitle, *m_lptzText;
+ wchar_t *m_lptzTitle, *m_lptzText;
HANDLE m_mtTitle, m_mtText;
bool m_bTextEmpty, m_bIcoLib;
HFONT m_hfnTitle, m_hfnText;
HICON m_hIcon;
HBITMAP m_hbmAvatar;
- TCHAR m_time[2 + 1 + 2 + 1];
+ wchar_t m_time[2 + 1 + 2 + 1];
ActionInfo* m_actions;
int m_actionCount;
HANDLE m_hNotification;
@@ -131,8 +131,8 @@ public: void updateData(POPUPDATAW_V2 *ppd);
void updateData(POPUPDATA2 *ppd);
void buildMText();
- void updateText(TCHAR *text);
- void updateTitle(TCHAR *title);
+ void updateText(wchar_t *text);
+ void updateTitle(wchar_t *title);
void updateTimer();
@@ -146,15 +146,15 @@ public: bool isTextEmpty() { return m_bTextEmpty; }
bool isIcolib() { return m_bIcoLib; }
TextType getTextType() { return m_textType; }
- TCHAR *getText() { return m_lptzText; }
+ wchar_t *getText() { return m_lptzText; }
HANDLE getTextM() { return m_mtText; }
- TCHAR *getTitle() { return m_lptzTitle; }
+ wchar_t *getTitle() { return m_lptzTitle; }
HANDLE getTitleM() { return m_mtTitle; }
int getActionCount() { return m_actionCount; }
ActionInfo *getActions() { return m_actions; }
- TCHAR *getTime() { return m_time; }
+ wchar_t *getTime() { return m_time; }
HICON getIcon() { return m_hIcon; }
MCONTACT getContact() { return m_hContact; }
MCONTACT getContactPassed() { return m_hContactPassed; }
@@ -210,8 +210,8 @@ public: LRESULT m_updateData_POPUPDATAW_V2(LPARAM arg) { updateData((POPUPDATAW_V2 *)arg); update(); return 0; }
LRESULT m_updateData_POPUPDATA2(LPARAM arg) { updateData((POPUPDATA2 *)arg); update(); return 0; }
- LRESULT m_updateText(LPARAM arg) { updateText((TCHAR *)arg); update(); return 0; }
- LRESULT m_updateTitle(LPARAM arg) { updateTitle((TCHAR *)arg); update(); return 0; }
+ LRESULT m_updateText(LPARAM arg) { updateText((wchar_t *)arg); update(); return 0; }
+ LRESULT m_updateTitle(LPARAM arg) { updateTitle((wchar_t *)arg); update(); return 0; }
LRESULT m_show(LPARAM) { show(); return 0; }
LRESULT m_hide(LPARAM) { hide(); return 0; }
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index ce5b1da030..676ac0beab 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -237,7 +237,7 @@ INT_PTR Popup_ShowMessageW(WPARAM wParam, LPARAM lParam) POPUPDATA2 ppd2 = { 0 };
ppd2.cbSize = sizeof(ppd2);
ppd2.flags = PU2_UNICODE;
- ppd2.lptzText = (TCHAR*)wParam;
+ ppd2.lptzText = (wchar_t*)wParam;
switch (lParam & 0x7fffffff) {
case SM_ERROR:
ppd2.lchIcon = LoadIconEx(IDI_MB_STOP, 0);
@@ -381,13 +381,13 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) ptd->pupClass.colorText = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, fonts.clText/*pc->colorText*/);
FontIDT fid = { 0 };
fid.cbSize = sizeof(FontIDT);
- mir_sntprintf(fid.group, _T(PU_FNT_AND_COLOR)L"/%S", ptd->pupClass.pszName);
+ mir_sntprintf(fid.group, _A2W(PU_FNT_AND_COLOR) L"/%S", ptd->pupClass.pszName);
mir_strncpy(fid.dbSettingsGroup, PU_MODULCLASS, _countof(fid.dbSettingsGroup) - 1);
fid.flags = FIDF_DEFAULTVALID;
fid.deffontsettings.charset = DEFAULT_CHARSET;
fid.deffontsettings.size = -11;
mir_tstrncpy(fid.deffontsettings.szFace, L"Verdana", _countof(fid.deffontsettings.szFace) - 1);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), _countof(fid.name) - 1);
+ mir_tstrncpy(fid.name, PU_FNT_NAME_TEXT, _countof(fid.name) - 1);
mir_strncpy(fid.prefix, setting, _countof(fid.prefix));
mir_snprintf(fid.prefix, "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol"
fid.deffontsettings.style = 0;
@@ -399,7 +399,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) ptd->pupClass.colorBack = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
ColourIDT cid = { 0 };
cid.cbSize = sizeof(ColourIDT);
- mir_sntprintf(cid.group, _T(PU_FNT_AND_COLOR)L"/%S", ptd->pupClass.pszName);
+ mir_sntprintf(cid.group, _A2W(PU_FNT_AND_COLOR) L"/%S", ptd->pupClass.pszName);
mir_strncpy(cid.dbSettingsGroup, PU_MODULCLASS, _countof(fid.dbSettingsGroup));
mir_tstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
mir_snprintf(cid.setting, "%s/BgCol", ptd->pupClass.pszName);
@@ -457,8 +457,8 @@ INT_PTR Popup_CreateClassPopup(WPARAM wParam, LPARAM lParam) ppd2.PluginWindowProc = pc->PluginWindowProc;
if (pc->flags & PCF_UNICODE) {
ppd2.flags = PU2_UNICODE;
- ppd2.lptzTitle = (TCHAR*)pdc->ptszTitle;
- ppd2.lptzText = (TCHAR*)pdc->ptszText;
+ ppd2.lptzTitle = (wchar_t*)pdc->pwszTitle;
+ ppd2.lptzText = (wchar_t*)pdc->pwszText;
}
else {
ppd2.flags = PU2_ANSI;
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp index 96913d57cf..242bf7b4c2 100644 --- a/plugins/Popup/src/skin.cpp +++ b/plugins/Popup/src/skin.cpp @@ -62,7 +62,7 @@ SIZE PopupSkin::measureAction(HDC hdc, POPUPACTION *act) const SIZE szText, szSpace;
LPTSTR wname = mir_a2t(name);
- TCHAR *str = TranslateTS(wname);
+ wchar_t *str = TranslateTS(wname);
GetTextExtentPoint32(hdc, str, (int)mir_tstrlen(str), &szText);
mir_free(wname);
GetTextExtentPoint32(hdc, L" ", 1, &szSpace);
@@ -125,7 +125,7 @@ void PopupSkin::drawAction(MyBitmap *bmp, POPUPACTION *act, int x, int y, bool h GetTextExtentPoint32(bmp->getDC(), L" ", 1, &szSpace);
LPTSTR wname = mir_a2t(name);
- TCHAR *str = TranslateTS(wname);
+ wchar_t *str = TranslateTS(wname);
GetTextExtentPoint32(bmp->getDC(), str, (int)mir_tstrlen(str), &szText);
bmp->Draw_Text(str,
(PopupOptions.actions&ACT_LARGE) ? (x + szSpace.cx + 32) : (x + szSpace.cx + 16),
@@ -185,7 +185,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options SIZE szNew;
szNew.cx = head->clocksize[CLOCK_LEFT] + head->clocksize[CLOCK_RIGHT];
szNew.cy = head->myBmp->getHeight();
- for (TCHAR *p = wnd->getTime(); *p; p++) {
+ for (wchar_t *p = wnd->getTime(); *p; p++) {
if (*p == ':')
szNew.cx += head->clocksize[CLOCK_SEPARATOR];
else if ((*p >= '0') && (*p <= '9'))
@@ -333,7 +333,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options if (head && head->myBmp) {
szNew.cx = head->clocksize[CLOCK_LEFT] + head->clocksize[CLOCK_RIGHT];
szNew.cy = head->myBmp->getHeight();
- for (TCHAR *p = wnd->getTime(); *p; p++) {
+ for (wchar_t *p = wnd->getTime(); *p; p++) {
if (*p == ':')
szNew.cx += head->clocksize[CLOCK_SEPARATOR];
else if ((*p >= '0') && (*p <= '9'))
@@ -429,7 +429,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW SIZE szNew;
szNew.cx = head->clocksize[CLOCK_LEFT] + head->clocksize[CLOCK_RIGHT];
szNew.cy = head->myBmp->getHeight();
- for (TCHAR *p = wnd->getTime(); *p; p++) {
+ for (wchar_t *p = wnd->getTime(); *p; p++) {
if (*p == ':')
szNew.cx += head->clocksize[CLOCK_SEPARATOR];
else if ((*p >= '0') && (*p <= '9'))
@@ -661,7 +661,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW bmp->BlendPart(head->myBmp, head->clockstart[CLOCK_LEFT], 0, head->clocksize[CLOCK_LEFT], sy, x, y, head->clocksize[CLOCK_LEFT], sy);
x += head->clocksize[CLOCK_LEFT];
- for (TCHAR *p = wnd->getTime(); *p; p++) {
+ for (wchar_t *p = wnd->getTime(); *p; p++) {
int clock_idx = -1;
if (*p == ':')
clock_idx = CLOCK_SEPARATOR;
@@ -741,7 +741,7 @@ bool PopupSkin::onMouseLeave(PopupWnd2 *wnd) const void PopupSkin::loadOptions(std::wistream &f)
{
- TCHAR *buf = new TCHAR[1024];
+ wchar_t *buf = new wchar_t[1024];
while (!f.eof()) {
f >> buf;
if (*buf == '#') {
@@ -755,10 +755,10 @@ void PopupSkin::loadOptions(std::wistream &f) id--;
if (m_flag_names[id])
mir_free(m_flag_names[id]);
- TCHAR *p = buf;
+ wchar_t *p = buf;
while (isspace(*p))
p++;
- TCHAR *q = p + mir_tstrlen(p) - 1;
+ wchar_t *q = p + mir_tstrlen(p) - 1;
while ((q >= p) && isspace(*q))
*q-- = 0;
m_flag_names[id] = mir_t2a(p);
@@ -783,11 +783,11 @@ bool PopupSkin::load(LPCTSTR dir) }
m_flags = 0;
- if (!_tcsncmp(L"res:", dir, 4)) // resource
+ if (!wcsncmp(L"res:", dir, 4)) // resource
loadSkin(dir + 4, L"Skin");
else { // filesystem
// skin info
- TCHAR dir_save[1024];
+ wchar_t dir_save[1024];
GetCurrentDirectory(1024, dir_save);
SetCurrentDirectory(dir);
@@ -829,7 +829,7 @@ void PopupSkin::loadSkin(std::wistream &f) head->next = NULL;
while (!f.eof()) {
- TCHAR buf[1024];
+ wchar_t buf[1024];
f >> buf;
if (!*buf)
@@ -900,7 +900,7 @@ void PopupSkin::loadSkin(LPCTSTR lpName, LPCTSTR lpType) HRSRC hRes = FindResource(hInst, lpName, lpType);
HRSRC hResLoad = (HRSRC)LoadResource(hInst, hRes);
char *lpResLock = (char *)LockResource(hResLoad);
- std::wistringstream stream((TCHAR*)_A2T(lpResLock));
+ std::wistringstream stream((wchar_t*)_A2T(lpResLock));
loadSkin(stream);
UnlockResource(lpResLock);
FreeResource(hRes);
@@ -917,7 +917,7 @@ PopupSkin::SKINELEMENT *PopupSkin::loadObject(std::wistream &f) element->myBmp = NULL;
while (!f.eof()) {
- TCHAR buf[1024];
+ wchar_t buf[1024];
f >> buf;
if (!*buf)
@@ -1087,11 +1087,11 @@ bool Skins::load() skin->next = m_skins;
m_skins = skin;
m_skins->name = mir_tstrdup(L"* Popup Classic");
- m_skins->dir = new TCHAR[1024];
+ m_skins->dir = new wchar_t[1024];
mir_tstrcpy(m_skins->dir, L"res:classic.popupskin");
m_skins->skin = 0;
- TCHAR dir[1024] = { '\0' };
+ wchar_t dir[1024] = { '\0' };
if (ServiceExists(MS_FOLDERS_GET_PATH)) {
if (FoldersGetCustomPathT(folderId, dir, _countof(dir), NULL) != 0)
@@ -1104,7 +1104,7 @@ bool Skins::load() return false;
}
- TCHAR dir_save[1024];
+ wchar_t dir_save[1024];
GetCurrentDirectory(1024, dir_save);
SetCurrentDirectory(dir);
@@ -1118,7 +1118,7 @@ bool Skins::load() skin->next = m_skins;
m_skins = skin;
m_skins->name = mir_tstrdup(ffd.cFileName);
- m_skins->dir = new TCHAR[1024];
+ m_skins->dir = new wchar_t[1024];
GetCurrentDirectory(1024, m_skins->dir);
m_skins->skin = 0;
@@ -1158,7 +1158,7 @@ const PopupSkin *Skins::getSkin(LPCTSTR name) if (!any->skin->isCompatible())
MessageBox(NULL,
TranslateT("The skin you are trying to load is designed\r\nfor newer version of Popup plus. And will not\r\ndisplay properly.\r\n\r\nPlease choose another skin."),
- _T(MODULNAME_LONG), MB_ICONSTOP | MB_OK);
+ MODULNAME_LONG, MB_ICONSTOP | MB_OK);
return any->skin;
}
diff --git a/plugins/Popup/src/stdafx.h b/plugins/Popup/src/stdafx.h index bc6507a35f..044916d971 100644 --- a/plugins/Popup/src/stdafx.h +++ b/plugins/Popup/src/stdafx.h @@ -129,8 +129,9 @@ http://miranda-ng.org/distr/ #define PU_MODULCLASS "PopupCLASS" // temp DB modul for this plugin
#define MODULNAME "Popup"
-#define MODULNAME_LONG "Popup Plus"
+#define MODULNAME_LONG L"Popup Plus"
#define MODULNAME_PLU "Popups"
+#define MODULNAME_PLUW L"Popups"
INT_PTR svcEnableDisableMenuCommand(WPARAM, LPARAM);
diff --git a/plugins/ProfileManager/src/pmanagerEx.cpp b/plugins/ProfileManager/src/pmanagerEx.cpp index 39346ae714..44c62b11c6 100644 --- a/plugins/ProfileManager/src/pmanagerEx.cpp +++ b/plugins/ProfileManager/src/pmanagerEx.cpp @@ -48,7 +48,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) static INT_PTR ChangePM(WPARAM, LPARAM)
{
- TCHAR fn[MAX_PATH];
+ wchar_t fn[MAX_PATH];
GetModuleFileName(GetModuleHandle(NULL), fn, _countof(fn));
ShellExecute(0, L"open", fn, L"/ForceShowPM", L"", 1);
CallService("CloseAction", 0, 0);
@@ -57,7 +57,7 @@ static INT_PTR ChangePM(WPARAM, LPARAM) static INT_PTR LoadPM(WPARAM, LPARAM)
{
- TCHAR fn[MAX_PATH];
+ wchar_t fn[MAX_PATH];
GetModuleFileName(GetModuleHandle(NULL), fn, _countof(fn));
ShellExecute(0, L"open", fn, L"/ForceShowPM", L"", 1);
return 0;
@@ -66,7 +66,7 @@ static INT_PTR LoadPM(WPARAM, LPARAM) static INT_PTR CheckDb(WPARAM, LPARAM)
{
if (MessageBox(0, TranslateT("Miranda NG will exit and Database checker will start.\n\nAre you sure you want to do this?"), TranslateT("Check database"), MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2) == IDYES) {
- TCHAR mirandaPath[MAX_PATH], cmdLine[100];
+ wchar_t mirandaPath[MAX_PATH], cmdLine[100];
PROCESS_INFORMATION pi;
STARTUPINFO si = { 0 };
si.cb = sizeof(si);
@@ -112,7 +112,7 @@ extern "C" __declspec(dllexport) int Load(void) CreateServiceFunction(SRV_RESTART_ME, RestartMe);
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Database"), -500200000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Database"), -500200000);
for (int i = 0; i < _countof(iconList); i++) {
mi.name.a = iconList[i].szDescr;
diff --git a/plugins/QuickContacts/src/options.cpp b/plugins/QuickContacts/src/options.cpp index 1c04ebf43b..21d23ef10f 100644 --- a/plugins/QuickContacts/src/options.cpp +++ b/plugins/QuickContacts/src/options.cpp @@ -51,8 +51,8 @@ int InitOptionsCallback(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("Contacts");
- odp.ptszTitle = LPGENT("Quick Contacts");
+ odp.pwszGroup = LPGENW("Contacts");
+ odp.pwszTitle = LPGENW("Quick Contacts");
odp.pfnDlgProc = OptionsDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 5d2e988a71..a50b89881c 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -126,8 +126,8 @@ int ModulesLoaded(WPARAM, LPARAM) hkd.cbSize = sizeof(hkd);
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "Quick Contacts/Open dialog";
- hkd.ptszDescription = LPGENT("Open dialog");
- hkd.ptszSection = LPGENT("Quick Contacts");
+ hkd.ptszDescription = LPGENW("Open dialog");
+ hkd.ptszSection = LPGENW("Quick Contacts");
hkd.pszService = MS_QC_SHOW_DIALOG;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_ALT, 'Q');
Hotkey_Register(&hkd);
@@ -137,37 +137,37 @@ int ModulesLoaded(WPARAM, LPARAM) hkd.lParam = HOTKEY_FILE;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'F');
hkd.pszName = "Quick Contacts/File";
- hkd.ptszDescription = LPGENT("Send file");
+ hkd.ptszDescription = LPGENW("Send file");
Hotkey_Register(&hkd);
hkd.lParam = HOTKEY_URL;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'U');
hkd.pszName = "Quick Contacts/URL";
- hkd.ptszDescription = LPGENT("Send URL");
+ hkd.ptszDescription = LPGENW("Send URL");
Hotkey_Register(&hkd);
hkd.lParam = HOTKEY_INFO;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'I');
hkd.pszName = "Quick Contacts/Info";
- hkd.ptszDescription = LPGENT("Open user info");
+ hkd.ptszDescription = LPGENW("Open user info");
Hotkey_Register(&hkd);
hkd.lParam = HOTKEY_HISTORY;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'H');
hkd.pszName = "Quick Contacts/History";
- hkd.ptszDescription = LPGENT("Open history");
+ hkd.ptszDescription = LPGENW("Open history");
Hotkey_Register(&hkd);
hkd.lParam = HOTKEY_MENU;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'M');
hkd.pszName = "Quick Contacts/Menu";
- hkd.ptszDescription = LPGENT("Open contact menu");
+ hkd.ptszDescription = LPGENW("Open contact menu");
Hotkey_Register(&hkd);
hkd.lParam = HOTKEY_ALL_CONTACTS;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'A');
hkd.pszName = "Quick Contacts/All Contacts";
- hkd.ptszDescription = LPGENT("Show all contacts");
+ hkd.ptszDescription = LPGENW("Show all contacts");
Hotkey_Register(&hkd);
if (ServiceExists(MS_SKIN_ADDHOTKEY))
@@ -190,7 +190,7 @@ int ModulesLoaded(WPARAM, LPARAM) SET_UID(mi, 0x3a3f768a, 0xcf47, 0x43d5, 0x92, 0x16, 0xe4, 0xeb, 0x93, 0xf6, 0x72, 0xfa);
mi.position = 500100001;
mi.flags = CMIF_TCHAR;
- mi.name.t = LPGENT("Quick Contacts...");
+ mi.name.w = LPGENW("Quick Contacts...");
mi.pszService = MS_QC_SHOW_DIALOG;
Menu_AddMainMenuItem(&mi);
return 0;
@@ -223,10 +223,10 @@ int EventAdded(WPARAM wparam, LPARAM hDbEvent) // array where the contacts are put into
struct c_struct {
- TCHAR szname[120];
- TCHAR szgroup[50];
+ wchar_t szname[120];
+ wchar_t szgroup[50];
MCONTACT hcontact;
- TCHAR proto[20];
+ wchar_t proto[20];
c_struct()
{
@@ -243,11 +243,11 @@ long max_proto_width; // Get the name the contact has in list
// This was not made to be called by more than one thread!
-TCHAR tmp_list_name[120];
+wchar_t tmp_list_name[120];
-TCHAR *GetListName(c_struct *cs)
+wchar_t *GetListName(c_struct *cs)
{
- if (opts.group_append && cs->szgroup[0] != _T('\0'))
+ if (opts.group_append && cs->szgroup[0] != '\0')
{
mir_sntprintf(tmp_list_name, L"%s (%s)", cs->szname, cs->szgroup);
return tmp_list_name;
@@ -259,13 +259,13 @@ TCHAR *GetListName(c_struct *cs) }
-int lstreq(TCHAR *a, TCHAR *b, size_t len = -1)
+int lstreq(wchar_t *a, wchar_t *b, size_t len = -1)
{
- a = CharLower(_tcsdup(a));
- b = CharLower(_tcsdup(b));
+ a = CharLower(wcsdup(a));
+ b = CharLower(wcsdup(b));
int ret;
if (len > 0)
- ret = _tcsncmp(a, b, len);
+ ret = wcsncmp(a, b, len);
else
ret = mir_tstrcmp(a, b);
free(a);
@@ -410,7 +410,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) }
// Make contact name
- TCHAR *tmp = (TCHAR *) pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *tmp = (wchar_t *) pcli->pfnGetContactDisplayName(hContact, 0);
mir_tstrncpy(contact->szname, tmp, _countof(contact->szname));
PROTOACCOUNT *acc = Proto_GetAccount(pszProto);
@@ -476,11 +476,11 @@ void EnableButtons(HWND hwndDlg, MCONTACT hContact) // check if the char(s) entered appears in a contacts name
-int CheckText(HWND hdlg, TCHAR *sztext, BOOL only_enable = FALSE)
+int CheckText(HWND hdlg, wchar_t *sztext, BOOL only_enable = FALSE)
{
EnableButtons(hwndMain, NULL);
- if(sztext == NULL || sztext[0] == _T('\0'))
+ if(sztext == NULL || sztext[0] == '\0')
return 0;
size_t len = mir_tstrlen(sztext);
@@ -527,7 +527,7 @@ MCONTACT GetSelectedContact(HWND hwndDlg) }
// Now try the name
- TCHAR cname[120] = L"";
+ wchar_t cname[120] = L"";
GetDlgItemText(hwndDlg, IDC_USERNAME, cname, _countof(cname));
@@ -562,7 +562,7 @@ LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) if (wparam<32 && wparam != VK_BACK)
break;
- TCHAR sztext[120] = L"";
+ wchar_t sztext[120] = L"";
DWORD start;
DWORD end;
@@ -597,7 +597,7 @@ LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) }
case WM_KEYUP:
{
- TCHAR sztext[120] = L"";
+ wchar_t sztext[120] = L"";
if (wparam == VK_RETURN)
{
@@ -708,10 +708,10 @@ BOOL MoveWindow(HWND hWnd, const RECT &rect, BOOL bRepaint) }
-static void FillButton(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key, HICON icon)
+static void FillButton(HWND hwndDlg, int dlgItem, wchar_t *name, wchar_t *key, HICON icon)
{
- TCHAR tmp[256];
- TCHAR *full = tmp;
+ wchar_t tmp[256];
+ wchar_t *full = tmp;
if (key == NULL)
full = TranslateTS(name);
@@ -724,10 +724,10 @@ static void FillButton(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key, HICON }
-static void FillCheckbox(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key)
+static void FillCheckbox(HWND hwndDlg, int dlgItem, wchar_t *name, wchar_t *key)
{
- TCHAR tmp[256];
- TCHAR *full = tmp;
+ wchar_t tmp[256];
+ wchar_t *full = tmp;
if (key == NULL)
full = TranslateTS(name);
@@ -762,13 +762,13 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA mir_subclassWindow(GetWindow(GetDlgItem(hwndDlg, IDC_USERNAME),GW_CHILD), EditProc);
// Buttons
- FillCheckbox(hwndDlg, IDC_SHOW_ALL_CONTACTS, LPGENT("Show all contacts"), hasNewHotkeyModule ? NULL : L"Ctrl+A");
- FillButton(hwndDlg, IDC_MESSAGE, LPGENT("Send message"), NULL, Skin_LoadIcon(SKINICON_EVENT_MESSAGE));
- FillButton(hwndDlg, IDC_FILE, LPGENT("Send file"), hasNewHotkeyModule ? NULL : L"Ctrl+F", Skin_LoadIcon(SKINICON_EVENT_FILE));
- FillButton(hwndDlg, IDC_URL, LPGENT("Send URL"), hasNewHotkeyModule ? NULL : L"Ctrl+U", Skin_LoadIcon(SKINICON_EVENT_URL));
- FillButton(hwndDlg, IDC_USERINFO, LPGENT("Open user info"), hasNewHotkeyModule ? NULL : L"Ctrl+I", Skin_LoadIcon(SKINICON_OTHER_USERDETAILS));
- FillButton(hwndDlg, IDC_HISTORY, LPGENT("Open history"), hasNewHotkeyModule ? NULL : L"Ctrl+H", Skin_LoadIcon(SKINICON_OTHER_HISTORY));
- FillButton(hwndDlg, IDC_MENU, LPGENT("Open contact menu"), hasNewHotkeyModule ? NULL : L"Ctrl+M", Skin_LoadIcon(SKINICON_OTHER_DOWNARROW));
+ FillCheckbox(hwndDlg, IDC_SHOW_ALL_CONTACTS, LPGENW("Show all contacts"), hasNewHotkeyModule ? NULL : L"Ctrl+A");
+ FillButton(hwndDlg, IDC_MESSAGE, LPGENW("Send message"), NULL, Skin_LoadIcon(SKINICON_EVENT_MESSAGE));
+ FillButton(hwndDlg, IDC_FILE, LPGENW("Send file"), hasNewHotkeyModule ? NULL : L"Ctrl+F", Skin_LoadIcon(SKINICON_EVENT_FILE));
+ FillButton(hwndDlg, IDC_URL, LPGENW("Send URL"), hasNewHotkeyModule ? NULL : L"Ctrl+U", Skin_LoadIcon(SKINICON_EVENT_URL));
+ FillButton(hwndDlg, IDC_USERINFO, LPGENW("Open user info"), hasNewHotkeyModule ? NULL : L"Ctrl+I", Skin_LoadIcon(SKINICON_OTHER_USERDETAILS));
+ FillButton(hwndDlg, IDC_HISTORY, LPGENW("Open history"), hasNewHotkeyModule ? NULL : L"Ctrl+H", Skin_LoadIcon(SKINICON_OTHER_HISTORY));
+ FillButton(hwndDlg, IDC_MENU, LPGENW("Open contact menu"), hasNewHotkeyModule ? NULL : L"Ctrl+M", Skin_LoadIcon(SKINICON_OTHER_DOWNARROW));
SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_SETEXTENDEDUI, TRUE, 0);
@@ -956,7 +956,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA {
// Get old text
HWND hEdit = GetWindow(GetWindow(hwndDlg,GW_CHILD),GW_CHILD);
- TCHAR sztext[120] = L"";
+ wchar_t sztext[120] = L"";
if (SendMessage(hEdit, EM_GETSEL, 0, 0) != -1)
SendMessage(hEdit, EM_REPLACESEL, 0, (LPARAM)L"");
@@ -1076,7 +1076,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
// Draw text
- TCHAR *name;
+ wchar_t *name;
if (opts.group_append && !opts.group_column)
name = GetListName(contacts[lpdis->itemData]);
else
diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp index 9067c7ac12..82aa13cd5a 100644 --- a/plugins/QuickMessages/src/Utils.cpp +++ b/plugins/QuickMessages/src/Utils.cpp @@ -224,7 +224,7 @@ BYTE getEntryByte(int buttonnum, int entrynum, BOOL mode) static HANDLE AddIcon(char* szIcoName) { - TCHAR tszPath[MAX_PATH]; + wchar_t tszPath[MAX_PATH]; GetModuleFileName(hinstance, tszPath, _countof(tszPath)); SKINICONDESC sid = { 0 }; @@ -232,7 +232,7 @@ static HANDLE AddIcon(char* szIcoName) sid.section.a = "Quick Messages"; sid.description.a = szIcoName; sid.pszName = szIcoName; - sid.defaultFile.t = tszPath; + sid.defaultFile.w = tszPath; sid.iDefaultIndex = -IDI_QICON; return IcoLib_AddIcon(&sid); } @@ -269,7 +269,7 @@ void InitButtonsList() int i, j, k = 0; QuickList = List_Create(0, 1); for (i = 0; i < g_iButtonsCount; i++) { - TCHAR* pszBName = NULL; + wchar_t* pszBName = NULL; ListData* ld = NULL; if (!(pszBName = getMenuEntry(i, 0, 3))) { g_iButtonsCount = i; @@ -286,7 +286,7 @@ void InitButtonsList() ld->dwOPFlags = 0; ld->bIsServName = ld->bIsOpServName = getEntryByte(i, 0, 3); for (j = 0;; j++) { - TCHAR* pszEntry = NULL; + wchar_t* pszEntry = NULL; ButtonData *bd = NULL; if (!(pszEntry = getMenuEntry(i, j, 0))) @@ -331,9 +331,9 @@ void DestructButtonsList() } } -TCHAR* getMenuEntry(int buttonnum, int entrynum, BYTE mode) +wchar_t* getMenuEntry(int buttonnum, int entrynum, BYTE mode) { - TCHAR* buffer = NULL; + wchar_t* buffer = NULL; char szMEntry[256]; DBVARIANT dbv; @@ -387,18 +387,18 @@ int RegisterCustomButton(WPARAM, LPARAM) return 0; } -TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR* ptszClip, int QVSize, int TextSize, int ClipSize) +wchar_t* ParseString(MCONTACT hContact, wchar_t* ptszQValIn, wchar_t* ptszText, wchar_t* ptszClip, int QVSize, int TextSize, int ClipSize) { int i = 0, iOffset = 0; - TCHAR* tempPointer = NULL; - TCHAR* ptszQValue = _tcsdup(ptszQValIn); - TCHAR* tempQValue = ptszQValue; - TCHAR varstr = _T('%'); - TCHAR* p = NULL; + wchar_t* tempPointer = NULL; + wchar_t* ptszQValue = wcsdup(ptszQValIn); + wchar_t* tempQValue = ptszQValue; + wchar_t varstr = '%'; + wchar_t* p = NULL; int NameLenght = 0; - TCHAR* ptszName = NULL; + wchar_t* ptszName = NULL; - if (!_tcschr(ptszQValue, varstr)) + if (!wcschr(ptszQValue, varstr)) return ptszQValue; if (TextSize && ptszText[TextSize - 1] == '\0') @@ -414,18 +414,18 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR* switch (ptszQValue[i + 1]) { case 't': - p = (TCHAR *)realloc(tempQValue, (QVSize + TextSize + 1) * sizeof(TCHAR)); + p = (wchar_t *)realloc(tempQValue, (QVSize + TextSize + 1) * sizeof(wchar_t)); if (!p) break; i = iOffset; tempQValue = ptszQValue = p; - tempPointer = (TCHAR *)memmove(ptszQValue + i + TextSize, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(TCHAR)); - memcpy(ptszQValue + i, ptszText, TextSize * sizeof(TCHAR)); + tempPointer = (wchar_t *)memmove(ptszQValue + i + TextSize, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(wchar_t)); + memcpy(ptszQValue + i, ptszText, TextSize * sizeof(wchar_t)); QVSize += (TextSize - 2); ptszQValue[QVSize] = '\0'; - if (!_tcschr(ptszQValue, varstr)) + if (!wcschr(ptszQValue, varstr)) return ptszQValue; ptszQValue = tempPointer; @@ -433,18 +433,18 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR* i = -1; break; case 'c': - p = (TCHAR *)realloc(tempQValue, (QVSize + ClipSize + 1) * sizeof(TCHAR)); + p = (wchar_t *)realloc(tempQValue, (QVSize + ClipSize + 1) * sizeof(wchar_t)); if (!p) break; i = iOffset; tempQValue = ptszQValue = p; - tempPointer = (TCHAR *)memmove(ptszQValue + i + ClipSize, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(TCHAR)); - memcpy(ptszQValue + i, ptszClip, ClipSize * sizeof(TCHAR)); + tempPointer = (wchar_t *)memmove(ptszQValue + i + ClipSize, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(wchar_t)); + memcpy(ptszQValue + i, ptszClip, ClipSize * sizeof(wchar_t)); QVSize += (ClipSize - 2); ptszQValue[QVSize] = '\0'; - if (!_tcschr(ptszQValue, varstr)) + if (!wcschr(ptszQValue, varstr)) return ptszQValue; ptszQValue = tempPointer; @@ -454,7 +454,7 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR* case 'P': ptszName = mir_a2u(GetContactProto(hContact)); NameLenght = (int)mir_tstrlen(ptszName); - p = (TCHAR *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(TCHAR)); + p = (wchar_t *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(wchar_t)); if (!p) { mir_free(ptszName); break; @@ -462,13 +462,13 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR* i = iOffset; tempQValue = ptszQValue = p; - tempPointer = (TCHAR *)memmove(ptszQValue + i + NameLenght, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(TCHAR)); - memcpy(ptszQValue + i, ptszName, NameLenght * sizeof(TCHAR)); + tempPointer = (wchar_t *)memmove(ptszQValue + i + NameLenght, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(wchar_t)); + memcpy(ptszQValue + i, ptszName, NameLenght * sizeof(wchar_t)); QVSize += (NameLenght - 2); mir_free(ptszName); ptszQValue[QVSize] = '\0'; - if (!_tcschr(ptszQValue, varstr)) + if (!wcschr(ptszQValue, varstr)) return ptszQValue; ptszQValue = tempPointer; @@ -477,20 +477,20 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR* break; case 'n': - ptszName = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0); + ptszName = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0); NameLenght = (int)mir_tstrlen(ptszName); - p = (TCHAR *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(TCHAR)); + p = (wchar_t *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(wchar_t)); if (!p) break; i = iOffset; tempQValue = ptszQValue = p; - tempPointer = (TCHAR *)memmove(ptszQValue + i + NameLenght, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(TCHAR)); - memcpy(ptszQValue + i, ptszName, NameLenght * sizeof(TCHAR)); + tempPointer = (wchar_t *)memmove(ptszQValue + i + NameLenght, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(wchar_t)); + memcpy(ptszQValue + i, ptszName, NameLenght * sizeof(wchar_t)); QVSize += (NameLenght - 2); ptszQValue[QVSize] = '\0'; - if (!_tcschr(ptszQValue, varstr)) + if (!wcschr(ptszQValue, varstr)) return ptszQValue; ptszQValue = tempPointer; @@ -502,7 +502,7 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR* if (ptszName == NULL) break; NameLenght = (int)mir_tstrlen(ptszName); - p = (TCHAR *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(TCHAR)); + p = (wchar_t *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(wchar_t)); if (!p) { mir_free(ptszName); break; @@ -510,13 +510,13 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR* i = iOffset; tempQValue = ptszQValue = p; - tempPointer = (TCHAR *)memmove(ptszQValue + i + NameLenght, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(TCHAR)); - memcpy(ptszQValue + i, ptszName, NameLenght * sizeof(TCHAR)); + tempPointer = (wchar_t *)memmove(ptszQValue + i + NameLenght, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(wchar_t)); + memcpy(ptszQValue + i, ptszName, NameLenght * sizeof(wchar_t)); QVSize += (NameLenght - 2); mir_free(ptszName); ptszQValue[QVSize] = '\0'; - if (!_tcschr(ptszQValue, varstr)) + if (!wcschr(ptszQValue, varstr)) return ptszQValue; ptszQValue = tempPointer; @@ -529,7 +529,7 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR* break; NameLenght = (int)mir_tstrlen(ptszName); - p = (TCHAR *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(TCHAR)); + p = (wchar_t *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(wchar_t)); if (!p) { mir_free(ptszName); break; @@ -537,13 +537,13 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR* i = iOffset; tempQValue = ptszQValue = p; - tempPointer = (TCHAR *)memmove(ptszQValue + i + NameLenght, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(TCHAR)); - memcpy(ptszQValue + i, ptszName, NameLenght * sizeof(TCHAR)); + tempPointer = (wchar_t *)memmove(ptszQValue + i + NameLenght, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(wchar_t)); + memcpy(ptszQValue + i, ptszName, NameLenght * sizeof(wchar_t)); QVSize += (NameLenght - 2); mir_free(ptszName); ptszQValue[QVSize] = '\0'; - if (!_tcschr(ptszQValue, varstr)) + if (!wcschr(ptszQValue, varstr)) return ptszQValue; ptszQValue = tempPointer; diff --git a/plugins/QuickMessages/src/Utils.h b/plugins/QuickMessages/src/Utils.h index 3f4d11770c..adfd0ffa76 100644 --- a/plugins/QuickMessages/src/Utils.h +++ b/plugins/QuickMessages/src/Utils.h @@ -34,10 +34,10 @@ typedef struct _tagButtonData BYTE bInQMenu;
BYTE bOpInQMenu;
DWORD dwOPFlags;
- TCHAR *pszName;
- TCHAR *pszValue;
- TCHAR *pszOpValue;
- TCHAR *pszOpName;
+ wchar_t *pszName;
+ wchar_t *pszValue;
+ wchar_t *pszOpValue;
+ wchar_t *pszOpName;
}ButtonData;
typedef struct _tagListData
@@ -45,9 +45,9 @@ typedef struct _tagListData SortedList* sl;
DWORD dwPos;
DWORD dwOPPos;
- TCHAR* ptszQValue;
- TCHAR* ptszOPQValue;
- TCHAR* ptszButtonName;
+ wchar_t* ptszQValue;
+ wchar_t* ptszOPQValue;
+ wchar_t* ptszButtonName;
BYTE bIsServName;
BYTE bIsOpServName;
DWORD dwOPFlags;
@@ -58,8 +58,8 @@ typedef struct _tagQuickData DWORD dwPos;
BOOL bIsService;
BYTE fEntryType;
- TCHAR* ptszValue;
- TCHAR* ptszValueName;
+ wchar_t* ptszValue;
+ wchar_t* ptszValueName;
}QuickData;
void InitButtonsList();
@@ -68,11 +68,11 @@ int sstSortButtons(const void * vmtbi1, const void * vmtbi2); int sstOpSortButtons(const void * vmtbi1, const void * vmtbi2);
int sstQuickSortButtons(const void * vmtbi1, const void * vmtbi2);
void li_ZeroQuickList(SortedList *pList);
-TCHAR* getMenuEntry(int entrynum,int buttonnum,BYTE mode) ;
+wchar_t* getMenuEntry(int entrynum,int buttonnum,BYTE mode) ;
int RegisterCustomButton(WPARAM wParam,LPARAM lParam);
void RemoveMenuEntryNode(SortedList *pList, int index);
void DestroyButton(int listnum);
void SaveModuleSettings(int buttonnum,ButtonData* bd);
void CleanSettings(int buttonnum,int from);
DWORD BalanceButtons(int buttonsWas,int buttonsNow);
-TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValueIn,TCHAR* ptszText,TCHAR* ptszClip,int QVSize,int TextSize ,int ClipSize);
+wchar_t* ParseString(MCONTACT hContact,wchar_t* ptszQValueIn,wchar_t* ptszText,wchar_t* ptszClip,int QVSize,int TextSize ,int ClipSize);
diff --git a/plugins/QuickMessages/src/main.cpp b/plugins/QuickMessages/src/main.cpp index 83eca17bda..6dc22694c7 100644 --- a/plugins/QuickMessages/src/main.cpp +++ b/plugins/QuickMessages/src/main.cpp @@ -74,26 +74,26 @@ static int InputMenuPopup(WPARAM, LPARAM lParam) AppendMenu(hSubMenu, MF_STRING, qd->dwPos + 254, qd->ptszValueName);
}
}
- else if (mwpd->uType == MSG_WINDOWPOPUP_SELECTED&&mwpd->selection >= 254) {
+ else if (mwpd->uType == MSG_WINDOWPOPUP_SELECTED && mwpd->selection >= 254) {
for (i = 0; i < QuickList->realCount; i++) {
QuickData* qd = (QuickData *)QuickList->items[i];
if ((qd->dwPos + 254) == mwpd->selection) {
CHARRANGE cr;
UINT textlenght = 0;
- TCHAR* pszText = NULL;
- TCHAR* ptszQValue = NULL;
- TCHAR* pszCBText = NULL;
+ wchar_t* pszText = NULL;
+ wchar_t* ptszQValue = NULL;
+ wchar_t* pszCBText = NULL;
BOOL bIsService = 0;
if (IsClipboardFormatAvailable(CF_TEXT)) {
if (OpenClipboard(mwpd->hwnd)) {
HANDLE hData = NULL;
- TCHAR* chBuffer = NULL;
+ wchar_t* chBuffer = NULL;
int textLength = 0;
hData = GetClipboardData(CF_UNICODETEXT);
- chBuffer = (TCHAR*)GlobalLock(hData);
+ chBuffer = (wchar_t*)GlobalLock(hData);
textLength = (int)mir_tstrlen(chBuffer);
pszCBText = mir_tstrdup(chBuffer);
GlobalUnlock(hData);
@@ -105,8 +105,8 @@ static int InputMenuPopup(WPARAM, LPARAM lParam) textlenght = cr.cpMax - cr.cpMin;
if (textlenght) {
- pszText = (TCHAR *)mir_alloc((textlenght + 10)*sizeof(TCHAR));
- memset(pszText, 0, ((textlenght + 10) * sizeof(TCHAR)));
+ pszText = (wchar_t *)mir_alloc((textlenght + 10)*sizeof(wchar_t));
+ memset(pszText, 0, ((textlenght + 10) * sizeof(wchar_t)));
SendMessage(mwpd->hwnd, EM_GETSELTEXT, 0, (LPARAM)pszText);
}
if (qd->ptszValue) {
@@ -139,9 +139,9 @@ static int CustomButtonPressed(WPARAM, LPARAM lParam) HWND hEdit = NULL;
BOOL bCTRL = 0;
BOOL bIsService = 0;
- TCHAR* pszText = NULL;
- TCHAR* pszCBText = NULL;
- TCHAR* ptszQValue = NULL;
+ wchar_t* pszText = NULL;
+ wchar_t* pszCBText = NULL;
+ wchar_t* ptszQValue = NULL;
UINT textlenght = 0;
SortedList* sl = NULL;
int state = 0;
@@ -157,12 +157,12 @@ static int CustomButtonPressed(WPARAM, LPARAM lParam) if (IsClipboardFormatAvailable(CF_TEXT)) {
if (OpenClipboard(cbcd->hwndFrom)) {
HANDLE hData = NULL;
- TCHAR* chBuffer = NULL;
+ wchar_t* chBuffer = NULL;
int textLength = 0;
hData = GetClipboardData(CF_UNICODETEXT);
- chBuffer = (TCHAR*)GlobalLock(hData);
+ chBuffer = (wchar_t*)GlobalLock(hData);
textLength = (int)mir_tstrlen(chBuffer);
pszCBText = mir_tstrdup(chBuffer);
GlobalUnlock(hData);
@@ -180,8 +180,8 @@ static int CustomButtonPressed(WPARAM, LPARAM lParam) textlenght = cr.cpMax - cr.cpMin;
if (textlenght) {
- pszText = (TCHAR *)mir_alloc((textlenght + 10)*sizeof(TCHAR));
- memset(pszText, 0, ((textlenght + 10) * sizeof(TCHAR)));
+ pszText = (wchar_t *)mir_alloc((textlenght + 10)*sizeof(wchar_t));
+ memset(pszText, 0, ((textlenght + 10) * sizeof(wchar_t)));
SendMessage(hEdit, EM_GETSELTEXT, 0, (LPARAM)pszText);
}
diff --git a/plugins/QuickMessages/src/options.cpp b/plugins/QuickMessages/src/options.cpp index 412d57f2cb..65d55d874a 100644 --- a/plugins/QuickMessages/src/options.cpp +++ b/plugins/QuickMessages/src/options.cpp @@ -119,7 +119,7 @@ void SetMenuEntryProperties(HWND hdlg) if (tvi.lParam) {
ListData* ld = (ListData*)tvi.lParam;
- TCHAR szValue[256];
+ wchar_t szValue[256];
GetDlgItemText(hdlg, IDC_RCLICKVALUE, szValue, _countof(szValue));
if (mir_tstrlen(szValue)) {
if (ld->ptszOPQValue && (ld->ptszOPQValue != ld->ptszQValue))
@@ -137,7 +137,7 @@ void SetMenuEntryProperties(HWND hdlg) if (tvi.lParam) {
ButtonData *bd = (ButtonData*)tvi.lParam;
- TCHAR szValue[256];
+ wchar_t szValue[256];
GetDlgItemText(hdlg, IDC_MENUVALUE, szValue, _countof(szValue));
if (mir_tstrlen(szValue)) {
if (mir_tstrlen(bd->pszOpValue) && (bd->pszOpValue != bd->pszValue))
@@ -177,7 +177,7 @@ void SetMenuEntryProperties(HWND hdlg) }
else {
if (!bd->pszOpValue)
- bd->pszOpValue = mir_tstrdup(LPGENT("Enter Value"));
+ bd->pszOpValue = mir_tstrdup(LPGENW("Enter Value"));
}
if (TreeView_GetParent(hMenuTree, tvi.hItem))
bd->fEntryOpType |= QMF_EX_CHILD;
@@ -198,7 +198,7 @@ void SaveMenuTree() int iBtd = g_iButtonsCount;
BOOL bDeleted = FALSE;
char szMEntry[256] = { '\0' };
- TCHAR strbuf[256];
+ wchar_t strbuf[256];
HTREEITEM hti = NULL;
TVITEM tvi;
@@ -439,7 +439,7 @@ static int BuildButtonsList(HWND hToolBarTree) void MoveItem(HTREEITEM hItem, HTREEITEM hInsertAfter, BOOLEAN bAsChild)
{
TVINSERTSTRUCT tvis;
- //TCHAR strbuf[128];
+ //wchar_t strbuf[128];
HTREEITEM hParent, hChild, hNewItem;
if (!hItem || !hInsertAfter)
@@ -464,7 +464,7 @@ void MoveItem(HTREEITEM hItem, HTREEITEM hInsertAfter, BOOLEAN bAsChild) // prepare the insert structure
{
- TCHAR strbuf[128];
+ wchar_t strbuf[128];
tvis.item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
tvis.item.pszText = strbuf;
@@ -737,8 +737,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) {
TVITEM tvi;
ButtonData* bd = NULL;
- TCHAR strbuf[256];
- TCHAR szLabel[256];
+ wchar_t strbuf[256];
+ wchar_t szLabel[256];
tvi.pszText = strbuf;
tvi.cchTextMax = _countof(strbuf);
@@ -802,7 +802,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) ButtonData *bd = (ButtonData*)tvi.lParam;
if (bd) {
- TCHAR szValue[256];
+ wchar_t szValue[256];
GetDlgItemText(hdlg, IDC_MENUVALUE, szValue, _countof(szValue));
if (mir_tstrlen(szValue)) {
if (bd->pszOpValue && (bd->pszOpValue != bd->pszValue))
@@ -866,8 +866,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) case TVN_ENDLABELEDIT:
{
TVITEM tvi;
- TCHAR strbuf[128];
- TCHAR szLabel[128];
+ wchar_t strbuf[128];
+ wchar_t szLabel[128];
tvi.pszText = strbuf;
tvi.cchTextMax = _countof(strbuf);
@@ -941,7 +941,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) {
TVINSERTSTRUCT tvis;
ListData* ld = NULL;
- TCHAR namebuff[MAX_PATH] = { '\0' };
+ wchar_t namebuff[MAX_PATH] = { '\0' };
int count = TreeView_GetCount(hButtonsList);
if (count > 10) break;
if (g_iOPButtonsCount == 99) {
@@ -1003,7 +1003,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) TVITEM tvi;
ButtonData *bd = NULL;
SortedList *sl = NULL;
- TCHAR namebuff[MAX_PATH] = { '\0' };
+ wchar_t namebuff[MAX_PATH] = { '\0' };
if (!TreeView_GetCount(hButtonsList)) break;
if (!(tvi.hItem = TreeView_GetSelection(hButtonsList))) break;
@@ -1054,7 +1054,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) bd->dwOPFlags |= QMF_DELETNEEDED;
if (tvi.hItem = TreeView_GetChild(hMenuTree, tvi.hItem)) {
- TCHAR strbuf[128];
+ wchar_t strbuf[128];
while (tvi.hItem) {
tvis.hInsertAfter = hti;
tvi.pszText = strbuf;
diff --git a/plugins/QuickReplies/src/events.cpp b/plugins/QuickReplies/src/events.cpp index 2a6cf0a8b2..4a3b57da5c 100644 --- a/plugins/QuickReplies/src/events.cpp +++ b/plugins/QuickReplies/src/events.cpp @@ -59,7 +59,7 @@ int OnModulesLoaded(WPARAM, LPARAM) bbd.cbSize = sizeof(BBButton);
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON;
bbd.pszModuleName = buttonName;
- bbd.ptszTooltip = LPGENT("Quick Replies\r\nLeft button - open menu\r\nRight button - options page");
+ bbd.ptszTooltip = LPGENW("Quick Replies\r\nLeft button - open menu\r\nRight button - options page");
bbd.hIcon = icon.hIcolib;
bbd.dwButtonID = iNumber;
bbd.dwDefPos = 220;
diff --git a/plugins/Quotes/src/CreateFilePath.cpp b/plugins/Quotes/src/CreateFilePath.cpp index 4e2c47a96c..6c73da75b0 100644 --- a/plugins/Quotes/src/CreateFilePath.cpp +++ b/plugins/Quotes/src/CreateFilePath.cpp @@ -1,12 +1,12 @@ #include "StdAfx.h"
-static TCHAR InvalidSymbols[] = { _T('\\'), _T('/'), _T(':'), _T('*'), _T('?'), _T('"'), _T('<'), _T('>'), _T('|') };
+static wchar_t InvalidSymbols[] = { '\\', '/', ':', '*', '?', '"', '<', '>', '|' };
-static TCHAR replace_invalid_symbol(TCHAR chr)
+static wchar_t replace_invalid_symbol(wchar_t chr)
{
for (int i = 0; i < _countof(InvalidSymbols); ++i)
if (chr == InvalidSymbols[i])
- return _T('_');
+ return '_';
return chr;
}
@@ -18,10 +18,10 @@ void prepare_name(tstring& rsName) tstring CreateFilePath(const tstring& rsName)
{
- TCHAR szPath[_MAX_PATH];
+ wchar_t szPath[_MAX_PATH];
::GetModuleFileName(g_hInstance, szPath, _MAX_PATH);
- TCHAR* p = _tcsrchr(szPath, _T('\\'));
+ wchar_t* p = wcsrchr(szPath, '\\');
if (p)
*p = 0;
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp index b92535800b..5ce786b6b5 100644 --- a/plugins/Quotes/src/Forex.cpp +++ b/plugins/Quotes/src/Forex.cpp @@ -43,9 +43,9 @@ PLUGININFOEX Global_pluginInfo = void UpdateMenu(bool bAutoUpdate)
{
if (bAutoUpdate) // to enable auto-update
- Menu_ModifyItem(g_hEnableDisableMenu, LPGENT("Auto Update Enabled"), Quotes_GetIconHandle(IDI_ICON_MAIN));
+ Menu_ModifyItem(g_hEnableDisableMenu, LPGENW("Auto Update Enabled"), Quotes_GetIconHandle(IDI_ICON_MAIN));
else // to disable auto-update
- Menu_ModifyItem(g_hEnableDisableMenu, LPGENT("Auto Update Disabled"), Quotes_GetIconHandle(IDI_ICON_DISABLED));
+ Menu_ModifyItem(g_hEnableDisableMenu, LPGENW("Auto Update Disabled"), Quotes_GetIconHandle(IDI_ICON_DISABLED));
CallService(MS_TTB_SETBUTTONSTATE, reinterpret_cast<WPARAM>(g_hTBButton), !bAutoUpdate ? TTBST_PUSHED : 0);
}
@@ -78,11 +78,11 @@ void InitMenu() {
CMenuItem mi;
mi.flags = CMIF_TCHAR;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Quotes"), 0, Quotes_GetIconHandle(IDI_ICON_MAIN));
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Quotes"), 0, Quotes_GetIconHandle(IDI_ICON_MAIN));
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "B474F556-22B6-42A1-A91E-22FE4F671388");
SET_UID(mi, 0x9de6716, 0x3591, 0x48c4, 0x9f, 0x64, 0x1b, 0xfd, 0xc6, 0xd1, 0x34, 0x97);
- mi.name.t = LPGENT("Enable/Disable Auto Update");
+ mi.name.w = LPGENW("Enable/Disable Auto Update");
mi.position = 10100001;
mi.hIcolibItem = Quotes_GetIconHandle(IDI_ICON_MAIN);
mi.pszService = g_pszAutoUpdateCmd;
@@ -91,7 +91,7 @@ void InitMenu() UpdateMenu(g_bAutoUpdate);
SET_UID(mi, 0x91cbabf6, 0x5073, 0x4a78, 0x84, 0x8, 0x34, 0x61, 0xc1, 0x8a, 0x34, 0xd9);
- mi.name.t = LPGENT("Refresh All Quotes\\Rates");
+ mi.name.w = LPGENW("Refresh All Quotes\\Rates");
mi.position = 20100001;
mi.hIcolibItem = Quotes_GetIconHandle(IDI_ICON_MAIN);
mi.pszService = "Quotes/RefreshAll";
@@ -99,7 +99,7 @@ void InitMenu() CreateServiceFunction(mi.pszService, QuotesMenu_RefreshAll);
SET_UID(mi, 0x3663409c, 0xbd36, 0x473b, 0x9b, 0x4f, 0xff, 0x80, 0xf6, 0x2c, 0xdf, 0x9b);
- mi.name.t = LPGENT("Currency Converter...");
+ mi.name.w = LPGENW("Currency Converter...");
mi.position = 20100002;
mi.hIcolibItem = Quotes_GetIconHandle(IDI_ICON_CURRENCY_CONVERTER);
mi.pszService = g_pszCurrencyConverter;
@@ -107,7 +107,7 @@ void InitMenu() CreateServiceFunction(mi.pszService, QuotesMenu_CurrencyConverter);
SET_UID(mi, 0x7cca4fd9, 0x903f, 0x4b7d, 0x93, 0x7a, 0x18, 0x63, 0x23, 0xd4, 0xa9, 0xa9);
- mi.name.t = LPGENT("Export All Quotes");
+ mi.name.w = LPGENW("Export All Quotes");
mi.hIcolibItem = Quotes_GetIconHandle(IDI_ICON_EXPORT);
mi.pszService = "Quotes/ExportAll";
mi.position = 20100003;
@@ -115,7 +115,7 @@ void InitMenu() CreateServiceFunction(mi.pszService, QuotesMenu_ExportAll);
SET_UID(mi, 0xa994d3b, 0x77c2, 0x4612, 0x8d, 0x5, 0x6a, 0xae, 0x8c, 0x21, 0xbd, 0xc9);
- mi.name.t = LPGENT("Import All Quotes");
+ mi.name.w = LPGENW("Import All Quotes");
mi.hIcolibItem = Quotes_GetIconHandle(IDI_ICON_IMPORT);
mi.pszService = "Quotes/ImportAll";
mi.position = 20100004;
@@ -128,7 +128,7 @@ void InitMenu() Menu_ConfigureItem(mi.root, MCI_OPT_UID, "C259BE01-642C-461E-997D-0E756B2A3AD6");
SET_UID(mi, 0xb9812194, 0x3235, 0x4e76, 0xa3, 0xa4, 0x73, 0x32, 0x96, 0x1c, 0x1c, 0xf4);
- mi.name.t = LPGENT("Refresh");
+ mi.name.w = LPGENW("Refresh");
mi.hIcolibItem = Quotes_GetIconHandle(IDI_ICON_REFRESH);
mi.pszService = "Quotes/RefreshContact";
g_hMenuRefresh = Menu_AddContactMenuItem(&mi, QUOTES_PROTOCOL_NAME);
@@ -136,7 +136,7 @@ void InitMenu() CreateServiceFunction(mi.pszService, QuotesMenu_RefreshContact);
SET_UID(mi, 0x19a16fa2, 0xf370, 0x4201, 0x92, 0x9, 0x25, 0xde, 0x4e, 0x55, 0xf9, 0x1a);
- mi.name.t = LPGENT("Open Log File...");
+ mi.name.w = LPGENW("Open Log File...");
mi.hIcolibItem = NULL;
mi.pszService = "Quotes/OpenLogFile";
g_hMenuOpenLogFile = Menu_AddContactMenuItem(&mi, QUOTES_PROTOCOL_NAME);
@@ -145,7 +145,7 @@ void InitMenu() #ifdef CHART_IMPLEMENT
SET_UID(mi, 0x65da7256, 0x43a2, 0x4857, 0xac, 0x52, 0x1c, 0xb7, 0xff, 0xd7, 0x96, 0xfa);
- mi.name.t = LPGENT("Chart...");
+ mi.name.w = LPGENW("Chart...");
mi.popupPosition = 2;
mi.hIcolibItem = NULL;
mi.pszService = "Quotes/Chart";
@@ -154,7 +154,7 @@ void InitMenu() #endif
SET_UID(mi, 0xac5fc17, 0x5640, 0x4f81, 0xa3, 0x44, 0x8c, 0xb6, 0x9a, 0x5c, 0x98, 0xf);
- mi.name.t = LPGENT("Edit Settings...");
+ mi.name.w = LPGENW("Edit Settings...");
mi.hIcolibItem = NULL;
mi.pszService = "Quotes/EditSettings";
g_hMenuEditSettings = Menu_AddContactMenuItem(&mi, QUOTES_PROTOCOL_NAME);
@@ -269,8 +269,8 @@ int QuotesEventFunc_OptInitialise(WPARAM wp, LPARAM/* lp*/) OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 910000000;
odp.hInstance = g_hInstance;
- odp.ptszTitle = _T(QUOTES_PROTOCOL_NAME);
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszTitle = _T(QUOTES_PROTOCOL_NAME);
+ odp.pwszGroup = LPGENW("Network");
odp.hIcon = Quotes_LoadIconEx(IDI_ICON_MAIN);
odp.flags = ODPF_USERINFOTAB | ODPF_TCHAR;
diff --git a/plugins/Quotes/src/HTTPSession.cpp b/plugins/Quotes/src/HTTPSession.cpp index ebe919e9f9..16583b071a 100644 --- a/plugins/Quotes/src/HTTPSession.cpp +++ b/plugins/Quotes/src/HTTPSession.cpp @@ -97,7 +97,7 @@ public: char* pResult = &*(apBuffer.begin());
int nIndex = find_header(pReply, "Content-Type");
if ((-1 != nIndex) && (NULL != strstr(_strlwr(pReply->headers[nIndex].szValue), "utf-8"))) {
- TCHAR* p = mir_utf8decodeT(pResult);
+ wchar_t* p = mir_utf8decodeT(pResult);
rsResponce = p;
mir_free(p);
}
diff --git a/plugins/Quotes/src/ImportExport.cpp b/plugins/Quotes/src/ImportExport.cpp index 9e7d15d711..ca9e9440fa 100644 --- a/plugins/Quotes/src/ImportExport.cpp +++ b/plugins/Quotes/src/ImportExport.cpp @@ -164,15 +164,15 @@ LPCTSTR prepare_filter(LPTSTR pszBuffer, size_t cBuffer) }
if (nLen < cBuffer)
- *p = _T('\0');
+ *p = '\0';
return pszBuffer;
}
bool show_open_file_dialog(bool bOpen, tstring& rsFile)
{
- TCHAR szBuffer[MAX_PATH];
- TCHAR szFilter[MAX_PATH];
+ wchar_t szBuffer[MAX_PATH];
+ wchar_t szFilter[MAX_PATH];
OPENFILENAME ofn;
memset(&ofn, 0, sizeof(ofn));
@@ -189,7 +189,7 @@ bool show_open_file_dialog(bool bOpen, tstring& rsFile) ofn.nMaxFile = MAX_PATH;
ofn.lpstrFile = szBuffer;
- ofn.lpstrFile[0] = _T('\0');
+ ofn.lpstrFile[0] = '\0';
if (bOpen) {
if (FALSE == GetOpenFileName(&ofn))
diff --git a/plugins/Quotes/src/Locale.cpp b/plugins/Quotes/src/Locale.cpp index 07c9f1a105..ae79f71eb6 100644 --- a/plugins/Quotes/src/Locale.cpp +++ b/plugins/Quotes/src/Locale.cpp @@ -16,7 +16,7 @@ tstring get_int_registry_value(LPCTSTR pszValueName) DWORD dwSize = 0;
lResult = ::RegQueryValueEx(hKey, pszValueName, nullptr, &dwType, nullptr, &dwSize);
if ((ERROR_SUCCESS == lResult) && ((REG_SZ == dwType) || (REG_EXPAND_SZ == dwType))) {
- std::vector<TCHAR> aBuffer(dwSize);
+ std::vector<wchar_t> aBuffer(dwSize);
lResult = ::RegQueryValueEx(hKey, pszValueName, nullptr, nullptr, reinterpret_cast<LPBYTE>(&*aBuffer.begin()), &dwSize);
if (ERROR_SUCCESS == lResult)
std::copy(aBuffer.begin(), aBuffer.end(), std::back_inserter(sResult));
diff --git a/plugins/Quotes/src/Log.cpp b/plugins/Quotes/src/Log.cpp index 055fb22937..f3a038d2a7 100644 --- a/plugins/Quotes/src/Log.cpp +++ b/plugins/Quotes/src/Log.cpp @@ -24,7 +24,7 @@ namespace tofstream file(rsFileName.c_str(), std::ios::ate | std::ios::app);
if (file.good())
{
- TCHAR szTime[20];
+ wchar_t szTime[20];
_tstrtime_s(szTime);
file << szTime << L" ================================>\n" << rsMsg << L"\n\n";
}
diff --git a/plugins/Quotes/src/OptionDukasCopy.cpp b/plugins/Quotes/src/OptionDukasCopy.cpp index f5506cada2..6a5b8b0fc6 100644 --- a/plugins/Quotes/src/OptionDukasCopy.cpp +++ b/plugins/Quotes/src/OptionDukasCopy.cpp @@ -314,6 +314,6 @@ void ShowDukasCopyPropPage(CQuotesProviderDukasCopy* pProvider, WPARAM wp, OPTIO odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG_ECONOMIC_RATES);
odp.pfnDlgProc = EconomicRatesDlgProc;
- odp.ptszTab = const_cast<LPTSTR>(pi.m_sName.c_str());
+ odp.pwszTab = const_cast<LPTSTR>(pi.m_sName.c_str());
Options_AddPage(wp, &odp);
}
diff --git a/plugins/Quotes/src/QuoteChart.cpp b/plugins/Quotes/src/QuoteChart.cpp index 47dca6bfce..25aa422995 100644 --- a/plugins/Quotes/src/QuoteChart.cpp +++ b/plugins/Quotes/src/QuoteChart.cpp @@ -47,7 +47,7 @@ bool read_log_file(MCONTACT hContact, TChart& rChart) line.imbue(loc);
tstring sName;
- std::getline(line, sName, _T('\t'));
+ std::getline(line, sName, '\t');
line >> oDateTime >> dRate;
if ((false == line.fail()) && (true == line.eof())) {
rChart.AddValue(oDateTime, dRate);
@@ -205,8 +205,8 @@ INT_PTR CALLBACK ChartDlgProc(HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) ::SetWindowLongPtr(hDlg, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(hContact));
- static LPCTSTR szSources[] = { LPGENT("Log File"), LPGENT("Miranda's History") };
- static LPCTSTR szFilters[] = { LPGENT("All"), LPGENT("Last Day"), LPGENT("Last Week"), LPGENT("Last Month"), LPGENT("Last Year"), LPGENT("User-Defined") };
+ static LPCTSTR szSources[] = { LPGENW("Log File"), LPGENW("Miranda's History") };
+ static LPCTSTR szFilters[] = { LPGENW("All"), LPGENW("Last Day"), LPGENW("Last Week"), LPGENW("Last Month"), LPGENW("Last Year"), LPGENW("User-Defined") };
for (int i = 0; i < sizeof(szSources) / sizeof(szSources[0]); ++i) {
LPCTSTR p = TranslateTS(szSources[i]);
diff --git a/plugins/Quotes/src/QuoteInfoDlg.cpp b/plugins/Quotes/src/QuoteInfoDlg.cpp index da74285271..ac9471c959 100644 --- a/plugins/Quotes/src/QuoteInfoDlg.cpp +++ b/plugins/Quotes/src/QuoteInfoDlg.cpp @@ -60,7 +60,7 @@ INT_PTR CALLBACK QuoteInfoDlgProcImpl(MCONTACT hContact, HWND hdlg, UINT msg, WP time_t nFetchTime;
if (true == get_fetch_time(nFetchTime, hContact)) {
- TCHAR szTime[50] = { 0 };
+ wchar_t szTime[50] = { 0 };
if (0 == _tctime_s(szTime, 50, &nFetchTime)) {
::SetDlgItemText(hdlg, IDC_EDIT_RATE_FETCH_TIME, szTime);
}
@@ -253,7 +253,7 @@ int Quotes_PrebuildContactMenu(WPARAM wp, LPARAM) tstring sLogFileName;
bool bThereIsLogFile = (true == get_log_file(hContact, sLogFileName))
- && (false == sLogFileName.empty()) && (0 == _taccess(sLogFileName.c_str(), 04));
+ && (false == sLogFileName.empty()) && (0 == _waccess(sLogFileName.c_str(), 04));
if (true == bThereIsLogFile) {
#ifdef CHART_IMPLEMENT
Menu_EnableItem(g_hMenuChart, true);
diff --git a/plugins/Quotes/src/QuotesProviderBase.cpp b/plugins/Quotes/src/QuotesProviderBase.cpp index b98dd35d51..263df84fac 100644 --- a/plugins/Quotes/src/QuotesProviderBase.cpp +++ b/plugins/Quotes/src/QuotesProviderBase.cpp @@ -263,7 +263,7 @@ public: bool bValid = true;
int nCurValue = 0;
for (tstring::const_iterator i = rsFrmt.begin(); i != rsFrmt.end() && bValid && nCurValue < NumValues;) {
- TCHAR chr = *i;
+ wchar_t chr = *i;
switch (chr) {
default:
if (false == std::isspace(chr))
@@ -272,10 +272,10 @@ public: ++i;
break;
- case _T('%'):
+ case '%':
++i;
if (i != rsFrmt.end()) {
- TCHAR t = *i;
+ wchar_t t = *i;
++i;
CQuotesProviderVisitorTendency visitor(hContact, t);
pProvider->Accept(visitor);
@@ -291,15 +291,15 @@ public: }
else bValid = false;
break;
- case _T('>'):
+ case '>':
m_nComparison = Greater;
++i;
break;
- case _T('<'):
+ case '<':
m_nComparison = Less;
++i;
break;
- case _T('='):
+ case '=':
switch (m_nComparison) {
default:
bValid = false;
@@ -372,22 +372,22 @@ tstring format_rate(const IQuotesProvider *pProvider, MCONTACT hContact, const t tstring sResult;
for (tstring::const_iterator i = rsFrmt.begin(); i != rsFrmt.end();) {
- TCHAR chr = *i;
+ wchar_t chr = *i;
switch (chr) {
default:
sResult += chr;
++i;
break;
- case _T('\\'):
+ case '\\':
++i;
if (i != rsFrmt.end()) {
- TCHAR t = *i;
+ wchar_t t = *i;
switch (t) {
- case _T('%'): sResult += L"%"; break;
- case _T('t'): sResult += L"\t"; break;
- case _T('n'): sResult += L"\n"; break;
- case _T('\\'): sResult += L"\\"; break;
+ case '%': sResult += L"%"; break;
+ case 't': sResult += L"\t"; break;
+ case 'n': sResult += L"\n"; break;
+ case '\\': sResult += L"\\"; break;
default: sResult += chr; sResult += t; break;
}
++i;
@@ -395,7 +395,7 @@ tstring format_rate(const IQuotesProvider *pProvider, MCONTACT hContact, const t else sResult += chr;
break;
- case _T('%'):
+ case '%':
++i;
if (i != rsFrmt.end()) {
chr = *i;
@@ -505,12 +505,12 @@ bool show_popup(const IQuotesProvider* pProvider, ppd.lchIcon = Quotes_LoadIconEx(IDI_ICON_DOWN);
}
- CQuotesProviderVisitorFormater visitor(hContact, _T('s'), 0);
+ CQuotesProviderVisitorFormater visitor(hContact, 's', 0);
pProvider->Accept(visitor);
const tstring& sTitle = visitor.GetResult();
mir_tstrncpy(ppd.lptzContactName, sTitle.c_str(), MAX_CONTACTNAME);
{
- ptrT ss(variables_parsedup((TCHAR*)rsFormat.c_str(), 0, hContact));
+ ptrT ss(variables_parsedup((wchar_t*)rsFormat.c_str(), 0, hContact));
tstring sText = format_rate(pProvider, hContact, tstring(ss));
mir_tstrncpy(ppd.lptzText, sText.c_str(), MAX_SECONDLINE);
}
@@ -572,7 +572,7 @@ void CQuotesProviderBase::WriteContactRate(MCONTACT hContact, double dRate, cons if (true == sSymbol.empty())
sSymbol = Quotes_DBGetStringT(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_SYMBOL);
- oNick << std::setfill(_T(' ')) << std::setw(10) << std::left << sSymbol << std::setw(6) << std::right << dRate;
+ oNick << std::setfill(L' ') << std::setw(10) << std::left << sSymbol << std::setw(6) << std::right << dRate;
}
CTendency tendency;
diff --git a/plugins/Quotes/src/QuotesProviderDukasCopy.cpp b/plugins/Quotes/src/QuotesProviderDukasCopy.cpp index e010f98577..8404c2b479 100644 --- a/plugins/Quotes/src/QuotesProviderDukasCopy.cpp +++ b/plugins/Quotes/src/QuotesProviderDukasCopy.cpp @@ -86,7 +86,7 @@ struct CEconomicRateInfo typedef std::vector<CEconomicRateInfo> TEconomicRates;
typedef IHTMLNode::THTMLNodePtr THTMLNodePtr;
-bool string2double(const TCHAR* pszText, double& rValue)
+bool string2double(const wchar_t* pszText, double& rValue)
{
assert(pszText);
try {
diff --git a/plugins/Quotes/src/QuotesProviderFinance.cpp b/plugins/Quotes/src/QuotesProviderFinance.cpp index b200715fa5..9403611d54 100644 --- a/plugins/Quotes/src/QuotesProviderFinance.cpp +++ b/plugins/Quotes/src/QuotesProviderFinance.cpp @@ -260,6 +260,6 @@ void CQuotesProviderFinance::ShowPropertyPage(WPARAM wp, OPTIONSDIALOGPAGE &odp) odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG_OPT_FINANCE);
odp.pfnDlgProc = GoogleFinanceOptDlgProc;
odp.dwInitParam = LPARAM(this);
- odp.ptszTab = const_cast<LPTSTR>(GetInfo().m_sName.c_str());
+ odp.pwszTab = const_cast<LPTSTR>(GetInfo().m_sName.c_str());
Options_AddPage(wp, &odp);
}
diff --git a/plugins/Quotes/src/QuotesProviderGoogle.cpp b/plugins/Quotes/src/QuotesProviderGoogle.cpp index 096def469d..95e15ca85b 100644 --- a/plugins/Quotes/src/QuotesProviderGoogle.cpp +++ b/plugins/Quotes/src/QuotesProviderGoogle.cpp @@ -382,7 +382,7 @@ void CQuotesProviderGoogle::ShowPropertyPage(WPARAM wp, OPTIONSDIALOGPAGE &odp) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG_OPT_GOOGLE);
odp.pfnDlgProc = GoogleOptDlgProc;
- odp.ptszTab = const_cast<LPTSTR>(GetInfo().m_sName.c_str());
+ odp.pwszTab = const_cast<LPTSTR>(GetInfo().m_sName.c_str());
Options_AddPage(wp, &odp);
}
diff --git a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp index 8219497148..cfcda85e76 100644 --- a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp +++ b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp @@ -66,8 +66,8 @@ tstring get_var_value(const tstring& rsHTML, LPCTSTR pszVarName, size_t cVarName if (tstring::npos != n) {
size_t cLengthHTML = rsHTML.size();
for (size_t i = n + cVarNameLength; i < cLengthHTML; ++i) {
- TCHAR c = rsHTML[i];
- if (_T(';') == c)
+ wchar_t c = rsHTML[i];
+ if (';' == c)
break;
sResult.push_back(c);
@@ -87,8 +87,8 @@ tstring get_company_id(const tstring& rsHTML) if (tstring::npos != n) {
size_t cLengthHTML = rsHTML.size();
for (size_t i = n + cVarNameLength; i < cLengthHTML; ++i) {
- TCHAR c = rsHTML[i];
- if (_T(')') == c)
+ wchar_t c = rsHTML[i];
+ if (')' == c)
break;
sResult.push_back(c);
@@ -103,10 +103,10 @@ tstring get_company_name(const tstring& rsHTML) static size_t cVarNameLength = mir_tstrlen(pszVarName);
tstring s = get_var_value(rsHTML, pszVarName, cVarNameLength);
- if (s.size() > 0 && _T('\'') == s[0])
+ if (s.size() > 0 && '\'' == s[0])
s.erase(s.begin());
- if (s.size() > 0 && _T('\'') == s[s.size() - 1])
+ if (s.size() > 0 && '\'' == s[s.size() - 1])
s.erase(s.rbegin().base() - 1);
return s;
@@ -171,8 +171,8 @@ bool get_dif_value(const IHTMLNode::THTMLNodePtr& pNode, CGoogleInfo& rInfo, int // this value is in brackets and it has percentage sign.
// Remove these symbols.
for (tstring::iterator i = sDiff.begin(); i != sDiff.end();) {
- TCHAR s = *i;
- if (_T('(') == s || _T(')') == s || _T('%') == s)
+ wchar_t s = *i;
+ if ('(' == s || ')' == s || '%' == s)
i = sDiff.erase(i);
else
++i;
diff --git a/plugins/Quotes/src/QuotesProviderVisitorFormater.cpp b/plugins/Quotes/src/QuotesProviderVisitorFormater.cpp index 04d3fe7662..f421813bf7 100644 --- a/plugins/Quotes/src/QuotesProviderVisitorFormater.cpp +++ b/plugins/Quotes/src/QuotesProviderVisitorFormater.cpp @@ -1,6 +1,6 @@ #include "StdAfx.h"
-CQuotesProviderVisitorFormater::CQuotesProviderVisitorFormater(MCONTACT hContact, TCHAR chr, int nWidth)
+CQuotesProviderVisitorFormater::CQuotesProviderVisitorFormater(MCONTACT hContact, wchar_t chr, int nWidth)
: m_hContact(hContact),
m_chr(chr),
m_nWidth(nWidth)
@@ -18,23 +18,23 @@ const tstring& CQuotesProviderVisitorFormater::GetResult()const void CQuotesProviderVisitorFormater::Visit(const CQuotesProviderDukasCopy&)
{
- if (_T('d') == m_chr || _T('D') == m_chr)
+ if ('d' == m_chr || 'D' == m_chr)
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_DESCRIPTION);
}
void CQuotesProviderVisitorFormater::Visit(const CQuotesProviderGoogle&)
{
switch (m_chr) {
- case _T('F'):
+ case 'F':
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_FROM_DESCRIPTION);
break;
- case _T('f'):
+ case 'f':
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_FROM_ID);
break;
- case _T('I'):
+ case 'I':
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_TO_DESCRIPTION);
break;
- case _T('i'):
+ case 'i':
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_TO_ID);
break;
}
@@ -67,24 +67,24 @@ static tstring format_fetch_time(const CQuotesProviderBase&, MCONTACT hContact, void CQuotesProviderVisitorFormater::Visit(const CQuotesProviderBase& rProvider)
{
switch (m_chr) {
- case _T('%'):
- case _T('\t'):
- case _T('\\'):
+ case '%':
+ case '\t':
+ case '\\':
m_sResult = m_chr;
break;
- case _T('S'):
+ case 'S':
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_PROVIDER);
break;
- case _T('s'):
+ case 's':
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_SYMBOL);
break;
- case _T('X'):
+ case 'X':
m_sResult = format_fetch_time(rProvider, m_hContact, Quotes_GetTimeFormat(true));
break;
- case _T('x'):
+ case 'x':
m_sResult = format_fetch_time(rProvider, m_hContact, Quotes_GetDateFormat(true));
break;
- case _T('t'):
+ case 't':
{
tstring sFrmt = Quotes_GetDateFormat(true);
sFrmt += L" ";
@@ -92,11 +92,11 @@ void CQuotesProviderVisitorFormater::Visit(const CQuotesProviderBase& rProvider) m_sResult = format_fetch_time(rProvider, m_hContact, sFrmt);
}
break;
- case _T('r'):
- case _T('R'):
+ case 'r':
+ case 'R':
FormatDoubleHelper(DB_STR_QUOTE_CURR_VALUE);
break;
- case _T('p'):
+ case 'p':
FormatDoubleHelper(DB_STR_QUOTE_PREV_VALUE);
break;
}
@@ -105,16 +105,16 @@ void CQuotesProviderVisitorFormater::Visit(const CQuotesProviderBase& rProvider) void CQuotesProviderVisitorFormater::Visit(const CQuotesProviderGoogleFinance&/* rProvider*/)
{
switch (m_chr) {
- case _T('o'):
+ case 'o':
FormatDoubleHelper(DB_STR_GOOGLE_FINANCE_OPEN_VALUE);
break;
- case _T('d'):
+ case 'd':
FormatDoubleHelper(DB_STR_GOOGLE_FINANCE_DIFF, L"0");
break;
- case _T('y'):
+ case 'y':
FormatDoubleHelper(DB_STR_GOOGLE_FINANCE_PERCENT_CHANGE_TO_YERSTERDAY_CLOSE, L"0");
break;
- case _T('n'):
+ case 'n':
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_DESCRIPTION);
break;
}
@@ -146,22 +146,22 @@ void CQuotesProviderVisitorFormater::FormatDoubleHelper(LPCSTR pszDbSet, void CQuotesProviderVisitorFormater::Visit(const CQuotesProviderYahoo&)
{
switch (m_chr) {
- case _T('o'):
+ case 'o':
FormatDoubleHelper(DB_STR_YAHOO_OPEN_VALUE);
break;
- case _T('h'):
+ case 'h':
FormatDoubleHelper(DB_STR_YAHOO_DAY_HIGH);
break;
- case _T('P'):
+ case 'P':
FormatDoubleHelper(DB_STR_YAHOO_PREVIOUS_CLOSE);
break;
- case _T('c'):
+ case 'c':
FormatDoubleHelper(DB_STR_YAHOO_CHANGE);
break;
- case _T('g'):
+ case 'g':
FormatDoubleHelper(DB_STR_YAHOO_DAY_LOW);
break;
- case _T('n'):
+ case 'n':
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_DESCRIPTION);
break;
}
diff --git a/plugins/Quotes/src/QuotesProviderVisitorFormater.h b/plugins/Quotes/src/QuotesProviderVisitorFormater.h index 9ae3408d6a..0b03842a35 100644 --- a/plugins/Quotes/src/QuotesProviderVisitorFormater.h +++ b/plugins/Quotes/src/QuotesProviderVisitorFormater.h @@ -4,7 +4,7 @@ class CQuotesProviderVisitorFormater : public CQuotesProviderVisitor
{
public:
- CQuotesProviderVisitorFormater(MCONTACT hContact, TCHAR chr, int nWidth);
+ CQuotesProviderVisitorFormater(MCONTACT hContact, wchar_t chr, int nWidth);
~CQuotesProviderVisitorFormater();
const tstring& GetResult()const;
@@ -22,7 +22,7 @@ private: private:
MCONTACT m_hContact;
- TCHAR m_chr;
+ wchar_t m_chr;
tstring m_sResult;
int m_nWidth;
};
diff --git a/plugins/Quotes/src/QuotesProviderVisitorTendency.cpp b/plugins/Quotes/src/QuotesProviderVisitorTendency.cpp index a4899909e1..1e6d4fe384 100644 --- a/plugins/Quotes/src/QuotesProviderVisitorTendency.cpp +++ b/plugins/Quotes/src/QuotesProviderVisitorTendency.cpp @@ -1,6 +1,6 @@ #include "stdafx.h"
-CQuotesProviderVisitorTendency::CQuotesProviderVisitorTendency(MCONTACT hContact, TCHAR chr)
+CQuotesProviderVisitorTendency::CQuotesProviderVisitorTendency(MCONTACT hContact, wchar_t chr)
: m_hContact(hContact), m_chr(chr), m_bValid(false), m_dResult(0.0)
{
}
@@ -8,11 +8,11 @@ CQuotesProviderVisitorTendency::CQuotesProviderVisitorTendency(MCONTACT hContact void CQuotesProviderVisitorTendency::Visit(const CQuotesProviderBase&)
{
switch (m_chr) {
- case _T('r'):
- case _T('R'):
+ case 'r':
+ case 'R':
GetValue(DB_STR_QUOTE_CURR_VALUE);
break;
- case _T('p'):
+ case 'p':
GetValue(DB_STR_QUOTE_PREV_VALUE);
break;
}
@@ -21,13 +21,13 @@ void CQuotesProviderVisitorTendency::Visit(const CQuotesProviderBase&) void CQuotesProviderVisitorTendency::Visit(const CQuotesProviderGoogleFinance&)
{
switch (m_chr) {
- case _T('o'):
+ case 'o':
GetValue(DB_STR_GOOGLE_FINANCE_OPEN_VALUE);
break;
- case _T('d'):
+ case 'd':
GetValue(DB_STR_GOOGLE_FINANCE_DIFF);
break;
- case _T('y'):
+ case 'y':
GetValue(DB_STR_GOOGLE_FINANCE_PERCENT_CHANGE_TO_YERSTERDAY_CLOSE);
break;
}
@@ -36,19 +36,19 @@ void CQuotesProviderVisitorTendency::Visit(const CQuotesProviderGoogleFinance&) void CQuotesProviderVisitorTendency::Visit(const CQuotesProviderYahoo&)
{
switch (m_chr) {
- case _T('o'):
+ case 'o':
GetValue(DB_STR_YAHOO_OPEN_VALUE);
break;
- case _T('h'):
+ case 'h':
GetValue(DB_STR_YAHOO_DAY_HIGH);
break;
- case _T('P'):
+ case 'P':
GetValue(DB_STR_YAHOO_PREVIOUS_CLOSE);
break;
- case _T('c'):
+ case 'c':
GetValue(DB_STR_YAHOO_CHANGE);
break;
- case _T('g'):
+ case 'g':
GetValue(DB_STR_YAHOO_DAY_LOW);
break;
}
diff --git a/plugins/Quotes/src/QuotesProviderVisitorTendency.h b/plugins/Quotes/src/QuotesProviderVisitorTendency.h index 9f81605220..537f8bd0a6 100644 --- a/plugins/Quotes/src/QuotesProviderVisitorTendency.h +++ b/plugins/Quotes/src/QuotesProviderVisitorTendency.h @@ -4,7 +4,7 @@ class CQuotesProviderVisitorTendency : public CQuotesProviderVisitor
{
public:
- CQuotesProviderVisitorTendency(MCONTACT hContact, TCHAR chr);
+ CQuotesProviderVisitorTendency(MCONTACT hContact, wchar_t chr);
bool IsValid()const{ return m_bValid; }
double GetResult()const{ return m_dResult; }
@@ -19,7 +19,7 @@ private: private:
MCONTACT m_hContact;
- TCHAR m_chr;
+ wchar_t m_chr;
bool m_bValid;
double m_dResult;
};
diff --git a/plugins/Quotes/src/QuotesProviderYahoo.cpp b/plugins/Quotes/src/QuotesProviderYahoo.cpp index e590472834..cef09471c2 100644 --- a/plugins/Quotes/src/QuotesProviderYahoo.cpp +++ b/plugins/Quotes/src/QuotesProviderYahoo.cpp @@ -2,10 +2,10 @@ void remove_quotes(tstring& s)
{
- if (*s.begin() == _T('"'))
+ if (*s.begin() == '"')
s.erase(s.begin());
- if (*s.rbegin() == _T('"')) {
+ if (*s.rbegin() == '"') {
tstring::iterator i(s.begin());
std::advance(i, s.size() - 1);
s.erase(i);
@@ -14,12 +14,12 @@ void remove_quotes(tstring& s) void remove_end_of_line(tstring& s)
{
- if (*s.rbegin() == _T('\n')) {
+ if (*s.rbegin() == '\n') {
tstring::iterator i(s.begin());
std::advance(i, s.size() - 1);
s.erase(i);
}
- if (*s.rbegin() == _T('\r')) {
+ if (*s.rbegin() == '\r') {
tstring::iterator i(s.begin());
std::advance(i, s.size() - 1);
s.erase(i);
@@ -83,7 +83,7 @@ void CQuotesProviderYahoo::RefreshQuotes(TContracts& anContacts) remove_end_of_line(sLine);
TStrings asStrings;
- for (tstring::size_type nPos = sLine.find(_T(',')); nPos != tstring::npos; nPos = sLine.find(_T(','))) {
+ for (tstring::size_type nPos = sLine.find(','); nPos != tstring::npos; nPos = sLine.find(',')) {
tstring::iterator i(sLine.begin());
std::advance(i, nPos);
tstring s(sLine.begin(), i);
diff --git a/plugins/Quotes/src/SettingsDlg.cpp b/plugins/Quotes/src/SettingsDlg.cpp index ee548a211e..5e8b0f0751 100644 --- a/plugins/Quotes/src/SettingsDlg.cpp +++ b/plugins/Quotes/src/SettingsDlg.cpp @@ -82,25 +82,25 @@ void update_all_controls(HWND hDlg) ::EnableWindow(::GetDlgItem(hDlg, IDC_BUTTON_POPUP_SETTINGS), (bIsCheckedContactSpec&&bIsPopupServiceEnabled));
}
-std::vector<TCHAR> get_filter()
+std::vector<wchar_t> get_filter()
{
- std::vector<TCHAR> aFilter;
- LPCTSTR pszFilterParts[] = { LPGENT("Log Files (*.txt,*.log)"), L"*.txt;*.log", LPGENT("All files (*.*)"), L"*.*" };
+ std::vector<wchar_t> aFilter;
+ LPCTSTR pszFilterParts[] = { LPGENW("Log Files (*.txt,*.log)"), L"*.txt;*.log", LPGENW("All files (*.*)"), L"*.*" };
for (int i = 0; i < sizeof(pszFilterParts) / sizeof(pszFilterParts[0]); ++i) {
tstring sPart = TranslateTS(pszFilterParts[i]);
std::copy(sPart.begin(), sPart.end(), std::back_inserter(aFilter));
- aFilter.push_back(_T('\0'));
+ aFilter.push_back('\0');
}
- aFilter.push_back(_T('\0'));
+ aFilter.push_back('\0');
return aFilter;
}
void select_log_file(HWND hDlg)
{
- std::vector<TCHAR> aFileBuffer(_MAX_PATH * 2, _T('\0'));
+ std::vector<wchar_t> aFileBuffer(_MAX_PATH * 2, '\0');
LPTSTR pszFile = &*aFileBuffer.begin();
- std::vector<TCHAR> aFilterBuffer = get_filter();
+ std::vector<wchar_t> aFilterBuffer = get_filter();
LPCTSTR pszFilter = &*aFilterBuffer.begin();
OPENFILENAME ofn = { 0 };
@@ -957,7 +957,7 @@ bool ShowSettingsDlg(HWND hWndParent, CAdvProviderSettings* pAdvSettings) static void replace_invalid_char(tstring::value_type& rChar, tstring::value_type repl)
{
- static const TCHAR charInvalidSigns[] = { _T('\\'), _T('/'), _T(':'), _T('*'), _T('?'), _T('\"'), _T('<'), _T('>'), _T('|') };
+ static const wchar_t charInvalidSigns[] = { '\\', '/', ':', '*', '?', '\"', '<', '>', '|' };
for (int i = 0; i < sizeof(charInvalidSigns) / sizeof(charInvalidSigns[0]); ++i) {
if (rChar == charInvalidSigns[i]) {
@@ -976,13 +976,13 @@ tstring GenerateLogFileName(const tstring &rsLogFilePattern, const tstring &rsQu tstring::size_type n = sPath.find(g_pszVariableQuoteName);
if (tstring::npos != n) {
tstring s = rsQuoteSymbol;
- std::for_each(s.begin(), s.end(), boost::bind(replace_invalid_char, _1, _T('_')));
+ std::for_each(s.begin(), s.end(), boost::bind(replace_invalid_char, _1, '_'));
sPath.replace(n, mir_tstrlen(g_pszVariableQuoteName), s.c_str());
}
}
if (nFlags & glfnResolveUserProfile) {
- TCHAR *ptszParsedName = Utils_ReplaceVarsT(sPath.c_str());
+ wchar_t *ptszParsedName = Utils_ReplaceVarsT(sPath.c_str());
if (ptszParsedName) {
sPath = ptszParsedName;
mir_free(ptszParsedName);
diff --git a/plugins/Quotes/src/WinCtrlHelper.cpp b/plugins/Quotes/src/WinCtrlHelper.cpp index 18662cb0cd..78be2d2ced 100644 --- a/plugins/Quotes/src/WinCtrlHelper.cpp +++ b/plugins/Quotes/src/WinCtrlHelper.cpp @@ -15,7 +15,7 @@ static INT_PTR CALLBACK VariableListDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPAR std::for_each(raSpec.begin(), raSpec.end(),
[&o](const CQuotesProviderVisitorFormatSpecificator::CFormatSpecificator& spec)
{
- o << spec.m_sSymbol << _T('\t') << spec.m_sDesc << L"\r\n";
+ o << spec.m_sSymbol << '\t' << spec.m_sDesc << L"\r\n";
});
::SetDlgItemText(hWnd, IDC_EDIT_VARIABLE, o.str().c_str());
}
diff --git a/plugins/Quotes/src/WinCtrlHelper.h b/plugins/Quotes/src/WinCtrlHelper.h index 52e4521f24..1c5777d45d 100644 --- a/plugins/Quotes/src/WinCtrlHelper.h +++ b/plugins/Quotes/src/WinCtrlHelper.h @@ -7,7 +7,7 @@ inline tstring get_window_text(HWND hWnd) {
int cBytes = ::GetWindowTextLength(hWnd);
- std::vector<TCHAR> aBuf(cBytes + 1);
+ std::vector<wchar_t> aBuf(cBytes + 1);
LPTSTR pBuffer = &*(aBuf.begin());
::GetWindowText(hWnd, pBuffer, cBytes + 1);
diff --git a/plugins/Quotes/src/stdafx.h b/plugins/Quotes/src/stdafx.h index bb38b5b290..d4c5d2ffc1 100644 --- a/plugins/Quotes/src/stdafx.h +++ b/plugins/Quotes/src/stdafx.h @@ -50,7 +50,7 @@ typedef std::wistream tistream; typedef boost::posix_time::wtime_input_facet ttime_input_facet;
typedef boost::posix_time::wtime_facet ttime_facet;
-inline std::string quotes_t2a(const TCHAR* t)
+inline std::string quotes_t2a(const wchar_t* t)
{
std::string s;
char* p = mir_t2a(t);
@@ -64,7 +64,7 @@ inline std::string quotes_t2a(const TCHAR* t) inline tstring quotes_a2t(const char* s)
{
tstring t;
- TCHAR* p = mir_a2t(s);
+ wchar_t* p = mir_a2t(s);
if (p) {
t = p;
mir_free(p);
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index 45e07dd431..86758e4288 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -222,7 +222,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM int i=0;
cmultimap::iterator curContact;
- std::tstring str;
+ std::wstring str;
char strtim[256 + 16];
string strtimformat;
@@ -237,7 +237,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM for(curContact = DlgDat->Contacts->begin(); curContact != DlgDat->Contacts->end(); curContact++) {
if (curContact->second != NULL && db_get_b(curContact->second, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0 ) {
- TCHAR *cname = ( TCHAR* )pcli->pfnGetContactDisplayName(curContact->second, 0);
+ wchar_t *cname = ( wchar_t* )pcli->pfnGetContactDisplayName(curContact->second, 0);
if ( cname == NULL )
continue;
@@ -504,9 +504,9 @@ int OnMsgEvent(WPARAM, LPARAM lParam) static int OnPrebuildContactMenu(WPARAM hContact, LPARAM)
{
if (db_get_b(hContact, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0)
- Menu_ModifyItem(hMenuItemRemove, LPGENT("Ignore Contact"));
+ Menu_ModifyItem(hMenuItemRemove, LPGENW("Ignore Contact"));
else
- Menu_ModifyItem(hMenuItemRemove, LPGENT("Show Contact"));
+ Menu_ModifyItem(hMenuItemRemove, LPGENW("Show Contact"));
return 0;
}
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index e40c5d048b..5df0d124b5 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -144,11 +144,11 @@ extern "C" int __declspec(dllexport) Unload(void) INT_PTR RemoveAllService(WPARAM, LPARAM)
{
if (gIniFile[0] == '\0') {
- MessageBox(NULL, TranslateT("Configuration file could not be found!"), TranslateT(MSGBOX_TITLE), MB_OK | MB_ICONERROR);
+ MessageBox(NULL, TranslateT("Configuration file could not be found!"), TranslateW(MSGBOX_TITLE), MB_OK | MB_ICONERROR);
return -1;
}
- if (MessageBox(NULL, TranslateT(NOTICE_TEXT), TranslateT(MSGBOX_TITLE), MB_YESNO) == IDYES) {
+ if (MessageBox(NULL, TranslateW(NOTICE_TEXT), TranslateW(MSGBOX_TITLE), MB_YESNO) == IDYES) {
SetProtocolsOffline();
RemoveUsers();
RemoveSettings();
@@ -156,7 +156,7 @@ INT_PTR RemoveAllService(WPARAM, LPARAM) RemoveDirectories();
DisablePlugins();
- MessageBox(NULL, TranslateT("Settings are deleted now."), TranslateT(MSGBOX_TITLE), MB_OK | MB_ICONINFORMATION);
+ MessageBox(NULL, TranslateT("Settings are deleted now."), TranslateW(MSGBOX_TITLE), MB_OK | MB_ICONINFORMATION);
}
return 0;
diff --git a/plugins/RemovePersonalSettings/src/stdafx.h b/plugins/RemovePersonalSettings/src/stdafx.h index ed36365f1d..482fbbad7f 100644 --- a/plugins/RemovePersonalSettings/src/stdafx.h +++ b/plugins/RemovePersonalSettings/src/stdafx.h @@ -39,10 +39,10 @@ #define METACONTACTS_PROTOCOL_NAME "MetaContacts"
-#define NOTICE_TEXT LPGEN("All your personal settings will be erased!\n\
+#define NOTICE_TEXT LPGENW("All your personal settings will be erased!\n\
Make sure you are running this from a copy of your profile (and not over the original one).\n\
Running this will erase files/folders under Miranda main folder.\n\n\
Are you sure you want to remove all your personal settings?\n\n\
(You cannot say that I don't told you about the risks :P)")
-#define MSGBOX_TITLE LPGEN("Remove Personal Settings")
+#define MSGBOX_TITLE LPGENW("Remove Personal Settings")
diff --git a/plugins/SMS/src/SMSConstans.h b/plugins/SMS/src/SMSConstans.h index b347620cbf..b212510210 100644 --- a/plugins/SMS/src/SMSConstans.h +++ b/plugins/SMS/src/SMSConstans.h @@ -33,7 +33,7 @@ struct FontOptionsList
{
COLORREF defColour;
- TCHAR* szDefFace;
+ wchar_t* szDefFace;
BYTE defStyle;
char defSize;
}
@@ -66,8 +66,8 @@ int SendSMSMenuCommand(WPARAM wParam,LPARAM lParam); #define SMS_READ "/ReadSms"
#define SMS_READ_ACK "/ReadSmsAck"
#define SMS_SEND "/SendSMS"
-#define SMS_SEND_STR LPGENT("Send &SMS...")
-#define SMS_SEND_CM_STR LPGENT("&SMS Message")
+#define SMS_SEND_STR LPGENW("Send &SMS...")
+#define SMS_SEND_CM_STR LPGENW("&SMS Message")
// ñòðóêòóðà ñîäåðæàùàÿ èíôîðìàöèþ î ñåðâèñàõ/ôóíêöèÿõ
struct SERVICE_ITEM
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp index d7a411f20b..3ad9cc6b53 100644 --- a/plugins/SMS/src/SMS_svc.cpp +++ b/plugins/SMS/src/SMS_svc.cpp @@ -32,7 +32,7 @@ int LoadModules(void) SET_UID(mi, 0x3ce387db, 0xbaac, 0x490f, 0xac, 0xab, 0x8c, 0xf7, 0xe9, 0xcd, 0x86, 0xa1);
mi.position = 300050000;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_SMS);
- mi.name.t = SMS_SEND_STR;
+ mi.name.w = SMS_SEND_STR;
mi.pszService = szServiceFunction;
mi.flags = CMIF_TCHAR;
Menu_AddMainMenuItem(&mi);
@@ -40,7 +40,7 @@ int LoadModules(void) SET_UID(mi, 0x736e4cff, 0x769e, 0x45dc, 0x8b, 0x78, 0x83, 0xf9, 0xe4, 0xbb, 0x81, 0x9e);
mi.position = -2000070000;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_SMS);
- mi.name.t = SMS_SEND_CM_STR;
+ mi.name.w = SMS_SEND_CM_STR;
mi.pszService = szServiceFunction;
mi.flags = CMIF_TCHAR;
ssSMSSettings.hContactMenuItems[0] = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp index 7c42dc769c..d6256e4726 100644 --- a/plugins/SMS/src/functions.cpp +++ b/plugins/SMS/src/functions.cpp @@ -402,31 +402,31 @@ DWORD ReplaceInBuff(LPVOID lpInBuff, size_t dwInBuffSize, size_t dwReplaceItemsC static const LPTSTR lpszXMLTags[] = { TEXT("'"), TEXT("""), TEXT("&"), TEXT("<"), TEXT(">") };
-static const size_t dwXMLTagsCount[] = { (6 * sizeof(TCHAR)), (6 * sizeof(TCHAR)), (5 * sizeof(TCHAR)), (4 * sizeof(TCHAR)), (4 * sizeof(TCHAR)) };
+static const size_t dwXMLTagsCount[] = { (6 * sizeof(wchar_t)), (6 * sizeof(wchar_t)), (5 * sizeof(wchar_t)), (4 * sizeof(wchar_t)), (4 * sizeof(wchar_t)) };
static const LPTSTR lpszXMLSymbols[] = { TEXT("\'"), TEXT("\""), TEXT("&"), TEXT("<"), TEXT(">") };
-static const size_t dwXMLSymbolsCount[] = { sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR) };
+static const size_t dwXMLSymbolsCount[] = { sizeof(wchar_t), sizeof(wchar_t), sizeof(wchar_t), sizeof(wchar_t), sizeof(wchar_t) };
//Decode XML coded string. The function translate special xml code into standard characters.
DWORD DecodeXML(LPTSTR lptszMessage, size_t dwMessageSize, LPTSTR lptszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize)
{
- DWORD dwRet = ReplaceInBuff(lptszMessage, (dwMessageSize*sizeof(TCHAR)), _countof(lpszXMLTags), (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, lptszMessageConverted, (dwMessageConvertedBuffSize*sizeof(TCHAR)), pdwMessageConvertedSize);
+ DWORD dwRet = ReplaceInBuff(lptszMessage, (dwMessageSize*sizeof(wchar_t)), _countof(lpszXMLTags), (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, lptszMessageConverted, (dwMessageConvertedBuffSize*sizeof(wchar_t)), pdwMessageConvertedSize);
- if (pdwMessageConvertedSize) (*pdwMessageConvertedSize) /= sizeof(TCHAR);
+ if (pdwMessageConvertedSize) (*pdwMessageConvertedSize) /= sizeof(wchar_t);
return(dwRet);
}
//Encode XML coded string. The function translate special saved xml characters into special characters.
DWORD EncodeXML(LPTSTR lptszMessage, size_t dwMessageSize, LPTSTR lptszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize)
{
- DWORD dwRet = ReplaceInBuff(lptszMessage, (dwMessageSize*sizeof(TCHAR)), _countof(lpszXMLTags), (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, lptszMessageConverted, (dwMessageConvertedBuffSize*sizeof(TCHAR)), pdwMessageConvertedSize);
+ DWORD dwRet = ReplaceInBuff(lptszMessage, (dwMessageSize*sizeof(wchar_t)), _countof(lpszXMLTags), (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, lptszMessageConverted, (dwMessageConvertedBuffSize*sizeof(wchar_t)), pdwMessageConvertedSize);
- if (pdwMessageConvertedSize) (*pdwMessageConvertedSize) /= sizeof(TCHAR);
+ if (pdwMessageConvertedSize) (*pdwMessageConvertedSize) /= sizeof(wchar_t);
return(dwRet);
}
//(Taken from Miranda-IM source code:)
-BYTE MsgDlgGetFontDefaultCharset(const TCHAR*)
+BYTE MsgDlgGetFontDefaultCharset(const wchar_t*)
{
return(DEFAULT_CHARSET);
}
diff --git a/plugins/SMS/src/options.cpp b/plugins/SMS/src/options.cpp index 2d59221d13..5a464a79c5 100644 --- a/plugins/SMS/src/options.cpp +++ b/plugins/SMS/src/options.cpp @@ -31,7 +31,7 @@ WORD wSMSSignControlsList[] = { IDC_BEGIN, IDC_END, IDC_SIGNATURE, IDC_SIGNGROUP INT_PTR CALLBACK DlgProcEditorOptions(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR tszSign[1024];
+ wchar_t tszSign[1024];
switch(msg){
case WM_INITDIALOG:
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp index fad6ded482..9779f46907 100644 --- a/plugins/SMS/src/receive.cpp +++ b/plugins/SMS/src/receive.cpp @@ -36,7 +36,7 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) return 0;
char szPhone[MAX_PHONE_LEN] = { 0 };
- TCHAR tszPhone[MAX_PHONE_LEN] = { 0 };
+ wchar_t tszPhone[MAX_PHONE_LEN] = { 0 };
LPSTR lpszXML = (LPSTR)((ACKDATA*)lParam)->lParam, lpszData, lpszPhone;
size_t dwXMLSize = 0, dwDataSize, dwPhoneSize;
ACKDATA *ack = ((ACKDATA*)lParam);
@@ -138,7 +138,7 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) if (ack->result == ACKRESULT_FAILED || CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "no", 2) == CSTR_EQUAL) {
char szBuff[1024];
- TCHAR tszErrorMessage[1028];
+ wchar_t tszErrorMessage[1028];
LPSTR lpszErrorDescription;
if (SendSMSWindowMultipleGet(hWndDlg)) {
@@ -209,7 +209,7 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) int handleNewMessage(WPARAM hContact, LPARAM hDbEvent)
{
char szServiceFunction[MAX_PATH], *pszServiceFunctionName;
- TCHAR szToolTip[MAX_PATH];
+ wchar_t szToolTip[MAX_PATH];
DBEVENTINFO dbei = { sizeof(dbei) };
if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == -1)
diff --git a/plugins/SMS/src/senddlg.cpp b/plugins/SMS/src/senddlg.cpp index 66f7581eeb..96f36d700a 100644 --- a/plugins/SMS/src/senddlg.cpp +++ b/plugins/SMS/src/senddlg.cpp @@ -142,7 +142,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA SendSMSWindowUpdateAccountList(hWndDlg);
{
- TCHAR tszSign[1024];
+ wchar_t tszSign[1024];
size_t dwSignLen = 0;
if (DB_SMS_GetByte(NULL, "UseSignature", SMS_DEFAULT_USESIGNATURE))
@@ -209,7 +209,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA case WM_TIMER:
if (wParam == TIMERID_MSGSEND) {
HWND hwndTimeOut;
- TCHAR tszMessage[1028], tszPhone[MAX_PHONE_LEN];
+ wchar_t tszMessage[1028], tszPhone[MAX_PHONE_LEN];
if (psswdWindowData->bMultiple) {
TVITEM tvi;
@@ -268,11 +268,11 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA break;
case TIMEDOUT_RETRY:
{
- TCHAR tszPhone[MAX_PHONE_LEN];
+ wchar_t tszPhone[MAX_PHONE_LEN];
size_t dwPhoneSize;
size_t dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
- LPTSTR lpwszMessage = (LPTSTR)MEMALLOC(((dwMessageSize + 4)*sizeof(TCHAR)));
+ LPTSTR lpwszMessage = (LPTSTR)MEMALLOC(((dwMessageSize + 4)*sizeof(wchar_t)));
if (lpwszMessage) {
if (psswdWindowData->bMultiple) {
TVITEM tvi;
@@ -303,7 +303,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA case IDC_ADDNUMBER:
{
- TCHAR tszPhone[MAX_PHONE_LEN];
+ wchar_t tszPhone[MAX_PHONE_LEN];
if (IsPhoneW(tszPhone, GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, _countof(tszPhone)))) {
TVINSERTSTRUCT tvis = { 0 };
tvis.item.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
@@ -345,7 +345,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA }
}
else {
- TCHAR tszPhone[MAX_PHONE_LEN];
+ wchar_t tszPhone[MAX_PHONE_LEN];
size_t dwPhoneSize = GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, _countof(tszPhone));
if (IsPhoneW(tszPhone, dwPhoneSize)) {
size_t dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
@@ -382,7 +382,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA break;
case IDC_MESSAGE:
if (HIWORD(wParam) == EN_CHANGE) {
- TCHAR tszBuff[MAX_PATH];
+ wchar_t tszBuff[MAX_PATH];
size_t dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
EnableWindow(GetDlgItem(hWndDlg, IDOK), dwMessageSize != 0);
@@ -394,7 +394,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA {
BOOL bCont = TRUE;
char szBuff[MAX_PATH];
- TCHAR tszPhone[MAX_PHONE_LEN];
+ wchar_t tszPhone[MAX_PHONE_LEN];
DBVARIANT dbv;
size_t dwPhoneSize = GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, (_countof(tszPhone) - 4));
@@ -558,7 +558,7 @@ HWND SendSMSWindowAdd(MCONTACT hContact) ListMTUnLock(&ssSMSSettings.lmtSendSMSWindowsListMT);
LPTSTR lptszContactDisplayName = pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR tszTitle[MAX_PATH];
+ wchar_t tszTitle[MAX_PATH];
mir_sntprintf(tszTitle, L"%s - %s", lptszContactDisplayName, TranslateT("Send SMS"));
SetWindowText(psswdWindowData->hWnd, tszTitle);
SendDlgItemMessage(psswdWindowData->hWnd, IDC_NAME, CB_ADDSTRING, 0, (LPARAM)lptszContactDisplayName);
@@ -841,12 +841,12 @@ HWND SendSMSWindowIsOtherInstanceHContact(MCONTACT hContact) //
void SendSMSWindowNext(HWND hWndDlg)
{
- TCHAR tszPhone[MAX_PHONE_LEN];
+ wchar_t tszPhone[MAX_PHONE_LEN];
size_t dwPhoneSize, dwMessageSize;
TVITEM tvi = { 0 };
dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
- LPTSTR lptszMessage = (LPTSTR)MEMALLOC(((dwMessageSize + 4)*sizeof(TCHAR)));
+ LPTSTR lptszMessage = (LPTSTR)MEMALLOC(((dwMessageSize + 4)*sizeof(wchar_t)));
if (!lptszMessage)
return;
@@ -952,7 +952,7 @@ void SendSMSWindowsUpdateAllAccountLists() void AddContactPhonesToComboToListParam(MCONTACT hContact, LPSTR lpszModule, LPSTR lpszValueName, HWND hWndList)
{
char szBuff[MAX_PATH];
- TCHAR tszPhone[MAX_PHONE_LEN], tszPhoneRaw[MAX_PHONE_LEN];
+ wchar_t tszPhone[MAX_PHONE_LEN], tszPhoneRaw[MAX_PHONE_LEN];
size_t i, dwPhoneSize;
if (DB_GetStaticStringW(hContact, lpszModule, lpszValueName, tszPhoneRaw, _countof(tszPhoneRaw), &dwPhoneSize)) {
@@ -1003,7 +1003,7 @@ void AddContactPhonesToCombo(HWND hWnd, MCONTACT hContact) void AddContactPhonesToTreeViewParam(MCONTACT hContact, LPSTR lpszModule, LPSTR lpszValueName, HWND hWndList, HTREEITEM *phParent)
{
char szBuff[MAX_PATH];
- TCHAR tszPhone[MAX_PHONE_LEN], tszPhoneRaw[MAX_PHONE_LEN];
+ wchar_t tszPhone[MAX_PHONE_LEN], tszPhoneRaw[MAX_PHONE_LEN];
size_t i, dwPhoneSize;
TVINSERTSTRUCT tvis = { 0 };
@@ -1073,7 +1073,7 @@ size_t GetSMSMessageLenMax(HWND hWndDlg) size_t dwMessageSize, dwLenght = 160;
dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
- LPTSTR lptszMessage = (LPTSTR)MEMALLOC(((dwMessageSize + 4)*sizeof(TCHAR)));
+ LPTSTR lptszMessage = (LPTSTR)MEMALLOC(((dwMessageSize + 4)*sizeof(wchar_t)));
if (lptszMessage) {
dwMessageSize = GetDlgItemText(hWndDlg, IDC_MESSAGE, lptszMessage, (int)dwMessageSize + 2);
if (dwMessageSize != WideCharToMultiByte(CP_UTF8, 0, lptszMessage, (int)dwMessageSize, NULL, 0, NULL, NULL))
diff --git a/plugins/Scriver/src/chat/chat.h b/plugins/Scriver/src/chat/chat.h index 949202712a..e1d2c3a693 100644 --- a/plugins/Scriver/src/chat/chat.h +++ b/plugins/Scriver/src/chat/chat.h @@ -60,7 +60,7 @@ struct LOGSTREAMDATA : public GCLogStreamDataBase struct SESSION_INFO : public GCSessionInfoBase, public CommonWindowData
{
- TCHAR szSearch[255];
+ wchar_t szSearch[255];
int desiredInputAreaHeight;
};
@@ -79,7 +79,7 @@ void LoadMsgLogBitmaps(void); void FreeMsgLogBitmaps(void);
// window.c
-int GetTextPixelSize( TCHAR* pszText, HFONT hFont, BOOL bWidth);
+int GetTextPixelSize( wchar_t* pszText, HFONT hFont, BOOL bWidth);
// options.c
int OptionsInit(void);
@@ -89,13 +89,13 @@ void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground); // manager.c
HWND SM_FindWindowByContact(MCONTACT hContact);
-SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const TCHAR* pszOriginal, const TCHAR* pszCurrent);
+SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const wchar_t* pszOriginal, const wchar_t* pszCurrent);
char SM_GetStatusIndicator(SESSION_INFO *si, USERINFO *ui);
// tools.c
BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight, int bManyFix);
-TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2) ;
-UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText);
+wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2) ;
+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);
//////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/Scriver/src/chat/main.cpp b/plugins/Scriver/src/chat/main.cpp index 29b88790d4..a223f9898d 100644 --- a/plugins/Scriver/src/chat/main.cpp +++ b/plugins/Scriver/src/chat/main.cpp @@ -154,7 +154,7 @@ static void OnLoadSettings() int Chat_Load()
{
- CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENT("Messaging") L"/" LPGENT("Group chats"), FONTMODE_SKIP };
+ CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Messaging") L"/" LPGENW("Group chats"), FONTMODE_SKIP };
mir_getCI(&data);
saveCI = *pci;
diff --git a/plugins/Scriver/src/chat/manager.cpp b/plugins/Scriver/src/chat/manager.cpp index 823547751c..e71eecc249 100644 --- a/plugins/Scriver/src/chat/manager.cpp +++ b/plugins/Scriver/src/chat/manager.cpp @@ -34,13 +34,13 @@ HWND SM_FindWindowByContact(MCONTACT hContact) return NULL;
}
-SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const TCHAR* pszOriginal, const TCHAR* pszCurrent)
+SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const wchar_t* pszOriginal, const wchar_t* pszCurrent)
{
SESSION_INFO* pResult = NULL;
if (prevSession == NULL && my_strstri(currSession->ptszName, pszOriginal) == currSession->ptszName)
pResult = currSession;
else {
- TCHAR* pszName = NULL;
+ wchar_t* pszName = NULL;
SESSION_INFO* pTemp = pci->wndList;
if (currSession == prevSession)
pszCurrent = pszOriginal;
diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp index db8d646289..6f83994009 100644 --- a/plugins/Scriver/src/chat/options.cpp +++ b/plugins/Scriver/src/chat/options.cpp @@ -27,7 +27,7 @@ static HWND hPathTip = 0; struct branch_t
{
- TCHAR* szDescr;
+ wchar_t* szDescr;
char* szDBName;
int iMode;
BYTE bDefault;
@@ -35,79 +35,79 @@ struct branch_t };
static struct branch_t branch1[] = {
- { LPGENT("Flash when someone speaks"), "FlashWindow", 0, 0, NULL },
- { LPGENT("Flash when a word is highlighted"), "FlashWindowHighlight", 0, 1, NULL },
- { LPGENT("Show chat nick list"), "ShowNicklist", 0, 1, NULL },
- { LPGENT("Enable button context menus"), "RightClickFilter", 0, 0, NULL },
- { LPGENT("Show topic on your contact list (if supported)"), "TopicOnClist", 0, 0, NULL },
- { LPGENT("Do not play sounds when focused"), "SoundsFocus", 0, 0, NULL },
- { LPGENT("Do not pop up when joining"), "PopupOnJoin", 0, 0, NULL },
- { LPGENT("Show and hide by double clicking in the contact list"), "ToggleVisibility", 0, 0, NULL },
- { LPGENT("Show contact statuses (if supported)"), "ShowContactStatus", 0, 0, NULL },
- { LPGENT("Display contact status icon before role icon"), "ContactStatusFirst", 0, 0, NULL },
- { LPGENT("Add ':' to auto-completed names"), "AddColonToAutoComplete", 0, 1, NULL }
+ { LPGENW("Flash when someone speaks"), "FlashWindow", 0, 0, NULL },
+ { LPGENW("Flash when a word is highlighted"), "FlashWindowHighlight", 0, 1, NULL },
+ { LPGENW("Show chat nick list"), "ShowNicklist", 0, 1, NULL },
+ { LPGENW("Enable button context menus"), "RightClickFilter", 0, 0, NULL },
+ { LPGENW("Show topic on your contact list (if supported)"), "TopicOnClist", 0, 0, NULL },
+ { LPGENW("Do not play sounds when focused"), "SoundsFocus", 0, 0, NULL },
+ { LPGENW("Do not pop up when joining"), "PopupOnJoin", 0, 0, NULL },
+ { LPGENW("Show and hide by double clicking in the contact list"), "ToggleVisibility", 0, 0, NULL },
+ { LPGENW("Show contact statuses (if supported)"), "ShowContactStatus", 0, 0, NULL },
+ { LPGENW("Display contact status icon before role icon"), "ContactStatusFirst", 0, 0, NULL },
+ { LPGENW("Add ':' to auto-completed names"), "AddColonToAutoComplete", 0, 1, NULL }
};
static struct branch_t branch2[] = {
- { LPGENT("Show icons"), "IconFlags", GC_EVENT_TOPIC | GC_EVENT_JOIN | GC_EVENT_QUIT |
+ { LPGENW("Show icons"), "IconFlags", GC_EVENT_TOPIC | GC_EVENT_JOIN | GC_EVENT_QUIT |
GC_EVENT_MESSAGE | GC_EVENT_ACTION | GC_EVENT_HIGHLIGHT | GC_EVENT_PART |
GC_EVENT_KICK | GC_EVENT_NOTICE | GC_EVENT_NICK | GC_EVENT_INFORMATION | GC_EVENT_ADDSTATUS, 0, NULL },
- { LPGENT("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1, NULL },
- { LPGENT("Only prefix with timestamp if it has changed"), "ShowTimeStampIfChanged", 0, 0, NULL },
- { LPGENT("Timestamp has same color as event"), "TimeStampEventColour", 0, 0, NULL },
- { LPGENT("Indent the second line of a message"), "LogIndentEnabled", 0, 1, NULL },
- { LPGENT("Limit user names to 20 characters"), "LogLimitNames", 0, 1, NULL },
- { LPGENT("Strip colors from messages"), "StripFormatting", 0, 0, NULL },
- { LPGENT("Enable 'event filter' for new rooms"), "FilterEnabled", 0, 0, NULL }
+ { LPGENW("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1, NULL },
+ { LPGENW("Only prefix with timestamp if it has changed"), "ShowTimeStampIfChanged", 0, 0, NULL },
+ { LPGENW("Timestamp has same color as event"), "TimeStampEventColour", 0, 0, NULL },
+ { LPGENW("Indent the second line of a message"), "LogIndentEnabled", 0, 1, NULL },
+ { LPGENW("Limit user names to 20 characters"), "LogLimitNames", 0, 1, NULL },
+ { LPGENW("Strip colors from messages"), "StripFormatting", 0, 0, NULL },
+ { LPGENW("Enable 'event filter' for new rooms"), "FilterEnabled", 0, 0, NULL }
};
static struct branch_t branch3[] = {
- { LPGENT("Show topic changes"), "FilterFlags", GC_EVENT_TOPIC, 0, NULL },
- { LPGENT("Show users joining"), "FilterFlags", GC_EVENT_JOIN, 0, NULL },
- { LPGENT("Show users disconnecting"), "FilterFlags", GC_EVENT_QUIT, 0, NULL },
- { LPGENT("Show messages"), "FilterFlags", GC_EVENT_MESSAGE, 1, NULL },
- { LPGENT("Show actions"), "FilterFlags", GC_EVENT_ACTION, 1, NULL },
- { LPGENT("Show users leaving"), "FilterFlags", GC_EVENT_PART, 0, NULL },
- { LPGENT("Show users being kicked"), "FilterFlags", GC_EVENT_KICK, 1, NULL },
- { LPGENT("Show notices"), "FilterFlags", GC_EVENT_NOTICE, 1, NULL },
- { LPGENT("Show users changing name"), "FilterFlags", GC_EVENT_NICK, 0, NULL },
- { LPGENT("Show information messages"), "FilterFlags", GC_EVENT_INFORMATION, 1, NULL },
- { LPGENT("Show status changes of users"), "FilterFlags", GC_EVENT_ADDSTATUS, 0, NULL },
+ { LPGENW("Show topic changes"), "FilterFlags", GC_EVENT_TOPIC, 0, NULL },
+ { LPGENW("Show users joining"), "FilterFlags", GC_EVENT_JOIN, 0, NULL },
+ { LPGENW("Show users disconnecting"), "FilterFlags", GC_EVENT_QUIT, 0, NULL },
+ { LPGENW("Show messages"), "FilterFlags", GC_EVENT_MESSAGE, 1, NULL },
+ { LPGENW("Show actions"), "FilterFlags", GC_EVENT_ACTION, 1, NULL },
+ { LPGENW("Show users leaving"), "FilterFlags", GC_EVENT_PART, 0, NULL },
+ { LPGENW("Show users being kicked"), "FilterFlags", GC_EVENT_KICK, 1, NULL },
+ { LPGENW("Show notices"), "FilterFlags", GC_EVENT_NOTICE, 1, NULL },
+ { LPGENW("Show users changing name"), "FilterFlags", GC_EVENT_NICK, 0, NULL },
+ { LPGENW("Show information messages"), "FilterFlags", GC_EVENT_INFORMATION, 1, NULL },
+ { LPGENW("Show status changes of users"), "FilterFlags", GC_EVENT_ADDSTATUS, 0, NULL },
};
static struct branch_t branch4[] = {
- { LPGENT("Show icons in tray only when the chat room is not active"), "TrayIconInactiveOnly", 0, 1, NULL },
- { LPGENT("Show icon in tray for topic changes"), "TrayIconFlags", GC_EVENT_TOPIC, 0, NULL },
- { LPGENT("Show icon in tray for users joining"), "TrayIconFlags", GC_EVENT_JOIN, 0, NULL },
- { LPGENT("Show icon in tray for users disconnecting"), "TrayIconFlags", GC_EVENT_QUIT, 0, NULL },
- { LPGENT("Show icon in tray for messages"), "TrayIconFlags", GC_EVENT_MESSAGE, 0, NULL },
- { LPGENT("Show icon in tray for actions"), "TrayIconFlags", GC_EVENT_ACTION, 0, NULL },
- { LPGENT("Show icon in tray for highlights"), "TrayIconFlags", GC_EVENT_HIGHLIGHT, 1, NULL },
- { LPGENT("Show icon in tray for users leaving"), "TrayIconFlags", GC_EVENT_PART, 0, NULL },
- { LPGENT("Show icon in tray for users kicking other user"), "TrayIconFlags", GC_EVENT_KICK, 0, NULL },
- { LPGENT("Show icon in tray for notices"), "TrayIconFlags", GC_EVENT_NOTICE, 0, NULL },
- { LPGENT("Show icon in tray for name changes"), "TrayIconFlags", GC_EVENT_NICK, 0, NULL },
- { LPGENT("Show icon in tray for information messages"), "TrayIconFlags", GC_EVENT_INFORMATION, 0, NULL },
- { LPGENT("Show icon in tray for status changes"), "TrayIconFlags", GC_EVENT_ADDSTATUS, 0, NULL },
+ { LPGENW("Show icons in tray only when the chat room is not active"), "TrayIconInactiveOnly", 0, 1, NULL },
+ { LPGENW("Show icon in tray for topic changes"), "TrayIconFlags", GC_EVENT_TOPIC, 0, NULL },
+ { LPGENW("Show icon in tray for users joining"), "TrayIconFlags", GC_EVENT_JOIN, 0, NULL },
+ { LPGENW("Show icon in tray for users disconnecting"), "TrayIconFlags", GC_EVENT_QUIT, 0, NULL },
+ { LPGENW("Show icon in tray for messages"), "TrayIconFlags", GC_EVENT_MESSAGE, 0, NULL },
+ { LPGENW("Show icon in tray for actions"), "TrayIconFlags", GC_EVENT_ACTION, 0, NULL },
+ { LPGENW("Show icon in tray for highlights"), "TrayIconFlags", GC_EVENT_HIGHLIGHT, 1, NULL },
+ { LPGENW("Show icon in tray for users leaving"), "TrayIconFlags", GC_EVENT_PART, 0, NULL },
+ { LPGENW("Show icon in tray for users kicking other user"), "TrayIconFlags", GC_EVENT_KICK, 0, NULL },
+ { LPGENW("Show icon in tray for notices"), "TrayIconFlags", GC_EVENT_NOTICE, 0, NULL },
+ { LPGENW("Show icon in tray for name changes"), "TrayIconFlags", GC_EVENT_NICK, 0, NULL },
+ { LPGENW("Show icon in tray for information messages"), "TrayIconFlags", GC_EVENT_INFORMATION, 0, NULL },
+ { LPGENW("Show icon in tray for status changes"), "TrayIconFlags", GC_EVENT_ADDSTATUS, 0, NULL },
};
static struct branch_t branch6[] = {
- { LPGENT("Show popups only when the chat room is not active"), "PopupInactiveOnly", 0, 1, NULL },
- { LPGENT("Show popup for topic changes"), "PopupFlags", GC_EVENT_TOPIC, 0, NULL },
- { LPGENT("Show popup for users joining"), "PopupFlags", GC_EVENT_JOIN, 0, NULL },
- { LPGENT("Show popup for users disconnecting"), "PopupFlags", GC_EVENT_QUIT, 0, NULL },
- { LPGENT("Show popup for messages"), "PopupFlags", GC_EVENT_MESSAGE, 0, NULL },
- { LPGENT("Show popup for actions"), "PopupFlags", GC_EVENT_ACTION, 0, NULL },
- { LPGENT("Show popup for highlights"), "PopupFlags", GC_EVENT_HIGHLIGHT, 0, NULL },
- { LPGENT("Show popup for users leaving"), "PopupFlags", GC_EVENT_PART, 0, NULL },
- { LPGENT("Show popup for users kicking other user"), "PopupFlags", GC_EVENT_KICK, 0, NULL },
- { LPGENT("Show popup for notices"), "PopupFlags", GC_EVENT_NOTICE, 0, NULL },
- { LPGENT("Show popup for name changes"), "PopupFlags", GC_EVENT_NICK, 0, NULL },
- { LPGENT("Show popup for information messages"), "PopupFlags", GC_EVENT_INFORMATION, 0, NULL },
- { LPGENT("Show popup for status changes"), "PopupFlags", GC_EVENT_ADDSTATUS, 0, NULL },
+ { LPGENW("Show popups only when the chat room is not active"), "PopupInactiveOnly", 0, 1, NULL },
+ { LPGENW("Show popup for topic changes"), "PopupFlags", GC_EVENT_TOPIC, 0, NULL },
+ { LPGENW("Show popup for users joining"), "PopupFlags", GC_EVENT_JOIN, 0, NULL },
+ { LPGENW("Show popup for users disconnecting"), "PopupFlags", GC_EVENT_QUIT, 0, NULL },
+ { LPGENW("Show popup for messages"), "PopupFlags", GC_EVENT_MESSAGE, 0, NULL },
+ { LPGENW("Show popup for actions"), "PopupFlags", GC_EVENT_ACTION, 0, NULL },
+ { LPGENW("Show popup for highlights"), "PopupFlags", GC_EVENT_HIGHLIGHT, 0, NULL },
+ { LPGENW("Show popup for users leaving"), "PopupFlags", GC_EVENT_PART, 0, NULL },
+ { LPGENW("Show popup for users kicking other user"), "PopupFlags", GC_EVENT_KICK, 0, NULL },
+ { LPGENW("Show popup for notices"), "PopupFlags", GC_EVENT_NOTICE, 0, NULL },
+ { LPGENW("Show popup for name changes"), "PopupFlags", GC_EVENT_NICK, 0, NULL },
+ { LPGENW("Show popup for information messages"), "PopupFlags", GC_EVENT_INFORMATION, 0, NULL },
+ { LPGENW("Show popup for status changes"), "PopupFlags", GC_EVENT_ADDSTATUS, 0, NULL },
};
-static HTREEITEM InsertBranch(HWND hwndTree, TCHAR* pszDescr, BOOL bExpanded)
+static HTREEITEM InsertBranch(HWND hwndTree, wchar_t* pszDescr, BOOL bExpanded)
{
TVINSERTSTRUCT tvis;
tvis.hParent = NULL;
@@ -222,7 +222,7 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM p return 0;
}
-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 )) {
@@ -250,7 +250,7 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading4, branch4, _countof(branch4), 0x1000);
SendMessage(hwndDlg, OPT_FIXHEADINGS, 0, 0);
{
- TCHAR* pszGroup = NULL;
+ wchar_t* pszGroup = NULL;
InitSetting(&pszGroup, "AddToGroup", L"Chat rooms");
SetDlgItemText(hwndDlg, IDC_CHAT_GROUP, pszGroup);
mir_free(pszGroup);
@@ -357,12 +357,12 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN3,UDM_SETRANGE,0,MAKELONG(10000,0));
SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN3,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,CHAT_MODULE,"LoggingLimit",100),0));
{
- TCHAR tszTemp[MAX_PATH];
+ wchar_t tszTemp[MAX_PATH];
PathToRelativeT(g_Settings.pszLogDir, tszTemp);
SetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, tszTemp);
}
- TCHAR tszTooltipText[2048];
+ wchar_t tszTooltipText[2048];
RECT rect;
mir_sntprintf(tszTooltipText,
@@ -452,7 +452,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa case IDC_CHAT_LOGDIRCHOOSE:
LPMALLOC psMalloc;
if (SUCCEEDED(CoGetMalloc(1, &psMalloc))) {
- TCHAR tszDirectory[MAX_PATH], tszTemp[MAX_PATH];
+ wchar_t tszDirectory[MAX_PATH], tszTemp[MAX_PATH];
BROWSEINFO bi = { 0 };
bi.hwndOwner = hwndDlg;
bi.pszDisplayName = tszDirectory;
@@ -519,15 +519,15 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_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_CHAT_HIGHLIGHTWORDS, ptszText, iLen + 1);
- p2 = _tcschr(ptszText, (TCHAR)',');
+ p2 = wcschr(ptszText, (wchar_t)',');
while (p2) {
*p2 = ' ';
- p2 = _tcschr(ptszText, (TCHAR)',');
+ p2 = wcschr(ptszText, (wchar_t)',');
}
db_set_ts(NULL, CHAT_MODULE, "HighlightWords", ptszText);
mir_free(ptszText);
@@ -537,7 +537,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY));
if (iLen > 0) {
- TCHAR *pszText1 = (TCHAR*)malloc(iLen*sizeof(TCHAR)+2);
+ wchar_t *pszText1 = (wchar_t*)malloc(iLen*sizeof(wchar_t)+2);
GetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, pszText1, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "LogDirectory", pszText1);
free(pszText1);
diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp index 1a9be6ca87..eebd6fdd00 100644 --- a/plugins/Scriver/src/chat/tools.cpp +++ b/plugins/Scriver/src/chat/tools.cpp @@ -21,17 +21,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "../stdafx.h"
-TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2)
+wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2)
{
for (int i = 0; s1[i]; i++)
- for (int j = i, k = 0; _totlower(s1[j]) == _totlower(s2[k]); j++, k++)
+ for (int j = i, k = 0; towlower(s1[j]) == towlower(s2[k]); j++, k++)
if (!s2[k + 1])
- return (TCHAR*)(s1 + i);
+ return (wchar_t*)(s1 + i);
return NULL;
}
-UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText)
+UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, wchar_t* pszUID, wchar_t* pszWordText)
{
GCMENUITEMS gcmi = { 0 };
HMENU hSubMenu = 0;
@@ -52,7 +52,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s }
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);
SetSearchEngineIcons(*hMenu, g_dat.hSearchEngineIconList);
@@ -61,7 +61,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s 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
@@ -79,7 +79,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s 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) {
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index 53eaba0c5a..9e5d799407 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -22,23 +22,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "../stdafx.h"
static ToolbarButton toolbarButtons[] = {
- { LPGENT("Bold"), IDC_CHAT_BOLD, 0, 4, 24 },
- { LPGENT("Italic"), IDC_CHAT_ITALICS, 0, 0, 24 },
- { LPGENT("Underline"), IDC_CHAT_UNDERLINE, 0, 0, 24 },
- { LPGENT("Text color"), IDC_CHAT_COLOR, 0, 0, 24 },
- { LPGENT("Background color"), IDC_CHAT_BKGCOLOR, 0, 0, 24 },
- { LPGENT("History"), IDC_CHAT_HISTORY, 1, 0, 24 },
- { LPGENT("Filter"), IDC_CHAT_FILTER, 1, 0, 24 },
- { LPGENT("Manager"), IDC_CHAT_CHANMGR, 1, 0, 24 },
- { LPGENT("Nick list"), IDC_CHAT_SHOWNICKLIST, 1, 0, 24 },
- { LPGENT("Send"), IDOK, 1, 0, 38 },
+ { LPGENW("Bold"), IDC_CHAT_BOLD, 0, 4, 24 },
+ { LPGENW("Italic"), IDC_CHAT_ITALICS, 0, 0, 24 },
+ { LPGENW("Underline"), IDC_CHAT_UNDERLINE, 0, 0, 24 },
+ { LPGENW("Text color"), IDC_CHAT_COLOR, 0, 0, 24 },
+ { LPGENW("Background color"), IDC_CHAT_BKGCOLOR, 0, 0, 24 },
+ { LPGENW("History"), IDC_CHAT_HISTORY, 1, 0, 24 },
+ { LPGENW("Filter"), IDC_CHAT_FILTER, 1, 0, 24 },
+ { LPGENW("Manager"), IDC_CHAT_CHANMGR, 1, 0, 24 },
+ { LPGENW("Nick list"), IDC_CHAT_SHOWNICKLIST, 1, 0, 24 },
+ { LPGENW("Send"), IDOK, 1, 0, 38 },
};
struct MESSAGESUBDATA
{
time_t lastEnterTime;
- TCHAR *szSearchQuery;
- TCHAR *szSearchResult;
+ wchar_t *szSearchQuery;
+ wchar_t *szSearchResult;
SESSION_INFO *lastSession;
};
@@ -207,9 +207,9 @@ static void TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si) return;
bool isTopic = false, isRoom = false;
- TCHAR *pszName = NULL;
- TCHAR* pszText = (TCHAR*)mir_alloc(iLen + 100 * sizeof(TCHAR));
- gt.cb = iLen + 99 * sizeof(TCHAR);
+ wchar_t *pszName = NULL;
+ wchar_t* pszText = (wchar_t*)mir_alloc(iLen + 100 * sizeof(wchar_t));
+ gt.cb = iLen + 99 * sizeof(wchar_t);
gt.flags = GT_DEFAULT;
SendMessage(hwnd, EM_GETTEXTEX, (WPARAM)>, (LPARAM)pszText);
@@ -218,7 +218,7 @@ static void TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si) if (dat->szSearchResult != NULL) {
int cbResult = (int)mir_tstrlen(dat->szSearchResult);
- if (start >= cbResult && !_tcsncicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) {
+ if (start >= cbResult && !wcsnicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) {
start -= cbResult;
goto LBL_SkipEnd;
}
@@ -237,12 +237,12 @@ LBL_SkipEnd: int topicStart = start;
while (topicStart >0 && (pszText[topicStart - 1] == ' ' || pszText[topicStart - 1] == 13 || pszText[topicStart - 1] == VK_TAB))
topicStart--;
- if (topicStart > 5 && _tcsstr(&pszText[topicStart - 6], L"/topic") == &pszText[topicStart - 6])
+ if (topicStart > 5 && wcsstr(&pszText[topicStart - 6], L"/topic") == &pszText[topicStart - 6])
isTopic = true;
}
if (dat->szSearchQuery == NULL) {
- dat->szSearchQuery = (TCHAR*)mir_alloc(sizeof(TCHAR)*(end - start + 1));
+ dat->szSearchQuery = (wchar_t*)mir_alloc(sizeof(wchar_t)*(end - start + 1));
mir_tstrncpy(dat->szSearchQuery, pszText + start, end - start + 1);
dat->szSearchResult = mir_tstrdup(dat->szSearchQuery);
dat->lastSession = NULL;
@@ -272,7 +272,7 @@ LBL_SkipEnd: if (end != start) {
ptrT szReplace;
if (!isRoom && !isTopic && g_Settings.bAddColonToAutoComplete && start == 0) {
- szReplace = (TCHAR*)mir_alloc((mir_tstrlen(pszName) + 4) * sizeof(TCHAR));
+ szReplace = (wchar_t*)mir_alloc((mir_tstrlen(pszName) + 4) * sizeof(wchar_t));
mir_tstrcpy(szReplace, pszName);
mir_tstrcat(szReplace, L": ");
pszName = szReplace;
@@ -783,13 +783,13 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO * p ti.uId = 1;
ti.rect = clientRect;
- TCHAR tszBuf[1024]; tszBuf[0] = 0;
+ wchar_t tszBuf[1024]; tszBuf[0] = 0;
USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, currentHovered);
if (ui) {
if (ProtoServiceExists(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT)) {
- TCHAR *p = (TCHAR*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui->pszUID);
+ wchar_t *p = (wchar_t*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui->pszUID);
if (p != NULL) {
- _tcsncpy_s(tszBuf, p, _TRUNCATE);
+ wcsncpy_s(tszBuf, p, _TRUNCATE);
mir_free(p);
}
}
@@ -960,8 +960,8 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, else if (wParam < ' ')
break;
else {
- TCHAR szNew[2];
- szNew[0] = (TCHAR)wParam;
+ wchar_t szNew[2];
+ szNew[0] = (wchar_t)wParam;
szNew[1] = '\0';
if (mir_tstrlen(si->szSearch) >= _countof(si->szSearch) - 2) {
MessageBeep(MB_OK);
@@ -976,7 +976,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, for (int i = 0; i < iItems; i++) {
USERINFO *ui = pci->UM_FindUserFromIndex(si->pUsers, i);
if (ui) {
- if (!_tcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) {
+ if (!wcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) {
SendMessage(hwnd, LB_SETCURSEL, i, 0);
InvalidateRect(hwnd, NULL, FALSE);
return 0;
@@ -1018,7 +1018,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, return mir_callNextSubclass(hwnd, NicklistSubclassProc, msg, wParam, lParam);
}
-int GetTextPixelSize(TCHAR* pszText, HFONT hFont, BOOL bWidth)
+int GetTextPixelSize(wchar_t* pszText, HFONT hFont, BOOL bWidth)
{
if (!pszText || !hFont)
return 0;
@@ -1051,7 +1051,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR HICON hIcon;
TabControlData tcd;
TitleBarData tbd;
- TCHAR szTemp[512];
+ wchar_t szTemp[512];
SESSION_INFO *si = (SESSION_INFO *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (!si && uMsg != WM_INITDIALOG)
@@ -1088,7 +1088,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR int mask = (int)SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_GETEVENTMASK, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETEVENTMASK, 0, mask | ENM_LINK | ENM_MOUSEEVENTS);
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS | ENM_KEYEVENTS | ENM_CHANGE | ENM_REQUESTRESIZE);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_LIMITTEXT, sizeof(TCHAR) * 0x7FFFFFFF, 0);
+ SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_LIMITTEXT, sizeof(wchar_t) * 0x7FFFFFFF, 0);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETOLECALLBACK, 0, (LPARAM)&reOleCallback);
if (db_get_b(NULL, CHAT_MODULE, "UseIEView", 0)) {
@@ -1427,7 +1427,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR if (ui) {
char szIndicator = SM_GetStatusIndicator(si, ui);
if (szIndicator > '\0') {
- static TCHAR ptszBuf[128];
+ static wchar_t ptszBuf[128];
mir_sntprintf(ptszBuf, L"%c%s", szIndicator, ui->pszNick);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ptszBuf);
}
@@ -1636,7 +1636,7 @@ LABEL_SHOWWINDOW: int item = LOWORD(SendDlgItemMessage(hwndDlg, IDC_CHAT_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,
@@ -1668,7 +1668,7 @@ LABEL_SHOWWINDOW: LRESULT lResult = (LRESULT)SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETSEL, 0, 0);
int start = LOWORD(lResult);
size_t dwNameLenMax = (mir_tstrlen(ui->pszUID) + 4);
- 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
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index 78259fb1ef..42ec8e52c0 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -254,23 +254,23 @@ void LoadGlobalIcons() }
}
-static struct { UINT cpId; const TCHAR *cpName; } cpTable[] =
+static struct { UINT cpId; const wchar_t *cpName; } cpTable[] =
{
- { 874, LPGENT("Thai") }, //
- { 932, LPGENT("Japanese") }, //
- { 936, LPGENT("Simplified Chinese") }, //
- { 949, LPGENT("Korean") }, //
- { 950, LPGENT("Traditional Chinese") }, //
- { 1250, LPGENT("Central European") }, //
- { 1251, LPGENT("Cyrillic") }, //
- { 1252, LPGENT("Latin I") }, //
- { 1253, LPGENT("Greek") }, //
- { 1254, LPGENT("Turkish") }, //
- { 1255, LPGENT("Hebrew") }, //
- { 1256, LPGENT("Arabic") }, //
- { 1257, LPGENT("Baltic") }, //
- { 1258, LPGENT("Vietnamese") }, //
- { 1361, LPGENT("Korean (Johab)") }
+ { 874, LPGENW("Thai") }, //
+ { 932, LPGENW("Japanese") }, //
+ { 936, LPGENW("Simplified Chinese") }, //
+ { 949, LPGENW("Korean") }, //
+ { 950, LPGENW("Traditional Chinese") }, //
+ { 1250, LPGENW("Central European") }, //
+ { 1251, LPGENW("Cyrillic") }, //
+ { 1252, LPGENW("Latin I") }, //
+ { 1253, LPGENW("Greek") }, //
+ { 1254, LPGENW("Turkish") }, //
+ { 1255, LPGENW("Hebrew") }, //
+ { 1256, LPGENW("Arabic") }, //
+ { 1257, LPGENW("Baltic") }, //
+ { 1258, LPGENW("Vietnamese") }, //
+ { 1361, LPGENW("Korean (Johab)") }
};
void LoadInfobarFonts()
diff --git a/plugins/Scriver/src/infobar.cpp b/plugins/Scriver/src/infobar.cpp index c8485ed218..0175199ccc 100644 --- a/plugins/Scriver/src/infobar.cpp +++ b/plugins/Scriver/src/infobar.cpp @@ -40,7 +40,7 @@ void SetupInfobar(InfobarWindowData* idat) cf2.cbSize = sizeof(cf2);
cf2.crTextColor = colour;
cf2.bCharSet = lf.lfCharSet;
- _tcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
+ wcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
cf2.dwEffects = ((lf.lfWeight >= FW_BOLD) ? CFE_BOLD : 0) | (lf.lfItalic ? CFE_ITALIC : 0);
cf2.wWeight = (WORD)lf.lfWeight;
cf2.bPitchAndFamily = lf.lfPitchAndFamily;
@@ -54,7 +54,7 @@ void SetupInfobar(InfobarWindowData* idat) cf2.cbSize = sizeof(cf2);
cf2.crTextColor = colour;
cf2.bCharSet = lf.lfCharSet;
- _tcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
+ wcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
cf2.dwEffects = ((lf.lfWeight >= FW_BOLD) ? CFE_BOLD : 0) | (lf.lfItalic ? CFE_ITALIC : 0);
cf2.wWeight = (WORD)lf.lfWeight;
cf2.bPitchAndFamily = lf.lfPitchAndFamily;
@@ -83,12 +83,12 @@ void RefreshInfobar(InfobarWindowData* idat) ptrT szXStatusName(db_get_tsa(idat->mwd->hContact, idat->mwd->szProto, "XStatusName"));
ptrT szXStatusMsg(db_get_tsa(idat->mwd->hContact, idat->mwd->szProto, "XStatusMsg"));
HICON hIcon = GetExtraStatusIcon(idat);
- TCHAR szText[2048];
+ wchar_t szText[2048];
SETTEXTEX st;
if (szXStatusMsg && *szXStatusMsg)
mir_sntprintf(szText, L"%s (%s)", TranslateTS(szXStatusName), szXStatusMsg);
else
- _tcsncpy_s(szText, TranslateTS(szXStatusName), _TRUNCATE);
+ wcsncpy_s(szText, TranslateTS(szXStatusName), _TRUNCATE);
st.flags = ST_DEFAULT;
st.codepage = 1200;
SendDlgItemMessage(hwnd, IDC_INFOBAR_NAME, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)pcli->pfnGetContactDisplayName(dat->hContact, 0));
diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp index fcc305a9f4..d9ecad41e3 100644 --- a/plugins/Scriver/src/input.cpp +++ b/plugins/Scriver/src/input.cpp @@ -372,11 +372,11 @@ BOOL HandleLinkClick(HINSTANCE hInstance, HWND hwndDlg, HWND hwndFocus, ENLINK * TEXTRANGE tr;
tr.chrg = lParam->chrg;
- tr.lpstrText = (LPWSTR)mir_alloc(sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 8));
+ tr.lpstrText = (LPWSTR)mir_alloc(sizeof(wchar_t)*(tr.chrg.cpMax - tr.chrg.cpMin + 8));
SendMessage(lParam->nmhdr.hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
- if (_tcschr(tr.lpstrText, _T('@')) != NULL && _tcschr(tr.lpstrText, _T(':')) == NULL && _tcschr(tr.lpstrText, _T('/')) == NULL) {
- memmove(tr.lpstrText + 7, tr.lpstrText, sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 1));
- memcpy(tr.lpstrText, L"mailto:", sizeof(TCHAR) * 7);
+ if (wcschr(tr.lpstrText, '@') != NULL && wcschr(tr.lpstrText, ':') == NULL && wcschr(tr.lpstrText, '/') == NULL) {
+ memmove(tr.lpstrText + 7, tr.lpstrText, sizeof(wchar_t)*(tr.chrg.cpMax - tr.chrg.cpMin + 1));
+ memcpy(tr.lpstrText, L"mailto:", sizeof(wchar_t) * 7);
}
BOOL bOpenLink = TRUE;
@@ -399,7 +399,7 @@ BOOL HandleLinkClick(HINSTANCE hInstance, HWND hwndDlg, HWND hwndFocus, ENLINK * if (!OpenClipboard(hwndDlg))
break;
EmptyClipboard();
- HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(tr.lpstrText) + 1));
+ HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(wchar_t)*(mir_tstrlen(tr.lpstrText) + 1));
mir_tstrcpy((LPWSTR)GlobalLock(hData), tr.lpstrText);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 34637e2010..341c9c6a3a 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -34,24 +34,24 @@ static void UpdateReadChars(HWND hwndDlg, SrmmWindowData * dat); static ToolbarButton toolbarButtons[] =
{
- { LPGENT("Quote"), IDC_QUOTE, 0, 4, 24 },
- { LPGENT("Add contact"), IDC_ADD, 0, 10, 24 },
- { LPGENT("User menu"), IDC_USERMENU, 1, 0, 24 },
- { LPGENT("User details"), IDC_DETAILS, 1, 0, 24 },
- { LPGENT("History"), IDC_HISTORY, 1, 0, 24 },
- { LPGENT("Send"), IDOK, 1, 0, 38 }
+ { LPGENW("Quote"), IDC_QUOTE, 0, 4, 24 },
+ { LPGENW("Add contact"), IDC_ADD, 0, 10, 24 },
+ { LPGENW("User menu"), IDC_USERMENU, 1, 0, 24 },
+ { LPGENW("User details"), IDC_DETAILS, 1, 0, 24 },
+ { LPGENW("History"), IDC_HISTORY, 1, 0, 24 },
+ { LPGENW("Send"), IDOK, 1, 0, 38 }
};
-static TCHAR* GetIEViewSelection(SrmmWindowData *dat)
+static wchar_t* GetIEViewSelection(SrmmWindowData *dat)
{
IEVIEWEVENT evt = { sizeof(evt) };
evt.hwnd = dat->hwndLog;
evt.hContact = dat->hContact;
evt.iType = IEE_GET_SELECTION;
- return mir_tstrdup((TCHAR*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&evt));
+ return mir_tstrdup((wchar_t*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&evt));
}
-static TCHAR* GetQuotedTextW(TCHAR *text)
+static wchar_t* GetQuotedTextW(wchar_t *text)
{
size_t i, j, l = mir_wstrlen(text);
int newLine = 1;
@@ -79,7 +79,7 @@ static TCHAR* GetQuotedTextW(TCHAR *text) }
j += 3;
- TCHAR *out = (TCHAR*)mir_alloc(sizeof(TCHAR)* j);
+ wchar_t *out = (wchar_t*)mir_alloc(sizeof(wchar_t)* j);
newLine = 1;
wasCR = 0;
for (i = j = 0; i < l; i++) {
@@ -156,15 +156,15 @@ int RTL_Detect(WCHAR *pszwText) return 0;
}
-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) {
@@ -297,7 +297,7 @@ static LRESULT CALLBACK LogEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, ScreenToClient(hwnd, (LPPOINT)&ptl);
ptrT pszWord(GetRichTextWord(hwnd, &ptl));
if (pszWord && pszWord[0]) {
- TCHAR szMenuText[4096];
+ wchar_t szMenuText[4096];
mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWord);
ModifyMenu(hSubMenu, 5, MF_STRING | MF_BYPOSITION, 5, szMenuText);
SetSearchEngineIcons(hMenu, g_dat.hSearchEngineIconList);
@@ -544,7 +544,7 @@ static void MessageDialogResize(HWND hwndDlg, SrmmWindowData *dat, int w, int h) static void UpdateReadChars(HWND hwndDlg, SrmmWindowData *dat)
{
if (dat->parent->hwndActive == hwndDlg) {
- TCHAR szText[256];
+ wchar_t szText[256];
int len = GetRichTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE), 1200, FALSE);
StatusBarData sbd;
@@ -754,7 +754,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (newData->szInitialText) {
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);
}
@@ -795,7 +795,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_LIMITTEXT, 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, sizeof(TCHAR) * 0x7FFFFFFF, 0);
+ SendDlgItemMessage(hwndDlg, IDC_LOG, EM_LIMITTEXT, sizeof(wchar_t) * 0x7FFFFFFF, 0);
SubclassLogEdit(GetDlgItem(hwndDlg, IDC_LOG));
SubclassMessageEdit(GetDlgItem(hwndDlg, IDC_MESSAGE));
dat->infobarData = CreateInfobar(hwndDlg, dat);
@@ -951,10 +951,10 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP 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);
@@ -1088,7 +1088,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP cf2.dwMask = CFM_COLOR | CFM_FACE | CFM_CHARSET | CFM_SIZE | CFM_WEIGHT | CFM_BOLD | CFM_ITALIC;
cf2.crTextColor = colour;
cf2.bCharSet = lf.lfCharSet;
- _tcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
+ wcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
cf2.dwEffects = ((lf.lfWeight >= FW_BOLD) ? CFE_BOLD : 0) | (lf.lfItalic ? CFE_ITALIC : 0);
cf2.wWeight = (WORD)lf.lfWeight;
cf2.bPitchAndFamily = lf.lfPitchAndFamily;
@@ -1345,7 +1345,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case DM_UPDATESTATUSBAR:
if (dat->parent->hwndActive == hwndDlg) {
- TCHAR szText[256];
+ wchar_t szText[256];
StatusBarData sbd = { 0 };
sbd.iFlags = SBDF_TEXT | SBDF_ICON;
if (dat->messagesInProgress && (g_dat.flags & SMF_SHOWPROGRESS)) {
@@ -1360,7 +1360,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dat->nTypeSecs--;
}
else if (dat->lastMessage) {
- TCHAR date[64], time[64];
+ wchar_t date[64], time[64];
TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"d", date, _countof(date), 0);
TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"t", time, _countof(time), 0);
mir_sntprintf(szText, TranslateT("Last message received on %s at %s."), date, time);
@@ -1576,7 +1576,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_GETPARAFORMAT, 0, (LPARAM)&pf2);
int bufSize = GetRichTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE), 1200, TRUE) + 2;
- ptrT ptszUnicode((TCHAR*)mir_alloc(bufSize * sizeof(TCHAR)));
+ ptrT ptszUnicode((wchar_t*)mir_alloc(bufSize * sizeof(wchar_t)));
MessageSendQueueItem msi = { 0 };
if (pf2.wEffects & PFE_RTLPARA)
@@ -1650,14 +1650,14 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP st.flags = ST_SELECTION;
st.codepage = 1200;
- TCHAR *buffer = NULL;
+ wchar_t *buffer = NULL;
if (dat->hwndLog != NULL)
buffer = GetIEViewSelection(dat);
else
buffer = GetRichEditSelection(GetDlgItem(hwndDlg, IDC_LOG));
if (buffer != NULL) {
- TCHAR *quotedBuffer = GetQuotedTextW(buffer);
+ wchar_t *quotedBuffer = GetQuotedTextW(buffer);
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)quotedBuffer);
mir_free(quotedBuffer);
mir_free(buffer);
@@ -1672,7 +1672,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (DbEventIsMessageOrCustom(&dbei)) {
buffer = DbGetEventTextT(&dbei, CP_ACP);
if (buffer != NULL) {
- TCHAR *quotedBuffer = GetQuotedTextW(buffer);
+ wchar_t *quotedBuffer = GetQuotedTextW(buffer);
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)quotedBuffer);
mir_free(quotedBuffer);
mir_free(buffer);
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 43a81f12b8..fc1bdea405 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -51,17 +51,17 @@ struct EventData COLORREF color;
union {
char *pszNick; // Nick, usage depends on type of event
- TCHAR *pszNickT;
+ wchar_t *pszNickT;
wchar_t *pszNickW; // Nick - Unicode
};
union {
char *pszText; // Text, usage depends on type of event
- TCHAR *pszTextT;
+ wchar_t *pszTextT;
wchar_t *pszTextW; // Text - Unicode
};
union {
char *pszText2; // Text, usage depends on type of event
- TCHAR *pszText2T;
+ wchar_t *pszText2T;
wchar_t *pszText2W; // Text - Unicode
};
DWORD time;
@@ -346,11 +346,11 @@ static char* SetToStyle(int style) }
// mode: 0 - date & time, 1 - date, 2 - time
-TCHAR* TimestampToString(DWORD dwFlags, time_t check, int mode)
+wchar_t* TimestampToString(DWORD dwFlags, time_t check, int mode)
{
- static TCHAR szResult[512];
- TCHAR str[80];
- TCHAR format[20];
+ static wchar_t szResult[512];
+ wchar_t str[80];
+ wchar_t format[20];
szResult[0] = '\0';
format[0] = '\0';
@@ -574,7 +574,7 @@ static char* CreateRTFFromEvent(SrmmWindowData *dat, EventData *evt, GlobalMessa if (gdat->flags & SMF_SHOWTIME && (evt->eventType != EVENTTYPE_MESSAGE ||
(gdat->flags & SMF_MARKFOLLOWUPS || isGroupBreak || !(gdat->flags & SMF_GROUPMESSAGES)))) {
- TCHAR *timestampString = NULL;
+ wchar_t *timestampString = NULL;
if (gdat->flags & SMF_GROUPMESSAGES && evt->eventType == EVENTTYPE_MESSAGE) {
if (isGroupBreak) {
if (!(gdat->flags & SMF_MARKFOLLOWUPS))
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 41e9ebd30b..85f3f26fcc 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -51,48 +51,48 @@ static const TabDef tabPages[] = { typedef struct FontOptionsListStruct
{
- const TCHAR *szDescr;
+ const wchar_t *szDescr;
COLORREF defColour;
- const TCHAR *szDefFace;
+ const wchar_t *szDefFace;
BYTE defStyle;
char defSize;
- const TCHAR *szBkgName;
+ const wchar_t *szBkgName;
} FontOptionsList;
static const FontOptionsList fontOptionsList[] = {
- { LPGENT("Outgoing messages"), RGB(106, 106, 106), L"Arial", 0, -12, LPGENT("Outgoing background")},
- { LPGENT("Incoming messages"), RGB(0, 0, 0), L"Arial", 0, -12, LPGENT("Incoming background")},
- { LPGENT("Outgoing name"), RGB(89, 89, 89), L"Arial", FONTF_BOLD, -12, LPGENT("Outgoing background")},
- { LPGENT("Outgoing time"), RGB(0, 0, 0), L"Terminal", FONTF_BOLD, -9, LPGENT("Outgoing background")},
- { LPGENT("Outgoing colon"), RGB(89, 89, 89), L"Arial", 0, -11, LPGENT("Outgoing background")},
- { LPGENT("Incoming name"), RGB(215, 0, 0), L"Arial", FONTF_BOLD, -12, LPGENT("Incoming background")},
- { LPGENT("Incoming time"), RGB(0, 0, 0), L"Terminal", FONTF_BOLD, -9, LPGENT("Incoming background")},
- { LPGENT("Incoming colon"), RGB(215, 0, 0), L"Arial", 0, -11, LPGENT("Incoming background")},
- { LPGENT("Message area"), RGB(0, 0, 0), L"Arial", 0, -12, LPGENT("Input area background")},
- { LPGENT("Notices"), RGB(90, 90, 160), L"Arial", 0, -12, LPGENT("Incoming background")},
- { LPGENT("Outgoing URL"), RGB(0, 0, 255), L"Arial", 0, -12, LPGENT("Outgoing background")},
- { LPGENT("Incoming URL"), RGB(0, 0, 255), L"Arial", 0, -12, LPGENT("Incoming background")},
- { LPGENT("Info bar contact name"), RGB(0, 0, 0), L"Arial", FONTF_BOLD, -19, LPGENT("Info bar background")},
- { LPGENT("Info bar status message"), RGB(50, 50, 50), L"Arial", FONTF_ITALIC, -11, LPGENT("Info bar background")}
+ { LPGENW("Outgoing messages"), RGB(106, 106, 106), L"Arial", 0, -12, LPGENW("Outgoing background")},
+ { LPGENW("Incoming messages"), RGB(0, 0, 0), L"Arial", 0, -12, LPGENW("Incoming background")},
+ { LPGENW("Outgoing name"), RGB(89, 89, 89), L"Arial", FONTF_BOLD, -12, LPGENW("Outgoing background")},
+ { LPGENW("Outgoing time"), RGB(0, 0, 0), L"Terminal", FONTF_BOLD, -9, LPGENW("Outgoing background")},
+ { LPGENW("Outgoing colon"), RGB(89, 89, 89), L"Arial", 0, -11, LPGENW("Outgoing background")},
+ { LPGENW("Incoming name"), RGB(215, 0, 0), L"Arial", FONTF_BOLD, -12, LPGENW("Incoming background")},
+ { LPGENW("Incoming time"), RGB(0, 0, 0), L"Terminal", FONTF_BOLD, -9, LPGENW("Incoming background")},
+ { LPGENW("Incoming colon"), RGB(215, 0, 0), L"Arial", 0, -11, LPGENW("Incoming background")},
+ { LPGENW("Message area"), RGB(0, 0, 0), L"Arial", 0, -12, LPGENW("Input area background")},
+ { LPGENW("Notices"), RGB(90, 90, 160), L"Arial", 0, -12, LPGENW("Incoming background")},
+ { LPGENW("Outgoing URL"), RGB(0, 0, 255), L"Arial", 0, -12, LPGENW("Outgoing background")},
+ { LPGENW("Incoming URL"), RGB(0, 0, 255), L"Arial", 0, -12, LPGENW("Incoming background")},
+ { LPGENW("Info bar contact name"), RGB(0, 0, 0), L"Arial", FONTF_BOLD, -19, LPGENW("Info bar background")},
+ { LPGENW("Info bar status message"), RGB(50, 50, 50), L"Arial", FONTF_ITALIC, -11, LPGENW("Info bar background")}
};
int fontOptionsListSize = _countof(fontOptionsList);
struct ColourOptionsList
{
- const TCHAR *szName;
+ const wchar_t *szName;
const char *szSettingName;
COLORREF defColour;
int systemColor;
}
static const colourOptionsList[] = {
- { LPGENT("Background"), SRMSGSET_BKGCOLOUR, 0, COLOR_WINDOW},
- { LPGENT("Input area background"), SRMSGSET_INPUTBKGCOLOUR, 0, COLOR_WINDOW},
- { LPGENT("Incoming background"), SRMSGSET_INCOMINGBKGCOLOUR, 0, COLOR_WINDOW},
- { LPGENT("Outgoing background"), SRMSGSET_OUTGOINGBKGCOLOUR, 0, COLOR_WINDOW},
- { LPGENT("Info bar background"), SRMSGSET_INFOBARBKGCOLOUR, 0, COLOR_3DLIGHT},
- { LPGENT("Line between messages"), SRMSGSET_LINECOLOUR, 0, COLOR_3DLIGHT},
+ { LPGENW("Background"), SRMSGSET_BKGCOLOUR, 0, COLOR_WINDOW},
+ { LPGENW("Input area background"), SRMSGSET_INPUTBKGCOLOUR, 0, COLOR_WINDOW},
+ { LPGENW("Incoming background"), SRMSGSET_INCOMINGBKGCOLOUR, 0, COLOR_WINDOW},
+ { LPGENW("Outgoing background"), SRMSGSET_OUTGOINGBKGCOLOUR, 0, COLOR_WINDOW},
+ { LPGENW("Info bar background"), SRMSGSET_INFOBARBKGCOLOUR, 0, COLOR_3DLIGHT},
+ { LPGENW("Line between messages"), SRMSGSET_LINECOLOUR, 0, COLOR_3DLIGHT},
};
int FontServiceFontsChanged(WPARAM, LPARAM)
@@ -106,8 +106,8 @@ int FontServiceFontsChanged(WPARAM, LPARAM) void RegisterFontServiceFonts()
{
FontIDT fid = { sizeof(fid) };
- _tcsncpy_s(fid.group, LPGENT("Messaging"), _TRUNCATE);
- _tcsncpy_s(fid.backgroundGroup, LPGENT("Messaging"), _TRUNCATE);
+ wcsncpy_s(fid.group, LPGENW("Messaging"), _TRUNCATE);
+ wcsncpy_s(fid.backgroundGroup, LPGENW("Messaging"), _TRUNCATE);
strncpy(fid.dbSettingsGroup, SRMMMOD, _countof(fid.dbSettingsGroup));
fid.flags = FIDF_DEFAULTVALID | FIDF_DEFAULTVALID;
for (int i = 0; i < _countof(fontOptionsList); i++) {
@@ -116,23 +116,23 @@ void RegisterFontServiceFonts() char szTemp[100];
mir_snprintf(szTemp, "SRMFont%d", i);
strncpy(fid.prefix, szTemp, _countof(fid.prefix));
- _tcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name));
+ wcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name));
fid.deffontsettings.colour = fontOptionsList[i].defColour;
fid.deffontsettings.size = fontOptionsList[i].defSize;
fid.deffontsettings.style = fontOptionsList[i].defStyle;
fid.deffontsettings.charset = DEFAULT_CHARSET;
- _tcsncpy(fid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fid.deffontsettings.szFace));
- _tcsncpy(fid.backgroundName, fontOptionsList[i].szBkgName, _countof(fid.backgroundName));
+ wcsncpy(fid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fid.deffontsettings.szFace));
+ wcsncpy(fid.backgroundName, fontOptionsList[i].szBkgName, _countof(fid.backgroundName));
FontRegisterT(&fid);
}
ColourIDT cid = { sizeof(cid) };
- _tcsncpy_s(cid.group, LPGENT("Messaging"), _TRUNCATE);
+ wcsncpy_s(cid.group, LPGENW("Messaging"), _TRUNCATE);
strncpy(cid.dbSettingsGroup, SRMMMOD, _countof(fid.dbSettingsGroup));
cid.flags = 0;
for (int i = 0; i < _countof(colourOptionsList); i++) {
cid.order = i;
- _tcsncpy(cid.name, colourOptionsList[i].szName, _countof(cid.name));
+ wcsncpy(cid.name, colourOptionsList[i].szName, _countof(cid.name));
if (colourOptionsList[i].systemColor != -1)
cid.defcolour = GetSysColor(colourOptionsList[i].systemColor);
else
@@ -192,7 +192,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour) if (tszFace == NULL)
mir_tstrcpy(lf->lfFaceName, fontOptionsList[i].szDefFace);
else
- _tcsncpy(lf->lfFaceName, tszFace, _countof(lf->lfFaceName));
+ wcsncpy(lf->lfFaceName, tszFace, _countof(lf->lfFaceName));
mir_snprintf(str, "%s%dSet", "SRMFont", i);
lf->lfCharSet = db_get_b(NULL, SRMMMOD, str, DEFAULT_CHARSET);
@@ -202,21 +202,21 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour) struct CheckBoxValues_t
{
DWORD style;
- const TCHAR *szDescr;
+ const wchar_t *szDescr;
};
static const struct CheckBoxValues_t 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)
@@ -862,9 +862,9 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam {
CLCINFOITEM cii = { sizeof(cii) };
cii.flags = CLCIIF_GROUPFONT | CLCIIF_CHECKBOX;
- cii.pszText = (TCHAR*)TranslateT("** New contacts **");
+ cii.pszText = (wchar_t*)TranslateT("** New contacts **");
hItemNew = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
- cii.pszText = (TCHAR*)TranslateT("** Unknown contacts **");
+ cii.pszText = (wchar_t*)TranslateT("** Unknown contacts **");
hItemUnknown = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
}
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE) | CLS_SHOWHIDDEN | CLS_NOHIDEOFFLINE);
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index d397964eae..41c9fc09e9 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -120,7 +120,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) }
}
if (hwnd == NULL || !IsWindowVisible(GetParent(hwnd))) {
- TCHAR toolTip[256];
+ wchar_t toolTip[256];
mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = {};
@@ -205,7 +205,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) if (hwnd)
SendMessage(hwnd, DM_TYPING, 0, lParam);
else if (lParam && (g_dat.flags2 & SMF2_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.flags2 & SMF2_SHOWTYPINGCLIST)) {
@@ -292,7 +292,7 @@ static void RestoreUnreadMessageAlerts(void) }
}
- TCHAR toolTip[256];
+ wchar_t toolTip[256];
CLISTEVENT cle = {};
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
@@ -523,8 +523,7 @@ int OnLoadModule(void) hMsftEdit = LoadLibrary(L"Msftedit.dll");
if (hMsftEdit == NULL) {
if (IDYES != MessageBox(0,
- TranslateT
- ("Miranda could not load the built-in message module, Msftedit.dll is missing. If you are using WINE, please make sure you have Msftedit.dll installed. Press 'Yes' to continue loading Miranda."),
+ TranslateT("Miranda could not load the built-in message module, Msftedit.dll is missing. If you are using WINE, please make sure you have Msftedit.dll installed. Press 'Yes' to continue loading Miranda."),
TranslateT("Information"), MB_YESNO | MB_ICONINFORMATION))
return 1;
return 0;
@@ -647,7 +646,7 @@ STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEU STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE *lplpstg)
{
- TCHAR sztName[64];
+ wchar_t sztName[64];
mir_sntprintf(sztName, L"s%u", nextStgId++);
if (pictStg == NULL)
return STG_E_MEDIUMFULL;
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index e4a8a19660..a4e6d42553 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct ToolbarButton
{
- TCHAR *name;
+ wchar_t *name;
UINT controlId;
int alignment;
int spacing;
@@ -38,9 +38,9 @@ struct ToolbarButton struct ErrorWindowData
{
- TCHAR *szName;
- TCHAR *szDescription;
- TCHAR *szText;
+ wchar_t *szName;
+ wchar_t *szDescription;
+ wchar_t *szText;
MessageSendQueueItem *queueItem;
HWND hwndParent;
};
diff --git a/plugins/Scriver/src/msgtimedout.cpp b/plugins/Scriver/src/msgtimedout.cpp index e50504a340..1db437ddbf 100644 --- a/plugins/Scriver/src/msgtimedout.cpp +++ b/plugins/Scriver/src/msgtimedout.cpp @@ -31,7 +31,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar case WM_INITDIALOG:
{
RECT rc, rcParent;
- TCHAR szText[2048];
+ wchar_t szText[2048];
ewd = (ErrorWindowData *) lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) ewd);
TranslateDialogDefault(hwndDlg);
@@ -52,7 +52,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar if (ewd->szName)
mir_sntprintf(szText, L"%s - %s", TranslateT("Send error"), ewd->szName);
else
- _tcsncpy_s(szText, TranslateT("Send error"), _TRUNCATE);
+ wcsncpy_s(szText, TranslateT("Send error"), _TRUNCATE);
SetWindowText(hwndDlg, szText);
GetWindowRect(hwndDlg, &rc);
diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp index 53348f2bdb..3bf73b1fb3 100644 --- a/plugins/Scriver/src/msgwindow.cpp +++ b/plugins/Scriver/src/msgwindow.cpp @@ -33,12 +33,12 @@ static void DrawTab(ParentWindowData *dat, HWND hwnd, WPARAM wParam, LPARAM lPar /////////////////////////////////////////////////////////////////////////////////////////
-static const TCHAR *titleTokenNames[] = { L"%name%", L"%status%", L"%statusmsg%", L"%account%" };
+static const wchar_t *titleTokenNames[] = { L"%name%", L"%status%", L"%statusmsg%", L"%account%" };
-TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
+wchar_t* GetWindowTitle(MCONTACT hContact, const char *szProto)
{
ptrT tmplt;
- const TCHAR* tokens[4] = { 0 };
+ const wchar_t* tokens[4] = { 0 };
CMString tszTemplate, tszStatus, tszTitle;
if (hContact && szProto) {
@@ -67,12 +67,12 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto) }
}
- for (const TCHAR *p = tszTemplate; *p; p++) {
+ for (const wchar_t *p = tszTemplate; *p; p++) {
if (*p == '%') {
int i;
for (i = 0; i < _countof(titleTokenNames); i++) {
size_t tnlen = mir_tstrlen(titleTokenNames[i]);
- if (!_tcsncmp(p, titleTokenNames[i], tnlen)) {
+ if (!wcsncmp(p, titleTokenNames[i], tnlen)) {
if (tokens[i] != NULL)
tszTitle.Append(tokens[i]);
@@ -461,7 +461,7 @@ LRESULT CALLBACK TabCtrlProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) dat->destTab = TabCtrl_HitTest(hwnd, &thinfo);
if (thinfo.flags != TCHT_NOWHERE && dat->destTab != dat->srcTab) {
NMHDR nmh;
- TCHAR sBuffer[501];
+ wchar_t sBuffer[501];
TCITEM item;
int curSel;
curSel = TabCtrl_GetCurSel(hwnd);
@@ -1207,7 +1207,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR TitleBarData *tbd = (TitleBarData *)wParam;
if (tbd != NULL && dat->hwndActive == hwnd) {
if (tbd->iFlags & TBDF_TEXT) {
- TCHAR oldtitle[256];
+ wchar_t oldtitle[256];
GetWindowText(hwndDlg, oldtitle, _countof(oldtitle));
if (mir_tstrcmp(tbd->pszText, oldtitle))
SetWindowText(hwndDlg, tbd->pszText);
@@ -1248,7 +1248,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR TabControlData *tcd = (TabControlData*)wParam;
int tabId = GetTabFromHWND(dat, (HWND)lParam);
if (tabId >= 0 && tcd != NULL) {
- TCHAR *ptszTemp = NULL;
+ wchar_t *ptszTemp = NULL;
TCITEM tci;
tci.mask = 0;
@@ -1256,7 +1256,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR tci.mask |= TCIF_TEXT;
tci.pszText = tcd->pszText;
if (g_dat.flags2 & SMF2_LIMITNAMES) {
- TCHAR *ltext = limitText(tcd->pszText, g_dat.limitNamesLength);
+ wchar_t *ltext = limitText(tcd->pszText, g_dat.limitNamesLength);
if (ltext != tcd->pszText)
tci.pszText = ptszTemp = ltext;
}
@@ -1345,7 +1345,7 @@ static void DrawTab(ParentWindowData *dat, HWND hwnd, WPARAM, LPARAM lParam) TabCtrlData *tcdat = (TabCtrlData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
HANDLE hTheme = NULL;
int tstate = 0;
- TCHAR szLabel[1024];
+ wchar_t szLabel[1024];
TCITEM tci;
tci.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_STATE;
tci.pszText = szLabel;
diff --git a/plugins/Scriver/src/msgwindow.h b/plugins/Scriver/src/msgwindow.h index d3e8092b8b..df0c822d16 100644 --- a/plugins/Scriver/src/msgwindow.h +++ b/plugins/Scriver/src/msgwindow.h @@ -60,7 +60,7 @@ struct StatusBarData {
int iItem;
int iFlags;
- TCHAR *pszText;
+ wchar_t *pszText;
HICON hIcon;
};
@@ -70,7 +70,7 @@ struct StatusBarData struct TitleBarData
{
int iFlags;
- TCHAR *pszText;
+ wchar_t *pszText;
HICON hIcon;
HICON hIconBig;
HICON hIconNot;
@@ -82,11 +82,11 @@ struct TitleBarData struct TabControlData
{
int iFlags;
- TCHAR *pszText;
+ wchar_t *pszText;
HICON hIcon;
};
-TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto);
+wchar_t* GetWindowTitle(MCONTACT hContact, const char *szProto);
HWND GetParentWindow(MCONTACT hContact, BOOL bChat);
void NotifyLocalWinEvent(MCONTACT hContact, HWND hwnd, unsigned int type);
diff --git a/plugins/Scriver/src/sendqueue.cpp b/plugins/Scriver/src/sendqueue.cpp index 908056ee08..770d00dc9c 100644 --- a/plugins/Scriver/src/sendqueue.cpp +++ b/plugins/Scriver/src/sendqueue.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static MessageSendQueueItem *global_sendQueue = NULL;
static mir_cs queueMutex;
-TCHAR* GetSendBufferMsg(MessageSendQueueItem *item)
+wchar_t* GetSendBufferMsg(MessageSendQueueItem *item)
{
return mir_utf8decodeW(item->sendBuffer);
}
diff --git a/plugins/Scriver/src/sendqueue.h b/plugins/Scriver/src/sendqueue.h index 8445a2dbac..470e3d5553 100644 --- a/plugins/Scriver/src/sendqueue.h +++ b/plugins/Scriver/src/sendqueue.h @@ -41,7 +41,7 @@ struct MessageSendQueueItem };
MessageSendQueueItem* CreateSendQueueItem(HWND hwndSender);
-TCHAR * GetSendBufferMsg(MessageSendQueueItem *item);
+wchar_t * GetSendBufferMsg(MessageSendQueueItem *item);
MessageSendQueueItem* FindOldestPendingSendQueueItem(HWND hwndSender, MCONTACT hContact);
MessageSendQueueItem* FindSendQueueItem(MCONTACT hContact, HANDLE hSendId);
BOOL RemoveSendQueueItem(MessageSendQueueItem* item);
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp index 43461d070b..8e771e2485 100644 --- a/plugins/Scriver/src/utils.cpp +++ b/plugins/Scriver/src/utils.cpp @@ -81,7 +81,7 @@ char* GetRichTextUtf(HWND hwnd) return textBuffer;
}
-int SetRichText(HWND hwnd, const TCHAR *text)
+int SetRichText(HWND hwnd, const wchar_t *text)
{
SETTEXTEX st;
st.flags = ST_DEFAULT;
@@ -140,32 +140,32 @@ char* GetRichTextRTF(HWND hwnd) return pszText; // pszText contains the text
}
-void rtrimText(TCHAR *text)
+void rtrimText(wchar_t *text)
{
- static TCHAR szTrimString[] = L":;,.!?\'\"><()[]- \r\n";
+ static wchar_t szTrimString[] = L":;,.!?\'\"><()[]- \r\n";
size_t iLen = mir_tstrlen(text) - 1;
- while (_tcschr(szTrimString, text[iLen])) {
- text[iLen] = _T('\0');
+ while (wcschr(szTrimString, text[iLen])) {
+ text[iLen] = '\0';
iLen--;
}
}
-TCHAR* limitText(TCHAR *text, int limit)
+wchar_t* limitText(wchar_t *text, int limit)
{
size_t len = mir_tstrlen(text);
if (len > g_dat.limitNamesLength) {
- TCHAR *ptszTemp = (TCHAR*)mir_alloc(sizeof(TCHAR) * (limit + 4));
- _tcsncpy(ptszTemp, text, limit + 1);
- _tcsncpy(ptszTemp + limit, L"...", 4);
+ wchar_t *ptszTemp = (wchar_t*)mir_alloc(sizeof(wchar_t) * (limit + 4));
+ wcsncpy(ptszTemp, text, limit + 1);
+ wcsncpy(ptszTemp + limit, L"...", 4);
return ptszTemp;
}
return text;
}
-TCHAR* GetRichTextWord(HWND hwnd, POINTL *ptl)
+wchar_t* GetRichTextWord(HWND hwnd, POINTL *ptl)
{
long iCharIndex, start, end, iRes;
- TCHAR *pszWord = GetRichEditSelection(hwnd);
+ wchar_t *pszWord = GetRichEditSelection(hwnd);
if (pszWord == NULL) {
iCharIndex = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM)ptl);
if (iCharIndex >= 0) {
@@ -175,7 +175,7 @@ TCHAR* GetRichTextWord(HWND hwnd, POINTL *ptl) TEXTRANGE tr;
CHARRANGE cr;
memset(&tr, 0, sizeof(TEXTRANGE));
- pszWord = (TCHAR*)mir_alloc(sizeof(TCHAR) * (end - start + 1));
+ pszWord = (wchar_t*)mir_alloc(sizeof(wchar_t) * (end - start + 1));
cr.cpMin = start;
cr.cpMax = end;
tr.chrg = cr;
@@ -200,12 +200,12 @@ static DWORD CALLBACK StreamOutCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG msi->sendBuffer = (char*)mir_realloc(msi->sendBuffer, msi->sendBufferSize + cb + 2);
memcpy(msi->sendBuffer + msi->sendBufferSize, pbBuff, cb);
msi->sendBufferSize += cb;
- *((TCHAR*)(msi->sendBuffer + msi->sendBufferSize)) = '\0';
+ *((wchar_t*)(msi->sendBuffer + msi->sendBufferSize)) = '\0';
*pcb = cb;
return 0;
}
-TCHAR *GetRichEditSelection(HWND hwnd)
+wchar_t *GetRichEditSelection(HWND hwnd)
{
CHARRANGE sel;
SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel);
@@ -221,7 +221,7 @@ TCHAR *GetRichEditSelection(HWND hwnd) stream.pfnCallback = StreamOutCallback;
stream.dwCookie = (DWORD_PTR)&msi;
SendMessage(hwnd, EM_STREAMOUT, SF_TEXT | SF_UNICODE | SFF_SELECTION, (LPARAM)&stream);
- return (TCHAR*)msi.sendBuffer;
+ return (wchar_t*)msi.sendBuffer;
}
void AppendToBuffer(char *&buffer, size_t &cbBufferEnd, size_t &cbBufferAlloced, const char *fmt, ...)
@@ -245,9 +245,9 @@ void AppendToBuffer(char *&buffer, size_t &cbBufferEnd, size_t &cbBufferAlloced, int MeasureMenuItem(WPARAM, LPARAM lParam)
{
LPMEASUREITEMSTRUCT mis = (LPMEASUREITEMSTRUCT)lParam;
- if (mis->itemData != (ULONG_PTR)g_dat.hButtonIconList && mis->itemData != (ULONG_PTR)g_dat.hSearchEngineIconList && mis->itemData != (ULONG_PTR)g_dat.hChatButtonIconList) {
+ if (mis->itemData != (ULONG_PTR)g_dat.hButtonIconList && mis->itemData != (ULONG_PTR)g_dat.hSearchEngineIconList && mis->itemData != (ULONG_PTR)g_dat.hChatButtonIconList)
return FALSE;
- }
+
mis->itemWidth = max(0, GetSystemMetrics(SM_CXSMICON) - GetSystemMetrics(SM_CXMENUCHECK) + 4);
mis->itemHeight = GetSystemMetrics(SM_CYSMICON) + 2;
return TRUE;
@@ -335,7 +335,7 @@ char *url_encode(char *str) return buf;
}
-void SearchWord(TCHAR *word, int engine)
+void SearchWord(wchar_t *word, int engine)
{
char szURL[4096];
if (word && word[0]) {
diff --git a/plugins/Scriver/src/utils.h b/plugins/Scriver/src/utils.h index 89ee584390..de18f2d2b5 100644 --- a/plugins/Scriver/src/utils.h +++ b/plugins/Scriver/src/utils.h @@ -34,16 +34,16 @@ enum SEARCHENGINES { SEARCHENGINE_FOODNETWORK = 8
};
-TCHAR *limitText(TCHAR *text, int limit);
+wchar_t *limitText(wchar_t *text, int limit);
void logInfo(const char *fmt, ...);
int GetRichTextLength(HWND hwnd, int codepage, BOOL inBytes);
-TCHAR *GetRichEditSelection(HWND hwnd);
+wchar_t *GetRichEditSelection(HWND hwnd);
char* GetRichTextRTF(HWND hwnd);
char* GetRichTextUtf(HWND hwnd);
-TCHAR *GetRichTextWord(HWND hwnd, POINTL *pt);
-int SetRichText(HWND hwnd, const TCHAR *text);
+wchar_t *GetRichTextWord(HWND hwnd, POINTL *pt);
+int SetRichText(HWND hwnd, const wchar_t *text);
int SetRichTextRTF(HWND hwnd, const char *text);
-void SearchWord(TCHAR * word, int engine);
+void SearchWord(wchar_t * word, int engine);
HDWP ResizeToolbar(HWND hwnd, HDWP hdwp, int width, int vPos, int height, int cControls, const ToolbarButton * buttons, int controlVisibility);
void ShowToolbarControls(HWND hwndDlg, int cControls, const ToolbarButton * buttons, int controlVisibility, int state);
void AppendToBuffer(char *&buffer, size_t &cbBufferEnd, size_t &cbBufferAlloced, const char *fmt, ...);
diff --git a/plugins/SecureIM/src/loadicons.cpp b/plugins/SecureIM/src/loadicons.cpp index a36986d8d9..ceb5a545cd 100644 --- a/plugins/SecureIM/src/loadicons.cpp +++ b/plugins/SecureIM/src/loadicons.cpp @@ -76,8 +76,8 @@ void InitIcons(void) HINSTANCE hNewIconInst = NULL;
if (g_hFolders) {
- TCHAR pathname[MAX_PATH];
- FoldersGetCustomPathExT(g_hFolders, pathname, MAX_PATH, "icons\\");
+ char pathname[MAX_PATH];
+ FoldersGetCustomPath(g_hFolders, pathname, MAX_PATH, "icons\\");
if (hNewIconInst == NULL)
hNewIconInst = LoadIconsPack(pathname);
}
@@ -93,12 +93,12 @@ void InitIcons(void) else
g_hIconInst = hNewIconInst;
- TCHAR tszPath[MAX_PATH];
+ char tszPath[MAX_PATH];
GetModuleFileName(g_hIconInst, tszPath, _countof(tszPath));
SKINICONDESC sid = { 0 };
sid.section.a = "SecureIM";
- sid.defaultFile.t = tszPath;
+ sid.defaultFile.a = tszPath;
for (int i = 0; i < _countof(icons); i++) {
sid.section.a = icons[i].section;
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp index 5a02a2cf66..91443d4d5c 100644 --- a/plugins/SecureIM/src/main.cpp +++ b/plugins/SecureIM/src/main.cpp @@ -43,7 +43,7 @@ static HGENMENU MyAddMenuItem(LPCWSTR name, int pos, LPCSTR szUid, HICON hicon, mi.flags = flags | CMIF_HIDDEN | CMIF_UNICODE;
mi.position = pos;
mi.hIcolibItem = hicon;
- mi.name.t = (TCHAR*)name;
+ mi.name.w = (wchar_t*)name;
mi.pszService = (char*)service;
HGENMENU res = Menu_AddContactMenuItem(&mi);
Menu_ConfigureItem(res, MCI_OPT_UID, szUid);
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index 6c05088389..0adf09a814 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -1573,7 +1573,7 @@ BOOL ShowSelectKeyDlg(HWND hParent, LPSTR KeyPath) char temp[MAX_PATH];
mir_snprintf(temp, "%s (*.asc)%c*.asc%c%s (*.*)%c*.*%c%c", Translate("ASC files"), 0, 0, Translate("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
- ofn.lpstrTitle = TranslateT("Open Key File");
+ ofn.lpstrTitle = Translate("Open Key File");
if (!GetOpenFileName(&ofn)) return FALSE;
return TRUE;
@@ -1622,7 +1622,7 @@ LPSTR LoadKeys(LPCSTR file, BOOL priv) BOOL SaveExportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv)
{
- TCHAR szFile[MAX_PATH] = "rsa_pub.asc";
+ char szFile[MAX_PATH] = "rsa_pub.asc";
if (priv)
mir_tstrcpy(szFile, "rsa_priv.asc");
@@ -1635,11 +1635,11 @@ BOOL SaveExportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv) ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_NONETWORKBUTTON;
ofn.lpstrFile = szFile;
- ofn.lpstrTitle = (priv) ? TranslateT("Save Private Key File") : TranslateT("Save Public Key File");
+ ofn.lpstrTitle = (priv) ? Translate("Save Private Key File") : Translate("Save Public Key File");
if (!GetSaveFileName(&ofn))
return FALSE;
- FILE *f = _tfopen(szFile, "wb");
+ FILE *f = fopen(szFile, "wb");
if (!f)
return FALSE;
fwrite(key, mir_strlen(key), 1, f);
@@ -1650,7 +1650,7 @@ BOOL SaveExportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv) BOOL LoadImportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv)
{
- TCHAR szFile[MAX_PATH] = "rsa_pub.asc";
+ char szFile[MAX_PATH] = "rsa_pub.asc";
if (priv)
mir_tstrcpy(szFile, "rsa_priv.asc");
@@ -1663,11 +1663,11 @@ BOOL LoadImportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv) char temp[MAX_PATH];
mir_snprintf(temp, "%s (*.asc)%c*.asc%c%s (*.*)%c*.*%c%c", Translate("ASC files"), 0, 0, Translate("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
- ofn.lpstrTitle = (priv) ? TranslateT("Load Private Key File") : TranslateT("Load Public Key File");
+ ofn.lpstrTitle = (priv) ? Translate("Load Private Key File") : Translate("Load Public Key File");
if (!GetOpenFileName(&ofn))
return FALSE;
- FILE *f = _tfopen(szFile, "rb");
+ FILE *f = fopen(szFile, "rb");
if (!f)
return FALSE;
diff --git a/plugins/SeenPlugin/src/file.cpp b/plugins/SeenPlugin/src/file.cpp index 3417e06dd2..5337d2ecb5 100644 --- a/plugins/SeenPlugin/src/file.cpp +++ b/plugins/SeenPlugin/src/file.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
BOOL g_bFileActive;
-static TCHAR *g_ptszFileStamp, *g_ptszFileName;
+static wchar_t *g_ptszFileStamp, *g_ptszFileName;
/////////////////////////////////////////////////////////////////////////////////////////
// Prepares the log file:
@@ -35,8 +35,8 @@ void InitFileOutput(void) tszFileName = mir_tstrdup(DEFAULT_FILENAME);
replaceStrT(g_ptszFileName, VARST(tszFileName));
- TCHAR *tszPath = NEWTSTR_ALLOCA(g_ptszFileName);
- TCHAR *p = _tcsrchr(tszPath, '\\');
+ wchar_t *tszPath = NEWWSTR_ALLOCA(g_ptszFileName);
+ wchar_t *p = wcsrchr(tszPath, '\\');
if (p) *p = 0;
CreateDirectoryTreeT(tszPath);
@@ -55,9 +55,9 @@ void UninitFileOutput() void FileWrite(MCONTACT hcontact)
{
- FILE *log = _tfopen(ParseString(g_ptszFileName, hcontact), L"a");
+ FILE *log = _wfopen(ParseString(g_ptszFileName, hcontact), L"a");
if (log != NULL) {
- _fputts(ParseString(g_ptszFileStamp, hcontact), log);
+ fputws(ParseString(g_ptszFileStamp, hcontact), log);
fputs("\r\n", log);
fclose(log);
}
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index 7d589a95c8..4aa5d23d1b 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -50,7 +50,7 @@ void HistoryWrite(MCONTACT hContact) if (historyLast >= historyMax)
historyLast = historyMax - 1;
- TCHAR *ptszString;
+ wchar_t *ptszString;
DBVARIANT dbv;
if (!db_get_ts(NULL, S_MOD, "HistoryStamp", &dbv)) {
ptszString = ParseString(dbv.ptszVal, hContact);
@@ -167,7 +167,7 @@ void MyResizeGetOffset(HWND hwndControl, int nWidth, int nHeight, int* nDx, int* INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARAM lparam)
{
MCONTACT hContact;
- TCHAR sztemp[1024];
+ wchar_t sztemp[1024];
switch (Message) {
case WM_INITDIALOG:
@@ -234,7 +234,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARA CallService(MS_MSG_SENDMESSAGE, hContact, 0);
break;
case IDC_TEST:
- debug(ParseString(LPGENT("Date: %d.%m.%y(%Y) \n Date desc: %W - %w - %E - %e \n Time: %H:%M:%S (%h-%p) \n user: %n - %u \n Status: %s \n IP: %i - %r"), hContact));
+ debug(ParseString(LPGENW("Date: %d.%m.%y(%Y) \n Date desc: %W - %w - %E - %e \n Time: %H:%M:%S (%h-%p) \n user: %n - %u \n Status: %s \n IP: %i - %r"), hContact));
break;
}
break;
diff --git a/plugins/SeenPlugin/src/main.cpp b/plugins/SeenPlugin/src/main.cpp index e3d6c714e6..cb98026c61 100644 --- a/plugins/SeenPlugin/src/main.cpp +++ b/plugins/SeenPlugin/src/main.cpp @@ -104,10 +104,10 @@ extern "C" __declspec(dllexport) int Load(void) LoadWatchedProtos();
- SkinAddNewSoundExT("LastSeenTrackedStatusChange", LPGENT("LastSeen"), LPGENT("User status change"));
- SkinAddNewSoundExT("LastSeenTrackedStatusOnline", LPGENT("LastSeen"), LPGENT("Changed to Online"));
- SkinAddNewSoundExT("LastSeenTrackedStatusOffline", LPGENT("LastSeen"), LPGENT("User Logged Off"));
- SkinAddNewSoundExT("LastSeenTrackedStatusFromOffline", LPGENT("LastSeen"), LPGENT("User Logged In"));
+ SkinAddNewSoundExT("LastSeenTrackedStatusChange", LPGENW("LastSeen"), LPGENW("User status change"));
+ SkinAddNewSoundExT("LastSeenTrackedStatusOnline", LPGENW("LastSeen"), LPGENW("Changed to Online"));
+ SkinAddNewSoundExT("LastSeenTrackedStatusOffline", LPGENW("LastSeen"), LPGENW("User Logged Off"));
+ SkinAddNewSoundExT("LastSeenTrackedStatusFromOffline", LPGENW("LastSeen"), LPGENW("User Logged In"));
return 0;
}
diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp index eeb15431f4..5288c204f5 100644 --- a/plugins/SeenPlugin/src/missed.cpp +++ b/plugins/SeenPlugin/src/missed.cpp @@ -105,9 +105,9 @@ int ShowMissed(void) if (!mcs.count)
return 0;
- TCHAR sztemp[1024], szcount[7];
+ wchar_t sztemp[1024], szcount[7];
for (int loop = 0; loop < mcs.count; loop++) {
- mir_tstrncat(sztemp, (TCHAR*)pcli->pfnGetContactDisplayName(mcs.wpcontact[loop], 0), _countof(sztemp) - mir_tstrlen(sztemp));
+ mir_tstrncat(sztemp, (wchar_t*)pcli->pfnGetContactDisplayName(mcs.wpcontact[loop], 0), _countof(sztemp) - mir_tstrlen(sztemp));
if (db_get_b(NULL, S_MOD, "MissedOnes_Count", 0)) {
mir_sntprintf(szcount, L" [%i]", mcs.times[loop]);
mir_tstrcat(sztemp, szcount);
diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index adc23838ba..178eaf301d 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
{
DBVARIANT dbv;
- TCHAR szstamp[256];
+ wchar_t szstamp[256];
BOOL hasPopups;
BYTE bchecked;
@@ -91,10 +91,10 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp ppd.lchIcon = Skin_LoadProtoIcon(NULL, idBack);
GetDlgItemText(hdlg, IDC_POPUPSTAMP, szstamp, _countof(szstamp));
- _tcsncpy(ppd.lptzContactName, ParseString(szstamp, NULL), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzContactName, ParseString(szstamp, NULL), MAX_CONTACTNAME);
GetDlgItemText(hdlg, IDC_POPUPSTAMPTEXT, szstamp, _countof(szstamp));
- _tcsncpy(ppd.lptzText, ParseString(szstamp, NULL), MAX_SECONDLINE);
+ wcsncpy(ppd.lptzText, ParseString(szstamp, NULL), MAX_SECONDLINE);
PUAddPopupT(&ppd);
SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
@@ -164,7 +164,7 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
{
DBVARIANT dbv;
- TCHAR szstamp[256];
+ wchar_t szstamp[256];
switch (msg) {
case WM_INITDIALOG:
@@ -434,15 +434,15 @@ int OptionsInit(WPARAM wparam, LPARAM) odp.hInstance = hInstance;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_SETTINGS);
- odp.ptszGroup = LPGENT("Contacts");
- odp.ptszTitle = LPGENT("Last seen");
+ odp.pwszGroup = LPGENW("Contacts");
+ odp.pwszTitle = LPGENW("Last seen");
odp.pfnDlgProc = OptsSettingsDlgProc;
Options_AddPage(wparam, &odp);
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPS);
- odp.ptszGroup = LPGENT("Popups");
- odp.ptszTitle = LPGENT("Last seen");
+ odp.pwszGroup = LPGENW("Popups");
+ odp.pwszTitle = LPGENW("Last seen");
odp.pfnDlgProc = OptsPopupsDlgProc;
Options_AddPage(wparam, &odp);
}
diff --git a/plugins/SeenPlugin/src/stdafx.h b/plugins/SeenPlugin/src/stdafx.h index 48999ed4c2..67fb460e2f 100644 --- a/plugins/SeenPlugin/src/stdafx.h +++ b/plugins/SeenPlugin/src/stdafx.h @@ -94,7 +94,7 @@ typedef struct{ } MISSEDCONTACTS;
int IsWatchedProtocol(const char* szProto);
-TCHAR *ParseString(TCHAR*, MCONTACT);
+wchar_t *ParseString(wchar_t*, MCONTACT);
void GetColorsFromDWord(LPCOLORREF First, LPCOLORREF Second, DWORD colDword);
DWORD GetDWordFromColors(COLORREF First, COLORREF Second);
int OptionsInit(WPARAM,LPARAM);
diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp index 25844a0435..318e336278 100644 --- a/plugins/SeenPlugin/src/userinfo.cpp +++ b/plugins/SeenPlugin/src/userinfo.cpp @@ -42,7 +42,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar case WM_REFRESH_UI:
{
ptrT szout(db_get_tsa(NULL, S_MOD, "UserStamp"));
- TCHAR *str = ParseString((szout != NULL) ? szout : DEFAULT_USERSTAMP, wparam);
+ wchar_t *str = ParseString((szout != NULL) ? szout : DEFAULT_USERSTAMP, wparam);
SetDlgItemText(hdlg, IDC_INFOTEXT, str);
if (!mir_tstrcmp(str, TranslateT("<unknown>")))
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 8b281dd3f9..e820fa97b6 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -141,17 +141,17 @@ DWORD isSeen(MCONTACT hcontact, SYSTEMTIME *st) return res;
}
-TCHAR *weekdays[] = { LPGENT("Sunday"), LPGENT("Monday"), LPGENT("Tuesday"), LPGENT("Wednesday"), LPGENT("Thursday"), LPGENT("Friday"), LPGENT("Saturday") };
-TCHAR *wdays_short[] = { LPGENT("Sun."), LPGENT("Mon."), LPGENT("Tue."), LPGENT("Wed."), LPGENT("Thu."), LPGENT("Fri."), LPGENT("Sat.") };
-TCHAR *monthnames[] = { LPGENT("January"), LPGENT("February"), LPGENT("March"), LPGENT("April"), LPGENT("May"), LPGENT("June"), LPGENT("July"), LPGENT("August"), LPGENT("September"), LPGENT("October"), LPGENT("November"), LPGENT("December") };
-TCHAR *mnames_short[] = { LPGENT("Jan."), LPGENT("Feb."), LPGENT("Mar."), LPGENT("Apr."), LPGENT("May"), LPGENT("Jun."), LPGENT("Jul."), LPGENT("Aug."), LPGENT("Sep."), LPGENT("Oct."), LPGENT("Nov."), LPGENT("Dec.") };
+wchar_t *weekdays[] = { LPGENW("Sunday"), LPGENW("Monday"), LPGENW("Tuesday"), LPGENW("Wednesday"), LPGENW("Thursday"), LPGENW("Friday"), LPGENW("Saturday") };
+wchar_t *wdays_short[] = { LPGENW("Sun."), LPGENW("Mon."), LPGENW("Tue."), LPGENW("Wed."), LPGENW("Thu."), LPGENW("Fri."), LPGENW("Sat.") };
+wchar_t *monthnames[] = { LPGENW("January"), LPGENW("February"), LPGENW("March"), LPGENW("April"), LPGENW("May"), LPGENW("June"), LPGENW("July"), LPGENW("August"), LPGENW("September"), LPGENW("October"), LPGENW("November"), LPGENW("December") };
+wchar_t *mnames_short[] = { LPGENW("Jan."), LPGENW("Feb."), LPGENW("Mar."), LPGENW("Apr."), LPGENW("May"), LPGENW("Jun."), LPGENW("Jul."), LPGENW("Aug."), LPGENW("Sep."), LPGENW("Oct."), LPGENW("Nov."), LPGENW("Dec.") };
-TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
+wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact)
{
#define MAXSIZE 1024
- static TCHAR sztemp[MAXSIZE + 1];
- TCHAR szdbsetting[128];
- TCHAR *charPtr;
+ static wchar_t sztemp[MAXSIZE + 1];
+ wchar_t szdbsetting[128];
+ wchar_t *charPtr;
int isetting = 0;
DWORD dwsetting = 0;
struct in_addr ia;
@@ -168,8 +168,8 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact) char *szProto = hcontact ? GetContactProto(hcontact) : courProtoName;
ptrT info;
- TCHAR *d = sztemp;
- for (TCHAR *p = szstring; *p; p++) {
+ wchar_t *d = sztemp;
+ for (wchar_t *p = szstring; *p; p++) {
if (d >= sztemp + MAXSIZE)
break;
@@ -182,18 +182,18 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact) switch (*++p) {
case 'Y':
if (!st.wYear) goto LBL_noData;
- d += _stprintf(d, L"%04i", st.wYear); //!!!!!!!!!!!!
+ d += swprintf(d, L"%04i", st.wYear); //!!!!!!!!!!!!
break;
case 'y':
if (!st.wYear) goto LBL_noData;
- d += _stprintf(d, L"%02i", st.wYear % 100); //!!!!!!!!!!!!
+ d += swprintf(d, L"%02i", st.wYear % 100); //!!!!!!!!!!!!
break;
case 'm':
if (!(isetting = st.wMonth)) goto LBL_noData;
LBL_2DigNum:
- d += _stprintf(d, L"%02i", isetting); //!!!!!!!!!!!!
+ d += swprintf(d, L"%02i", isetting); //!!!!!!!!!!!!
break;
case 'd':
@@ -252,7 +252,7 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact) goto LBL_2DigNum;
case 'n':
- charPtr = hcontact ? (TCHAR*)pcli->pfnGetContactDisplayName(hcontact, 0) : (wantempty ? L"" : L"---");
+ charPtr = hcontact ? (wchar_t*)pcli->pfnGetContactDisplayName(hcontact, 0) : (wantempty ? L"" : L"---");
goto LBL_charPtr;
case 'N':
@@ -264,7 +264,7 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact) case 'G':
if (!db_get_ts(hcontact, "CList", "Group", &dbv)) {
- _tcsncpy(szdbsetting, dbv.ptszVal, _countof(szdbsetting));
+ wcsncpy(szdbsetting, dbv.ptszVal, _countof(szdbsetting));
db_free(&dbv);
charPtr = szdbsetting;
goto LBL_charPtr;
@@ -280,7 +280,7 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact) case 's':
if (isetting = db_get_w(hcontact, S_MOD, hcontact ? "StatusTriger" : courProtoName, 0)) {
- _tcsncpy(szdbsetting, pcli->pfnGetStatusModeDescription(isetting | 0x8000, 0), _countof(szdbsetting));
+ wcsncpy(szdbsetting, pcli->pfnGetStatusModeDescription(isetting | 0x8000, 0), _countof(szdbsetting));
if (!(isetting & 0x8000)) {
mir_tstrncat(szdbsetting, L"/", _countof(szdbsetting) - mir_tstrlen(szdbsetting));
mir_tstrncat(szdbsetting, TranslateT("Idle"), _countof(szdbsetting) - mir_tstrlen(szdbsetting));
@@ -300,7 +300,7 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact) case 'o':
if (isetting = db_get_w(hcontact, S_MOD, hcontact ? "OldStatus" : courProtoName, 0)) {
- _tcsncpy(szdbsetting, pcli->pfnGetStatusModeDescription(isetting, 0), _countof(szdbsetting));
+ wcsncpy(szdbsetting, pcli->pfnGetStatusModeDescription(isetting, 0), _countof(szdbsetting));
if (includeIdle && hcontact && db_get_b(hcontact, S_MOD, "OldIdle", 0)) {
mir_tstrncat(szdbsetting, L"/", _countof(szdbsetting) - mir_tstrlen(szdbsetting));
mir_tstrncat(szdbsetting, TranslateT("Idle"), _countof(szdbsetting) - mir_tstrlen(szdbsetting));
@@ -325,13 +325,13 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact) goto LBL_noData;
ia.S_un.S_addr = htonl(dwsetting);
- _tcsncpy(szdbsetting, _A2T(inet_ntoa(ia)), _countof(szdbsetting));
+ wcsncpy(szdbsetting, _A2T(inet_ntoa(ia)), _countof(szdbsetting));
charPtr = szdbsetting;
}
goto LBL_charPtr;
case 'P':
- _tcsncpy(szdbsetting, szProto ? _A2T(szProto) : (wantempty ? L"" : L"ProtoUnknown"), _countof(szdbsetting));
+ wcsncpy(szdbsetting, szProto ? _A2T(szProto) : (wantempty ? L"" : L"ProtoUnknown"), _countof(szdbsetting));
charPtr = szdbsetting;
goto LBL_charPtr;
@@ -356,7 +356,7 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact) if (!pa)
goto LBL_noData;
- _tcsncpy(szdbsetting, pa->tszAccountName, _countof(szdbsetting));
+ wcsncpy(szdbsetting, pa->tszAccountName, _countof(szdbsetting));
charPtr = szdbsetting;
}
goto LBL_charPtr;
@@ -477,16 +477,16 @@ void ShowPopup(MCONTACT hcontact, const char * lpzProto, int newStatus) ppd.lchIcon = Skin_LoadProtoIcon(lpzProto, newStatus);
if (!db_get_ts(NULL, S_MOD, "PopupStamp", &dbv)) {
- _tcsncpy(ppd.lptzContactName, ParseString(dbv.ptszVal, hcontact), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzContactName, ParseString(dbv.ptszVal, hcontact), MAX_CONTACTNAME);
db_free(&dbv);
}
- else _tcsncpy(ppd.lptzContactName, ParseString(DEFAULT_POPUPSTAMP, hcontact), MAX_CONTACTNAME);
+ else wcsncpy(ppd.lptzContactName, ParseString(DEFAULT_POPUPSTAMP, hcontact), MAX_CONTACTNAME);
if (!db_get_ts(NULL, S_MOD, "PopupStampText", &dbv)) {
- _tcsncpy(ppd.lptzText, ParseString(dbv.ptszVal, hcontact), MAX_SECONDLINE);
+ wcsncpy(ppd.lptzText, ParseString(dbv.ptszVal, hcontact), MAX_SECONDLINE);
db_free(&dbv);
}
- else _tcsncpy(ppd.lptzText, ParseString(DEFAULT_POPUPSTAMPTEXT, hcontact), MAX_SECONDLINE);
+ else wcsncpy(ppd.lptzText, ParseString(DEFAULT_POPUPSTAMPTEXT, hcontact), MAX_SECONDLINE);
ppd.PluginWindowProc = PopupDlgProc;
PUAddPopupT(&ppd);
}
@@ -731,24 +731,24 @@ short int isDbZero(MCONTACT hContact, const char *module_name, const char *setti return -1;
}
-TCHAR* any_to_IdleNotidleUnknown(MCONTACT hContact, const char *module_name, const char *setting_name, TCHAR *buff, int bufflen)
+wchar_t* any_to_IdleNotidleUnknown(MCONTACT hContact, const char *module_name, const char *setting_name, wchar_t *buff, int bufflen)
{
short int r = isDbZero(hContact, module_name, setting_name);
if (r == -1) {
- _tcsncpy(buff, TranslateT("Unknown"), bufflen);
+ wcsncpy(buff, TranslateT("Unknown"), bufflen);
}
else {
- _tcsncpy(buff, r ? TranslateT("Not Idle") : TranslateT("Idle"), bufflen);
+ wcsncpy(buff, r ? TranslateT("Not Idle") : TranslateT("Idle"), bufflen);
};
buff[bufflen - 1] = 0;
return buff;
}
-TCHAR* any_to_Idle(MCONTACT hContact, const char *module_name, const char *setting_name, TCHAR *buff, int bufflen)
+wchar_t* any_to_Idle(MCONTACT hContact, const char *module_name, const char *setting_name, wchar_t *buff, int bufflen)
{
if (isDbZero(hContact, module_name, setting_name) == 0) { //DB setting is NOT zero and exists
buff[0] = L'/';
- _tcsncpy(&buff[1], TranslateT("Idle"), bufflen - 1);
+ wcsncpy(&buff[1], TranslateT("Idle"), bufflen - 1);
}
else buff[0] = 0;
buff[bufflen - 1] = 0;
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index eb4b9dcc61..1a9f0de514 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -94,7 +94,7 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, Window_SetIcon_IcoLib(hwndDlg, GetIconHandle(ICO_MAIN)); { CSend* self = (CSend*)lParam; - TCHAR* tmp = mir_tstrdup(TranslateT("Resulting URL from\n")); + wchar_t* tmp = mir_tstrdup(TranslateT("Resulting URL from\n")); mir_tstradd(tmp, self->m_pszSendTyp); SetDlgItemText(hwndDlg, IDC_HEADERBAR, tmp); mir_free(tmp); @@ -124,16 +124,16 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, case ID_btnCopy: case ID_btnThumbCopy: SendDlgItemMessage(hwndDlg, i, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIconBtn(ICO_BTN_COPY)); - SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Copy"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Copy"), BATF_TCHAR); break; case ID_btnBBC: case ID_btnThumbBBC: SendDlgItemMessage(hwndDlg, i, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIconBtn(ICO_BTN_BBC)); - SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Copy BBCode"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Copy BBCode"), BATF_TCHAR); break; default: SendDlgItemMessage(hwndDlg, i, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIconBtn(ICO_BTN_BBCLNK)); - SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Copy BBCode w/ link"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Copy BBCode w/ link"), BATF_TCHAR); } } } @@ -151,7 +151,7 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, case ID_btnBBC: case ID_btnThumbBBC: case ID_btnThumbBBC2: - TCHAR tmp[2048]; + wchar_t tmp[2048]; int edtID = ID_edtURL; int bbc = 0; switch (LOWORD(wParam)) { @@ -166,16 +166,16 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, size_t len; if (bbc) { if (bbc == 1) { - memcpy(tmp, L"[img]", 5 * sizeof(TCHAR)); len = 5; + memcpy(tmp, L"[img]", 5 * sizeof(wchar_t)); len = 5; len += GetDlgItemText(hwndDlg, edtID, tmp + len, 2048 - 11); - memcpy(tmp + len, L"[/img]", 7 * sizeof(TCHAR)); len += 7; + memcpy(tmp + len, L"[/img]", 7 * sizeof(wchar_t)); len += 7; } else { - memcpy(tmp, L"[url=", 5 * sizeof(TCHAR)); len = 5; + memcpy(tmp, L"[url=", 5 * sizeof(wchar_t)); len = 5; len += GetDlgItemText(hwndDlg, ID_edtURL, tmp + len, 1024); - memcpy(tmp + len, L"][img]", 6 * sizeof(TCHAR)); len += 6; + memcpy(tmp + len, L"][img]", 6 * sizeof(wchar_t)); len += 6; len += GetDlgItemText(hwndDlg, edtID, tmp + len, 1024); - memcpy(tmp + len, L"[/img][/url]", 13 * sizeof(TCHAR)); len += 12; + memcpy(tmp + len, L"[/img][/url]", 13 * sizeof(wchar_t)); len += 12; } } else @@ -187,8 +187,8 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, continue; } EmptyClipboard(); - HGLOBAL clipbuffer = GlobalAlloc(GMEM_MOVEABLE, len*sizeof(TCHAR) + sizeof(TCHAR)); - TCHAR* tmp2 = (TCHAR*)GlobalLock(clipbuffer); + HGLOBAL clipbuffer = GlobalAlloc(GMEM_MOVEABLE, len*sizeof(wchar_t) + sizeof(wchar_t)); + wchar_t* tmp2 = (wchar_t*)GlobalLock(clipbuffer); mir_tstrncpy(tmp2, tmp, len + 1); tmp2[len] = '\0'; GlobalUnlock(clipbuffer); SetClipboardData(CF_UNICODETEXT, clipbuffer); @@ -215,7 +215,7 @@ void CSend::svcSendMsgExit(const char* szMessage) Exit(CSEND_DIALOG); return; } if (m_ChatRoom) { - TCHAR* tmp = mir_a2t(szMessage); + wchar_t* tmp = mir_a2t(szMessage); if (m_pszFileDesc) { mir_tstradd(tmp, L"\r\n"); mir_tstradd(tmp, m_pszFileDesc); @@ -282,7 +282,7 @@ void CSend::svcSendFileExit() Exit(ACKRESULT_SUCCESS); return; } if (!m_hContact) { - Error(LPGENT("%s requires a valid contact!"), m_pszSendTyp); + Error(LPGENW("%s requires a valid contact!"), m_pszSendTyp); Exit(ACKRESULT_FAILED); return; } mir_freeAndNil(m_szEventMsg); @@ -307,8 +307,8 @@ void CSend::svcSendFileExit() } // Start miranda PSS_FILE based on mir ver (T) - TCHAR* ppFile[2] = { 0, 0 }; - TCHAR* pDesc = mir_tstrdup(m_pszFileDesc); + wchar_t* ppFile[2] = { 0, 0 }; + wchar_t* pDesc = mir_tstrdup(m_pszFileDesc); ppFile[0] = mir_tstrdup(m_pszFile); ppFile[1] = NULL; m_hSend = (HANDLE)ProtoChainSend(m_hContact, PSS_FILE, (WPARAM)pDesc, (LPARAM)ppFile); @@ -336,13 +336,13 @@ int CSend::OnSend(void *obj, WPARAM, LPARAM lParam) */ switch (ack->result) { - case ACKRESULT_INITIALISING: //SetFtStatus(hwndDlg, LPGENT("Initialising..."), 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_LISTENING: //SetFtStatus(hwndDlg, LPGENT("Waiting for connection..."), FTS_TEXT); break; - case ACKRESULT_CONNECTED: //SetFtStatus(hwndDlg, LPGENT("Connected"), FTS_TEXT); break; - case ACKRESULT_SENTREQUEST: //SetFtStatus(hwndDlg, LPGENT("Decision sent"), FTS_TEXT); break; - case ACKRESULT_NEXTFILE: //SetFtStatus(hwndDlg, LPGENT("Moving to next file..."), FTS_TEXT); + case ACKRESULT_INITIALISING: //SetFtStatus(hwndDlg, LPGENW("Initialising..."), 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_LISTENING: //SetFtStatus(hwndDlg, LPGENW("Waiting for connection..."), FTS_TEXT); break; + case ACKRESULT_CONNECTED: //SetFtStatus(hwndDlg, LPGENW("Connected"), FTS_TEXT); break; + case ACKRESULT_SENTREQUEST: //SetFtStatus(hwndDlg, LPGENW("Decision sent"), FTS_TEXT); break; + case ACKRESULT_NEXTFILE: //SetFtStatus(hwndDlg, LPGENW("Moving to next file..."), FTS_TEXT); case ACKRESULT_FILERESUME: // case ACKRESULT_DATA: //transfer is on progress break; @@ -397,7 +397,7 @@ void CSend::DB_EventAdd(WORD EventType) //--------------------------------------------------------------------------- void CSend::Error(LPCTSTR pszFormat, ...) { - TCHAR tszMsg[MAX_SECONDLINE]; + wchar_t tszMsg[MAX_SECONDLINE]; mir_sntprintf(tszMsg, L"%s - %s", _T(SZ_SENDSS), TranslateT("Error")); mir_free(m_ErrorTitle), m_ErrorTitle = mir_tstrdup(tszMsg); @@ -456,7 +456,7 @@ void CSend::Exit(unsigned int Result) if (err) { SkinPlaySound("FileFailed"); if (m_ErrorMsg) MsgBoxService(NULL, (LPARAM)&m_box); - else MsgErr(NULL, LPGENT("An unknown error has occurred.")); + else MsgErr(NULL, LPGENW("An unknown error has occurred.")); } } if (m_pszFile && *m_pszFile && m_bDeleteAfterSend && m_EnableItem&SS_DLG_DELETEAFTERSSEND) { diff --git a/plugins/SendScreenshotPlus/src/CSend.h b/plugins/SendScreenshotPlus/src/CSend.h index 9ff63828de..293e34f077 100644 --- a/plugins/SendScreenshotPlus/src/CSend.h +++ b/plugins/SendScreenshotPlus/src/CSend.h @@ -42,10 +42,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define GC_RESULT_ERROR 202 #define GC_RESULT_NOSESSION 209 -const TCHAR SS_ERR_INIT[] =LPGENT("Unable to initiate %s."); -const TCHAR SS_ERR_MAPI[] =LPGENT("MAPI error (%i):\n%s."); -const TCHAR SS_ERR_RESPONSE[] =LPGENT("Unknown response from %s (%i)"); -const TCHAR SS_ERR_NORESPONSE[] =LPGENT("Got no response from %s (%i)"); +const wchar_t SS_ERR_INIT[] =LPGENW("Unable to initiate %s."); +const wchar_t SS_ERR_MAPI[] =LPGENW("MAPI error (%i):\n%s."); +const wchar_t SS_ERR_RESPONSE[] =LPGENW("Unknown response from %s (%i)"); +const wchar_t SS_ERR_NORESPONSE[] =LPGENW("Got no response from %s (%i)"); //--------------------------------------------------------------------------- class CSend { @@ -56,25 +56,25 @@ class CSend { virtual int Send() = NULL; // returns 1 if sent (you must delete class) and 0 when still sending (class deletes itself) int SendSilent() {m_bAsync=m_bSilent=true; return Send();}; - void SetFile(TCHAR* file){mir_free(m_pszFile), m_pszFile=mir_tstrdup(file);}; + void SetFile(wchar_t* file){mir_free(m_pszFile), m_pszFile=mir_tstrdup(file);}; void SetFile(char* file){mir_free(m_pszFile), m_pszFile=mir_a2t(file);}; - void SetDescription(TCHAR* descr){mir_free(m_pszFileDesc), m_pszFileDesc=mir_tstrdup(descr);}; + void SetDescription(wchar_t* descr){mir_free(m_pszFileDesc), m_pszFileDesc=mir_tstrdup(descr);}; void SetContact(MCONTACT hContact); char* GetURL(){return m_URL;}; char* GetURLthumbnail(){return m_URLthumb;}; BYTE GetEnableItem() {return m_EnableItem;}; - TCHAR* GetErrorMsg() {return m_ErrorMsg;}; + wchar_t* GetErrorMsg() {return m_ErrorMsg;}; bool m_bDeleteAfterSend; protected: bool m_bAsync; bool m_bSilent; - TCHAR* m_pszFile; - TCHAR* m_pszFileDesc; + wchar_t* m_pszFile; + wchar_t* m_pszFileDesc; char* m_URL; char* m_URLthumb; static int OnSend(void *obj, WPARAM wParam, LPARAM lParam); - TCHAR* m_pszSendTyp; //hold string for error mess + wchar_t* m_pszSendTyp; //hold string for error mess char* m_pszProto; //Contact Proto Modul MCONTACT m_hContact; //Contact handle BYTE m_EnableItem; //hold flag for send type @@ -94,8 +94,8 @@ class CSend { HANDLE m_hOnSend; //HookEventObj on ME_PROTO_ACK MSGBOX m_box; - TCHAR* m_ErrorMsg; - TCHAR* m_ErrorTitle; + wchar_t* m_ErrorMsg; + wchar_t* m_ErrorTitle; void Unhook(){if(m_hOnSend) {UnhookEvent(m_hOnSend);m_hOnSend = NULL;}} void DB_EventAdd(WORD EventType); diff --git a/plugins/SendScreenshotPlus/src/CSendDropbox.cpp b/plugins/SendScreenshotPlus/src/CSendDropbox.cpp index 62203d6ccd..47b7f778e6 100644 --- a/plugins/SendScreenshotPlus/src/CSendDropbox.cpp +++ b/plugins/SendScreenshotPlus/src/CSendDropbox.cpp @@ -60,7 +60,7 @@ void CSendDropbox::SendThread() if (CallService(MS_DROPBOX_UPLOAD, (WPARAM)&m_URL, (LPARAM)&ui)) { - Error(LPGENT("%s (%i):\nCould not add a share to the Dropbox plugin."), TranslateTS(m_pszSendTyp), 0); + Error(LPGENW("%s (%i):\nCould not add a share to the Dropbox plugin."), TranslateTS(m_pszSendTyp), 0); Exit(ACKRESULT_FAILED); return; } diff --git a/plugins/SendScreenshotPlus/src/CSendEmail.cpp b/plugins/SendScreenshotPlus/src/CSendEmail.cpp index 99fa9304ea..dc91c4a867 100644 --- a/plugins/SendScreenshotPlus/src/CSendEmail.cpp +++ b/plugins/SendScreenshotPlus/src/CSendEmail.cpp @@ -35,7 +35,7 @@ CSendEmail::CSendEmail(HWND Owner, MCONTACT hContact, bool /*bAsync*/) : CSend(Owner, hContact, true) { m_EnableItem = SS_DLG_DESCRIPTION | SS_DLG_DELETEAFTERSSEND; // SS_DLG_AUTOSEND | ; - m_pszSendTyp = LPGENT("Email transfer"); + m_pszSendTyp = LPGENW("Email transfer"); m_pszFileA = NULL; m_pszFileName = NULL; m_Email = NULL; @@ -136,53 +136,53 @@ void CSendEmail::SendThread() int res = lpMAPISendMail(NULL, NULL, &Msg, MAPI_LOGON_UI | MAPI_DIALOG, 0); ::FreeLibrary(hMAPILib); - TCHAR* err; + wchar_t* err; switch (res) { case SUCCESS_SUCCESS: //The call succeeded and the message was sent. Exit(ACKRESULT_SUCCESS); return; // No message was sent case MAPI_E_AMBIGUOUS_RECIPIENT: - err = LPGENT("A recipient matched more than one of the recipient descriptor structures and MAPI_DIALOG was not set"); + err = LPGENW("A recipient matched more than one of the recipient descriptor structures and MAPI_DIALOG was not set"); break; case MAPI_E_ATTACHMENT_NOT_FOUND: - err = LPGENT("The specified attachment was not found"); + err = LPGENW("The specified attachment was not found"); break; case MAPI_E_ATTACHMENT_OPEN_FAILURE: - err = LPGENT("The specified attachment could not be opened"); + err = LPGENW("The specified attachment could not be opened"); break; case MAPI_E_BAD_RECIPTYPE: - err = LPGENT("The type of a recipient was not MAPI_TO, MAPI_CC, or MAPI_BCC"); + err = LPGENW("The type of a recipient was not MAPI_TO, MAPI_CC, or MAPI_BCC"); break; case MAPI_E_FAILURE: - err = LPGENT("One or more unspecified errors occurred"); + err = LPGENW("One or more unspecified errors occurred"); break; case MAPI_E_INSUFFICIENT_MEMORY: - err = LPGENT("There was insufficient memory to proceed"); + err = LPGENW("There was insufficient memory to proceed"); break; case MAPI_E_INVALID_RECIPS: - err = LPGENT("One or more recipients were invalid or did not resolve to any address"); + err = LPGENW("One or more recipients were invalid or did not resolve to any address"); break; case MAPI_E_LOGIN_FAILURE: - err = LPGENT("There was no default logon, and the user failed to log on successfully when the logon dialog box was displayed"); + err = LPGENW("There was no default logon, and the user failed to log on successfully when the logon dialog box was displayed"); break; case MAPI_E_TEXT_TOO_LARGE: - err = LPGENT("The text in the message was too large"); + err = LPGENW("The text in the message was too large"); break; case MAPI_E_TOO_MANY_FILES: - err = LPGENT("There were too many file attachments"); + err = LPGENW("There were too many file attachments"); break; case MAPI_E_TOO_MANY_RECIPIENTS: - err = LPGENT("There were too many recipients"); + err = LPGENW("There were too many recipients"); break; case MAPI_E_UNKNOWN_RECIPIENT: - err = LPGENT("A recipient did not appear in the address list"); + err = LPGENW("A recipient did not appear in the address list"); break; case MAPI_E_USER_ABORT: - err = LPGENT("The user canceled one of the dialog boxes"); + err = LPGENW("The user canceled one of the dialog boxes"); break; default: - err = LPGENT("Unknown Error"); + err = LPGENW("Unknown Error"); break; } Error(SS_ERR_MAPI, res, err); diff --git a/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp b/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp index a6cd2dcc29..3267ecdd14 100644 --- a/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp +++ b/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp @@ -35,7 +35,7 @@ CSendFTPFile::CSendFTPFile(HWND Owner, MCONTACT hContact, bool /*bAsync*/) : CSend(Owner, hContact, true) { m_EnableItem = 0; //SS_DLG_DESCRIPTION | SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND; - m_pszSendTyp = LPGENT("FTPFile transfer"); + m_pszSendTyp = LPGENW("FTPFile transfer"); m_pszFileName = NULL; } @@ -74,7 +74,7 @@ void CSendFTPFile::SendThread() INT_PTR ret = FTPFileUploadA(m_hContact, FNUM_DEFAULT, FMODE_RAWFILE, &m_pszFileName, 1); if (ret != 0) { - Error(LPGENT("%s (%i):\nCould not add a share to the FTP File plugin."), TranslateTS(m_pszSendTyp), ret); + Error(LPGENW("%s (%i):\nCould not add a share to the FTP File plugin."), TranslateTS(m_pszSendTyp), ret); Exit(ret); return; } diff --git a/plugins/SendScreenshotPlus/src/CSendFile.cpp b/plugins/SendScreenshotPlus/src/CSendFile.cpp index 4c6ce014ee..d94aa4c5cf 100644 --- a/plugins/SendScreenshotPlus/src/CSendFile.cpp +++ b/plugins/SendScreenshotPlus/src/CSendFile.cpp @@ -34,7 +34,7 @@ CSendFile::CSendFile(HWND Owner, MCONTACT hContact, bool /*bAsync*/) : CSend(Owner, hContact, true) { m_EnableItem = SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND | SS_DLG_DESCRIPTION; - m_pszSendTyp = LPGENT("File transfer"); + m_pszSendTyp = LPGENW("File transfer"); } CSendFile::~CSendFile() diff --git a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp index cea7ece543..636b49d1b3 100644 --- a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp @@ -38,7 +38,7 @@ CSendHTTPServer::CSendHTTPServer(HWND Owner, MCONTACT hContact, bool /*bAsync*/) : CSend(Owner, hContact, true) { m_EnableItem = SS_DLG_DESCRIPTION; //| SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND; - m_pszSendTyp = LPGENT("HTTPServer transfer"); + m_pszSendTyp = LPGENW("HTTPServer transfer"); m_pszFileName = NULL; m_fsi_pszSrvPath = NULL; m_fsi_pszRealPath = NULL; @@ -56,7 +56,7 @@ int CSendHTTPServer::Send() { if (!m_hContact) return 1; if (CallService(MS_HTTP_ACCEPT_CONNECTIONS, TRUE, 0) != 0) { - Error(LPGENT("Could not start the HTTP Server plugin.")); + Error(LPGENW("Could not start the HTTP Server plugin.")); Exit(ACKRESULT_FAILED); return !m_bAsync; } @@ -102,7 +102,7 @@ void CSendHTTPServer::SendThread() } if (ret != 0) { - Error(LPGENT("%s (%i):\nCould not add a share to the HTTP Server plugin."), TranslateTS(m_pszSendTyp), ret); + Error(LPGENW("%s (%i):\nCould not add a share to the HTTP Server plugin."), TranslateTS(m_pszSendTyp), ret); Exit(ret); return; } diff --git a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp index cb5abc8e20..870ae89f82 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp @@ -34,7 +34,7 @@ CSendHost_ImageShack::CSendHost_ImageShack(HWND Owner, MCONTACT hContact, bool b : CSend(Owner, hContact, bAsync) { m_EnableItem = SS_DLG_DESCRIPTION | SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND; - m_pszSendTyp = LPGENT("Image upload"); + m_pszSendTyp = LPGENW("Image upload"); } CSendHost_ImageShack::~CSendHost_ImageShack() @@ -100,7 +100,7 @@ void CSendHost_ImageShack::SendThread() } else {/// check error mess from server url = GetHTMLContent(reply->pData, "<error ", "</error>"); - TCHAR* err = NULL; + wchar_t* err = NULL; if (url) err = mir_a2t(url); if (!err || !*err) {/// fallback to server response mess mir_free(err); diff --git a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp index d3fe40ce74..a6eb7c6e57 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp @@ -19,7 +19,7 @@ CSendHost_Imgur::CSendHost_Imgur(HWND Owner, MCONTACT hContact, bool bAsync) : CSend(Owner, hContact, bAsync) { m_EnableItem = SS_DLG_DESCRIPTION | SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND; - m_pszSendTyp = LPGENT("Image upload"); + m_pszSendTyp = LPGENW("Image upload"); } CSendHost_Imgur::~CSendHost_Imgur() diff --git a/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp b/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp index 6d210953b0..68232006ce 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp @@ -19,7 +19,7 @@ CSendHost_UploadPie::CSendHost_UploadPie(HWND Owner, MCONTACT hContact, bool bAs : m_expire(expire), CSend(Owner, hContact, bAsync) { m_EnableItem = SS_DLG_DESCRIPTION | SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND; - m_pszSendTyp = LPGENT("Image upload"); + m_pszSendTyp = LPGENW("Image upload"); } CSendHost_UploadPie::~CSendHost_UploadPie() @@ -92,7 +92,7 @@ void CSendHost_UploadPie::SendThread(void* obj) } else {/// check error mess from server const char* err = GetHTMLContent(reply->pData, "<p id=\"error\"", "</p>"); - TCHAR* werr; + wchar_t* werr; if (err) werr = mir_a2t(err); else werr = mir_a2t(reply->pData); self->Error(L"%s", werr); diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp index fa4d8277e4..c2db7bff90 100644 --- a/plugins/SendScreenshotPlus/src/Main.cpp +++ b/plugins/SendScreenshotPlus/src/Main.cpp @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "Main.h" // Prototypes /////////////////////////////////////////////////////////////////////////// -CLIST_INTERFACE *pcli;
+CLIST_INTERFACE *pcli; HINSTANCE g_hSendSS; MGLOBAL g_myGlobals; HANDLE g_hNetlibUser=0;//!< Netlib Register User @@ -68,11 +68,11 @@ IconItem ICONS_BTN[ICO_BTN_END_] = }; static HANDLE m_hFolderScreenshot = 0; -TCHAR* GetCustomPath() +wchar_t* GetCustomPath() { - TCHAR* pszPath = Utils_ReplaceVarsT(L"%miranda_userdata%\\Screenshots"); + wchar_t* pszPath = Utils_ReplaceVarsT(L"%miranda_userdata%\\Screenshots"); if (m_hFolderScreenshot) { - TCHAR szPath[1024] = { 0 }; + wchar_t szPath[1024] = { 0 }; FoldersGetCustomPathT(m_hFolderScreenshot, szPath, 1024, pszPath); mir_free(pszPath); pszPath = mir_tstrdup(szPath); @@ -83,7 +83,7 @@ TCHAR* GetCustomPath() } int result = CreateDirectoryTreeT(pszPath); if (result) { - TCHAR szError[MAX_PATH]; + wchar_t szError[MAX_PATH]; mir_sntprintf(szError, MAX_PATH, TranslateT("Could not create screenshot folder (error code: %d):\n%s\nDo you have write permissions?"), result, pszPath); MessageBox(NULL, szError, L"SendSS", MB_OK | MB_ICONERROR | MB_APPLMODAL); mir_free(pszPath); @@ -107,7 +107,7 @@ INT_PTR service_OpenCaptureDialog(WPARAM wParam, LPARAM lParam) MessageBox(NULL, TranslateT("Could not create main dialog."), TranslateT("Error"), MB_OK | MB_ICONERROR | MB_APPLMODAL); return -1; } - TCHAR* pszPath = GetCustomPath(); + wchar_t* pszPath = GetCustomPath(); if (!pszPath) { delete frmMain; return -1; @@ -135,7 +135,7 @@ INT_PTR service_SendDesktop(WPARAM wParam, LPARAM) MessageBox(NULL, TranslateT("Could not create main dialog."), TranslateT("Error"), MB_OK | MB_ICONERROR | MB_APPLMODAL); return -1; } - TCHAR* pszPath = GetCustomPath(); + wchar_t* pszPath = GetCustomPath(); if (!pszPath) { delete frmMain; return -1; @@ -289,19 +289,19 @@ DLL_EXPORT int Load(void) mi.hIcolibItem = GetIconHandle(ICO_MAINXS); SET_UID(mi, 0xa559a22e, 0xd0f9, 0x4553, 0x8e, 0x68, 0x55, 0xb3, 0xae, 0xc4, 0x5d, 0x93); - mi.name.t = LPGENT("Take a screenshot"); + mi.name.w = LPGENW("Take a screenshot"); mi.pszService = MS_SENDSS_OPENDIALOG; mi.position = 1000001; Menu_AddMainMenuItem(&mi); SET_UID(mi, 0xfea0a84, 0x1767, 0x4605, 0x99, 0xf0, 0xa9, 0x48, 0x1a, 0xa6, 0x6f, 0xce); - mi.name.t = LPGENT("Send screenshot"); + mi.name.w = LPGENW("Send screenshot"); mi.pszService = MS_SENDSS_OPENDIALOG; mi.position = 1000000; Menu_AddContactMenuItem(&mi); SET_UID(mi, 0x8d5b0d9a, 0x68d4, 0x4594, 0x9f, 0x41, 0x0, 0x64, 0x20, 0xe7, 0xf8, 0x9f); - mi.name.t = LPGENT("Send desktop screenshot"); + mi.name.w = LPGENW("Send desktop screenshot"); mi.pszService = MS_SENDSS_SENDDESKTOP; mi.position = 1000001; Menu_AddContactMenuItem(&mi); @@ -309,7 +309,7 @@ DLL_EXPORT int Load(void) /// hotkey's HOTKEYDESC hkd = { sizeof(hkd) }; hkd.pszName = "Open SendSS+"; - hkd.ptszDescription = LPGENT("Open SendSS+"); + hkd.ptszDescription = LPGENW("Open SendSS+"); hkd.ptszSection = L"SendSS+"; hkd.pszService = MS_SENDSS_OPENDIALOG; //hkd.DefHotKey=HOTKEYCODE(HOTKEYF_CONTROL, VK_F10) | HKF_MIRANDA_LOCAL; @@ -329,6 +329,6 @@ DLL_EXPORT int Load(void) DLL_EXPORT int Unload(void) { if (g_clsTargetHighlighter) - UnregisterClass((TCHAR*)g_clsTargetHighlighter, g_hSendSS), g_clsTargetHighlighter = 0; + UnregisterClass((wchar_t*)g_clsTargetHighlighter, g_hSendSS), g_clsTargetHighlighter = 0; return 0; } diff --git a/plugins/SendScreenshotPlus/src/UAboutForm.cpp b/plugins/SendScreenshotPlus/src/UAboutForm.cpp index 6d7e0a57a6..7a468f99c4 100644 --- a/plugins/SendScreenshotPlus/src/UAboutForm.cpp +++ b/plugins/SendScreenshotPlus/src/UAboutForm.cpp @@ -93,7 +93,7 @@ LRESULT TfrmAbout::wmInitdialog(WPARAM, LPARAM) //License { - TCHAR* pszText = NULL; + wchar_t* pszText = NULL; mir_tstradd(pszText, _T(__COPYRIGHT)); mir_tstradd(pszText, L"\r\n\r\n"); @@ -102,7 +102,7 @@ LRESULT TfrmAbout::wmInitdialog(WPARAM, LPARAM) char* data = (char*)mir_alloc(size + 1); memcpy(data, LockResource(LoadResource(g_hSendSS, hRes)), size); data[size] = '\0'; - TCHAR* pszCopyright = mir_a2t(data); + wchar_t* pszCopyright = mir_a2t(data); mir_free(data); mir_tstradd(pszText, pszCopyright); mir_free(pszCopyright); @@ -117,7 +117,7 @@ LRESULT TfrmAbout::wmInitdialog(WPARAM, LPARAM) char* data = (char*)mir_alloc(size + 1); memcpy(data, LockResource(LoadResource(g_hSendSS, hRes)), size); data[size] = '\0'; - TCHAR* pszText = mir_a2t(data); + wchar_t* pszText = mir_a2t(data); mir_free(data); SetDlgItemText(m_hWnd, IDC_CREDIT, pszText); mir_free(pszText); @@ -183,10 +183,10 @@ TfrmAbout::~TfrmAbout() void TfrmAbout::btnPageClick() { HWND hCtrl = GetDlgItem(m_hWnd, IDA_CONTRIBLINK); - const TCHAR* credits = TranslateT("Credits"); - const TCHAR* copyright = TranslateT("Copyright"); - const TCHAR* title; - const TCHAR* button; + const wchar_t* credits = TranslateT("Credits"); + const wchar_t* copyright = TranslateT("Copyright"); + const wchar_t* title; + const wchar_t* button; if (!m_Page) { ShowWindow(GetDlgItem(m_hWnd, IDC_CREDIT), SW_HIDE); ShowWindow(GetDlgItem(m_hWnd, IDC_LICENSE), SW_SHOW); @@ -202,9 +202,9 @@ void TfrmAbout::btnPageClick() button = copyright; } SetWindowText(hCtrl, button); - TCHAR newTitle[128]; - TCHAR* pszPlug = mir_a2t(__PLUGIN_NAME); - TCHAR* pszVer = mir_a2t(__VERSION_STRING_DOTS); + wchar_t newTitle[128]; + wchar_t* pszPlug = mir_a2t(__PLUGIN_NAME); + wchar_t* pszVer = mir_a2t(__VERSION_STRING_DOTS); mir_sntprintf(newTitle, L"%s - %s\nv%s", pszPlug, title, pszVer); mir_free(pszPlug); mir_free(pszVer); diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index 92e894894c..bf8edb1658 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -71,7 +71,7 @@ INT_PTR CALLBACK TfrmMain::DlgProc_CaptureTabPage(HWND hDlg, UINT uMsg, WPARAM w case WM_COMMAND: if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == ID_btnExplore) { /// local file tab OPENFILENAME ofn = { sizeof(OPENFILENAME) }; - TCHAR filename[MAX_PATH]; + wchar_t filename[MAX_PATH]; GetDlgItemText(hDlg, ID_edtSize, filename, _countof(filename)); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = hDlg; @@ -129,7 +129,7 @@ INT_PTR CALLBACK TfrmMain::DlgTfrmMain(HWND hWnd, UINT msg, WPARAM wParam, LPARA switch (msg) { case WM_DROPFILES:{ /// Drag&Drop of local files - TCHAR filename[MAX_PATH]; + wchar_t filename[MAX_PATH]; if (!DragQueryFile((HDROP)wParam, 0, filename, MAX_PATH)) *filename = '\0'; DragFinish((HDROP)wParam); if (wnd->second->m_hwndTabPage) @@ -175,7 +175,7 @@ void TfrmMain::wmInitdialog(WPARAM, LPARAM) /// Taskbar and Window icon Window_SetIcon_IcoLib(m_hWnd, GetIconHandle(ICO_MAIN)); - TCHAR *pt = mir_tstrdup(pcli->pfnGetContactDisplayName(m_hContact, 0)); + wchar_t *pt = mir_tstrdup(pcli->pfnGetContactDisplayName(m_hContact, 0)); if (pt && (m_hContact != 0)) { CMString string; string.AppendFormat(TranslateT("Send screenshot to %s"), pt); @@ -238,7 +238,7 @@ void TfrmMain::wmInitdialog(WPARAM, LPARAM) ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("<Entire Desktop>")), 0); ComboBox_SetCurSel(hCtrl, 0); if (m_MonitorCount > 1) { - TCHAR tszTemp[120]; + wchar_t tszTemp[120]; for (size_t mon = 0; mon < m_MonitorCount; ++mon) { /// @todo : fix format for non MSVC compilers mir_sntprintf(tszTemp, L"%Iu. %s%s", mon + 1, TranslateT("Monitor"), @@ -496,13 +496,13 @@ void TfrmMain::SetTargetWindow(HWND hwnd) } m_hTargetWindow = hwnd; int len = GetWindowTextLength(m_hTargetWindow) + 1; - TCHAR* lpTitle; + wchar_t* lpTitle; if (len > 1) { - lpTitle = (TCHAR*)mir_alloc(len*sizeof(TCHAR)); + lpTitle = (wchar_t*)mir_alloc(len*sizeof(wchar_t)); GetWindowText(m_hTargetWindow, lpTitle, len); } else {//no WindowText present, use WindowClass - lpTitle = (TCHAR*)mir_alloc(64 * sizeof(TCHAR)); + lpTitle = (wchar_t*)mir_alloc(64 * sizeof(wchar_t)); RealGetWindowClass(m_hTargetWindow, lpTitle, 64); } SetDlgItemText(m_hwndTabPage, ID_edtCaption, lpTitle); @@ -516,7 +516,7 @@ void TfrmMain::wmTimer(WPARAM wParam, LPARAM) static int primarymouse; if (!m_hTargetHighlighter) { primarymouse = GetSystemMetrics(SM_SWAPBUTTON) ? VK_RBUTTON : VK_LBUTTON; - m_hTargetHighlighter = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW, (TCHAR*)g_clsTargetHighlighter, NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, g_hSendSS, NULL); + m_hTargetHighlighter = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW, (wchar_t*)g_clsTargetHighlighter, NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, g_hSendSS, NULL); if (!m_hTargetHighlighter) return; SetLayeredWindowAttributes(m_hTargetHighlighter, 0, 123, LWA_ALPHA); SetSystemCursor(CopyCursor(GetIcon(ICO_TARGET)), OCR_IBEAM);//text cursor @@ -658,7 +658,7 @@ void TfrmMain::UMevent(WPARAM, LPARAM lParam) switch (lParam) { case EVT_CaptureDone: if (!m_Screenshot && m_opt_tabCapture != 2) { - TCHAR *err = TranslateT("Couldn't take a screenshot"); + wchar_t *err = TranslateT("Couldn't take a screenshot"); MessageBox(NULL, err, ERROR_TITLE, MB_OK | MB_ICONWARNING); Show(); return; @@ -781,7 +781,7 @@ void TfrmMain::SaveOptions(void) } //--------------------------------------------------------------------------- -void TfrmMain::Init(TCHAR* DestFolder, MCONTACT Contact) +void TfrmMain::Init(wchar_t* DestFolder, MCONTACT Contact) { m_FDestFolder = mir_tstrdup(DestFolder); m_hContact = Contact; @@ -801,11 +801,11 @@ void TfrmMain::btnCaptureClick() { if (m_opt_tabCapture == 1) m_hTargetWindow = GetDesktopWindow(); else if (m_opt_tabCapture == 2) { - TCHAR filename[MAX_PATH]; + wchar_t filename[MAX_PATH]; GetDlgItemText(m_hwndTabPage, ID_edtSize, filename, _countof(filename)); FILE* fp = _wfopen(filename, L"rb"); if (!fp) { - TCHAR *err = TranslateT("Select a file"); + wchar_t *err = TranslateT("Select a file"); MessageBox(m_hWnd, err, ERROR_TITLE, MB_OK | MB_ICONWARNING); return; } @@ -813,7 +813,7 @@ void TfrmMain::btnCaptureClick() mir_free(m_pszFile); m_pszFile = mir_tstrdup(filename); } else if (!m_hTargetWindow) { - TCHAR *err = TranslateT("Select a target window."); + wchar_t *err = TranslateT("Select a target window."); MessageBox(m_hWnd, err, ERROR_TITLE, MB_OK | MB_ICONWARNING); return; } @@ -928,7 +928,7 @@ void TfrmMain::edtSizeUpdate(HWND hWnd, BOOL ClientArea, HWND hTarget, UINT Ctrl // get window dimensions RECT rect = { 0 }; RECT cliRect = { 0 }; - TCHAR B[33], H[16]; + wchar_t B[33], H[16]; GetWindowRect(hWnd, &rect); if (ClientArea) { POINT pt = { 0 }; @@ -941,9 +941,9 @@ void TfrmMain::edtSizeUpdate(HWND hWnd, BOOL ClientArea, HWND hTarget, UINT Ctrl rect = cliRect; } // _itot_s(rect.right - rect.left, B, 33, 10); - _itot(rect.right - rect.left, B, 10); + _itow(rect.right - rect.left, B, 10); // _itot_s(rect.bottom - rect.top, H, 16, 10); - _itot(rect.bottom - rect.top, H, 10); + _itow(rect.bottom - rect.top, H, 10); mir_tstrncat(B, L"x", _countof(B) - mir_tstrlen(B)); mir_tstrncat(B, H, _countof(B) - mir_tstrlen(B)); SetDlgItemText(hTarget, Ctrl, B); @@ -951,11 +951,11 @@ void TfrmMain::edtSizeUpdate(HWND hWnd, BOOL ClientArea, HWND hTarget, UINT Ctrl void TfrmMain::edtSizeUpdate(RECT rect, HWND hTarget, UINT Ctrl) { - TCHAR B[33], H[16]; + wchar_t B[33], H[16]; // _itot_s(ABS(rect.right - rect.left), B, 33, 10); - _itot(ABS(rect.right - rect.left), B, 10); + _itow(ABS(rect.right - rect.left), B, 10); // _itot_s(ABS(rect.bottom - rect.top), H, 16, 10); - _itot(ABS(rect.bottom - rect.top), H, 10); + _itow(ABS(rect.bottom - rect.top), H, 10); mir_tstrncat(B, L"x", _countof(B) - mir_tstrlen(B)); mir_tstrncat(B, H, _countof(B) - mir_tstrlen(B)); SetDlgItemText(hTarget, Ctrl, B); @@ -966,25 +966,25 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) { //generate File name FREE_IMAGE_FORMAT fif = FIF_UNKNOWN; - TCHAR* ret; - TCHAR* path = NULL; - TCHAR* pszFilename = NULL; - TCHAR* pszFileDesc = NULL; + wchar_t* ret; + wchar_t* path = NULL; + wchar_t* pszFilename = NULL; + wchar_t* pszFileDesc = NULL; if (!dib) return 1; //error unsigned FileNumber = db_get_dw(NULL, SZ_SENDSS, "FileNumber", 0) + 1; if (FileNumber > 99999) FileNumber = 1; //Generate FileName mir_tstradd(path, m_FDestFolder); - if (path[mir_tstrlen(path) - 1] != _T('\\')) mir_tstradd(path, L"\\"); + if (path[mir_tstrlen(path) - 1] != '\\') mir_tstradd(path, L"\\"); mir_tstradd(path, L"shot%.5u");//on format change, adapt "len" below size_t len = mir_tstrlen(path) + 2; - pszFilename = (TCHAR*)mir_alloc(sizeof(TCHAR)*(len)); + pszFilename = (wchar_t*)mir_alloc(sizeof(wchar_t)*(len)); mir_sntprintf(pszFilename, len, path, FileNumber); mir_free(path); //Generate a description according to the screenshot - TCHAR winText[1024]; + wchar_t winText[1024]; GetDlgItemText(m_hwndTabPage, ID_edtCaption, winText, _countof(winText)); @@ -1064,7 +1064,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) case 3: //TIFF (miranda freeimage interface do not support save tiff, we udse GDI+) { - TCHAR* pszFile = NULL; + wchar_t* pszFile = NULL; mir_tstradd(pszFile, pszFilename); mir_tstradd(pszFile, L".tif"); @@ -1085,7 +1085,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) //dib24 = FIP->FI_ConvertTo8Bits(dib_new); //ret = SaveImage(FIF_GIF,dib24, pszFilename, L"gif"); //FIP->FI_Unload(dib24); - TCHAR* pszFile = NULL; + wchar_t* pszFile = NULL; mir_tstradd(pszFile, pszFilename); mir_tstradd(pszFile, L".gif"); HBITMAP hBmp = FIP->FI_CreateHBITMAPFromDIB(dib_new); @@ -1100,8 +1100,8 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) } /* //load PNG and save file in user format (if differ) //this get better result for transparent aereas - //TCHAR* pszFormat = (TCHAR*)ComboBox_GetItemData(hwndCombo, ComboBox_GetCurSel(hwndCombo)); - TCHAR pszFormat[6]; + //wchar_t* pszFormat = (wchar_t*)ComboBox_GetItemData(hwndCombo, ComboBox_GetCurSel(hwndCombo)); + wchar_t pszFormat[6]; ComboBox_GetText(hwndCombo, pszFormat, 6); if(ret && (mir_tstrcmpi (pszFormat,L"png") != 0)) { @@ -1148,7 +1148,7 @@ void TfrmMain::FormClose() { bool bCanDelete = m_opt_btnDeleteAfterSend; if (m_opt_tabCapture == 2) { /// existing file - TCHAR description[1024]; + wchar_t description[1024]; GetDlgItemText(m_hwndTabPage, ID_edtCaption, description, _countof(description)); if (!IsWindowEnabled(GetDlgItem(m_hWnd, ID_chkDesc)) || !m_opt_btnDesc) *description = '\0'; diff --git a/plugins/SendScreenshotPlus/src/UMainForm.h b/plugins/SendScreenshotPlus/src/UMainForm.h index 2a715a52f2..f0595bbce1 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.h +++ b/plugins/SendScreenshotPlus/src/UMainForm.h @@ -74,7 +74,7 @@ class TfrmMain{ bool m_bOnExitSave; static void Unload(); - void Init(TCHAR* DestFolder, MCONTACT Contact); + void Init(wchar_t* DestFolder, MCONTACT Contact); void Close(){SendMessage(m_hWnd,WM_CLOSE,0,0);} void Show(){ShowWindow(m_hWnd,SW_SHOW);} void Hide(){ShowWindow(m_hWnd,SW_HIDE);} @@ -88,9 +88,9 @@ class TfrmMain{ bool m_bFormAbout; HWND m_hTargetWindow, m_hLastWin; HWND m_hTargetHighlighter; - TCHAR* m_FDestFolder; - TCHAR* m_pszFile; - TCHAR* m_pszFileDesc; + wchar_t* m_FDestFolder; + wchar_t* m_pszFile; + wchar_t* m_pszFileDesc; FIBITMAP* m_Screenshot;//Graphics::TBitmap *Screenshot; RGBQUAD m_AlphaColor; CSend* m_cSend; diff --git a/plugins/SendScreenshotPlus/src/Utils.cpp b/plugins/SendScreenshotPlus/src/Utils.cpp index d36a4a9cc6..260631038f 100644 --- a/plugins/SendScreenshotPlus/src/Utils.cpp +++ b/plugins/SendScreenshotPlus/src/Utils.cpp @@ -142,7 +142,7 @@ FIBITMAP* CaptureWindow(HWND hCapture, BOOL bClientArea, BOOL bIndirectCapture) return dib; } -FIBITMAP* CaptureMonitor(const TCHAR* szDevice, const RECT* cropRect/*=NULL*/) +FIBITMAP* CaptureMonitor(const wchar_t* szDevice, const RECT* cropRect/*=NULL*/) { HDC hScrDC; RECT rect; @@ -308,11 +308,11 @@ FIBITMAP* CreateDIBFromDC(HDC hDC, const RECT* rect, HWND hCapture/*=NULL*/) return dib; } -TCHAR* SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const TCHAR* pszFilename, const TCHAR* pszExt, int flag) +wchar_t* SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const wchar_t* pszFilename, const wchar_t* pszExt, int flag) { int ret = 0; - TCHAR* pszFile = NULL; - TCHAR* FileExt = GetFileExt(pszFilename); + wchar_t* pszFile = NULL; + wchar_t* FileExt = GetFileExt(pszFilename); if (!FileExt) { if (!pszExt) return NULL; mir_tstradd(pszFile, pszFilename); @@ -338,35 +338,35 @@ TCHAR* SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const TCHAR* pszFilename, } //--------------------------------------------------------------------------- -TCHAR* GetFileNameW(const TCHAR* pszPath) +wchar_t* GetFileNameW(const wchar_t* pszPath) { - const TCHAR* slash = _tcsrchr(pszPath, _T('\\')); - if (!slash) slash = _tcsrchr(pszPath, _T('/')); + const wchar_t* slash = wcsrchr(pszPath, '\\'); + if (!slash) slash = wcsrchr(pszPath, '/'); if (slash) return mir_t2u(slash + 1); else return mir_t2u(pszPath); } -TCHAR* GetFileExtW(const TCHAR* pszPath) +wchar_t* GetFileExtW(const wchar_t* pszPath) { - const TCHAR* slash = _tcsrchr(pszPath, _T('.')); + const wchar_t* slash = wcsrchr(pszPath, '.'); if (slash) return mir_t2u(slash); return NULL; } -char* GetFileNameA(const TCHAR* pszPath) +char* GetFileNameA(const wchar_t* pszPath) { - const TCHAR* slash = _tcsrchr(pszPath, _T('\\')); - if (!slash) slash = _tcsrchr(pszPath, _T('/')); + const wchar_t* slash = wcsrchr(pszPath, '\\'); + if (!slash) slash = wcsrchr(pszPath, '/'); if (slash) return mir_t2a(slash + 1); else return mir_t2a(pszPath); } -char* GetFileExtA(const TCHAR* pszPath) +char* GetFileExtA(const wchar_t* pszPath) { - const TCHAR* slash = _tcsrchr(pszPath, _T('.')); + const wchar_t* slash = wcsrchr(pszPath, '.'); if (slash) return mir_t2a(slash); return NULL; @@ -395,7 +395,7 @@ BOOL GetEncoderClsid(wchar_t *wchMimeType, CLSID& clsidEncoder) return bOk; } -void SaveGIF(HBITMAP hBmp, TCHAR* szFilename) +void SaveGIF(HBITMAP hBmp, wchar_t* szFilename) { Gdiplus::GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken; @@ -415,7 +415,7 @@ void SaveGIF(HBITMAP hBmp, TCHAR* szFilename) Gdiplus::GdiplusShutdown(gdiplusToken); } -void SaveTIF(HBITMAP hBmp, TCHAR* szFilename) +void SaveTIF(HBITMAP hBmp, wchar_t* szFilename) { //http://www.codeproject.com/Messages/1406708/How-to-reduce-the-size-of-an-Image-using-GDIplus.aspx ULONG_PTR gdiplusToken; diff --git a/plugins/SendScreenshotPlus/src/Utils.h b/plugins/SendScreenshotPlus/src/Utils.h index 354244457f..5c22a17b7e 100644 --- a/plugins/SendScreenshotPlus/src/Utils.h +++ b/plugins/SendScreenshotPlus/src/Utils.h @@ -50,13 +50,13 @@ size_t MonitorInfoEnum(MONITORINFOEX* & myMonitors, RECT & virtualScreen); BOOL CALLBACK MonitorInfoEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData); FIBITMAP* CaptureWindow(HWND hCapture, BOOL bClientArea, BOOL bIndirectCapture); -FIBITMAP* CaptureMonitor(const TCHAR* szDevice,const RECT* cropRect=NULL); -TCHAR* SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const TCHAR* pszFilename, const TCHAR* pszExt, int flag=0); +FIBITMAP* CaptureMonitor(const wchar_t* szDevice,const RECT* cropRect=NULL); +wchar_t* SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const wchar_t* pszFilename, const wchar_t* pszExt, int flag=0); -TCHAR* GetFileNameW(const TCHAR* pszPath); -TCHAR* GetFileExtW (const TCHAR* pszPath); -char* GetFileNameA(const TCHAR* pszPath); -char* GetFileExtA (const TCHAR* pszPath); +wchar_t* GetFileNameW(const wchar_t* pszPath); +wchar_t* GetFileExtW (const wchar_t* pszPath); +char* GetFileNameA(const wchar_t* pszPath); +char* GetFileExtA (const wchar_t* pszPath); #ifdef _UNICODE # define GetFileName GetFileNameW # define GetFileExt GetFileExtW @@ -66,9 +66,9 @@ char* GetFileExtA (const TCHAR* pszPath); #endif // _UNICODE BOOL GetEncoderClsid(wchar_t *wchMimeType, CLSID& clsidEncoder); -//void SavePNG(HBITMAP hBmp, TCHAR* szFilename); -void SaveGIF(HBITMAP hBmp, TCHAR* szFilename); -void SaveTIF(HBITMAP hBmp, TCHAR* szFilename); +//void SavePNG(HBITMAP hBmp, wchar_t* szFilename); +void SaveGIF(HBITMAP hBmp, wchar_t* szFilename); +void SaveTIF(HBITMAP hBmp, wchar_t* szFilename); //--------------------------------------------------------------------------- /* Old stuff from Borland C++ @@ -76,16 +76,16 @@ void SaveTIF(HBITMAP hBmp, TCHAR* szFilename); */ -class EventHandle
-{
- HANDLE _hEvent;
-public:
- inline EventHandle() { _hEvent = CreateEvent(NULL, 0, 0, NULL); }
- inline ~EventHandle() { CloseHandle(_hEvent); }
- inline void Set() { SetEvent(_hEvent); }
- inline void Wait() { WaitForSingleObject(_hEvent, INFINITE); }
- inline void Wait(DWORD dwMilliseconds) { WaitForSingleObject(_hEvent, dwMilliseconds); }
- inline operator HANDLE() { return _hEvent; }
+class EventHandle +{ + HANDLE _hEvent; +public: + inline EventHandle() { _hEvent = CreateEvent(NULL, 0, 0, NULL); } + inline ~EventHandle() { CloseHandle(_hEvent); } + inline void Set() { SetEvent(_hEvent); } + inline void Wait() { WaitForSingleObject(_hEvent, INFINITE); } + inline void Wait(DWORD dwMilliseconds) { WaitForSingleObject(_hEvent, dwMilliseconds); } + inline operator HANDLE() { return _hEvent; } }; #endif diff --git a/plugins/SendScreenshotPlus/src/ctrl_button.cpp b/plugins/SendScreenshotPlus/src/ctrl_button.cpp index 06fdadea88..d68cb3ed14 100644 --- a/plugins/SendScreenshotPlus/src/ctrl_button.cpp +++ b/plugins/SendScreenshotPlus/src/ctrl_button.cpp @@ -42,7 +42,7 @@ typedef struct TMBCtrl int stateId; // button state int defbutton; // default button int pbState; - TCHAR cHot; + wchar_t cHot; } BTNCTRL, *LPBTNCTRL; // External theme methods and properties @@ -258,7 +258,7 @@ static void __fastcall PaintThemeButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClien static void __fastcall PaintButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClient) { RECT rcText = { 0, 0, 0, 0 }; - TCHAR szText[MAX_PATH] = { 0 }; + wchar_t szText[MAX_PATH] = { 0 }; WORD ccText; // Draw the flat button @@ -416,7 +416,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L while (*tmp) { if (*tmp == '&' && *(tmp + 1)) { - bct->cHot = _totlower(*(tmp + 1)); + bct->cHot = towlower(*(tmp + 1)); break; } tmp++; @@ -426,7 +426,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L break; case WM_SYSKEYUP: - if (bct->stateId != PBS_DISABLED && bct->cHot && bct->cHot == _totlower((TCHAR)wParam)) { + if (bct->stateId != PBS_DISABLED && bct->cHot && bct->cHot == towlower((wchar_t)wParam)) { if (bct->dwStyle & MBS_PUSHBUTTON) { if (bct->pbState) bct->pbState = 0; else bct->pbState = 1; @@ -564,7 +564,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L break; case BUTTONTRANSLATE: - TCHAR szButton[MAX_PATH]; + wchar_t szButton[MAX_PATH]; GetWindowText(bct->hwnd, szButton, _countof(szButton)); SetWindowText(bct->hwnd, TranslateTS(szButton)); break; diff --git a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp index 5801dcd7fb..5562180bbb 100644 --- a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp +++ b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp @@ -334,9 +334,9 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_OKCANCEL: retOk = IDRETRY; - SetDlgItemText(hDlg, IDOK, LPGENT("OK")); + SetDlgItemText(hDlg, IDOK, LPGENW("OK")); retCancel = IDCANCEL; - SetDlgItemText(hDlg, IDCANCEL, LPGENT("Cancel")); + SetDlgItemText(hDlg, IDCANCEL, LPGENW("Cancel")); rcOk.left = dlgMid - okWidth - 10; rcOk.right = rcOk.left + okWidth; rcCancel.left = dlgMid + 10; @@ -347,9 +347,9 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_RETRYCANCEL: retOk = IDRETRY; - SetDlgItemText(hDlg, IDOK, LPGENT("Retry")); + SetDlgItemText(hDlg, IDOK, LPGENW("Retry")); retCancel = IDCANCEL; - SetDlgItemText(hDlg, IDCANCEL, LPGENT("Cancel")); + SetDlgItemText(hDlg, IDCANCEL, LPGENW("Cancel")); rcOk.left = dlgMid - okWidth - 10; rcOk.right = rcOk.left + okWidth; rcCancel.left = dlgMid + 10; @@ -360,9 +360,9 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_YESNO: retOk = IDYES; - SetDlgItemText(hDlg, IDOK, LPGENT("Yes")); + SetDlgItemText(hDlg, IDOK, LPGENW("Yes")); retCancel = IDNO; - SetDlgItemText(hDlg, IDCANCEL, LPGENT("No")); + SetDlgItemText(hDlg, IDCANCEL, LPGENW("No")); rcOk.left = dlgMid - okWidth - 10; rcOk.right = rcOk.left + okWidth; rcCancel.left = dlgMid + 10; @@ -373,11 +373,11 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_ABORTRETRYIGNORE: retOk = IDABORT; - SetDlgItemText(hDlg, IDOK, LPGENT("Abort")); + SetDlgItemText(hDlg, IDOK, LPGENW("Abort")); retAll = IDABORT; - SetDlgItemText(hDlg, IDALL, LPGENT("Retry")); + SetDlgItemText(hDlg, IDALL, LPGENW("Retry")); retCancel = IDCANCEL; - SetDlgItemText(hDlg, IDCANCEL, LPGENT("Ignore")); + SetDlgItemText(hDlg, IDCANCEL, LPGENW("Ignore")); rcAll.left = dlgMid - (allWidth / 2); rcAll.right = rcAll.left + allWidth; rcOk.left = rcAll.left - okWidth - 5; @@ -391,11 +391,11 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_YESNOCANCEL: retOk = IDYES; - SetDlgItemText(hDlg, IDOK, LPGENT("Yes")); + SetDlgItemText(hDlg, IDOK, LPGENW("Yes")); retAll = IDNO; - SetDlgItemText(hDlg, IDALL, LPGENT("No")); + SetDlgItemText(hDlg, IDALL, LPGENW("No")); retCancel = IDCANCEL; - SetDlgItemText(hDlg, IDCANCEL, LPGENT("Cancel")); + SetDlgItemText(hDlg, IDCANCEL, LPGENW("Cancel")); rcAll.left = dlgMid - (allWidth / 2); rcAll.right = rcAll.left + allWidth; rcOk.left = rcAll.left - okWidth - 5; @@ -409,13 +409,13 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_YESALLNO: retOk = IDYES; - SetDlgItemText(hDlg, IDOK, LPGENT("Yes")); + SetDlgItemText(hDlg, IDOK, LPGENW("Yes")); retAll = IDALL; - SetDlgItemText(hDlg, IDALL, LPGENT("All")); + SetDlgItemText(hDlg, IDALL, LPGENW("All")); //retNon = IDNONE; - SetDlgItemText(hDlg, IDNONE, LPGENT("None")); + SetDlgItemText(hDlg, IDNONE, LPGENW("None")); retCancel = IDNO; - SetDlgItemText(hDlg, IDCANCEL, LPGENT("No")); + SetDlgItemText(hDlg, IDCANCEL, LPGENW("No")); rcCancel.right = rcDlg.right - rcDlg.left - 10; rcCancel.left = rcCancel.right - caWidth; rcNone.right = rcCancel.left - 5; @@ -673,7 +673,7 @@ INT_PTR MsgBoxService(WPARAM, LPARAM lParam) **/ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszInfo, LPCTSTR pszFormat, ...) { - TCHAR tszMsg[MAX_SECONDLINE]; + wchar_t tszMsg[MAX_SECONDLINE]; va_list vl; va_start(vl, pszFormat); @@ -699,7 +699,7 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI **/ INT_PTR CALLBACK MsgErr(HWND hParent, LPCTSTR pszFormat, ...) { - TCHAR tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE]; + wchar_t tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE]; mir_sntprintf(tszTitle, L"%s - %s", _T(MODNAME), TranslateT("Error")); va_list vl; diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 91e1ac7203..7a88a5816f 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -161,7 +161,7 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l dy = 20;
dx = 150;
dd = 5;
- hClistControl = CreateWindowEx(WS_EX_CLIENTEDGE, _T(CLISTCONTROL_CLASS), L"",
+ hClistControl = CreateWindowEx(WS_EX_CLIENTEDGE, CLISTCONTROL_CLASSW, L"",
WS_TABSTOP | WS_VISIBLE | WS_CHILD,
x, y, dx, dy, hdlg, (HMENU)IDC_CLIST, g_hInst, 0);
@@ -196,7 +196,7 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l break;
case IDOK:
- TCHAR szUserSessionName[MAX_PATH];
+ wchar_t szUserSessionName[MAX_PATH];
{
DWORD session_list_temp[255] = { 0 };
int i = 0, length = GetWindowTextLength(GetDlgItem(hdlg, IDC_LIST));
@@ -475,21 +475,21 @@ int SaveSessionDate() {
if (session_list[0] != 0) {
int TimeSize = GetTimeFormat(LOCALE_USER_DEFAULT, 0/*TIME_NOSECONDS*/, NULL, NULL, NULL, 0);
- TCHAR *szTimeBuf = (TCHAR*)mir_alloc((TimeSize + 1)*sizeof(TCHAR));
+ wchar_t *szTimeBuf = (wchar_t*)mir_alloc((TimeSize + 1)*sizeof(wchar_t));
GetTimeFormat(LOCALE_USER_DEFAULT, 0/*TIME_NOSECONDS*/, NULL, NULL, szTimeBuf, TimeSize);
int DateSize = GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, NULL, 0);
- TCHAR *szDateBuf = (TCHAR*)mir_alloc((DateSize + 1)*sizeof(TCHAR));
+ wchar_t *szDateBuf = (wchar_t*)mir_alloc((DateSize + 1)*sizeof(wchar_t));
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, szDateBuf, DateSize);
int lenn = (DateSize + TimeSize + 5);
- TCHAR *szSessionTime = (TCHAR*)mir_alloc(lenn*sizeof(TCHAR));
+ wchar_t *szSessionTime = (wchar_t*)mir_alloc(lenn*sizeof(wchar_t));
mir_sntprintf(szSessionTime, lenn, L"%s - %s", szTimeBuf, szDateBuf);
char szSetting[256];
mir_snprintf(szSetting, "%s_%d", "SessionDate", 0);
- TCHAR *ptszSaveSessionDate = db_get_tsa(NULL, MODNAME, szSetting);
+ wchar_t *ptszSaveSessionDate = db_get_tsa(NULL, MODNAME, szSetting);
db_set_ts(NULL, MODNAME, szSetting, szSessionTime);
mir_free(szSessionTime);
@@ -507,14 +507,14 @@ int SaveSessionDate() return 0;
}
-int SaveUserSessionName(TCHAR *szUSessionName)
+int SaveUserSessionName(wchar_t *szUSessionName)
{
if (session_list[0] == 0)
return 1;
char szSetting[256];
mir_snprintf(szSetting, "%s_%u", "UserSessionDsc", 0);
- TCHAR *ptszUserSessionName = db_get_tsa(NULL, MODNAME, szSetting);
+ wchar_t *ptszUserSessionName = db_get_tsa(NULL, MODNAME, szSetting);
if (ptszUserSessionName)
ResaveSettings("UserSessionDsc", 1, 255, ptszUserSessionName);
@@ -789,7 +789,7 @@ static int PluginInit(WPARAM, LPARAM) // Main menu
CMenuItem mi;
mi.position = 1000000000;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Sessions Manager"), 1000000000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Sessions Manager"), 1000000000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "D77B9AB4-AF7E-43DB-A487-BD581704D635");
SET_UID(mi, 0xd35302fa, 0x8326, 0x4323, 0xa3, 0xe5, 0xb4, 0x41, 0xff, 0xfb, 0xaa, 0x2d);
diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp index 7df7a2b1f9..6f98c5a005 100644 --- a/plugins/Sessions/Src/Options.cpp +++ b/plugins/Sessions/Src/Options.cpp @@ -334,7 +334,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l EnableWindow(GetDlgItem(hdlg, IDC_DEL), FALSE);
//EnableWindow(GetDlgItem(hdlg,IDC_SAVE),TRUE);
SetDlgItemText(hdlg, IDC_EDIT, TranslateT("View"));
- hOpClistControl = CreateWindowEx(WS_EX_STATICEDGE, _T(CLISTCONTROL_CLASS), L"",
+ hOpClistControl = CreateWindowEx(WS_EX_STATICEDGE, CLISTCONTROL_CLASSW, L"",
WS_TABSTOP | WS_VISIBLE | WS_CHILD,
14, 198, 161, 163, hdlg, (HMENU)IDC_EMCLIST, g_hInst, 0);
@@ -376,7 +376,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l }
if (bSesssionNameChanged) {
if (GetWindowTextLength(hComboBoxEdit)) {
- TCHAR szUserSessionName[MAX_PATH] = { '\0' };
+ wchar_t szUserSessionName[MAX_PATH] = { '\0' };
GetWindowText(hComboBoxEdit, szUserSessionName, _countof(szUserSessionName));
RenameUserDefSession(opses_count, szUserSessionName);
SendDlgItemMessage(hdlg, IDC_LIST, CB_RESETCONTENT, 0, 0);
diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp index 1672a81dda..5b0fe2e88a 100644 --- a/plugins/Sessions/Src/Utils.cpp +++ b/plugins/Sessions/Src/Utils.cpp @@ -222,7 +222,7 @@ void SetInSessionOrder(MCONTACT hContact, int mode, int count, unsigned int orde }
}
-BOOL ResaveSettings(char *szName, int iFirst, int iLimit, TCHAR *szBuffer)
+BOOL ResaveSettings(char *szName, int iFirst, int iLimit, wchar_t *szBuffer)
{
for (int i = iFirst; i < iLimit; i++) {
if (szBuffer == NULL)
@@ -231,7 +231,7 @@ BOOL ResaveSettings(char *szName, int iFirst, int iLimit, TCHAR *szBuffer) char szNameBuf[256];
mir_snprintf(szNameBuf, "%s_%u", szName, i);
- TCHAR *ptszTemp = db_get_tsa(NULL, MODNAME, szNameBuf);
+ wchar_t *ptszTemp = db_get_tsa(NULL, MODNAME, szNameBuf);
db_set_ts(NULL, MODNAME, szNameBuf, szBuffer);
mir_free(szBuffer);
@@ -298,7 +298,7 @@ int LoadSessionToCombobox(HWND hdlg, BOOL mode, int iLimit, char* pszSetting, in for (int i = 0; i < iLimit; i++) {
mir_snprintf(szBuffer, "%s_%u", pszSetting, i);
- TCHAR *pszBuffer = db_get_tsa(NULL, MODNAME, szBuffer);
+ wchar_t *pszBuffer = db_get_tsa(NULL, MODNAME, szBuffer);
if (pszBuffer) {
if (!IsMarkedUserDefSession(i + iFirstNum) || mode == 1) {
index = SendDlgItemMessage(hdlg, IDC_LIST, CB_ADDSTRING, 0, (LPARAM)pszBuffer);
@@ -327,7 +327,7 @@ int FillFavoritesMenu(HMENU hMenu, int iLimit) if (IsMarkedUserDefSession(i)) {
char szBuffer[256];
mir_snprintf(szBuffer, "%s_%u", "UserSessionDsc", i);
- TCHAR *pszBuffer = db_get_tsa(NULL, MODNAME, szBuffer);
+ wchar_t *pszBuffer = db_get_tsa(NULL, MODNAME, szBuffer);
if (pszBuffer) {
AppendMenu(hMenu, MF_STRING, i + 1, pszBuffer);
iItems++;
@@ -358,7 +358,7 @@ int CheckContactVisibility(MCONTACT hContact) return !db_get_b(hContact, "CList", "Hidden", 0);
}
-void RenameUserDefSession(int ses_count, TCHAR* ptszNewName)
+void RenameUserDefSession(int ses_count, wchar_t* ptszNewName)
{
char szSession[256];
mir_snprintf(szSession, "%s_%u", "UserSessionDsc", ses_count);
diff --git a/plugins/Sessions/Src/Utils.h b/plugins/Sessions/Src/Utils.h index ed1a8fd000..c474393433 100644 --- a/plugins/Sessions/Src/Utils.h +++ b/plugins/Sessions/Src/Utils.h @@ -30,7 +30,7 @@ bool LoadContactsFromMask(MCONTACT hContact, int mode, int count); int AddToCurSession(MCONTACT hContact, LPARAM lparam);
int DelFromCurSession(MCONTACT hContact,LPARAM lparam);
int CheckForDuplicate(MCONTACT contact_list[], MCONTACT lparam);
-BOOL ResaveSettings(char* szName,int iFirst,int iLimit,TCHAR* pszPrevSetting);
+BOOL ResaveSettings(char* szName,int iFirst,int iLimit,wchar_t* pszPrevSetting);
void OffsetWindow(HWND parent, HWND hwnd, int dx, int dy);
int LoadSessionToCombobox (HWND hdlg,BOOL mode,int iLimit,char* pszSetting,int iFirstNum);
int MarkUserDefSession(int ses_count,BYTE bCheck);
@@ -38,7 +38,7 @@ BYTE IsMarkedUserDefSession(int ses_count); void SavePosition(HWND hWnd, char *wndName);
void LoadPosition(HWND hWnd, char *wndName);
int CheckContactVisibility(MCONTACT hContact);
-void RenameUserDefSession(int ses_count,TCHAR* ptszNewName);
+void RenameUserDefSession(int ses_count,wchar_t* ptszNewName);
int FillFavoritesMenu (HMENU hMenu,int iLimit);
#endif // __UTILS_H__
\ No newline at end of file diff --git a/plugins/Sessions/Src/stdafx.h b/plugins/Sessions/Src/stdafx.h index b193b5c79e..d6cad97c92 100644 --- a/plugins/Sessions/Src/stdafx.h +++ b/plugins/Sessions/Src/stdafx.h @@ -55,7 +55,7 @@ int DeleteAutoSession(int ses_count); int LoadSession(WPARAM, LPARAM);
int SaveSessionHandles(WPARAM, LPARAM);
INT_PTR SaveUserSessionHandles(WPARAM, LPARAM);
-int SaveUserSessionName(TCHAR*);
+int SaveUserSessionName(wchar_t*);
INT_PTR CloseCurrentSession(WPARAM, LPARAM);
int SaveSessionDate();
diff --git a/plugins/ShellExt/src/main.cpp b/plugins/ShellExt/src/main.cpp index 83d5842fb2..1c16adb12d 100644 --- a/plugins/ShellExt/src/main.cpp +++ b/plugins/ShellExt/src/main.cpp @@ -6,7 +6,7 @@ HINSTANCE hInst; int hLangpack;
bool bIsVistaPlus;
-TCHAR tszLogPath[MAX_PATH];
+wchar_t tszLogPath[MAX_PATH];
PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
@@ -28,7 +28,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID) bIsVistaPlus = GetProcAddress( GetModuleHandleA("kernel32.dll"), "GetProductInfo") != NULL;
GetTempPath(_countof(tszLogPath), tszLogPath);
- _tcscat_s(tszLogPath, _countof(tszLogPath), L"shlext.log");
+ wcscat_s(tszLogPath, _countof(tszLogPath), L"shlext.log");
hInst = hinstDLL;
DisableThreadLibraryCalls(hinstDLL);
@@ -83,7 +83,7 @@ STDAPI DllCanUnloadNow() struct HRegKey
{
- HRegKey(HKEY hRoot, const TCHAR *ptszKey) : m_key(NULL)
+ HRegKey(HKEY hRoot, const wchar_t *ptszKey) : m_key(NULL)
{ RegCreateKeyEx(hRoot, ptszKey, 0, 0, 0, KEY_SET_VALUE | KEY_CREATE_SUB_KEY, 0, &m_key, 0);
}
@@ -127,9 +127,9 @@ STDAPI DllRegisterServer() if (kInprocServer == NULL)
return E_FAIL;
- TCHAR tszFileName[MAX_PATH];
+ wchar_t tszFileName[MAX_PATH];
GetModuleFileName(hInst, tszFileName, _countof(tszFileName));
- if ( RegSetValueEx(kInprocServer, NULL, 0, REG_SZ, (LPBYTE)tszFileName, sizeof(TCHAR)*(lstrlen(tszFileName)+1)))
+ if ( RegSetValueEx(kInprocServer, NULL, 0, REG_SZ, (LPBYTE)tszFileName, sizeof(wchar_t)*(lstrlen(tszFileName)+1)))
return E_FAIL;
if ( RegSetValueExA(kInprocServer, "ThreadingModel", 0, REG_SZ, (PBYTE)str4, sizeof(str4)))
return E_FAIL;
diff --git a/plugins/ShellExt/src/options.cpp b/plugins/ShellExt/src/options.cpp index 0a0c837ee4..e052f2fda7 100644 --- a/plugins/ShellExt/src/options.cpp +++ b/plugins/ShellExt/src/options.cpp @@ -7,7 +7,7 @@ static void AutoSize(HWND hwnd) HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
HFONT hOldFont = (HFONT)SelectObject(hDC, hFont);
- TCHAR szBuf[MAX_PATH];
+ wchar_t szBuf[MAX_PATH];
int i = GetWindowText(hwnd, szBuf, _countof(szBuf));
SIZE tS;
@@ -20,16 +20,16 @@ static void AutoSize(HWND hwnd) ////////////////////////////////////////////////////////////////////////////////////////////
-static TCHAR* COM_OKSTR[2] = {
- LPGENT("Problem, registration missing/deleted."),
- LPGENT("Successfully created shell registration.") };
-static TCHAR* COM_APPROVEDSTR[2] = { LPGENT("Not Approved"), LPGENT("Approved") };
+static wchar_t* COM_OKSTR[2] = {
+ LPGENW("Problem, registration missing/deleted."),
+ LPGENW("Successfully created shell registration.") };
+static wchar_t* COM_APPROVEDSTR[2] = { LPGENW("Not Approved"), LPGENW("Approved") };
static void InitControls(HWND hwndDlg)
{
int comReg = IsCOMRegistered();
- TCHAR szBuf[MAX_PATH];
+ wchar_t szBuf[MAX_PATH];
mir_sntprintf(szBuf, L"%s (%s)",
TranslateTS(COM_OKSTR[(comReg & COMREG_OK) != 0]),
TranslateTS(COM_APPROVEDSTR[(comReg & COMREG_APPROVED) != 0]));
diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index 17915853ec..f711fb1512 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -550,7 +550,7 @@ void CheckUnregisterServer() {
if (bIsVistaPlus) {
// launches regsvr to remove the dll under admin.
- TCHAR szFileName[MAX_PATH], szBuf[MAX_PATH * 2];
+ wchar_t szFileName[MAX_PATH], szBuf[MAX_PATH * 2];
GetModuleFileName(hInst, szFileName, _countof(szFileName));
mir_sntprintf(szBuf, L"/s /u \"%s\"", szFileName);
@@ -570,7 +570,7 @@ void CheckUnregisterServer() // for permission before installing the shell extension. note the filepath arg has to be quoted }
void CheckRegisterServer()
{
- TCHAR szFileName[MAX_PATH], szBuf[MAX_PATH * 2];
+ wchar_t szFileName[MAX_PATH], szBuf[MAX_PATH * 2];
HKEY hRegKey;
if (!RegOpenKeyEx(HKEY_CLASSES_ROOT, L"miranda.shlext", 0, KEY_READ, &hRegKey))
diff --git a/plugins/ShellExt/src/utils.cpp b/plugins/ShellExt/src/utils.cpp index 834850073d..275224388e 100644 --- a/plugins/ShellExt/src/utils.cpp +++ b/plugins/ShellExt/src/utils.cpp @@ -1,11 +1,11 @@ #include "stdafx.h"
#ifdef LOG_ENABLED
-extern TCHAR tszLogPath[];
+extern wchar_t tszLogPath[];
void logA(const char *format, ...)
{
- FILE *out = _tfopen(tszLogPath, L"a+");
+ FILE *out = _wfopen(tszLogPath, L"a+");
if (out) {
va_list args;
va_start(args, format);
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 917ab2ae7d..451539ba83 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -24,13 +24,13 @@ BOOL gbVarsServiceExist = FALSE; INT interval;
int hLangpack;
-TCHAR* ptszDefaultMsg[] = {
- LPGENT("I am currently away. I will reply to you when I am back."),
- LPGENT("I am currently very busy and can't spare any time to talk with you. Sorry..."),
- LPGENT("I am not available right now."),
- LPGENT("I am now doing something, I will talk to you later."),
- LPGENT("I am on the phone right now. I will get back to you very soon."),
- LPGENT("I am having meal right now. I will get back to you very soon.")
+wchar_t* ptszDefaultMsg[] = {
+ LPGENW("I am currently away. I will reply to you when I am back."),
+ LPGENW("I am currently very busy and can't spare any time to talk with you. Sorry..."),
+ LPGENW("I am not available right now."),
+ LPGENW("I am now doing something, I will talk to you later."),
+ LPGENW("I am on the phone right now. I will get back to you very soon."),
+ LPGENW("I am having meal right now. I will get back to you very soon.")
};
PLUGININFOEX pluginInfoEx = {
@@ -64,9 +64,9 @@ INT_PTR ToggleEnable(WPARAM, LPARAM) db_set_b(NULL, protocolname, KEY_ENABLED, fEnabled);
if (fEnabled)
- Menu_ModifyItem(hEnableMenu, LPGENT("Disable Auto&reply"), iconList[0].hIcolib);
+ Menu_ModifyItem(hEnableMenu, LPGENW("Disable Auto&reply"), iconList[0].hIcolib);
else
- Menu_ModifyItem(hEnableMenu, LPGENT("Enable Auto&reply"), iconList[1].hIcolib);
+ Menu_ModifyItem(hEnableMenu, LPGENW("Enable Auto&reply"), iconList[1].hIcolib);
return 0;
}
@@ -77,9 +77,9 @@ INT_PTR Toggle(WPARAM hContact, LPARAM) on = !on;
if (on)
- Menu_ModifyItem(hToggle, LPGENT("Turn off Autoanswer"), iconList[0].hIcolib);
+ Menu_ModifyItem(hToggle, LPGENW("Turn off Autoanswer"), iconList[0].hIcolib);
else
- Menu_ModifyItem(hToggle, LPGENT("Turn on Autoanswer"), iconList[1].hIcolib);
+ Menu_ModifyItem(hToggle, LPGENW("Turn on Autoanswer"), iconList[1].hIcolib);
return 0;
}
@@ -87,9 +87,9 @@ INT OnPreBuildContactMenu(WPARAM hContact, LPARAM) {
BOOL on = !db_get_b(hContact, protocolname, "TurnedOn", 0);
if (on)
- Menu_ModifyItem(hToggle, LPGENT("Turn off Autoanswer"), iconList[0].hIcolib);
+ Menu_ModifyItem(hToggle, LPGENW("Turn off Autoanswer"), iconList[0].hIcolib);
else
- Menu_ModifyItem(hToggle, LPGENT("Turn on Autoanswer"), iconList[1].hIcolib);
+ Menu_ModifyItem(hToggle, LPGENW("Turn on Autoanswer"), iconList[1].hIcolib);
return 0;
}
@@ -97,7 +97,7 @@ INT CheckDefaults(WPARAM, LPARAM) {
interval = db_get_w(NULL, protocolname, KEY_REPEATINTERVAL, 300);
- TCHAR *ptszVal = db_get_tsa(NULL, protocolname, KEY_HEADING);
+ wchar_t *ptszVal = db_get_tsa(NULL, protocolname, KEY_HEADING);
if (ptszVal == 0)
// Heading not set
db_set_ts(NULL, protocolname, KEY_HEADING, TranslateT("Dear %user%, the owner left the following message:"));
@@ -112,7 +112,7 @@ INT CheckDefaults(WPARAM, LPARAM) mir_snprintf(szStatus, "%d", c);
ptszVal = db_get_tsa(NULL, protocolname, szStatus);
if (ptszVal == 0) {
- TCHAR *ptszDefault;
+ wchar_t *ptszDefault;
if (c < ID_STATUS_FREECHAT)
// This mode does not have a preset message
ptszDefault = ptszDefaultMsg[c - ID_STATUS_ONLINE - 1];
@@ -133,9 +133,9 @@ INT CheckDefaults(WPARAM, LPARAM) BOOL fEnabled = db_get_b(NULL, protocolname, KEY_ENABLED, 1);
if (fEnabled)
- Menu_ModifyItem(hEnableMenu, LPGENT("Disable Auto&reply"), iconList[0].hIcolib);
+ Menu_ModifyItem(hEnableMenu, LPGENW("Disable Auto&reply"), iconList[0].hIcolib);
else
- Menu_ModifyItem(hEnableMenu, LPGENT("Enable Auto&reply"), iconList[1].hIcolib);
+ Menu_ModifyItem(hEnableMenu, LPGENW("Enable Auto&reply"), iconList[1].hIcolib);
return 0;
}
@@ -164,7 +164,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) if (!dbei.cbBlob) /// invalid size
return FALSE;
- TCHAR *ptszVal = db_get_tsa(hContact, "Protocol", "p");
+ wchar_t *ptszVal = db_get_tsa(hContact, "Protocol", "p");
if (ptszVal == NULL) // Contact with no protocol ?!!
return FALSE;
mir_free(ptszVal);
@@ -190,7 +190,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) if (*ptszVal) {
CMString ptszTemp;
- TCHAR *ptszNick = db_get_tsa(hContact, pszProto, "Nick");
+ wchar_t *ptszNick = db_get_tsa(hContact, pszProto, "Nick");
if (ptszNick == 0) {
mir_free(ptszVal);
return FALSE;
@@ -198,7 +198,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) msgLen += mir_tstrlen(ptszVal);
- TCHAR *ptszHead = db_get_tsa(NULL, protocolname, KEY_HEADING);
+ wchar_t *ptszHead = db_get_tsa(NULL, protocolname, KEY_HEADING);
if (ptszHead != NULL) {
ptszTemp = ptszHead;
ptszTemp.Replace(L"%user%", ptszNick);
@@ -206,7 +206,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) mir_free(ptszHead);
}
- TCHAR *ptszTemp2 = (TCHAR*)mir_alloc(sizeof(TCHAR) * (msgLen + 5));
+ wchar_t *ptszTemp2 = (wchar_t*)mir_alloc(sizeof(wchar_t) * (msgLen + 5));
mir_sntprintf(ptszTemp2, msgLen + 5, L"%s\r\n\r\n%s", ptszTemp.c_str(), ptszVal);
if (ServiceExists(MS_VARS_FORMATSTRING)) {
ptszTemp = variables_parse(ptszTemp2, 0, hContact);
@@ -241,8 +241,8 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) IconItemT iconList[] =
{
- { LPGENT("Disable Auto&reply"), "Disable Auto&reply", IDI_OFF },
- { LPGENT("Enable Auto&reply"), "Enable Auto&reply", IDI_ON }
+ { LPGENW("Disable Auto&reply"), "Disable Auto&reply", IDI_OFF },
+ { LPGENW("Enable Auto&reply"), "Enable Auto&reply", IDI_ON }
};
extern "C" int __declspec(dllexport)Load(void)
@@ -257,13 +257,13 @@ extern "C" int __declspec(dllexport)Load(void) SET_UID(mi, 0xac1c64a, 0x82ca, 0x4845, 0x86, 0x89, 0x59, 0x76, 0x12, 0x74, 0x72, 0x7b);
mi.position = 500090000;
- mi.name.t = L"";
+ mi.name.w = L"";
mi.pszService = protocolname"/ToggleEnable";
hEnableMenu = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0xb290cccd, 0x4ecc, 0x475e, 0x87, 0xcb, 0x51, 0xf4, 0x3b, 0xc3, 0x44, 0x9c);
mi.position = -0x7FFFFFFF;
- mi.name.t = L"";
+ mi.name.w = L"";
mi.pszService = protocolname"/ToggleAutoanswer";
hToggle = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp index 038988fe43..59dbbe5ad6 100644 --- a/plugins/SimpleAR/src/Options.cpp +++ b/plugins/SimpleAR/src/Options.cpp @@ -1,6 +1,6 @@ #include "stdafx.h"
-TCHAR* ptszMessage[6]={0};
+wchar_t* ptszMessage[6]={0};
INT lastIndex=-1;
INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -22,7 +22,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara for (INT c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++) {
mir_snprintf(tszStatus, "%d", c);
- TCHAR *pszStatus = pcli->pfnGetStatusModeDescription(c, 0);
+ wchar_t *pszStatus = pcli->pfnGetStatusModeDescription(c, 0);
if (c == ID_STATUS_ONLINE || c == ID_STATUS_FREECHAT || c == ID_STATUS_INVISIBLE)
continue;
else {
@@ -30,9 +30,9 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara if (!db_get_ts(NULL, protocolname, tszStatus, &dbv)) {
if (c < ID_STATUS_FREECHAT)
- ptszMessage[c - ID_STATUS_ONLINE - 1] = _tcsdup(dbv.ptszVal);
+ ptszMessage[c - ID_STATUS_ONLINE - 1] = wcsdup(dbv.ptszVal);
else if (c > ID_STATUS_INVISIBLE)
- ptszMessage[c - ID_STATUS_ONLINE - 3] = _tcsdup(dbv.ptszVal);
+ ptszMessage[c - ID_STATUS_ONLINE - 3] = wcsdup(dbv.ptszVal);
db_free(&dbv);
}
}
@@ -76,16 +76,16 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- TCHAR ptszText[1024];
+ wchar_t ptszText[1024];
BOOL translated;
BOOL fEnabled = IsDlgButtonChecked(hwndDlg, IDC_ENABLEREPLIER) == 1;
db_set_b(NULL, protocolname, KEY_ENABLED, (BYTE)fEnabled);
if (fEnabled)
- Menu_ModifyItem(hEnableMenu, LPGENT("Disable Auto&reply"), iconList[0].hIcolib);
+ Menu_ModifyItem(hEnableMenu, LPGENW("Disable Auto&reply"), iconList[0].hIcolib);
else
- Menu_ModifyItem(hEnableMenu, LPGENT("Enable Auto&reply"), iconList[1].hIcolib);
+ Menu_ModifyItem(hEnableMenu, LPGENW("Enable Auto&reply"), iconList[1].hIcolib);
GetDlgItemText(hwndDlg, IDC_HEADING, ptszText, _countof(ptszText));
db_set_ts(NULL, protocolname, KEY_HEADING, ptszText);
diff --git a/plugins/SimpleAR/src/stdafx.h b/plugins/SimpleAR/src/stdafx.h index 1994df2a7c..ff19f084ef 100644 --- a/plugins/SimpleAR/src/stdafx.h +++ b/plugins/SimpleAR/src/stdafx.h @@ -23,7 +23,7 @@ //General
extern HINSTANCE hinstance;
extern INT interval;
-extern TCHAR *ptszDefaultMsg[6];
+extern wchar_t *ptszDefaultMsg[6];
extern HGENMENU hEnableMenu;
extern IconItemT iconList[];
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index c8b0f37e56..dc3896efa3 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc., static HGENMENU hAwayMsgMenuItem, hCopyMsgMenuItem, hGoToURLMenuItem;
static MWindowList hWindowList, hWindowList2;
-static TCHAR *StrNormNewline(TCHAR *tszStr)
+static wchar_t *StrNormNewline(wchar_t *tszStr)
{
if (tszStr == NULL)
return NULL;
@@ -43,7 +43,7 @@ static TCHAR *StrNormNewline(TCHAR *tszStr) if (!nCR)
return mir_tstrdup(tszStr);
- TCHAR *tszNewStr = (TCHAR *)mir_alloc((mir_tstrlen(tszStr) + nCR + 1) * sizeof(TCHAR)), *ptszStr = tszNewStr;
+ wchar_t *tszNewStr = (wchar_t *)mir_alloc((mir_tstrlen(tszStr) + nCR + 1) * sizeof(wchar_t)), *ptszStr = tszNewStr;
while (*tszStr) {
if (*tszStr == 0x0A)
*ptszStr++ = 0x0D;
@@ -79,11 +79,11 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP dat->hAwayMsgEvent = dat->hSeq ? HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_AWAYMSG) : NULL;
WindowList_Add(hWindowList, hwndDlg, dat->hContact);
{
- TCHAR str[256], format[128];
- TCHAR *contactName = (TCHAR *)pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ wchar_t str[256], format[128];
+ wchar_t *contactName = (wchar_t *)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);
@@ -115,7 +115,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP dat->hAwayMsgEvent = NULL;
}
- TCHAR *tszMsg = StrNormNewline((TCHAR *)ack->lParam);
+ wchar_t *tszMsg = StrNormNewline((wchar_t *)ack->lParam);
SetDlgItemText(hwndDlg, IDC_MSG, tszMsg);
mir_free(tszMsg);
@@ -138,18 +138,18 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP if (!OpenClipboard(hwndDlg))
break;
if (EmptyClipboard()) {
- TCHAR msg[1024];
+ wchar_t msg[1024];
int len = GetDlgItemText(hwndDlg, IDC_MSG, msg, _countof(msg));
if (len) {
LPTSTR lptstrCopy;
- HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(TCHAR));
+ HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(wchar_t));
if (hglbCopy == NULL) {
CloseClipboard();
break;
}
lptstrCopy = (LPTSTR)GlobalLock(hglbCopy);
- memcpy(lptstrCopy, msg, len * sizeof(TCHAR));
- lptstrCopy[len] = (TCHAR)0;
+ memcpy(lptstrCopy, msg, len * sizeof(wchar_t));
+ lptstrCopy[len] = (wchar_t)0;
GlobalUnlock(hglbCopy);
SetClipboardData(CF_UNICODETEXT, hglbCopy);
@@ -202,8 +202,8 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP dat->hSeq = (HANDLE)ProtoChainSend(dat->hContact, PSS_GETAWAYMSG, 0, 0);
dat->hAwayMsgEvent = dat->hSeq ? HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_AWAYMSG) : NULL;
WindowList_Add(hWindowList2, hwndDlg, dat->hContact);
- TCHAR *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
- TCHAR str[256], format[128];
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ wchar_t str[256], format[128];
GetWindowText(hwndDlg, format, _countof(format));
mir_sntprintf(str, format, contactName);
SetWindowText(hwndDlg, str);
@@ -233,22 +233,22 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP break;
}
if (EmptyClipboard()) {
- TCHAR msg[1024];
- TCHAR *tszMsg = StrNormNewline((TCHAR *)ack->lParam);
- _tcsncpy_s(msg, tszMsg, _TRUNCATE);
+ wchar_t msg[1024];
+ wchar_t *tszMsg = StrNormNewline((wchar_t *)ack->lParam);
+ wcsncpy_s(msg, tszMsg, _TRUNCATE);
mir_free(tszMsg);
size_t len = mir_tstrlen(msg);
if (len) {
LPTSTR lptstrCopy;
- HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(TCHAR));
+ HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(wchar_t));
if (hglbCopy == NULL) {
CloseClipboard();
DestroyWindow(hwndDlg);
break;
}
lptstrCopy = (LPTSTR)GlobalLock(hglbCopy);
- memcpy(lptstrCopy, msg, len * sizeof(TCHAR));
- lptstrCopy[len] = (TCHAR)0;
+ memcpy(lptstrCopy, msg, len * sizeof(wchar_t));
+ lptstrCopy[len] = (wchar_t)0;
GlobalUnlock(hglbCopy);
SetClipboardData(CF_UNICODETEXT, hglbCopy);
@@ -339,7 +339,7 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM) if (szProto == NULL || db_get_b(hContact, szProto, "ChatRoom", 0))
return 0;
- TCHAR str[128];
+ wchar_t str[128];
int iStatus = 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(iStatus == ID_STATUS_OFFLINE ? ID_STATUS_INVISIBLE : iStatus)) {
@@ -388,7 +388,7 @@ int LoadAwayMsgModule(void) SET_UID(mi, 0xd3282acc, 0x9ff1, 0x4ede, 0x8a, 0x1e, 0x36, 0x72, 0x3f, 0x44, 0x4f, 0x84);
CreateServiceFunction(MS_AWAYMSG_SHOWAWAYMSG, GetMessageCommand);
mi.position = -2000005000;
- mi.name.t = LPGENT("Re&ad Away message");
+ mi.name.w = LPGENW("Re&ad Away message");
mi.pszService = MS_AWAYMSG_SHOWAWAYMSG;
hAwayMsgMenuItem = Menu_AddContactMenuItem(&mi);
@@ -396,7 +396,7 @@ int LoadAwayMsgModule(void) CreateServiceFunction(MS_SIMPLESTATUSMSG_COPYMSG, CopyAwayMsgCommand);
mi.position = -2000006000;
mi.hIcolibItem = GetIconHandle(IDI_COPY);
- mi.name.t = LPGENT("Copy Away message");
+ mi.name.w = LPGENW("Copy Away message");
mi.pszService = MS_SIMPLESTATUSMSG_COPYMSG;
hCopyMsgMenuItem = Menu_AddContactMenuItem(&mi);
@@ -404,7 +404,7 @@ int LoadAwayMsgModule(void) CreateServiceFunction(MS_SIMPLESTATUSMSG_GOTOURLMSG, GoToURLMsgCommand);
mi.position = -2000007000;
mi.hIcolibItem = GetIconHandle(IDI_GOTOURL);
- mi.name.t = LPGENT("&Go to URL in Away message");
+ mi.name.w = LPGENW("&Go to URL in Away message");
mi.pszService = MS_SIMPLESTATUSMSG_GOTOURLMSG;
hGoToURLMenuItem = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 5bcc8ea109..942eaa19a5 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -28,7 +28,7 @@ PROTOACCOUNTS *accounts; static int g_iIdleTime = -1;
UINT_PTR g_uUpdateMsgTimer = 0, *g_uSetStatusTimer;
-static TCHAR *g_ptszWinampSong;
+static wchar_t *g_ptszWinampSong;
HANDLE hTTBButton = 0, h_statusmodechange;
HWND hwndSAMsgDialog;
static HANDLE *hProtoStatusMenuItem;
@@ -90,9 +90,9 @@ void log2file(const char *fmt, ...) }
#endif
-static TCHAR *GetWinampSong(void)
+static wchar_t *GetWinampSong(void)
{
- TCHAR *szTitle, *pstr, *res = NULL;
+ wchar_t *szTitle, *pstr, *res = NULL;
HWND hwndWinamp = FindWindow(L"STUDIO", NULL);
int iTitleLen;
@@ -103,7 +103,7 @@ static TCHAR *GetWinampSong(void) return NULL;
iTitleLen = GetWindowTextLength(hwndWinamp);
- szTitle = (TCHAR *)mir_alloc((iTitleLen + 1) * sizeof(TCHAR));
+ szTitle = (wchar_t *)mir_alloc((iTitleLen + 1) * sizeof(wchar_t));
if (szTitle == NULL)
return NULL;
@@ -113,7 +113,7 @@ static TCHAR *GetWinampSong(void) return NULL;
}
- pstr = _tcsstr(szTitle, L" - Winamp");
+ pstr = wcsstr(szTitle, L" - Winamp");
if (pstr == NULL)
{
mir_free(szTitle);
@@ -122,8 +122,8 @@ static TCHAR *GetWinampSong(void) if (pstr < szTitle + (iTitleLen / 2))
{
- memmove(szTitle, pstr + 9, mir_tstrlen(pstr + 9) * sizeof(TCHAR));
- pstr = _tcsstr(pstr + 1, L" - Winamp");
+ memmove(szTitle, pstr + 9, mir_tstrlen(pstr + 9) * sizeof(wchar_t));
+ pstr = wcsstr(pstr + 1, L" - Winamp");
if (pstr == NULL)
{
mir_free(szTitle);
@@ -132,7 +132,7 @@ static TCHAR *GetWinampSong(void) }
*pstr = 0;
- pstr = _tcschr(szTitle, _T('.'));
+ pstr = wcschr(szTitle, '.');
if (pstr == NULL)
{
mir_free(szTitle);
@@ -146,16 +146,16 @@ static TCHAR *GetWinampSong(void) return res;
}
-TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
+wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int)
{
int i, count = 0, len;
- TCHAR substituteStr[1024], *msg = mir_tstrdup(in);
+ wchar_t substituteStr[1024], *msg = mir_tstrdup(in);
for (i = 0; msg[i]; i++)
{
if (msg[i] == 0x0D && db_get_b(NULL, "SimpleStatusMsg", "RemoveCR", 0))
{
- TCHAR *p = msg + i;
+ wchar_t *p = msg + i;
if (i + 1 <= 1024 && msg[i + 1])
{
if (msg[i + 1] == 0x0A)
@@ -163,7 +163,7 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int) if (i + 2 <= 1024 && msg[i + 2])
{
count++;
- memmove(p, p + 1, (mir_tstrlen(p) - 1) * sizeof(TCHAR));
+ memmove(p, p + 1, (mir_tstrlen(p) - 1) * sizeof(wchar_t));
}
else
{
@@ -177,9 +177,9 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int) if (msg[i] != '%')
continue;
- if (!_tcsnicmp(msg+i, L"%winampsong%", 12))
+ if (!wcsnicmp(msg+i, L"%winampsong%", 12))
{
- TCHAR *ptszWinampTitle = GetWinampSong();
+ wchar_t *ptszWinampTitle = GetWinampSong();
if (ptszWinampTitle != NULL)
{
@@ -195,14 +195,14 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int) continue;
if (mir_tstrlen(ptszWinampTitle) > 12)
- msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(ptszWinampTitle) - 12) * sizeof(TCHAR));
+ msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(ptszWinampTitle) - 12) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(ptszWinampTitle), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(TCHAR));
- memcpy(msg + i, ptszWinampTitle, mir_tstrlen(ptszWinampTitle) * sizeof(TCHAR));
+ memmove(msg + i + mir_tstrlen(ptszWinampTitle), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(wchar_t));
+ memcpy(msg + i, ptszWinampTitle, mir_tstrlen(ptszWinampTitle) * sizeof(wchar_t));
mir_free(ptszWinampTitle);
}
- else if (!_tcsnicmp(msg + i, L"%time%", 6))
+ else if (!wcsnicmp(msg + i, L"%time%", 6))
{
MIRANDA_IDLE_INFO mii = {0};
mii.cbSize = sizeof(mii);
@@ -230,31 +230,31 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int) else GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, substituteStr, _countof(substituteStr));
if (mir_tstrlen(substituteStr) > 6)
- msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(TCHAR));
+ msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(TCHAR));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
}
- else if (!_tcsnicmp(msg + i, L"%date%", 6))
+ else if (!wcsnicmp(msg + i, L"%date%", 6))
{
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, substituteStr, _countof(substituteStr));
if (mir_tstrlen(substituteStr) > 6)
- msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(TCHAR));
+ msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(TCHAR));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
}
- else if (!_tcsnicmp(msg+i, L"%rand(", 6))
+ else if (!wcsnicmp(msg+i, L"%rand(", 6))
{
- TCHAR *temp, *token;
+ wchar_t *temp, *token;
int ran_from, ran_to, k;
temp = mir_tstrdup(msg + i + 6);
- token = _tcstok(temp, L",)");
- ran_from = _ttoi(token);
- token = _tcstok(NULL, L",)%%");
- ran_to = _ttoi(token);
+ token = wcstok(temp, L",)");
+ ran_from = _wtoi(token);
+ token = wcstok(NULL, L",)%%");
+ ran_to = _wtoi(token);
if (ran_to > ran_from)
{
@@ -262,14 +262,14 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int) for (k = i + 1; msg[k]; k++) if (msg[k] == '%') { k++; break; }
if (mir_tstrlen(substituteStr) > k - i)
- msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - (k - i)) * sizeof(TCHAR));
+ msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - (k - i)) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + (k - i), (mir_tstrlen(msg) - i - (k - i - 1)) * sizeof(TCHAR));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ memmove(msg + i + mir_tstrlen(substituteStr), msg + i + (k - i), (mir_tstrlen(msg) - i - (k - i - 1)) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
}
mir_free(temp);
}
- else if (!_tcsnicmp(msg+i, L"%randmsg%", 9))
+ else if (!wcsnicmp(msg+i, L"%randmsg%", 9))
{
char buff[16];
int k, k2 = 0;
@@ -289,7 +289,7 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int) mir_snprintf(buff, "SMsg%d", k);
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
if (tszStatusMsg == NULL)
continue;
@@ -299,7 +299,7 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int) if (!mir_tstrlen(substituteStr))
continue;
- if (_tcsstr(substituteStr, L"%randmsg%") != NULL || _tcsstr(substituteStr, L"%randdefmsg%") != NULL)
+ if (wcsstr(substituteStr, L"%randmsg%") != NULL || wcsstr(substituteStr, L"%randdefmsg%") != NULL)
{
if (k == maxk) maxk--;
}
@@ -309,12 +309,12 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int) if (k2 == maxk || k2 > maxk) mir_tstrcpy(substituteStr, L"");
if (mir_tstrlen(substituteStr) > 9)
- msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 9) * sizeof(TCHAR));
+ msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 9) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 9, (mir_tstrlen(msg) - i - 8) * sizeof(TCHAR));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 9, (mir_tstrlen(msg) - i - 8) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
}
- else if (!_tcsnicmp(msg+i, L"%randdefmsg%", 12))
+ else if (!wcsnicmp(msg+i, L"%randdefmsg%", 12))
{
char buff[16];
int k, k2 = 0;
@@ -334,7 +334,7 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int) mir_snprintf(buff, "DefMsg%d", k);
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
if (tszStatusMsg == NULL)
continue;
@@ -344,7 +344,7 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int) if (!mir_tstrlen(substituteStr))
continue;
- if (_tcsstr(substituteStr, L"%randmsg%") != NULL || _tcsstr(substituteStr, L"%randdefmsg%") != NULL)
+ if (wcsstr(substituteStr, L"%randmsg%") != NULL || wcsstr(substituteStr, L"%randdefmsg%") != NULL)
{
if (k == maxk) maxk--;
}
@@ -354,10 +354,10 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int) if (k2 == maxk || k2 > maxk) mir_tstrcpy(substituteStr, L"");
if (mir_tstrlen(substituteStr) > 12)
- msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg)+1+mir_tstrlen(substituteStr)-12) * sizeof(TCHAR));
+ msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg)+1+mir_tstrlen(substituteStr)-12) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(TCHAR));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
}
}
@@ -370,7 +370,7 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int) len = db_get_w(NULL, "SimpleStatusMsg", szSetting, 1024);
if (len < mir_tstrlen(msg))
{
- msg = (TCHAR *)mir_realloc(msg, len * sizeof(TCHAR));
+ msg = (wchar_t *)mir_realloc(msg, len * sizeof(wchar_t));
msg[len] = 0;
}
}
@@ -378,14 +378,14 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int) return msg;
}
-TCHAR *InsertVarsIntoMsg(TCHAR *tszMsg, const char *szProto, int iStatus, MCONTACT hContact)
+wchar_t *InsertVarsIntoMsg(wchar_t *tszMsg, const char *szProto, int iStatus, MCONTACT hContact)
{
if (ServiceExists(MS_VARS_FORMATSTRING) && db_get_b(NULL, "SimpleStatusMsg", "EnableVariables", 1))
{
- TCHAR *tszVarsMsg = variables_parse(tszMsg, NULL, hContact);
+ wchar_t *tszVarsMsg = variables_parse(tszMsg, NULL, hContact);
if (tszVarsMsg != NULL)
{
- TCHAR *format = InsertBuiltinVarsIntoMsg(tszVarsMsg, szProto, iStatus);
+ wchar_t *format = InsertBuiltinVarsIntoMsg(tszVarsMsg, szProto, iStatus);
mir_free(tszVarsMsg);
return format;
}
@@ -394,10 +394,10 @@ TCHAR *InsertVarsIntoMsg(TCHAR *tszMsg, const char *szProto, int iStatus, MCONTA return InsertBuiltinVarsIntoMsg(tszMsg, szProto, iStatus);
}
-static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto)
+static wchar_t *GetAwayMessageFormat(int iStatus, const char *szProto)
{
char szSetting[80];
- TCHAR *format;
+ wchar_t *format;
mir_snprintf(szSetting, "%sFlags", szProto ? szProto : "");
int flags = db_get_b(NULL, "SimpleStatusMsg", StatusModeToDbSetting(iStatus, szSetting), STATUS_DEFAULT);
@@ -446,7 +446,7 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto) return format;
}
-void DBWriteMessage(char *szSetting, TCHAR *tszMsg)
+void DBWriteMessage(char *szSetting, wchar_t *tszMsg)
{
if (tszMsg && mir_tstrlen(tszMsg))
db_set_ts(NULL, "SimpleStatusMsg", szSetting, tszMsg);
@@ -454,7 +454,7 @@ void DBWriteMessage(char *szSetting, TCHAR *tszMsg) db_unset(NULL, "SimpleStatusMsg", szSetting);
}
-void SaveMessageToDB(const char *szProto, TCHAR *tszMsg, BOOL bIsFormat)
+void SaveMessageToDB(const char *szProto, wchar_t *tszMsg, BOOL bIsFormat)
{
char szSetting[80];
@@ -504,9 +504,9 @@ void SaveStatusAsCurrent(const char *szProto, int iStatus) db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)iStatus);
}
-static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, MCONTACT hContact)
+static wchar_t *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, MCONTACT hContact)
{
- TCHAR *format;
+ wchar_t *format;
char szSetting[80];
if ((!iStatus || iStatus == ID_STATUS_CURRENT) && szProto)
@@ -553,7 +553,7 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, if (bInsertVars && format != NULL)
{
- TCHAR *tszVarsMsg = InsertVarsIntoMsg(format, szProto, iStatus, hContact); // TODO random values not the same!
+ wchar_t *tszVarsMsg = InsertVarsIntoMsg(format, szProto, iStatus, hContact); // TODO random values not the same!
mir_free(format);
return tszVarsMsg;
}
@@ -583,13 +583,13 @@ int CheckProtoSettings(const char *szProto, int iInitialStatus) return iInitialStatus;
}
-static void Proto_SetAwayMsgT(const char *szProto, int iStatus, TCHAR *tszMsg)
+static void Proto_SetAwayMsgT(const char *szProto, int iStatus, wchar_t *tszMsg)
{
if (!(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_INDIVMODEMSG))
CallProtoService(szProto, PS_SETAWAYMSG, (WPARAM)iStatus, (LPARAM)tszMsg);
}
-static void Proto_SetStatus(const char *szProto, int iInitialStatus, int iStatus, TCHAR *tszMsg)
+static void Proto_SetStatus(const char *szProto, int iInitialStatus, int iStatus, wchar_t *tszMsg)
{
if (iStatus == ID_STATUS_OFFLINE && iStatus != iInitialStatus)
{
@@ -627,11 +627,11 @@ int HasProtoStaticStatusMsg(const char *szProto, int iInitialStatus, int iStatus else if (flags & PROTO_THIS_MSG)
{
mir_snprintf(szSetting, "Proto%sDefault", szProto);
- TCHAR *szSimpleStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *szSimpleStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
if (szSimpleStatusMsg != NULL)
{
SaveMessageToDB(szProto, szSimpleStatusMsg, TRUE);
- TCHAR *msg = InsertVarsIntoMsg(szSimpleStatusMsg, szProto, iStatus, NULL);
+ wchar_t *msg = InsertVarsIntoMsg(szSimpleStatusMsg, szProto, iStatus, NULL);
mir_free(szSimpleStatusMsg);
Proto_SetStatus(szProto, iInitialStatus, iStatus, msg);
SaveMessageToDB(szProto, msg, FALSE);
@@ -679,15 +679,15 @@ INT_PTR SetStatusModeFromExtern(WPARAM wParam, LPARAM lParam) if ((Proto_Status2Flag(newStatus) & status_modes_msg) || (newStatus == ID_STATUS_OFFLINE && (Proto_Status2Flag(ID_STATUS_INVISIBLE) & status_modes_msg)))
{
- TCHAR *msg = NULL;
+ wchar_t *msg = NULL;
if (HasProtoStaticStatusMsg(accounts->pa[i]->szModuleName, GetCurrentStatus(accounts->pa[i]->szModuleName), newStatus))
continue;
if (lParam)
- msg = InsertVarsIntoMsg((TCHAR *)lParam, accounts->pa[i]->szModuleName, newStatus, NULL);
+ msg = InsertVarsIntoMsg((wchar_t *)lParam, accounts->pa[i]->szModuleName, newStatus, NULL);
- SaveMessageToDB(accounts->pa[i]->szModuleName, (TCHAR *)lParam, TRUE);
+ SaveMessageToDB(accounts->pa[i]->szModuleName, (wchar_t *)lParam, TRUE);
SaveMessageToDB(accounts->pa[i]->szModuleName, msg, FALSE);
Proto_SetStatus(accounts->pa[i]->szModuleName, GetCurrentStatus(accounts->pa[i]->szModuleName), newStatus, msg /*? msg : L""*/);
mir_free(msg);
@@ -701,9 +701,9 @@ INT_PTR SetStatusModeFromExtern(WPARAM wParam, LPARAM lParam) int ChangeStatusMessage(WPARAM wParam, LPARAM lParam);
-void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, TCHAR *message, BOOL bOnStartup)
+void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, wchar_t *message, BOOL bOnStartup)
{
- TCHAR *msg = NULL;
+ wchar_t *msg = NULL;
#ifdef _DEBUG
log2file("SetStatusMessage(\"%s\", %d, %d, \"%S\", %d)", szProto, iInitialStatus, iStatus, message, bOnStartup);
#endif
@@ -1012,7 +1012,7 @@ int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) }
else if (iProtoFlags & PROTO_NOCHANGE && !bOnStartup) {
mir_snprintf(szSetting, "FCur%sMsg", szProto);
- TCHAR *msg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *msg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
#ifdef _DEBUG
log2file("ChangeStatusMessage(): Set %s status and \"%S\" status message for %s.", StatusModeToDbSetting(iStatus, ""), msg, szProto);
@@ -1023,7 +1023,7 @@ int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) }
if (!bShowDlg || bScreenSaverRunning) {
- TCHAR *msg = GetAwayMessageFormat(iStatus, szProto);
+ wchar_t *msg = GetAwayMessageFormat(iStatus, szProto);
#ifdef _DEBUG
log2file("ChangeStatusMessage(): Set %s status and \"%S\" status message for %s.", StatusModeToDbSetting(iStatus, ""), msg, szProto);
#endif
@@ -1073,7 +1073,7 @@ int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) !(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
- TCHAR *msg;
+ wchar_t *msg;
if (iProtoFlags & PROTO_NOCHANGE) {
mir_snprintf(szSetting, "FCur%sMsg", accounts->pa[i]->szModuleName);
msg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
@@ -1134,7 +1134,7 @@ static int ProcessProtoAck(WPARAM , LPARAM lParam) int SetStartupStatus(int i)
{
char szSetting[80];
- TCHAR *fmsg, *msg = NULL;
+ wchar_t *fmsg, *msg = NULL;
int iStatus = GetStartupStatus(accounts->pa[i]->szModuleName);
if (iStatus == ID_STATUS_OFFLINE)
@@ -1277,7 +1277,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD) if (!hwndSAMsgDialog)
{
char szBuffer[64];
- TCHAR *tszMsg;
+ wchar_t *tszMsg;
int iCurrentStatus;
for (int i = 0; i < accounts->count; ++i)
@@ -1296,7 +1296,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD) continue;
mir_snprintf(szBuffer, "FCur%sMsg", accounts->pa[i]->szModuleName);
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szBuffer);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szBuffer);
if (tszStatusMsg == NULL)
continue;
@@ -1348,8 +1348,8 @@ void RegisterHotkey(void) hkd.cbSize = sizeof(hkd);
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "SimpleStatusMsg_OpenDialog";
- hkd.ptszDescription = LPGENT("Open status message dialog");
- hkd.ptszSection = LPGENT("Status message");
+ hkd.ptszDescription = LPGENW("Open status message dialog");
+ hkd.ptszSection = LPGENW("Status message");
hkd.pszService = MS_SIMPLESTATUSMSG_SHOWDIALOGINT;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, VK_OEM_3);
Hotkey_Register(&hkd);
@@ -1389,7 +1389,7 @@ static int ChangeStatusMsgPrebuild(WPARAM, LPARAM) mi.flags |= CMIF_HIDDEN;
mi.hIcolibItem = GetIconHandle(IDI_CSMSG);
mi.pszService = MS_SIMPLESTATUSMSG_SHOWDIALOGINT;
- mi.name.t = LPGENT("Status message...");
+ mi.name.w = LPGENW("Status message...");
mi.position = 2000200000;
Menu_AddStatusMenuItem(&mi);
@@ -1418,7 +1418,7 @@ static int ChangeStatusMsgPrebuild(WPARAM, LPARAM) if (Proto_IsAccountLocked(pa[i]))
{
- TCHAR szBuffer[256];
+ wchar_t szBuffer[256];
mir_sntprintf(szBuffer, TranslateT("%s (locked)"), pa[i]->tszAccountName);
mi.root = Menu_CreateRoot(MO_STATUS, szBuffer, mi.position);
}
@@ -1477,8 +1477,8 @@ static int OnIdleChanged(WPARAM, LPARAM lParam) {
if (!(lParam & IDF_ISIDLE))
iStatus = ID_STATUS_ONLINE;
- TCHAR *tszMsg = GetAwayMessage(iStatus, accounts->pa[i]->szModuleName, FALSE, NULL);
- TCHAR *tszVarsMsg = InsertVarsIntoMsg(tszMsg, accounts->pa[i]->szModuleName, iStatus, NULL);
+ wchar_t *tszMsg = GetAwayMessage(iStatus, accounts->pa[i]->szModuleName, FALSE, NULL);
+ wchar_t *tszVarsMsg = InsertVarsIntoMsg(tszMsg, accounts->pa[i]->szModuleName, iStatus, NULL);
SaveMessageToDB(accounts->pa[i]->szModuleName, tszMsg, TRUE);
SaveMessageToDB(accounts->pa[i]->szModuleName, tszVarsMsg, FALSE);
mir_free(tszMsg);
@@ -1494,7 +1494,7 @@ static int CSStatusChange(WPARAM wParam, LPARAM) PROTOCOLSETTINGEX **ps = *(PROTOCOLSETTINGEX***)wParam;
int status_mode, CSProtoCount;
char szSetting[80];
- TCHAR *msg = NULL;
+ wchar_t *msg = NULL;
if (ps == NULL) return -1;
@@ -1530,7 +1530,7 @@ static int CSStatusChange(WPARAM wParam, LPARAM) for (int j = 1; j <= max_hist_msgs; j++)
{
mir_snprintf(buff, "SMsg%d", j);
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
if (tszStatusMsg != NULL)
{
if (!mir_tstrcmp(tszStatusMsg, szMsgW))
@@ -1568,13 +1568,13 @@ static int CSStatusChange(WPARAM wParam, LPARAM) return 0;
}
-static TCHAR *ParseWinampSong(ARGUMENTSINFO *ai)
+static wchar_t *ParseWinampSong(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
ai->flags |= AIF_DONTPARSE;
- TCHAR *ptszWinampTitle = GetWinampSong();
+ wchar_t *ptszWinampTitle = GetWinampSong();
if (ptszWinampTitle != NULL) {
mir_free(g_ptszWinampSong);
@@ -1586,12 +1586,12 @@ static TCHAR *ParseWinampSong(ARGUMENTSINFO *ai) return ptszWinampTitle;
}
-static TCHAR *ParseDate(ARGUMENTSINFO *ai)
+static wchar_t *ParseDate(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
- TCHAR szStr[128] = {0};
+ wchar_t szStr[128] = {0};
ai->flags |= AIF_DONTPARSE;
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, szStr, _countof(szStr));
@@ -1634,7 +1634,7 @@ static int OnICQStatusMsgRequest(WPARAM wParam, LPARAM lParam, LPARAM lMirParam) return 0;
int iStatus = ICQMsgTypeToStatus(wParam);
- TCHAR *tszMsg = GetAwayMessage(iStatus, szProto, TRUE, hContact);
+ wchar_t *tszMsg = GetAwayMessage(iStatus, szProto, TRUE, hContact);
Proto_SetAwayMsgT(szProto, iStatus, tszMsg);
mir_free(tszMsg);
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index c6099f9aef..6162d10dbe 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -99,7 +99,7 @@ HIMAGELIST AddStatusIconsToImageList(const char *szProto, int status_flags) HWND WINAPI CreateStatusComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) { int j = 0, cur_sel = 0; - TCHAR *status_desc; + wchar_t *status_desc; if (!(data->m_iDlgFlags & DLG_SHOW_STATUS)) return NULL; @@ -115,9 +115,9 @@ HWND WINAPI CreateStatusComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) cbei.mask = CBEIF_LPARAM | CBEIF_TEXT | CBEIF_IMAGE | CBEIF_SELECTEDIMAGE; if (data->m_bOnStartup) - status_desc = (TCHAR *)TranslateT("<startup>"); + status_desc = (wchar_t *)TranslateT("<startup>"); else - status_desc = (TCHAR *)TranslateT("<current>"); + status_desc = (wchar_t *)TranslateT("<current>"); cbei.iItem = j; cbei.pszText = (LPTSTR)status_desc; @@ -171,7 +171,7 @@ HWND WINAPI CreateStatusComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) int profileCount = (int)CallService(MS_SS_GETPROFILECOUNT, (WPARAM)&defaultProfile, 0); for (int i = 0; i < profileCount; ++i) { - TCHAR tszProfileName[128]; + wchar_t tszProfileName[128]; CallService(MS_SS_GETPROFILENAME, (WPARAM)i, (LPARAM)tszProfileName); cbei.iItem = j; @@ -217,7 +217,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) { char buff[16]; BOOL found = FALSE; - TCHAR text[128]; + wchar_t text[128]; HWND handle = CreateWindowEx(0, WC_COMBOBOXEX, NULL, WS_TABSTOP | CBS_NOINTEGRALHEIGHT | WS_VISIBLE | WS_CHILD | CBS_DROPDOWNLIST, @@ -238,7 +238,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) mir_snprintf(buff, "SMsg%d", j); j--; - TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff); + wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff); if (tszStatusMsg != NULL) { if (*tszStatusMsg != '\0') { found = TRUE; @@ -332,7 +332,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) for (int i = 1; i <= data->num_def_msgs; ++i) { // predefined messages mir_snprintf(buff, "DefMsg%d", i); - TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff); + wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff); if (tszStatusMsg != NULL) { if (*tszStatusMsg != '\0') { cbei.iItem = -1; @@ -465,20 +465,20 @@ VOID APIENTRY HandlePopupMenu(HWND hwnd, POINT pt, HWND edit_control) break; if (EmptyClipboard()) { - TCHAR item_string[128]; + wchar_t item_string[128]; GetMenuString(hmenu, m_selection, (LPTSTR)&item_string, 128, MF_BYCOMMAND); int len = (int)mir_tstrlen(item_string); if (len) { LPTSTR lptstrCopy; - HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(TCHAR)); + HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(wchar_t)); if (hglbCopy == NULL) { CloseClipboard(); break; } lptstrCopy = (LPTSTR)GlobalLock(hglbCopy); - memcpy(lptstrCopy, item_string, len * sizeof(TCHAR)); - lptstrCopy[len] = (TCHAR)0; + memcpy(lptstrCopy, item_string, len * sizeof(wchar_t)); + lptstrCopy[len] = (wchar_t)0; GlobalUnlock(hglbCopy); SetClipboardData(CF_UNICODETEXT, hglbCopy); @@ -531,15 +531,15 @@ static LRESULT CALLBACK EditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L } if (wParam == 127 && GetKeyState(VK_CONTROL) & 0x8000) { // Ctrl + Backspace DWORD start, end; - TCHAR *text; + wchar_t *text; int textLen; SendMessage(hwndDlg, EM_GETSEL, (WPARAM)&end, NULL); SendMessage(hwndDlg, WM_KEYDOWN, VK_LEFT, 0); SendMessage(hwndDlg, EM_GETSEL, (WPARAM)&start, NULL); textLen = GetWindowTextLength(hwndDlg); - text = (TCHAR *)mir_alloc(sizeof(TCHAR) * (textLen + 1)); + text = (wchar_t *)mir_alloc(sizeof(wchar_t) * (textLen + 1)); GetWindowText(hwndDlg, 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(hwndDlg, text); mir_free(text); SendMessage(hwndDlg, EM_SETSEL, start, start); @@ -593,7 +593,7 @@ int AddToPredefined(HWND hwndDlg, struct MsgBoxData *data) { COMBOBOXEXITEM newitem = {0}; int len = 0, num_items; - TCHAR msg[1024], text[1024]; + wchar_t msg[1024], text[1024]; if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EDIT1))) len = GetDlgItemText(hwndDlg, IDC_EDIT1, msg, _countof(msg)); @@ -676,8 +676,8 @@ void ClearHistory(struct MsgBoxData *data, int cur_sel) void DisplayCharsCount(struct MsgBoxData *dlg_data, HWND hwndDlg) { - TCHAR msg[1024]; - TCHAR status_text[128]; + wchar_t msg[1024]; + wchar_t status_text[128]; int len, lines = 1; if (dlg_data->m_iCountdown != -2) @@ -716,7 +716,7 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting); if (szSetting != NULL) { if (*szSetting != '\0') { - TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting); + wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting); if (tszStatusMsg != NULL) { if (*tszStatusMsg != '\0') { SetDlgItemText(hwndDlg, IDC_EDIT1, tszStatusMsg); @@ -745,7 +745,7 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) else mir_snprintf(setting, "Default"); - TCHAR *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting)); + wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting)); if (tszStatusMsg != NULL) { SetDlgItemText(hwndDlg, IDC_EDIT1, tszStatusMsg); fcursel = SendMessage(data->recent_cbex, CB_FINDSTRINGEXACT, num_start, (LPARAM)tszStatusMsg); @@ -760,7 +760,7 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) else mir_snprintf(setting, "Msg"); - TCHAR *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting)); + wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting)); if (tszStatusMsg != NULL) { SetDlgItemText(hwndDlg, IDC_EDIT1, tszStatusMsg); fcursel = SendMessage(data->recent_cbex, CB_FINDSTRINGEXACT, num_start, (LPARAM)tszStatusMsg); @@ -776,7 +776,7 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus) { - TCHAR szTitle[256], szProtoName[128]; + wchar_t szTitle[256], szProtoName[128]; BOOL bDisabled = msgbox_data->m_szProto && !(CallProtoService(msgbox_data->m_szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND); mir_sntprintf(szProtoName, msgbox_data->m_szProto ? Proto_GetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global")); @@ -787,7 +787,7 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus) mir_sntprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<current>"), szProtoName); } else if (iStatus > ID_STATUS_CURRENT) { - TCHAR buff[128]; + wchar_t buff[128]; char buff1[128]; CallService(MS_SS_GETPROFILENAME, iStatus - 40083, (LPARAM)buff1); @@ -812,7 +812,7 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus) { int num_items = SendMessage(msgbox_data->recent_cbex, CB_GETCOUNT, 0, 0); int fcursel = CB_ERR, num_start = num_items - msgbox_data->num_def_msgs - 1; - TCHAR msg[1024]; + wchar_t msg[1024]; if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EDIT1))) EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT1), TRUE); @@ -890,7 +890,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA switch (uMsg) { case WM_INITDIALOG: { - TCHAR szTitle[256], szFormat[256], szProtoName[128]; + wchar_t szTitle[256], szFormat[256], szProtoName[128]; struct MsgBoxInitData *init_data; struct MsgBoxData *copy_init_data; INITCOMMONCONTROLSEX icex = {0}; @@ -997,7 +997,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA SetEditControlText(copy_init_data, hwndDlg, copy_init_data->m_iStatus); if ((copy_init_data->m_iDlgFlags & DLG_SHOW_BUTTONS) || (copy_init_data->m_iDlgFlags & DLG_SHOW_BUTTONS_FLAT)) { - TCHAR msg[1024]; + wchar_t msg[1024]; if (!GetDlgItemText(hwndDlg, IDC_EDIT1, msg, _countof(msg))) EnableWindow(GetDlgItem(hwndDlg, IDC_BADD), FALSE); @@ -1096,7 +1096,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA break; } else { - TCHAR str[64]; + wchar_t str[64]; mir_sntprintf(str, TranslateT("Closing in %d"), msgbox_data->m_iCountdown); SetDlgItemText(hwndDlg, IDC_OK, str); } @@ -1107,7 +1107,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA switch (LOWORD(wParam)) { case IDC_OK: { - TCHAR tszMsg[1024]; + wchar_t tszMsg[1024]; int iStatus, iMsgLen = 0, iProfileStatus = 0; BOOL bCurrentStatus = FALSE; @@ -1172,7 +1172,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA for (int i = 1; i <= msgbox_data->max_hist_msgs; i++) { mir_snprintf(buff, "SMsg%d", i); - TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff); + wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff); if (tszStatusMsg != NULL) { if (!mir_tstrcmp(tszStatusMsg, tszMsg)) { found = true; @@ -1285,7 +1285,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA DisplayCharsCount(msgbox_data, hwndDlg); SendMessage(msgbox_data->recent_cbex, CB_SETCURSEL, -1, 0); if ((msgbox_data->m_iDlgFlags & DLG_SHOW_BUTTONS) || (msgbox_data->m_iDlgFlags & DLG_SHOW_BUTTONS_FLAT)) { - TCHAR msg[1024]; + wchar_t msg[1024]; if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_BDEL))) EnableWindow(GetDlgItem(hwndDlg, IDC_BDEL), FALSE); @@ -1337,7 +1337,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA switch (HIWORD(wParam)) { case CBN_SELENDOK: { - TCHAR text[1024]; + wchar_t text[1024]; int cur_sel = SendMessage(msgbox_data->recent_cbex, CB_GETCURSEL, 0, 0); COMBOBOXEXITEM cbitem = {0}; @@ -1366,7 +1366,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (MessageBox(NULL, TranslateT("Are you sure you want to clear status message history?"), TranslateT("Confirm clearing history"), MB_ICONQUESTION | MB_YESNO) == IDYES) ClearHistory(msgbox_data, cur_sel); else if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EDIT1))) { - TCHAR msg[1024]; + wchar_t msg[1024]; int fcursel = CB_ERR, num_start; num_start = SendMessage(msgbox_data->recent_cbex, CB_GETCOUNT, 0, 0); num_start -= msgbox_data->num_def_msgs + 1; @@ -1518,7 +1518,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA EnableWindow(GetDlgItem(hwndDlg, IDC_BDEL), FALSE); } else { - TCHAR text[1024]; + wchar_t text[1024]; if (cur_sel - 1 >= 0) cur_sel--; @@ -1583,7 +1583,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (msgbox_data->m_bPredefChanged) { int i, num_items, new_num_def_msgs = 0; COMBOBOXEXITEM cbitem = {0}; - TCHAR text[1024]; + wchar_t text[1024]; char buff[64]; num_items = SendMessage(msgbox_data->recent_cbex, CB_GETCOUNT, 0, 0); diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index e990901469..e7695ca304 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -61,15 +61,15 @@ static LRESULT CALLBACK OptEditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam if (wParam == 127 && GetKeyState(VK_CONTROL) & 0x8000) // Ctrl + Backspace
{
DWORD start, end;
- TCHAR *text;
+ wchar_t *text;
int textLen;
SendMessage(hwndDlg, EM_GETSEL, (WPARAM)&end, NULL);
SendMessage(hwndDlg, WM_KEYDOWN, VK_LEFT, 0);
SendMessage(hwndDlg, EM_GETSEL, (WPARAM)&start, NULL);
textLen = GetWindowTextLength(hwndDlg);
- text = (TCHAR *)mir_alloc(sizeof(TCHAR) * (textLen + 1));
+ text = (wchar_t *)mir_alloc(sizeof(wchar_t) * (textLen + 1));
GetWindowText(hwndDlg, 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(hwndDlg, text);
mir_free(text);
SendMessage(hwndDlg, EM_SETSEL, start, start);
@@ -85,14 +85,14 @@ static LRESULT CALLBACK OptEditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam struct SingleProtoMsg
{
int flags;
- TCHAR *msg;
+ wchar_t *msg;
int max_length;
};
struct SingleStatusMsg
{
int flags[9];
- TCHAR msg[9][1024];
+ wchar_t msg[9][1024];
};
struct OptDlgData
@@ -451,7 +451,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting);
if (szSetting)
{
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg && mir_tstrlen(tszStatusMsg))
{
if (tszStatusMsg && mir_tstrlen(tszStatusMsg))
@@ -489,7 +489,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l else
mir_snprintf(setting, "Msg");
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
if (tszStatusMsg)
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
@@ -602,7 +602,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting);
if (szSetting != NULL)
{
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg)
{
if (tszStatusMsg[0])
@@ -639,7 +639,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l else
mir_snprintf(setting, "Msg");
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
if (tszStatusMsg != NULL)
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
@@ -697,7 +697,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting);
if (szSetting != NULL)
{
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg)
{
if (tszStatusMsg[0])
@@ -726,7 +726,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l else
mir_snprintf(setting, "Msg");
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
if (tszStatusMsg != NULL)
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
@@ -807,7 +807,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting);
if (szSetting != NULL)
{
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg)
{
if (tszStatusMsg[0])
@@ -837,7 +837,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l else
mir_snprintf(setting, "Msg");
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i + ID_STATUS_ONLINE, setting));
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i + ID_STATUS_ONLINE, setting));
if (tszStatusMsg != NULL)
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
@@ -862,7 +862,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (HIWORD(wParam) == EN_KILLFOCUS)
{
- TCHAR msg[1024];
+ wchar_t msg[1024];
if (data->proto_msg[j].flags & PROTO_THIS_MSG)
{
@@ -1181,7 +1181,7 @@ static bool IsHistoryMsgsFound(HWND, int histMax) if (j < 1)
j = histMax;
mir_snprintf(szSetting, "SMsg%d", j);
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg != NULL) {
if (*tszStatusMsg != '\0') {
mir_free(tszStatusMsg);
@@ -1234,7 +1234,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_SETCURSEL, (WPARAM)i_btnhide, 0);
if (!ServiceExists(MS_SS_GETPROFILECOUNT)) {
- TCHAR szText[100];
+ wchar_t szText[100];
mir_sntprintf(szText, L"%s *", TranslateT("Show status profiles in status list"));
SetDlgItemText(hwndDlg, IDC_CPROFILES, szText);
EnableWindow(GetDlgItem(hwndDlg, IDC_CPROFILES), FALSE);
diff --git a/plugins/SimpleStatusMsg/src/simplestatusmsg.h b/plugins/SimpleStatusMsg/src/simplestatusmsg.h index c1ca255b19..c5fd123b6d 100644 --- a/plugins/SimpleStatusMsg/src/simplestatusmsg.h +++ b/plugins/SimpleStatusMsg/src/simplestatusmsg.h @@ -81,7 +81,7 @@ int LoadAwayMsgModule(void); int AwayMsgPreShutdown(void);
/* main.cpp */
-void SetStatusMessage(const char *szProto, int initial_status_mode, int status_mode, TCHAR *message, BOOL on_startup);
+void SetStatusMessage(const char *szProto, int initial_status_mode, int status_mode, wchar_t *message, BOOL on_startup);
/* msgbox.cpp */
INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
@@ -97,7 +97,7 @@ void ReleaseIconEx(const char* name); HANDLE HookProtoEvent(const char *szModule, const char *szEvent, MIRANDAHOOKPARAM hookProc);
void UnhookProtoEvents(void);
int GetRandom(int from, int to);
-const TCHAR *GetDefaultMessage(int status);
+const wchar_t *GetDefaultMessage(int status);
const char *StatusModeToDbSetting(int status, const char *suffix);
int GetCurrentStatus(const char *szProto);
int GetStartupStatus(const char *szProto);
diff --git a/plugins/SimpleStatusMsg/src/utils.cpp b/plugins/SimpleStatusMsg/src/utils.cpp index d27b1ad5ae..f0bbf520b5 100644 --- a/plugins/SimpleStatusMsg/src/utils.cpp +++ b/plugins/SimpleStatusMsg/src/utils.cpp @@ -89,7 +89,7 @@ int GetRandom(int from, int to) }
// From SRAway module
-const TCHAR *GetDefaultMessage(int status)
+const wchar_t *GetDefaultMessage(int status)
{
switch (status) {
case ID_STATUS_AWAY: return TranslateT("I've been away since %time%.");
diff --git a/plugins/SkypeStatusChange/src/main.cpp b/plugins/SkypeStatusChange/src/main.cpp index fe36751074..a8329b8598 100644 --- a/plugins/SkypeStatusChange/src/main.cpp +++ b/plugins/SkypeStatusChange/src/main.cpp @@ -187,12 +187,12 @@ LRESULT APIENTRY SkypeAPI_WindowProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) oCopyData.cbData = cLength + 1;
SendMessage(wndSkypeAPIWindow, WM_COPYDATA, (WPARAM)hWnd, (LPARAM)&oCopyData);
if (g_Options.GetSyncStatusMsgFlag()) {
- TCHAR* pszStatusMsg = NULL;
+ wchar_t* pszStatusMsg = NULL;
if (ProtoServiceExists(si.Module(), PS_GETMYAWAYMSG))
- pszStatusMsg = reinterpret_cast<TCHAR*>(CallProtoService(si.Module(), PS_GETMYAWAYMSG, (WPARAM)ms.m_nMirandaStatus, SGMA_TCHAR));
+ pszStatusMsg = reinterpret_cast<wchar_t*>(CallProtoService(si.Module(), PS_GETMYAWAYMSG, (WPARAM)ms.m_nMirandaStatus, SGMA_TCHAR));
if ((NULL == pszStatusMsg) || (CALLSERVICE_NOTFOUND == INT_PTR(pszStatusMsg)))
- pszStatusMsg = reinterpret_cast<TCHAR*>(CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)ms.m_nMirandaStatus, 0));
+ pszStatusMsg = reinterpret_cast<wchar_t*>(CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)ms.m_nMirandaStatus, 0));
if (pszStatusMsg && reinterpret_cast<LPARAM>(pszStatusMsg) != CALLSERVICE_NOTFOUND) {
T2Utf pMsg(pszStatusMsg);
diff --git a/plugins/SkypeStatusChange/src/options.cpp b/plugins/SkypeStatusChange/src/options.cpp index a600cb3e12..cb789436a4 100644 --- a/plugins/SkypeStatusChange/src/options.cpp +++ b/plugins/SkypeStatusChange/src/options.cpp @@ -26,7 +26,7 @@ enum ETreeCheckBoxState TCBS_DISABLE_CHECKED = 4,
};
-HTREEITEM tree_insert_item(HWND hwndTree, TCHAR *pName, HTREEITEM htiParent, ETreeCheckBoxState nState, CTreeItemData *pData)
+HTREEITEM tree_insert_item(HWND hwndTree, wchar_t *pName, HTREEITEM htiParent, ETreeCheckBoxState nState, CTreeItemData *pData)
{
TVINSERTSTRUCT tvi = { 0 };
tvi.hParent = htiParent;
diff --git a/plugins/SkypeStatusChange/src/stdafx.h b/plugins/SkypeStatusChange/src/stdafx.h index 307fa73413..8fc6dec0ea 100644 --- a/plugins/SkypeStatusChange/src/stdafx.h +++ b/plugins/SkypeStatusChange/src/stdafx.h @@ -1,6 +1,5 @@ #include <windows.h>
#include <stdio.h>
-#include <tchar.h>
#include <assert.h>
#include <commctrl.h>
diff --git a/plugins/SmileyAdd/src/SmileyBase.cpp b/plugins/SmileyAdd/src/SmileyBase.cpp index 8d9a58b94f..583396fbe7 100644 --- a/plugins/SmileyAdd/src/SmileyBase.cpp +++ b/plugins/SmileyAdd/src/SmileyBase.cpp @@ -91,7 +91,7 @@ void ISmileyBase::SendOnViewChange(void) }
}
-bool ISmileyBase::QueryHitPointSpecial(int x, int y, HWND hwnd, TCHAR **smltxt)
+bool ISmileyBase::QueryHitPointSpecial(int x, int y, HWND hwnd, wchar_t **smltxt)
{
bool result = m_visible && m_hwnd == hwnd;
if (result)
@@ -101,9 +101,9 @@ bool ISmileyBase::QueryHitPointSpecial(int x, int y, HWND hwnd, TCHAR **smltxt) return result;
}
-void ISmileyBase::SetHint(TCHAR *smltxt)
+void ISmileyBase::SetHint(wchar_t *smltxt)
{
- m_smltxt = _tcsdup(smltxt);
+ m_smltxt = wcsdup(smltxt);
}
@@ -374,7 +374,7 @@ void CloseSmileys(void) }
}
-int CheckForTip(int x, int y, HWND hwnd, TCHAR **smltxt)
+int CheckForTip(int x, int y, HWND hwnd, wchar_t **smltxt)
{
for (int i = 0; i < regSmileys.getCount(); i++)
if (regSmileys[i]->QueryHitPointSpecial(x, y, hwnd, smltxt))
diff --git a/plugins/SmileyAdd/src/SmileyBase.h b/plugins/SmileyAdd/src/SmileyBase.h index 10378a52b3..499e960510 100644 --- a/plugins/SmileyAdd/src/SmileyBase.h +++ b/plugins/SmileyAdd/src/SmileyBase.h @@ -39,7 +39,7 @@ class ISmileyBase : public IOleObject, public IViewObject2, public ITooltipData DWORD m_advf;
LONG m_lRefCount;
- TCHAR* m_smltxt;
+ wchar_t* m_smltxt;
protected:
SIZEL m_sizeExtent;
@@ -56,8 +56,8 @@ public: virtual void OnClose(void);
void SendOnViewChange(void);
- bool QueryHitPointSpecial(int x, int y, HWND hwnd, TCHAR **smltxt);
- void SetHint(TCHAR *smltxt);
+ bool QueryHitPointSpecial(int x, int y, HWND hwnd, wchar_t **smltxt);
+ void SetHint(wchar_t *smltxt);
virtual void Draw() PURE;
virtual void SetPosition(HWND hwnd, LPCRECT lpRect);
diff --git a/plugins/SmileyAdd/src/customsmiley.cpp b/plugins/SmileyAdd/src/customsmiley.cpp index 97480911f6..a61a014e9c 100644 --- a/plugins/SmileyAdd/src/customsmiley.cpp +++ b/plugins/SmileyAdd/src/customsmiley.cpp @@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. SmileyPackCListType g_SmileyPackCStore;
-bool SmileyPackCListType::AddSmileyPack(MCONTACT hContact, TCHAR *dir)
+bool SmileyPackCListType::AddSmileyPack(MCONTACT hContact, wchar_t *dir)
{
bool res = true;
if (GetSmileyPack(hContact) == NULL) {
@@ -36,7 +36,7 @@ bool SmileyPackCListType::AddSmileyPack(MCONTACT hContact, TCHAR *dir) return res;
}
-bool SmileyPackCListType::AddSmiley(MCONTACT hContact, TCHAR *path)
+bool SmileyPackCListType::AddSmiley(MCONTACT hContact, wchar_t *path)
{
SmileyPackCType *smpack = GetSmileyPack(hContact);
if (smpack == NULL) {
@@ -59,7 +59,7 @@ SmileyPackCType* SmileyPackCListType::GetSmileyPack(MCONTACT id) }
-SmileyCType::SmileyCType(const CMString &fullpath, const TCHAR *filepath)
+SmileyCType::SmileyCType(const CMString &fullpath, const wchar_t *filepath)
{
LoadFromResource(fullpath, 0);
CreateTriggerText(_T2A(filepath));
@@ -78,7 +78,7 @@ bool SmileyCType::CreateTriggerText(char *text) return false;
char save = res[reslen]; res[reslen] = 0; // safe because of mir_alloc
- TCHAR *txt = mir_utf8decodeT(res);
+ wchar_t *txt = mir_utf8decodeT(res);
res[reslen] = save;
if (txt == NULL)
@@ -93,19 +93,19 @@ bool SmileyCType::CreateTriggerText(char *text) // SmileyPackCType
//
-bool SmileyPackCType::LoadSmileyDir(TCHAR *dir)
+bool SmileyPackCType::LoadSmileyDir(wchar_t *dir)
{
CMString dirs = dir;
dirs += L"\\*.*";
- _tfinddata_t c_file;
- INT_PTR hFile = _tfindfirst((TCHAR*)dirs.c_str(), &c_file);
+ _wfinddata_t c_file;
+ INT_PTR hFile = _wfindfirst((wchar_t*)dirs.c_str(), &c_file);
if (hFile > -1L) {
do {
if (c_file.name[0] != '.') {
CMString fullpath = dir;
fullpath = fullpath + L"\\" + c_file.name;
- TCHAR *div = _tcsrchr(c_file.name, '.');
+ wchar_t *div = wcsrchr(c_file.name, '.');
if (div) {
*div = 0;
SmileyCType *smlc = new SmileyCType(fullpath, c_file.name);
@@ -115,7 +115,7 @@ bool SmileyPackCType::LoadSmileyDir(TCHAR *dir) m_SmileyList.insert(smlc);
}
}
- } while (_tfindnext(hFile, &c_file) == 0);
+ } while (_wfindnext(hFile, &c_file) == 0);
_findclose(hFile);
AddTriggersToSmileyLookup();
return true;
@@ -123,7 +123,7 @@ bool SmileyPackCType::LoadSmileyDir(TCHAR *dir) return false;
}
-bool SmileyPackCType::LoadSmiley(TCHAR *path)
+bool SmileyPackCType::LoadSmiley(wchar_t *path)
{
CMString dirs = path;
int slash = dirs.ReverseFind('\\');
@@ -137,7 +137,7 @@ bool SmileyPackCType::LoadSmiley(TCHAR *path) return true;
}
- m_SmileyList.insert(new SmileyCType(dirs, (TCHAR*)name.c_str()));
+ m_SmileyList.insert(new SmileyCType(dirs, (wchar_t*)name.c_str()));
CMString empty;
m_SmileyLookup.insert(new SmileyLookup(
diff --git a/plugins/SmileyAdd/src/customsmiley.h b/plugins/SmileyAdd/src/customsmiley.h index 3517d348cd..b1366e83bc 100644 --- a/plugins/SmileyAdd/src/customsmiley.h +++ b/plugins/SmileyAdd/src/customsmiley.h @@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. class SmileyCType : public SmileyType
{
public:
- SmileyCType(const CMString &fullpath, const TCHAR *filepath);
+ SmileyCType(const CMString &fullpath, const wchar_t *filepath);
bool CreateTriggerText(char *text);
};
@@ -52,8 +52,8 @@ public: MCONTACT GetId(void) { return m_id; }
void SetId(MCONTACT id) { m_id = id; }
- bool LoadSmiley(TCHAR *path);
- bool LoadSmileyDir(TCHAR *dir);
+ bool LoadSmiley(wchar_t *path);
+ bool LoadSmileyDir(wchar_t *dir);
};
@@ -68,8 +68,8 @@ private: public:
int NumberOfSmileyPacks(void) { return m_SmileyPacks.getCount(); }
- bool AddSmiley(MCONTACT hContact, TCHAR *path);
- bool AddSmileyPack(MCONTACT hContact, TCHAR *dir);
+ bool AddSmiley(MCONTACT hContact, wchar_t *path);
+ bool AddSmileyPack(MCONTACT hContact, wchar_t *dir);
void ClearAndFreeAll(void) { m_SmileyPacks.destroy(); }
diff --git a/plugins/SmileyAdd/src/download.cpp b/plugins/SmileyAdd/src/download.cpp index b015c34603..2f45d51950 100644 --- a/plugins/SmileyAdd/src/download.cpp +++ b/plugins/SmileyAdd/src/download.cpp @@ -36,7 +36,7 @@ struct QueueElem static HANDLE g_hDlMutex;
static OBJLIST<QueueElem> dlQueue(10);
-static TCHAR cachepath[MAX_PATH];
+static wchar_t cachepath[MAX_PATH];
static bool threadRunning;
bool InternetDownloadFile(const char *szUrl, char *szDest, HANDLE &hHttpDwnl)
@@ -131,13 +131,13 @@ void __cdecl SmileyDownloadThread(void*) WaitForSingleObject(g_hDlMutex, 3000);
while (!Miranda_Terminated() && dlQueue.getCount()) {
ReleaseMutex(g_hDlMutex);
- if (_taccess(dlQueue[0].fname.c_str(), 0) != 0) {
+ if (_waccess(dlQueue[0].fname.c_str(), 0) != 0) {
InternetDownloadFile(_T2A(dlQueue[0].url.c_str()), _T2A(dlQueue[0].fname.c_str()), hHttpDwnl);
WaitForSingleObject(g_hDlMutex, 3000);
CMString fname(dlQueue[0].fname);
if (dlQueue[0].needext) { fname += GetImageExt(fname); needext = true; }
- _trename(dlQueue[0].fname.c_str(), fname.c_str());
+ _wrename(dlQueue[0].fname.c_str(), fname.c_str());
}
else WaitForSingleObject(g_hDlMutex, 3000);
@@ -175,8 +175,8 @@ bool GetSmileyFile(CMString &url, const CMString &packstr) if (needext)
filename += L".*";
- _tfinddata_t c_file;
- INT_PTR hFile = _tfindfirst((TCHAR*)filename.c_str(), &c_file);
+ _wfinddata_t c_file;
+ INT_PTR hFile = _wfindfirst((wchar_t*)filename.c_str(), &c_file);
if (hFile > -1) {
_findclose(hFile);
filename.Truncate(pathpos);
diff --git a/plugins/SmileyAdd/src/general.cpp b/plugins/SmileyAdd/src/general.cpp index 5a6b94ca63..0a27734c92 100644 --- a/plugins/SmileyAdd/src/general.cpp +++ b/plugins/SmileyAdd/src/general.cpp @@ -59,11 +59,11 @@ HICON GetDefaultIcon(bool copy) return resIco;
}
-const TCHAR* GetImageExt(CMString &fname)
+const wchar_t* GetImageExt(CMString &fname)
{
- const TCHAR *ext = L"";
+ const wchar_t *ext = L"";
- int fileId = _topen(fname.c_str(), O_RDONLY | _O_BINARY);
+ int fileId = _wopen(fname.c_str(), O_RDONLY | _O_BINARY);
if (fileId != -1) {
BYTE buf[6];
@@ -126,18 +126,18 @@ HICON ImageList_GetIconFixed(HIMAGELIST himl, INT i, UINT fStyle) void pathToRelative(const CMString &pSrc, CMString &pOut)
{
- TCHAR szOutPath[MAX_PATH];
+ wchar_t szOutPath[MAX_PATH];
PathToRelativeT(pSrc.c_str(), szOutPath);
pOut = szOutPath;
}
void pathToAbsolute(const CMString &pSrc, CMString &pOut)
{
- TCHAR szOutPath[MAX_PATH];
+ wchar_t szOutPath[MAX_PATH];
- TCHAR *szVarPath = Utils_ReplaceVarsT(pSrc.c_str());
- if (szVarPath == (TCHAR*)CALLSERVICE_NOTFOUND || szVarPath == NULL) {
- TCHAR szExpPath[MAX_PATH];
+ wchar_t *szVarPath = Utils_ReplaceVarsT(pSrc.c_str());
+ if (szVarPath == (wchar_t*)CALLSERVICE_NOTFOUND || szVarPath == NULL) {
+ wchar_t szExpPath[MAX_PATH];
ExpandEnvironmentStrings(pSrc.c_str(), szExpPath, _countof(szExpPath));
PathToAbsoluteT(szExpPath, szOutPath);
}
@@ -186,7 +186,7 @@ bool InitGdiPlus(void) {
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
- static const TCHAR errmsg[] = L"GDI+ not installed.\n"
+ static const wchar_t errmsg[] = L"GDI+ not installed.\n"
L"GDI+ can be downloaded here: http://www.microsoft.com/downloads";
__try {
@@ -227,9 +227,9 @@ bool IsSmileyProto(char *proto) return proto && mir_strcmp(proto, META_PROTO) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & (PF1_IM | PF1_CHAT));
}
-void ReportError(const TCHAR *errmsg)
+void ReportError(const wchar_t *errmsg)
{
- static const TCHAR title[] = L"Miranda SmileyAdd";
+ static const wchar_t title[] = L"Miranda SmileyAdd";
POPUPDATAT pd = { 0 };
mir_tstrcpy(pd.lpwzContactName, title);
diff --git a/plugins/SmileyAdd/src/imagecache.cpp b/plugins/SmileyAdd/src/imagecache.cpp index 1592a858fc..6960adff96 100644 --- a/plugins/SmileyAdd/src/imagecache.cpp +++ b/plugins/SmileyAdd/src/imagecache.cpp @@ -528,7 +528,7 @@ void DestroyImageCache(void) ImageBase* AddCacheImage(const CMString &file, int index)
{
CMString tmpfile(file); tmpfile.AppendFormat(L"#%d", index);
- unsigned id = mir_hash(tmpfile.c_str(), tmpfile.GetLength() * sizeof(TCHAR));
+ unsigned id = mir_hash(tmpfile.c_str(), tmpfile.GetLength() * sizeof(wchar_t));
WaitForSingleObject(g_hMutexIm, 3000);
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index 86264d591a..8466424240 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -204,7 +204,7 @@ BOOL OptionsDialogType::DialogProcedure(UINT msg, WPARAM wParam, LPARAM lParam) void OptionsDialogType::AddCategory(void)
{
- TCHAR cat[30];
+ wchar_t cat[30];
GetDlgItemText(m_hwndDialog, IDC_NEWCATEGORY, cat, _countof(cat));
CMString catd = cat;
@@ -327,7 +327,7 @@ void OptionsDialogType::PopulateSmPackList(void) SmileyCategoryListType::SmileyCategoryVectorType &smc = *tmpsmcat.GetSmileyCategoryList();
for (int i = 0; i < smc.getCount(); i++) {
if (smc[i].IsVisible()) {
- tvi.item.pszText = (TCHAR*)smc[i].GetDisplayName().c_str();
+ tvi.item.pszText = (wchar_t*)smc[i].GetDisplayName().c_str();
if (!smc[i].IsProto()) {
tvi.item.iImage = 0;
tvi.item.iSelectedImage = 0;
@@ -463,7 +463,7 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item) {
OPENFILENAME ofn = { 0 };
- TCHAR filename[MAX_PATH] = L"";
+ wchar_t filename[MAX_PATH] = L"";
ofn.lpstrFile = filename;
ofn.nMaxFile = _countof(filename);
@@ -480,7 +480,7 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item) ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = m_hwndDialog;
- TCHAR filter[512], *pfilter;
+ wchar_t filter[512], *pfilter;
mir_tstrcpy(filter, TranslateT("Smiley packs"));
mir_tstrcat(filter, L" (*.msl;*.asl;*.xep)");
pfilter = filter + mir_tstrlen(filter) + 1;
@@ -511,7 +511,7 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item) void OptionsDialogType::FilenameChanged(void)
{
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
GetDlgItemText(m_hwndDialog, IDC_FILENAME, str, _countof(str));
SmileyCategoryType *smc = tmpsmcat.GetSmileyCategory(GetSelProto());
@@ -593,7 +593,7 @@ void OptionsType::ReadPackFileName(CMString &filename, const CMString &name, con CMString settingKey = name + L"-filename";
ptrT tszValue(db_get_tsa(NULL, "SmileyAdd", _T2A(settingKey.c_str())));
- filename = (tszValue != NULL) ? (TCHAR*)tszValue : defaultFilename;
+ filename = (tszValue != NULL) ? (wchar_t*)tszValue : defaultFilename;
}
void OptionsType::WritePackFileName(const CMString &filename, const CMString &name)
diff --git a/plugins/SmileyAdd/src/richcall.cpp b/plugins/SmileyAdd/src/richcall.cpp index 9e994418ea..92a556a81c 100644 --- a/plugins/SmileyAdd/src/richcall.cpp +++ b/plugins/SmileyAdd/src/richcall.cpp @@ -97,7 +97,7 @@ static void SetPosition(HWND hwnd) static void SetTooltip(long x, long y, HWND hwnd, RichEditData *rdt)
{
- TCHAR *smltxt;
+ wchar_t *smltxt;
int needtip = CheckForTip(x, y, hwnd, &smltxt);
if (needtip == rdt->tipActive)
return;
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index c0d453624c..1abad18364 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -301,7 +301,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) const int ind = i + 3;
mi.position = ind;
- mi.name.t = (TCHAR*)smc[i].GetDisplayName().c_str();
+ mi.name.w = (wchar_t*)smc[i].GetDisplayName().c_str();
if (cat == smc[i].GetName()) {
mi.flags |= CMIF_CHECKED;
@@ -315,7 +315,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) }
mi.position = 1;
- mi.name.t = L"<None>";
+ mi.name.w = L"<None>";
if (cat == L"<None>") {
mi.flags |= CMIF_CHECKED;
nonecheck = false;
@@ -326,7 +326,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) menuHandleArray.insert(hMenu);
mi.position = 2;
- mi.name.t = LPGENT("Protocol specific");
+ mi.name.w = LPGENW("Protocol specific");
if (nonecheck) mi.flags |= CMIF_CHECKED; else mi.flags &= ~CMIF_CHECKED;
hMenu = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/SmileyAdd/src/smileyroutines.cpp b/plugins/SmileyAdd/src/smileyroutines.cpp index d71a91fed0..e6d7dfd7ed 100644 --- a/plugins/SmileyAdd/src/smileyroutines.cpp +++ b/plugins/SmileyAdd/src/smileyroutines.cpp @@ -19,6 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h"
+#include <tchar.h>
+
ISmileyBase* CreateSmileyObject(SmileyType *sml);
ISmileyBase* CreateAniSmileyObject(SmileyType *sml, COLORREF clr, bool ishpp);
@@ -29,7 +31,7 @@ bool g_HiddenTextSupported = true; const GUID IID_ITextDocument =
{ 0x8CC497C0, 0xA1DF, 0x11CE, { 0x80,0x98,0x00,0xAA,0x00,0x47,0xBE,0x5D } };
-void LookupAllSmileys(SmileyPackType *smileyPack, SmileyPackCType *smileyCPack, const TCHAR *lpstrText, SmileysQueueType &smllist, const bool firstOnly)
+void LookupAllSmileys(SmileyPackType *smileyPack, SmileyPackCType *smileyCPack, const wchar_t *lpstrText, SmileysQueueType &smllist, const bool firstOnly)
{
if (lpstrText == NULL || *lpstrText == 0) return;
@@ -98,20 +100,20 @@ void LookupAllSmileys(SmileyPackType *smileyPack, SmileyPackCType *smileyCPack, ReplaceSmileyType *dat = new ReplaceSmileyType;
- const TCHAR *textToSearch = lpstrText + smloff;
- const TCHAR *textSmlStart = lpstrText + (*smlf)[firstSmlRef].pos;
- const TCHAR *textSmlEnd = textSmlStart + (*smlf)[firstSmlRef].len;
+ const wchar_t *textToSearch = lpstrText + smloff;
+ const wchar_t *textSmlStart = lpstrText + (*smlf)[firstSmlRef].pos;
+ const wchar_t *textSmlEnd = textSmlStart + (*smlf)[firstSmlRef].len;
// check if leading space exist
- const TCHAR *prech = _tcsdec(textToSearch, textSmlStart);
- dat->ldspace = prech != NULL ? _istspace(*prech) != 0 : smloff == 0;
+ const wchar_t *prech = _wcsdec(textToSearch, textSmlStart);
+ dat->ldspace = prech != NULL ? iswspace(*prech) != 0 : smloff == 0;
// check if trailing space exist
- dat->trspace = *textSmlEnd == 0 || _istspace(*textSmlEnd);
+ dat->trspace = *textSmlEnd == 0 || iswspace(*textSmlEnd);
// compute text location in RichEdit
- dat->loc.cpMin = (long)_tcsnccnt(textToSearch, (*smlf)[firstSmlRef].pos - smloff) + numCharsSoFar;
- dat->loc.cpMax = numCharsSoFar = (long)_tcsnccnt(textSmlStart, (*smlf)[firstSmlRef].len) + dat->loc.cpMin;
+ dat->loc.cpMin = (long)_wcsncnt(textToSearch, (*smlf)[firstSmlRef].pos - smloff) + numCharsSoFar;
+ dat->loc.cpMax = numCharsSoFar = (long)_wcsncnt(textSmlStart, (*smlf)[firstSmlRef].len) + dat->loc.cpMin;
if (!opt.EnforceSpaces || (dat->ldspace && dat->trspace)) {
dat->ldspace |= !opt.SurroundSmileyWithSpaces;
@@ -143,7 +145,7 @@ void LookupAllSmileys(SmileyPackType *smileyPack, SmileyPackCType *smileyCPack, }
-void FindSmileyInText(SmileyPackType *smp, const TCHAR *str, unsigned &first, unsigned &size, SmileyType **sml)
+void FindSmileyInText(SmileyPackType *smp, const wchar_t *str, unsigned &first, unsigned &size, SmileyType **sml)
{
SmileysQueueType smllist;
LookupAllSmileys(smp, NULL, str, smllist, true);
@@ -221,9 +223,9 @@ void ReplaceSmileys(HWND hwnd, SmileyPackType *smp, SmileyPackCType *smcp, const // disable screen updates
TextDocument->Freeze(&cnt);
- TCHAR classname[20];
+ wchar_t classname[20];
GetClassName(hwnd, classname, _countof(classname));
- bool ishpp = (_tcsncmp(classname, L"THppRichEdit", 12) == 0) || fireView;
+ bool ishpp = (wcsncmp(classname, L"THppRichEdit", 12) == 0) || fireView;
SetRichCallback(hwnd, NULL, false, true);
diff --git a/plugins/SmileyAdd/src/smileyroutines.h b/plugins/SmileyAdd/src/smileyroutines.h index 93b00cb08e..2507afc11e 100644 --- a/plugins/SmileyAdd/src/smileyroutines.h +++ b/plugins/SmileyAdd/src/smileyroutines.h @@ -34,10 +34,10 @@ typedef SMOBJLIST<ReplaceSmileyType> SmileysQueueType; -void LookupAllSmileys(SmileyPackType *smileyPack, SmileyPackCType *smileyCPack, const TCHAR *lpstrText, SmileysQueueType &smllist, const bool firstOnly);
+void LookupAllSmileys(SmileyPackType *smileyPack, SmileyPackCType *smileyCPack, const wchar_t *lpstrText, SmileysQueueType &smllist, const bool firstOnly);
void ReplaceSmileys(HWND hwnd, SmileyPackType *smp, SmileyPackCType *smcp, const CHARRANGE &sel, bool useHidden, bool ignoreLast, bool unFreeze, bool fireView = 0);
void ReplaceSmileysWithText(HWND hwnd, CHARRANGE &sel, bool keepFrozen);
-void FindSmileyInText(SmileyPackType *smp, const TCHAR *str, unsigned &first, unsigned &size, SmileyType **index);
+void FindSmileyInText(SmileyPackType *smp, const wchar_t *str, unsigned &first, unsigned &size, SmileyType **index);
SmileyType* FindButtonSmiley(SmileyPackType *smp);
#endif
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 97c63f00a5..7024c5ed97 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -208,14 +208,14 @@ SmileyType* SmileyPackType::GetSmiley(unsigned index) return (index < (unsigned)m_SmileyList.getCount()) ? &m_SmileyList[index] : NULL;
}
-static DWORD_PTR ConvertServiceParam(MCONTACT hContact, const TCHAR *param)
+static DWORD_PTR ConvertServiceParam(MCONTACT hContact, const wchar_t *param)
{
if (param == NULL)
return 0;
if (mir_tstrcmpi(L"hContact", param) == 0)
return hContact;
- if (_istdigit(*param))
- return _ttoi(param);
+ if (iswdigit(*param))
+ return _wtoi(param);
return (DWORD_PTR)param;
}
@@ -253,10 +253,10 @@ SmileyPackType::~SmileyPackType() if (m_hSmList != NULL) ImageList_Destroy(m_hSmList);
}
-static const TCHAR urlRegEx[] =
+static const wchar_t urlRegEx[] =
L"(?:ftp|https|http|file|aim|webcal|irc|msnim|xmpp|gopher|mailto|news|nntp|telnet|wais|prospero)://?[\\w.?%:/$+;]*";
-static const TCHAR pathRegEx[] = L"[\\s\"][a-zA-Z]:[\\\\/][\\w.\\-\\\\/]*";
-static const TCHAR timeRegEx[] = L"\\d{1,2}:\\d{2}:\\d{2}|\\d{1,2}:\\d{2}";
+static const wchar_t pathRegEx[] = L"[\\s\"][a-zA-Z]:[\\\\/][\\w.\\-\\\\/]*";
+static const wchar_t timeRegEx[] = L"\\d{1,2}:\\d{2}:\\d{2}|\\d{1,2}:\\d{2}";
void SmileyPackType::AddTriggersToSmileyLookup(void)
{
@@ -354,11 +354,11 @@ bool SmileyPackType::LoadSmileyFile(const CMString &filename, const CMString &pa pathToAbsolute(filename, modpath);
// Load xep file
- int fh = _topen(modpath.c_str(), _O_BINARY | _O_RDONLY);
+ int fh = _wopen(modpath.c_str(), _O_BINARY | _O_RDONLY);
if (fh == -1) {
if (!noerr) {
- static const TCHAR errmsg[] = LPGENT("Smiley pack %s for category \"%s\" not found.\nSelect correct smiley pack in the Options -> Customize -> Smileys.");
- TCHAR msgtxt[1024];
+ static const wchar_t errmsg[] = LPGENW("Smiley pack %s for category \"%s\" not found.\nSelect correct smiley pack in the Options -> Customize -> Smileys.");
+ wchar_t msgtxt[1024];
mir_sntprintf(msgtxt, TranslateTS(errmsg), modpath.c_str(), packname);
ReportError(msgtxt);
}
@@ -443,8 +443,8 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & _TMatcher *m0 = pat->createTMatcher(tbuf);
while (m0->findNextMatch()) {
POINT tpt;
- tpt.x = _ttol(m0->getGroup(2).c_str());
- tpt.y = _ttol(m0->getGroup(3).c_str());
+ tpt.x = _wtol(m0->getGroup(2).c_str());
+ tpt.y = _wtol(m0->getGroup(3).c_str());
if (m0->getGroup(1) == L"Selection")
selec = tpt;
@@ -479,7 +479,7 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & SmileyType *dat = new SmileyType;
- const int iconIndex = _ttol(m0->getGroup(3).c_str());
+ const int iconIndex = _wtol(m0->getGroup(3).c_str());
dat->SetHidden(m0->getStartingIndex(1) >= 0);
if (m0->getStartingIndex(4) >= 0) {
@@ -517,8 +517,8 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & m_SmileyList.insert(dat);
if (!noerr) {
- static const TCHAR errmsg[] = LPGENT("Smiley #%u in file %s for smiley pack %s not found.");
- TCHAR msgtxt[1024];
+ static const wchar_t errmsg[] = LPGENW("Smiley #%u in file %s for smiley pack %s not found.");
+ wchar_t msgtxt[1024];
mir_sntprintf(msgtxt, TranslateTS(errmsg), smnum, resname.c_str(), modpath.c_str());
CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, _T2A(msgtxt));
errorFound = true;
@@ -642,7 +642,7 @@ bool SmileyPackType::LoadSmileyFileXEP(CMString &tbuf, bool onlyInfo, CMString&) SmileyType *dat = new SmileyType;
dat->SetRegEx(true);
- dat->SetImList(m_hSmList, _ttol(m0->getGroup(1).c_str()));
+ dat->SetImList(m_hSmList, _wtol(m0->getGroup(1).c_str()));
dat->m_ToolText = m0->getGroup(2);
DecodeHTML(dat->m_ToolText);
@@ -897,7 +897,7 @@ void SmileyCategoryListType::AddAccountAsCategory(PROTOACCOUNT *acc, const CMStr CMString patha;
pathToAbsolute(paths, patha);
- if (_taccess(patha.c_str(), 0) != 0)
+ if (_waccess(patha.c_str(), 0) != 0)
paths = defaultFile;
}
@@ -923,7 +923,7 @@ void SmileyCategoryListType::AddProtoAsCategory(char *acc, const CMString &defau CMString paths = _A2T(path), patha;
pathToAbsolute(paths, patha);
- if (_taccess(patha.c_str(), 0) != 0)
+ if (_waccess(patha.c_str(), 0) != 0)
paths = defaultFile;
CMString dName(acc), displayName;
displayName.AppendFormat(TranslateT("%s global smiley pack"), dName.GetBuffer());
@@ -995,7 +995,7 @@ void SmileyCategoryListType::AddContactTransportAsCategory(MCONTACT hContact, co CMString paths = _A2T(path), patha;
pathToAbsolute(paths, patha);
- if (_taccess(patha.c_str(), 0) != 0)
+ if (_waccess(patha.c_str(), 0) != 0)
paths = defaultFile;
AddCategory(displayName, displayName, smcTransportProto, paths);
@@ -1055,7 +1055,7 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void) SmileyLookup::SmileyLookup(const CMString &str, const bool regexs, const int ind, const CMString &smpt)
{
- TCHAR msgtxt[1024];
+ wchar_t msgtxt[1024];
m_ind = ind;
if (regexs) {
@@ -1067,13 +1067,13 @@ SmileyLookup::SmileyLookup(const CMString &str, const bool regexs, const int ind m_valid &= (!matcher->findFirstMatch() ||
matcher->getStartingIndex() != matcher->getEndingIndex());
if (!m_valid) {
- static const TCHAR errmsg[] = LPGENT("Regular expression \"%s\" in smiley pack \"%s\" could produce \"empty matches\".");
+ static const wchar_t errmsg[] = LPGENW("Regular expression \"%s\" in smiley pack \"%s\" could produce \"empty matches\".");
mir_sntprintf(msgtxt, TranslateTS(errmsg), str.c_str(), smpt.c_str());
}
delete matcher;
}
else {
- static const TCHAR errmsg[] = LPGENT("Regular expression \"%s\" in smiley pack \"%s\" malformed.");
+ static const wchar_t errmsg[] = LPGENW("Regular expression \"%s\" in smiley pack \"%s\" malformed.");
mir_sntprintf(msgtxt, TranslateTS(errmsg), str.c_str(), smpt.c_str());
}
@@ -1112,8 +1112,8 @@ void SmileyLookup::Find(const CMString &str, SmileyLocVecType &smlcur, bool firs delete matcher;
}
else {
- const TCHAR *pos = str.c_str();
- while ((pos = _tcsstr(pos, m_text.c_str())) != NULL) {
+ const wchar_t *pos = str.c_str();
+ while ((pos = wcsstr(pos, m_text.c_str())) != NULL) {
smlcur.insert(new SmileyLocType(pos - str.c_str(), m_text.GetLength()));
pos += m_text.GetLength();
if (firstOnly && m_ind != -1)
diff --git a/plugins/SmileyAdd/src/smileys.h b/plugins/SmileyAdd/src/smileys.h index 765480e123..cba4999442 100644 --- a/plugins/SmileyAdd/src/smileys.h +++ b/plugins/SmileyAdd/src/smileys.h @@ -69,7 +69,7 @@ public: bool IsSound(void) const { return (m_flags & SoundSmiley) != 0; }
bool IsText(void) const { return (m_flags & TextSmiley) != 0; }
- bool IsFileFound(void) { return _taccess(m_filepath.c_str(), 0) == 0; }
+ bool IsFileFound(void) { return _waccess(m_filepath.c_str(), 0) == 0; }
bool IsValid(void) { return m_size.cx != 0; }
ImageBase* CreateCachedImage(void);
@@ -203,7 +203,7 @@ public: SmileyType* GetSmiley(unsigned index);
- const TCHAR* GetButtonSmiley(void) const { return m_ButtonSmiley.c_str(); }
+ const wchar_t* GetButtonSmiley(void) const { return m_ButtonSmiley.c_str(); }
bool LoadSmileyFile(const CMString &filename, const CMString &packname, bool onlyInfo, bool noerr = false);
diff --git a/plugins/SmileyAdd/src/smltool.cpp b/plugins/SmileyAdd/src/smltool.cpp index d427c47644..8db7726c1f 100644 --- a/plugins/SmileyAdd/src/smltool.cpp +++ b/plugins/SmileyAdd/src/smltool.cpp @@ -236,7 +236,7 @@ void SmileyToolWindowType::SmileySel(int but) ti.uId = (UINT_PTR)m_hwndDialog;
const CMString &toolText = m_pSmileyPack->GetSmiley(m_CurrentHotTrack)->GetToolText();
- ti.lpszText = const_cast<TCHAR*>(toolText.c_str());
+ ti.lpszText = const_cast<wchar_t*>(toolText.c_str());
SendMessage(m_hToolTip, TTM_UPDATETIPTEXT, 0, (LPARAM)&ti);
SendMessage(m_hToolTip, TTM_ACTIVATE, TRUE, 0);
diff --git a/plugins/SmileyAdd/src/stdafx.h b/plugins/SmileyAdd/src/stdafx.h index 3f9d130e8e..4599a5a6f3 100644 --- a/plugins/SmileyAdd/src/stdafx.h +++ b/plugins/SmileyAdd/src/stdafx.h @@ -120,7 +120,7 @@ int UpdateSrmmDlg(WPARAM wParam, LPARAM lParam); //functions for general use (defined in general.cpp)
int CalculateTextHeight(HDC hdc, CHARFORMAT2 *chf);
-const TCHAR* GetImageExt(CMString &fname);
+const wchar_t* GetImageExt(CMString &fname);
MCONTACT DecodeMetaContact(MCONTACT hContact);
bool IsSmileyProto(char *proto);
@@ -133,7 +133,7 @@ void pathToAbsolute(const CMString &pSrc, CMString &pOut); bool InitGdiPlus(void);
void DestroyGdiPlus(void);
-void ReportError(const TCHAR *errmsg);
+void ReportError(const wchar_t *errmsg);
HICON GetDefaultIcon(bool copy = true);
void CloseRichCallback(HWND hwnd);
@@ -144,7 +144,7 @@ void ProcessAllInputAreas(bool restoreText); void RichEditData_Destroy(void);
void CloseSmileys(void);
-int CheckForTip(int x, int y, HWND hwnd, TCHAR **smltxt);
+int CheckForTip(int x, int y, HWND hwnd, wchar_t **smltxt);
void UrlDecode(char *str);
diff --git a/plugins/Spamotron/src/bayes.cpp b/plugins/Spamotron/src/bayes.cpp index d6d582a59b..aa377760a7 100644 --- a/plugins/Spamotron/src/bayes.cpp +++ b/plugins/Spamotron/src/bayes.cpp @@ -177,7 +177,7 @@ int get_token_score(int type, char *token) return score;
}
-double get_msg_score(TCHAR *msg)
+double get_msg_score(wchar_t *msg)
{
char *message, *token;
double spam_prob, ham_prob, tmp1 = 1, tmp2 = 1;
@@ -220,7 +220,7 @@ double get_msg_score(TCHAR *msg) return tmp1 / (tmp1 + tmp2);
}
-void queue_message(MCONTACT hContact, DWORD msgtime, TCHAR *message)
+void queue_message(MCONTACT hContact, DWORD msgtime, wchar_t *message)
{
char *tmp;
sqlite3_stmt *stmt;
@@ -247,7 +247,7 @@ void queue_message(MCONTACT hContact, DWORD msgtime, TCHAR *message) void bayes_approve_contact(MCONTACT hContact)
{
const char *message;
- TCHAR *messageW;
+ wchar_t *messageW;
int d = 0;
sqlite3_stmt *stmt;
@@ -279,7 +279,7 @@ void dequeue_messages() time_t t = time(NULL);
sqlite3_stmt *stmt;
const char *message;
- TCHAR *messageW;
+ wchar_t *messageW;
int d = 0;
if (bayesdb == NULL)
@@ -306,7 +306,7 @@ void dequeue_messages() }
/* Learn one message as either SPAM or HAM as specified in type parameter */
-void learn(int type, TCHAR *msg)
+void learn(int type, wchar_t *msg)
{
char *tok, *message;
BYTE digest[16];
@@ -375,12 +375,12 @@ void learn(int type, TCHAR *msg) mir_free(message);
}
-void learn_ham(TCHAR *msg)
+void learn_ham(wchar_t *msg)
{
learn(0, msg);
}
-void learn_spam(TCHAR *msg)
+void learn_spam(wchar_t *msg)
{
learn(1, msg);
}
\ No newline at end of file diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index 5bf7c8a4d6..7f20587abc 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -1,31 +1,31 @@ #include "stdafx.h"
-TCHAR currentResponse[256] = {0};
+wchar_t currentResponse[256] = {0};
-TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, MCONTACT hContact, const char* option, const TCHAR *def)
+wchar_t* _getCOptS(wchar_t *buf, unsigned int buflen, MCONTACT hContact, const char* option, const wchar_t *def)
{
DBVARIANT dbv = {0};
_tcsnset(buf, 0, buflen);
if (db_get_ts(hContact, PLUGIN_NAME, option, &dbv) != 0)
- _tcsncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
+ wcsncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
else if (dbv.type == DBVT_TCHAR) {
- _tcsncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
+ wcsncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
}
db_free(&dbv);
return buf;
}
-TCHAR* _getMOptS(TCHAR *buf, unsigned int buflen, const char* module, const char* option, const TCHAR *def)
+wchar_t* _getMOptS(wchar_t *buf, unsigned int buflen, const char* module, const char* option, const wchar_t *def)
{
- TCHAR* tmp;
+ wchar_t* tmp;
DBVARIANT dbv = {0};
_tcsnset(buf, 0, buflen);
if (db_get_s(NULL, module, option, &dbv) != 0)
- _tcsncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
+ wcsncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
else if (dbv.type == DBVT_TCHAR) {
- _tcsncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
+ wcsncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
} else {
tmp = mir_a2u(dbv.pszVal);
- _tcsncpy(buf, tmp, min(buflen, mir_tstrlen(tmp)+1));
+ wcsncpy(buf, tmp, min(buflen, mir_tstrlen(tmp)+1));
mir_free(tmp);
}
db_free(&dbv);
@@ -36,9 +36,9 @@ TCHAR* _getMOptS(TCHAR *buf, unsigned int buflen, const char* module, const char BOOL _saveDlgItemText(HWND hDialog, int controlID, char* option)
{
int len;
- TCHAR *tmp;
+ wchar_t *tmp;
len = GetWindowTextLength(GetDlgItem(hDialog, controlID));
- tmp = (TCHAR *)malloc((len + 1)*sizeof(TCHAR));
+ tmp = (wchar_t *)malloc((len + 1)*sizeof(wchar_t));
GetDlgItemText(hDialog, controlID, tmp, len + 1);
_setOptTS(option, tmp);
free(tmp);
@@ -49,9 +49,9 @@ int _saveDlgItemResponse(HWND hDialog, int controlID, char* option) int ret = 0;
int isRegex = 0;
int len;
- TCHAR *tmp;
+ wchar_t *tmp;
len = GetWindowTextLength(GetDlgItem(hDialog, controlID));
- tmp = (TCHAR*)malloc((len+1)*sizeof(TCHAR));
+ tmp = (wchar_t*)malloc((len+1)*sizeof(wchar_t));
GetDlgItemText(hDialog, controlID, tmp, len+1);
isRegex = _isregex(tmp);
if (!isRegex)
@@ -68,20 +68,20 @@ int _saveDlgItemResponse(HWND hDialog, int controlID, char* option) BOOL _saveDlgItemInt(HWND hDialog, int controlID, char* option)
{
int len;
- TCHAR *tmp;
+ wchar_t *tmp;
len = GetWindowTextLength(GetDlgItem(hDialog, controlID));
- tmp = (TCHAR *)malloc((len + 1)*sizeof(TCHAR));
+ tmp = (wchar_t *)malloc((len + 1)*sizeof(wchar_t));
GetDlgItemText(hDialog, controlID, tmp, len + 1);
- _setOptD(option, _ttoi(tmp));
+ _setOptD(option, _wtoi(tmp));
free(tmp);
return TRUE;
}
BOOL _saveDlgItemScore(HWND hDialog, int controlID, char* option)
{
int len;
- TCHAR *tmp;
+ wchar_t *tmp;
len = GetWindowTextLength(GetDlgItem(hDialog, controlID));
- tmp = (TCHAR *)malloc((len + 1)*sizeof(TCHAR));
+ tmp = (wchar_t *)malloc((len + 1)*sizeof(wchar_t));
GetDlgItemText(hDialog, controlID, tmp, len + 1);
_setOptD(option, _tcstod(tmp, NULL)/SCORE_C);
return TRUE;
@@ -93,12 +93,12 @@ INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM {
static int bInitializing = 0, i, j, numProtocols;
PROTOACCOUNT **pd;
- TCHAR pName[256] = {0};
+ wchar_t pName[256] = {0};
char protoOption[256] = {0};
HWND hProtocolsList = GetDlgItem(optDlg, IDC_OPT_PROTOCOLS);
LVITEM lvi = {0};
LVCOLUMN lvc = {0};
- TCHAR buf[512];
+ wchar_t buf[512];
switch (msg) {
case WM_INITDIALOG:
@@ -115,8 +115,8 @@ INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM CheckDlgButton(optDlg, IDC_OPT_LOG_ACTIONS, _getOptB("LogActions", defaultLogActions) ? BST_CHECKED : BST_UNCHECKED);
SetDlgItemText(optDlg, IDC_OPT_IN_MSG_APPROVE_WORDLIST, _getOptS(buf, _countof(buf), "ApproveOnMsgInWordlist", defaultApproveOnMsgInWordlist));
- SetDlgItemText(optDlg, IDC_OPT_MAX_MSG_CONTACT, _itot((unsigned int)_getOptD("MaxMsgContactCountPerDay", defaultMaxMsgContactCountPerDay), buf, 10));
- SetDlgItemText(optDlg, IDC_OPT_MAX_SAME_MSG, _itot((unsigned int)_getOptD("MaxSameMsgCountPerDay", defaultMaxSameMsgCountPerDay), buf, 10));
+ SetDlgItemText(optDlg, IDC_OPT_MAX_MSG_CONTACT, _itow((unsigned int)_getOptD("MaxMsgContactCountPerDay", defaultMaxMsgContactCountPerDay), buf, 10));
+ SetDlgItemText(optDlg, IDC_OPT_MAX_SAME_MSG, _itow((unsigned int)_getOptD("MaxSameMsgCountPerDay", defaultMaxSameMsgCountPerDay), buf, 10));
SetDlgItemText(optDlg, IDC_OPT_DONT_REPLY_MSG_WORDLIST, _getOptS(buf, _countof(buf), "DontReplyMsgWordlist", defaultDontReplyMsgWordlist));
///Individual protocols list
@@ -129,7 +129,7 @@ INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM for (i = 0, j = 0; i < numProtocols; i++)
{
lvi.iItem = i;
- _getMOptS(pName, 200*sizeof(TCHAR), pd[i]->szModuleName, "AM_BaseProto", L"");
+ _getMOptS(pName, 200*sizeof(wchar_t), pd[i]->szModuleName, "AM_BaseProto", L"");
if (mir_tstrcmp(pName, L"ICQ") != 0)
continue;
lvi.pszText = mir_a2u(pd[i]->szModuleName);
@@ -217,7 +217,7 @@ INT_PTR CALLBACK DlgProcOptionsQuestion(HWND optDlg, UINT msg, WPARAM wParam, LP static int bInitializing = 0;
int i, selectedMode;
HWND ht;
- TCHAR *buf;
+ wchar_t *buf;
unsigned int buflen = 500;
switch (msg) {
@@ -243,7 +243,7 @@ INT_PTR CALLBACK DlgProcOptionsQuestion(HWND optDlg, UINT msg, WPARAM wParam, LP }
}
SetDlgItemText(optDlg, IDC_OPT_MATH_RESPONSE, TranslateT("Will be automatically evaluated from %mathexpr%"));
- buf = (TCHAR *)malloc(buflen*sizeof(TCHAR));
+ buf = (wchar_t *)malloc(buflen*sizeof(wchar_t));
switch (selectedMode) {
case SPAMOTRON_MODE_PLAIN:
case SPAMOTRON_MODE_ROTATE:
@@ -289,7 +289,7 @@ INT_PTR CALLBACK DlgProcOptionsQuestion(HWND optDlg, UINT msg, WPARAM wParam, LP return FALSE;
i = SendDlgItemMessage(optDlg, IDC_OPT_MODE, CB_GETCURSEL, 0, 0);
selectedMode = SendDlgItemMessage(optDlg, IDC_OPT_MODE, CB_GETITEMDATA, i, 0);
- buf = (TCHAR*)malloc(buflen*sizeof(TCHAR));
+ buf = (wchar_t*)malloc(buflen*sizeof(wchar_t));
switch (selectedMode) {
case SPAMOTRON_MODE_PLAIN:
case SPAMOTRON_MODE_ROTATE:
@@ -418,8 +418,8 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA {
static int bInitializing = 0, len;
BOOL bEnabled;
- TCHAR *dbuf;
- TCHAR buf[MAX_BUFFER_LENGTH];
+ wchar_t *dbuf;
+ wchar_t buf[MAX_BUFFER_LENGTH];
char cbuf[MAX_BUFFER_LENGTH];
switch (msg) {
case WM_INITDIALOG:
@@ -482,7 +482,7 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA case IDC_OPT_BAYES_HAM:
// Learn ham from learnbox
len = GetWindowTextLength(GetDlgItem(optDlg, IDC_OPT_BAYES_LEARNBOX))+1;
- dbuf = (TCHAR *)malloc(len*sizeof(TCHAR));
+ dbuf = (wchar_t *)malloc(len*sizeof(wchar_t));
if (!dbuf)
return FALSE;
GetDlgItemText(optDlg, IDC_OPT_BAYES_LEARNBOX, dbuf, len);
@@ -499,7 +499,7 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA case IDC_OPT_BAYES_SPAM:
// Learn spam from learnbox
len = GetWindowTextLength(GetDlgItem(optDlg, IDC_OPT_BAYES_LEARNBOX))+1;
- dbuf = (TCHAR *)malloc(len*sizeof(TCHAR));
+ dbuf = (wchar_t *)malloc(len*sizeof(wchar_t));
if (!dbuf)
return FALSE;
GetDlgItemText(optDlg, IDC_OPT_BAYES_LEARNBOX, dbuf, len);
@@ -515,7 +515,7 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA case IDC_CHECK_MSG:
len = GetWindowTextLength(GetDlgItem(optDlg, IDC_OPT_BAYES_LEARNBOX))+1;
- dbuf = (TCHAR *)malloc((len)*sizeof(TCHAR));
+ dbuf = (wchar_t *)malloc((len)*sizeof(wchar_t));
if (!dbuf)
return FALSE;
GetDlgItemText(optDlg, IDC_OPT_BAYES_LEARNBOX, dbuf, len);
@@ -556,21 +556,21 @@ int OnOptInitialize(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("Message sessions");
- odp.ptszTitle = _T(PLUGIN_NAME);
+ odp.pwszGroup = LPGENW("Message sessions");
+ odp.pwszTitle = _T(PLUGIN_NAME);
odp.flags = ODPF_TCHAR | ODPF_BOLDGROUPS;
- odp.ptszTab = LPGENT("Settings");
+ odp.pwszTab = LPGENW("Settings");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_SPAMOTRON_MAIN);
odp.pfnDlgProc = DlgProcOptionsMain;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Messages");
+ odp.pwszTab = LPGENW("Messages");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_SPAMOTRON_Q);
odp.pfnDlgProc = DlgProcOptionsQuestion;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Bayes");
+ odp.pwszTab = LPGENW("Bayes");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_SPAMOTRON_BAYES);
odp.pfnDlgProc = DlgProcOptionsBayes;
Options_AddPage(wParam, &odp);
@@ -578,8 +578,8 @@ int OnOptInitialize(WPARAM wParam, LPARAM) if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_SPAMOTRON_POPUPS);
odp.pfnDlgProc = DlgProcOptionsPopups;
- odp.ptszGroup = LPGENT("Popups");
- odp.ptszTab = NULL;
+ odp.pwszGroup = LPGENW("Popups");
+ odp.pwszTab = NULL;
Options_AddPage(wParam, &odp);
}
return 0;
diff --git a/plugins/Spamotron/src/popups.cpp b/plugins/Spamotron/src/popups.cpp index 46289ac9af..0d81268d04 100644 --- a/plugins/Spamotron/src/popups.cpp +++ b/plugins/Spamotron/src/popups.cpp @@ -143,7 +143,7 @@ INT_PTR CALLBACK DlgProcOptionsPopups(HWND optDlg, UINT msg, WPARAM wParam, LPAR return FALSE;
}
-int ShowPopupPreview(HWND optDlg, BYTE popupType, TCHAR *line1, TCHAR *line2)
+int ShowPopupPreview(HWND optDlg, BYTE popupType, wchar_t *line1, wchar_t *line2)
{
POPUPDATAT ppdp = {0};
switch (popupType)
@@ -185,14 +185,14 @@ int ShowPopupPreview(HWND optDlg, BYTE popupType, TCHAR *line1, TCHAR *line2) ppdp.iSeconds = 0;
ppdp.lchContact = NULL;
- _tcsncpy_s(ppdp.lptzContactName, (line1 ? line1 : _T(PLUGIN_NAME)), _TRUNCATE);
+ wcsncpy_s(ppdp.lptzContactName, (line1 ? line1 : _T(PLUGIN_NAME)), _TRUNCATE);
if (line2)
- _tcsncpy_s(ppdp.lptzText, line2, _TRUNCATE);
+ wcsncpy_s(ppdp.lptzText, line2, _TRUNCATE);
return PUAddPopupT(&ppdp);
}
-int ShowPopup(MCONTACT hContact, BYTE popupType, TCHAR *line1, TCHAR *line2)
+int ShowPopup(MCONTACT hContact, BYTE popupType, wchar_t *line1, wchar_t *line2)
{
POPUPDATAT ppdp = {0};
switch (popupType)
@@ -234,8 +234,8 @@ int ShowPopup(MCONTACT hContact, BYTE popupType, TCHAR *line1, TCHAR *line2) ppdp.iSeconds = 0;
ppdp.lchContact = hContact;
- _tcsncpy_s(ppdp.lptzContactName, (line1 ? line1 : _T(PLUGIN_NAME)), _TRUNCATE);
+ wcsncpy_s(ppdp.lptzContactName, (line1 ? line1 : _T(PLUGIN_NAME)), _TRUNCATE);
if (line2)
- _tcsncpy_s(ppdp.lptzText, line2, _TRUNCATE);
+ wcsncpy_s(ppdp.lptzText, line2, _TRUNCATE);
return PUAddPopupT(&ppdp);
}
\ No newline at end of file diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp index dceac13a6e..a96cc0551b 100644 --- a/plugins/Spamotron/src/spamotron.cpp +++ b/plugins/Spamotron/src/spamotron.cpp @@ -42,10 +42,10 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) char *msgblob;
char protoOption[256] = {0};
int buflen = MAX_BUFFER_LENGTH;
- TCHAR buf[MAX_BUFFER_LENGTH];
- TCHAR *message = NULL, *challengeW = NULL, *tmpW = NULL;
- TCHAR *whitelist = NULL, *ptok;
- TCHAR mexpr[64];
+ wchar_t buf[MAX_BUFFER_LENGTH];
+ wchar_t *message = NULL, *challengeW = NULL, *tmpW = NULL;
+ wchar_t *whitelist = NULL, *ptok;
+ wchar_t mexpr[64];
int maxmsglen = 0, a, b, i;
BOOL bayesEnabled = _getOptB("BayesEnabled", defaultBayesEnabled);
BOOL bCorrectResponse = FALSE;
@@ -132,20 +132,20 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) /*** Check for words in white-list ***/
if (_getOptB("ApproveOnMsgIn", defaultApproveOnMsgIn)) {
- whitelist = (TCHAR*)malloc(2048 * sizeof(TCHAR));
+ whitelist = (wchar_t*)malloc(2048 * sizeof(wchar_t));
if (whitelist != NULL) {
_getOptS(whitelist, 2048, "ApproveOnMsgInWordlist", defaultApproveOnMsgInWordlist);
if (_isregex(whitelist)) {
if (_regmatch(message, whitelist))
bCorrectResponse = TRUE;
} else {
- ptok = _tcstok(whitelist, L" ");
+ ptok = wcstok(whitelist, L" ");
while (ptok != NULL) {
- if (_tcsstr(message, ptok)) {
+ if (wcsstr(message, ptok)) {
bCorrectResponse = TRUE;
break;
}
- ptok = _tcstok(NULL, L" ");
+ ptok = wcstok(NULL, L" ");
}
}
free(whitelist);
@@ -207,8 +207,8 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) case SPAMOTRON_MODE_MATH:
if (message == NULL)
break;
- _itot(_getCOptD(hContact, "ResponseMath", -1), buf, 10);
- if (_tcsstr(message, buf) && (mir_tstrlen(buf) == mir_tstrlen(message))) {
+ _itow(_getCOptD(hContact, "ResponseMath", -1), buf, 10);
+ if (wcsstr(message, buf) && (mir_tstrlen(buf) == mir_tstrlen(message))) {
bCorrectResponse = TRUE;
}
break;
@@ -232,7 +232,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) // Resubmit pending authorization request
if (_getCOptB(hContact, "AuthEventPending", FALSE)) {
DBVARIANT _dbv;
- TCHAR AuthEventModule[100];
+ wchar_t AuthEventModule[100];
char* szAuthEventModule;
if (db_get(hContact, PLUGIN_NAME, "AuthEvent", &_dbv) == 0) {
DBEVENTINFO *_dbei = (DBEVENTINFO *)malloc(sizeof(DBEVENTINFO));
@@ -344,8 +344,8 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) /*** Send Challenge ***/
- challengeW = (TCHAR *)malloc(maxmsglen*sizeof(TCHAR));
- tmpW = (TCHAR *)malloc(maxmsglen*sizeof(TCHAR));
+ challengeW = (wchar_t *)malloc(maxmsglen*sizeof(wchar_t));
+ tmpW = (wchar_t *)malloc(maxmsglen*sizeof(wchar_t));
switch (_getOptB("Mode", defaultMode)) {
case SPAMOTRON_MODE_PLAIN:
if (dbei->eventType == EVENTTYPE_AUTHREQUEST)
diff --git a/plugins/Spamotron/src/stdafx.h b/plugins/Spamotron/src/stdafx.h index 2d584589ba..1be69abae9 100644 --- a/plugins/Spamotron/src/stdafx.h +++ b/plugins/Spamotron/src/stdafx.h @@ -40,7 +40,7 @@ #define _getOptD(a,b) _getCOptD(NULL, a, b)
#define _setOptD(a,b) _setCOptD(NULL, a, b)
-TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, MCONTACT hContact, const char* option, const TCHAR *def);
+wchar_t* _getCOptS(wchar_t *buf, unsigned int buflen, MCONTACT hContact, const char* option, const wchar_t *def);
#define _getOptS(a,b,c,d) _getCOptS(a, b, NULL, c, d)
#define _setCOptTS(a,b,c) db_set_ts(a, PLUGIN_NAME, b, c)
#define _setCOptS(a,b,c) db_set_s(a, PLUGIN_NAME, b, c)
@@ -90,24 +90,24 @@ TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, MCONTACT hContact, const char* #define _NOTIFYP _getOptB("NotifyPopup", defaultNotifyPopup)
-TCHAR* ReplaceVars(TCHAR *dst, unsigned int len);
-TCHAR* ReplaceVarsNum(TCHAR *dst, unsigned int len, int num);
-TCHAR* ReplaceVar(TCHAR *dst, unsigned int len, const TCHAR *var, const TCHAR *rvar);
-int get_response_id(const TCHAR *strvar);
-int get_response_num(const TCHAR *str);
-TCHAR* get_response(TCHAR* dst, unsigned int dstlen, int num);
-
-TCHAR* _tcsstr_cc(TCHAR* str, TCHAR* strSearch, BOOL cc);
-BOOL _isregex(TCHAR* strSearch);
-BOOL _isvalidregex(TCHAR* strSearch);
-BOOL _regmatch(TCHAR* str, TCHAR* strSearch);
-BOOL Contains(TCHAR* dst, TCHAR* src);
+wchar_t* ReplaceVars(wchar_t *dst, unsigned int len);
+wchar_t* ReplaceVarsNum(wchar_t *dst, unsigned int len, int num);
+wchar_t* ReplaceVar(wchar_t *dst, unsigned int len, const wchar_t *var, const wchar_t *rvar);
+int get_response_id(const wchar_t *strvar);
+int get_response_num(const wchar_t *str);
+wchar_t* get_response(wchar_t* dst, unsigned int dstlen, int num);
+
+wchar_t* _tcsstr_cc(wchar_t* str, wchar_t* strSearch, BOOL cc);
+BOOL _isregex(wchar_t* strSearch);
+BOOL _isvalidregex(wchar_t* strSearch);
+BOOL _regmatch(wchar_t* str, wchar_t* strSearch);
+BOOL Contains(wchar_t* dst, wchar_t* src);
BOOL isOneDay(DWORD timestamp1, DWORD timestamp2);
void MarkUnread(MCONTACT hContact);
-int ShowPopup(MCONTACT hContact, BYTE popupType, TCHAR *line1, TCHAR *line2);
-int ShowPopupPreview(HWND optDlg, BYTE popupType, TCHAR *line1, TCHAR *line2);
-int _notify(MCONTACT hContact, BYTE type, TCHAR *message, TCHAR *origmessage);
+int ShowPopup(MCONTACT hContact, BYTE popupType, wchar_t *line1, wchar_t *line2);
+int ShowPopupPreview(HWND optDlg, BYTE popupType, wchar_t *line1, wchar_t *line2);
+int _notify(MCONTACT hContact, BYTE type, wchar_t *message, wchar_t *origmessage);
int LogToSystemHistory(char *message, char *origmessage);
#define POPUP_DEFAULT 0
#define POPUP_BLOCKED 1
@@ -136,13 +136,13 @@ extern sqlite3 *bayesdb; int OpenBayes();
int CheckBayes();
-void learn(int type, TCHAR *msg);
-void learn_ham(TCHAR *msg);
-void learn_spam(TCHAR *msg);
+void learn(int type, wchar_t *msg);
+void learn_ham(wchar_t *msg);
+void learn_spam(wchar_t *msg);
int get_token_count(int type);
int get_msg_count(int type);
-double get_msg_score(TCHAR *msg);
-void queue_message(MCONTACT hContact, DWORD msgtime, TCHAR *message);
+double get_msg_score(wchar_t *msg);
+void queue_message(MCONTACT hContact, DWORD msgtime, wchar_t *message);
void bayes_approve_contact(MCONTACT hContact);
void dequeue_messages();
diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp index 7a9bf2fe3e..4d5ca64280 100644 --- a/plugins/Spamotron/src/utils.cpp +++ b/plugins/Spamotron/src/utils.cpp @@ -2,36 +2,36 @@ #include <locale.h> -TCHAR *_tcstolower(TCHAR *dst) +wchar_t *_tcstolower(wchar_t *dst) { if (dst == NULL) return NULL; SIZE_T dst_len = mir_tstrlen(dst); for (SIZE_T i = 0; i < dst_len; i ++) - dst[i] = _totlower(dst[i]); + dst[i] = towlower(dst[i]); return dst; } -TCHAR *_tcstoupper(TCHAR *dst) +wchar_t *_tcstoupper(wchar_t *dst) { if (dst == NULL) return NULL; SIZE_T dst_len = mir_tstrlen(dst); for (SIZE_T i = 0; i < dst_len; i ++) - dst[i] = _totupper(dst[i]); + dst[i] = towupper(dst[i]); return dst; } -BOOL _isregex(TCHAR* strSearch) +BOOL _isregex(wchar_t* strSearch) { BOOL ret = FALSE; pcre16 *re; const char *error; int erroroffs, rc; - TCHAR *regex; - TCHAR regex_parse[] = L"/(.*)/([igsm]*)"; + wchar_t *regex; + wchar_t regex_parse[] = L"/(.*)/([igsm]*)"; int ovector[9]; if (strSearch == NULL) @@ -52,15 +52,15 @@ err_out: return ret; } -BOOL _isvalidregex(TCHAR* strSearch) +BOOL _isvalidregex(wchar_t* strSearch) { BOOL ret = FALSE; pcre16 *re; const char *error; int erroroffs, rc; - TCHAR *regex, *regexp, *mod; + wchar_t *regex, *regexp, *mod; int opts = 0; - TCHAR regex_parse[] = L"/(.*)/([igsm]*)"; + wchar_t regex_parse[] = L"/(.*)/([igsm]*)"; int ovector[9]; if (strSearch == NULL) @@ -82,11 +82,11 @@ BOOL _isvalidregex(TCHAR* strSearch) mod = regex + ovector[4]; mod[ovector[5] - ovector[4]] = 0; - if (_tcsstr(mod, L"i")) + if (wcsstr(mod, L"i")) opts |= PCRE_CASELESS; - if (_tcsstr(mod, L"m")) + if (wcsstr(mod, L"m")) opts |= PCRE_MULTILINE; - if (_tcsstr(mod, L"s")) + if (wcsstr(mod, L"s")) opts |= PCRE_DOTALL; re = pcre16_compile(regexp, opts, &error, &erroroffs, NULL); @@ -100,15 +100,15 @@ err_out: return ret; } -BOOL _regmatch(TCHAR* str, TCHAR* strSearch) +BOOL _regmatch(wchar_t* str, wchar_t* strSearch) { BOOL ret = FALSE; pcre16 *re; const char *error; int erroroffs, rc; - TCHAR *regex, *regexp, *data = NULL, *mod; + wchar_t *regex, *regexp, *data = NULL, *mod; int opts = 0; - TCHAR regex_parse[] = L"^/(.*)/([igsm]*)"; + wchar_t regex_parse[] = L"^/(.*)/([igsm]*)"; int ovector[9]; if (str == NULL || strSearch == NULL) @@ -133,11 +133,11 @@ BOOL _regmatch(TCHAR* str, TCHAR* strSearch) data = mir_tstrdup(str); if (data == NULL) goto err_out; - if (_tcsstr(mod, L"i")) + if (wcsstr(mod, L"i")) opts |= PCRE_CASELESS; - if (_tcsstr(mod, L"m")) + if (wcsstr(mod, L"m")) opts |= PCRE_MULTILINE; - if (_tcsstr(mod, L"s")) + if (wcsstr(mod, L"s")) opts |= PCRE_DOTALL; re = pcre16_compile(regexp, opts, &error, &erroroffs, NULL); @@ -154,14 +154,14 @@ err_out: return ret; } -int get_response_id(const TCHAR* strvar) +int get_response_id(const wchar_t* strvar) { int ret = 0; pcre16 *re; const char *error; int erroroffs, rc; - TCHAR *_str, *_strvar; - TCHAR regex[] = L"^%response([#-_]([0-9]+))?%$"; + wchar_t *_str, *_strvar; + wchar_t regex[] = L"^%response([#-_]([0-9]+))?%$"; int ovector[9]; if (strvar == NULL) @@ -181,45 +181,45 @@ int get_response_id(const TCHAR* strvar) } else if (rc == 3) { _str = _strvar + ovector[4]; _str[ovector[5] - ovector[4]] = 0; - ret = _ttoi(_str); + ret = _wtoi(_str); } mir_free(_strvar); return ret; } -int get_response_num(const TCHAR *str) +int get_response_num(const wchar_t *str) { int i = 0; - TCHAR *tmp, *strc; + wchar_t *tmp, *strc; if (str == NULL) return 0; strc = mir_tstrdup(str); if (strc == NULL) return 0; - tmp = _tcstok(strc, L"\r\n"); + tmp = wcstok(strc, L"\r\n"); while (tmp) { i ++; - tmp = _tcstok(NULL, L"\r\n"); /* Move next. */ + tmp = wcstok(NULL, L"\r\n"); /* Move next. */ } mir_free(strc); return i; } -TCHAR* get_response(TCHAR* dst, unsigned int dstlen, int num) +wchar_t* get_response(wchar_t* dst, unsigned int dstlen, int num) { int i = 0; - TCHAR *tmp, *src; + wchar_t *tmp, *src; if (dst == NULL || dstlen == 0 || num < 0) return dst; - src = (TCHAR*)mir_alloc(MAX_BUFFER_LENGTH * sizeof(TCHAR)); + src = (wchar_t*)mir_alloc(MAX_BUFFER_LENGTH * sizeof(wchar_t)); if (src == NULL) goto err_out; _getOptS(src, MAX_BUFFER_LENGTH, "Response", defaultResponse); - tmp = _tcstok(src, L"\r\n"); + tmp = wcstok(src, L"\r\n"); while (tmp) { if (i == num) { mir_tstrcpy(dst, tmp); @@ -227,7 +227,7 @@ TCHAR* get_response(TCHAR* dst, unsigned int dstlen, int num) return dst; } i ++; - tmp = _tcstok(NULL, L"\r\n"); /* Move next. */ + tmp = wcstok(NULL, L"\r\n"); /* Move next. */ } mir_free(src); err_out: @@ -235,12 +235,12 @@ err_out: return dst; } -TCHAR* _tcsstr_cc(TCHAR* str, TCHAR* strSearch, BOOL cc) +wchar_t* _tcsstr_cc(wchar_t* str, wchar_t* strSearch, BOOL cc) { - TCHAR *ret = NULL, *_str = NULL, *_strSearch = NULL; + wchar_t *ret = NULL, *_str = NULL, *_strSearch = NULL; if (cc) - return _tcsstr(str, strSearch); + return wcsstr(str, strSearch); _str = mir_tstrdup(str); if (_str == NULL) @@ -248,7 +248,7 @@ TCHAR* _tcsstr_cc(TCHAR* str, TCHAR* strSearch, BOOL cc) _strSearch = mir_tstrdup(strSearch); if (_strSearch == NULL) goto err_out; - ret = _tcsstr(_tcstolower(_str), _tcstolower(_strSearch)); + ret = wcsstr(_tcstolower(_str), _tcstolower(_strSearch)); if (ret != NULL) ret = ((ret - _str) + str); err_out: @@ -258,10 +258,10 @@ err_out: return ret; } -BOOL Contains(TCHAR* dst, TCHAR* src) // Checks for occurence of substring from src in dst +BOOL Contains(wchar_t* dst, wchar_t* src) // Checks for occurence of substring from src in dst { BOOL ret = FALSE; - TCHAR *tsrc = NULL, *tdst = NULL, *token, *token_end; + wchar_t *tsrc = NULL, *tdst = NULL, *token, *token_end; SIZE_T dst_len; if (dst == NULL || src == NULL) @@ -274,24 +274,24 @@ BOOL Contains(TCHAR* dst, TCHAR* src) // Checks for occurence of substring from goto err_out; tdst = _tcstoupper(tdst); dst_len = mir_tstrlen(tdst); - token = _tcstok(tsrc, L","); + token = wcstok(tsrc, L","); while (token) { token_end = (token + mir_tstrlen(token)); - while (!_tcsncmp(token, L" ", 1)) { /* Skeep spaces at start. */ + while (!wcsncmp(token, L" ", 1)) { /* Skeep spaces at start. */ token ++; } /* Skeep spaces at end. */ - while (token > token_end && _tcschr((token_end - 1), _T(' '))) { + while (token > token_end && wcschr((token_end - 1), ' ')) { token_end --; token_end[0] = 0; } /* Compare. */ if (dst_len == (token_end - token) && - 0 == memcmp(tdst, _tcstoupper(token), (dst_len * sizeof(TCHAR)))) { + 0 == memcmp(tdst, _tcstoupper(token), (dst_len * sizeof(wchar_t)))) { ret = TRUE; break; } - token = _tcstok(NULL, L","); /* Move next. */ + token = wcstok(NULL, L","); /* Move next. */ } err_out: mir_free(tsrc); @@ -321,9 +321,9 @@ BOOL isOneDay(DWORD timestamp1, DWORD timestamp2) return FALSE; } -TCHAR* ReplaceVar(TCHAR *dst, unsigned int len, const TCHAR *var, const TCHAR *rvar) +wchar_t* ReplaceVar(wchar_t *dst, unsigned int len, const wchar_t *var, const wchar_t *rvar) { - TCHAR *var_start; + wchar_t *var_start; SIZE_T dst_len, var_len, rvar_len; if (dst == NULL || var == NULL || rvar == NULL) @@ -331,39 +331,39 @@ TCHAR* ReplaceVar(TCHAR *dst, unsigned int len, const TCHAR *var, const TCHAR *r dst_len = mir_tstrlen(dst); var_len = mir_tstrlen(var); rvar_len = mir_tstrlen(rvar); - var_start = _tcsstr(dst, var); + var_start = wcsstr(dst, var); while (var_start) { if (len < (dst_len + rvar_len - var_len + 1)) return NULL; /* Out of buf space. */ memmove((var_start + rvar_len), (var_start + var_len), - (((dst + dst_len + 1) - (var_start + var_len)) * sizeof(TCHAR))); + (((dst + dst_len + 1) - (var_start + var_len)) * sizeof(wchar_t))); if (var_len >= rvar_len) { /* Buf data size not changed or decreased. */ dst_len -= (var_len - rvar_len); } else { /* Buf data size increased. */ dst_len += (rvar_len - var_len); } - memcpy(var_start, rvar, (rvar_len * sizeof(TCHAR))); - var_start = _tcsstr(dst, var); /* Move next. */ + memcpy(var_start, rvar, (rvar_len * sizeof(wchar_t))); + var_start = wcsstr(dst, var); /* Move next. */ } return dst; } -TCHAR* ReplaceVars(TCHAR *dst, unsigned int len) +wchar_t* ReplaceVars(wchar_t *dst, unsigned int len) { return ReplaceVarsNum(dst, len, -1); } -TCHAR* ReplaceVarsNum(TCHAR *dst, unsigned int len, int num) +wchar_t* ReplaceVarsNum(wchar_t *dst, unsigned int len, int num) { - TCHAR response[MAX_BUFFER_LENGTH]; + wchar_t response[MAX_BUFFER_LENGTH]; int ret, i; pcre16 *re; const char *error; int erroroffs, rc; - TCHAR *_str, *tmp, **r = NULL, **tr, *ttmp, *dstcopy; - TCHAR regex[] = L"%response([#-_]([0-9]+))?%"; + wchar_t *_str, *tmp, **r = NULL, **tr, *ttmp, *dstcopy; + wchar_t regex[] = L"%response([#-_]([0-9]+))?%"; int ovector[9]; re = pcre16_compile(regex, 0, &error, &erroroffs, NULL); @@ -371,14 +371,14 @@ TCHAR* ReplaceVarsNum(TCHAR *dst, unsigned int len, int num) return FALSE; // [TODO] and log some error _getOptS(response, _countof(response), "Response", defaultResponse); - ttmp = _tcstok(response, L"\r\n"); + ttmp = wcstok(response, L"\r\n"); for (i = 0; ttmp != NULL; i ++) { - tr = (TCHAR**)mir_realloc(r, ((i + 1) * sizeof(TCHAR*))); + tr = (wchar_t**)mir_realloc(r, ((i + 1) * sizeof(wchar_t*))); if (tr == NULL) goto err_out; r = tr; r[i] = ttmp; - ttmp = _tcstok(NULL, L"\r\n"); /* Move next. */ + ttmp = wcstok(NULL, L"\r\n"); /* Move next. */ } do { @@ -397,7 +397,7 @@ TCHAR* ReplaceVarsNum(TCHAR *dst, unsigned int len, int num) ttmp[ovector[1] - ovector[0]] = 0; tmp = _str + ovector[4]; tmp[ovector[5] - ovector[4]] = 0; - ret = _ttoi(tmp); + ret = _wtoi(tmp); } else { ttmp = dstcopy + ovector[0]; ttmp[ovector[1] - ovector[0]] = 0; @@ -423,10 +423,10 @@ err_out: return dst; } -int _notify(MCONTACT hContact, BYTE type, TCHAR *message, TCHAR *origmessage) +int _notify(MCONTACT hContact, BYTE type, wchar_t *message, wchar_t *origmessage) { char *tmp, *tmporig; - TCHAR msg[MAX_BUFFER_LENGTH]; + wchar_t msg[MAX_BUFFER_LENGTH]; mir_sntprintf(msg, message, pcli->pfnGetContactDisplayName(hContact, 0)); if (_getOptB("LogActions", defaultLogActions)) { diff --git a/plugins/SpellChecker/src/RichEdit.cpp b/plugins/SpellChecker/src/RichEdit.cpp index ea5846a42a..1317f767cd 100644 --- a/plugins/SpellChecker/src/RichEdit.cpp +++ b/plugins/SpellChecker/src/RichEdit.cpp @@ -143,7 +143,7 @@ int RichEdit::GetLineCount() const return SendMessage(EM_GETLINECOUNT, 0, 0);
}
-void RichEdit::GetLine(int line, TCHAR *text, size_t text_len) const
+void RichEdit::GetLine(int line, wchar_t *text, size_t text_len) const
{
*((WORD*)text) = WORD(text_len - 1);
unsigned size = (unsigned)SendMessage(EM_GETLINE, (WPARAM)line, (LPARAM)text);
@@ -152,7 +152,7 @@ void RichEdit::GetLine(int line, TCHAR *text, size_t text_len) const // to make both implementations return same size
int lineLen = GetLineLength(line);
size = (unsigned)max(0, min((int)text_len - 1, min((int)size, lineLen)));
- text[size] = _T('\0');
+ text[size] = '\0';
}
int RichEdit::GetLineLength(int line) const
@@ -193,7 +193,7 @@ int RichEdit::GetTextLength() const return GetWindowTextLength(m_hwnd);
}
-TCHAR* RichEdit::GetText(int start, int end) const
+wchar_t* RichEdit::GetText(int start, int end) const
{
if (end <= start)
end = GetTextLength();
@@ -211,26 +211,26 @@ TCHAR* RichEdit::GetText(int start, int end) const return mir_tstrdup(L"");
}
- TCHAR *res = mir_u2t(text);
+ wchar_t *res = mir_u2t(text);
range->Release();
::SysFreeString(text);
return res;
}
int len = (GetTextLength() + 1);
- TCHAR *tmp = (TCHAR *)mir_alloc(len * sizeof(TCHAR));
+ wchar_t *tmp = (wchar_t *)mir_alloc(len * sizeof(wchar_t));
GetWindowText(m_hwnd, tmp, len);
tmp[len] = 0;
- TCHAR *ret = (TCHAR *)mir_alloc((end - start + 1) * sizeof(TCHAR));
- memmove(ret, &tmp[start], (end - start) * sizeof(TCHAR));
+ wchar_t *ret = (wchar_t *)mir_alloc((end - start + 1) * sizeof(wchar_t));
+ memmove(ret, &tmp[start], (end - start) * sizeof(wchar_t));
ret[end - start] = 0;
mir_free(tmp);
return ret;
}
-void RichEdit::ReplaceSel(const TCHAR *new_text)
+void RichEdit::ReplaceSel(const wchar_t *new_text)
{
if (m_stopped) {
CHARRANGE sel = GetSel();
@@ -249,7 +249,7 @@ void RichEdit::ReplaceSel(const TCHAR *new_text) else SendMessage(EM_REPLACESEL, m_undoEnabled, (LPARAM)new_text);
}
-int RichEdit::Replace(int start, int end, const TCHAR *new_text)
+int RichEdit::Replace(int start, int end, const wchar_t *new_text)
{
CHARRANGE sel = GetSel();
CHARRANGE replace_sel = { start, end };
@@ -262,7 +262,7 @@ int RichEdit::Replace(int start, int end, const TCHAR *new_text) return dif;
}
-int RichEdit::Insert(int pos, const TCHAR *text)
+int RichEdit::Insert(int pos, const wchar_t *text)
{
CHARRANGE sel = GetSel();
CHARRANGE replace_sel = { pos, pos };
diff --git a/plugins/SpellChecker/src/RichEdit.h b/plugins/SpellChecker/src/RichEdit.h index 4556369c31..17ebe1e438 100644 --- a/plugins/SpellChecker/src/RichEdit.h +++ b/plugins/SpellChecker/src/RichEdit.h @@ -35,7 +35,7 @@ public: int GetCharFromPos(const POINT &pt);
int GetLineCount() const;
- void GetLine(int line, TCHAR *text, size_t text_len) const;
+ void GetLine(int line, wchar_t *text, size_t text_len) const;
int GetLineLength(int line) const;
int GetFirstCharOfLine(int line) const;
int GetLineFromChar(int charPos) const;
@@ -44,12 +44,12 @@ public: void SetSel(int start, int end);
void SetSel(const CHARRANGE &sel);
- TCHAR* GetText(int start, int end) const;
+ wchar_t* GetText(int start, int end) const;
int GetTextLength() const;
- void ReplaceSel(const TCHAR *new_text);
- int Replace(int start, int end, const TCHAR *new_text);
- int Insert(int pos, const TCHAR *text);
+ void ReplaceSel(const wchar_t *new_text);
+ int Replace(int start, int end, const wchar_t *new_text);
+ int Insert(int pos, const wchar_t *text);
int Delete(int start, int end);
private:
diff --git a/plugins/SpellChecker/src/ardialog.cpp b/plugins/SpellChecker/src/ardialog.cpp index 3b1258508f..0b1a14fa56 100644 --- a/plugins/SpellChecker/src/ardialog.cpp +++ b/plugins/SpellChecker/src/ardialog.cpp @@ -25,8 +25,8 @@ static INT_PTR CALLBACK AddReplacementDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa struct Data
{
Dictionary *dict;
- tstring find;
- tstring replace;
+ std::wstring find;
+ std::wstring replace;
BOOL useVariables;
BOOL modal;
@@ -37,7 +37,7 @@ struct Data };
BOOL ShowAutoReplaceDialog(HWND parent, BOOL modal,
- Dictionary *dict, const TCHAR *find, const TCHAR *replace, BOOL useVariables,
+ Dictionary *dict, const wchar_t *find, const wchar_t *replace, BOOL useVariables,
BOOL findReadOnly, AutoReplaceDialogCallback callback, void *param)
{
Data *data = new Data();
@@ -79,11 +79,11 @@ static LRESULT CALLBACK OnlyCharsEditProc(HWND hwnd, UINT msg, WPARAM wParam, LP if (GetKeyState(VK_CONTROL) & 0x8000) // CTRL key
break;
{
- TCHAR c = (TCHAR)wParam;
+ wchar_t c = (wchar_t)wParam;
if (!data->dict->autoReplace->isWordChar(c))
return 1;
- TCHAR tmp[2] = { c, 0 };
+ wchar_t tmp[2] = { c, 0 };
CharLower(tmp);
wParam = tmp[0];
@@ -96,10 +96,10 @@ static LRESULT CALLBACK OnlyCharsEditProc(HWND hwnd, UINT msg, WPARAM wParam, LP switch (msg) {
case EM_PASTESPECIAL:
case WM_PASTE:
- TCHAR text[256];
+ wchar_t text[256];
GetWindowText(hwnd, text, _countof(text));
- scoped_free<TCHAR> dest = data->dict->autoReplace->filterText(text);
+ scoped_free<wchar_t> dest = data->dict->autoReplace->filterText(text);
SetWindowText(hwnd, dest);
break;
}
@@ -171,7 +171,7 @@ static INT_PTR CALLBACK AddReplacementDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa SendDlgItemMessage(hwndDlg, IDC_NEW, EM_LIMITTEXT, 256, 0);
if (!data->find.empty()) {
- scoped_free<TCHAR> tmp = data->dict->autoReplace->filterText(data->find.c_str());
+ scoped_free<wchar_t> tmp = data->dict->autoReplace->filterText(data->find.c_str());
SetDlgItemText(hwndDlg, IDC_OLD, tmp);
}
if (!data->replace.empty())
@@ -213,7 +213,7 @@ static INT_PTR CALLBACK AddReplacementDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa {
Data *data = (Data *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- TCHAR find[256];
+ wchar_t find[256];
if (data->findReadOnly)
mir_tstrncpy(find, data->find.c_str(), _countof(find));
else {
@@ -221,7 +221,7 @@ static INT_PTR CALLBACK AddReplacementDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa lstrtrim(find);
}
- TCHAR replace[256];
+ wchar_t replace[256];
GetDlgItemText(hwndDlg, IDC_NEW, replace, _countof(replace));
lstrtrim(replace);
diff --git a/plugins/SpellChecker/src/ardialog.h b/plugins/SpellChecker/src/ardialog.h index 83f97c6026..6ece91cc4f 100644 --- a/plugins/SpellChecker/src/ardialog.h +++ b/plugins/SpellChecker/src/ardialog.h @@ -22,11 +22,11 @@ Boston, MA 02111-1307, USA. typedef void (*AutoReplaceDialogCallback)(BOOL canceled, Dictionary *dict,
- const TCHAR *find, const TCHAR *replace, BOOL useVariables,
- const TCHAR *original_find, void *param);
+ const wchar_t *find, const wchar_t *replace, BOOL useVariables,
+ const wchar_t *original_find, void *param);
BOOL ShowAutoReplaceDialog(HWND parent, BOOL modal,
- Dictionary *dict, const TCHAR *find, const TCHAR *replace, BOOL useVariables,
+ Dictionary *dict, const wchar_t *find, const wchar_t *replace, BOOL useVariables,
BOOL findReadOnly, AutoReplaceDialogCallback callback, void *param);
diff --git a/plugins/SpellChecker/src/autoreplace.cpp b/plugins/SpellChecker/src/autoreplace.cpp index 899146ffdf..a3ad88e928 100644 --- a/plugins/SpellChecker/src/autoreplace.cpp +++ b/plugins/SpellChecker/src/autoreplace.cpp @@ -24,13 +24,13 @@ AutoReplacement::AutoReplacement() {
}
-AutoReplacement::AutoReplacement(const TCHAR *replace, BOOL useVariables)
+AutoReplacement::AutoReplacement(const wchar_t *replace, BOOL useVariables)
: replace(replace), useVariables(useVariables)
{
}
-AutoReplaceMap::AutoReplaceMap(TCHAR *aFilename, Dictionary *dict)
+AutoReplaceMap::AutoReplaceMap(wchar_t *aFilename, Dictionary *dict)
{
m_dict = dict;
mir_tstrncpy(m_filename, aFilename, _countof(m_filename));
@@ -39,7 +39,7 @@ AutoReplaceMap::AutoReplaceMap(TCHAR *aFilename, Dictionary *dict) void AutoReplaceMap::loadAutoReplaceMap()
{
- FILE *file = _tfopen(m_filename, L"rb");
+ FILE *file = _wfopen(m_filename, L"rb");
if (file == NULL)
return;
@@ -88,17 +88,17 @@ void AutoReplaceMap::loadAutoReplaceMap() void AutoReplaceMap::writeAutoReplaceMap()
{
// Create path
- TCHAR *p = _tcsrchr(m_filename, _T('\\'));
+ wchar_t *p = wcsrchr(m_filename, '\\');
if (p != NULL) {
*p = 0;
CreateDirectoryTreeT(m_filename);
- *p = _T('\\');
+ *p = '\\';
}
// Write it
- FILE *file = _tfopen(m_filename, L"wb");
+ FILE *file = _wfopen(m_filename, L"wb");
if (file != NULL) {
- map<tstring, AutoReplacement>::iterator it = m_replacements.begin();
+ map<std::wstring, AutoReplacement>::iterator it = m_replacements.begin();
for (; it != m_replacements.end(); it++) {
AutoReplacement &ar = it->second;
@@ -115,32 +115,32 @@ void AutoReplaceMap::writeAutoReplaceMap() }
-BOOL AutoReplaceMap::isWordChar(TCHAR c)
+BOOL AutoReplaceMap::isWordChar(wchar_t c)
{
if (IsNumber(c))
return TRUE;
- if (_tcschr(L"-_.!@#$%&*()[]{}<>:?/\\=+", c) != NULL)
+ if (wcschr(L"-_.!@#$%&*()[]{}<>:?/\\=+", c) != NULL)
return TRUE;
return m_dict->isWordChar(c);
}
-TCHAR* AutoReplaceMap::autoReplace(const TCHAR * word)
+wchar_t* AutoReplaceMap::autoReplace(const wchar_t * word)
{
- scoped_free<TCHAR> from = _tcslwr(_tcsdup(word));
+ scoped_free<wchar_t> from = wcslwr(wcsdup(word));
if (m_replacements.find(from.get()) == m_replacements.end())
return NULL;
AutoReplacement &ar = m_replacements[from.get()];
- TCHAR *to;
+ wchar_t *to;
if (ar.useVariables)
- to = variables_parsedup((TCHAR *)ar.replace.c_str(), (TCHAR *)word, NULL);
+ to = variables_parsedup((wchar_t *)ar.replace.c_str(), (wchar_t *)word, NULL);
else
- to = _tcsdup(ar.replace.c_str());
+ to = wcsdup(ar.replace.c_str());
// Wich case to use?
size_t len = mir_tstrlen(word);
@@ -156,17 +156,17 @@ TCHAR* AutoReplaceMap::autoReplace(const TCHAR * word) return CharUpper(to);
// First upper
- TCHAR tmp[2];
+ wchar_t tmp[2];
tmp[0] = to[0];
- tmp[1] = _T('\0');
+ tmp[1] = '\0';
CharUpper(tmp);
to[0] = tmp[0];
return to;
}
-TCHAR* AutoReplaceMap::filterText(const TCHAR *find)
+wchar_t* AutoReplaceMap::filterText(const wchar_t *find)
{
- TCHAR *ret = _tcsdup(find);
+ wchar_t *ret = wcsdup(find);
int len = mir_tstrlen(ret);
int pos = 0;
for (int i = 0; i < len; i++)
@@ -176,27 +176,27 @@ TCHAR* AutoReplaceMap::filterText(const TCHAR *find) return CharLower(ret);
}
-void AutoReplaceMap::add(const TCHAR * aFrom, const TCHAR * to, BOOL useVariables)
+void AutoReplaceMap::add(const wchar_t * aFrom, const wchar_t * to, BOOL useVariables)
{
- scoped_free<TCHAR> from = filterText(aFrom);
+ scoped_free<wchar_t> from = filterText(aFrom);
m_replacements[from.get()] = AutoReplacement(to, useVariables);
writeAutoReplaceMap();
}
-void AutoReplaceMap::copyMap(map<tstring, AutoReplacement> *replacements)
+void AutoReplaceMap::copyMap(map<std::wstring, AutoReplacement> *replacements)
{
*replacements = m_replacements;
}
-void AutoReplaceMap::setMap(const map<tstring, AutoReplacement> &replacements)
+void AutoReplaceMap::setMap(const map<std::wstring, AutoReplacement> &replacements)
{
m_replacements.clear();
- map<tstring, AutoReplacement>::const_iterator it = replacements.begin();
+ map<std::wstring, AutoReplacement>::const_iterator it = replacements.begin();
for (; it != replacements.end(); it++) {
- scoped_free<TCHAR> from = filterText(it->first.c_str());
+ scoped_free<wchar_t> from = filterText(it->first.c_str());
m_replacements[from.get()] = it->second;
}
diff --git a/plugins/SpellChecker/src/autoreplace.h b/plugins/SpellChecker/src/autoreplace.h index 8a81fdfcbf..316f015e0d 100644 --- a/plugins/SpellChecker/src/autoreplace.h +++ b/plugins/SpellChecker/src/autoreplace.h @@ -24,11 +24,11 @@ Boston, MA 02111-1307, USA. struct AutoReplacement
{
- tstring replace;
+ std::wstring replace;
BOOL useVariables;
AutoReplacement();
- AutoReplacement(const TCHAR *replace, BOOL useVariables);
+ AutoReplacement(const wchar_t *replace, BOOL useVariables);
};
@@ -38,31 +38,31 @@ class Dictionary; class AutoReplaceMap
{
private:
- TCHAR m_filename[1024];
+ wchar_t m_filename[1024];
Dictionary *m_dict;
- map<tstring, AutoReplacement> m_replacements;
+ map<std::wstring, AutoReplacement> m_replacements;
void loadAutoReplaceMap();
void writeAutoReplaceMap();
public:
- AutoReplaceMap(TCHAR *filename, Dictionary *dict);
+ AutoReplaceMap(wchar_t *filename, Dictionary *dict);
- TCHAR* filterText(const TCHAR *find);
- BOOL isWordChar(TCHAR c);
+ wchar_t* filterText(const wchar_t *find);
+ BOOL isWordChar(wchar_t c);
/// Return an auto replacement to a word or NULL if none exists.
/// You have to free the item.
- TCHAR* autoReplace(const TCHAR *word);
+ wchar_t* autoReplace(const wchar_t *word);
/// Add a word to the list of auto-replaced words
- void add(const TCHAR *from, const TCHAR *to, BOOL useVariables = FALSE);
+ void add(const wchar_t *from, const wchar_t *to, BOOL useVariables = FALSE);
/// Make a copy of the auto replace map
- void copyMap(map<tstring, AutoReplacement> *replacements);
+ void copyMap(map<std::wstring, AutoReplacement> *replacements);
/// Make a copy of the auto replace map
- void setMap(const map<tstring, AutoReplacement> &replacements);
+ void setMap(const map<std::wstring, AutoReplacement> &replacements);
};
diff --git a/plugins/SpellChecker/src/dictionary.cpp b/plugins/SpellChecker/src/dictionary.cpp index 58218fc2b1..efad448000 100644 --- a/plugins/SpellChecker/src/dictionary.cpp +++ b/plugins/SpellChecker/src/dictionary.cpp @@ -25,16 +25,16 @@ Boston, MA 02111-1307, USA. // Additional languages that i could not find in Windows struct { - TCHAR *language; - TCHAR *localized_name; + wchar_t *language; + wchar_t *localized_name; } aditionalLanguages[] = { - { L"tl_PH", LPGENT("Tagalog (Philippines)") }, - { L"de_frami_neu", LPGENT("German (Germany)") } + { L"tl_PH", LPGENW("Tagalog (Philippines)") }, + { L"de_frami_neu", LPGENW("German (Germany)") } }; struct { - TCHAR *name; - TCHAR *key; + wchar_t *name; + wchar_t *key; } otherHunspellApps[] = { { L"Thunderbird", L"thunderbird.exe" }, { L"Firefox", L"firefox.exe" } @@ -355,19 +355,19 @@ void LoadThread(LPVOID hd); class HunspellDictionary : public Dictionary { protected: - TCHAR fileWithoutExtension[1024]; - TCHAR userPath[1024]; + wchar_t fileWithoutExtension[1024]; + wchar_t userPath[1024]; volatile int loaded; Hunspell *hunspell; - TCHAR *wordChars; + wchar_t *wordChars; UINT codePage; void loadCustomDict() { - TCHAR filename[1024]; + wchar_t filename[1024]; mir_sntprintf(filename, L"%s\\%s.cdic", userPath, language); - FILE *file = _tfopen(filename, L"rb"); + FILE *file = _wfopen(filename, L"rb"); if (file != NULL) { char tmp[1024]; int c, pos = 0; @@ -388,14 +388,14 @@ protected: } } - void appendToCustomDict(const TCHAR *word) + void appendToCustomDict(const wchar_t *word) { CreateDirectoryTreeT(userPath); - TCHAR filename[1024]; + wchar_t filename[1024]; mir_sntprintf(filename, L"%s\\%s.cdic", userPath, language); - FILE *file = _tfopen(filename, L"ab"); + FILE *file = _wfopen(filename, L"ab"); if (file != NULL) { char tmp[1024]; toHunspell(tmp, word, _countof(tmp)); @@ -404,7 +404,7 @@ protected: } } - virtual void addWordInternal(const TCHAR * word) + virtual void addWordInternal(const wchar_t * word) { if (loaded != LANGUAGE_LOADED) return; @@ -415,12 +415,12 @@ protected: hunspell->add(hunspell_word); } - void toHunspell(char *hunspellWord, const TCHAR *word, size_t hunspellWordLen) + void toHunspell(char *hunspellWord, const wchar_t *word, size_t hunspellWordLen) { WideCharToMultiByte(codePage, 0, word, -1, hunspellWord, (int)hunspellWordLen, NULL, NULL); } - TCHAR* fromHunspell(const char *hunspellWord) + wchar_t* fromHunspell(const char *hunspellWord) { int len = MultiByteToWideChar(codePage, 0, hunspellWord, -1, NULL, 0); WCHAR *ret = (WCHAR *)malloc((len + 1) * sizeof(WCHAR)); @@ -428,31 +428,31 @@ protected: return ret; } - TCHAR* fromHunspellAndFree(char *hunspellWord) + wchar_t* fromHunspellAndFree(char *hunspellWord) { if (hunspellWord == NULL) return NULL; - TCHAR *ret = fromHunspell(hunspellWord); + wchar_t *ret = fromHunspell(hunspellWord); free(hunspellWord); return ret; } public: - HunspellDictionary(TCHAR *aLanguage, TCHAR *aFileWithoutExtension, TCHAR *anUserPath, TCHAR *aSource) + HunspellDictionary(wchar_t *aLanguage, wchar_t *aFileWithoutExtension, wchar_t *anUserPath, wchar_t *aSource) { mir_tstrncpy(language, aLanguage, _countof(language)); mir_tstrncpy(fileWithoutExtension, aFileWithoutExtension, _countof(fileWithoutExtension)); mir_tstrncpy(userPath, anUserPath, _countof(userPath)); if (aSource == NULL) - source[0] = _T('\0'); + source[0] = '\0'; else mir_tstrncpy(source, aSource, _countof(source)); loaded = LANGUAGE_NOT_LOADED; - localized_name[0] = _T('\0'); - english_name[0] = _T('\0'); - full_name[0] = _T('\0'); + localized_name[0] = '\0'; + english_name[0] = '\0'; + full_name[0] = '\0'; hunspell = NULL; wordChars = NULL; codePage = CP_ACP; @@ -467,14 +467,14 @@ public: free(wordChars); } - TCHAR * merge(TCHAR * s1, TCHAR *s2) + wchar_t * merge(wchar_t * s1, wchar_t *s2) { int len1 = (s1 == NULL ? 0 : mir_tstrlen(s1)); int len2 = (s2 == NULL ? 0 : mir_tstrlen(s2)); - TCHAR *ret; + wchar_t *ret; if (len1 > 0 && len2 > 0) { - ret = (TCHAR *)malloc(sizeof(TCHAR) * (len1 + len2 + 1)); + ret = (wchar_t *)malloc(sizeof(wchar_t) * (len1 + len2 + 1)); mir_tstrncpy(ret, s1, len1 + 1); mir_tstrncpy(&ret[len1], s2, len2 + 1); @@ -490,7 +490,7 @@ public: FREE(s1); } else { - ret = (TCHAR *)malloc(sizeof(TCHAR)); + ret = (wchar_t *)malloc(sizeof(wchar_t)); ret[0] = 0; FREE(s1); @@ -500,13 +500,13 @@ public: // Remove duplicated chars int last = mir_tstrlen(ret) - 1; for (int i = 0; i <= last; i++) { - TCHAR c = ret[i]; + wchar_t c = ret[i]; for (int j = last; j > i; j--) { if (c != ret[j]) continue; if (j != last) ret[j] = ret[last]; - ret[last] = _T('\0'); + ret[last] = '\0'; last--; } } @@ -530,7 +530,7 @@ public: // Get codepage const char *dic_enc = hunspell->get_dic_encoding(); - TCHAR *hwordchars; + wchar_t *hwordchars; if (mir_strcmp(dic_enc, "UTF-8") == 0) { codePage = CP_UTF8; @@ -550,8 +550,8 @@ public: hwordchars = fromHunspell(hunspell->get_wordchars()); } - TCHAR *casechars = fromHunspellAndFree(get_casechars(dic_enc)); - TCHAR *try_string = fromHunspellAndFree(hunspell->get_try_string()); + wchar_t *casechars = fromHunspellAndFree(get_casechars(dic_enc)); + wchar_t *try_string = fromHunspellAndFree(hunspell->get_try_string()); wordChars = merge(merge(casechars, hwordchars), try_string); @@ -569,7 +569,7 @@ public: } // Return TRUE if the word is correct - virtual BOOL spell(const TCHAR *word) + virtual BOOL spell(const wchar_t *word) { load(); if (loaded != LANGUAGE_LOADED) @@ -584,7 +584,7 @@ public: } // Return a list of suggestions to a word - virtual Suggestions suggest(const TCHAR * word) + virtual Suggestions suggest(const wchar_t * word) { Suggestions ret = { 0 }; @@ -600,7 +600,7 @@ public: if (ret.count > 0 && words != NULL) { // Oki, lets make our array - ret.words = (TCHAR **)malloc(ret.count * sizeof(TCHAR *)); + ret.words = (wchar_t **)malloc(ret.count * sizeof(wchar_t *)); for (unsigned i = 0; i < ret.count; i++) { ret.words[i] = fromHunspell(words[i]); free(words[i]); @@ -613,7 +613,7 @@ public: } // Return a list of auto suggestions to a word - virtual Suggestions autoSuggest(const TCHAR * word) + virtual Suggestions autoSuggest(const wchar_t * word) { Suggestions ret = { 0 }; @@ -632,7 +632,7 @@ public: // Oki, lets make our array ret.count = count; - ret.words = (TCHAR **)malloc(ret.count * sizeof(TCHAR *)); + ret.words = (wchar_t **)malloc(ret.count * sizeof(wchar_t *)); for (int i = 0; i < count; i++) { ret.words[i] = fromHunspell(words[i]); free(words[i]); @@ -644,7 +644,7 @@ public: // Return a list of auto suggestions to a word // You have to free the list AND each item - virtual TCHAR * autoSuggestOne(const TCHAR * word) + virtual wchar_t * autoSuggestOne(const wchar_t * word) { load(); if (loaded != LANGUAGE_LOADED) @@ -659,7 +659,7 @@ public: if (count <= 0) return NULL; - TCHAR *ret = fromHunspell(words[0]); + wchar_t *ret = fromHunspell(words[0]); // Oki, lets make our array for (int i = 0; i < count; i++) @@ -670,7 +670,7 @@ public: } // Return TRUE if the char is a word char - virtual BOOL isWordChar(TCHAR c) + virtual BOOL isWordChar(wchar_t c) { if (c == 0) return FALSE; @@ -679,7 +679,7 @@ public: if (loaded != LANGUAGE_LOADED) return TRUE; - return _tcschr(wordChars, (_TINT)c) != NULL; + return wcschr(wordChars, (_TINT)c) != NULL; } // Assert that all needed data is loaded @@ -698,14 +698,14 @@ public: // Add a word to the user custom dict - virtual void addWord(const TCHAR * word) + virtual void addWord(const wchar_t * word) { addWordInternal(word); appendToCustomDict(word); } // Add a word to the list of ignored words - virtual void ignoreWord(const TCHAR * word) + virtual void ignoreWord(const wchar_t * word) { addWordInternal(word); } @@ -725,15 +725,15 @@ LIST<Dictionary> *tmp_dicts; // To get the names of the languages BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString) { - TCHAR *stopped = NULL; - USHORT langID = (USHORT)_tcstol(lpLocaleString, &stopped, 16); + wchar_t *stopped = NULL; + USHORT langID = (USHORT)wcstol(lpLocaleString, &stopped, 16); - TCHAR ini[32]; - TCHAR end[32]; + wchar_t ini[32]; + wchar_t end[32]; GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SISO639LANGNAME, ini, _countof(ini)); GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SISO3166CTRYNAME, end, _countof(end)); - TCHAR name[64]; + wchar_t name[64]; mir_sntprintf(name, L"%s_%s", ini, end); for (int i = 0; i < tmp_dicts->getCount(); i++) { @@ -747,10 +747,10 @@ BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString) if (dict->localized_name[0] == 0) GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SNATIVEDISPLAYNAME, dict->localized_name, _countof(dict->localized_name)); if (dict->localized_name[0] == 0 && dict->english_name[0] != 0) { - TCHAR country[1024]; + wchar_t country[1024]; GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SENGCOUNTRY, country, _countof(country)); - TCHAR localName[1024]; + wchar_t localName[1024]; if (country[0] != 0) mir_sntprintf(localName, L"%s (%s)", dict->english_name, country); else @@ -778,7 +778,7 @@ void GetDictsInfo(LIST<Dictionary> &dicts) for (int i = 0; i < dicts.getCount(); i++) { Dictionary *dict = dicts[i]; - if (dict->full_name[0] == _T('\0')) { + if (dict->full_name[0] == '\0') { DBVARIANT dbv; char lang[128]; @@ -788,7 +788,7 @@ void GetDictsInfo(LIST<Dictionary> &dicts) db_free(&dbv); } - if (dict->localized_name[0] == _T('\0')) { + if (dict->localized_name[0] == '\0') { for (size_t j = 0; j < _countof(aditionalLanguages); j++) { if (!mir_tstrcmp(aditionalLanguages[j].language, dict->language)) { mir_tstrncpy(dict->localized_name, TranslateTS(aditionalLanguages[j].localized_name), _countof(dict->localized_name)); @@ -797,7 +797,7 @@ void GetDictsInfo(LIST<Dictionary> &dicts) } } - if (dict->localized_name[0] != _T('\0')) { + if (dict->localized_name[0] != '\0') { mir_sntprintf(dict->full_name, L"%s [%s]", dict->localized_name, dict->language); } else { @@ -808,10 +808,10 @@ void GetDictsInfo(LIST<Dictionary> &dicts) } -void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, TCHAR *path, TCHAR *user_path, TCHAR *source) +void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, wchar_t *path, wchar_t *user_path, wchar_t *source) { // Load the language files and create an array with then - TCHAR file[1024] = { 0 }; + wchar_t file[1024] = { 0 }; mir_sntprintf(file, L"%s\\*.dic", path); BOOL found = FALSE; @@ -833,14 +833,14 @@ void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, TCHAR *path, TCH if (attrib == 0xFFFFFFFF || (attrib & FILE_ATTRIBUTE_DIRECTORY)) continue; - ffd.cFileName[mir_tstrlen(ffd.cFileName) - 4] = _T('\0'); + ffd.cFileName[mir_tstrlen(ffd.cFileName) - 4] = '\0'; - TCHAR *lang = ffd.cFileName; + wchar_t *lang = ffd.cFileName; // Replace - for _ for (size_t i = 0; i < mir_tstrlen(lang); i++) - if (lang[i] == _T('-')) - lang[i] = _T('_'); + if (lang[i] == '-') + lang[i] = '_'; // Check if dict is new bool exists = false; @@ -850,7 +850,7 @@ void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, TCHAR *path, TCH if (!exists) { found = TRUE; - file[mir_tstrlen(file) - 4] = _T('\0'); + file[mir_tstrlen(file) - 4] = '\0'; dicts.insert(new HunspellDictionary(lang, file, user_path, source)); } } while (FindNextFile(hFFD, &ffd)); @@ -861,7 +861,7 @@ void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, TCHAR *path, TCH // Return a list of avaible languages -void GetAvaibleDictionaries(LIST<Dictionary> &dicts, TCHAR *path, TCHAR *user_path) +void GetAvaibleDictionaries(LIST<Dictionary> &dicts, wchar_t *path, wchar_t *user_path) { // Get miranda folder dicts GetHunspellDictionariesFromFolder(dicts, path, user_path, NULL); @@ -869,7 +869,7 @@ void GetAvaibleDictionaries(LIST<Dictionary> &dicts, TCHAR *path, TCHAR *user_pa if (opts.use_other_apps_dicts) { // Get other apps dicts for (int i = 0; i < _countof(otherHunspellApps); i++) { - TCHAR key[1024]; + wchar_t key[1024]; mir_sntprintf(key, APPPATH, otherHunspellApps[i].key); HKEY hKey = 0; @@ -893,8 +893,8 @@ void GetAvaibleDictionaries(LIST<Dictionary> &dicts, TCHAR *path, TCHAR *user_pa if (ERROR_SUCCESS != RegEnumValue(hKey, local, key, &cchValue, NULL, NULL, NULL, NULL)) break; key[cchValue] = 0; - TCHAR *pos; - if (pos = _tcsrchr(key, _T('\\'))) { + wchar_t *pos; + if (pos = wcsrchr(key, '\\')) { if (!mir_tstrcmpi(&pos[1], otherHunspellApps[i].key)) { pos[0] = 0; lResult = ERROR_SUCCESS; @@ -907,7 +907,7 @@ void GetAvaibleDictionaries(LIST<Dictionary> &dicts, TCHAR *path, TCHAR *user_pa } if (ERROR_SUCCESS == lResult) { - TCHAR folder[1024]; + wchar_t folder[1024]; mir_sntprintf(folder, L"%s\\Dictionaries", key); GetHunspellDictionariesFromFolder(languages, folder, user_path, otherHunspellApps[i].name); diff --git a/plugins/SpellChecker/src/dictionary.h b/plugins/SpellChecker/src/dictionary.h index 09902435f6..da70a6a4c2 100644 --- a/plugins/SpellChecker/src/dictionary.h +++ b/plugins/SpellChecker/src/dictionary.h @@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA. struct Suggestions {
- TCHAR ** words;
+ wchar_t ** words;
size_t count;
};
@@ -32,37 +32,37 @@ struct Suggestions { // All dictionaries use a lazy interface
class Dictionary {
public:
- TCHAR language[128];
- TCHAR localized_name[128];
- TCHAR english_name[128];
- TCHAR full_name[256];
- TCHAR source[128];
+ wchar_t language[128];
+ wchar_t localized_name[128];
+ wchar_t english_name[128];
+ wchar_t full_name[256];
+ wchar_t source[128];
AutoReplaceMap *autoReplace;
HANDLE hIcolib;
virtual ~Dictionary();
// Return TRUE if the word is correct
- virtual BOOL spell(const TCHAR *) = 0;
+ virtual BOOL spell(const wchar_t *) = 0;
// Return a list of suggestions to a word
- virtual Suggestions suggest(const TCHAR * word) = 0;
+ virtual Suggestions suggest(const wchar_t * word) = 0;
// Return a list of auto suggestions to a word
- virtual Suggestions autoSuggest(const TCHAR * word) = 0;
+ virtual Suggestions autoSuggest(const wchar_t * word) = 0;
// Return a auto suggestions to a word
// You have to free the item
- virtual TCHAR * autoSuggestOne(const TCHAR * word) = 0;
+ virtual wchar_t * autoSuggestOne(const wchar_t * word) = 0;
// Return TRUE if the char is a word char
- virtual BOOL isWordChar(TCHAR c) = 0;
+ virtual BOOL isWordChar(wchar_t c) = 0;
// Add a word to the user custom dict
- virtual void addWord(const TCHAR * word) = 0;
+ virtual void addWord(const wchar_t * word) = 0;
// Add a word to the list of ignored words
- virtual void ignoreWord(const TCHAR * word) = 0;
+ virtual void ignoreWord(const wchar_t * word) = 0;
// Assert that all needed data is loaded
virtual void load() = 0;
@@ -74,7 +74,7 @@ public: // Return a list of avaible languages
-void GetAvaibleDictionaries(LIST<Dictionary> &dicts, TCHAR *path, TCHAR *user_path);
+void GetAvaibleDictionaries(LIST<Dictionary> &dicts, wchar_t *path, wchar_t *user_path);
// Free the list returned by GetAvaibleDictionaries
void FreeDictionaries(LIST<Dictionary> &dicts);
diff --git a/plugins/SpellChecker/src/options.cpp b/plugins/SpellChecker/src/options.cpp index ed625ab6f2..c0bc78ab5a 100644 --- a/plugins/SpellChecker/src/options.cpp +++ b/plugins/SpellChecker/src/options.cpp @@ -88,7 +88,7 @@ void LoadOptions() LoadOpts(autoReplaceControls, _countof(autoReplaceControls), MODULE_NAME);
if (languages.getCount() <= 0) {
- opts.default_language[0] = _T('\0');
+ opts.default_language[0] = '\0';
return;
}
@@ -213,7 +213,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (sel >= languages.getCount())
sel = 0;
db_set_ts(NULL, MODULE_NAME, "DefaultLanguage",
- (TCHAR *)languages[sel]->language);
+ (wchar_t *)languages[sel]->language);
mir_tstrcpy(opts.default_language, languages[sel]->language);
}
}
@@ -247,21 +247,21 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP struct AutoreplaceData
{
Dictionary *dict;
- map<tstring, AutoReplacement> autoReplaceMap;
+ map<std::wstring, AutoReplacement> autoReplaceMap;
BOOL initialized;
BOOL changed;
AutoreplaceData(Dictionary *dict) : dict(dict), initialized(FALSE), changed(FALSE) {}
- void RemoveWord(const TCHAR *aWord)
+ void RemoveWord(const wchar_t *aWord)
{
- map<tstring, AutoReplacement>::iterator it = autoReplaceMap.find(aWord);
+ map<std::wstring, AutoReplacement>::iterator it = autoReplaceMap.find(aWord);
if (it != autoReplaceMap.end())
autoReplaceMap.erase(it);
changed = TRUE;
}
- void AddWord(const TCHAR *find, const TCHAR *replace, BOOL useVars)
+ void AddWord(const wchar_t *find, const wchar_t *replace, BOOL useVars)
{
autoReplaceMap[find] = AutoReplacement(replace, useVars);
changed = TRUE;
@@ -302,26 +302,26 @@ static void LoadReplacements(HWND hwndDlg) data->initialized = TRUE;
}
- map<tstring, AutoReplacement>::iterator it = data->autoReplaceMap.begin();
+ map<std::wstring, AutoReplacement>::iterator it = data->autoReplaceMap.begin();
for (int i = 0; it != data->autoReplaceMap.end(); it++, i++) {
LVITEM item = { 0 };
item.mask = LVIF_TEXT | LVIF_PARAM;
item.iItem = i;
item.iSubItem = 0;
- item.pszText = (TCHAR *)it->first.c_str();
+ item.pszText = (wchar_t *)it->first.c_str();
item.lParam = i;
ListView_InsertItem(hList, &item);
- ListView_SetItemText(hList, i, 1, (TCHAR *)it->second.replace.c_str());
+ ListView_SetItemText(hList, i, 1, (wchar_t *)it->second.replace.c_str());
}
EnableDisableCtrls(hwndDlg);
}
static void SaveNewReplacements(BOOL canceled, Dictionary*,
- const TCHAR *find, const TCHAR *replace, BOOL useVariables,
- const TCHAR *original_find, void *param)
+ const wchar_t *find, const wchar_t *replace, BOOL useVariables,
+ const wchar_t *original_find, void *param)
{
if (canceled)
return;
@@ -342,8 +342,8 @@ static void ShowAddReplacement(HWND hwndDlg, int item = -1) AutoreplaceData *data = (AutoreplaceData *)SendDlgItemMessage(hwndDlg, IDC_LANGUAGE, CB_GETITEMDATA, sel, 0);
- TCHAR find[256];
- const TCHAR *replace = NULL;
+ wchar_t find[256];
+ const wchar_t *replace = NULL;
BOOL useVariables = FALSE;
if (item < 0)
@@ -430,7 +430,7 @@ static INT_PTR CALLBACK AutoreplaceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam sel = SendMessage(hList, LVM_GETNEXTITEM, -1, LVNI_SELECTED);
while (sel >= 0) {
- TCHAR tmp[256];
+ wchar_t tmp[256];
ListView_GetItemText(hList, sel, 0, tmp, _countof(tmp));
data->RemoveWord(tmp);
diff --git a/plugins/SpellChecker/src/options.h b/plugins/SpellChecker/src/options.h index 65e33c0f4e..8d699d4adf 100644 --- a/plugins/SpellChecker/src/options.h +++ b/plugins/SpellChecker/src/options.h @@ -31,7 +31,7 @@ Boston, MA 02111-1307, USA. struct Options
{
- TCHAR default_language[32];
+ wchar_t default_language[32];
BOOL auto_replace_dict;
BOOL auto_replace_user;
BOOL ignore_uppercase;
diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp index 7d12a021f5..e6217118c4 100644 --- a/plugins/SpellChecker/src/spellchecker.cpp +++ b/plugins/SpellChecker/src/spellchecker.cpp @@ -40,13 +40,13 @@ HINSTANCE hInst; int hLangpack = 0; HANDLE hDictionariesFolder = NULL; -TCHAR *dictionariesFolder; +wchar_t *dictionariesFolder; HANDLE hCustomDictionariesFolder = NULL; -TCHAR *customDictionariesFolder; +wchar_t *customDictionariesFolder; HANDLE hFlagsDllFolder = NULL; -TCHAR *flagsDllFolder; +wchar_t *flagsDllFolder; HBITMAP hCheckedBmp; BITMAP bmpChecked; @@ -79,7 +79,7 @@ static int IconsChanged(WPARAM, LPARAM) for (int i = 0; i < languages.getCount(); i++) { sid.dwId = i; - TCHAR tmp[128]; + wchar_t tmp[128]; mir_sntprintf(tmp, L"%s - %s", TranslateT("Spell Checker"), languages[i]->full_name); sid.tszTooltip = tmp; @@ -108,19 +108,19 @@ static int ModulesLoaded(WPARAM, LPARAM) // Folders plugin support if (hDictionariesFolder = FoldersRegisterCustomPathT(LPGEN("Spell Checker"), LPGEN("Dictionaries"), DICTIONARIES_FOLDER)) { - dictionariesFolder = (TCHAR *)mir_alloc(sizeof(TCHAR) * MAX_PATH); + dictionariesFolder = (wchar_t *)mir_alloc(sizeof(wchar_t) * MAX_PATH); FoldersGetCustomPathT(hDictionariesFolder, dictionariesFolder, MAX_PATH, L"."); } else dictionariesFolder = Utils_ReplaceVarsT(DICTIONARIES_FOLDER); if (hCustomDictionariesFolder = FoldersRegisterCustomPathT(LPGEN("Spell Checker"), LPGEN("Custom Dictionaries"), CUSTOM_DICTIONARIES_FOLDER)) { - customDictionariesFolder = (TCHAR *)mir_alloc(sizeof(TCHAR) * MAX_PATH); + customDictionariesFolder = (wchar_t *)mir_alloc(sizeof(wchar_t) * MAX_PATH); FoldersGetCustomPathT(hCustomDictionariesFolder, customDictionariesFolder, MAX_PATH, L"."); } else customDictionariesFolder = Utils_ReplaceVarsT(CUSTOM_DICTIONARIES_FOLDER); if (hFlagsDllFolder = FoldersRegisterCustomPathT(LPGEN("Spell Checker"), LPGEN("Flags DLL"), FLAGS_DLL_FOLDER)) { - flagsDllFolder = (TCHAR *)mir_alloc(sizeof(TCHAR) * MAX_PATH); + flagsDllFolder = (wchar_t *)mir_alloc(sizeof(wchar_t) * MAX_PATH); FoldersGetCustomPathT(hFlagsDllFolder, flagsDllFolder, MAX_PATH, L"."); } else flagsDllFolder = Utils_ReplaceVarsT(FLAGS_DLL_FOLDER); @@ -133,21 +133,21 @@ static int ModulesLoaded(WPARAM, LPARAM) if (opts.use_flags) { // Load flags dll - TCHAR flag_file[MAX_PATH]; + wchar_t flag_file[MAX_PATH]; mir_sntprintf(flag_file, L"%s\\flags_icons.dll", flagsDllFolder); HMODULE hFlagsDll = LoadLibraryEx(flag_file, NULL, LOAD_LIBRARY_AS_DATAFILE); - TCHAR path[MAX_PATH]; + wchar_t path[MAX_PATH]; GetModuleFileName(hInst, path, MAX_PATH); SKINICONDESC sid = { 0 }; sid.flags = SIDF_ALL_TCHAR | SIDF_SORTED; - sid.section.t = LPGENT("Spell Checker") L"/" LPGENT("Flags"); + sid.section.w = LPGENW("Spell Checker") L"/" LPGENW("Flags"); // Get language flags for (int i = 0; i < languages.getCount(); i++) { Dictionary *p = languages[i]; - sid.description.t = p->full_name; + sid.description.w = p->full_name; char lang[32]; mir_snprintf(lang, "spell_lang_%d", i); @@ -159,13 +159,13 @@ static int ModulesLoaded(WPARAM, LPARAM) if (hFlag != NULL) { sid.hDefaultIcon = hFlag; - sid.defaultFile.t = NULL; + sid.defaultFile.w = NULL; sid.iDefaultIndex = 0; } else { hFlagIcoLib = IcoLib_GetIcon("spellchecker_unknown"); sid.hDefaultIcon = hFlagIcoLib; - sid.defaultFile.t = NULL; + sid.defaultFile.w = NULL; sid.iDefaultIndex = 0; } @@ -183,7 +183,7 @@ static int ModulesLoaded(WPARAM, LPARAM) for (int j = 0; j < languages.getCount(); j++) { Dictionary *dict = languages[j]; - TCHAR filename[MAX_PATH]; + wchar_t filename[MAX_PATH]; mir_sntprintf(filename, L"%s\\%s.ar", customDictionariesFolder, dict->language); dict->autoReplace = new AutoReplaceMap(filename, dict); @@ -204,7 +204,7 @@ static int ModulesLoaded(WPARAM, LPARAM) for (int i = 0; i < languages.getCount(); i++) { sid.dwId = i; - TCHAR tmp[128]; + wchar_t tmp[128]; mir_sntprintf(tmp, L"%s - %s", TranslateT("Spell Checker"), languages[i]->full_name); sid.tszTooltip = tmp; sid.hIcon = (opts.use_flags) ? IcoLib_GetIconByHandle(languages[i]->hIcolib) : IcoLib_GetIcon("spellchecker_enabled"); diff --git a/plugins/SpellChecker/src/stdafx.h b/plugins/SpellChecker/src/stdafx.h index 66e5e39f3f..ea4ea9b6bc 100644 --- a/plugins/SpellChecker/src/stdafx.h +++ b/plugins/SpellChecker/src/stdafx.h @@ -96,7 +96,7 @@ extern HBITMAP hCheckedBmp; struct WrongWordPopupMenuData
{
Suggestions suggestions;
- TCHAR *word;
+ wchar_t *word;
CHARRANGE pos;
HMENU hMeSubMenu;
HMENU hCorrectSubMenu;
@@ -110,7 +110,7 @@ struct Dialog MCONTACT hContact;
char name[64];
Dictionary *lang;
- TCHAR lang_name[32];
+ wchar_t lang_name[32];
BOOL enabled;
BOOL srmm;
@@ -129,11 +129,11 @@ struct Dialog };
static BOOL CenterParent(HWND hwnd);
-TCHAR *lstrtrim(TCHAR *str);
-BOOL lstreq(TCHAR *a, TCHAR *b, size_t len = -1);
-inline BOOL IsNumber(TCHAR c)
+wchar_t *lstrtrim(wchar_t *str);
+BOOL lstreq(wchar_t *a, wchar_t *b, size_t len = -1);
+inline BOOL IsNumber(wchar_t c)
{
- return c >= _T('0') && c <= _T('9');
+ return c >= '0' && c <= '9';
}
int MsgWindowEvent(WPARAM wParam, LPARAM lParam);
@@ -151,9 +151,9 @@ INT_PTR ShowPopupMenuService(WPARAM wParam, LPARAM lParam); LRESULT CALLBACK MenuWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
void ModifyIcon(Dialog *dlg);
-BOOL GetWordCharRange(Dialog *dlg, CHARRANGE &sel, TCHAR *text, size_t text_len, int &first_char);
-TCHAR *GetWordUnderPoint(Dialog *dlg, POINT pt, CHARRANGE &sel);
+BOOL GetWordCharRange(Dialog *dlg, CHARRANGE &sel, wchar_t *text, size_t text_len, int &first_char);
+wchar_t *GetWordUnderPoint(Dialog *dlg, POINT pt, CHARRANGE &sel);
-int GetClosestLanguage(TCHAR *lang_name);
+int GetClosestLanguage(wchar_t *lang_name);
#endif // __COMMONS_H__
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index 7242f0c98c..7df9b00d14 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -19,7 +19,7 @@ Boston, MA 02111-1307, USA. #include "stdafx.h"
-typedef void(*FoundWrongWordCallback)(TCHAR *word, CHARRANGE pos, void *param);
+typedef void(*FoundWrongWordCallback)(wchar_t *word, CHARRANGE pos, void *param);
typedef map<HWND, Dialog *> DialogMapType;
DialogMapType dialogs;
@@ -95,20 +95,20 @@ void SetNoUnderline(Dialog *dlg) dlg->re->Start();
}
-inline BOOL IsURL(TCHAR c)
+inline BOOL IsURL(wchar_t c)
{
- return (c >= _T('a') && c <= _T('z'))
- || (c >= _T('A') && c <= _T('Z'))
+ return (c >= 'a' && c <= 'z')
+ || (c >= 'A' && c <= 'Z')
|| IsNumber(c)
- || c == _T('.') || c == _T('/')
- || c == _T('\\') || c == _T('?')
- || c == _T('=') || c == _T('&')
- || c == _T('%') || c == _T('-')
- || c == _T('_') || c == _T(':')
- || c == _T('@') || c == _T('#');
+ || c == '.' || c == '/'
+ || c == '\\' || c == '?'
+ || c == '=' || c == '&'
+ || c == '%' || c == '-'
+ || c == '_' || c == ':'
+ || c == '@' || c == '#';
}
-int FindURLEnd(Dialog *dlg, TCHAR *text, int start_pos, int *checked_until = NULL)
+int FindURLEnd(Dialog *dlg, wchar_t *text, int start_pos, int *checked_until = NULL)
{
int num_slashes = 0;
int num_ats = 0;
@@ -117,12 +117,12 @@ int FindURLEnd(Dialog *dlg, TCHAR *text, int start_pos, int *checked_until = NUL int i = start_pos;
for (; IsURL(text[i]) || dlg->lang->isWordChar(text[i]); i++) {
- TCHAR c = text[i];
- if (c == _T('\\') || c == _T('/'))
+ wchar_t c = text[i];
+ if (c == '\\' || c == '/')
num_slashes++;
- else if (c == _T('.'))
+ else if (c == '.')
num_dots++;
- else if (c == _T('@'))
+ else if (c == '@')
num_ats++;
}
@@ -142,7 +142,7 @@ int FindURLEnd(Dialog *dlg, TCHAR *text, int start_pos, int *checked_until = NUL }
-int ReplaceWord(Dialog *dlg, CHARRANGE &sel, TCHAR *new_word)
+int ReplaceWord(Dialog *dlg, CHARRANGE &sel, wchar_t *new_word)
{
dlg->re->Stop();
dlg->re->ResumeUndo();
@@ -161,10 +161,10 @@ public: virtual ~TextParser() {}
/// @return true when finished an word
- virtual bool feed(int pos, TCHAR c) = 0;
+ virtual bool feed(int pos, wchar_t c) = 0;
virtual int getFirstCharPos() = 0;
virtual void reset() = 0;
- virtual void deal(const TCHAR *text, bool *mark, bool *replace, TCHAR **replacement) = 0;
+ virtual void deal(const wchar_t *text, bool *mark, bool *replace, wchar_t **replacement) = 0;
};
class SpellParser : public TextParser
@@ -185,14 +185,14 @@ public: found_real_char = FALSE;
}
- virtual bool feed(int pos, TCHAR c)
+ virtual bool feed(int pos, wchar_t c)
{
// Is inside a word?
if (dict->isWordChar(c) || IsNumber(c)) {
if (last_pos == -1)
last_pos = pos;
- if (c != _T('-') && !IsNumber(c))
+ if (c != '-' && !IsNumber(c))
found_real_char = TRUE;
return false;
@@ -209,7 +209,7 @@ public: return (!found_real_char) ? -1 : last_pos;
}
- virtual void deal(const TCHAR *text, bool *mark, bool *replace, TCHAR **replacement)
+ virtual void deal(const wchar_t *text, bool *mark, bool *replace, wchar_t **replacement)
{
// Is it correct?
if (dict->spell(text))
@@ -244,7 +244,7 @@ public: last_pos = -1;
}
- virtual bool feed(int pos, TCHAR c)
+ virtual bool feed(int pos, wchar_t c)
{
// Is inside a word?
if (ar->isWordChar(c)) {
@@ -261,7 +261,7 @@ public: return last_pos;
}
- virtual void deal(const TCHAR *text, bool*, bool *replace, TCHAR **replacement)
+ virtual void deal(const wchar_t *text, bool*, bool *replace, wchar_t **replacement)
{
*replacement = ar->autoReplace(text);
if (*replacement != NULL)
@@ -274,7 +274,7 @@ int CheckTextLine(Dialog *dlg, int line, TextParser *parser, const CHARRANGE &ignored, FoundWrongWordCallback callback, void *param)
{
int errors = 0;
- TCHAR text[1024];
+ wchar_t text[1024];
dlg->re->GetLine(line, text, _countof(text));
int len = mir_tstrlen(text);
int first_char = dlg->re->GetFirstCharOfLine(line);
@@ -312,7 +312,7 @@ int CheckTextLine(Dialog *dlg, int line, TextParser *parser, }
}
else {
- TCHAR c = text[pos];
+ wchar_t c = text[pos];
BOOL feed = parser->feed(pos, c);
if (!feed) {
@@ -356,7 +356,7 @@ int CheckTextLine(Dialog *dlg, int line, TextParser *parser, bool mark = false;
bool replace = false;
- TCHAR *replacement = NULL;
+ wchar_t *replacement = NULL;
parser->deal(&text[last_pos], &mark, &replace, &replacement);
if (replace) {
@@ -431,12 +431,12 @@ int CheckText(Dialog *dlg, BOOL check_all, FoundWrongWordCallback callback = NUL return errors;
}
-void ToLocaleID(TCHAR *szKLName, size_t size)
+void ToLocaleID(wchar_t *szKLName, size_t size)
{
- TCHAR *stopped = NULL;
- USHORT langID = (USHORT)_tcstol(szKLName, &stopped, 16);
+ wchar_t *stopped = NULL;
+ USHORT langID = (USHORT)wcstol(szKLName, &stopped, 16);
- TCHAR ini[32], end[32];
+ wchar_t ini[32], end[32];
GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SISO639LANGNAME, ini, _countof(ini));
GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SISO3166CTRYNAME, end, _countof(end));
@@ -445,7 +445,7 @@ void ToLocaleID(TCHAR *szKLName, size_t size) void LoadDictFromKbdl(Dialog *dlg)
{
- TCHAR szKLName[KL_NAMELENGTH + 1];
+ wchar_t szKLName[KL_NAMELENGTH + 1];
// Use default input language
HKL hkl = GetKeyboardLayout(0);
@@ -500,7 +500,7 @@ LRESULT CALLBACK OwnerProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (opts.ask_when_sending_with_error) {
int errors = TimerCheck(dlg, TRUE);
if (errors > 0) {
- TCHAR text[500];
+ wchar_t text[500];
mir_sntprintf(text, TranslateT("There are %d spelling errors. Are you sure you want to send this message?"), errors);
if (MessageBox(hwnd, text, TranslateT("Spell Checker"), MB_ICONQUESTION | MB_YESNO) == IDNO)
return TRUE;
@@ -584,7 +584,7 @@ LRESULT CALLBACK EditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) break;
{
- TCHAR c = (TCHAR)wParam;
+ wchar_t c = (wchar_t)wParam;
BOOL deleting = (c == VK_BACK || c == VK_DELETE);
// Need to do that to avoid changing the word while typing
@@ -616,7 +616,7 @@ LRESULT CALLBACK EditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) CHARRANGE sel = dlg->re->GetSel();
- TCHAR text[1024];
+ wchar_t text[1024];
int first_char;
GetWordCharRange(dlg, sel, text, _countof(text), first_char);
@@ -674,7 +674,7 @@ LRESULT CALLBACK EditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) return ret;
}
-int GetClosestLanguage(TCHAR *lang_name)
+int GetClosestLanguage(wchar_t *lang_name)
{
int i;
@@ -684,11 +684,11 @@ int GetClosestLanguage(TCHAR *lang_name) return i;
// Try searching by the prefix only
- TCHAR lang[128];
+ wchar_t lang[128];
mir_tstrncpy(lang, lang_name, _countof(lang));
{
- TCHAR *p = _tcschr(lang, _T('_'));
- if (p != NULL) *p = _T('\0');
+ wchar_t *p = wcschr(lang, '_');
+ if (p != NULL) *p = '\0';
}
// First check if there is a language that is only the prefix
@@ -699,7 +699,7 @@ int GetClosestLanguage(TCHAR *lang_name) // Now try any suffix
size_t len = mir_tstrlen(lang);
for (i = 0; i < languages.getCount(); i++) {
- TCHAR *p = _tcschr(languages[i]->language, _T('_'));
+ wchar_t *p = wcschr(languages[i]->language, '_');
if (p == NULL)
continue;
@@ -707,7 +707,7 @@ int GetClosestLanguage(TCHAR *lang_name) if (prefix_len != len)
continue;
- if (_tcsnicmp(languages[i]->language, lang_name, len) == 0)
+ if (wcsnicmp(languages[i]->language, lang_name, len) == 0)
return i;
}
@@ -734,7 +734,7 @@ void GetUserProtoLanguageSetting(Dialog *dlg, MCONTACT hContact, char *group, ch }
if (dbv.type == DBVT_TCHAR && dbv.ptszVal != NULL) {
- TCHAR *lang = dbv.ptszVal;
+ wchar_t *lang = dbv.ptszVal;
for (int i = 0; i < languages.getCount(); i++) {
Dictionary *dict = languages[i];
@@ -756,18 +756,18 @@ void GetUserLanguageSetting(Dialog *dlg, char *setting) return;
GetUserProtoLanguageSetting(dlg, dlg->hContact, proto, setting);
- if (dlg->lang_name[0] != _T('\0'))
+ if (dlg->lang_name[0] != '\0')
return;
GetUserProtoLanguageSetting(dlg, dlg->hContact, "UserInfo", setting, FALSE);
- if (dlg->lang_name[0] != _T('\0'))
+ if (dlg->lang_name[0] != '\0')
return;
// If not found and is inside meta, try to get from the meta
MCONTACT hMetaContact = db_mc_getMeta(dlg->hContact);
if (hMetaContact != NULL) {
GetUserProtoLanguageSetting(dlg, hMetaContact, META_PROTO, setting);
- if (dlg->lang_name[0] != _T('\0'))
+ if (dlg->lang_name[0] != '\0')
return;
GetUserProtoLanguageSetting(dlg, hMetaContact, "UserInfo", setting, FALSE);
@@ -778,7 +778,7 @@ void GetContactLanguage(Dialog *dlg) {
DBVARIANT dbv = { 0 };
- dlg->lang_name[0] = _T('\0');
+ dlg->lang_name[0] = '\0';
if (dlg->hContact == NULL) {
if (!db_get_ts(NULL, MODULE_NAME, dlg->name, &dbv)) {
@@ -792,13 +792,13 @@ void GetContactLanguage(Dialog *dlg) db_free(&dbv);
}
- if (dlg->lang_name[0] == _T('\0') && !db_get_ts(dlg->hContact, "eSpeak", "TalkLanguage", &dbv)) {
+ if (dlg->lang_name[0] == '\0' && !db_get_ts(dlg->hContact, "eSpeak", "TalkLanguage", &dbv)) {
mir_tstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
// Try from metacontact
- if (dlg->lang_name[0] == _T('\0')) {
+ if (dlg->lang_name[0] == '\0') {
MCONTACT hMetaContact = db_mc_getMeta(dlg->hContact);
if (hMetaContact != NULL) {
if (!db_get_ts(hMetaContact, MODULE_NAME, "TalkLanguage", &dbv)) {
@@ -806,7 +806,7 @@ void GetContactLanguage(Dialog *dlg) db_free(&dbv);
}
- if (dlg->lang_name[0] == _T('\0') && !db_get_ts(hMetaContact, "eSpeak", "TalkLanguage", &dbv)) {
+ if (dlg->lang_name[0] == '\0' && !db_get_ts(hMetaContact, "eSpeak", "TalkLanguage", &dbv)) {
mir_tstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
@@ -814,17 +814,17 @@ void GetContactLanguage(Dialog *dlg) }
// Try to get from Language info
- if (dlg->lang_name[0] == _T('\0'))
+ if (dlg->lang_name[0] == '\0')
GetUserLanguageSetting(dlg, "Language");
- if (dlg->lang_name[0] == _T('\0'))
+ if (dlg->lang_name[0] == '\0')
GetUserLanguageSetting(dlg, "Language1");
- if (dlg->lang_name[0] == _T('\0'))
+ if (dlg->lang_name[0] == '\0')
GetUserLanguageSetting(dlg, "Language2");
- if (dlg->lang_name[0] == _T('\0'))
+ if (dlg->lang_name[0] == '\0')
GetUserLanguageSetting(dlg, "Language3");
// Use default lang
- if (dlg->lang_name[0] == _T('\0'))
+ if (dlg->lang_name[0] == '\0')
mir_tstrncpy(dlg->lang_name, opts.default_language, _countof(dlg->lang_name));
}
@@ -973,7 +973,7 @@ int RemoveContactTextBox(HWND hwnd) }
// TODO Make this better
-BOOL GetWordCharRange(Dialog *dlg, CHARRANGE &sel, TCHAR *text, size_t text_len, int &first_char)
+BOOL GetWordCharRange(Dialog *dlg, CHARRANGE &sel, wchar_t *text, size_t text_len, int &first_char)
{
// Get line
int line = dlg->re->GetLineFromChar(sel.cpMin);
@@ -989,7 +989,7 @@ BOOL GetWordCharRange(Dialog *dlg, CHARRANGE &sel, TCHAR *text, size_t text_len, sel.cpMin--;
sel.cpMin++;
- while (text[sel.cpMax - first_char] != _T('\0') && (dlg->lang->isWordChar(text[sel.cpMax - first_char])
+ while (text[sel.cpMax - first_char] != '\0' && (dlg->lang->isWordChar(text[sel.cpMax - first_char])
|| IsNumber(text[sel.cpMax - first_char])))
sel.cpMax++;
@@ -1000,12 +1000,12 @@ BOOL GetWordCharRange(Dialog *dlg, CHARRANGE &sel, TCHAR *text, size_t text_len, // See if it has only '-'s
BOOL has_valid_char = FALSE;
for (int i = sel.cpMin; i < sel.cpMax && !has_valid_char; i++)
- has_valid_char = (text[i - first_char] != _T('-'));
+ has_valid_char = (text[i - first_char] != '-');
return has_valid_char;
}
-TCHAR *GetWordUnderPoint(Dialog *dlg, POINT pt, CHARRANGE &sel)
+wchar_t *GetWordUnderPoint(Dialog *dlg, POINT pt, CHARRANGE &sel)
{
// Get text
if (dlg->re->GetTextLength() <= 0)
@@ -1015,19 +1015,19 @@ TCHAR *GetWordUnderPoint(Dialog *dlg, POINT pt, CHARRANGE &sel) sel.cpMin = sel.cpMax = dlg->re->GetCharFromPos(pt);
// Get text
- TCHAR text[1024];
+ wchar_t text[1024];
int first_char;
if (!GetWordCharRange(dlg, sel, text, _countof(text), first_char))
return NULL;
// copy the word
- text[sel.cpMax - first_char] = _T('\0');
- return _tcsdup(&text[sel.cpMin - first_char]);
+ text[sel.cpMax - first_char] = '\0';
+ return wcsdup(&text[sel.cpMin - first_char]);
}
-void AppendSubmenu(HMENU hMenu, HMENU hSubMenu, TCHAR *name)
+void AppendSubmenu(HMENU hMenu, HMENU hSubMenu, wchar_t *name)
{
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -1039,7 +1039,7 @@ void AppendSubmenu(HMENU hMenu, HMENU hSubMenu, TCHAR *name) InsertMenuItem(hMenu, 0, TRUE, &mii);
}
-void AppendMenuItem(HMENU hMenu, int id, TCHAR *name, HICON hIcon, BOOL checked)
+void AppendMenuItem(HMENU hMenu, int id, wchar_t *name, HICON hIcon, BOOL checked)
{
ICONINFO iconInfo;
GetIconInfo(hIcon, &iconInfo);
@@ -1061,7 +1061,7 @@ void AppendMenuItem(HMENU hMenu, int id, TCHAR *name, HICON hIcon, BOOL checked) #define WORD_MENU_ID_BASE 100
#define AUTOREPLACE_MENU_ID_BASE 50
-void AddMenuForWord(Dialog *dlg, TCHAR *word, CHARRANGE &pos, HMENU hMenu, BOOL in_submenu, UINT base)
+void AddMenuForWord(Dialog *dlg, wchar_t *word, CHARRANGE &pos, HMENU hMenu, BOOL in_submenu, UINT base)
{
if (dlg->wrong_words == NULL)
dlg->wrong_words = new vector<WrongWordPopupMenuData>(1);
@@ -1116,7 +1116,7 @@ void AddMenuForWord(Dialog *dlg, TCHAR *word, CHARRANGE &pos, HMENU hMenu, BOOL if (!in_submenu && opts.show_wrong_word) {
InsertMenu(hMenu, 0, MF_BYPOSITION | MF_SEPARATOR, 0, 0);
- TCHAR text[128];
+ wchar_t text[128];
mir_sntprintf(text, TranslateT("Wrong word: %s"), word);
InsertMenu(hMenu, 0, MF_BYPOSITION, 0, text);
}
@@ -1128,13 +1128,13 @@ struct FoundWrongWordParam int count;
};
-void FoundWrongWord(TCHAR *word, CHARRANGE pos, void *param)
+void FoundWrongWord(wchar_t *word, CHARRANGE pos, void *param)
{
FoundWrongWordParam *p = (FoundWrongWordParam*)param;
p->count++;
- AddMenuForWord(p->dlg, _tcsdup(word), pos, p->dlg->hWrongWordsSubMenu, TRUE, WORD_MENU_ID_BASE * p->count);
+ AddMenuForWord(p->dlg, wcsdup(word), pos, p->dlg->hWrongWordsSubMenu, TRUE, WORD_MENU_ID_BASE * p->count);
}
void AddItemsToMenu(Dialog *dlg, HMENU hMenu, POINT pt, HWND hwndOwner)
@@ -1179,7 +1179,7 @@ void AddItemsToMenu(Dialog *dlg, HMENU hMenu, POINT pt, HWND hwndOwner) }
else {
CHARRANGE sel;
- TCHAR *word = GetWordUnderPoint(dlg, pt, sel);
+ wchar_t *word = GetWordUnderPoint(dlg, pt, sel);
if (word != NULL && !dlg->lang->spell(word)) {
InsertMenu(hMenu, 0, MF_BYPOSITION | MF_SEPARATOR, 0, 0);
AddMenuForWord(dlg, word, sel, hMenu, FALSE, WORD_MENU_ID_BASE);
@@ -1190,8 +1190,8 @@ void AddItemsToMenu(Dialog *dlg, HMENU hMenu, POINT pt, HWND hwndOwner) static void AddWordToDictCallback(BOOL canceled, Dictionary *dict,
- const TCHAR *find, const TCHAR *replace, BOOL useVariables,
- const TCHAR *, void *param)
+ const wchar_t *find, const wchar_t *replace, BOOL useVariables,
+ const wchar_t *, void *param)
{
if (canceled)
return;
@@ -1549,7 +1549,7 @@ LRESULT CALLBACK MenuWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) return mir_callNextSubclass(hwnd, MenuWndProc, msg, wParam, lParam);
}
-TCHAR* lstrtrim(TCHAR *str)
+wchar_t* lstrtrim(wchar_t *str)
{
int len = mir_tstrlen(str);
@@ -1557,22 +1557,22 @@ TCHAR* lstrtrim(TCHAR *str) for (i = len - 1; i >= 0 && (str[i] == ' ' || str[i] == '\t'); --i);
if (i < len - 1) {
++i;
- str[i] = _T('\0');
+ str[i] = '\0';
len = i;
}
for (i = 0; i < len && (str[i] == ' ' || str[i] == '\t'); ++i);
if (i > 0)
- memmove(str, &str[i], (len - i + 1) * sizeof(TCHAR));
+ memmove(str, &str[i], (len - i + 1) * sizeof(wchar_t));
return str;
}
-BOOL lstreq(TCHAR *a, TCHAR *b, size_t len)
+BOOL lstreq(wchar_t *a, wchar_t *b, size_t len)
{
- a = CharLower(_tcsdup(a));
- b = CharLower(_tcsdup(b));
- BOOL ret = len ? !_tcsncmp(a, b, len) : !mir_tstrcmp(a, b);
+ a = CharLower(wcsdup(a));
+ b = CharLower(wcsdup(b));
+ BOOL ret = len ? !wcsncmp(a, b, len) : !mir_tstrcmp(a, b);
free(a);
free(b);
return ret;
diff --git a/plugins/SplashScreen/src/bitmap_funcs.cpp b/plugins/SplashScreen/src/bitmap_funcs.cpp index 33ef919c64..9c89965cbe 100644 --- a/plugins/SplashScreen/src/bitmap_funcs.cpp +++ b/plugins/SplashScreen/src/bitmap_funcs.cpp @@ -38,7 +38,7 @@ MyBitmap::MyBitmap(int w, int h) allocate(w, h);
}
-MyBitmap::MyBitmap(TCHAR *fn)
+MyBitmap::MyBitmap(wchar_t *fn)
{
dcBmp = 0;
hBmp = 0;
@@ -118,7 +118,7 @@ void MyBitmap::restoreAlpha(int x, int y, int w, int h) bitsSave = 0;
}
-void MyBitmap::DrawText(TCHAR *str, int x, int y)
+void MyBitmap::DrawText(wchar_t *str, int x, int y)
{
SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_tstrlen(str), &sz);
RECT rc; SetRect(&rc, x, y, x + 10000, y + 10000);
@@ -127,7 +127,7 @@ void MyBitmap::DrawText(TCHAR *str, int x, int y) this->restoreAlpha(x - 2, y - 2, sz.cx + 2, sz.cy + 2);
}
-bool MyBitmap::loadFromFile(TCHAR *fn)
+bool MyBitmap::loadFromFile(wchar_t *fn)
{
if (bits) free();
diff --git a/plugins/SplashScreen/src/bitmap_funcs.h b/plugins/SplashScreen/src/bitmap_funcs.h index 35be6683db..851b746e4d 100644 --- a/plugins/SplashScreen/src/bitmap_funcs.h +++ b/plugins/SplashScreen/src/bitmap_funcs.h @@ -26,10 +26,10 @@ private: public:
MyBitmap();
MyBitmap(int w, int h);
- MyBitmap(TCHAR *fn);
+ MyBitmap(wchar_t *fn);
~MyBitmap();
- bool loadFromFile(TCHAR *fn);
+ bool loadFromFile(wchar_t *fn);
int getWidth() { return width; }
int getHeight() { return height; }
@@ -43,7 +43,7 @@ public: void saveAlpha(int x = 0, int y = 0, int w = 0, int h = 0);
void restoreAlpha(int x = 0, int y = 0, int w = 0, int h = 0);
- void DrawText(TCHAR *str, int x, int y);
+ void DrawText(wchar_t *str, int x, int y);
inline COLOR32 *getBits() { return bits; }
inline COLOR32 *getRow(int row) { return bits + row * width; }
diff --git a/plugins/SplashScreen/src/debug.h b/plugins/SplashScreen/src/debug.h index 3132433ccb..c283bd30d9 100644 --- a/plugins/SplashScreen/src/debug.h +++ b/plugins/SplashScreen/src/debug.h @@ -2,7 +2,7 @@ #define __debug_h__
#define PlugName "SplashScreen"
-extern TCHAR szLogFile[MAX_PATH];
+extern wchar_t szLogFile[MAX_PATH];
/*
* output a notification message.
@@ -11,10 +11,10 @@ extern TCHAR szLogFile[MAX_PATH]; *
*/
-int inline _DebugPopup(MCONTACT hContact, TCHAR *fmt, ...)
+int inline _DebugPopup(MCONTACT hContact, wchar_t *fmt, ...)
{
va_list va;
- TCHAR debug[1024];
+ wchar_t debug[1024];
va_start(va, fmt);
mir_sntprintf(debug, fmt, va);
@@ -24,9 +24,9 @@ int inline _DebugPopup(MCONTACT hContact, TCHAR *fmt, ...) ppd.lchContact = hContact;
ppd.lchIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
if(hContact != 0)
- mir_tstrncpy(ppd.lptzContactName, (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
+ mir_tstrncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
else
- mir_tstrncpy(ppd.lptzContactName, _T(PlugName), MAX_CONTACTNAME);
+ mir_tstrncpy(ppd.lptzContactName, _A2W(PlugName), MAX_CONTACTNAME);
mir_tstrncpy(ppd.lptzText, debug, MAX_SECONDLINE - 20);
ppd.colorText = RGB(255,255,255);
ppd.colorBack = RGB(255,0,0);
@@ -41,7 +41,7 @@ int inline _DebugPopup(MCONTACT hContact, TCHAR *fmt, ...) int inline initLog()
{
- fclose(_tfopen(szLogFile, L"w"));
+ fclose(_wfopen(szLogFile, L"w"));
return 0;
}
@@ -49,10 +49,10 @@ int inline initLog() * logging func
*/
-void inline logMessage(TCHAR *func, TCHAR *msg)
+void inline logMessage(wchar_t *func, wchar_t *msg)
{
- FILE *f = _tfopen(szLogFile, L"a");
- _ftprintf(f, L"%s:\t\t%s\n", func, msg);
+ FILE *f = _wfopen(szLogFile, L"a");
+ fwprintf(f, L"%s:\t\t%s\n", func, msg);
fclose(f);
}
diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp index 74eeb0ff7c..0a88380ac3 100644 --- a/plugins/SplashScreen/src/main.cpp +++ b/plugins/SplashScreen/src/main.cpp @@ -31,11 +31,11 @@ BOOL bmodulesloaded = false; // modules are loaded BOOL png2dibavail = true; // can we use png2dib service?
// path to miranda's dir, config file path, splash path, sound path
-TCHAR szDllName[MAX_PATH], szSplashFile[MAX_PATH], szSoundFile[MAX_PATH], szhAdvaimgPath[MAX_PATH], szPrefix[128], inBuf[80];
-TCHAR *szMirDir;
+wchar_t szDllName[MAX_PATH], szSplashFile[MAX_PATH], szSoundFile[MAX_PATH], szhAdvaimgPath[MAX_PATH], szPrefix[128], inBuf[80];
+wchar_t *szMirDir;
char szVersion[MAX_PATH];
#ifdef _DEBUG
-TCHAR szLogFile[MAX_PATH];
+wchar_t szLogFile[MAX_PATH];
#endif
SPLASHOPTS options;
HWND hwndSplash;
@@ -69,12 +69,12 @@ void SplashMain() CallService(MS_SYSTEM_GETVERSIONTEXT, MAX_PATH, (LPARAM)szVersion);
#ifdef _DEBUG
- mir_sntprintf(szLogFile, L"%s\\%s.log", szMirDir, _T(__PLUGIN_NAME));
+ mir_sntprintf(szLogFile, L"%s\\%s.log", szMirDir, _A2W(__PLUGIN_NAME));
initLog();
- TCHAR *mirandaVerString = mir_a2t(szVersion);
+ wchar_t *mirandaVerString = mir_a2t(szVersion);
logMessage(L"Miranda version", mirandaVerString);
mir_free(mirandaVerString);
- logMessage(L"Dll Name", _T(__FILENAME));
+ logMessage(L"Dll Name", _A2W(__FILENAME));
logMessage(L"Advaimg path", szhAdvaimgPath);
#endif
@@ -94,15 +94,14 @@ void SplashMain() mir_tstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
- else
- mir_tstrcpy(inBuf, L"splash\\splash.png");
+ else mir_tstrcpy(inBuf, L"splash\\splash.png");
- TCHAR szExpandedSplashFile[MAX_PATH];
+ wchar_t szExpandedSplashFile[MAX_PATH];
ExpandEnvironmentStrings(inBuf, szExpandedSplashFile, _countof(szExpandedSplashFile));
mir_tstrcpy(inBuf, szExpandedSplashFile);
- TCHAR *pos3 = 0;
- pos3 = _tcsrchr(inBuf, _T(':'));
+ wchar_t *pos3 = 0;
+ pos3 = wcsrchr(inBuf, ':');
if (pos3 == NULL)
mir_sntprintf(szSplashFile, L"%s\\%s", szMirDir, inBuf);
else
@@ -112,15 +111,14 @@ void SplashMain() mir_tstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
- else
- mir_tstrcpy(inBuf, L"sounds\\startup.wav");
+ else mir_tstrcpy(inBuf, L"sounds\\startup.wav");
- TCHAR szExpandedSoundFile[MAX_PATH];
+ wchar_t szExpandedSoundFile[MAX_PATH];
ExpandEnvironmentStrings(inBuf, szExpandedSoundFile, _countof(szExpandedSoundFile));
mir_tstrcpy(inBuf, szExpandedSoundFile);
- TCHAR *pos2;
- pos2 = _tcschr(inBuf, _T(':'));
+ wchar_t *pos2;
+ pos2 = wcschr(inBuf, ':');
if (pos2 == NULL)
mir_sntprintf(szSoundFile, L"%s\\%s", szMirDir, inBuf);
else
@@ -130,19 +128,19 @@ void SplashMain() logMessage(L"SoundFilePath", szSoundFile);
#endif
- TCHAR szOldPath[MAX_PATH] = { 0 };
+ wchar_t szOldPath[MAX_PATH] = { 0 };
if (options.random) // randomly select a splash file
{
int filescount = 0;
- TCHAR szSplashDir[MAX_PATH] = { 0 }, szSearch[MAX_PATH] = { 0 };
- TCHAR *p = 0;
- TCHAR files[255][50]; //TODO: make memory allocation dynamic
+ wchar_t szSplashDir[MAX_PATH] = { 0 }, szSearch[MAX_PATH] = { 0 };
+ wchar_t *p = 0;
+ wchar_t files[255][50]; //TODO: make memory allocation dynamic
mir_tstrcpy(szSplashDir, szSplashFile);
mir_tstrcpy(szOldPath, szSplashFile);
// find the last \ and null it out, this leaves no trailing slash
- p = _tcsrchr(szSplashDir, _T('\\'));
+ p = wcsrchr(szSplashDir, '\\');
if (p) *p = 0;
// create the search filter
mir_sntprintf(szSearch, L"%s\\*.*", szSplashDir);
@@ -158,7 +156,7 @@ void SplashMain() #endif
//files = new char[mir_strlen(ffd.cFileName)];
//files[filescount] = new char[mir_strlen(ffd.cFileName)];
- TCHAR ext[5];
+ wchar_t ext[5];
wmemcpy(ext, ffd.cFileName + (mir_tstrlen(ffd.cFileName) - 4), 5);
#ifdef _DEBUG
@@ -197,7 +195,7 @@ void SplashMain() int PlugDisableHook(WPARAM wParam, LPARAM lParam)
{
#ifdef _DEBUG
- TCHAR buf[128];
+ wchar_t buf[128];
#endif
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
if (options.inheritGS) {
@@ -207,7 +205,7 @@ int PlugDisableHook(WPARAM wParam, LPARAM lParam) cws->value.bVal ? _DebugPopup(NULL, L"Sounds enabled.", L"") : _DebugPopup(NULL, L"Sounds disabled.", L"");
logMessage(L"Module", _A2T(cws->szModule));
logMessage(L"Setting", _A2T(cws->szSetting));
- logMessage(L"Value", _itot(cws->value.bVal, buf, 10));
+ logMessage(L"Value", _itow(cws->value.bVal, buf, 10));
#endif
}
if (!strcmp(cws->szModule, "PluginDisable") && !strcmp(cws->szSetting, _T2A(szDllName))) {
@@ -217,7 +215,7 @@ int PlugDisableHook(WPARAM wParam, LPARAM lParam) logMessage(L"PlugDisableHook", L"Triggered");
logMessage(L"Module", _A2T(cws->szModule));
logMessage(L"Setting", _A2T(cws->szSetting));
- logMessage(L"Value", _itot(cws->value.bVal, buf, 10));
+ logMessage(L"Value", _itow(cws->value.bVal, buf, 10));
#endif
}
}
@@ -271,7 +269,7 @@ extern "C" int __declspec(dllexport) Load(void) extern "C" int __declspec(dllexport) Unload(void)
{
- UnregisterClass(_T(SPLASH_CLASS), hInst);
+ UnregisterClass(SPLASH_CLASS, hInst);
// Freeing loaded libraries
if (hAdvaimg)
diff --git a/plugins/SplashScreen/src/options.cpp b/plugins/SplashScreen/src/options.cpp index 845a016ab4..f68eac44be 100644 --- a/plugins/SplashScreen/src/options.cpp +++ b/plugins/SplashScreen/src/options.cpp @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "stdafx.h"
-TCHAR szPath2Spash[MAX_PATH], szSoundFilePath[MAX_PATH];
+wchar_t szPath2Spash[MAX_PATH], szSoundFilePath[MAX_PATH];
// Reads values from db
void ReadDbConfig()
@@ -66,7 +66,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
else {
ReadDbConfig();
- TCHAR inBuf[80];
+ wchar_t inBuf[80];
DBVARIANT dbv = { 0 };
if (!db_get_ts(NULL, MODNAME, "Path", &dbv)) {
mir_tstrcpy(inBuf, dbv.ptszVal);
@@ -108,9 +108,9 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (options.showversion)
CheckDlgButton(hwndDlg, IDC_SHOWVERSION, BST_CHECKED);
- SetDlgItemText(hwndDlg, IDC_SHOWTIME, _itot(options.showtime, inBuf, 10));
- SetDlgItemText(hwndDlg, IDC_FISTEP, _itot(options.fisteps, inBuf, 10));
- SetDlgItemText(hwndDlg, IDC_FOSTEP, _itot(options.fosteps, inBuf, 10));
+ SetDlgItemText(hwndDlg, IDC_SHOWTIME, _itow(options.showtime, inBuf, 10));
+ SetDlgItemText(hwndDlg, IDC_FISTEP, _itow(options.fisteps, inBuf, 10));
+ SetDlgItemText(hwndDlg, IDC_FOSTEP, _itow(options.fosteps, inBuf, 10));
SendDlgItemMessage(hwndDlg, IDC_SHOWTIME, EM_LIMITTEXT, 5, 0);
}
@@ -166,11 +166,11 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case IDC_CHOOSESPLASH:
{
- TCHAR szTempPath[MAX_PATH], initDir[MAX_PATH];
+ wchar_t szTempPath[MAX_PATH], initDir[MAX_PATH];
if (Exists(szSplashFile)) {
mir_tstrcpy(initDir, szSplashFile);
- TCHAR *pos = _tcsrchr(initDir, _T('\\'));
+ wchar_t *pos = wcsrchr(initDir, '\\');
if (pos != NULL)
*pos = 0;
}
@@ -180,7 +180,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP mir_free(szMirDir);
}
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
mir_sntprintf(tmp, L"%s (*.png, *.bmp)%c*.png;*.bmp%c%c", TranslateT("Graphic files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
@@ -204,7 +204,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP int result = PathToRelativeT(szTempPath, szPath2Spash);
if (result && mir_tstrlen(szPath2Spash) > 0) {
if (options.random) {
- TCHAR *pos = _tcsrchr(szPath2Spash, _T('\\'));
+ wchar_t *pos = wcsrchr(szPath2Spash, '\\');
if (pos != NULL) {
*pos = 0;
mir_tstrcat(szPath2Spash, L"\\");
@@ -222,12 +222,12 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case IDC_CHOOSESND:
{
- TCHAR szTempPath[MAX_PATH], initDir[MAX_PATH];
- TCHAR *pos;
+ wchar_t szTempPath[MAX_PATH], initDir[MAX_PATH];
+ wchar_t *pos;
if (Exists(szSoundFile)) {
mir_tstrcpy(initDir, szSoundFile);
- pos = _tcsrchr(initDir, _T('\\'));
+ pos = wcsrchr(initDir, '\\');
if (pos != NULL) *pos = 0;
}
else {
@@ -238,7 +238,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
mir_sntprintf(tmp, L"%s (*.wav, *.mp3)%c*.wav;*.mp3%c%c", TranslateT("Sound Files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
@@ -285,7 +285,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
{
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_SPLASHPATH, tmp, _countof(tmp));
db_set_ts(NULL, MODNAME, "Path", tmp);
@@ -298,16 +298,16 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP mir_tstrcpy(szPrefix, tmp);
GetDlgItemText(hwndDlg, IDC_SHOWTIME, tmp, _countof(tmp));
- db_set_dw(NULL, MODNAME, "TimeToShow", _ttoi(tmp));
- options.showtime = _ttoi(tmp);
+ db_set_dw(NULL, MODNAME, "TimeToShow", _wtoi(tmp));
+ options.showtime = _wtoi(tmp);
GetDlgItemText(hwndDlg, IDC_FISTEP, tmp, _countof(tmp));
- db_set_dw(NULL, MODNAME, "FadeinSpeed", _ttoi(tmp));
- options.fisteps = _ttoi(tmp);
+ db_set_dw(NULL, MODNAME, "FadeinSpeed", _wtoi(tmp));
+ options.fisteps = _wtoi(tmp);
GetDlgItemText(hwndDlg, IDC_FOSTEP, tmp, _countof(tmp));
- db_set_dw(NULL, MODNAME, "FadeoutSpeed", _ttoi(tmp));
- options.fosteps = _ttoi(tmp);
+ db_set_dw(NULL, MODNAME, "FadeoutSpeed", _wtoi(tmp));
+ options.fosteps = _wtoi(tmp);
if (IsDlgButtonChecked(hwndDlg, IDC_ACTIVE)) {
db_set_b(NULL, MODNAME, "Active", 1);
diff --git a/plugins/SplashScreen/src/services.cpp b/plugins/SplashScreen/src/services.cpp index e7aa6c7a66..7a9e35cc69 100644 --- a/plugins/SplashScreen/src/services.cpp +++ b/plugins/SplashScreen/src/services.cpp @@ -22,14 +22,14 @@ INT_PTR ShowSplashService(WPARAM wparam, LPARAM lparam)
{
bserviceinvoked = true;
- TCHAR szOldfn[256];
- TCHAR *filename = (TCHAR*)wparam;
+ wchar_t szOldfn[256];
+ wchar_t *filename = (wchar_t*)wparam;
int timetoshow = (int)lparam;
mir_tstrcpy(szOldfn, szSplashFile);
options.showtime = timetoshow;
- TCHAR *pos = _tcsrchr(filename, _T(':'));
+ wchar_t *pos = wcsrchr(filename, ':');
if (pos == NULL)
mir_sntprintf(szSplashFile, L"%s\\%s", szMirDir, filename);
else
diff --git a/plugins/SplashScreen/src/splash.cpp b/plugins/SplashScreen/src/splash.cpp index 9e209b906a..c3cafffbc6 100644 --- a/plugins/SplashScreen/src/splash.cpp +++ b/plugins/SplashScreen/src/splash.cpp @@ -41,7 +41,7 @@ LRESULT CALLBACK SplashWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM case WM_TIMER:
#ifdef _DEBUG
- TCHAR b[40];
+ wchar_t b[40];
mir_sntprintf(b, L"%d", wParam);
logMessage(L"Timer ID", b);
mir_sntprintf(b, L"%d", options.showtime);
@@ -152,7 +152,7 @@ void __cdecl SplashThread(void *arg) wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
wcl.lpszMenuName = NULL;
- wcl.lpszClassName = _T(SPLASH_CLASS);
+ wcl.lpszClassName = SPLASH_CLASS;
wcl.hIconSm = NULL;
RegisterClassEx(&wcl);
@@ -172,7 +172,7 @@ void __cdecl SplashThread(void *arg) hwndSplash = CreateWindowEx(
WS_EX_TOOLWINDOW | WS_EX_TOPMOST,//dwStyleEx
- _T(SPLASH_CLASS), //Class name
+ SPLASH_CLASS, //Class name
NULL, //Title
DS_SETFONT | DS_FIXEDSYS | WS_POPUP, //dwStyle
WindowRect.left, // x
@@ -227,8 +227,8 @@ void __cdecl SplashThread(void *arg) }
}
- TCHAR verString[256] = { 0 };
- TCHAR *mirandaVerString = mir_a2t(szVersion);
+ wchar_t verString[256] = { 0 };
+ wchar_t *mirandaVerString = mir_a2t(szVersion);
mir_sntprintf(verString, L"%s%s", szPrefix, mirandaVerString);
mir_free(mirandaVerString);
LOGFONT lf = { 0 };
@@ -326,7 +326,7 @@ BOOL ShowSplash(BOOL bpreview) else {
timeout = options.showtime;
#ifdef _DEBUG
- TCHAR b[40];
+ wchar_t b[40];
mir_sntprintf(b, L"%d", options.showtime);
logMessage(L"Timeout", b);
#endif
diff --git a/plugins/SplashScreen/src/stdafx.h b/plugins/SplashScreen/src/stdafx.h index 070026efa2..dd1217124b 100644 --- a/plugins/SplashScreen/src/stdafx.h +++ b/plugins/SplashScreen/src/stdafx.h @@ -22,8 +22,8 @@ #define _CRT_SECURE_NO_DEPRECATE
-#include <windows.h>
#include <tchar.h>
+#include <windows.h>
#include <time.h>
#include <dshow.h>
@@ -48,7 +48,7 @@ #endif
// Internal defines
-#define SPLASH_CLASS "MirandaSplash"
+#define SPLASH_CLASS L"MirandaSplash"
#define MODNAME "SplashScreen"
#define WM_LOADED (WM_USER + 10)
@@ -68,8 +68,8 @@ struct SPLASHOPTS extern HWND hwndSplash;
extern SPLASHOPTS options;
-extern TCHAR szSplashFile[MAX_PATH], szSoundFile[MAX_PATH], szPrefix[128];
-extern TCHAR *szMirDir;
+extern wchar_t szSplashFile[MAX_PATH], szSoundFile[MAX_PATH], szPrefix[128];
+extern wchar_t *szMirDir;
extern char szVersion[MAX_PATH];
extern BOOL bserviceinvoked, bmodulesloaded, png2dibavail;
extern HINSTANCE hInst;
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index abe47b5afb..b6e0a330f9 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -227,7 +227,7 @@ static INT_PTR AdvSt() if ((Enabled == 1)) {
POPUPDATAT ppd = {0};
- TCHAR * lptzText =L"";
+ wchar_t * lptzText =L"";
db_set_b(NULL, "Skin", "UseSound", 0);
EnablePopupModule();
@@ -237,7 +237,7 @@ static INT_PTR AdvSt() ppd.lchContact = NULL;
ppd.iSeconds = PopUpTime;
wcsncpy_s(ppd.lptzText, lptzText, _TRUNCATE);
- lptzText = TranslateT(MENU_NAME);
+ lptzText = TranslateW(MENU_NAMEW);
wcsncpy_s(ppd.lptzContactName, lptzText, _TRUNCATE);
PUAddPopupT(&ppd);
}
@@ -267,13 +267,13 @@ INT_PTR StartupSilenceEnabled(WPARAM, LPARAM) if (MenuItem == 1)
UpdateMenu();
if (PopUp == 1) {
- TCHAR * lptzText = Enabled == 1 ? S_MODE_CHANGEDON : S_MODE_CHANGEDOFF;
+ wchar_t * lptzText = Enabled == 1 ? S_MODE_CHANGEDON : S_MODE_CHANGEDOFF;
POPUPDATAT ppd = {0};
ppd.lchIcon = IcoLib_GetIconByHandle((Enabled == 1) ? GetIconHandle(ENABLE_SILENCE) : GetIconHandle(DISABLE_SILENCE));
ppd.lchContact = NULL;
ppd.iSeconds = PopUpTime;
wcsncpy_s(ppd.lptzText, lptzText, _TRUNCATE);
- lptzText = TranslateT(MENU_NAME);
+ lptzText = TranslateW(MENU_NAMEW);
wcsncpy_s(ppd.lptzContactName, lptzText, _TRUNCATE);
PUAddPopupT(&ppd);
}
diff --git a/plugins/StartupSilence/src/stdafx.h b/plugins/StartupSilence/src/stdafx.h index 84ca37766e..e4fcc25b3b 100644 --- a/plugins/StartupSilence/src/stdafx.h +++ b/plugins/StartupSilence/src/stdafx.h @@ -45,6 +45,7 @@ INT_PTR SilenceConnection(WPARAM wParam, LPARAM lParam); #define SS_SILENCE_CONNECTION "StartupSilence/SilenceConnection"
#define MENU_NAME LPGEN("Silence at startup")
+#define MENU_NAMEW LPGENW("Silence at startup")
#define DISABLE_SILENCE LPGEN("Toggle Silence OFF")
#define ENABLE_SILENCE LPGEN("Toggle Silence ON")
#define DISABLE_SILENCETTB LPGEN("Toggle Silence OFF TTB")
@@ -58,15 +59,15 @@ INT_PTR SilenceConnection(WPARAM wParam, LPARAM lParam); #define SS_IS_ON Translate("Silence At Startup is ON")
#define SS_IS_OFF Translate("Silence At Startup is OFF")
#define TTBNAME Translate("Toggle Silence At Startup")
-#define NOTICE TranslateT(MENU_NAME)
+#define NOTICE TranslateW(MENU_NAMEW)
#define NEEDTTBMOD TranslateT("You have to install TopToolBar plugin to use this option.")
#define NEEDPOPUP TranslateT("You have to install popup plugin to use this option.")
static IconItem iconList[] = {
- {MENU_NAME, MENU_NAME, IDI_SSICON},
- {ALL_ENABLED_FLT, ALL_ENABLED_FLT, IDI_SSFILTEREDON},
- {DISABLE_SILENCE, DISABLE_SILENCE, IDI_SSDISABLE},
- {ENABLE_SILENCE, ENABLE_SILENCE, IDI_SSENABLE}
+ { MENU_NAME, MENU_NAME, IDI_SSICON},
+ { ALL_ENABLED_FLT, ALL_ENABLED_FLT, IDI_SSFILTEREDON},
+ { DISABLE_SILENCE, DISABLE_SILENCE, IDI_SSDISABLE},
+ { ENABLE_SILENCE, ENABLE_SILENCE, IDI_SSENABLE}
};
static IconItem iconttbList[] = {
diff --git a/plugins/StatusChange/src/main.cpp b/plugins/StatusChange/src/main.cpp index e5e1b035c6..e9d9b17458 100644 --- a/plugins/StatusChange/src/main.cpp +++ b/plugins/StatusChange/src/main.cpp @@ -315,8 +315,8 @@ int StatusChangeOptInit(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.ptszTitle = LPGENT("Status Change");
- odp.ptszGroup = LPGENT("Status");
+ odp.pwszTitle = LPGENW("Status Change");
+ odp.pwszGroup = LPGENW("Status");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = DlgProcStatusChangeOpts;
Options_AddPage(wParam, &odp);
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp index bd6ea8f7dc..1cb68c1f1d 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp @@ -242,7 +242,7 @@ static int changeState(TAAAProtoSetting &setting, STATES newState) if (db_get_b(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_MSGCUSTOM), FALSE)) {
DBVARIANT dbv;
if (!db_get_ts(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_STATUSMSG), &dbv)) {
- setting.szMsg = _tcsdup(dbv.ptszVal);
+ setting.szMsg = wcsdup(dbv.ptszVal);
db_free(&dbv);
}
}
@@ -375,7 +375,7 @@ static VOID CALLBACK AutoAwayTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DW TAAAProtoSettingList ps = autoAwaySettings;
for (int i = 0; i < ps.getCount(); i++) {
if (ps[i].szMsg)
- ps[i].szMsg = _tcsdup(ps[i].szMsg);
+ ps[i].szMsg = wcsdup(ps[i].szMsg);
if (ps[i].status == ID_STATUS_DISABLED)
ps[i].szName = "";
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp index 0ae73b66d0..818631c5dc 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp @@ -127,7 +127,7 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L if (settings[i]->msg != NULL)
SetDlgItemTextA(hwndDlg, IDC_STATUSMSG, settings[i]->msg);
else {
- ptrT msg((TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, settings[i]->status, 0));
+ ptrT msg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, settings[i]->status, 0));
SetDlgItemText(hwndDlg, IDC_STATUSMSG, (msg != NULL) ? msg : L"");
}
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp index fddb288e73..58e2dba951 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp @@ -205,7 +205,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_RESETCONTENT, 0, 0);
for (int i=0; i < _countof(statusModeList); i++) {
if ((flags & statusModePf2List[i]) || statusModePf2List[i] == PF2_OFFLINE || bSettingSame) {
- TCHAR *statusMode = pcli->pfnGetStatusModeDescription(statusModeList[i], 0);
+ wchar_t *statusMode = pcli->pfnGetStatusModeDescription(statusModeList[i], 0);
int item = SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_ADDSTRING, 0, (LPARAM)statusMode);
SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_SETITEMDATA, item, (LPARAM)statusModeList[i]);
item = SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_ADDSTRING, 0, (LPARAM)statusMode);
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 6f76de23d5..413c8f0f54 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -67,7 +67,7 @@ static int StartTimer(int timer, int timeout, BOOL restart); static int StopTimer(int timer); int LoadMainOptions(); static void GetCurrentConnectionSettings(); -static int AssignStatus(TConnectionSettings* connSetting, int status, int lastStatus, TCHAR *szMsg); +static int AssignStatus(TConnectionSettings* connSetting, int status, int lastStatus, wchar_t *szMsg); static int ProcessProtoAck(WPARAM wParam, LPARAM lParam); static VOID CALLBACK CheckConnectingTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); static VOID CALLBACK CheckAckStatusTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); @@ -83,7 +83,7 @@ static VOID CALLBACK CheckContinueslyTimer(HWND hwnd, UINT message, UINT_PTR idE INT_PTR IsProtocolEnabledService(WPARAM wParam, LPARAM lParam); static int ProcessPopup(int reason, LPARAM lParam); -static INT_PTR ShowPopup(TCHAR *msg, HICON hIcon); +static INT_PTR ShowPopup(wchar_t *msg, HICON hIcon); LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); static DWORD CALLBACK MessageWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); @@ -205,7 +205,7 @@ static void FreeProtoSettings(PROTOCOLSETTINGEX** ps) free(ps); } -static int AssignStatus(TConnectionSettings* cs, int status, int lastStatus, TCHAR *szMsg) +static int AssignStatus(TConnectionSettings* cs, int status, int lastStatus, wchar_t *szMsg) { if (status < MIN_STATUS || status > MAX_STATUS) return -1; @@ -228,7 +228,7 @@ static int AssignStatus(TConnectionSettings* cs, int status, int lastStatus, TCH if (cs->szMsg != NULL) free(cs->szMsg); - cs->szMsg = _tcsdup(szMsg); + cs->szMsg = wcsdup(szMsg); } else if (szMsg != cs->szMsg) { if (cs->szMsg != NULL) @@ -877,7 +877,7 @@ static VOID CALLBACK CheckContinueslyTimer(HWND, UINT, UINT_PTR, DWORD) } // =============== popup ====================== -static TCHAR* GetHumanName(LPARAM lParam) +static wchar_t* GetHumanName(LPARAM lParam) { PROTOACCOUNT *ProtoAccount = Proto_GetAccount((char*)lParam); return (ProtoAccount != NULL) ? ProtoAccount->tszAccountName : TranslateT("Protocol"); @@ -886,7 +886,7 @@ static TCHAR* GetHumanName(LPARAM lParam) static int ProcessPopup(int reason, LPARAM lParam) { HICON hIcon = NULL; - TCHAR text[MAX_SECONDLINE]; + wchar_t text[MAX_SECONDLINE]; if (!db_get_b(NULL, MODULENAME, SETTING_SHOWCONNECTIONPOPUPS, FALSE) || !ServiceExists(MS_POPUP_ADDPOPUPT)) return -1; @@ -929,7 +929,7 @@ static int ProcessPopup(int reason, LPARAM lParam) return -1; if (lParam) { PROTOCOLSETTINGEX **ps = (PROTOCOLSETTINGEX **)lParam; - TCHAR protoInfoLine[512], protoInfo[MAX_SECONDLINE]; + wchar_t protoInfoLine[512], protoInfo[MAX_SECONDLINE]; memset(protoInfoLine, '\0', sizeof(protoInfoLine)); memset(protoInfo, '\0', sizeof(protoInfo)); mir_tstrcpy(protoInfo, L"\r\n"); @@ -979,12 +979,12 @@ static int ProcessPopup(int reason, LPARAM lParam) return ShowPopup(text, hIcon); } -static INT_PTR ShowPopup(TCHAR *msg, HICON hIcon) +static INT_PTR ShowPopup(wchar_t *msg, HICON hIcon) { POPUPDATAT ppd = { 0 }; ppd.lchIcon = hIcon; - _tcsncpy(ppd.lptzContactName, TranslateT("KeepStatus"), MAX_CONTACTNAME); - _tcsncpy(ppd.lptzText, msg, MAX_SECONDLINE); + wcsncpy(ppd.lptzContactName, TranslateT("KeepStatus"), MAX_CONTACTNAME); + wcsncpy(ppd.lptzText, msg, MAX_SECONDLINE); if (db_get_b(NULL, MODULENAME, SETTING_POPUP_USEWINCOLORS, 0)) { ppd.colorBack = GetSysColor(COLOR_BTNFACE); ppd.colorText = GetSysColor(COLOR_WINDOWTEXT); diff --git a/plugins/StatusPlugins/KeepStatus/options.cpp b/plugins/StatusPlugins/KeepStatus/options.cpp index effa88cf8a..147fcf0b5d 100644 --- a/plugins/StatusPlugins/KeepStatus/options.cpp +++ b/plugins/StatusPlugins/KeepStatus/options.cpp @@ -481,8 +481,8 @@ INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l ppd.lchContact = NULL;
ppd.lchIcon = Skin_LoadIcon(SKINICON_STATUS_OFFLINE);
- _tcsncpy(ppd.lptzContactName, TranslateT("KeepStatus"), MAX_CONTACTNAME);
- _tcsncpy(ppd.lptzText, TranslateT("You broke the Internet!"), MAX_SECONDLINE);
+ wcsncpy(ppd.lptzContactName, TranslateT("KeepStatus"), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzText, TranslateT("You broke the Internet!"), MAX_SECONDLINE);
if (IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS))
{
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
@@ -568,8 +568,8 @@ int OptionsInit(WPARAM wparam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("Status");
- odp.ptszTitle = LPGENT("KeepStatus");
+ odp.pwszGroup = LPGENW("Status");
+ odp.pwszTitle = LPGENW("KeepStatus");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TABS);
odp.pfnDlgProc = DlgProcKsTabs;
@@ -578,11 +578,11 @@ int OptionsInit(WPARAM wparam, LPARAM) if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
memset(&odp, 0, sizeof(odp));
odp.position = 150000000;
- odp.ptszGroup = LPGENT("Popups");
+ odp.pwszGroup = LPGENW("Popups");
odp.groupPosition = 910000000;
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_PUOPT_KEEPSTATUS);
- odp.ptszTitle = LPGENT("KeepStatus");
+ odp.pwszTitle = LPGENW("KeepStatus");
odp.pfnDlgProc = PopupOptDlgProc;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wparam, &odp);
diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index f50907a46f..389b7a4d66 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -128,7 +128,7 @@ static char* GetCMDL(TSettingsList& protoSettings) /////////////////////////////////////////////////////////////////////////////////////////
// Link processing
-static TCHAR* GetLinkDescription(TSettingsList& protoSettings)
+static wchar_t* GetLinkDescription(TSettingsList& protoSettings)
{
if ( protoSettings.getCount() == 0 )
return NULL;
@@ -137,7 +137,7 @@ static TCHAR* GetLinkDescription(TSettingsList& protoSettings) for (int i=0; i < protoSettings.getCount(); i++) {
TSSSetting &p = protoSettings[i];
- TCHAR *status;
+ wchar_t *status;
if ( p.status == ID_STATUS_LAST)
status = TranslateT("<last>");
else if (p.status == ID_STATUS_CURRENT)
@@ -161,9 +161,9 @@ static TCHAR* GetLinkDescription(TSettingsList& protoSettings) HRESULT CreateLink(TSettingsList& protoSettings)
{
- TCHAR savePath[MAX_PATH];
+ wchar_t savePath[MAX_PATH];
if (SHGetSpecialFolderPath(NULL, savePath, 0x10, FALSE))
- _tcsncat_s(savePath, SHORTCUT_FILENAME, _countof(savePath) - mir_tstrlen(savePath));
+ wcsncat_s(savePath, SHORTCUT_FILENAME, _countof(savePath) - mir_tstrlen(savePath));
else
mir_sntprintf(savePath, L".\\%s", SHORTCUT_FILENAME);
@@ -172,11 +172,11 @@ HRESULT CreateLink(TSettingsList& protoSettings) HRESULT hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, ( void** )&psl);
if (SUCCEEDED(hres)) {
char *args = GetCMDLArguments(protoSettings);
- TCHAR *desc = GetLinkDescription(protoSettings);
+ wchar_t *desc = GetLinkDescription(protoSettings);
// Set the path to the shortcut target, and add the
// description.
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetModuleFileName(NULL, path, _countof(path));
psl->SetPath(path);
psl->SetDescription(desc);
@@ -323,7 +323,7 @@ static INT_PTR CALLBACK StartupStatusOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wPa break;
}
else {
- TCHAR text[128];
+ wchar_t text[128];
mir_sntprintf(text, TranslateT("size: %d x %d"),
db_get_dw(NULL, MODULE_CLIST, SETTING_WIDTH, 0),
db_get_dw(NULL, MODULE_CLIST, SETTING_HEIGHT, 0));
@@ -343,7 +343,7 @@ static INT_PTR CALLBACK StartupStatusOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wPa int defProfile;
int profileCount = GetProfileCount((WPARAM)&defProfile, 0);
for ( int i=0; i < profileCount; i++ ) {
- TCHAR profileName[128];
+ wchar_t profileName[128];
if ( GetProfileName(i, (LPARAM)profileName))
continue;
@@ -427,7 +427,7 @@ static INT_PTR CALLBACK StartupStatusOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wPa GetProfile( defProfile, *ps );
for ( int i=0; i < ps->getCount(); i++ )
if ( (*ps)[i].szMsg != NULL )
- (*ps)[i].szMsg = _tcsdup( (*ps)[i].szMsg );
+ (*ps)[i].szMsg = wcsdup( (*ps)[i].szMsg );
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CMDLOPTIONS), hwndDlg, CmdlOptionsDlgProc, (LPARAM)ps);
}
@@ -536,7 +536,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP else {
for (int j=0; j < ar.getCount(); j++)
if ( ar[j].szMsg != NULL)
- ar[j].szMsg = _tcsdup( ar[j].szMsg );
+ ar[j].szMsg = wcsdup( ar[j].szMsg );
ppo->tszName = db_get_tsa(NULL, MODULENAME, OptName(i, SETTING_PROFILENAME));
if (ppo->tszName == NULL) {
@@ -660,7 +660,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP case UM_ADDPROFILE:
{
- TCHAR *tszName = (TCHAR*)lParam;
+ wchar_t *tszName = (wchar_t*)lParam;
if (tszName == NULL)
break;
@@ -738,7 +738,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP ps->szMsg = NULL;
if (IsDlgButtonChecked(hwndDlg, IDC_CUSTOMMSG)) {
len = SendDlgItemMessage(hwndDlg, IDC_STATUSMSG, WM_GETTEXTLENGTH, 0, 0);
- ps->szMsg = (TCHAR*)calloc(sizeof(TCHAR), len+1);
+ ps->szMsg = (wchar_t*)calloc(sizeof(wchar_t), len+1);
GetDlgItemText(hwndDlg, IDC_STATUSMSG, ps->szMsg, (len + 1));
}
SendMessage(hwndDlg, UM_SETSTATUSMSG, 0, 0);
@@ -757,7 +757,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP ps->szMsg = NULL;
}
int len = SendDlgItemMessage(hwndDlg, IDC_STATUSMSG, WM_GETTEXTLENGTH, 0, 0);
- ps->szMsg = (TCHAR*)calloc(sizeof(TCHAR), len+1);
+ ps->szMsg = (wchar_t*)calloc(sizeof(wchar_t), len+1);
GetDlgItemText(hwndDlg, IDC_STATUSMSG, ps->szMsg, (len + 1));
}
break;
@@ -867,7 +867,7 @@ INT_PTR CALLBACK addProfileDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lP case WM_COMMAND:
if (LOWORD(wParam) == IDC_OK) {
- TCHAR profileName[128];
+ wchar_t profileName[128];
GetDlgItemText(hwndDlg, IDC_PROFILENAME, profileName, _countof(profileName));
SendMessage(hwndParent, UM_ADDPROFILE, 0, (LPARAM)profileName);
// done and exit
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp index cfc69ce732..d370e53999 100644 --- a/plugins/StatusPlugins/StartupStatus/profiles.cpp +++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp @@ -65,12 +65,12 @@ static int CreateMainMenuItems(WPARAM, LPARAM) mcount = 0; int count = GetProfileCount(0, 0); for (int i = 0; i < count && mcount < MAX_MMITEMS; i++) { - TCHAR profilename[128]; + wchar_t profilename[128]; if (!db_get_b(NULL, MODULENAME, OptName(i, SETTING_CREATEMMITEM), 0) || GetProfileName(i, (LPARAM)profilename)) continue; if (db_get_b(NULL, MODULENAME, OptName(i, SETTING_INSUBMENU), 1) && !mi.root) { - mi.root = Menu_CreateRoot(MO_STATUS, LPGENT("Status profiles"), 2000100000); + mi.root = Menu_CreateRoot(MO_STATUS, LPGENW("Status profiles"), 2000100000); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "1AB30D51-BABA-4B27-9288-1A12278BAD8D"); } @@ -78,7 +78,7 @@ static int CreateMainMenuItems(WPARAM, LPARAM) mir_snprintf(servicename, "%s%d", MS_SS_MENUSETPROFILEPREFIX, mcount); hProfileServices[mcount] = CreateServiceFunctionParam(servicename, profileService, mcount); - mi.name.t = profilename; + mi.name.w = profilename; mi.position = 2000100000 + mcount; mi.pszService = servicename; if (Menu_AddStatusMenuItem(&mi)) @@ -100,9 +100,9 @@ INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam) if (profile >= count && count > 0) return -1; - TCHAR* buf = (TCHAR*)lParam; + wchar_t* buf = (wchar_t*)lParam; if (count == 0) { - _tcsncpy(buf, TranslateT("default"), 128 - 1); + wcsncpy(buf, TranslateT("default"), 128 - 1); return 0; } @@ -112,7 +112,7 @@ INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam) if (db_get_ts(NULL, MODULENAME, setting, &dbv)) return -1; - _tcsncpy(buf, dbv.ptszVal, 128 - 1); buf[127] = 0; + wcsncpy(buf, dbv.ptszVal, 128 - 1); buf[127] = 0; db_free(&dbv); return 0; } @@ -130,7 +130,7 @@ INT_PTR GetProfileCount(WPARAM wParam, LPARAM) return count; } -TCHAR *GetStatusMessage(int profile, char *szProto) +wchar_t *GetStatusMessage(int profile, char *szProto) { char dbSetting[80]; DBVARIANT dbv; @@ -139,7 +139,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto) if ((pce[i].profile == profile) && (!mir_strcmp(pce[i].szProto, szProto))) { mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { // reload from db - pce[i].msg = (TCHAR*)realloc(pce[i].msg, sizeof(TCHAR)*(mir_tstrlen(dbv.ptszVal) + 1)); + pce[i].msg = (wchar_t*)realloc(pce[i].msg, sizeof(wchar_t)*(mir_tstrlen(dbv.ptszVal) + 1)); if (pce[i].msg != NULL) { mir_tstrcpy(pce[i].msg, dbv.ptszVal); } @@ -163,7 +163,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto) pce[pceCount].msg = NULL; mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { - pce[pceCount].msg = _tcsdup(dbv.ptszVal); + pce[pceCount].msg = wcsdup(dbv.ptszVal); db_free(&dbv); } pceCount++; diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp index e592da5e71..13d708f0de 100644 --- a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp +++ b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp @@ -63,7 +63,7 @@ TSSSetting::TSSSetting(int profile, PROTOACCOUNT *pa) szMsg = GetStatusMessage(profile, szName);
if (szMsg)
- szMsg = _tcsdup(szMsg);
+ szMsg = wcsdup(szMsg);
}
TSSSetting::~TSSSetting()
@@ -173,7 +173,7 @@ static void SetLastStatusMessages(TSettingsList &ps) DBVARIANT dbv;
if (ps[i].szMsg == NULL && !db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) {
- ps[i].szMsg = _tcsdup(dbv.ptszVal); // remember this won't be freed
+ ps[i].szMsg = wcsdup(dbv.ptszVal); // remember this won't be freed
db_free(&dbv);
}
}
diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.h b/plugins/StatusPlugins/StartupStatus/startupstatus.h index 0346567861..5303ab3468 100644 --- a/plugins/StatusPlugins/StartupStatus/startupstatus.h +++ b/plugins/StatusPlugins/StartupStatus/startupstatus.h @@ -40,7 +40,7 @@ struct PROFILECE {
int profile;
char *szProto;
- TCHAR *msg;
+ wchar_t *msg;
};
struct PROFILEOPTIONS : public MZeroedObject
@@ -51,7 +51,7 @@ struct PROFILEOPTIONS : public MZeroedObject mir_free(tszName);
}
- TCHAR *tszName;
+ wchar_t *tszName;
TSettingsList* ps;
BOOL showDialog;
BOOL createTtb;
@@ -144,7 +144,7 @@ TSettingsList* GetCurrentProtoSettings(); // profile
int GetProfile(int profileID, TSettingsList& arSettings );
-TCHAR *GetStatusMessage(int profile, char *szProto);
+wchar_t *GetStatusMessage(int profile, char *szProto);
INT_PTR LoadAndSetProfile(WPARAM wParam, LPARAM lParam);
INT_PTR GetProfileCount(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp index 4f78f829d1..19411d9938 100644 --- a/plugins/StatusPlugins/commonstatus.cpp +++ b/plugins/StatusPlugins/commonstatus.cpp @@ -95,7 +95,7 @@ int GetActualStatus(PROTOCOLSETTINGEX *protoSetting) }
// helper, from core
-static TCHAR* GetDefaultMessage(int status)
+static wchar_t* GetDefaultMessage(int status)
{
switch (status) {
case ID_STATUS_AWAY: return TranslateT("I've been away since %time%.");
@@ -113,14 +113,14 @@ static TCHAR* GetDefaultMessage(int status) return NULL;
}
-TCHAR* GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int newstatus)
+wchar_t* GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int newstatus)
{
if (ps->szMsg != NULL) {// custom message set
log_infoA("CommonStatus: Status message set by calling plugin");
return mir_tstrdup(ps->szMsg);
}
- TCHAR *tMsg = (TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, newstatus, (LPARAM)ps->szName);
+ wchar_t *tMsg = (wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, newstatus, (LPARAM)ps->szName);
log_debugA("CommonStatus: Status message retrieved from general awaysys: %S", tMsg);
return tMsg;
}
@@ -169,28 +169,28 @@ static int equalsGlobalStatus(PROTOCOLSETTINGEX **ps) static void SetStatusMsg(PROTOCOLSETTINGEX *ps, int newstatus)
{
- TCHAR* tszMsg = GetDefaultStatusMessage(ps, newstatus);
+ wchar_t* tszMsg = GetDefaultStatusMessage(ps, newstatus);
if (tszMsg) {
/* replace the default vars in msg (I believe this is from core) */
for (int j = 0; tszMsg[j]; j++) {
if (tszMsg[j] != '%')
continue;
- TCHAR substituteStr[128];
- if (!_tcsnicmp(tszMsg + j, L"%time%", 6))
+ wchar_t substituteStr[128];
+ if (!wcsnicmp(tszMsg + j, L"%time%", 6))
GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, 0, 0, substituteStr, _countof(substituteStr));
- else if (!_tcsnicmp(tszMsg + j, L"%date%", 6))
+ else if (!wcsnicmp(tszMsg + j, L"%date%", 6))
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, 0, 0, substituteStr, _countof(substituteStr));
else
continue;
if (mir_tstrlen(substituteStr) > 6)
- tszMsg = (TCHAR*)mir_realloc(tszMsg, sizeof(TCHAR)*(mir_tstrlen(tszMsg) + 1 + mir_tstrlen(substituteStr) - 6));
- memmove(tszMsg + j + mir_tstrlen(substituteStr), tszMsg + j + 6, sizeof(TCHAR)*(mir_tstrlen(tszMsg) - j - 5));
- memcpy(tszMsg + j, substituteStr, sizeof(TCHAR)*mir_tstrlen(substituteStr));
+ tszMsg = (wchar_t*)mir_realloc(tszMsg, sizeof(wchar_t)*(mir_tstrlen(tszMsg) + 1 + mir_tstrlen(substituteStr) - 6));
+ memmove(tszMsg + j + mir_tstrlen(substituteStr), tszMsg + j + 6, sizeof(wchar_t)*(mir_tstrlen(tszMsg) - j - 5));
+ memcpy(tszMsg + j, substituteStr, sizeof(wchar_t)*mir_tstrlen(substituteStr));
}
- TCHAR *szFormattedMsg = variables_parsedup(tszMsg, ps->tszAccName, NULL);
+ wchar_t *szFormattedMsg = variables_parsedup(tszMsg, ps->tszAccName, NULL);
if (szFormattedMsg != NULL) {
mir_free(tszMsg);
tszMsg = szFormattedMsg;
diff --git a/plugins/StatusPlugins/commonstatus.h b/plugins/StatusPlugins/commonstatus.h index e43c7b5e25..2288cc0e34 100644 --- a/plugins/StatusPlugins/commonstatus.h +++ b/plugins/StatusPlugins/commonstatus.h @@ -28,7 +28,6 @@ #include <shlobj.h>
#include <uxtheme.h>
#include <stdio.h>
-#include <tchar.h>
#include <newpluginapi.h>
#include <m_system.h>
@@ -71,7 +70,7 @@ static int statusModeList[] = { ID_STATUS_OFFLINE, ID_STATUS_ONLINE, ID_STATUS_AWAY, ID_STATUS_NA, ID_STATUS_OCCUPIED, ID_STATUS_DND, ID_STATUS_FREECHAT, ID_STATUS_INVISIBLE, ID_STATUS_ONTHEPHONE, ID_STATUS_OUTTOLUNCH };
static int statusModePf2List[] = { PF2_OFFLINE, PF2_ONLINE, PF2_SHORTAWAY, PF2_LONGAWAY, PF2_LIGHTDND, PF2_HEAVYDND, PF2_FREECHAT, PF2_INVISIBLE, PF2_ONTHEPHONE, PF2_OUTTOLUNCH };
-TCHAR *GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int status);
+wchar_t *GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int status);
int GetActualStatus(PROTOCOLSETTINGEX *protoSetting);
int InitCommonStatus();
bool IsSuitableProto(PROTOACCOUNT *pa);
diff --git a/plugins/StatusPlugins/confirmdialog.cpp b/plugins/StatusPlugins/confirmdialog.cpp index ac622de347..34b82714a8 100644 --- a/plugins/StatusPlugins/confirmdialog.cpp +++ b/plugins/StatusPlugins/confirmdialog.cpp @@ -34,7 +34,7 @@ struct TConfirmSetting : public PROTOCOLSETTINGEX {
memcpy(this, &x, sizeof(PROTOCOLSETTINGEX));
if (szMsg)
- szMsg = _tcsdup(szMsg);
+ szMsg = wcsdup(szMsg);
}
~TConfirmSetting()
@@ -59,7 +59,7 @@ static INT_PTR CALLBACK StatusMessageDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar protoSetting = (PROTOCOLSETTINGEX *)lParam;
if (protoSetting->szMsg == NULL) {
- TCHAR* smsg = GetDefaultStatusMessage(protoSetting, GetActualStatus(protoSetting));
+ wchar_t* smsg = GetDefaultStatusMessage(protoSetting, GetActualStatus(protoSetting));
if (smsg != NULL) {
SetDlgItemText(hwndDlg, IDC_STSMSG, smsg);
mir_free(smsg);
@@ -68,7 +68,7 @@ static INT_PTR CALLBACK StatusMessageDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar else SetDlgItemText(hwndDlg, IDC_STSMSG, protoSetting->szMsg);
{
- TCHAR desc[512];
+ wchar_t desc[512];
mir_sntprintf(desc, TranslateT("Set %s message for %s."),
pcli->pfnGetStatusModeDescription(GetActualStatus(protoSetting), 0), protoSetting->tszAccName);
SetDlgItemText(hwndDlg, IDC_DESCRIPTION, desc);
@@ -81,7 +81,7 @@ static INT_PTR CALLBACK StatusMessageDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar {
int len = SendDlgItemMessage(hwndDlg, IDC_STSMSG, WM_GETTEXTLENGTH, 0, 0);
if (len > 0) {
- protoSetting->szMsg = (TCHAR*)realloc(protoSetting->szMsg, sizeof(TCHAR)*(len + 1));
+ protoSetting->szMsg = (wchar_t*)realloc(protoSetting->szMsg, sizeof(wchar_t)*(len + 1));
if (protoSetting->szMsg != NULL)
GetDlgItemText(hwndDlg, IDC_STSMSG, protoSetting->szMsg, len + 1);
}
@@ -107,7 +107,7 @@ static int SetStatusList(HWND hwndDlg) return -1;
HWND hList = GetDlgItem(hwndDlg, IDC_STARTUPLIST);
- TCHAR buf[100];
+ wchar_t buf[100];
// create items
LVITEM lvItem = { 0 };
@@ -124,7 +124,7 @@ static int SetStatusList(HWND hwndDlg) case ID_STATUS_CURRENT: actualStatus = CallProtoService((*confirmSettings)[i].szName, PS_GETSTATUS, 0, 0); break;
default: actualStatus = (*confirmSettings)[i].status;
}
- TCHAR* status = pcli->pfnGetStatusModeDescription(actualStatus, 0);
+ wchar_t* status = pcli->pfnGetStatusModeDescription(actualStatus, 0);
switch ((*confirmSettings)[i].status) {
case ID_STATUS_LAST:
mir_sntprintf(buf, L"%s (%s)", TranslateT("<last>"), status);
@@ -140,9 +140,9 @@ static int SetStatusList(HWND hwndDlg) // status message
if (!((!((CallProtoService((*confirmSettings)[i].szName, PS_GETCAPS, (WPARAM)PFLAGNUM_1, 0)&PF1_MODEMSGSEND)&~PF1_INDIVMODEMSG)) || (!(CallProtoService((*confirmSettings)[i].szName, PS_GETCAPS, (WPARAM)PFLAGNUM_3, 0)&Proto_Status2Flag(actualStatus))))) {
- TCHAR *msg = GetDefaultStatusMessage(&(*confirmSettings)[i], actualStatus);
+ wchar_t *msg = GetDefaultStatusMessage(&(*confirmSettings)[i], actualStatus);
if (msg != NULL) {
- TCHAR* fMsg = variables_parsedup(msg, (*confirmSettings)[i].tszAccName, NULL);
+ wchar_t* fMsg = variables_parsedup(msg, (*confirmSettings)[i].tszAccName, NULL);
ListView_SetItemText(hList, lvItem.iItem, 2, fMsg);
mir_free(fMsg);
mir_free(msg);
@@ -197,7 +197,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP int defaultProfile;
int profileCount = (int)CallService(MS_SS_GETPROFILECOUNT, (WPARAM)&defaultProfile, 0);
for (int i = 0; i < profileCount; i++) {
- TCHAR profileName[128];
+ wchar_t profileName[128];
CallService(MS_SS_GETPROFILENAME, i, (LPARAM)profileName);
int item = SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_ADDSTRING, 0, (LPARAM)profileName);
SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_SETITEMDATA, item, i);
@@ -209,7 +209,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
// start timer
if (timeOut > 0) {
- TCHAR text[32];
+ wchar_t text[32];
mir_sntprintf(text, TranslateT("Closing in %d"), timeOut);
SetDlgItemText(hwndDlg, IDC_CLOSE, text);
SetTimer(hwndDlg, TIMER_ID, 1000, NULL);
@@ -218,7 +218,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_TIMER:
{
- TCHAR text[32];
+ wchar_t text[32];
mir_sntprintf(text, TranslateT("Closing in %d"), timeOut - 1);
SetDlgItemText(hwndDlg, IDC_CLOSE, text);
if (timeOut <= 0) {
@@ -247,7 +247,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP CallService(MS_SS_GETPROFILE, (WPARAM)profile, (LPARAM)confirmSettings);
for (int i = 0; i < confirmSettings->getCount(); i++)
if ((*confirmSettings)[i].szMsg != NULL) // we free this later, copy to our memory space
- (*confirmSettings)[i].szMsg = _tcsdup((*confirmSettings)[i].szMsg);
+ (*confirmSettings)[i].szMsg = wcsdup((*confirmSettings)[i].szMsg);
SetStatusList(hwndDlg);
}
@@ -268,7 +268,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // LAST STATUS
if (proto->status == ID_STATUS_LAST) {
- TCHAR last[80];
+ wchar_t last[80];
mir_sntprintf(last, L"%s (%s)", TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, last);
actualStatus = proto->lastStatus;
@@ -277,7 +277,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // CURRENT STATUS
else if (proto->status == ID_STATUS_CURRENT) {
int currentStatus = CallProtoService(proto->szName, PS_GETSTATUS, 0, 0);
- TCHAR current[80];
+ wchar_t current[80];
mir_sntprintf(current, L"%s (%s)", TranslateT("<current>"), pcli->pfnGetStatusModeDescription(currentStatus, 0));
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, current);
actualStatus = currentStatus;
@@ -343,7 +343,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP int actualStatus = proto->status;
// last
- TCHAR buf[100];
+ wchar_t buf[100];
mir_sntprintf(buf, L"%s (%s)", TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
int item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)buf);
SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, ID_STATUS_LAST);
@@ -364,7 +364,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP for (int i = 0; i < _countof(statusModeList); i++) {
if (((flags & statusModePf2List[i]) || (statusModePf2List[i] == PF2_OFFLINE)) && (!((!(flags)& Proto_Status2Flag(statusModePf2List[i]))) || ((CallProtoService(proto->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0)&Proto_Status2Flag(statusModePf2List[i]))))) {
- TCHAR *statusMode = pcli->pfnGetStatusModeDescription(statusModeList[i], 0);
+ wchar_t *statusMode = pcli->pfnGetStatusModeDescription(statusModeList[i], 0);
item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)statusMode);
SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, statusModeList[i]);
if (statusModeList[i] == proto->status)
diff --git a/plugins/StopSpamMod/src/init.cpp b/plugins/StopSpamMod/src/init.cpp index 4b8ef5167e..453dc319ef 100755 --- a/plugins/StopSpamMod/src/init.cpp +++ b/plugins/StopSpamMod/src/init.cpp @@ -43,14 +43,14 @@ BOOL gbMathExpression = 0; HANDLE hStopSpamLogDirH=0;
-tstring gbSpammersGroup = L"Spammers";
-tstring gbAutoAuthGroup = L"NotSpammers";
+wstring gbSpammersGroup = L"Spammers";
+wstring gbAutoAuthGroup = L"NotSpammers";
-tstring gbQuestion;
-tstring gbAnswer;
-tstring gbCongratulation;
+wstring gbQuestion;
+wstring gbAnswer;
+wstring gbCongratulation;
std::wstring gbAuthRepl;
-extern TCHAR const * defQuestion;
+extern wchar_t const * defQuestion;
extern int RemoveTmp(WPARAM,LPARAM);
/////////////////////////////////////////////////////////////////////////////////////////
@@ -75,7 +75,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) return &pluginInfoEx;
}
-extern tstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, tstring errorValue);
+extern wstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, wstring errorValue);
void InitVars()
{
diff --git a/plugins/StopSpamMod/src/options.cpp b/plugins/StopSpamMod/src/options.cpp index 7c4e557c06..8cc6139b5c 100755 --- a/plugins/StopSpamMod/src/options.cpp +++ b/plugins/StopSpamMod/src/options.cpp @@ -18,7 +18,7 @@ #include "stdafx.h"
char *pluginDescription = LPGEN("No more spam! Robots can't go! Only human beings invited!\r\n\r\nThis plugin works pretty simple:\r\nWhile messages from users on your contact list go as there is no any anti-spam software, messages from unknown users are not delivered to you. But also they are not ignored, this plugin replies with a simple question, and if user gives the right answer, plugin adds him to your contact list so that he can contact you.");
-TCHAR const *defQuestion = TranslateT("Spammers made me to install small anti-spam system you are now speaking with.\r\nPlease reply \"nospam\" without quotes and spaces if you want to contact me.");
+wchar_t const *defQuestion = TranslateT("Spammers made me to install small anti-spam system you are now speaking with.\r\nPlease reply \"nospam\" without quotes and spaces if you want to contact me.");
INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
@@ -143,7 +143,7 @@ INT_PTR CALLBACK ProtoDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (LB_ERR != n) {
size_t len = SendDlgItemMessage(hwnd, ID_ALLPROTO, LB_GETTEXTLEN, n, 0);
if (LB_ERR != len) {
- TCHAR * buf = new TCHAR[len + 1];
+ wchar_t * buf = new wchar_t[len + 1];
SendDlgItemMessage(hwnd, ID_ALLPROTO, LB_GETTEXT, n, (LPARAM)buf);
SendDlgItemMessage(hwnd, ID_USEDPROTO, LB_ADDSTRING, 0, (LPARAM)buf);
delete[]buf;
@@ -157,7 +157,7 @@ INT_PTR CALLBACK ProtoDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (LB_ERR != n) {
size_t len = SendDlgItemMessage(hwnd, ID_USEDPROTO, LB_GETTEXTLEN, n, 0);
if (LB_ERR != len) {
- TCHAR * buf = new TCHAR[len + 1];
+ wchar_t * buf = new wchar_t[len + 1];
SendDlgItemMessage(hwnd, ID_USEDPROTO, LB_GETTEXT, n, (LPARAM)buf);
SendDlgItemMessage(hwnd, ID_ALLPROTO, LB_ADDSTRING, 0, (LPARAM)buf);
delete[]buf;
@@ -270,7 +270,7 @@ INT_PTR CALLBACK AdvancedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar db_set_b(NULL, pluginName, "CaseInsensitive", gbCaseInsensitive = BST_CHECKED == IsDlgButtonChecked(hwnd, IDC_CASE_INSENSITIVE));
db_set_b(NULL, pluginName, "DisableInInvis", gbInvisDisable = BST_CHECKED == IsDlgButtonChecked(hwnd, IDC_INVIS_DISABLE));
{
- static tstring NewGroupName, CurrentGroupName;
+ static wstring NewGroupName, CurrentGroupName;
NewGroupName = GetDlgItemString(hwnd, ID_SPECIALGROUPNAME);
CurrentGroupName = gbSpammersGroup = DBGetContactSettingStringPAN(NULL, pluginName, "SpammersGroup", L"0");
if (mir_wstrcmp(CurrentGroupName.c_str(), NewGroupName.c_str()) != 0) {
@@ -294,7 +294,7 @@ INT_PTR CALLBACK AdvancedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar db_set_b(NULL, pluginName, "HistoryLog", gbHistoryLog = BST_CHECKED == IsDlgButtonChecked(hwnd, IDC_HISTORY_LOG));
db_set_b(NULL, pluginName, "MathExpression", gbMathExpression = BST_CHECKED == IsDlgButtonChecked(hwnd, IDC_MATH_QUESTION));
{
- static tstring NewAGroupName, CurrentAGroupName;
+ static wstring NewAGroupName, CurrentAGroupName;
NewAGroupName = GetDlgItemString(hwnd, IDC_AUTOADDGROUP);
CurrentAGroupName = gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, pluginName, "AutoAuthGroup", L"0");
if (mir_wstrcmp(CurrentAGroupName.c_str(), NewAGroupName.c_str()) != 0) {
@@ -318,29 +318,29 @@ MIRANDA_HOOK_EVENT(ME_OPT_INITIALISE, w, l) UNREFERENCED_PARAMETER(l);
OPTIONSDIALOGPAGE odp = { 0 };
- odp.ptszGroup = LPGENT("Message sessions");
- odp.ptszTitle = LPGENT("StopSpam");
+ odp.pwszGroup = LPGENW("Message sessions");
+ odp.pwszTitle = LPGENW("StopSpam");
odp.position = -1;
odp.hInstance = hInst;
odp.flags = ODPF_TCHAR;
- odp.ptszTab = LPGENT("General");
+ odp.pwszTab = LPGENW("General");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_MAIN);
odp.pfnDlgProc = MainDlgProc;
Options_AddPage(w, &odp);
- odp.ptszTab = LPGENT("Messages");
+ odp.pwszTab = LPGENW("Messages");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_MESSAGES);
odp.pfnDlgProc = MessagesDlgProc;
Options_AddPage(w, &odp);
- odp.ptszTab = LPGENT("Accounts");
+ odp.pwszTab = LPGENW("Accounts");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_PROTO);
odp.pfnDlgProc = ProtoDlgProc;
Options_AddPage(w, &odp);
- odp.ptszTab = LPGENT("Advanced");
+ odp.pwszTab = LPGENW("Advanced");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_ADVANCED);
odp.pfnDlgProc = AdvancedDlgProc;
Options_AddPage(w, &odp);
diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp index 918ec129aa..c5cc135954 100755 --- a/plugins/StopSpamMod/src/stopspam.cpp +++ b/plugins/StopSpamMod/src/stopspam.cpp @@ -49,7 +49,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, hContact, hDbEvent) db_set_ws(hcntct, "CList", "Group", gbSpammersGroup.c_str()); BYTE msg = 1; if (gbIgnoreURL) { - TCHAR* EventText = ReqGetText(&dbei); //else return NULL + wchar_t* EventText = ReqGetText(&dbei); //else return NULL msg = !IsUrlContains(EventText); mir_free(EventText); } @@ -110,7 +110,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) // reject processing of the event return 1; - tstring message; + wstring message; if (dbei->flags & DBEF_UTF) { wchar_t* msg_u; @@ -136,7 +136,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) bool answered = false; if (gbMathExpression) { if (boost::algorithm::all(message, boost::is_digit())) { - int num = _ttoi(message.c_str()); + int num = _wtoi(message.c_str()); int math_answer = db_get_dw(hContact, pluginName, "MathAnswer", 0); if (num && math_answer) answered = (num == math_answer); @@ -173,7 +173,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) // send congratulation if (bSendMsg) { - tstring prot = DBGetContactSettingStringPAN(NULL, dbei->szModule, "AM_BaseProto", L""); + wstring prot = DBGetContactSettingStringPAN(NULL, dbei->szModule, "AM_BaseProto", L""); // for notICQ protocols or disable auto auth. reqwest if ((Stricmp(L"ICQ", prot.c_str())) || (!gbAutoReqAuth)) { char * buf = mir_utf8encodeW(variables_parse(gbCongratulation, hContact).c_str()); @@ -199,23 +199,23 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) return 0; } // URL contains check - bSendMsg = (bSendMsg && gbIgnoreURL) ? (!IsUrlContains((TCHAR *)message.c_str())) : bSendMsg; + bSendMsg = (bSendMsg && gbIgnoreURL) ? (!IsUrlContains((wchar_t *)message.c_str())) : bSendMsg; // if message message does not contain infintite talk protection prefix // and question count for this contact is less then maximum if (bSendMsg) { - if ((!gbInfTalkProtection || tstring::npos == message.find(L"StopSpam automatic message:\r\n")) + if ((!gbInfTalkProtection || wstring::npos == message.find(L"StopSpam automatic message:\r\n")) && (!gbMaxQuestCount || db_get_dw(hContact, pluginName, "QuestionCount", 0) < gbMaxQuestCount)) { // send question - tstring q; + wstring q; if (gbInfTalkProtection) q += L"StopSpam automatic message:\r\n"; if (gbMathExpression) { //parse math expression in question - tstring tmp_question = gbQuestion; + wstring tmp_question = gbQuestion; std::list<int> args; - std::list<TCHAR> actions; - tstring::size_type p1 = gbQuestion.find(L"X"), p2 = 0; - const tstring expr_chars = L"X+-/*", expr_acts = L"+-/*"; - while (p1 < gbQuestion.length() && p1 != tstring::npos && expr_chars.find(gbQuestion[p1]) != tstring::npos) { + std::list<wchar_t> actions; + wstring::size_type p1 = gbQuestion.find(L"X"), p2 = 0; + const wstring expr_chars = L"X+-/*", expr_acts = L"+-/*"; + while (p1 < gbQuestion.length() && p1 != wstring::npos && expr_chars.find(gbQuestion[p1]) != wstring::npos) { std::string arg; p2 = p1; for (p1 = gbQuestion.find(L"X", p1); (p1 < gbQuestion.length()) && (gbQuestion[p1] == L'X'); ++p1) @@ -224,7 +224,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) tmp_question.replace(p2, arg.size(), toUTF16(arg)); args.push_back(atoi(arg.c_str())); - if ((p1 < gbQuestion.length()) && (p1 != tstring::npos) && (expr_acts.find(gbQuestion[p1]) != tstring::npos)) + if ((p1 < gbQuestion.length()) && (p1 != wstring::npos) && (expr_acts.find(gbQuestion[p1]) != wstring::npos)) actions.push_back(gbQuestion[p1]); ++p1; } @@ -234,25 +234,25 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) while (!args.empty()) { if (!actions.empty()) { switch (actions.front()) { - case _T('+'): + case '+': { math_answer += args.front(); args.pop_front(); } break; - case _T('-'): + case '-': { math_answer -= args.front(); args.pop_front(); } break; - case _T('/'): + case '/': { math_answer /= args.front(); args.pop_front(); } break; - case _T('*'): + case '*': { math_answer *= args.front(); args.pop_front(); diff --git a/plugins/StopSpamMod/src/stopspam.h b/plugins/StopSpamMod/src/stopspam.h index b783dc4d40..6b76869416 100755 --- a/plugins/StopSpamMod/src/stopspam.h +++ b/plugins/StopSpamMod/src/stopspam.h @@ -17,14 +17,14 @@ extern BOOL gbHistoryLog; extern BOOL gbInvisDisable; extern BOOL gbIgnoreURL; extern BOOL gbMathExpression; -extern tstring gbSpammersGroup; -extern tstring gbQuestion; -extern tstring gbAnswer; -extern tstring gbCongratulation; +extern wstring gbSpammersGroup; +extern wstring gbQuestion; +extern wstring gbAnswer; +extern wstring gbCongratulation; extern std::wstring gbAuthRepl; extern BOOL gbAutoAuth; extern BOOL gbAutoAddToServerList; extern BOOL gbAutoReqAuth; -extern tstring gbAutoAuthGroup; +extern wstring gbAutoAuthGroup; extern BOOL gbLogToFile; extern BOOL gbDelAllTempory; diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index bfa076de6a..e2fa1253d1 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -17,7 +17,7 @@ #include "stdafx.h"
-tstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, tstring errorValue)
+wstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, wstring errorValue)
{
DBVARIANT dbv;
//if(db_get(hContact, szModule, szSetting, &dbv))
@@ -41,13 +41,13 @@ std::string DBGetContactSettingStringPAN_A(MCONTACT hContact, char const * szMod return errorValue;
}
-tstring &GetDlgItemString(HWND hwnd, int id)
+wstring &GetDlgItemString(HWND hwnd, int id)
{
HWND h = GetDlgItem(hwnd, id);
int len = GetWindowTextLength(h);
- TCHAR * buf = new TCHAR[len + 1];
+ wchar_t * buf = new wchar_t[len + 1];
GetWindowText(h, buf, len + 1);
- static tstring s;
+ static wstring s;
s = buf;
delete[]buf;
return s;
@@ -64,13 +64,13 @@ bool ProtoInList(std::string proto) return std::string::npos != GetProtoList().find(proto + "\r\n");
}
-void DeleteCListGroupsByName(TCHAR* szGroupName)
+void DeleteCListGroupsByName(wchar_t* szGroupName)
{
BYTE ConfirmDelete = db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT);
if (ConfirmDelete)
db_set_b(NULL, "CList", "ConfirmDelete", 0);
- TCHAR *szGroup;
+ wchar_t *szGroup;
for (int i = 1; (szGroup = Clist_GroupGetName(i, NULL)) != NULL; i++)
if (!mir_wstrcmp(szGroupName, szGroup))
Clist_GroupDelete(i);
@@ -86,19 +86,19 @@ int RemoveTmp(WPARAM, LPARAM) return 0;
}
-tstring variables_parse(tstring const &tstrFormat, MCONTACT hContact)
+wstring variables_parse(wstring const &tstrFormat, MCONTACT hContact)
{
if (gbVarsServiceExist) {
FORMATINFO fi;
- TCHAR *tszParsed;
- tstring tstrResult;
+ wchar_t *tszParsed;
+ wstring tstrResult;
memset(&fi, 0, sizeof(fi));
fi.cbSize = sizeof(fi);
- fi.tszFormat = _tcsdup(tstrFormat.c_str());
+ fi.tszFormat = wcsdup(tstrFormat.c_str());
fi.hContact = hContact;
fi.flags |= FIF_TCHAR;
- tszParsed = (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+ tszParsed = (wchar_t *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
free(fi.tszFormat);
if (tszParsed) {
tstrResult = tszParsed;
@@ -111,13 +111,13 @@ tstring variables_parse(tstring const &tstrFormat, MCONTACT hContact) // case-insensitive mir_tstrcmp
//by nullbie as i remember...
-#define NEWTSTR_MALLOC(A) (A==NULL) ? NULL : mir_tstrcpy((TCHAR*)mir_alloc(sizeof(TCHAR)*(mir_tstrlen(A)+1)),A)
-const int Stricmp(const TCHAR *str, const TCHAR *substr)
+#define NEWTSTR_MALLOC(A) (A==NULL) ? NULL : mir_tstrcpy((wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_tstrlen(A)+1)),A)
+const int Stricmp(const wchar_t *str, const wchar_t *substr)
{
int i = 0;
- TCHAR *str_up = NEWTSTR_MALLOC(str);
- TCHAR *substr_up = NEWTSTR_MALLOC(substr);
+ wchar_t *str_up = NEWTSTR_MALLOC(str);
+ wchar_t *substr_up = NEWTSTR_MALLOC(substr);
CharUpperBuff(str_up, (int)mir_tstrlen(str_up));
CharUpperBuff(substr_up, (int)mir_tstrlen(substr_up));
@@ -130,7 +130,7 @@ const int Stricmp(const TCHAR *str, const TCHAR *substr) return i;
}
-TCHAR* ReqGetText(DBEVENTINFO* dbei)
+wchar_t* ReqGetText(DBEVENTINFO* dbei)
{
if (!dbei->pBlob)
return 0;
@@ -152,15 +152,15 @@ TCHAR* ReqGetText(DBEVENTINFO* dbei) WCHAR* msg = NULL;
msg = (dbei->flags&DBEF_UTF) ? mir_utf8decodeW(tstr) : mir_a2u(tstr);
mir_free(tstr);
- return (TCHAR *)msg;
+ return (wchar_t *)msg;
};
return 0;
}
-BOOL IsUrlContains(TCHAR * Str)
+BOOL IsUrlContains(wchar_t * Str)
{
const int CountUrl = 11;
- const TCHAR URL[CountUrl][5] =
+ const wchar_t URL[CountUrl][5] =
{
L"http",
L"www",
@@ -176,10 +176,10 @@ BOOL IsUrlContains(TCHAR * Str) };
if (Str && mir_tstrlen(Str) > 0) {
- TCHAR *StrLower = NEWTSTR_MALLOC(Str);
+ wchar_t *StrLower = NEWTSTR_MALLOC(Str);
CharLowerBuff(StrLower, (int)mir_tstrlen(StrLower));
for (int i = 0; i < CountUrl; i++)
- if (_tcsstr(StrLower, URL[i])) {
+ if (wcsstr(StrLower, URL[i])) {
mir_free(StrLower);
return 1;
}
@@ -188,27 +188,27 @@ BOOL IsUrlContains(TCHAR * Str) return 0;
}
-tstring GetContactUid(MCONTACT hContact, tstring Protocol)
+wstring GetContactUid(MCONTACT hContact, wstring Protocol)
{
char *szProto = mir_utf8encodeW(Protocol.c_str());
ptrT uid(Contact_GetInfo(CNF_DISPLAYUID, hContact, szProto));
return (uid) ? uid : L"";
}
-void LogSpamToFile(MCONTACT hContact, tstring message)
+void LogSpamToFile(MCONTACT hContact, wstring message)
{
if (!gbLogToFile) return;
- tstring LogStrW, LogTime, LogProtocol, LogContactId, LogContactName;
+ wstring LogStrW, LogTime, LogProtocol, LogContactId, LogContactName;
std::fstream file;
- TCHAR pszName[MAX_PATH];
+ wchar_t pszName[MAX_PATH];
if (hStopSpamLogDirH)
FoldersGetCustomPathT(hStopSpamLogDirH, pszName, MAX_PATH, L"");
else
mir_tstrncpy(pszName, VARST(L"%miranda_logpath%"), _countof(pszName));
- tstring filename = pszName;
+ wstring filename = pszName;
filename += L"\\stopspam_mod.log";
file.open(filename.c_str(), std::ios::out | std::ios::app);
@@ -222,7 +222,7 @@ void LogSpamToFile(MCONTACT hContact, tstring message) // Name, UID and Protocol Log line
LogProtocol = DBGetContactSettingStringPAN(hContact, "Protocol", "p", L"");
- LogContactName = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
+ LogContactName = (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0);
LogContactId = (LogProtocol == L"") ? L"" : GetContactUid(hContact, LogProtocol);
// Name, UID and Protocol Log line
@@ -331,7 +331,7 @@ void HistoryLogFunc(MCONTACT hContact, std::string message) std::string msg = message;
msg.append("\n");
msg.append("Protocol: ").append(GetContactProto(hContact)).append(" Contact: ");
- msg.append(toUTF8((TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0))).append(" ID: ");
+ msg.append(toUTF8((wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0))).append(" ID: ");
msg.append(toUTF8(GetContactUid(hContact, toUTF16(GetContactProto(hContact)))));
HistoryLog(NULL, (char*)msg.c_str(), EVENTTYPE_MESSAGE, DBEF_READ);
}
diff --git a/plugins/StopSpamMod/src/utilities.h b/plugins/StopSpamMod/src/utilities.h index 4120d0dec9..b0ffab994c 100755 --- a/plugins/StopSpamMod/src/utilities.h +++ b/plugins/StopSpamMod/src/utilities.h @@ -1,17 +1,17 @@ -tstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, tstring errorValue); +std::wstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, std::wstring errorValue); std::string DBGetContactSettingStringPAN_A(MCONTACT hContact, char const * szModule, char const * szSetting, std::string errorValue); -tstring &GetDlgItemString(HWND hwnd, int id); +std::wstring &GetDlgItemString(HWND hwnd, int id); std::string &GetProtoList(); bool ProtoInList(std::string proto); void RemoveExcludedUsers(); -tstring variables_parse(tstring const &tstrFormat, MCONTACT hContact); -const int Stricmp(const TCHAR *str, const TCHAR *substr); -//const int Stristr(const TCHAR *str, const TCHAR *substr); -TCHAR* ReqGetText(DBEVENTINFO* dbei); -BOOL IsUrlContains(TCHAR * Str); -void DeleteCListGroupsByName(TCHAR* szGroupName); -tstring GetContactUid(MCONTACT hContact, std::string Protocol); -void LogSpamToFile(MCONTACT hContact, tstring message); +std::wstring variables_parse(std::wstring const &tstrFormat, MCONTACT hContact); +const int Stricmp(const wchar_t *str, const wchar_t *substr); +//const int Stristr(const wchar_t *str, const wchar_t *substr); +wchar_t* ReqGetText(DBEVENTINFO* dbei); +BOOL IsUrlContains(wchar_t * Str); +void DeleteCListGroupsByName(wchar_t* szGroupName); +std::wstring GetContactUid(MCONTACT hContact, std::string Protocol); +void LogSpamToFile(MCONTACT hContact, std::wstring message); std::string toUTF8(std::wstring str); std::string toUTF8(std::string str); std::wstring toUTF16(std::string str); diff --git a/plugins/StopSpamPlus/src/options.cpp b/plugins/StopSpamPlus/src/options.cpp index 03105de55d..3feb724e8f 100644 --- a/plugins/StopSpamPlus/src/options.cpp +++ b/plugins/StopSpamPlus/src/options.cpp @@ -1,7 +1,7 @@ #include "stdafx.h"
-TCHAR * pluginDescription = TranslateT("No more spam! Robots can't go! Only human beings invited!\r\n\r\nThis plugin works pretty simple:\r\nWhile messages from users on your contact list go as there is no any anti-spam software, messages from unknown users are not delivered to you. But also they are not ignored, this plugin replies with a simple question, and if user gives the right answer, plugin adds him to your contact list so that he can contact you.");
-TCHAR const * infTalkProtPrefix = TranslateT("StopSpam automatic message:\r\n");
+wchar_t * pluginDescription = TranslateT("No more spam! Robots can't go! Only human beings invited!\r\n\r\nThis plugin works pretty simple:\r\nWhile messages from users on your contact list go as there is no any anti-spam software, messages from unknown users are not delivered to you. But also they are not ignored, this plugin replies with a simple question, and if user gives the right answer, plugin adds him to your contact list so that he can contact you.");
+wchar_t const * infTalkProtPrefix = TranslateT("StopSpam automatic message:\r\n");
char const * answeredSetting = "Answered";
char const * questCountSetting = "QuestionCount";
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp index 9b821b1aa3..5026af7098 100644 --- a/plugins/StopSpamPlus/src/services.cpp +++ b/plugins/StopSpamPlus/src/services.cpp @@ -27,7 +27,7 @@ INT_PTR RemoveTempContacts(WPARAM, LPARAM lParam) MCONTACT hNext = db_find_next(hContact);
ptrT szGroup(db_get_tsa(hContact, "CList", "Group"));
- if (db_get_b(hContact, "CList", "NotOnList", 0) || (szGroup != NULL && (_tcsstr(szGroup, L"Not In List") || _tcsstr(szGroup, TranslateT("Not In List"))))) {
+ if (db_get_b(hContact, "CList", "NotOnList", 0) || (szGroup != NULL && (wcsstr(szGroup, L"Not In List") || wcsstr(szGroup, TranslateT("Not In List"))))) {
char *szProto = GetContactProto(hContact);
if (szProto != NULL) {
// Check if protocol uses server side lists
@@ -47,10 +47,10 @@ INT_PTR RemoveTempContacts(WPARAM, LPARAM lParam) }
int hGroup = 1;
- TCHAR *group_name;
+ wchar_t *group_name;
do {
group_name = Clist_GroupGetName(hGroup, 0);
- if (group_name != NULL && _tcsstr(group_name, TranslateT("Not In List"))) {
+ if (group_name != NULL && wcsstr(group_name, TranslateT("Not In List"))) {
BYTE ConfirmDelete = db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT);
if (ConfirmDelete)
db_set_b(NULL, "CList", "ConfirmDelete", 0);
diff --git a/plugins/StopSpamPlus/src/stdafx.h b/plugins/StopSpamPlus/src/stdafx.h index b22afebe4d..8e521c120d 100644 --- a/plugins/StopSpamPlus/src/stdafx.h +++ b/plugins/StopSpamPlus/src/stdafx.h @@ -32,8 +32,8 @@ typedef std::wstring tstring; #define pluginName LPGEN("StopSpam")
-extern TCHAR * pluginDescription;
-extern TCHAR const * infTalkProtPrefix;
+extern wchar_t * pluginDescription;
+extern wchar_t const * infTalkProtPrefix;
extern char const * answeredSetting;
extern char const * questCountSetting;
extern HANDLE hLoadHook;
diff --git a/plugins/StopSpamPlus/src/stopspam.cpp b/plugins/StopSpamPlus/src/stopspam.cpp index 13fd6dbd21..ccd407d3d5 100644 --- a/plugins/StopSpamPlus/src/stopspam.cpp +++ b/plugins/StopSpamPlus/src/stopspam.cpp @@ -54,7 +54,7 @@ extern "C" int __declspec(dllexport) Load(void) mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mi.name.t = LPGENT("Remove Temporary Contacts");
+ mi.name.w = LPGENW("Remove Temporary Contacts");
mi.pszService = pluginName"/RemoveTempContacts";
Menu_AddMainMenuItem(&mi);
diff --git a/plugins/StopSpamPlus/src/utils.cpp b/plugins/StopSpamPlus/src/utils.cpp index 0b617519da..f5ea232f94 100644 --- a/plugins/StopSpamPlus/src/utils.cpp +++ b/plugins/StopSpamPlus/src/utils.cpp @@ -4,7 +4,7 @@ tstring &GetDlgItemString(HWND hwnd, int id) {
HWND h = GetDlgItem(hwnd, id);
int len = GetWindowTextLength(h);
- TCHAR * buf = new TCHAR[len + 1];
+ wchar_t * buf = new wchar_t[len + 1];
GetWindowText(h, buf, len + 1);
static tstring s;
s = buf;
@@ -48,10 +48,10 @@ tstring variables_parse(tstring const &tstrFormat, MCONTACT hContact){ memset(&fi, 0, sizeof(fi));
fi.cbSize = sizeof(fi);
- fi.tszFormat = _tcsdup(tstrFormat.c_str());
+ fi.tszFormat = wcsdup(tstrFormat.c_str());
fi.hContact = hContact;
fi.flags |= FIF_TCHAR;
- TCHAR *tszParsed = (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+ wchar_t *tszParsed = (wchar_t *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
free(fi.tszFormat);
if (tszParsed) {
tstrResult = tszParsed;
diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp index 603bdceb34..673ad7d5a2 100644 --- a/plugins/TabSRMM/src/TSButton.cpp +++ b/plugins/TabSRMM/src/TSButton.cpp @@ -277,7 +277,7 @@ static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint) RECT rcText;
CopyRect(&rcText, &rcClient);
- TCHAR szText[MAX_PATH];
+ wchar_t szText[MAX_PATH];
GetWindowText(ctl->hwnd, szText, _countof(szText));
SetBkMode(hdcMem, TRANSPARENT);
HFONT hOldFont = (HFONT)SelectObject(hdcMem, ctl->hFont);
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index adb7c964c5..2e2561c2c2 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -24,7 +24,7 @@ struct CustomButtonData : public MZeroedObject DWORD m_dwButtonCID; DWORD m_dwArrowCID; // only use with BBBF_ISARROWBUTTON flag - TCHAR *m_ptszTooltip; // button's tooltip + wchar_t *m_ptszTooltip; // button's tooltip int m_iButtonWidth; // must be 22 for regular button and 33 for button with arrow HANDLE m_hIcon; // Handle to icolib registred icon @@ -356,7 +356,7 @@ static int SaveTree(HWND hToolBarTree) bool RSide = false; int count = 10; DWORD loc_sepcout = 0; - TCHAR strbuf[128]; + wchar_t strbuf[128]; TVITEM tvi; tvi.mask = TVIF_TEXT | TVIF_PARAM | TVIF_HANDLE; @@ -561,7 +561,7 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l TreeView_GetItem(hToolBarTree, &tvi); if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT) || (hti.hItem == TVI_FIRST)) { TVINSERTSTRUCT tvis; - TCHAR strbuf[128]; + wchar_t strbuf[128]; tvis.item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE; tvis.item.stateMask = 0xFFFFFFFF; tvis.item.pszText = strbuf; @@ -699,7 +699,7 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l case TVN_SELCHANGING: hItem = TreeView_GetSelection(hToolBarTree); if (hItem != NULL) { - TCHAR strbuf[128]; + wchar_t strbuf[128]; TVITEM tvi; tvi.hItem = hItem; @@ -727,7 +727,7 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l case TVN_SELCHANGED: hItem = TreeView_GetSelection(hToolBarTree); if (hItem != NULL) { - TCHAR strbuf[128]; + wchar_t strbuf[128]; TVITEM tvi; tvi.pszText = strbuf; @@ -840,14 +840,14 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 10; bbd.hIcon = Skin_GetIconHandle(SKINICON_OTHER_CONNECTING); bbd.pszModuleName = "Tabsrmm"; - bbd.ptszTooltip = LPGENT("Protocol button"); + bbd.ptszTooltip = LPGENW("Protocol button"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISARROWBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_NAME; bbd.dwDefPos = 20; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[20]; - bbd.ptszTooltip = LPGENT("Info button"); + bbd.ptszTooltip = LPGENW("Info button"); CB_AddButton(0, (LPARAM)&bbd); if (PluginConfig.g_SmileyAddAvail) { @@ -856,7 +856,7 @@ void CB_InitDefaultButtons() bbd.iButtonWidth = 0; bbd.dwDefPos = 30; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[9]; - bbd.ptszTooltip = LPGENT("Insert emoticon"); + bbd.ptszTooltip = LPGENW("Insert emoticon"); CB_AddButton(0, (LPARAM)&bbd); } @@ -864,35 +864,35 @@ void CB_InitDefaultButtons() bbd.dwButtonID = IDC_FONTBOLD; bbd.dwDefPos = 40; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[10]; - bbd.ptszTooltip = LPGENT("Bold text"); + bbd.ptszTooltip = LPGENW("Bold text"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; bbd.dwButtonID = IDC_FONTITALIC; bbd.dwDefPos = 50; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[11]; - bbd.ptszTooltip = LPGENT("Italic text"); + bbd.ptszTooltip = LPGENW("Italic text"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; bbd.dwButtonID = IDC_FONTUNDERLINE; bbd.dwDefPos = 60; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[12]; - bbd.ptszTooltip = LPGENT("Underlined text"); + bbd.ptszTooltip = LPGENW("Underlined text"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; bbd.dwButtonID = IDC_FONTSTRIKEOUT; bbd.dwDefPos = 70; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[15]; - bbd.ptszTooltip = LPGENT("Strike-through text"); + bbd.ptszTooltip = LPGENW("Strike-through text"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; bbd.dwButtonID = IDC_FONTFACE; bbd.dwDefPos = 80; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[14]; - bbd.ptszTooltip = LPGENT("Select font color"); + bbd.ptszTooltip = LPGENW("Select font color"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_ISARROWBUTTON | BBBF_CREATEBYID; @@ -900,7 +900,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 10; bbd.iButtonWidth = 51; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[6]; - bbd.ptszTooltip = LPGENT("Send message\nClick dropdown arrow for sending options"); + bbd.ptszTooltip = LPGENW("Send message\nClick dropdown arrow for sending options"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; @@ -908,7 +908,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 20; bbd.iButtonWidth = 0; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[8]; - bbd.ptszTooltip = LPGENT("Close session"); + bbd.ptszTooltip = LPGENW("Close session"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; @@ -916,7 +916,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 30; bbd.iButtonWidth = 0; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[4]; - bbd.ptszTooltip = LPGENT("Quote last message OR selected text"); + bbd.ptszTooltip = LPGENW("Quote last message OR selected text"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; @@ -924,7 +924,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 40; bbd.iButtonWidth = 0; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[2]; - bbd.ptszTooltip = LPGENT("Message log options"); + bbd.ptszTooltip = LPGENW("Message log options"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; @@ -932,7 +932,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 50; bbd.iButtonWidth = 0; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[0]; - bbd.ptszTooltip = LPGENT("View user's history"); + bbd.ptszTooltip = LPGENW("View user's history"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; @@ -940,7 +940,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 60; bbd.iButtonWidth = 0; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[7]; - bbd.ptszTooltip = LPGENT("Edit user notes"); + bbd.ptszTooltip = LPGENW("Edit user notes"); CB_AddButton(0, (LPARAM)&bbd); //chat buttons @@ -976,7 +976,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 81; bbd.iButtonWidth = 22; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[16]; - bbd.ptszTooltip = LPGENT("Change background color"); + bbd.ptszTooltip = LPGENW("Change background color"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; @@ -984,7 +984,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 22; bbd.iButtonWidth = 22; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[19]; - bbd.ptszTooltip = LPGENT("Toggle nick list"); + bbd.ptszTooltip = LPGENW("Toggle nick list"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; @@ -992,7 +992,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 24; bbd.iButtonWidth = 22; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[18]; - bbd.ptszTooltip = LPGENT("Event filter - right click to setup, left click to activate/deactivate"); + bbd.ptszTooltip = LPGENW("Event filter - right click to setup, left click to activate/deactivate"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; @@ -1000,7 +1000,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 33; bbd.iButtonWidth = 22; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[17]; - bbd.ptszTooltip = LPGENT("Channel manager"); + bbd.ptszTooltip = LPGENW("Channel manager"); CB_AddButton(0, (LPARAM)&bbd); BB_RegisterSeparators(); diff --git a/plugins/TabSRMM/src/chat/chat.h b/plugins/TabSRMM/src/chat/chat.h index 536f837528..59f4078655 100644 --- a/plugins/TabSRMM/src/chat/chat.h +++ b/plugins/TabSRMM/src/chat/chat.h @@ -52,7 +52,7 @@ struct MODULEINFO : public GCModuleInfoBase {
DWORD idleTimeStamp;
DWORD lastIdleCheck;
- TCHAR tszIdleMsg[60];
+ wchar_t tszIdleMsg[60];
};
struct SESSION_INFO : public GCSessionInfoBase
@@ -62,7 +62,7 @@ struct SESSION_INFO : public GCSessionInfoBase int iLogTrayFlags, iLogPopupFlags, iDiskLogFlags;
int iSearchItem;
- TCHAR szSearch[255];
+ wchar_t szSearch[255];
};
struct LOGSTREAMDATA : public GCLogStreamDataBase
@@ -116,7 +116,7 @@ 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);
// options.c
enum { FONTSECTION_AUTO, FONTSECTION_IM, FONTSECTION_IP };
@@ -132,28 +132,28 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT // manager.c
SESSION_INFO* SM_FindSessionByHWND(HWND h);
SESSION_INFO* SM_FindSessionByHCONTACT(MCONTACT h);
-SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const TCHAR* pszOriginal, const TCHAR* pszCurrent);
+SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const wchar_t* pszOriginal, const wchar_t* pszCurrent);
void SM_RemoveContainer(TContainerData *pContainer);
BOOL SM_ReconfigureFilters();
-int UM_CompareItem(USERINFO *u1, const TCHAR* pszNick, WORD wStatus);
+int UM_CompareItem(USERINFO *u1, const wchar_t* pszNick, WORD wStatus);
//clist.c
//tools.c
BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight, int bManyFix);
int Chat_GetColorIndex(const char* pszModule, COLORREF cr);
-TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2);
+wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2);
int GetRichTextLength(HWND hwnd);
BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *pszText);
char GetIndicator(SESSION_INFO *si, LPCTSTR ptszNick, int *iNickIndex);
-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);
void Chat_SetFilters(SESSION_INFO *si);
void TSAPI DoFlashAndSoundWorker(FLASH_PARAMS* p);
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, ...);
BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce);
#include "chat_resource.h"
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index a7894b3e37..09b240c6aa 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -54,16 +54,16 @@ static char* u2a(const wchar_t* src, int codepage) return result;
}
-static char* t2acp(const TCHAR* src, int codepage)
+static char* t2acp(const wchar_t* src, int codepage)
{
return u2a(src, codepage);
}
-static TCHAR *a2tcp(const char *text, int cp)
+static wchar_t *a2tcp(const char *text, int cp)
{
if (text != NULL) {
int cbLen = MultiByteToWideChar(cp, 0, text, -1, NULL, 0);
- TCHAR* result = (TCHAR*)mir_alloc(sizeof(TCHAR)*(cbLen + 1));
+ wchar_t* result = (wchar_t*)mir_alloc(sizeof(wchar_t)*(cbLen + 1));
if (result == NULL)
return NULL;
MultiByteToWideChar(cp, 0, text, -1, result, cbLen);
@@ -72,12 +72,12 @@ static TCHAR *a2tcp(const char *text, int cp) return NULL;
}
-static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR **buffer, int *cbBufferEnd, int *cbBufferAlloced, const TCHAR *fmt, ...)
+static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, wchar_t **buffer, int *cbBufferEnd, int *cbBufferAlloced, const wchar_t *fmt, ...)
{
va_list va;
int lineLen, textCharsCount = 0;
- TCHAR* line = (TCHAR*)_alloca(8001 * sizeof(TCHAR));
- TCHAR* d;
+ wchar_t* line = (wchar_t*)_alloca(8001 * sizeof(wchar_t));
+ wchar_t* d;
MODULEINFO *mi = pci->MM_FindModule(streamData->si->pszModule);
va_start(va, fmt);
@@ -89,14 +89,14 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR ** lineLen = lineLen * 9 + 8;
if (*cbBufferEnd + lineLen > *cbBufferAlloced) {
cbBufferAlloced[0] += (lineLen + 1024 - lineLen % 1024);
- *buffer = (TCHAR*)mir_realloc(*buffer, *cbBufferAlloced * sizeof(TCHAR));
+ *buffer = (wchar_t*)mir_realloc(*buffer, *cbBufferAlloced * sizeof(wchar_t));
}
d = *buffer + *cbBufferEnd;
for (; *line; line++, textCharsCount++) {
if (*line == '%' && !simpleMode) {
- TCHAR szTemp[200];
+ wchar_t szTemp[200];
szTemp[0] = '\0';
switch (*++line) {
@@ -109,12 +109,12 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR ** case 'f':
if (!g_Settings.bStripFormat && !streamData->bStripFormat) {
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';
- col = _ttoi(szTemp3);
+ col = _wtoi(szTemp3);
mir_sntprintf(szTemp, L"%%%c#%02X%02X%02X", c, GetRValue(mi->crColors[col]), GetGValue(mi->crColors[col]), GetBValue(mi->crColors[col]));
}
}
@@ -141,7 +141,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR ** if (szTemp[0]) {
size_t iLen = mir_tstrlen(szTemp);
- memcpy(d, szTemp, iLen * sizeof(TCHAR));
+ memcpy(d, szTemp, iLen * sizeof(wchar_t));
d += iLen;
}
}
@@ -150,7 +150,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR ** *d++ = (char)*line;
}
else {
- *d++ = (TCHAR)*line;
+ *d++ = (wchar_t)*line;
}
}
*d = '\0';
@@ -158,21 +158,21 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR ** return textCharsCount;
}
-static void AddEventTextToBufferIEView(TCHAR **buffer, int *bufferEnd, int *bufferAlloced, LOGSTREAMDATA *streamData)
+static void AddEventTextToBufferIEView(wchar_t **buffer, int *bufferEnd, int *bufferAlloced, LOGSTREAMDATA *streamData)
{
if (streamData->lin->ptszText)
Log_AppendIEView(streamData, FALSE, str, L": %s", streamData->lin->ptszText);
}
-static void AddEventToBufferIEView(TCHAR **buffer, int *bufferEnd, int *bufferAlloced, LOGSTREAMDATA *streamData, TCHAR *pszNick)
+static void AddEventToBufferIEView(wchar_t **buffer, int *bufferEnd, int *bufferAlloced, LOGSTREAMDATA *streamData, wchar_t *pszNick)
{
if (streamData && streamData->lin) {
switch (streamData->lin->iType) {
case GC_EVENT_MESSAGE:
if (streamData->lin->ptszText) {
- TCHAR *ptszTemp = NULL;
- TCHAR *ptszText = streamData->lin->ptszText;
+ wchar_t *ptszTemp = NULL;
+ wchar_t *ptszText = streamData->lin->ptszText;
if (streamData->dat->codePage != CP_ACP) {
char *aText = t2acp(streamData->lin->ptszText, CP_ACP);
ptszText = ptszTemp = a2tcp(aText, streamData->dat->codePage);
@@ -249,9 +249,9 @@ static void AddEventToBufferIEView(TCHAR **buffer, int *bufferEnd, int *bufferAl }
}
-static void LogEventIEView(LOGSTREAMDATA *streamData, TCHAR *ptszNick)
+static void LogEventIEView(LOGSTREAMDATA *streamData, wchar_t *ptszNick)
{
- TCHAR *buffer = NULL;
+ wchar_t *buffer = NULL;
int bufferEnd = 0;
int bufferAlloced = 0;
IEVIEWEVENTDATA ied;
@@ -422,10 +422,10 @@ static int EventToIcon(LOGINFO * lin) return 0;
}
-static void Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, CMStringA &str, const TCHAR *fmt, ...)
+static void Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, CMStringA &str, const wchar_t *fmt, ...)
{
int textCharsCount = 0;
- TCHAR *line = (TCHAR*)_alloca(8001 * sizeof(TCHAR));
+ wchar_t *line = (wchar_t*)_alloca(8001 * sizeof(wchar_t));
va_list va;
va_start(va, fmt);
@@ -458,14 +458,14 @@ static void Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, CMStringA if (g_Settings.bStripFormat || streamData->bStripFormat)
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);
res.AppendFormat((c == 'c') ? "\\cf%u " : "\\highlight%u ", col);
}
@@ -520,8 +520,8 @@ static void Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, CMStringA static void AddEventToBuffer(CMStringA &str, LOGSTREAMDATA *streamData)
{
- TCHAR szTemp[512], szTemp2[512];
- TCHAR* pszNick = NULL;
+ wchar_t szTemp[512], szTemp2[512];
+ wchar_t* pszNick = NULL;
if (streamData == NULL)
return;
@@ -531,20 +531,20 @@ static void AddEventToBuffer(CMStringA &str, LOGSTREAMDATA *streamData) if (streamData->lin->ptszNick) {
if (g_Settings.bLogLimitNames && mir_tstrlen(streamData->lin->ptszNick) > 20) {
- _tcsncpy_s(szTemp, 20, streamData->lin->ptszNick, _TRUNCATE);
- _tcsncpy_s(szTemp + 20, 4, L"...", _TRUNCATE);
+ wcsncpy_s(szTemp, 20, streamData->lin->ptszNick, _TRUNCATE);
+ wcsncpy_s(szTemp + 20, 4, L"...", _TRUNCATE);
}
- else _tcsncpy_s(szTemp, streamData->lin->ptszNick, _TRUNCATE);
+ else wcsncpy_s(szTemp, streamData->lin->ptszNick, _TRUNCATE);
if (g_Settings.bClickableNicks)
mir_sntprintf(szTemp2, L"~~++#%s#++~~", szTemp);
else
- _tcsncpy_s(szTemp2, szTemp, _TRUNCATE);
+ wcsncpy_s(szTemp2, szTemp, _TRUNCATE);
if (streamData->lin->ptszUserInfo && streamData->lin->iType != GC_EVENT_TOPIC)
mir_sntprintf(szTemp, L"%s (%s)", szTemp2, streamData->lin->ptszUserInfo);
else
- _tcsncpy_s(szTemp, szTemp2, _TRUNCATE);
+ wcsncpy_s(szTemp, szTemp2, _TRUNCATE);
pszNick = szTemp;
}
@@ -669,7 +669,7 @@ char* Log_CreateRtfHeader(MODULEINFO *mi) int iIndent = 0;
if (g_Settings.bLogSymbols) {
- TCHAR szString[2];
+ wchar_t szString[2];
LOGFONT lf;
szString[1] = 0;
@@ -770,10 +770,10 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData) //insert timestamp
if (g_Settings.bShowTime) {
- TCHAR szTimeStamp[30], szOldTimeStamp[30];
+ wchar_t szTimeStamp[30], szOldTimeStamp[30];
- _tcsncpy_s(szTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, lin->time), _TRUNCATE);
- _tcsncpy_s(szOldTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, streamData->si->LastTime), _TRUNCATE);
+ wcsncpy_s(szTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, lin->time), _TRUNCATE);
+ wcsncpy_s(szOldTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, streamData->si->LastTime), _TRUNCATE);
if (!g_Settings.bShowTimeIfChanged || streamData->si->LastTime == 0 || mir_tstrcmp(szTimeStamp, szOldTimeStamp)) {
streamData->si->LastTime = lin->time;
Log_AppendRTF(streamData, TRUE, str, L"%s", szTimeStamp);
@@ -984,7 +984,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedra // trim the message log to the number of most recent events
// this uses hidden marks in the rich text to find the events which should be deleted
if (si->bTrimmed) {
- TCHAR szPattern[50];
+ wchar_t szPattern[50];
mir_sntprintf(szPattern, L"~-+%d+-~", si->pLogEnd);
FINDTEXTEX fi;
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp index eee0f6823d..61859eab96 100644 --- a/plugins/TabSRMM/src/chat/main.cpp +++ b/plugins/TabSRMM/src/chat/main.cpp @@ -269,7 +269,7 @@ int Chat_Load() {
CheckUpdate();
- CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENT("Message Sessions") L"/" LPGENT("Group chats"), FONTMODE_ALTER };
+ CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Message Sessions") L"/" LPGENW("Group chats"), FONTMODE_ALTER };
mir_getCI(&data);
saveCI = *pci;
pci->OnCreateModule = OnCreateModule;
diff --git a/plugins/TabSRMM/src/chat/manager.cpp b/plugins/TabSRMM/src/chat/manager.cpp index b1958c909c..014b238b05 100644 --- a/plugins/TabSRMM/src/chat/manager.cpp +++ b/plugins/TabSRMM/src/chat/manager.cpp @@ -26,14 +26,14 @@ #include "../stdafx.h"
-static int sttCompareNicknames(const TCHAR *s1, const TCHAR *s2)
+static int sttCompareNicknames(const wchar_t *s1, const wchar_t *s2)
{
if (s2 == NULL)
return 1;
// skip rubbish
- while (*s1 && !_istalpha(*s1)) ++s1;
- while (*s2 && !_istalpha(*s2)) ++s2;
+ while (*s1 && !iswalpha(*s1)) ++s1;
+ while (*s2 && !iswalpha(*s2)) ++s2;
// are there ~0veRy^kEwL_n1kz?
if (!*s1 && !*s2) return 0;
@@ -44,7 +44,7 @@ static int sttCompareNicknames(const TCHAR *s1, const TCHAR *s2) return mir_tstrcmpi(s1, s2);
}
-int UM_CompareItem(USERINFO *u1, const TCHAR* pszNick, WORD wStatus)
+int UM_CompareItem(USERINFO *u1, const wchar_t* pszNick, WORD wStatus)
{
WORD dw1 = u1->Status;
WORD dw2 = wStatus;
@@ -108,12 +108,12 @@ SESSION_INFO* SM_FindSessionByHCONTACT(MCONTACT h) return NULL;
}
-SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const TCHAR* pszOriginal, const TCHAR* pszCurrent)
+SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const wchar_t* pszOriginal, const wchar_t* pszCurrent)
{
if (prevSession == NULL && my_strstri(currSession->ptszName, pszOriginal) == currSession->ptszName)
return currSession;
- TCHAR* pszName = NULL;
+ wchar_t* pszName = NULL;
if (currSession == prevSession)
pszCurrent = pszOriginal;
diff --git a/plugins/TabSRMM/src/chat/muchighlight.cpp b/plugins/TabSRMM/src/chat/muchighlight.cpp index 4567ba7000..0ec60454ff 100644 --- a/plugins/TabSRMM/src/chat/muchighlight.cpp +++ b/plugins/TabSRMM/src/chat/muchighlight.cpp @@ -65,12 +65,12 @@ void CMUCHighlight::init() tokenize(m_NickPatternString, m_NickPatterns, m_iNickPatterns);
}
-void CMUCHighlight::tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr)
+void CMUCHighlight::tokenize(wchar_t *tszString, wchar_t**& patterns, UINT& nr)
{
if (tszString == 0)
return;
- TCHAR *p = tszString;
+ wchar_t *p = tszString;
if (*p == 0)
return;
@@ -83,14 +83,14 @@ void CMUCHighlight::tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr) while (*p) {
if (*p == ' ') {
p++;
- while (*p && _istspace(*p))
+ while (*p && iswspace(*p))
p++;
if (*p)
nr++;
}
p++;
}
- patterns = (TCHAR **)mir_alloc(nr * sizeof(TCHAR*));
+ patterns = (wchar_t **)mir_alloc(nr * sizeof(wchar_t*));
p = tszString;
nr = 0;
@@ -101,7 +101,7 @@ void CMUCHighlight::tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr) while (*p) {
if (*p == ' ') {
*p++ = 0;
- while (*p && _istspace(*p))
+ while (*p && iswspace(*p))
p++;
if (*p)
patterns[nr++] = p;
@@ -118,13 +118,13 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF return 0;
if ((m_dwFlags & MATCH_TEXT) && (dwFlags & MATCH_TEXT) && (m_fHighlightMe || m_iTextPatterns > 0) && psi != 0) {
- TCHAR *p = pci->RemoveFormatting(pgce->ptszText);
- p = NEWTSTR_ALLOCA(p);
+ wchar_t *p = pci->RemoveFormatting(pgce->ptszText);
+ p = NEWWSTR_ALLOCA(p);
if (p == NULL)
return 0;
CharLower(p);
- TCHAR *tszMe = ((psi && psi->pMe) ? NEWTSTR_ALLOCA(psi->pMe->pszNick) : 0);
+ wchar_t *tszMe = ((psi && psi->pMe) ? NEWWSTR_ALLOCA(psi->pMe->pszNick) : 0);
if (tszMe)
CharLower(tszMe);
@@ -141,7 +141,7 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF if (*p == 0)
break;
- TCHAR *p1 = p;
+ wchar_t *p1 = p;
while (*p1 && *p1 != ' ' && *p1 != ',' && *p1 != '.' && *p1 != ':' && *p1 != ';' && *p1 != '?' && *p1 != '!')
p1++;
@@ -250,7 +250,7 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L iLen = ::GetWindowTextLength(::GetDlgItem(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN));
if (iLen) {
- szBuf = reinterpret_cast<TCHAR *>(mir_realloc(szBuf, sizeof(wchar_t) * (iLen + 2)));
+ szBuf = reinterpret_cast<wchar_t *>(mir_realloc(szBuf, sizeof(wchar_t) * (iLen + 2)));
::GetDlgItemText(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN, szBuf, iLen + 1);
db_set_ts(0, CHAT_MODULE, "HighlightWords", szBuf);
}
diff --git a/plugins/TabSRMM/src/chat/muchighlight.h b/plugins/TabSRMM/src/chat/muchighlight.h index 570541e075..5f8533868e 100644 --- a/plugins/TabSRMM/src/chat/muchighlight.h +++ b/plugins/TabSRMM/src/chat/muchighlight.h @@ -60,16 +60,16 @@ public: static INT_PTR CALLBACK dlgProcAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); // for the "add to" dialog
private:
- void tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr);
+ void tokenize(wchar_t *tszString, wchar_t**& patterns, UINT& nr);
DWORD m_dwFlags;
bool m_fInitialized;
- TCHAR** m_NickPatterns;
- TCHAR** m_TextPatterns;
+ wchar_t** m_NickPatterns;
+ wchar_t** m_TextPatterns;
UINT m_iNickPatterns;
UINT m_iTextPatterns;
- TCHAR *m_NickPatternString;
- TCHAR *m_TextPatternString;
+ wchar_t *m_NickPatternString;
+ wchar_t *m_TextPatternString;
bool m_Valid;
bool m_fHighlightMe;
};
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index 36c9ec9d29..79bfc11d83 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -33,13 +33,13 @@ struct FontOptionsList
{
- TCHAR* szDescr;
+ wchar_t* szDescr;
COLORREF defColour;
- TCHAR* szDefFace;
+ wchar_t* szDefFace;
BYTE defCharset, defStyle;
char defSize;
COLORREF colour;
- TCHAR szFace[LF_FACESIZE];
+ wchar_t szFace[LF_FACESIZE];
BYTE charset, style;
char size;
};
@@ -47,8 +47,8 @@ struct FontOptionsList struct ColorOptionsList
{
int order;
- TCHAR* tszGroup;
- TCHAR* tszName;
+ wchar_t* tszGroup;
+ wchar_t* tszName;
char* szSetting;
COLORREF def;
};
@@ -58,70 +58,70 @@ struct ColorOptionsList * (GetSysColor(default_color & 0x00ffffff)), not a rgb value.
*/
static ColorOptionsList _clrs[] = {
- { 0, LPGENT("Message Sessions"), LPGENT("Input area background"), "inputbg", SRMSGDEFSET_BKGCOLOUR },
- { 1, LPGENT("Message Sessions"), LPGENT("Log background"), SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR },
- { 0, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Outgoing background"), "outbg", SRMSGDEFSET_BKGOUTCOLOUR },
- { 1, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Incoming background"), "inbg", SRMSGDEFSET_BKGINCOLOUR },
- { 2, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Status background"), "statbg", SRMSGDEFSET_BKGCOLOUR },
- { 3, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Incoming background(old)"), "oldinbg", SRMSGDEFSET_BKGINCOLOUR },
- { 4, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Outgoing background(old)"), "oldoutbg", SRMSGDEFSET_BKGOUTCOLOUR },
- { 5, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Horizontal Grid Lines"), "hgrid", RGB(224, 224, 224) },
- { 0, LPGENT("Message Sessions") L"/" LPGENT("Info Panel"), LPGENT("Panel background low"), "ipfieldsbg", 0x62caff },
- { 1, LPGENT("Message Sessions") L"/" LPGENT("Info Panel"), LPGENT("Panel background high"), "ipfieldsbgHigh", 0xf0f0f0 },
- { 0, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Toolbar background high"), "tbBgHigh", 0 },
- { 1, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Toolbar background low"), "tbBgLow", 0 },
- { 2, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Window fill color"), "fillColor", 0 },
- { 3, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Text area borders"), "cRichBorders", 0 },
- { 4, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Aero glow effect"), "aeroGlow", RGB(40, 40, 255) },
- { 4, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Generic text color (only when fill color is set)"), "genericTxtClr", 0xff000000 | COLOR_BTNTEXT },
+ { 0, LPGENW("Message Sessions"), LPGENW("Input area background"), "inputbg", SRMSGDEFSET_BKGCOLOUR },
+ { 1, LPGENW("Message Sessions"), LPGENW("Log background"), SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR },
+ { 0, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Outgoing background"), "outbg", SRMSGDEFSET_BKGOUTCOLOUR },
+ { 1, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Incoming background"), "inbg", SRMSGDEFSET_BKGINCOLOUR },
+ { 2, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Status background"), "statbg", SRMSGDEFSET_BKGCOLOUR },
+ { 3, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Incoming background(old)"), "oldinbg", SRMSGDEFSET_BKGINCOLOUR },
+ { 4, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Outgoing background(old)"), "oldoutbg", SRMSGDEFSET_BKGOUTCOLOUR },
+ { 5, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Horizontal Grid Lines"), "hgrid", RGB(224, 224, 224) },
+ { 0, LPGENW("Message Sessions") L"/" LPGENW("Info Panel"), LPGENW("Panel background low"), "ipfieldsbg", 0x62caff },
+ { 1, LPGENW("Message Sessions") L"/" LPGENW("Info Panel"), LPGENW("Panel background high"), "ipfieldsbgHigh", 0xf0f0f0 },
+ { 0, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Toolbar background high"), "tbBgHigh", 0 },
+ { 1, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Toolbar background low"), "tbBgLow", 0 },
+ { 2, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Window fill color"), "fillColor", 0 },
+ { 3, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Text area borders"), "cRichBorders", 0 },
+ { 4, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Aero glow effect"), "aeroGlow", RGB(40, 40, 255) },
+ { 4, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Generic text color (only when fill color is set)"), "genericTxtClr", 0xff000000 | COLOR_BTNTEXT },
};
static ColorOptionsList _tabclrs[] = {
- { 0, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Normal text"), "tab_txt_normal", 0xff000000 | COLOR_BTNTEXT },
- { 1, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Active text"), "tab_txt_active", 0xff000000 | COLOR_BTNTEXT },
- { 2, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Hovered text"), "tab_txt_hottrack", 0xff000000 | COLOR_HOTLIGHT },
- { 3, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Unread text"), "tab_txt_unread", 0xff000000 | COLOR_HOTLIGHT },
-
- { 4, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Normal background"), "tab_bg_normal", 0xff000000 | COLOR_3DFACE },
- { 5, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Active background"), "tab_bg_active", 0xff000000 | COLOR_3DFACE },
- { 6, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Hovered background"), "tab_bg_hottrack", 0xff000000 | COLOR_3DFACE },
- { 7, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Unread background"), "tab_bg_unread", 0xff000000 | COLOR_3DFACE }
+ { 0, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Normal text"), "tab_txt_normal", 0xff000000 | COLOR_BTNTEXT },
+ { 1, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Active text"), "tab_txt_active", 0xff000000 | COLOR_BTNTEXT },
+ { 2, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Hovered text"), "tab_txt_hottrack", 0xff000000 | COLOR_HOTLIGHT },
+ { 3, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Unread text"), "tab_txt_unread", 0xff000000 | COLOR_HOTLIGHT },
+
+ { 4, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Normal background"), "tab_bg_normal", 0xff000000 | COLOR_3DFACE },
+ { 5, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Active background"), "tab_bg_active", 0xff000000 | COLOR_3DFACE },
+ { 6, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Hovered background"), "tab_bg_hottrack", 0xff000000 | COLOR_3DFACE },
+ { 7, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Unread background"), "tab_bg_unread", 0xff000000 | COLOR_3DFACE }
};
extern LOGFONT lfDefault;
static FontOptionsList IM_fontOptionsList[] = {
- { LPGENT(">> Outgoing messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT(">> Outgoing misc events"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("<< Incoming messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("<< Incoming misc events"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT(">> Outgoing name"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT(">> Outgoing timestamp"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT("<< Incoming name"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT("<< Incoming timestamp"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT(">> Outgoing messages (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT(">> Outgoing misc events (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("<< Incoming messages (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("<< Incoming misc events (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT(">> Outgoing name (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT(">> Outgoing timestamp (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT("<< Incoming name (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT("<< Incoming timestamp (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT("* Message Input Area"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("* Status changes"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("* Dividers"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("* Error and warning messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("* Symbols (incoming)"), RGB(50, 50, 50), L"Webdings", SYMBOL_CHARSET, 0, -12 },
- { LPGENT("* Symbols (outgoing)"), RGB(50, 50, 50), L"Webdings", SYMBOL_CHARSET, 0, -12 },
+ { LPGENW(">> Outgoing messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW(">> Outgoing misc events"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("<< Incoming messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("<< Incoming misc events"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW(">> Outgoing name"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW(">> Outgoing timestamp"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW("<< Incoming name"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW("<< Incoming timestamp"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW(">> Outgoing messages (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW(">> Outgoing misc events (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("<< Incoming messages (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("<< Incoming misc events (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW(">> Outgoing name (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW(">> Outgoing timestamp (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW("<< Incoming name (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW("<< Incoming timestamp (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW("* Message Input Area"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("* Status changes"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("* Dividers"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("* Error and warning messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("* Symbols (incoming)"), RGB(50, 50, 50), L"Webdings", SYMBOL_CHARSET, 0, -12 },
+ { LPGENW("* Symbols (outgoing)"), RGB(50, 50, 50), L"Webdings", SYMBOL_CHARSET, 0, -12 },
};
static FontOptionsList IP_fontOptionsList[] = {
- { LPGENT("Nickname"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("UIN"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Status"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Protocol"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Contacts local time"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Window caption (skinned mode)"), RGB(255, 255, 255), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Nickname"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("UIN"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Status"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Protocol"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Contacts local time"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Window caption (skinned mode)"), RGB(255, 255, 255), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
};
static FontOptionsList *fontOptionsList = IM_fontOptionsList;
@@ -129,49 +129,49 @@ static int fontCount = MSGDLGFONTCOUNT; struct branch_t
{
- TCHAR* szDescr;
+ wchar_t* szDescr;
char* szDBName;
int iMode;
BYTE bDefault;
HTREEITEM hItem;
};
static branch_t branch1[] = {
- { LPGENT("Open new chat rooms in the default container"), "DefaultContainer", 0, 1, NULL },
- { LPGENT("Flash window when someone speaks"), "FlashWindow", 0, 0, NULL },
- { LPGENT("Flash window when a word is highlighted"), "FlashWindowHighlight", 0, 1, NULL },
- { LPGENT("Create tabs or windows for highlight events"), "CreateWindowOnHighlight", 0, 0, NULL },
- { LPGENT("Activate chat window on highlight"), "AnnoyingHighlight", 0, 0, NULL },
- { LPGENT("Show list of users in the chat room"), "ShowNicklist", 0, 1, NULL },
- { LPGENT("Colorize nicknames in member list"), "ColorizeNicks", 0, 1, NULL },
- { LPGENT("Show button menus when right clicking the buttons"), "RightClickFilter", 0, 1, NULL },
- { LPGENT("Show topic as status message on the contact list"), "TopicOnClist", 0, 1, NULL },
- { LPGENT("Do not pop up the window when joining a chat room"), "PopupOnJoin", 0, 0, NULL },
- { LPGENT("Hide or show the window by double click in the contact list"), "ToggleVisibility", 0, 0, NULL },
- { LPGENT("Sync splitter position with standard IM sessions"), "SyncSplitter", 0, 0, NULL },
- { LPGENT("Show contact's status modes if supported by the protocol"), "ShowContactStatus", 0, 1, NULL },
- { LPGENT("Display contact's status icon before user role icon"), "ContactStatusFirst", 0, 0, NULL },
- { LPGENT("Use IRC style status indicators in the nick list"), "ClassicIndicators", 0, 0, NULL },
- { LPGENT("Use alternative sorting method in member list"), "AlternativeSorting", 0, 1, NULL }
+ { LPGENW("Open new chat rooms in the default container"), "DefaultContainer", 0, 1, NULL },
+ { LPGENW("Flash window when someone speaks"), "FlashWindow", 0, 0, NULL },
+ { LPGENW("Flash window when a word is highlighted"), "FlashWindowHighlight", 0, 1, NULL },
+ { LPGENW("Create tabs or windows for highlight events"), "CreateWindowOnHighlight", 0, 0, NULL },
+ { LPGENW("Activate chat window on highlight"), "AnnoyingHighlight", 0, 0, NULL },
+ { LPGENW("Show list of users in the chat room"), "ShowNicklist", 0, 1, NULL },
+ { LPGENW("Colorize nicknames in member list"), "ColorizeNicks", 0, 1, NULL },
+ { LPGENW("Show button menus when right clicking the buttons"), "RightClickFilter", 0, 1, NULL },
+ { LPGENW("Show topic as status message on the contact list"), "TopicOnClist", 0, 1, NULL },
+ { LPGENW("Do not pop up the window when joining a chat room"), "PopupOnJoin", 0, 0, NULL },
+ { LPGENW("Hide or show the window by double click in the contact list"), "ToggleVisibility", 0, 0, NULL },
+ { LPGENW("Sync splitter position with standard IM sessions"), "SyncSplitter", 0, 0, NULL },
+ { LPGENW("Show contact's status modes if supported by the protocol"), "ShowContactStatus", 0, 1, NULL },
+ { LPGENW("Display contact's status icon before user role icon"), "ContactStatusFirst", 0, 0, NULL },
+ { LPGENW("Use IRC style status indicators in the nick list"), "ClassicIndicators", 0, 0, NULL },
+ { LPGENW("Use alternative sorting method in member list"), "AlternativeSorting", 0, 1, NULL }
};
static branch_t branch2[] = {
- { LPGENT("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1, NULL },
- { LPGENT("Timestamp only when event time differs"), "ShowTimeStampIfChanged", 0, 0, NULL },
- { LPGENT("Timestamp has same color as the event"), "TimeStampEventColour", 0, 0, NULL },
- { LPGENT("Indent the second line of a message"), "LogIndentEnabled", 0, 1, NULL },
- { LPGENT("Limit user names in the message log to 20 characters"), "LogLimitNames", 0, 1, NULL },
- { LPGENT("Add a colon (:) to auto-completed user names"), "AddColonToAutoComplete", 0, 1, NULL },
- { LPGENT("Add a comma instead of a colon to auto-completed user names"), "UseCommaAsColon", 0, 0, NULL },
- { LPGENT("Start private conversation on double click in nick list (insert nick if unchecked)"), "DoubleClick4Privat", 0, 0, NULL },
- { LPGENT("Strip colors from messages in the log"), "StripFormatting", 0, 0, NULL },
- { LPGENT("Enable the 'event filter' for new rooms"), "FilterEnabled", 0, 0, NULL },
- { LPGENT("Use IRC style status indicators in the log"), "LogClassicIndicators", 0, 0, NULL },
- { LPGENT("Allow clickable user names in the message log"), "ClickableNicks", 0, 1, NULL },
- { LPGENT("Add new line after names"), "NewlineAfterNames", 0, 0, NULL },
- { LPGENT("Colorize user names in message log"), "ColorizeNicksInLog", 0, 1, NULL },
- { LPGENT("Scale down icons to 10x10 pixels in the chat log"), "ScaleIcons", 0, 1, NULL },
- { LPGENT("Place a separator in the log after a window lost its foreground status"), "UseDividers", 0, 1, NULL },
- { LPGENT("Only place a separator when an incoming event is announced with a popup"), "DividersUsePopupConfig", 0, 1, NULL }
+ { LPGENW("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1, NULL },
+ { LPGENW("Timestamp only when event time differs"), "ShowTimeStampIfChanged", 0, 0, NULL },
+ { LPGENW("Timestamp has same color as the event"), "TimeStampEventColour", 0, 0, NULL },
+ { LPGENW("Indent the second line of a message"), "LogIndentEnabled", 0, 1, NULL },
+ { LPGENW("Limit user names in the message log to 20 characters"), "LogLimitNames", 0, 1, NULL },
+ { LPGENW("Add a colon (:) to auto-completed user names"), "AddColonToAutoComplete", 0, 1, NULL },
+ { LPGENW("Add a comma instead of a colon to auto-completed user names"), "UseCommaAsColon", 0, 0, NULL },
+ { LPGENW("Start private conversation on double click in nick list (insert nick if unchecked)"), "DoubleClick4Privat", 0, 0, NULL },
+ { LPGENW("Strip colors from messages in the log"), "StripFormatting", 0, 0, NULL },
+ { LPGENW("Enable the 'event filter' for new rooms"), "FilterEnabled", 0, 0, NULL },
+ { LPGENW("Use IRC style status indicators in the log"), "LogClassicIndicators", 0, 0, NULL },
+ { LPGENW("Allow clickable user names in the message log"), "ClickableNicks", 0, 1, NULL },
+ { LPGENW("Add new line after names"), "NewlineAfterNames", 0, 0, NULL },
+ { LPGENW("Colorize user names in message log"), "ColorizeNicksInLog", 0, 1, NULL },
+ { LPGENW("Scale down icons to 10x10 pixels in the chat log"), "ScaleIcons", 0, 1, NULL },
+ { LPGENW("Place a separator in the log after a window lost its foreground status"), "UseDividers", 0, 1, NULL },
+ { LPGENW("Only place a separator when an incoming event is announced with a popup"), "DividersUsePopupConfig", 0, 1, NULL }
};
static HWND hPathTip = 0;
@@ -222,19 +222,19 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM mir_snprintf(str, "Font%d", i);
if ((i == 17 && !mir_strcmp(szMod, CHATFONT_MODULE)) || ((i == 20 || i == 21) && !mir_strcmp(szMod, FONTMODULE))) {
lf->lfCharSet = SYMBOL_CHARSET;
- _tcsncpy_s(lf->lfFaceName, L"Webdings", _TRUNCATE);
+ wcsncpy_s(lf->lfFaceName, L"Webdings", _TRUNCATE);
}
else {
ptrT tszDefFace(db_get_tsa(NULL, szMod, str));
if (tszDefFace == NULL)
- _tcsncpy_s(lf->lfFaceName, fol[j].szDefFace, _TRUNCATE);
+ wcsncpy_s(lf->lfFaceName, fol[j].szDefFace, _TRUNCATE);
else
- _tcsncpy_s(lf->lfFaceName, tszDefFace, _TRUNCATE);
+ wcsncpy_s(lf->lfFaceName, tszDefFace, _TRUNCATE);
}
}
}
-static HTREEITEM InsertBranch(HWND hwndTree, TCHAR* pszDescr, BOOL bExpanded)
+static HTREEITEM InsertBranch(HWND hwndTree, wchar_t* pszDescr, BOOL bExpanded)
{
TVINSERTSTRUCT tvis;
tvis.hParent = NULL;
@@ -354,7 +354,7 @@ HICON LoadIconEx(char *pszIcoLibName) return IcoLib_GetIcon(szTemp);
}
-static void InitSetting(TCHAR* &ppPointer, const char *pszSetting, const TCHAR *pszDefault)
+static void InitSetting(wchar_t* &ppPointer, const char *pszSetting, const wchar_t *pszDefault)
{
ptrT val(db_get_tsa(NULL, CHAT_MODULE, pszSetting));
replaceStrT(ppPointer, (val != NULL) ? val : pszDefault);
@@ -410,7 +410,7 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM FillBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading1, branch1, _countof(branch1), 0x0000);
FillBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading2, branch2, _countof(branch2), 0x0000);
- TCHAR* pszGroup = NULL;
+ wchar_t* pszGroup = NULL;
InitSetting(pszGroup, "AddToGroup", L"Chat rooms");
SetDlgItemText(hwndDlg, IDC_GROUP, pszGroup);
mir_free(pszGroup);
@@ -435,12 +435,12 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
int iLen;
- TCHAR *pszText = NULL;
+ wchar_t *pszText = NULL;
BYTE b;
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_GROUP));
if (iLen > 0) {
- pszText = (TCHAR*)mir_realloc(pszText, (iLen + 2) * sizeof(TCHAR));
+ pszText = (wchar_t*)mir_realloc(pszText, (iLen + 2) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_GROUP, pszText, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "AddToGroup", pszText);
}
@@ -472,16 +472,16 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM return FALSE;
}
-static TCHAR* chatcolorsnames[] =
+static wchar_t* chatcolorsnames[] =
{
- LPGENT("Voiced"),
- LPGENT("Half operators"),
- LPGENT("Channel operators"),
- LPGENT("Extended mode 1"),
- LPGENT("Extended mode 2"),
- LPGENT("Selection background"),
- LPGENT("Selected text"),
- LPGENT("Incremental search highlight")
+ LPGENW("Voiced"),
+ LPGENW("Half operators"),
+ LPGENW("Channel operators"),
+ LPGENW("Extended mode 1"),
+ LPGENW("Extended mode 2"),
+ LPGENW("Selection background"),
+ LPGENW("Selected text"),
+ LPGENW("Incremental search highlight")
};
void RegisterFontServiceFonts()
@@ -502,54 +502,54 @@ void RegisterFontServiceFonts() mir_snprintf(szTemp, "Font%d", i);
strncpy(fid.prefix, szTemp, _countof(fid.prefix));
fid.order = i;
- _tcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name));
+ wcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name));
fid.deffontsettings.colour = fontOptionsList[i].colour;
fid.deffontsettings.size = (char)lf.lfHeight;
fid.deffontsettings.style = (lf.lfWeight >= FW_BOLD ? FONTF_BOLD : 0) | (lf.lfItalic ? FONTF_ITALIC : 0);
fid.deffontsettings.charset = lf.lfCharSet;
fid.flags = fid.flags & ~FIDF_CLASSMASK | (fid.deffontsettings.style&FONTF_BOLD ? FIDF_CLASSHEADER : FIDF_CLASSGENERAL);
- _tcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE);
- _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), _countof(fid.backgroundGroup));
- _tcsncpy(fid.group, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), _countof(fid.group));
+ wcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE);
+ wcsncpy(fid.backgroundGroup, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), _countof(fid.backgroundGroup));
+ wcsncpy(fid.group, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), _countof(fid.group));
switch (i) {
case MSGFONTID_MYMSG:
case 1:
case MSGFONTID_MYNAME:
case MSGFONTID_MYTIME:
case 21:
- _tcsncpy(fid.backgroundName, LPGENT("Outgoing background"), _countof(fid.backgroundName));
+ wcsncpy(fid.backgroundName, LPGENW("Outgoing background"), _countof(fid.backgroundName));
break;
case 8:
case 9:
case 12:
case 13:
- _tcsncpy(fid.backgroundName, LPGENT("Outgoing background(old)"), _countof(fid.backgroundName));
+ wcsncpy(fid.backgroundName, LPGENW("Outgoing background(old)"), _countof(fid.backgroundName));
break;
case 10:
case 11:
case 14:
case 15:
- _tcsncpy(fid.backgroundName, LPGENT("Incoming background(old)"), _countof(fid.backgroundName));
+ wcsncpy(fid.backgroundName, LPGENW("Incoming background(old)"), _countof(fid.backgroundName));
break;
case MSGFONTID_MESSAGEAREA:
- _tcsncpy(fid.group, LPGENT("Message Sessions"), _countof(fid.group));
- _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions"), _countof(fid.backgroundGroup));
- _tcsncpy(fid.backgroundName, LPGENT("Input area background"), _countof(fid.backgroundName));
+ wcsncpy(fid.group, LPGENW("Message Sessions"), _countof(fid.group));
+ wcsncpy(fid.backgroundGroup, LPGENW("Message Sessions"), _countof(fid.backgroundGroup));
+ wcsncpy(fid.backgroundName, LPGENW("Input area background"), _countof(fid.backgroundName));
fid.flags |= FIDF_DISABLESTYLES;
fid.flags &= ~FIDF_ALLOWEFFECTS;
break;
case 17:
- _tcsncpy(fid.backgroundName, LPGENT("Status background"), _countof(fid.backgroundName));
+ wcsncpy(fid.backgroundName, LPGENW("Status background"), _countof(fid.backgroundName));
break;
case 18:
- _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions"), _countof(fid.backgroundGroup));
- _tcsncpy(fid.backgroundName, LPGENT("Log background"), _countof(fid.backgroundName));
+ wcsncpy(fid.backgroundGroup, LPGENW("Message Sessions"), _countof(fid.backgroundGroup));
+ wcsncpy(fid.backgroundName, LPGENW("Log background"), _countof(fid.backgroundName));
break;
case 19:
- _tcsncpy(fid.backgroundName, L"", _countof(fid.backgroundName));
+ wcsncpy(fid.backgroundName, L"", _countof(fid.backgroundName));
break;
default:
- _tcsncpy(fid.backgroundName, LPGENT("Incoming background"), _countof(fid.backgroundName));
+ wcsncpy(fid.backgroundName, LPGENW("Incoming background"), _countof(fid.backgroundName));
break;
}
FontRegisterT(&fid);
@@ -557,35 +557,35 @@ void RegisterFontServiceFonts() fontOptionsList = IP_fontOptionsList;
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
- _tcsncpy(fid.group, LPGENT("Message Sessions") L"/" LPGENT("Info Panel"), _countof(fid.group));
- _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions") L"/" LPGENT("Info Panel"), _countof(fid.backgroundGroup));
- _tcsncpy(fid.backgroundName, LPGENT("Fields background"), _countof(fid.backgroundName));
+ wcsncpy(fid.group, LPGENW("Message Sessions") L"/" LPGENW("Info Panel"), _countof(fid.group));
+ wcsncpy(fid.backgroundGroup, LPGENW("Message Sessions") L"/" LPGENW("Info Panel"), _countof(fid.backgroundGroup));
+ wcsncpy(fid.backgroundName, LPGENW("Fields background"), _countof(fid.backgroundName));
for (int i = 0; i < IPFONTCOUNT; i++) {
LoadMsgDlgFont(FONTSECTION_IP, i + 100, &lf, &fontOptionsList[i].colour, FONTMODULE);
mir_snprintf(szTemp, "Font%d", i + 100);
strncpy(fid.prefix, szTemp, _countof(fid.prefix));
fid.order = i + 100;
- _tcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name));
+ wcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name));
fid.deffontsettings.colour = fontOptionsList[i].colour;
fid.deffontsettings.size = (char)lf.lfHeight;
fid.deffontsettings.style = (lf.lfWeight >= FW_BOLD ? FONTF_BOLD : 0) | (lf.lfItalic ? FONTF_ITALIC : 0);
fid.deffontsettings.charset = lf.lfCharSet;
fid.flags = fid.flags & ~FIDF_CLASSMASK | (fid.deffontsettings.style&FONTF_BOLD ? FIDF_CLASSHEADER : FIDF_CLASSGENERAL);
fid.deffontsettings.charset = lf.lfCharSet;
- _tcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE);
+ wcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE);
if (i == IPFONTCOUNT - 1) {
- _tcsncpy(fid.backgroundGroup, L"", _countof(fid.backgroundGroup));
- _tcsncpy(fid.backgroundName, L"", _countof(fid.backgroundName));
- _tcsncpy(fid.group, LPGENT("Message Sessions"), _countof(fid.group));
+ wcsncpy(fid.backgroundGroup, L"", _countof(fid.backgroundGroup));
+ wcsncpy(fid.backgroundName, L"", _countof(fid.backgroundName));
+ wcsncpy(fid.group, LPGENW("Message Sessions"), _countof(fid.group));
}
FontRegisterT(&fid);
}
- _tcsncpy(cid.group, LPGENT("Message Sessions") L"/" LPGENT("Group chats"), _countof(cid.group));
+ wcsncpy(cid.group, LPGENW("Message Sessions") L"/" LPGENW("Group chats"), _countof(cid.group));
strncpy(cid.dbSettingsGroup, CHAT_MODULE, _countof(cid.dbSettingsGroup));
for (int i = 0; i <= 7; i++) {
mir_snprintf(szTemp, "NickColor%d", i);
- _tcsncpy(cid.name, chatcolorsnames[i], _countof(cid.name));
+ wcsncpy(cid.name, chatcolorsnames[i], _countof(cid.name));
cid.order = i + 1;
strncpy(cid.setting, szTemp, _countof(cid.setting));
switch (i) {
@@ -602,13 +602,13 @@ void RegisterFontServiceFonts() ColourRegisterT(&cid);
}
cid.order++;
- _tcsncpy_s(cid.name, LPGENT("Nick list background"), _TRUNCATE);
+ wcsncpy_s(cid.name, LPGENW("Nick list background"), _TRUNCATE);
strncpy_s(cid.setting, "ColorNicklistBG", _TRUNCATE);
cid.defcolour = SRMSGDEFSET_BKGCOLOUR;
ColourRegisterT(&cid);
cid.order++;
- _tcsncpy_s(cid.name, LPGENT("Group chat log background"), _TRUNCATE);
+ wcsncpy_s(cid.name, LPGENW("Group chat log background"), _TRUNCATE);
strncpy_s(cid.setting, "ColorLogBG", _TRUNCATE);
ColourRegisterT(&cid);
@@ -618,8 +618,8 @@ void RegisterFontServiceFonts() for (int i = 0; i < _countof(_clrs); i++) {
cid.order = _clrs[i].order;
- _tcsncpy(cid.group, _clrs[i].tszGroup, _countof(fid.group));
- _tcsncpy(cid.name, _clrs[i].tszName, _countof(cid.name));
+ wcsncpy(cid.group, _clrs[i].tszGroup, _countof(fid.group));
+ wcsncpy(cid.name, _clrs[i].tszName, _countof(cid.name));
strncpy(cid.setting, _clrs[i].szSetting, _countof(cid.setting));
if (_clrs[i].def & 0xff000000)
cid.defcolour = GetSysColor(_clrs[i].def & 0x000000ff);
@@ -633,8 +633,8 @@ void RegisterFontServiceFonts() // text and background colors for tabs
for (int i = 0; i < _countof(_tabclrs); i++) {
cid.order = _tabclrs[i].order;
- _tcsncpy(cid.group, _tabclrs[i].tszGroup, _countof(fid.group));
- _tcsncpy(cid.name, _tabclrs[i].tszName, _countof(cid.name));
+ wcsncpy(cid.group, _tabclrs[i].tszGroup, _countof(fid.group));
+ wcsncpy(cid.name, _tabclrs[i].tszName, _countof(cid.name));
strncpy(cid.setting, _tabclrs[i].szSetting, _countof(cid.setting));
if (_tabclrs[i].def & 0xff000000)
cid.defcolour = GetSysColor(_tabclrs[i].def & 0x000000ff);
@@ -689,7 +689,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN4, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, CHAT_MODULE, "LoggingLimit", 100), 0));
Utils::enableDlgControl(hwndDlg, IDC_LIMIT, g_Settings.bLoggingEnabled);
- TCHAR tszTooltipText[2048];
+ wchar_t tszTooltipText[2048];
mir_sntprintf(tszTooltipText,
L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n"
@@ -745,23 +745,23 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM switch (LOWORD(wParam)) {
case IDC_MUC_OPENLOGBASEDIR:
{
- TCHAR tszTemp[MAX_PATH + 20];
- _tcsncpy_s(tszTemp, g_Settings.pszLogDir, _TRUNCATE);
+ wchar_t tszTemp[MAX_PATH + 20];
+ wcsncpy_s(tszTemp, g_Settings.pszLogDir, _TRUNCATE);
- TCHAR *p = tszTemp;
+ wchar_t *p = tszTemp;
while (*p && (*p == '\\' || *p == '.'))
p++;
if (*p)
- if (TCHAR *p1 = _tcschr(p, '\\'))
+ if (wchar_t *p1 = wcschr(p, '\\'))
*p1 = 0;
- TCHAR tszInitialDir[_MAX_DRIVE + _MAX_PATH + 10];
+ wchar_t tszInitialDir[_MAX_DRIVE + _MAX_PATH + 10];
mir_sntprintf(tszInitialDir, L"%s%s", M.getChatLogPath(), p);
if (!PathFileExists(tszInitialDir))
- _tcsncpy_s(tszInitialDir, M.getChatLogPath(), _TRUNCATE);
+ wcsncpy_s(tszInitialDir, M.getChatLogPath(), _TRUNCATE);
- TCHAR tszReturnName[MAX_PATH]; tszReturnName[0] = 0;
+ wchar_t tszReturnName[MAX_PATH]; tszReturnName[0] = 0;
mir_sntprintf(tszTemp, L"%s%c*.*%c%c", TranslateT("All files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
@@ -779,7 +779,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM case IDC_FONTCHOOSE:
{
- TCHAR tszDirectory[MAX_PATH];
+ wchar_t tszDirectory[MAX_PATH];
LPMALLOC psMalloc;
if (SUCCEEDED(CoGetMalloc(1, &psMalloc))) {
@@ -793,11 +793,11 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM LPITEMIDLIST idList = SHBrowseForFolder(&bi);
if (idList) {
- const TCHAR *szUserDir = M.getUserDir();
+ const wchar_t *szUserDir = M.getUserDir();
SHGetPathFromIDList(idList, tszDirectory);
mir_tstrcat(tszDirectory, L"\\");
- TCHAR tszTemp[MAX_PATH];
+ wchar_t tszTemp[MAX_PATH];
PathToRelativeT(tszDirectory, tszTemp, szUserDir);
SetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, mir_tstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
}
@@ -824,7 +824,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY));
if (iLen > 0) {
- TCHAR *pszText1 = (TCHAR*)mir_alloc(iLen*sizeof(TCHAR) + 2);
+ wchar_t *pszText1 = (wchar_t*)mir_alloc(iLen*sizeof(wchar_t) + 2);
GetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, pszText1, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "LogDirectory", pszText1);
mir_free(pszText1);
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index d892fc66aa..4fd40eb4d2 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -34,9 +34,9 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT if (M.FindWindow(hContact) != 0)
return 0;
- if (hContact != 0 && M.GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, L"default", 6)) {
+ if (hContact != 0 && M.GetByte("limittabs", 0) && !wcsncmp(pContainer->szName, L"default", 6)) {
if ((pContainer = FindMatchingContainer(L"default")) == NULL) {
- TCHAR szName[CONTAINER_NAMELEN + 1];
+ wchar_t szName[CONTAINER_NAMELEN + 1];
mir_sntprintf(szName, L"default");
if ((pContainer = CreateContainer(szName, CNT_CREATEFLAG_CLONED, hContact)) == NULL)
return 0;
@@ -49,17 +49,17 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT newData.szInitialText = NULL;
memset(&newData.item, 0, sizeof(newData.item));
- TCHAR *contactName = pcli->pfnGetContactDisplayName(newData.hContact, 0);
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(newData.hContact, 0);
// cut nickname if larger than x chars...
- TCHAR newcontactname[128];
+ wchar_t newcontactname[128];
if (mir_tstrlen(contactName) > 0) {
if (M.GetByte("cuttitle", 0))
CutContactName(contactName, newcontactname, _countof(newcontactname));
else
- _tcsncpy_s(newcontactname, contactName, _TRUNCATE);
+ wcsncpy_s(newcontactname, contactName, _TRUNCATE);
}
- else _tcsncpy_s(newcontactname, L"_U_", _TRUNCATE);
+ else wcsncpy_s(newcontactname, L"_U_", _TRUNCATE);
newData.item.pszText = newcontactname;
newData.item.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;
@@ -163,12 +163,12 @@ void ShowRoom(SESSION_INFO *si, WPARAM, BOOL) return;
}
- TCHAR szName[CONTAINER_NAMELEN + 2]; szName[0] = 0;
+ wchar_t szName[CONTAINER_NAMELEN + 2]; szName[0] = 0;
TContainerData *pContainer = si->pContainer;
if (pContainer == NULL) {
GetContainerNameForContact(si->hContact, szName, CONTAINER_NAMELEN);
if (!g_Settings.bOpenInDefault && !mir_tstrcmp(szName, L"default"))
- _tcsncpy(szName, L"Chat Rooms", CONTAINER_NAMELEN);
+ wcsncpy(szName, L"Chat Rooms", CONTAINER_NAMELEN);
szName[CONTAINER_NAMELEN] = 0;
pContainer = FindContainerByName(szName);
}
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index 98a3b8f603..274e4ab8a0 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -92,11 +92,11 @@ BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce) return TRUE;
}
-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, ...)
{
POPUPDATAT pd = { 0 };
va_list marker;
- static TCHAR szBuf[4 * 1024];
+ static wchar_t szBuf[4 * 1024];
if (!fmt || mir_tstrlen(fmt) == 0 || mir_tstrlen(fmt) > 2000)
return 0;
@@ -114,7 +114,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
mir_sntprintf(pd.lptzContactName, L"%s - %s", (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, pcli->pfnGetContactDisplayName(hContact, 0));
- _tcsncpy_s(pd.lptzText, TranslateTS(szBuf), _TRUNCATE);
+ wcsncpy_s(pd.lptzText, TranslateTS(szBuf), _TRUNCATE);
pd.iSeconds = g_Settings.iPopupTimeout;
if (g_Settings.iPopupStyle == 2) {
@@ -144,7 +144,7 @@ BOOL DoPopup(SESSION_INFO *si, GCEVENT* gce) TWindowData *dat = si->dat;
TContainerData *pContainer = dat ? dat->pContainer : NULL;
- TCHAR *bbStart, *bbEnd;
+ wchar_t *bbStart, *bbEnd;
if (g_Settings.bBBCodeInPopups) {
bbStart = L"[b]";
bbEnd = L"[/b]";
@@ -474,15 +474,15 @@ int Chat_GetColorIndex(const char* pszModule, COLORREF cr) return -1;
}
-TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2)
+wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2)
{
int i, j, k;
- _tsetlocale(LC_ALL, L"");
+ _wsetlocale(LC_ALL, L"");
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 (TCHAR*)(s1 + i);
+ return (wchar_t*)(s1 + i);
return NULL;
}
@@ -505,7 +505,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) return saveCI.LogToFile(si, gce); // call kernel method
}
-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;
@@ -531,7 +531,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);
}
@@ -539,14 +539,14 @@ 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
- _tcsncpy_s(szTemp, TranslateT("&Message"), _TRUNCATE);
+ wcsncpy_s(szTemp, TranslateT("&Message"), _TRUNCATE);
if (mir_tstrlen(szTemp) > 40)
- _tcsncpy_s(szTemp + 40, 4, L"...", _TRUNCATE);
+ wcsncpy_s(szTemp + 40, 4, L"...", _TRUNCATE);
ModifyMenu(*hMenu, ID_MESS, MF_STRING | MF_BYCOMMAND, ID_MESS, szTemp);
gcmi.Type = MENU_ON_NICKLIST;
}
@@ -557,7 +557,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) {
@@ -686,7 +686,7 @@ BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce) dwMask |= CMUCHighlight::MATCH_NICKNAME;
if (si && g_Settings.bLogClassicIndicators) {
size_t len = mir_tstrlen(gce->ptszNick) + 1;
- TCHAR *tmp = (TCHAR*)_alloca(sizeof(TCHAR)*(len + 1));
+ wchar_t *tmp = (wchar_t*)_alloca(sizeof(wchar_t)*(len + 1));
*tmp = GetIndicator(si, gce->ptszNick, 0);
mir_tstrcpy(tmp + 1, gce->ptszNick);
evTmp.ptszNick = tmp;
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index c633d50ee9..cde016a19e 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -44,8 +44,8 @@ char szIndicators[] = { 0, '+', '%', '@', '!', '*' }; struct MESSAGESUBDATA { time_t lastEnterTime; - TCHAR *szSearchQuery; - TCHAR *szSearchResult; + wchar_t *szSearchQuery; + wchar_t *szSearchResult; BOOL iSavedSpaces; SESSION_INFO *lastSession; }; @@ -130,18 +130,18 @@ static BOOL CheckCustomLink(HWND hwndDlg, POINT *ptClient, UINT uMsg, WPARAM wPa return bIsCustomLink; } -bool IsStringValidLink(TCHAR *pszText) +bool IsStringValidLink(wchar_t *pszText) { if (pszText == NULL) return false; - if (mir_tstrlen(pszText) < 5 || _tcschr(pszText, '"')) + if (mir_tstrlen(pszText) < 5 || wcschr(pszText, '"')) return false; - if (_totlower(pszText[0]) == 'w' && _totlower(pszText[1]) == 'w' && _totlower(pszText[2]) == 'w' && pszText[3] == '.' && _istalnum(pszText[4])) + if (towlower(pszText[0]) == 'w' && towlower(pszText[1]) == 'w' && towlower(pszText[2]) == 'w' && pszText[3] == '.' && iswalnum(pszText[4])) return true; - return _tcsstr(pszText, L"://") != NULL; + return wcsstr(pszText, L"://") != NULL; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -440,11 +440,11 @@ static bool TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si) return false; bool isTopic = false, isRoom = false; - TCHAR *pszName = NULL; - TCHAR *pszText = (TCHAR*)mir_calloc((iLen + 10) * sizeof(TCHAR)); + wchar_t *pszName = NULL; + wchar_t *pszText = (wchar_t*)mir_calloc((iLen + 10) * sizeof(wchar_t)); gt.flags = GT_DEFAULT; - gt.cb = (iLen + 9) * sizeof(TCHAR); + gt.cb = (iLen + 9) * sizeof(wchar_t); SendMessage(hwnd, EM_GETTEXTEX, (WPARAM)>, (LPARAM)pszText); if (start > 1 && pszText[start - 1] == ' ' && pszText[start - 2] == ':') @@ -452,7 +452,7 @@ static bool TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si) if (dat->szSearchResult != NULL) { int cbResult = (int)mir_tstrlen(dat->szSearchResult); - if (start >= cbResult && !_tcsncicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) { + if (start >= cbResult && !wcsnicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) { start -= cbResult; goto LBL_SkipEnd; } @@ -471,7 +471,7 @@ LBL_SkipEnd: int topicStart = start; while (topicStart > 0 && (pszText[topicStart - 1] == ' ' || pszText[topicStart - 1] == 13 || pszText[topicStart - 1] == VK_TAB)) topicStart--; - if (topicStart > 5 && _tcsstr(&pszText[topicStart - 6], L"/topic") == &pszText[topicStart - 6]) + if (topicStart > 5 && wcsstr(&pszText[topicStart - 6], L"/topic") == &pszText[topicStart - 6]) isTopic = TRUE; } if (dat->szSearchQuery == NULL) { @@ -495,7 +495,7 @@ LBL_SkipEnd: if (end != start) { ptrT szReplace; if (!isRoom && !isTopic && g_Settings.bAddColonToAutoComplete && start == 0) { - szReplace = (TCHAR*)mir_alloc((mir_wstrlen(pszName) + 4) * sizeof(TCHAR)); + szReplace = (wchar_t*)mir_alloc((mir_wstrlen(pszName) + 4) * sizeof(wchar_t)); mir_wstrcpy(szReplace, pszName); mir_wstrcat(szReplace, g_Settings.bUseCommaAsColon ? L", " : L": "); pszName = szReplace; @@ -1308,14 +1308,14 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *pa ti.uId = 1; ti.rect = clientRect; - TCHAR tszBuf[1024]; tszBuf[0] = 0; + wchar_t tszBuf[1024]; tszBuf[0] = 0; USERINFO *ui1 = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, currentHovered); if (ui1) { if (ProtoServiceExists(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT)) { - TCHAR *p = (TCHAR*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui1->pszUID); + wchar_t *p = (wchar_t*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui1->pszUID); if (p != NULL) { - _tcsncpy_s(tszBuf, p, _TRUNCATE); + wcsncpy_s(tszBuf, p, _TRUNCATE); mir_free(p); } } @@ -1460,8 +1460,8 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, MessageBeep(MB_OK); break; } - TCHAR szNew[2]; - szNew[0] = (TCHAR)wParam; + wchar_t szNew[2]; + szNew[0] = (wchar_t)wParam; szNew[1] = '\0'; mir_tstrcat(si->szSearch, szNew); } @@ -1472,7 +1472,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, for (i = 0; i < iItems; i++) { USERINFO *ui = pci->UM_FindUserFromIndex(si->pUsers, i); if (ui) { - if (!_tcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) { + if (!wcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) { SendMessage(hwnd, LB_SETSEL, FALSE, -1); SendMessage(hwnd, LB_SETSEL, TRUE, i); si->iSearchItem = i; @@ -1662,11 +1662,11 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, USERINFO *ui1 = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, currentHovered); if (ui1) { - TCHAR tszBuf[1024]; tszBuf[0] = 0; + wchar_t tszBuf[1024]; tszBuf[0] = 0; if (ProtoServiceExists(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT)) { - TCHAR *p = (TCHAR*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui1->pszUID); + wchar_t *p = (wchar_t*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui1->pszUID); if (p) { - _tcsncpy_s(tszBuf, p, _TRUNCATE); + wcsncpy_s(tszBuf, p, _TRUNCATE); mir_free(p); } } @@ -1691,7 +1691,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, // calculate the required rectangle for a string using the given font. This is more // precise than using GetTextExtentPoint...() -int GetTextPixelSize(TCHAR* pszText, HFONT hFont, bool bWidth) +int GetTextPixelSize(wchar_t* pszText, HFONT hFont, bool bWidth) { if (!pszText || !hFont) return 0; @@ -1889,15 +1889,15 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (!dat->bWasDeleted) { dat->wStatus = si->wStatus; - const TCHAR *szNick = dat->cache->getNick(); + const wchar_t *szNick = dat->cache->getNick(); if (mir_tstrlen(szNick) > 0) { if (M.GetByte("cuttitle", 0)) CutContactName(szNick, dat->newtitle, _countof(dat->newtitle)); else - _tcsncpy_s(dat->newtitle, szNick, _TRUNCATE); + wcsncpy_s(dat->newtitle, szNick, _TRUNCATE); } - TCHAR szTemp[100]; + wchar_t szTemp[100]; HICON hIcon = 0; switch (si->iType) { @@ -1930,7 +1930,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar dat->hTabIcon = dat->hTabStatusIcon; if (dat->cache->getStatus() != dat->cache->getOldStatus()) { - _tcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->wStatus, 0), _TRUNCATE); + wcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->wStatus, 0), _TRUNCATE); TCITEM item = { 0 }; item.mask = TCIF_TEXT; @@ -1953,7 +1953,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar break; if (si->pszModule != NULL) { - TCHAR szFinalStatusBarText[512]; + wchar_t szFinalStatusBarText[512]; //Mad: strange rare crash here... MODULEINFO *mi = pci->MM_FindModule(si->pszModule); @@ -1990,7 +1990,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (si->ptszStatusbarText) mir_sntprintf(szFinalStatusBarText, L"%s %s", mi->ptszModDispName, si->ptszStatusbarText); else - _tcsncpy_s(szFinalStatusBarText, mi->ptszModDispName, _TRUNCATE); + wcsncpy_s(szFinalStatusBarText, mi->ptszModDispName, _TRUNCATE); } SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 0, (LPARAM)szFinalStatusBarText); UpdateStatusBar(dat); @@ -2511,7 +2511,7 @@ LABEL_SHOWWINDOW: ClientToScreen(((LPNMHDR)lParam)->hwndFrom, &pt); // fixing stuff for searches - TCHAR *pszWord = (TCHAR*)_alloca(8192); + wchar_t *pszWord = (wchar_t*)_alloca(8192); pszWord[0] = '\0'; POINTL ptl = { pt.x, pt.y }; ScreenToClient(GetDlgItem(hwndDlg, IDC_CHAT_LOG), (LPPOINT)&ptl); @@ -2531,7 +2531,7 @@ LABEL_SHOWWINDOW: TEXTRANGE tr = { 0 }; tr.chrg = cr; - tr.lpstrText = (TCHAR*)pszWord; + tr.lpstrText = (wchar_t*)pszWord; int iRes = SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_GETTEXTRANGE, 0, (LPARAM)&tr); if (iRes > 0) { @@ -2617,7 +2617,7 @@ LABEL_SHOWWINDOW: TEXTRANGE tr; tr.lpstrText = NULL; tr.chrg = ((ENLINK*)lParam)->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(((LPNMHDR)lParam)->hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr); BOOL isLink = IsStringValidLink(tr.lpstrText); @@ -2684,19 +2684,19 @@ LABEL_SHOWWINDOW: CHARRANGE chr; SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_EXGETSEL, 0, (LPARAM)&chr); - TCHAR tszAplTmpl[] = L"%s:"; + wchar_t tszAplTmpl[] = L"%s:"; size_t bufSize = mir_tstrlen(tr.lpstrText) + mir_tstrlen(tszAplTmpl) + 3; - TCHAR *tszTmp = (TCHAR*)mir_alloc(bufSize * sizeof(TCHAR)), *tszAppeal = tszTmp; + wchar_t *tszTmp = (wchar_t*)mir_alloc(bufSize * sizeof(wchar_t)), *tszAppeal = tszTmp; TEXTRANGE tr2; - tr2.lpstrText = (LPTSTR)mir_alloc(sizeof(TCHAR) * 2); + tr2.lpstrText = (LPTSTR)mir_alloc(sizeof(wchar_t) * 2); if (chr.cpMin) { // prepend nick with space if needed tr2.chrg.cpMin = chr.cpMin - 1; tr2.chrg.cpMax = chr.cpMin; SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETTEXTRANGE, 0, (LPARAM)&tr2); - if (!_istspace(*tr2.lpstrText)) - *tszTmp++ = _T(' '); + if (!iswspace(*tr2.lpstrText)) + *tszTmp++ = ' '; mir_tstrcpy(tszTmp, tr.lpstrText); } else // in the beginning of the message window @@ -2708,14 +2708,14 @@ LABEL_SHOWWINDOW: tr2.chrg.cpMax = chr.cpMax + 1; // if there is no space after selection, // or there is nothing after selection at all... - if (!SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETTEXTRANGE, 0, (LPARAM)&tr2) || !_istspace(*tr2.lpstrText)) { - tszAppeal[st++] = _T(' '); - tszAppeal[st++] = _T('\0'); + if (!SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETTEXTRANGE, 0, (LPARAM)&tr2) || !iswspace(*tr2.lpstrText)) { + tszAppeal[st++] = ' '; + tszAppeal[st++] = '\0'; } } else { - tszAppeal[st++] = _T(' '); - tszAppeal[st++] = _T('\0'); + tszAppeal[st++] = ' '; + tszAppeal[st++] = '\0'; } SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_REPLACESEL, FALSE, (LPARAM)tszAppeal); mir_free((void*)tr2.lpstrText); @@ -3202,11 +3202,11 @@ LABEL_SHOWWINDOW: case DM_CONTAINERSELECTED: { - TCHAR *szNewName = (TCHAR*)lParam; + wchar_t *szNewName = (wchar_t*)lParam; if (!mir_tstrcmp(szNewName, TranslateT("Default container"))) szNewName = CGlobals::m_default_container_name; int iOldItems = TabCtrl_GetItemCount(hwndTab); - if (!_tcsncmp(dat->pContainer->szName, szNewName, CONTAINER_NAMELEN)) + if (!wcsncmp(dat->pContainer->szName, szNewName, CONTAINER_NAMELEN)) break; TContainerData *pNewContainer = FindContainerByName(szNewName); if (pNewContainer == NULL) diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 9f7ccd8adc..b955bd2cb8 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -117,10 +117,10 @@ bool CContactCache::updateNick() { bool fChanged = false; if (m_Valid) { - TCHAR *tszNick = pcli->pfnGetContactDisplayName(getActiveContact(), 0); + wchar_t *tszNick = pcli->pfnGetContactDisplayName(getActiveContact(), 0); if (tszNick && mir_tstrcmp(m_szNick, tszNick)) fChanged = true; - _tcsncpy_s(m_szNick, (tszNick ? tszNick : L"<undef>"), _TRUNCATE); + wcsncpy_s(m_szNick, (tszNick ? tszNick : L"<undef>"), _TRUNCATE); } return fChanged; } @@ -180,7 +180,7 @@ bool CContactCache::updateUIN() if (m_Valid) { ptrT uid(Contact_GetInfo(CNF_DISPLAYUID, getActiveContact(), getActiveProto())); if (uid != NULL) - _tcsncpy_s(m_szUIN, uid, _TRUNCATE); + wcsncpy_s(m_szUIN, uid, _TRUNCATE); } return false; @@ -287,12 +287,12 @@ void CContactCache::saveHistory(WPARAM wParam, LPARAM) if (m_history[m_iHistoryTop].szText == NULL) { if (iLength < HISTORY_INITIAL_ALLOCSIZE) iLength = HISTORY_INITIAL_ALLOCSIZE; - m_history[m_iHistoryTop].szText = (TCHAR*)mir_alloc(iLength); + m_history[m_iHistoryTop].szText = (wchar_t*)mir_alloc(iLength); m_history[m_iHistoryTop].lLen = iLength; } else { if (iLength > m_history[m_iHistoryTop].lLen) { - m_history[m_iHistoryTop].szText = (TCHAR*)mir_realloc(m_history[m_iHistoryTop].szText, iLength); + m_history[m_iHistoryTop].szText = (wchar_t*)mir_realloc(m_history[m_iHistoryTop].szText, iLength); m_history[m_iHistoryTop].lLen = iLength; } } @@ -329,7 +329,7 @@ void CContactCache::inputHistoryEvent(WPARAM wParam) if (::GetWindowTextLength(hwndEdit) > 0) saveHistory(m_iHistorySize, 0); else - m_history[m_iHistorySize].szText[0] = (TCHAR)'\0'; + m_history[m_iHistorySize].szText[0] = (wchar_t)'\0'; } if (wParam == VK_UP) { if (m_iHistoryCurrent == 0) @@ -379,7 +379,7 @@ void CContactCache::allocHistory() m_iHistoryTop = 0; if (m_history) memset(m_history, 0, (sizeof(TInputHistory) * m_iHistorySize)); - m_history[m_iHistorySize].szText = (TCHAR*)mir_alloc((HISTORY_INITIAL_ALLOCSIZE + 1) * sizeof(TCHAR)); + m_history[m_iHistorySize].szText = (wchar_t*)mir_alloc((HISTORY_INITIAL_ALLOCSIZE + 1) * sizeof(wchar_t)); m_history[m_iHistorySize].lLen = HISTORY_INITIAL_ALLOCSIZE; } @@ -517,11 +517,11 @@ int CContactCache::cacheUpdateMetaChanged(WPARAM bMetaEnabled, LPARAM) /** * normalize the status message with proper cr/lf sequences. - * @param src TCHAR*: original status message + * @param src wchar_t*: original status message * @param fStripAll bool: strip all cr/lf sequences and replace them with spaces (use for title bar) - * @return TCHAR*: converted status message. CALLER is responsible to mir_free it, MUST use mir_free() + * @return wchar_t*: converted status message. CALLER is responsible to mir_free it, MUST use mir_free() */ -TCHAR* CContactCache::getNormalizedStatusMsg(const TCHAR *src, bool fStripAll) +wchar_t* CContactCache::getNormalizedStatusMsg(const wchar_t *src, bool fStripAll) { if (src == 0 || mir_tstrlen(src) < 2) return 0; @@ -531,7 +531,7 @@ TCHAR* CContactCache::getNormalizedStatusMsg(const TCHAR *src, bool fStripAll) for (int i = 0; src[i] != 0; i++) { if (src[i] == 0x0d || src[i] == '\t') continue; - if (i && src[i] == (TCHAR)0x0a) { + if (i && src[i] == (wchar_t)0x0a) { if (fStripAll) { dest.AppendChar(' '); continue; diff --git a/plugins/TabSRMM/src/contactcache.h b/plugins/TabSRMM/src/contactcache.h index 4be30f678b..a6e6fa191b 100644 --- a/plugins/TabSRMM/src/contactcache.h +++ b/plugins/TabSRMM/src/contactcache.h @@ -33,7 +33,7 @@ #define HISTORY_INITIAL_ALLOCSIZE 300
struct TInputHistory {
- TCHAR* szText;
+ wchar_t* szText;
size_t lLen;
};
@@ -68,7 +68,7 @@ struct CContactCache : public MZeroedObject const WORD getStatus() const { return m_wStatus; }
const WORD getActiveStatus() const { return m_isMeta ? m_wMetaStatus : m_wStatus; }
const WORD getOldStatus() const { return m_wOldStatus; }
- const TCHAR* getNick() const { return m_szNick; }
+ const wchar_t* getNick() const { return m_szNick; }
const MCONTACT getContact() const { return m_hContact; }
const MCONTACT getActiveContact() const { return (m_isMeta) ? m_hSub : m_hContact; }
const DWORD getIdleTS() const { return m_idleTS; }
@@ -78,11 +78,11 @@ struct CContactCache : public MZeroedObject bool isSubContact() const { return cc->IsSub(); }
bool isFavorite() const { return m_isFavorite; }
bool isRecent() const { return m_isRecent; }
- const TCHAR* getRealAccount() const { return m_szAccount ? m_szAccount : C_INVALID_ACCOUNT; }
- const TCHAR* getUIN() const { return m_szUIN; }
- const TCHAR* getStatusMsg() const { return m_szStatusMsg; }
- const TCHAR* getXStatusMsg() const { return m_xStatusMsg; }
- const TCHAR* getListeningInfo() const { return m_ListeningInfo; }
+ const wchar_t* getRealAccount() const { return m_szAccount ? m_szAccount : C_INVALID_ACCOUNT; }
+ const wchar_t* getUIN() const { return m_szUIN; }
+ const wchar_t* getStatusMsg() const { return m_szStatusMsg; }
+ const wchar_t* getXStatusMsg() const { return m_xStatusMsg; }
+ const wchar_t* getListeningInfo() const { return m_ListeningInfo; }
BYTE getXStatusId() const { return m_xStatus; }
const HWND getWindowData(TWindowData*& dat) const { dat = m_dat; return m_hwnd; }
const HWND getHwnd() const { return m_hwnd; }
@@ -107,7 +107,7 @@ struct CContactCache : public MZeroedObject void closeWindow();
void deletedHandler();
void updateFavorite();
- TCHAR* getNormalizedStatusMsg(const TCHAR *src, bool fStripAll = false);
+ wchar_t* getNormalizedStatusMsg(const wchar_t *src, bool fStripAll = false);
HICON getIcon(int& iSize) const;
/*
@@ -128,9 +128,9 @@ private: MCONTACT m_hContact, m_hSub;
WORD m_wStatus, m_wOldStatus, m_wMetaStatus;
char *m_szMetaProto;
- TCHAR *m_szAccount;
- TCHAR m_szNick[80], m_szUIN[80];
- TCHAR *m_szStatusMsg, *m_xStatusMsg, *m_ListeningInfo;
+ wchar_t *m_szAccount;
+ wchar_t m_szNick[80], m_szUIN[80];
+ wchar_t *m_szStatusMsg, *m_xStatusMsg, *m_ListeningInfo;
BYTE m_xStatus;
DWORD m_idleTS;
bool m_isMeta;
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 57edcf6d1f..02851f893c 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -151,7 +151,7 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, CSkin::DrawItem(dcMem, &rcWindow, &SkinItems[pContainer->ncActive ? ID_EXTBKFRAME : ID_EXTBKFRAMEINACTIVE]);
- TCHAR szWindowText[512];
+ wchar_t szWindowText[512];
GetWindowText(hwndDlg, szWindowText, _countof(szWindowText));
szWindowText[511] = 0;
@@ -1006,7 +1006,7 @@ panel_found: dat = NULL;
if (lParam) { // lParam != 0 means sent by a chat window
- TCHAR szText[512];
+ wchar_t szText[512];
dat = (TWindowData*)GetWindowLongPtr((HWND)wParam, GWLP_USERDATA);
GetWindowText((HWND)wParam, szText, _countof(szText));
szText[_countof(szText) - 1] = 0;
@@ -1305,9 +1305,9 @@ panel_found: case DM_OPTIONSAPPLIED:
char szCname[40];
- TCHAR szTitleFormat[200];
+ wchar_t szTitleFormat[200];
{
- TCHAR *szThemeName = NULL;
+ wchar_t *szThemeName = NULL;
DBVARIANT dbv = { 0 };
szTitleFormat[0] = 0;
@@ -1332,7 +1332,7 @@ panel_found: if (szThemeName != NULL) {
PathToAbsoluteT(szThemeName, pContainer->szAbsThemeFile, M.getDataPath());
- _tcsncpy_s(pContainer->szRelThemeFile, szThemeName, _TRUNCATE);
+ wcsncpy_s(pContainer->szRelThemeFile, szThemeName, _TRUNCATE);
db_free(&dbv);
}
else pContainer->szAbsThemeFile[0] = pContainer->szRelThemeFile[0] = 0;
@@ -1748,7 +1748,7 @@ panel_found: // The WM_DESTROY handler of the container DlgProc is responsible for mir_free()'ing the
// pointer and for removing the struct from the linked list.
-TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, MCONTACT hContactFrom)
+TContainerData* TSAPI CreateContainer(const wchar_t *name, int iTemp, MCONTACT hContactFrom)
{
if (CMimAPI::m_shutDown)
return NULL;
@@ -1756,7 +1756,7 @@ TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, MCONTACT hCo TContainerData *pContainer = (TContainerData*)mir_calloc(sizeof(TContainerData));
if (pContainer == NULL)
return NULL;
- _tcsncpy(pContainer->szName, name, CONTAINER_NAMELEN + 1);
+ wcsncpy(pContainer->szName, name, CONTAINER_NAMELEN + 1);
AppendToContainerList(pContainer);
if (M.GetByte("limittabs", 0) && !mir_tstrcmp(name, L"default"))
@@ -1781,11 +1781,11 @@ TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, MCONTACT hCo break;
}
- if (!_tcsncmp(tszName, name, CONTAINER_NAMELEN)) {
+ if (!wcsncmp(tszName, name, CONTAINER_NAMELEN)) {
pContainer->iContainerIndex = i;
iFound = TRUE;
}
- else if (!_tcsncmp(tszName, L"**mir_free**", CONTAINER_NAMELEN))
+ else if (!wcsncmp(tszName, L"**mir_free**", CONTAINER_NAMELEN))
iFirstFree = i;
} while (++i && iFound == FALSE);
}
@@ -1874,12 +1874,12 @@ void TSAPI CloseOtherTabs(HWND hwndTab, TWindowData &dat) //
// size = max length of target string
-int TSAPI CutContactName(const TCHAR *oldname, TCHAR *newname, size_t size)
+int TSAPI CutContactName(const wchar_t *oldname, wchar_t *newname, size_t size)
{
if (mir_tstrlen(oldname) <= PluginConfig.m_iTabNameLimit)
- _tcsncpy_s(newname, size, oldname, _TRUNCATE);
+ wcsncpy_s(newname, size, oldname, _TRUNCATE);
else {
- TCHAR fmt[30];
+ wchar_t fmt[30];
mir_sntprintf(fmt, L"%%%d.%ds...", PluginConfig.m_iTabNameLimit, PluginConfig.m_iTabNameLimit);
mir_sntprintf(newname, size, fmt, oldname);
}
@@ -1904,7 +1904,7 @@ static TContainerData* TSAPI AppendToContainerList(TContainerData *pContainer) return p;
}
-TContainerData* TSAPI FindContainerByName(const TCHAR *name)
+TContainerData* TSAPI FindContainerByName(const wchar_t *name)
{
if (name == NULL || mir_tstrlen(name) == 0)
return 0;
@@ -1913,7 +1913,7 @@ TContainerData* TSAPI FindContainerByName(const TCHAR *name) return NULL;
for (TContainerData *p = pFirstContainer; p; p = p->pNext)
- if (!_tcsncmp(p->szName, name, CONTAINER_NAMELEN))
+ if (!wcsncmp(p->szName, name, CONTAINER_NAMELEN))
return p;
// error, didn't find it.
@@ -2006,11 +2006,11 @@ void TSAPI AdjustTabClientRect(TContainerData *pContainer, RECT *rc) // retrieve the container name for the given contact handle.
// if none is assigned, return the name of the default container
-int TSAPI GetContainerNameForContact(MCONTACT hContact, TCHAR *szName, int iNameLen)
+int TSAPI GetContainerNameForContact(MCONTACT hContact, wchar_t *szName, int iNameLen)
{
// single window mode using cloned (temporary) containers
if (M.GetByte("singlewinmode", 0)) {
- _tcsncpy_s(szName, iNameLen, L"Message Session", _TRUNCATE);
+ wcsncpy_s(szName, iNameLen, L"Message Session", _TRUNCATE);
return 0;
}
@@ -2018,21 +2018,21 @@ int TSAPI GetContainerNameForContact(MCONTACT hContact, TCHAR *szName, int iName if (M.GetByte("useclistgroups", 0)) {
ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
if (tszGroup == NULL) {
- _tcsncpy_s(szName, iNameLen, L"default", _TRUNCATE);
+ wcsncpy_s(szName, iNameLen, L"default", _TRUNCATE);
return 0;
}
- _tcsncpy_s(szName, iNameLen, tszGroup, _TRUNCATE);
+ wcsncpy_s(szName, iNameLen, tszGroup, _TRUNCATE);
return 1;
}
ptrT tszContainerName(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
if (tszContainerName == NULL) {
- _tcsncpy_s(szName, iNameLen, L"default", _TRUNCATE);
+ wcsncpy_s(szName, iNameLen, L"default", _TRUNCATE);
return 0;
}
- _tcsncpy_s(szName, iNameLen, tszContainerName, _TRUNCATE);
+ wcsncpy_s(szName, iNameLen, tszContainerName, _TRUNCATE);
return 1;
}
@@ -2067,7 +2067,7 @@ void TSAPI DeleteContainer(int iIndex) db_unset(NULL, SRMSGMOD_T, szSetting);
}
-void TSAPI RenameContainer(int iIndex, const TCHAR *szNew)
+void TSAPI RenameContainer(int iIndex, const wchar_t *szNew)
{
if (mir_tstrlen(szNew) == 0)
return;
@@ -2109,7 +2109,7 @@ HMENU TSAPI BuildContainerMenu() if (tszName == NULL)
break;
- if (_tcsncmp(tszName, L"**mir_free**", CONTAINER_NAMELEN))
+ if (wcsncmp(tszName, L"**mir_free**", CONTAINER_NAMELEN))
AppendMenu(hMenu, MF_STRING, IDM_CONTAINERMENU + i, !mir_tstrcmp(tszName, L"default") ? TranslateT("Default container") : tszName);
i++;
}
diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp index edc4d321be..33f27f8b7c 100644 --- a/plugins/TabSRMM/src/containeroptions.cpp +++ b/plugins/TabSRMM/src/containeroptions.cpp @@ -101,19 +101,19 @@ void TSAPI ApplyContainerSetting(TContainerData *pContainer, DWORD flags, UINT m static struct _tagPages
{
- const TCHAR *szTitle, *szDesc;
+ const wchar_t *szTitle, *szDesc;
UINT uIds[10];
} o_pages[] = {
- { LPGENT("General options"), NULL, IDC_O_NOTABS, IDC_O_STICKY, IDC_VERTICALMAX, IDC_AUTOSPLITTER, IDC_O_AUTOHIDE, IDC_AUTOCLOSETABTIME, IDC_AUTOCLOSETABSPIN, IDC_O_AUTOHIDESECONDS, 0, 0 },
- { LPGENT("Window layout"), NULL, IDC_CNTNOSTATUSBAR, IDC_HIDEMENUBAR, IDC_UIDSTATUSBAR, IDC_HIDETOOLBAR, IDC_INFOPANEL, IDC_BOTTOMTOOLBAR, 0, 0, 0, 0 },
- { LPGENT("Tabs and switch bar"), LPGENT("Choose your options for the tabbed user interface. Not all options can be applied to open windows. You may need to close and re-open them."), IDC_TABMODE, IDC_O_TABMODE, IDC_O_SBARLAYOUT, IDC_SBARLAYOUT, IDC_FLASHICON, IDC_FLASHLABEL, IDC_SINGLEROWTAB, IDC_BUTTONTABS, IDC_CLOSEBUTTONONTABS, 0 },
- { LPGENT("Notifications"), LPGENT("Select, when you want to see event notifications (popups) for this window. The settings apply to all tabs within this window."), IDC_O_DONTREPORT, IDC_DONTREPORTUNFOCUSED2, IDC_DONTREPORTFOCUSED2, IDC_ALWAYSPOPUPSINACTIVE, IDC_O_EXPLAINGLOBALNOTIFY, 0, 0, 0, 0, 0 },
- { LPGENT("Flashing"), NULL, IDC_O_FLASHDEFAULT, IDC_O_FLASHALWAYS, IDC_O_FLASHNEVER, 0, 0, 0, 0, 0, 0, 0 },
- { LPGENT("Title bar"), NULL, IDC_O_HIDETITLE, IDC_TITLEFORMAT, IDC_O_TITLEBARFORMAT, IDC_O_HELP_TITLEFORMAT, 0, 0, 0, 0, 0, 0 },
- { LPGENT("Window size and theme"), LPGENT("You can select a private theme (.tabsrmm file) for this container which will then override the default message log theme. You will have to close and re-open all message windows after changing this option."), IDC_THEME, IDC_SELECTTHEME, IDC_USEGLOBALSIZE, IDC_SAVESIZEASGLOBAL, IDC_LABEL_PRIVATETHEME, IDC_TSLABEL_EXPLAINTHEME, 0, 0, 0, 0 },
- { LPGENT("Transparency"), LPGENT("This feature may be unavailable when using a container skin."), IDC_TRANSPARENCY, IDC_TRANSPARENCY_ACTIVE, IDC_TRANSPARENCY_INACTIVE, IDC_TSLABEL_ACTIVE, IDC_TSLABEL_INACTIVE, 0, 0, 0, 0, 0 },
- { LPGENT("Contact avatars"), NULL, IDC_O_STATIC_AVATAR, IDC_O_STATIC_OWNAVATAR, IDC_AVATARMODE, IDC_OWNAVATARMODE, IDC_AVATARSONTASKBAR, 0, 0, 0, 0, 0 },
- { LPGENT("Sound notifications"), NULL, IDC_O_ENABLESOUNDS, IDC_O_SOUNDSMINIMIZED, IDC_O_SOUNDSUNFOCUSED, IDC_O_SOUNDSINACTIVE, IDC_O_SOUNDSFOCUSED, 0, 0, 0, 0, 0 },
+ { LPGENW("General options"), NULL, IDC_O_NOTABS, IDC_O_STICKY, IDC_VERTICALMAX, IDC_AUTOSPLITTER, IDC_O_AUTOHIDE, IDC_AUTOCLOSETABTIME, IDC_AUTOCLOSETABSPIN, IDC_O_AUTOHIDESECONDS, 0, 0 },
+ { LPGENW("Window layout"), NULL, IDC_CNTNOSTATUSBAR, IDC_HIDEMENUBAR, IDC_UIDSTATUSBAR, IDC_HIDETOOLBAR, IDC_INFOPANEL, IDC_BOTTOMTOOLBAR, 0, 0, 0, 0 },
+ { LPGENW("Tabs and switch bar"), LPGENW("Choose your options for the tabbed user interface. Not all options can be applied to open windows. You may need to close and re-open them."), IDC_TABMODE, IDC_O_TABMODE, IDC_O_SBARLAYOUT, IDC_SBARLAYOUT, IDC_FLASHICON, IDC_FLASHLABEL, IDC_SINGLEROWTAB, IDC_BUTTONTABS, IDC_CLOSEBUTTONONTABS, 0 },
+ { LPGENW("Notifications"), LPGENW("Select, when you want to see event notifications (popups) for this window. The settings apply to all tabs within this window."), IDC_O_DONTREPORT, IDC_DONTREPORTUNFOCUSED2, IDC_DONTREPORTFOCUSED2, IDC_ALWAYSPOPUPSINACTIVE, IDC_O_EXPLAINGLOBALNOTIFY, 0, 0, 0, 0, 0 },
+ { LPGENW("Flashing"), NULL, IDC_O_FLASHDEFAULT, IDC_O_FLASHALWAYS, IDC_O_FLASHNEVER, 0, 0, 0, 0, 0, 0, 0 },
+ { LPGENW("Title bar"), NULL, IDC_O_HIDETITLE, IDC_TITLEFORMAT, IDC_O_TITLEBARFORMAT, IDC_O_HELP_TITLEFORMAT, 0, 0, 0, 0, 0, 0 },
+ { LPGENW("Window size and theme"), LPGENW("You can select a private theme (.tabsrmm file) for this container which will then override the default message log theme. You will have to close and re-open all message windows after changing this option."), IDC_THEME, IDC_SELECTTHEME, IDC_USEGLOBALSIZE, IDC_SAVESIZEASGLOBAL, IDC_LABEL_PRIVATETHEME, IDC_TSLABEL_EXPLAINTHEME, 0, 0, 0, 0 },
+ { LPGENW("Transparency"), LPGENW("This feature may be unavailable when using a container skin."), IDC_TRANSPARENCY, IDC_TRANSPARENCY_ACTIVE, IDC_TRANSPARENCY_INACTIVE, IDC_TSLABEL_ACTIVE, IDC_TSLABEL_INACTIVE, 0, 0, 0, 0, 0 },
+ { LPGENW("Contact avatars"), NULL, IDC_O_STATIC_AVATAR, IDC_O_STATIC_OWNAVATAR, IDC_AVATARMODE, IDC_OWNAVATARMODE, IDC_AVATARSONTASKBAR, 0, 0, 0, 0, 0 },
+ { LPGENW("Sound notifications"), NULL, IDC_O_ENABLESOUNDS, IDC_O_SOUNDSMINIMIZED, IDC_O_SOUNDSUNFOCUSED, IDC_O_SOUNDSINACTIVE, IDC_O_SOUNDSFOCUSED, 0, 0, 0, 0, 0 },
};
static void ShowPage(HWND hwndDlg, int iPage, BOOL fShow)
@@ -152,7 +152,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, pContainer = (TContainerData*)lParam;
pContainer->hWndOptions = hwndDlg;
SetWindowText(hwndDlg, TranslateT("Container options"));
- TCHAR szNewTitle[128];
+ wchar_t szNewTitle[128];
mir_sntprintf(szNewTitle, L"%s", !mir_tstrcmp(pContainer->szName, L"default") ?
TranslateT("Default container") : pContainer->szName);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, szNewTitle);
@@ -342,7 +342,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, pContainer->fPrivateThemeChanged = TRUE;
if (PathFileExists(szFinalThemeFile))
- _tcsncpy_s(pContainer->szRelThemeFile, szFilename, _TRUNCATE);
+ wcsncpy_s(pContainer->szRelThemeFile, szFilename, _TRUNCATE);
else
pContainer->szRelThemeFile[0] = 0;
}
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index 3fdb69954f..a60bf718a8 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -270,12 +270,12 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm) return CDRF_NOTIFYITEMDRAW | CDRF_NOTIFYPOSTPAINT | CDRF_NOTIFYPOSTERASE;
case CDDS_ITEMPREPAINT:
- TCHAR *szText;
+ wchar_t *szText;
bool fDraw;
{
int iIndex = idToIndex(nmtb->nmcd.dwItemSpec);
if (iIndex >= 0 && iIndex < NR_BUTTONS)
- szText = (TCHAR*)m_TbButtons[iIndex].iString;
+ szText = (wchar_t*)m_TbButtons[iIndex].iString;
else
szText = NULL;
@@ -834,7 +834,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR int height = itemRect.bottom - itemRect.top;
HICON hIcon = (HICON)SendMessage(hWnd, SB_GETICON, i, 0);
- TCHAR szText[1024]; szText[0] = 0;
+ wchar_t szText[1024]; szText[0] = 0;
LRESULT result = SendMessage(hWnd, SB_GETTEXT, i, (LPARAM)szText);
if (i == 2 && pContainer) {
TWindowData *pDat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
@@ -952,7 +952,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR if (dat != NULL) {
RECT rc;
SIZE size;
- TCHAR wBuf[512]; wBuf[0] = 0;
+ wchar_t wBuf[512]; wBuf[0] = 0;
CLCINFOTIP ti = { 0 };
ti.cbSize = sizeof(ti);
ti.ptCursor = pt;
@@ -975,10 +975,10 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR mtnStatus ? TranslateT("enabled") : TranslateT("disabled"));
}
else if (sid->dwId == MSG_ICON_SESSION)
- _tcsncpy_s(wBuf, TranslateT("Session list.\nClick left for a list of open sessions.\nClick right to access favorites and quickly configure message window behavior"), _TRUNCATE);
+ wcsncpy_s(wBuf, TranslateT("Session list.\nClick left for a list of open sessions.\nClick right to access favorites and quickly configure message window behavior"), _TRUNCATE);
}
else if (sid->tszTooltip)
- _tcsncpy(wBuf, sid->tszTooltip, _countof(wBuf));
+ wcsncpy(wBuf, sid->tszTooltip, _countof(wBuf));
if (wBuf[0]) {
CallService("mToolTip/ShowTipW", (WPARAM)wBuf, (LPARAM)&ti);
@@ -995,7 +995,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR iLength = SendDlgItemMessage(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_MESSAGE : IDC_CHAT_MESSAGE, EM_GETTEXTLENGTHEX, (WPARAM)>xl, 0);
tooltip_active = TRUE;
- const TCHAR *szFormat = TranslateT("There are %d pending send jobs. Message length: %d bytes, message length limit: %d bytes\n\n%d messages are queued for later delivery");
+ const wchar_t *szFormat = TranslateT("There are %d pending send jobs. Message length: %d bytes, message length limit: %d bytes\n\n%d messages are queued for later delivery");
mir_sntprintf(wBuf, szFormat, dat->iOpenJobs, iLength, dat->nMax ? dat->nMax : 20000, iQueued);
CallService("mToolTip/ShowTipW", (WPARAM)wBuf, (LPARAM)&ti);
diff --git a/plugins/TabSRMM/src/controls.h b/plugins/TabSRMM/src/controls.h index cefcf8276b..bda3bc61ac 100644 --- a/plugins/TabSRMM/src/controls.h +++ b/plugins/TabSRMM/src/controls.h @@ -66,7 +66,7 @@ public: void setAero(bool fState) { m_isAero = fState; }
const bool getAero(void) const { return(m_isAero); }
- const LRESULT processAccelerator(TCHAR a, UINT& ctlId) const
+ const LRESULT processAccelerator(wchar_t a, UINT& ctlId) const
{
UINT _ctlId;
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 629c9a6d11..0680d86d3a 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -414,14 +414,14 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA * @return
*/
-static TCHAR* ShortenPreview(DBEVENTINFO* dbe)
+static wchar_t* ShortenPreview(DBEVENTINFO* dbe)
{
bool fAddEllipsis = false;
size_t iPreviewLimit = nen_options.iLimitPreview;
if (iPreviewLimit > 500 || iPreviewLimit == 0)
iPreviewLimit = 500;
- TCHAR *buf = DbGetEventTextT(dbe, CP_ACP);
+ wchar_t *buf = DbGetEventTextT(dbe, CP_ACP);
if (mir_tstrlen(buf) > iPreviewLimit) {
fAddEllipsis = true;
size_t iIndex = iPreviewLimit;
@@ -432,13 +432,13 @@ static TCHAR* ShortenPreview(DBEVENTINFO* dbe) buf[iIndex] = 0;
}
if (fAddEllipsis) {
- buf = (TCHAR*)mir_realloc(buf, (mir_tstrlen(buf) + 5) * sizeof(TCHAR));
+ buf = (wchar_t*)mir_realloc(buf, (mir_tstrlen(buf) + 5) * sizeof(wchar_t));
mir_tstrcat(buf, L"...");
}
return buf;
}
-static TCHAR* GetPreviewT(WORD eventType, DBEVENTINFO* dbe)
+static wchar_t* GetPreviewT(WORD eventType, DBEVENTINFO* dbe)
{
char *pBlob = (char *)dbe->pBlob;
@@ -463,7 +463,7 @@ static TCHAR* GetPreviewT(WORD eventType, DBEVENTINFO* dbe) szDescr = szFileName + namelength + 1;
ptrT tszFileName(DbGetEventStringT(dbe, szFileName));
- TCHAR buf[1024];
+ wchar_t buf[1024];
if (szDescr && Utils::safe_strlen(szDescr, dbe->cbBlob - sizeof(DWORD) - namelength - 1) > 0) {
ptrT tszDescr(DbGetEventStringT(dbe, szDescr));
@@ -498,7 +498,7 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) if (hEvent == NULL)
return 0;
- TCHAR szHeader[256];
+ wchar_t szHeader[256];
if (pdata->pluginOptions->bShowHeaders)
mir_sntprintf(szHeader, L"%s %d\n", TranslateT("New messages: "), pdata->nrMerged + 1);
else
@@ -511,11 +511,11 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) }
db_event_get(hEvent, &dbe);
- TCHAR timestamp[MAX_DATASIZE];
- _tcsftime(timestamp, MAX_DATASIZE, L"%Y.%m.%d %H:%M", _localtime32((__time32_t *)&dbe.timestamp));
+ wchar_t timestamp[MAX_DATASIZE];
+ wcsftime(timestamp, MAX_DATASIZE, L"%Y.%m.%d %H:%M", _localtime32((__time32_t *)&dbe.timestamp));
mir_sntprintf(pdata->eventData[pdata->nrMerged].tszText, L"\n\n%s\n", timestamp);
- TCHAR *szPreview = GetPreviewT(dbe.eventType, &dbe);
+ wchar_t *szPreview = GetPreviewT(dbe.eventType, &dbe);
if (szPreview) {
mir_tstrncat(pdata->eventData[pdata->nrMerged].tszText, szPreview, _countof(pdata->eventData[pdata->nrMerged].tszText) - mir_tstrlen(pdata->eventData[pdata->nrMerged].tszText));
mir_free(szPreview);
@@ -529,10 +529,10 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) * for which there is enough space in the popup text
*/
- TCHAR lpzText[MAX_SECONDLINE];
+ wchar_t lpzText[MAX_SECONDLINE];
int i, available = MAX_SECONDLINE - 1;
if (pdata->pluginOptions->bShowHeaders) {
- _tcsncpy(lpzText, szHeader, MAX_SECONDLINE);
+ wcsncpy(lpzText, szHeader, MAX_SECONDLINE);
available -= (int)mir_tstrlen(szHeader);
}
else lpzText[0] = 0;
@@ -613,21 +613,21 @@ static int PopupShowT(NEN_OPTIONS *pluginOptions, MCONTACT hContact, MEVENT hEve pud.PluginData = pdata;
if (hContact)
- _tcsncpy_s(pud.lptzContactName, pcli->pfnGetContactDisplayName(hContact, 0), _TRUNCATE);
+ wcsncpy_s(pud.lptzContactName, pcli->pfnGetContactDisplayName(hContact, 0), _TRUNCATE);
else
- _tcsncpy_s(pud.lptzContactName, _A2T(dbe.szModule), _TRUNCATE);
+ wcsncpy_s(pud.lptzContactName, _A2T(dbe.szModule), _TRUNCATE);
- TCHAR *szPreview = GetPreviewT((WORD)eventType, &dbe);
+ wchar_t *szPreview = GetPreviewT((WORD)eventType, &dbe);
if (szPreview) {
- _tcsncpy_s(pud.lptzText, szPreview, _TRUNCATE);
+ wcsncpy_s(pud.lptzText, szPreview, _TRUNCATE);
mir_free(szPreview);
}
- else _tcsncpy(pud.lptzText, L" ", MAX_SECONDLINE);
+ else wcsncpy(pud.lptzText, L" ", MAX_SECONDLINE);
pdata->eventData = (EVENT_DATAT *)mir_alloc(NR_MERGED * sizeof(EVENT_DATAT));
pdata->eventData[0].hEvent = hEvent;
pdata->eventData[0].timestamp = dbe.timestamp;
- _tcsncpy(pdata->eventData[0].tszText, pud.lptzText, MAX_SECONDLINE);
+ wcsncpy(pdata->eventData[0].tszText, pud.lptzText, MAX_SECONDLINE);
pdata->eventData[0].tszText[MAX_SECONDLINE - 1] = 0;
pdata->nrEventsAlloced = NR_MERGED;
pdata->nrMerged = 1;
@@ -662,14 +662,14 @@ void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced) mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA | MIIM_BITMAP;
- const TCHAR *tszProto = dat->cache->getRealAccount();
+ const wchar_t *tszProto = dat->cache->getRealAccount();
assert(tszProto != 0);
GetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)dat->hContact, FALSE, &mii);
if (!bForced)
PluginConfig.m_UnreadInTray -= (mii.dwItemData & 0x0000ffff);
if (mii.dwItemData > 0 || bForced) {
- TCHAR szMenuEntry[80];
+ wchar_t szMenuEntry[80];
mir_sntprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszProto,
dat->cache->getNick(), dat->szStatus[0] ? dat->szStatus : L"(undef)", mii.dwItemData & 0x0000ffff);
@@ -684,18 +684,18 @@ void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced) }
// if we want tray support, add the contact to the list of unread sessions in the tray menu
-int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const TCHAR *szStatus, MCONTACT hContact, DWORD fromEvent)
+int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const wchar_t *szStatus, MCONTACT hContact, DWORD fromEvent)
{
if (!PluginConfig.g_hMenuTrayUnread || hContact == 0 || szProto == NULL)
return 0;
PROTOACCOUNT *acc = Proto_GetAccount(szProto);
- TCHAR *tszFinalProto = (acc && acc->tszAccountName ? acc->tszAccountName : 0);
+ wchar_t *tszFinalProto = (acc && acc->tszAccountName ? acc->tszAccountName : 0);
if (tszFinalProto == 0)
return 0;
WORD wMyStatus = (wStatus == 0) ? db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) : wStatus;
- const TCHAR *szMyStatus = (szStatus == NULL) ? pcli->pfnGetStatusModeDescription(wMyStatus, 0) : szStatus;
+ const wchar_t *szMyStatus = (szStatus == NULL) ? pcli->pfnGetStatusModeDescription(wMyStatus, 0) : szStatus;
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -703,8 +703,8 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro mii.wID = (UINT)hContact;
mii.hbmpItem = HBMMENU_CALLBACK;
- TCHAR szMenuEntry[80];
- const TCHAR *szNick = NULL;
+ wchar_t szMenuEntry[80];
+ const wchar_t *szNick = NULL;
if (dat != 0) {
szNick = dat->cache->getNick();
GetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, FALSE, &mii);
diff --git a/plugins/TabSRMM/src/functions.h b/plugins/TabSRMM/src/functions.h index 00ab7a0f2e..de55cf7163 100644 --- a/plugins/TabSRMM/src/functions.h +++ b/plugins/TabSRMM/src/functions.h @@ -50,7 +50,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP int TSAPI NEN_ReadOptions(NEN_OPTIONS *options);
int TSAPI NEN_WriteOptions(NEN_OPTIONS *options);
-int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const TCHAR *szStatus, MCONTACT hContact, DWORD fromEvent);
+int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const wchar_t *szStatus, MCONTACT hContact, DWORD fromEvent);
void TSAPI DeletePopupsForContact(MCONTACT hContact, DWORD dwMask);
/*
@@ -61,7 +61,7 @@ void TSAPI CreateSystrayIcon(int create); void TSAPI FlashTrayIcon(HICON hIcon);
void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced);
void TSAPI LoadFavoritesAndRecent();
-void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, const char *szProto, TCHAR *szStatus,
+void TSAPI AddContactToFavorites(MCONTACT hContact, const wchar_t *szNickname, const char *szProto, wchar_t *szStatus,
WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu);
void TSAPI CreateTrayMenus(int mode);
void TSAPI HandleMenuEntryFromhContact(MCONTACT iSelection);
@@ -76,9 +76,9 @@ int TSAPI ActivateTabFromHWND(HWND hwndTab, HWND hwnd); void TSAPI FlashContainer(TContainerData *pContainer, int iMode, int iNum);
void TSAPI CreateImageList(BOOL bInitial);
-TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName);
-TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, MCONTACT hContactFrom);
-TContainerData* TSAPI FindContainerByName(const TCHAR *name);
+TContainerData* TSAPI FindMatchingContainer(const wchar_t *szName);
+TContainerData* TSAPI CreateContainer(const wchar_t *name, int iTemp, MCONTACT hContactFrom);
+TContainerData* TSAPI FindContainerByName(const wchar_t *name);
int TSAPI GetTabIndexFromHWND(HWND hwndTab, HWND hwnd);
HWND TSAPI GetHWNDFromTabIndex(HWND hwndTab, int idx);
@@ -90,8 +90,8 @@ void TSAPI ReflashContainer(TContainerData *pContainer); void TSAPI CloseAllContainers();
void TSAPI DeleteContainer(int iIndex);
-void TSAPI RenameContainer(int iIndex, const TCHAR *newName);
-int TSAPI GetContainerNameForContact(MCONTACT hContact, TCHAR *szName, int iNameLen);
+void TSAPI RenameContainer(int iIndex, const wchar_t *newName);
+int TSAPI GetContainerNameForContact(MCONTACT hContact, wchar_t *szName, int iNameLen);
HMENU TSAPI BuildContainerMenu();
void TSAPI PreTranslateDates();
void TSAPI ApplyContainerSetting(TContainerData *pContainer, DWORD flags, UINT mode, bool fForceResize);
@@ -142,15 +142,15 @@ int TSAPI UnloadTSButtonModule(); #if defined(__LOGDEBUG_)
int _DebugTraceW(const wchar_t *fmt, ...);
#endif
-int _DebugPopup(MCONTACT hContact, const TCHAR *fmt, ...);
+int _DebugPopup(MCONTACT hContact, const wchar_t *fmt, ...);
int _DebugMessage(HWND hwndDlg, TWindowData *dat, const char *fmt, ...);
// themes
-const TCHAR* TSAPI GetThemeFileName(int iMode);
-int TSAPI CheckThemeVersion(const TCHAR *szIniFilename);
-void TSAPI WriteThemeToINI(const TCHAR *szIniFilename, TWindowData *dat);
-void TSAPI ReadThemeFromINI(const TCHAR *szIniFilename, TContainerData *dat, int noAdvanced, DWORD dwFlags);
+const wchar_t* TSAPI GetThemeFileName(int iMode);
+int TSAPI CheckThemeVersion(const wchar_t *szIniFilename);
+void TSAPI WriteThemeToINI(const wchar_t *szIniFilename, TWindowData *dat);
+void TSAPI ReadThemeFromINI(const wchar_t *szIniFilename, TContainerData *dat, int noAdvanced, DWORD dwFlags);
// user prefs
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 5f63d6c7e5..03317d8d5b 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -43,13 +43,13 @@ void TSAPI DM_SaveLogAsRTF(const TWindowData *dat) CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event); } else if (dat) { - TCHAR szFilter[MAX_PATH], szFilename[MAX_PATH]; + wchar_t szFilter[MAX_PATH], szFilename[MAX_PATH]; mir_sntprintf(szFilter, L"%s%c*.rtf%c%c", TranslateT("Rich Edit file"), 0, 0, 0); mir_sntprintf(szFilename, L"%s.rtf", dat->cache->getNick()); Utils::sanitizeFilename(szFilename); - TCHAR szInitialDir[MAX_PATH + 2]; + wchar_t szInitialDir[MAX_PATH + 2]; mir_sntprintf(szInitialDir, L"%s%s\\", M.getDataPath(), L"\\Saved message logs"); CreateDirectoryTreeT(szInitialDir); @@ -535,7 +535,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, else { int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE)); - TCHAR *buf = (TCHAR*)mir_alloc((iLen + 2) * sizeof(TCHAR)); + wchar_t *buf = (wchar_t*)mir_alloc((iLen + 2) * sizeof(wchar_t)); GetDlgItemText(hwndDlg, IDC_MESSAGE, buf, iLen + 1); db_set_ts(dat->hContact, "UserInfo", "MyNotes", buf); SetDlgItemText(hwndDlg, IDC_MESSAGE, L""); @@ -612,7 +612,7 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR WORD v[4]; CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)&v); - TCHAR tStr[80]; + wchar_t tStr[80]; mir_sntprintf(tStr, L"%s %d.%d.%d.%d [build %d]", TranslateT("Version"), __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM, v[3]); SetDlgItemText(hwndDlg, IDC_HEADERBAR, tStr); @@ -1000,9 +1000,9 @@ void TSAPI DM_LoadLocale(TWindowData *dat) if (!db_get_ts(dat->hContact, SRMSGMOD_T, "locale", &dbv)) db_free(&dbv); else { - TCHAR szKLName[KL_NAMELENGTH + 1]; + wchar_t szKLName[KL_NAMELENGTH + 1]; if (!PluginConfig.m_bDontUseDefaultKbd) { - TCHAR szBuf[20]; + wchar_t szBuf[20]; GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, szBuf, 20); mir_sntprintf(szKLName, L"0000%s", szBuf); db_set_ts(dat->hContact, SRMSGMOD_T, "locale", szKLName); @@ -1039,7 +1039,7 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat) if (dat->pContainer->hwndStatus == 0 || dat->pContainer->hwndActive != dat->hwnd) return; - TCHAR szBuf[100]; + wchar_t szBuf[100]; if (dat->bShowTyping) { SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, (LPARAM)PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]); mir_sntprintf(szBuf, TranslateT("%s is typing a message..."), dat->cache->getNick()); @@ -1055,7 +1055,7 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat) if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR) mir_sntprintf(szBuf, L"UID: %s", dat->cache->getUIN()); else if (dat->lastMessage) { - TCHAR date[64], time[64]; + wchar_t date[64], time[64]; TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"d", date, _countof(date), 0); if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR && mir_tstrlen(date) > 6) date[mir_tstrlen(date) - 5] = 0; @@ -1077,7 +1077,7 @@ void TSAPI DM_SaveLocale(TWindowData *dat, WPARAM, LPARAM lParam) return; if (PluginConfig.m_bAutoLocaleSupport && dat->hContact && dat->pContainer->hwndActive == dat->hwnd) { - TCHAR szKLName[KL_NAMELENGTH + 1]; + wchar_t szKLName[KL_NAMELENGTH + 1]; if ((HKL)lParam != dat->hkl) { dat->hkl = (HKL)lParam; ActivateKeyboardLayout(dat->hkl, 0); @@ -1591,7 +1591,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam) } dat->hQueuedEvents[dat->iNextQueuedEvent++] = hDbEvent; - TCHAR szBuf[100]; + wchar_t szBuf[100]; mir_sntprintf(szBuf, TranslateT("Auto scrolling is disabled, %d message(s) queued (press F12 to enable it)"), dat->iNextQueuedEvent); SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, szBuf); @@ -1704,7 +1704,7 @@ void TSAPI DM_HandleAutoSizeRequest(TWindowData *dat, REQRESIZE* rr) void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) { - TCHAR newtitle[128], newcontactname[128]; + wchar_t newtitle[128], newcontactname[128]; DWORD dwOldIdle = dat->idle; const char *szActProto = 0; @@ -1722,7 +1722,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) TCITEM item = { 0 }; if (dat->hContact) { - const TCHAR *szNick = dat->cache->getNick(); + const wchar_t *szNick = dat->cache->getNick(); if (dat->szProto) { szActProto = dat->cache->getProto(); @@ -1732,13 +1732,13 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) dat->dwFlagsEx = dat->idle ? dat->dwFlagsEx | MWF_SHOW_ISIDLE : dat->dwFlagsEx & ~MWF_SHOW_ISIDLE; dat->wStatus = dat->cache->getStatus(); - _tcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, 0), _TRUNCATE); + wcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, 0), _TRUNCATE); if (lParam != 0) { if (PluginConfig.m_bCutContactNameOnTabs) CutContactName(szNick, newcontactname, _countof(newcontactname)); else - _tcsncpy_s(newcontactname, szNick, _TRUNCATE); + wcsncpy_s(newcontactname, szNick, _TRUNCATE); Utils::DoubleAmpersands(newcontactname, _countof(newcontactname)); @@ -1746,15 +1746,15 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) if (PluginConfig.m_bStatusOnTabs) mir_sntprintf(newtitle, L"%s (%s)", newcontactname, dat->szStatus); else - _tcsncpy_s(newtitle, newcontactname, _TRUNCATE); + wcsncpy_s(newtitle, newcontactname, _TRUNCATE); } - else _tcsncpy_s(newtitle, L"Forward", _TRUNCATE); + else wcsncpy_s(newtitle, L"Forward", _TRUNCATE); item.mask |= TCIF_TEXT; } SendMessage(hwndDlg, DM_UPDATEWINICON, 0, 0); - TCHAR fulluin[256]; + wchar_t fulluin[256]; if (dat->bIsMeta) mir_sntprintf(fulluin, TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nRight click for metacontact control\nClick dropdown to add or remove user from your favorites."), @@ -1767,12 +1767,12 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) SendDlgItemMessage(hwndDlg, IDC_NAME, BUTTONADDTOOLTIP, (WPARAM)fulluin, BATF_TCHAR); } } - else _tcsncpy_s(newtitle, L"Message Session", _TRUNCATE); + else wcsncpy_s(newtitle, L"Message Session", _TRUNCATE); if (dat->idle != dwOldIdle || lParam != 0) { if (item.mask & TCIF_TEXT) { item.pszText = newtitle; - _tcsncpy(dat->newtitle, newtitle, _countof(dat->newtitle)); + wcsncpy(dat->newtitle, newtitle, _countof(dat->newtitle)); dat->newtitle[127] = 0; if (dat->pWnd) dat->pWnd->updateTitle(dat->cache->getNick()); diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 688a365f04..9bb015b8bf 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -37,7 +37,7 @@ CGlobals PluginConfig; static TContainerSettings _cnt_default = { false, CNT_FLAGS_DEFAULT, CNT_FLAGSEX_DEFAULT, 255, CInfoPanel::DEGRADE_THRESHOLD, 60, L"%n (%s)", 1, 0 };
-TCHAR* CGlobals::m_default_container_name = L"default";
+wchar_t* CGlobals::m_default_container_name = L"default";
extern HANDLE hHookButtonPressedEvt;
extern HANDLE hHookToolBarLoadedEvt;
@@ -558,7 +558,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) }
}
- TCHAR toolTip[256];
+ wchar_t toolTip[256];
CLISTEVENT cle = {};
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
@@ -597,8 +597,8 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c) if (wStatus == wOldStatus)
return;
- TCHAR *szOldStatus = pcli->pfnGetStatusModeDescription(wOldStatus, 0);
- TCHAR *szNewStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
+ wchar_t *szOldStatus = pcli->pfnGetStatusModeDescription(wOldStatus, 0);
+ wchar_t *szNewStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
if (szOldStatus == 0 || szNewStatus == 0)
return;
diff --git a/plugins/TabSRMM/src/globals.h b/plugins/TabSRMM/src/globals.h index d258f91259..3cc0a9b484 100644 --- a/plugins/TabSRMM/src/globals.h +++ b/plugins/TabSRMM/src/globals.h @@ -148,7 +148,7 @@ public: TSplitterBroadCast lastSPlitterPos;
TContainerSettings globalContainerSettings;
- static TCHAR* m_default_container_name;
+ static wchar_t* m_default_container_name;
static void logStatusChange(WPARAM wParam, const CContactCache *c);
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index 8d92bde883..00b3abf2fe 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -28,7 +28,7 @@ #include "stdafx.h"
-TCHAR *xStatusDescr[] =
+wchar_t *xStatusDescr[] =
{
L"Angry", L"Duck", L"Tired", L"Party", L"Beer", L"Thinking", L"Eating",
L"TV", L"Friends", L"Coffee", L"Music", L"Business", L"Camera", L"Funny",
@@ -383,8 +383,8 @@ void CInfoPanel::renderContent(const HDC hdc) void CInfoPanel::RenderIPNickname(const HDC hdc, RECT &rcItem)
{
- const TCHAR *szStatusMsg = NULL;
- const TCHAR *szTextToShow = 0;
+ const wchar_t *szStatusMsg = NULL;
+ const wchar_t *szTextToShow = 0;
bool fShowUin = false;
COLORREF clr = 0;
@@ -488,9 +488,9 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) else
hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
- const TCHAR *tszUin = m_dat->cache->getUIN();
+ const wchar_t *tszUin = m_dat->cache->getUIN();
if (tszUin[0]) {
- TCHAR szBuf[256];
+ wchar_t szBuf[256];
if (m_dat->idle) {
time_t diff = time(NULL) - m_dat->idle;
@@ -498,16 +498,16 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) int i_mins = (diff - i_hrs * 3600) / 60;
mir_sntprintf(szBuf, TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins);
}
- else _tcscpy_s(szBuf, 256, tszUin);
+ else wcscpy_s(szBuf, 256, tszUin);
if (M.GetByte("ShowClientDescription", 1)) {
- TCHAR temp[256];
+ wchar_t temp[256];
ptrT szVersion(db_get_tsa(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer"));
if (szVersion)
mir_sntprintf(temp, TranslateT(" Client: %s"), szVersion);
else
mir_sntprintf(temp, TranslateT(" Client not cached yet"));
- _tcscat_s(szBuf, 256, temp);
+ wcscat_s(szBuf, 256, temp);
}
SIZE sUIN;
@@ -535,13 +535,13 @@ void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem) GetTextExtentPoint32(hdc, m_dat->szStatus, (int)mir_tstrlen(m_dat->szStatus), &sStatus);
// figure out final account name
- const TCHAR *szFinalProto = m_dat->cache->getRealAccount();
+ const wchar_t *szFinalProto = m_dat->cache->getRealAccount();
if (szFinalProto) {
SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_PROTO]);
GetTextExtentPoint32(hdc, szFinalProto, (int)mir_tstrlen(szFinalProto), &sProto);
}
- TCHAR szResult[80]; szResult[0] = 0;
+ wchar_t szResult[80]; szResult[0] = 0;
if (m_dat->hTimeZone) {
TimeZone_PrintDateTime(m_dat->hTimeZone, L"t", szResult, _countof(szResult), 0);
GetTextExtentPoint32(hdc, szResult, (int)mir_tstrlen(szResult), &sTime);
@@ -612,7 +612,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) HFONT hOldFont;
if (m_height < DEGRADE_THRESHOLD) {
- TCHAR tszText[2048];
+ wchar_t tszText[2048];
mir_sntprintf(tszText, TranslateT("Topic is: %s"),
si->ptszTopic ? si->ptszTopic : TranslateT("no topic set."));
@@ -621,7 +621,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) CSkin::m_glowSize, m_ipConfig.clrs[IPFONTID_UIN]);
}
else {
- const TCHAR *tszNick = m_dat->cache->getNick();
+ const wchar_t *tszNick = m_dat->cache->getNick();
hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_NICK]));
::GetTextExtentPoint32(hdc, tszNick, (int)mir_tstrlen(tszNick), &m_szNick);
@@ -640,7 +640,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) ::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_STATUS]);
if (si->ptszStatusbarText) {
- TCHAR *pTmp = _tcschr(si->ptszStatusbarText, ']');
+ wchar_t *pTmp = wcschr(si->ptszStatusbarText, ']');
pTmp += 2;
if (si->ptszStatusbarText[0] == '[' && pTmp > si->ptszStatusbarText) {
@@ -669,7 +669,7 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem) COLORREF clr = m_ipConfig.clrs[IPFONTID_UIN];
SIZE szTitle;
- TCHAR szPrefix[100];
+ wchar_t szPrefix[100];
mir_sntprintf(szPrefix, TranslateT("Topic is: %s"), L"");
::GetTextExtentPoint32(hdc, szPrefix, (int)mir_tstrlen(szPrefix), &szTitle);
mapRealRect(rcItem, m_rcUIN, szTitle);
@@ -865,7 +865,7 @@ void CInfoPanel::trackMouse(POINT &pt) /////////////////////////////////////////////////////////////////////////////////////////
// activate a tooltip
// @param ctrlId : control id
-// @param lParam : typically a TCHAR * for the tooltip text
+// @param lParam : typically a wchar_t * for the tooltip text
void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam)
{
@@ -879,7 +879,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) ::SendMessage(m_dat->hwndTip, TTM_TRACKPOSITION, 0, (LPARAM)MAKELONG(rc.left, rc.bottom));
}
if (lParam)
- m_dat->ti.lpszText = reinterpret_cast<TCHAR *>(lParam);
+ m_dat->ti.lpszText = reinterpret_cast<wchar_t *>(lParam);
else {
if (m_hwndConfig)
return;
@@ -891,7 +891,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) DBVARIANT dbv = { 0 };
if (BYTE xStatus = m_dat->cache->getXStatusId()) {
- TCHAR *tszXStatusName = 0;
+ wchar_t *tszXStatusName = 0;
if (0 == db_get_ts(m_dat->cache->getContact(), m_dat->cache->getProto(), "XStatusName", &dbv))
tszXStatusName = dbv.ptszVal;
else if (xStatus > 0 && xStatus <= 31)
@@ -1060,7 +1060,7 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L switch (msg) {
case WM_INITDIALOG:
{
- TCHAR tszTitle[100];
+ wchar_t tszTitle[100];
mir_sntprintf(tszTitle, TranslateT("Set panel visibility for this %s"),
m_isChat ? TranslateT("chat room") : TranslateT("contact"));
::SetDlgItemText(hwnd, IDC_STATIC_VISIBILTY, tszTitle);
@@ -1306,10 +1306,10 @@ void CInfoPanel::dismissConfig(bool fForced) //
// @param hwndParent HWND owner (used only for position calculation)
// @param hContact HANDLE contact handle
-// @param pszText TCHAR* the content of the rich edit control
+// @param pszText wchar_t* the content of the rich edit control
// @param panel CInfoPanel* the panel which owns it
-CTip::CTip(const HWND hwndParent, const MCONTACT hContact, const TCHAR *pszText, const CInfoPanel* panel)
+CTip::CTip(const HWND hwndParent, const MCONTACT hContact, const wchar_t *pszText, const CInfoPanel* panel)
{
m_hwnd = ::CreateWindowEx(WS_EX_TOOLWINDOW, L"RichEditTipClass", L"", (M.isAero() ? WS_THICKFRAME : WS_BORDER) | WS_POPUPWINDOW | WS_TABSTOP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
0, 0, 40, 40, 0, 0, g_hInst, this);
@@ -1339,7 +1339,7 @@ CTip::CTip(const HWND hwndParent, const MCONTACT hContact, const TCHAR *pszText, // @param hIcon optional icon to display in the tip header
// @param szTitle optional title to display in the tip header
-void CTip::show(const RECT& rc, POINT& pt, const HICON hIcon, const TCHAR *szTitle)
+void CTip::show(const RECT& rc, POINT& pt, const HICON hIcon, const wchar_t *szTitle)
{
HDC hdc = ::GetDC(m_hwnd);
@@ -1492,7 +1492,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam break;
case WM_ERASEBKGND:
- TCHAR szTitle[128];
+ wchar_t szTitle[128];
{
HDC hdc = (HDC)wParam;
COLORREF clr = CInfoPanel::m_ipConfig.clrs[IPFONTID_NICK];
diff --git a/plugins/TabSRMM/src/infopanel.h b/plugins/TabSRMM/src/infopanel.h index 7cf319ac94..aadb0d1f84 100644 --- a/plugins/TabSRMM/src/infopanel.h +++ b/plugins/TabSRMM/src/infopanel.h @@ -52,7 +52,7 @@ struct TInfoPanelConfig { UINT height1, height2;
};
-extern TCHAR *xStatusDescr[];
+extern wchar_t *xStatusDescr[];
/**
* a simple tooltip class using a richedit control to display its content. Allows
@@ -71,12 +71,12 @@ public: LEFT_BAR_WIDTH = 20
};
- CTip(const HWND hwndParent, const MCONTACT hContact, const TCHAR *pszText = 0, const CInfoPanel *panel = 0);
+ CTip(const HWND hwndParent, const MCONTACT hContact, const wchar_t *pszText = 0, const CInfoPanel *panel = 0);
~CTip()
{
mir_free(m_pszText);
}
- void show(const RECT& rc, POINT& pt, const HICON hIcon = 0, const TCHAR *szTitle = 0);
+ void show(const RECT& rc, POINT& pt, const HICON hIcon = 0, const wchar_t *szTitle = 0);
const HWND getHwnd() const { return(m_hwnd); }
static void registerClass();
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index 193be84d7b..d79da9851b 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -47,7 +47,7 @@ DURT CMimAPI::m_pfnDwmUnregisterThumbnail = 0; DSIT CMimAPI::m_pfnDwmSetIconicThumbnail = 0; DSILP CMimAPI::m_pfnDwmSetIconicLivePreviewBitmap = 0; bool CMimAPI::m_shutDown = 0; -TCHAR CMimAPI::m_userDir[] = L"\0"; +wchar_t CMimAPI::m_userDir[] = L"\0"; bool CMimAPI::m_haveBufferedPaint = false; @@ -88,10 +88,10 @@ int CMimAPI::FoldersPathChanged(WPARAM, LPARAM) void CMimAPI::configureCustomFolders() { - m_hDataPath = FoldersRegisterCustomPathT(LPGEN("TabSRMM"), LPGEN("Data path"), const_cast<TCHAR *>(getDataPath())); - m_hSkinsPath = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("TabSRMM"), const_cast<TCHAR *>(getSkinPath())); - m_hAvatarsPath = FoldersRegisterCustomPathT(LPGEN("Avatars"), LPGEN("Saved TabSRMM avatars"), const_cast<TCHAR *>(getSavedAvatarPath())); - m_hChatLogsPath = FoldersRegisterCustomPathT(LPGEN("TabSRMM"), LPGEN("Group chat logs root"), const_cast<TCHAR *>(getChatLogPath())); + m_hDataPath = FoldersRegisterCustomPathT(LPGEN("TabSRMM"), LPGEN("Data path"), const_cast<wchar_t *>(getDataPath())); + m_hSkinsPath = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("TabSRMM"), const_cast<wchar_t *>(getSkinPath())); + m_hAvatarsPath = FoldersRegisterCustomPathT(LPGEN("Avatars"), LPGEN("Saved TabSRMM avatars"), const_cast<wchar_t *>(getSavedAvatarPath())); + m_hChatLogsPath = FoldersRegisterCustomPathT(LPGEN("TabSRMM"), LPGEN("Group chat logs root"), const_cast<wchar_t *>(getChatLogPath())); if (m_hDataPath) HookEvent(ME_FOLDERS_PATH_CHANGED, CMimAPI::FoldersPathChanged); @@ -101,25 +101,25 @@ void CMimAPI::configureCustomFolders() INT_PTR CMimAPI::foldersPathChanged() { - TCHAR szTemp[MAX_PATH + 2]; + wchar_t szTemp[MAX_PATH + 2]; if (m_hDataPath) { szTemp[0] = 0; - FoldersGetCustomPathT(m_hDataPath, szTemp, MAX_PATH, const_cast<TCHAR *>(getDataPath())); - _tcsncpy_s(m_szProfilePath, szTemp, _TRUNCATE); + FoldersGetCustomPathT(m_hDataPath, szTemp, MAX_PATH, const_cast<wchar_t *>(getDataPath())); + wcsncpy_s(m_szProfilePath, szTemp, _TRUNCATE); szTemp[0] = 0; - FoldersGetCustomPathT(m_hSkinsPath, szTemp, MAX_PATH, const_cast<TCHAR *>(getSkinPath())); - _tcsncpy_s(m_szSkinsPath, (MAX_PATH - 1), szTemp, _TRUNCATE); + FoldersGetCustomPathT(m_hSkinsPath, szTemp, MAX_PATH, const_cast<wchar_t *>(getSkinPath())); + wcsncpy_s(m_szSkinsPath, (MAX_PATH - 1), szTemp, _TRUNCATE); Utils::ensureTralingBackslash(m_szSkinsPath); szTemp[0] = 0; - FoldersGetCustomPathT(m_hAvatarsPath, szTemp, MAX_PATH, const_cast<TCHAR *>(getSavedAvatarPath())); - _tcsncpy_s(m_szSavedAvatarsPath, szTemp, _TRUNCATE); + FoldersGetCustomPathT(m_hAvatarsPath, szTemp, MAX_PATH, const_cast<wchar_t *>(getSavedAvatarPath())); + wcsncpy_s(m_szSavedAvatarsPath, szTemp, _TRUNCATE); szTemp[0] = 0; - FoldersGetCustomPathT(m_hChatLogsPath, szTemp, MAX_PATH, const_cast<TCHAR *>(getChatLogPath())); - _tcsncpy_s(m_szChatLogsPath, (MAX_PATH - 1), szTemp, _TRUNCATE); + FoldersGetCustomPathT(m_hChatLogsPath, szTemp, MAX_PATH, const_cast<wchar_t *>(getChatLogPath())); + wcsncpy_s(m_szChatLogsPath, (MAX_PATH - 1), szTemp, _TRUNCATE); Utils::ensureTralingBackslash(m_szChatLogsPath); } @@ -132,13 +132,13 @@ INT_PTR CMimAPI::foldersPathChanged() return 0; } -const TCHAR* CMimAPI::getUserDir() +const wchar_t* CMimAPI::getUserDir() { if (m_userDir[0] == 0) { if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) - _tcsncpy_s(m_userDir, L"%miranda_userdata%", _TRUNCATE); + wcsncpy_s(m_userDir, L"%miranda_userdata%", _TRUNCATE); else - _tcsncpy_s(m_userDir, VARST(L"%miranda_userdata%"), _TRUNCATE); + wcsncpy_s(m_userDir, VARST(L"%miranda_userdata%"), _TRUNCATE); Utils::ensureTralingBackslash(m_userDir); } @@ -147,16 +147,16 @@ const TCHAR* CMimAPI::getUserDir() void CMimAPI::InitPaths() { - const TCHAR *szUserdataDir = getUserDir(); + const wchar_t *szUserdataDir = getUserDir(); mir_sntprintf(m_szProfilePath, L"%stabSRMM", szUserdataDir); if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) { - _tcsncpy_s(m_szChatLogsPath, L"%miranda_logpath%", _TRUNCATE); - _tcsncpy_s(m_szSkinsPath, L"%miranda_path%\\Skins\\TabSRMM", _TRUNCATE); + wcsncpy_s(m_szChatLogsPath, L"%miranda_logpath%", _TRUNCATE); + wcsncpy_s(m_szSkinsPath, L"%miranda_path%\\Skins\\TabSRMM", _TRUNCATE); } else { - _tcsncpy_s(m_szChatLogsPath, VARST(L"%miranda_logpath%"), _TRUNCATE); - _tcsncpy_s(m_szSkinsPath, VARST(L"%miranda_path%\\Skins\\TabSRMM"), _TRUNCATE); + wcsncpy_s(m_szChatLogsPath, VARST(L"%miranda_logpath%"), _TRUNCATE); + wcsncpy_s(m_szSkinsPath, VARST(L"%miranda_path%\\Skins\\TabSRMM"), _TRUNCATE); } Utils::ensureTralingBackslash(m_szChatLogsPath); @@ -298,7 +298,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) } if (mode) { - TCHAR szTip[256]; + wchar_t szTip[256]; mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0)); if (fShowOnClist && ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && M.GetByte(SRMSGMOD, "ShowTypingBalloon", 0)) { MIRANDASYSTRAYNOTIFY tn; @@ -320,7 +320,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) cle.hIcon = PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]; cle.pszService = "SRMsg/TypingMessage"; cle.ptszTooltip = szTip; - pcli->pfnAddEvent(&cle);
+ pcli->pfnAddEvent(&cle); } } return 0; @@ -411,7 +411,7 @@ int CMimAPI::DispatchNewEvent(WPARAM hContact, LPARAM hDbEvent) int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent) { - TCHAR szName[CONTAINER_NAMELEN + 1]; + wchar_t szName[CONTAINER_NAMELEN + 1]; DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hDbEvent, &dbei); @@ -542,7 +542,7 @@ nowindowcreate: if (!(dbei.flags & DBEF_READ)) { UpdateTrayMenu(0, 0, dbei.szModule, NULL, hContact, 1); if (!nen_options.bTraySupport) { - TCHAR toolTip[256], *contactName; + wchar_t toolTip[256], *contactName; CLISTEVENT cle = {}; cle.hContact = hContact; @@ -553,7 +553,7 @@ nowindowcreate: contactName = pcli->pfnGetContactDisplayName(hContact, 0); mir_sntprintf(toolTip, TranslateT("Message from %s"), contactName); cle.ptszTooltip = toolTip; - pcli->pfnAddEvent(&cle);
+ pcli->pfnAddEvent(&cle); } tabSRMM_ShowPopup(hContact, hDbEvent, dbei.eventType, 0, 0, 0, dbei.szModule); } diff --git a/plugins/TabSRMM/src/mim.h b/plugins/TabSRMM/src/mim.h index c70aa767f6..8322326611 100644 --- a/plugins/TabSRMM/src/mim.h +++ b/plugins/TabSRMM/src/mim.h @@ -216,7 +216,7 @@ public: static bool m_shutDown, m_haveBufferedPaint;
private:
- TCHAR m_szProfilePath[MAX_PATH + 2], m_szSkinsPath[MAX_PATH + 2], m_szSavedAvatarsPath[MAX_PATH + 2], m_szChatLogsPath[MAX_PATH + 2];
+ wchar_t m_szProfilePath[MAX_PATH + 2], m_szSkinsPath[MAX_PATH + 2], m_szSavedAvatarsPath[MAX_PATH + 2], m_szChatLogsPath[MAX_PATH + 2];
HMODULE m_hUxTheme, m_hDwmApi;
bool m_isAero, m_DwmActive, m_isVsThemed;
HANDLE m_hDataPath, m_hSkinsPath, m_hAvatarsPath, m_hChatLogsPath;
@@ -231,7 +231,7 @@ private: void InitPaths();
private:
- static TCHAR m_userDir[MAX_PATH + 2];
+ static wchar_t m_userDir[MAX_PATH + 2];
};
extern CMimAPI M;
diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp index 907f802484..1fc829c606 100644 --- a/plugins/TabSRMM/src/modplus.cpp +++ b/plugins/TabSRMM/src/modplus.cpp @@ -40,7 +40,7 @@ #include "stdafx.h"
-static TCHAR* getMenuEntry(int i)
+static wchar_t* getMenuEntry(int i)
{
char MEntry[256];
mir_snprintf(MEntry, "MenuEntry_%u", i);
@@ -59,7 +59,7 @@ static int RegisterCustomButton(WPARAM, LPARAM) bbd.dwDefPos = 200;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[3];
bbd.pszModuleName = "Tabmodplus";
- bbd.ptszTooltip = LPGENT("Insert [img] tag / surround selected text with [img][/img]");
+ bbd.ptszTooltip = LPGENW("Insert [img] tag / surround selected text with [img][/img]");
return CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
}
@@ -74,14 +74,14 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) bbd.pszModuleName = "Tabmodplus";
CallService(MS_BB_GETBUTTONSTATE, wParam, (LPARAM)&bbd);
- TCHAR *pszText = L"";
+ wchar_t *pszText = L"";
CHARRANGE cr;
cr.cpMin = cr.cpMax = 0;
SendDlgItemMessage(cbcd->hwndFrom, IDC_MESSAGE, EM_EXGETSEL, 0, (LPARAM)&cr);
UINT textlenght = cr.cpMax - cr.cpMin;
if (textlenght) {
- pszText = (TCHAR*)mir_alloc((textlenght + 1)*sizeof(TCHAR));
- memset(pszText, 0, ((textlenght + 1) * sizeof(TCHAR)));
+ pszText = (wchar_t*)mir_alloc((textlenght + 1)*sizeof(wchar_t));
+ memset(pszText, 0, ((textlenght + 1) * sizeof(wchar_t)));
SendDlgItemMessage(cbcd->hwndFrom, IDC_MESSAGE, EM_GETSELTEXT, 0, (LPARAM)pszText);
}
@@ -95,7 +95,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) else
state = 4;
- TCHAR *pszFormatedText = NULL, *pszMenu[256] = { 0 };
+ wchar_t *pszFormatedText = NULL, *pszMenu[256] = { 0 };
size_t bufSize;
@@ -118,7 +118,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) break;
bufSize = textlenght + mir_tstrlen(pszMenu[res - 1]) + 2;
- pszFormatedText = (TCHAR*)_alloca(bufSize*sizeof(TCHAR));
+ pszFormatedText = (wchar_t*)_alloca(bufSize*sizeof(wchar_t));
mir_sntprintf(pszFormatedText, bufSize, pszMenu[res - 1], pszText);
}
break;
@@ -127,7 +127,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) SendDlgItemMessage(cbcd->hwndFrom, IDC_MESSAGE, EM_GETSELTEXT, 0, (LPARAM)pszText);
bufSize = textlenght + 12;
- pszFormatedText = (TCHAR*)_alloca(bufSize*sizeof(TCHAR));
+ pszFormatedText = (wchar_t*)_alloca(bufSize*sizeof(wchar_t));
mir_sntprintf(pszFormatedText, bufSize, L"[img]%s[/img]", pszText);
bbd.ptszTooltip = 0;
@@ -139,14 +139,14 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) case 3:
pszFormatedText = L"[img]";
- bbd.ptszTooltip = LPGENT("Insert [img] tag / surround selected text with [img][/img]");
+ bbd.ptszTooltip = LPGENW("Insert [img] tag / surround selected text with [img][/img]");
CallService(MS_BB_SETBUTTONSTATE, wParam, (LPARAM)&bbd);
break;
case 4:
pszFormatedText = L"[/img]";
- bbd.ptszTooltip = LPGENT("Insert [img] tag / surround selected text with [img][/img]");
+ bbd.ptszTooltip = LPGENW("Insert [img] tag / surround selected text with [img][/img]");
CallService(MS_BB_SETBUTTONSTATE, wParam, (LPARAM)&bbd);
break;
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 83be1cc69e..529dac6ce1 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -30,9 +30,9 @@ #define MS_HTTPSERVER_ADDFILENAME "HTTPServer/AddFileName"
-bool IsStringValidLink(TCHAR* pszText);
+bool IsStringValidLink(wchar_t* pszText);
-const TCHAR *pszIDCSAVE_close = 0, *pszIDCSAVE_save = 0;
+const wchar_t *pszIDCSAVE_close = 0, *pszIDCSAVE_save = 0;
static const UINT sendControls[] = { IDC_MESSAGE, IDC_LOG };
static const UINT formatControls[] = { IDC_SMILEYBTN, IDC_FONTBOLD, IDC_FONTITALIC, IDC_FONTUNDERLINE, IDC_FONTFACE, IDC_FONTSTRIKEOUT };
@@ -45,13 +45,13 @@ static COLORREF rtfDefColors[] = { RGB(255, 0, 0), RGB(0, 0, 255), RGB(0, 255, 0 static struct
{
int id;
- const TCHAR* text;
+ const wchar_t* text;
}
tooltips[] =
{
- { IDC_ADD, LPGENT("Add this contact permanently to your contact list") },
- { IDC_CANCELADD, LPGENT("Do not add this contact permanently") },
- { IDC_TOGGLESIDEBAR, LPGENT("Expand or collapse the side bar") }
+ { IDC_ADD, LPGENW("Add this contact permanently to your contact list") },
+ { IDC_CANCELADD, LPGENW("Do not add this contact permanently") },
+ { IDC_TOGGLESIDEBAR, LPGENW("Expand or collapse the side bar") }
};
static struct
@@ -587,7 +587,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar HANDLE hClip = GetClipboardData(CF_TEXT);
if (hClip) {
if ((int)mir_strlen((char*)hClip) > mwdat->nMax) {
- TCHAR szBuffer[512];
+ wchar_t szBuffer[512];
if (M.GetByte("autosplit", 0))
mir_sntprintf(szBuffer, TranslateT("WARNING: The message you are trying to paste exceeds the message size limit for the active protocol. It will be sent in chunks of max %d characters"), mwdat->nMax - 10);
else
@@ -1189,7 +1189,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (dat->hContact && dat->szProto != NULL) {
dat->wStatus = db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE);
- _tcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, 0), _TRUNCATE);
+ wcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, 0), _TRUNCATE);
}
else dat->wStatus = ID_STATUS_OFFLINE;
@@ -1353,7 +1353,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l }
if (newData->szInitialText) {
if (newData->isWchar)
- SetDlgItemTextW(hwndDlg, IDC_MESSAGE, (TCHAR*)newData->szInitialText);
+ SetDlgItemTextW(hwndDlg, IDC_MESSAGE, (wchar_t*)newData->szInitialText);
else
SetDlgItemTextA(hwndDlg, IDC_MESSAGE, newData->szInitialText);
int len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE));
@@ -2706,7 +2706,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l MEVENT hDBEvent = 0;
if (dat->hwndIEView || dat->hwndHPP) { // IEView quoting support..
- TCHAR *selected = 0;
+ wchar_t *selected = 0;
IEVIEWEVENT event = { sizeof(event) };
event.hContact = dat->hContact;
@@ -2715,11 +2715,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (dat->hwndIEView) {
event.hwnd = dat->hwndIEView;
- selected = (TCHAR*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event);
+ selected = (wchar_t*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event);
}
else {
event.hwnd = dat->hwndHPP;
- selected = (TCHAR*)CallService(MS_HPP_EG_EVENT, 0, (LPARAM)&event);
+ selected = (wchar_t*)CallService(MS_HPP_EG_EVENT, 0, (LPARAM)&event);
}
if (selected != NULL) {
@@ -2742,22 +2742,22 @@ quote_from_last: if (sel.cpMin == sel.cpMax) {
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.cbBlob = db_event_getBlobSize(hDBEvent);
- TCHAR *szText = (TCHAR*)mir_alloc((dbei.cbBlob + 1) * sizeof(TCHAR)); //URLs are made one char bigger for crlf
+ wchar_t *szText = (wchar_t*)mir_alloc((dbei.cbBlob + 1) * sizeof(wchar_t)); //URLs are made one char bigger for crlf
dbei.pBlob = (BYTE*)szText;
db_event_get(hDBEvent, &dbei);
int iSize = int(mir_strlen((char*)dbei.pBlob)) + 1;
bool bNeedsFree = false;
- TCHAR *szConverted;
+ wchar_t *szConverted;
if (dbei.flags & DBEF_UTF) {
szConverted = mir_utf8decodeW((char*)szText);
bNeedsFree = true;
}
else {
if (iSize != (int)dbei.cbBlob)
- szConverted = (TCHAR*)&dbei.pBlob[iSize];
+ szConverted = (wchar_t*)&dbei.pBlob[iSize];
else {
- szConverted = (TCHAR*)mir_alloc(sizeof(TCHAR) * iSize);
+ szConverted = (wchar_t*)mir_alloc(sizeof(wchar_t) * iSize);
bNeedsFree = true;
MultiByteToWideChar(CP_ACP, 0, (char*)dbei.pBlob, -1, szConverted, iSize);
}
@@ -2768,7 +2768,7 @@ quote_from_last: memmove(szText + iDescr + 2, szText + sizeof(DWORD) + iDescr, dbei.cbBlob - iDescr - sizeof(DWORD)-1);
szText[iDescr] = '\r';
szText[iDescr + 1] = '\n';
- szConverted = (TCHAR*)mir_alloc(sizeof(TCHAR)* (1 + mir_strlen((char *)szText)));
+ szConverted = (wchar_t*)mir_alloc(sizeof(wchar_t)* (1 + mir_strlen((char *)szText)));
MultiByteToWideChar(CP_ACP, 0, (char *)szText, -1, szConverted, 1 + (int)mir_strlen((char *)szText));
bNeedsFree = true;
}
@@ -2871,15 +2871,15 @@ quote_from_last: return 0;
// sent by the select container dialog box when a container was selected...
- // lParam = (TCHAR*)selected name...
+ // lParam = (wchar_t*)selected name...
case DM_CONTAINERSELECTED:
{
- TCHAR *szNewName = (TCHAR*)lParam;
+ wchar_t *szNewName = (wchar_t*)lParam;
if (!mir_tstrcmp(szNewName, TranslateT("Default container")))
szNewName = CGlobals::m_default_container_name;
int iOldItems = TabCtrl_GetItemCount(hwndTab);
- if (!_tcsncmp(m_pContainer->szName, szNewName, CONTAINER_NAMELEN))
+ if (!wcsncmp(m_pContainer->szName, szNewName, CONTAINER_NAMELEN))
break;
TContainerData *pNewContainer = FindContainerByName(szNewName);
@@ -3041,10 +3041,10 @@ quote_from_last: }
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));
Utils::AddToFileList(&ppFiles, &totalCount, szFilename);
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index d50f9b4374..f68dd7c692 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -77,7 +77,7 @@ void TSAPI RearrangeTab(HWND hwndDlg, const TWindowData *dat, int iMode, BOOL fS return;
HWND hwndTab = GetParent(hwndDlg);
- TCHAR oldText[512];
+ wchar_t oldText[512];
TCITEM item = { 0 };
item.mask = TCIF_IMAGE | TCIF_TEXT | TCIF_PARAM;
@@ -129,17 +129,17 @@ static UINT_PTR CALLBACK OpenFileSubclass(HWND hwnd, UINT msg, WPARAM, LPARAM lP static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic)
{
- TCHAR szFinalFilename[MAX_PATH];
+ wchar_t szFinalFilename[MAX_PATH];
time_t t = time(NULL);
struct tm *lt = localtime(&t);
DWORD setView = 1;
- TCHAR szTimestamp[100];
+ wchar_t szTimestamp[100];
mir_sntprintf(szTimestamp, L"%04u %02u %02u_%02u%02u", lt->tm_year + 1900, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min);
- TCHAR *szProto = mir_a2t(dat->cache->getActiveProto());
+ wchar_t *szProto = mir_a2t(dat->cache->getActiveProto());
- TCHAR szFinalPath[MAX_PATH];
+ wchar_t szFinalPath[MAX_PATH];
mir_sntprintf(szFinalPath, L"%s\\%s", M.getSavedAvatarPath(), szProto);
mir_free(szProto);
@@ -151,7 +151,7 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) }
}
- TCHAR szBaseName[MAX_PATH];
+ wchar_t szBaseName[MAX_PATH];
if (isOwnPic)
mir_sntprintf(szBaseName, L"My Avatar_%s", szTimestamp);
else
@@ -162,7 +162,7 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) // do not allow / or \ or % in the filename
Utils::sanitizeFilename(szFinalFilename);
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s%c*.bmp;*.png;*.jpg;*.gif%c%c", TranslateT("Image files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
@@ -259,7 +259,7 @@ int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID) EnableMenuItem(submenu, ID_TABMENU_CLEARSAVEDTABPOSITION, (M.GetDword(dat->hContact, "tabindex", -1) != -1) ? MF_ENABLED : MF_GRAYED);
}
else if (menuID == MENU_PICMENU) {
- TCHAR *szText = NULL;
+ wchar_t *szText = NULL;
char avOverride = (char)M.GetByte(dat->hContact, "hideavatar", -1);
HMENU visMenu = GetSubMenu(submenu, 0);
BOOL picValid = bInfoPanel ? (dat->hOwnPic != 0) : (dat->ace && dat->ace->hbmPic && dat->ace->hbmPic != PluginConfig.g_hbmUnknown);
@@ -424,7 +424,7 @@ int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId) void TSAPI UpdateReadChars(const TWindowData *dat)
{
if (dat && (dat->pContainer->hwndStatus && dat->pContainer->hwndActive == dat->hwnd)) {
- TCHAR buf[128];
+ wchar_t buf[128];
int len;
if (dat->bType == SESSIONTYPE_CHAT)
@@ -441,7 +441,7 @@ void TSAPI UpdateReadChars(const TWindowData *dat) BOOL fCaps = (GetKeyState(VK_CAPITAL) & 1);
BOOL fNum = (GetKeyState(VK_NUMLOCK) & 1);
- TCHAR szBuf[20]; szBuf[0] = 0;
+ wchar_t szBuf[20]; szBuf[0] = 0;
if (dat->fInsertMode)
mir_tstrcat(szBuf, L"O");
if (fCaps)
@@ -646,19 +646,19 @@ int TSAPI CheckValidSmileyPack(const char *szProto, MCONTACT hContact) /////////////////////////////////////////////////////////////////////////////////////////
// return value MUST be mir_free()'d by caller.
-TCHAR* TSAPI QuoteText(const TCHAR *text)
+wchar_t* TSAPI QuoteText(const wchar_t *text)
{
int outChar, lineChar;
int iCharsPerLine = M.GetDword("quoteLineLength", 64);
size_t bufSize = mir_wstrlen(text) + 23;
- TCHAR *strout = (TCHAR*)mir_alloc(bufSize * sizeof(TCHAR));
+ wchar_t *strout = (wchar_t*)mir_alloc(bufSize * sizeof(wchar_t));
int inChar = 0;
int justDoneLineBreak = 1;
for (outChar = 0, lineChar = 0; text[inChar];) {
if (outChar >= bufSize - 8) {
bufSize += 20;
- strout = (TCHAR*)mir_realloc(strout, bufSize * sizeof(TCHAR));
+ strout = (wchar_t*)mir_realloc(strout, bufSize * sizeof(wchar_t));
}
if (justDoneLineBreak && text[inChar] != '\r' && text[inChar] != '\n') {
strout[outChar++] = '>';
@@ -832,31 +832,31 @@ char* TSAPI Message_GetFromStream(HWND hwndRtf, DWORD dwPassedFlags) return pszText; // pszText contains the 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;
}
}
@@ -864,7 +864,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");
}
}
@@ -907,7 +907,7 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors 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
@@ -919,8 +919,8 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors 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);
if (iCol && dat->bType != SESSIONTYPE_CHAT)
@@ -928,85 +928,85 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors 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
if (!(lf.lfWeight == FW_BOLD)) // only allow bold if the font itself isn't a bold one, otherwise just strip it..
if (dat->SendFormat)
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
if (!lf.lfItalic && dat->SendFormat)
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
if (!lf.lfStrikeOut && dat->SendFormat)
res.Append((p[7] != '0') ? L"[s]" : L"[/s]");
}
- else if (!_tcsncmp(p, L"\\ul", 3)) { // underlined
+ else if (!wcsncmp(p, L"\\ul", 3)) { // underlined
if (!lf.lfUnderline && dat->SendFormat) {
- if (p[3] == 0 || _tcschr(tszRtfBreaks, p[3])) {
+ 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];
+ wchar_t tmp[10];
if (p[3] != ' ' && p[3] != '\\') {
- _tcsncpy(tmp, p + 2, 3);
+ wcsncpy(tmp, p + 2, 3);
tmp[3] = 0;
}
else {
- _tcsncpy(tmp, p + 2, 2);
+ wcsncpy(tmp, p + 2, 2);
tmp[2] = 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;
@@ -1039,7 +1039,7 @@ void TSAPI GetMYUIN(TWindowData *dat) {
ptrT uid(Contact_GetInfo(CNF_DISPLAYUID, NULL, dat->cache->getActiveProto()));
if (uid != NULL)
- _tcsncpy_s(dat->myUin, uid, _TRUNCATE);
+ wcsncpy_s(dat->myUin, uid, _TRUNCATE);
else
dat->myUin[0] = 0;
}
@@ -1249,9 +1249,9 @@ void TSAPI GetSendFormat(TWindowData *dat) //
// GetLocaleInfo() should no longer be used on Vista and later
-void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName)
+void TSAPI GetLocaleID(TWindowData *dat, const wchar_t *szKLName)
{
- TCHAR szLI[256], *stopped = NULL;
+ wchar_t szLI[256], *stopped = NULL;
USHORT langID;
WORD wCtype2[3];
PARAFORMAT2 pf2;
@@ -1261,34 +1261,34 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName) szLI[0] = szLI[1] = 0;
memset(&pf2, 0, sizeof(PARAFORMAT2));
- langID = (USHORT)_tcstol(szKLName, &stopped, 16);
+ langID = (USHORT)wcstol(szKLName, &stopped, 16);
dat->lcid = MAKELCID(langID, 0);
/*
* Vista+: read ISO locale names from the registry
*/
if (PluginConfig.m_bIsVista) {
HKEY hKey = 0;
- TCHAR szKey[20];
- DWORD dwLID = _tcstoul(szKLName, &stopped, 16);
+ wchar_t szKey[20];
+ DWORD dwLID = wcstoul(szKLName, &stopped, 16);
mir_sntprintf(szKey, L"%04.04x", LOWORD(dwLID));
if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, L"MIME\\Database\\Rfc1766", 0, KEY_READ, &hKey)) {
DWORD dwLength = 255;
if (ERROR_SUCCESS == RegQueryValueEx(hKey, szKey, 0, 0, (unsigned char *)szLI, &dwLength)) {
- TCHAR* p;
+ wchar_t* p;
szLI[255] = 0;
- if ((p = _tcschr(szLI, ';')) != 0)
+ if ((p = wcschr(szLI, ';')) != 0)
*p = 0;
}
RegCloseKey(hKey);
}
- szLI[0] = _totupper(szLI[0]);
- szLI[1] = _totupper(szLI[1]);
+ szLI[0] = towupper(szLI[0]);
+ szLI[1] = towupper(szLI[1]);
}
else {
GetLocaleInfo(dat->lcid, LOCALE_SISO639LANGNAME, szLI, 10);
- _tcsupr(szLI);
+ wcsupr(szLI);
}
fLocaleNotSet = (dat->lcID[0] == 0 && dat->lcID[1] == 0);
mir_sntprintf(dat->lcID, szLI);
@@ -1557,7 +1557,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM, LPARAM lParam, TWindowData *dat) }
if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_STATICTEXT) || dis->hwndItem == GetDlgItem(hwndDlg, IDC_LOGFROZENTEXT)) {
- TCHAR szWindowText[256];
+ wchar_t szWindowText[256];
if (CSkin::m_skinEnabled) {
SetTextColor(dis->hDC, CSkin::m_DefaultFontColor);
CSkin::SkinDrawBG(dis->hwndItem, dat->pContainer->hwnd, dat->pContainer, &dis->rcItem, dis->hDC);
@@ -1737,11 +1737,11 @@ void TSAPI GetMyNick(TWindowData *dat) ptrT tszNick(Contact_GetInfo(CNF_NICK, NULL, dat->cache->getActiveProto()));
if (tszNick != NULL) {
if (mir_tstrlen(tszNick) == 0 || !mir_tstrcmp(tszNick, TranslateT("'(Unknown contact)'")))
- _tcsncpy_s(dat->szMyNickname, (dat->myUin[0] ? dat->myUin : TranslateT("'(Unknown contact)'")), _TRUNCATE);
+ wcsncpy_s(dat->szMyNickname, (dat->myUin[0] ? dat->myUin : TranslateT("'(Unknown contact)'")), _TRUNCATE);
else
- _tcsncpy_s(dat->szMyNickname, tszNick, _TRUNCATE);
+ wcsncpy_s(dat->szMyNickname, tszNick, _TRUNCATE);
}
- else _tcsncpy_s(dat->szMyNickname, L"<undef>", _TRUNCATE); // same here
+ else wcsncpy_s(dat->szMyNickname, L"<undef>", _TRUNCATE); // same here
}
HICON TSAPI MY_GetContactIcon(const TWindowData *dat, LPCSTR szSetting)
@@ -1849,14 +1849,14 @@ LONG TSAPI GetDefaultMinimumInputHeight(const TWindowData *dat) return(height);
}
-static LIST<TCHAR> vTempFilenames(5);
+static LIST<wchar_t> vTempFilenames(5);
// send a pasted bitmap by file transfer.
void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp)
{
const wchar_t* mirandatempdir = L"Miranda";
const wchar_t* filenametemplate = L"\\clp-%Y%m%d-%H%M%S0.jpg";
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
size_t tempdirlen = GetTempPath(MAX_PATH, filename);
bool fSend = true;
@@ -1899,7 +1899,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp) time(&rawtime);
const tm* timeinfo;
timeinfo = _localtime32((__time32_t *)&rawtime);
- _tcsftime(filename + tempdirlen, MAX_PATH - tempdirlen, filenametemplate, timeinfo);
+ wcsftime(filename + tempdirlen, MAX_PATH - tempdirlen, filenametemplate, timeinfo);
size_t firstnumberpos = tempdirlen + 14;
size_t lastnumberpos = tempdirlen + 20;
while (GetFileAttributes(filename) != INVALID_FILE_ATTRIBUTES) { // while it exists
@@ -1916,7 +1916,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp) }
if (filename[0] == 0) { // prompting to save
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s%c*.jpg%c%c", TranslateT("JPEG-compressed images"), 0, 0, 0);
OPENFILENAME dlg;
@@ -1940,7 +1940,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp) CallService(MS_IMG_SAVE, (WPARAM)&ii, IMGL_TCHAR);
int totalCount = 0;
- TCHAR **ppFiles = NULL;
+ wchar_t **ppFiles = NULL;
Utils::AddToFileList(&ppFiles, &totalCount, filename);
wchar_t* _t = mir_tstrdup(filename);
diff --git a/plugins/TabSRMM/src/msgdlgutils.h b/plugins/TabSRMM/src/msgdlgutils.h index 7b6c84ebb5..1d7610caca 100644 --- a/plugins/TabSRMM/src/msgdlgutils.h +++ b/plugins/TabSRMM/src/msgdlgutils.h @@ -38,7 +38,7 @@ bool TSAPI GetAvatarVisibility(HWND hwndDlg, TWindowData *dat); void TSAPI ProcessAvatarChange(HWND hwnd, LPARAM lParam);
void TSAPI UpdateStatusBar(const TWindowData *dat);
int TSAPI CheckValidSmileyPack(const char *szProto, MCONTACT hContact);
-TCHAR* TSAPI QuoteText(const TCHAR *text);
+wchar_t* TSAPI QuoteText(const wchar_t *text);
void TSAPI UpdateReadChars(const TWindowData *dat);
void TSAPI ShowPicture(TWindowData *dat, BOOL showNewPic);
void TSAPI AdjustBottomAvatarDisplay(TWindowData *dat);
@@ -55,7 +55,7 @@ void TSAPI SaveSplitter(TWindowData *dat); void TSAPI LoadSplitter(TWindowData *dat);
void TSAPI PlayIncomingSound(const TWindowData *dat);
void TSAPI GetSendFormat(TWindowData *dat);
-void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName);
+void TSAPI GetLocaleID(TWindowData *dat, const wchar_t *szKLName);
void TSAPI LoadOwnAvatar(TWindowData *dat);
void TSAPI LoadContactAvatar(TWindowData *dat);
void TSAPI LoadTimeZone(TWindowData *dat);
@@ -64,7 +64,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat void TSAPI LoadOverrideTheme(TContainerData *pContainer);
void TSAPI LoadThemeDefaults(TContainerData *pContainer);
void TSAPI ConfigureSmileyButton(TWindowData *dat);
-int TSAPI CutContactName(const TCHAR *szold, TCHAR *sznew, size_t size);
+int TSAPI CutContactName(const wchar_t *szold, wchar_t *sznew, size_t size);
void TSAPI SendNudge(const TWindowData *dat);
void TSAPI EnableSendButton(const TWindowData *dat, int iMode);
LRESULT TSAPI GetSendButtonState(HWND hwnd);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 52d7273605..8abd3a071b 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -29,41 +29,41 @@ #include "stdafx.h"
struct TCpTable cpTable[] = {
- { 874, LPGENT("Thai") },
- { 932, LPGENT("Japanese") },
- { 936, LPGENT("Simplified Chinese") },
- { 949, LPGENT("Korean") },
- { 950, LPGENT("Traditional Chinese") },
- { 1250, LPGENT("Central European") },
- { 1251, LPGENT("Cyrillic") },
- { 20866, LPGENT("Cyrillic KOI8-R") },
- { 1252, LPGENT("Latin I") },
- { 1253, LPGENT("Greek") },
- { 1254, LPGENT("Turkish") },
- { 1255, LPGENT("Hebrew") },
- { 1256, LPGENT("Arabic") },
- { 1257, LPGENT("Baltic") },
- { 1258, LPGENT("Vietnamese") },
- { 1361, LPGENT("Korean (Johab)") },
+ { 874, LPGENW("Thai") },
+ { 932, LPGENW("Japanese") },
+ { 936, LPGENW("Simplified Chinese") },
+ { 949, LPGENW("Korean") },
+ { 950, LPGENW("Traditional Chinese") },
+ { 1250, LPGENW("Central European") },
+ { 1251, LPGENW("Cyrillic") },
+ { 20866, LPGENW("Cyrillic KOI8-R") },
+ { 1252, LPGENW("Latin I") },
+ { 1253, LPGENW("Greek") },
+ { 1254, LPGENW("Turkish") },
+ { 1255, LPGENW("Hebrew") },
+ { 1256, LPGENW("Arabic") },
+ { 1257, LPGENW("Baltic") },
+ { 1258, LPGENW("Vietnamese") },
+ { 1361, LPGENW("Korean (Johab)") },
{ (UINT)-1, NULL }
};
-wchar_t* weekDays[7] = { LPGENT("Sunday"), LPGENT("Monday"), LPGENT("Tuesday"), LPGENT("Wednesday"), LPGENT("Thursday"), LPGENT("Friday"), LPGENT("Saturday") };
+wchar_t* weekDays[7] = { LPGENW("Sunday"), LPGENW("Monday"), LPGENW("Tuesday"), LPGENW("Wednesday"), LPGENW("Thursday"), LPGENW("Friday"), LPGENW("Saturday") };
wchar_t* months[12] =
{
- LPGENT("January"), LPGENT("February"), LPGENT("March"), LPGENT("April"), LPGENT("May"), LPGENT("June"),
- LPGENT("July"), LPGENT("August"), LPGENT("September"), LPGENT("October"), LPGENT("November"), LPGENT("December")
+ LPGENW("January"), LPGENW("February"), LPGENW("March"), LPGENW("April"), LPGENW("May"), LPGENW("June"),
+ LPGENW("July"), LPGENW("August"), LPGENW("September"), LPGENW("October"), LPGENW("November"), LPGENW("December")
};
static time_t today;
int g_groupBreak = TRUE;
-static TCHAR *szMyName = NULL;
-static TCHAR *szYourName = NULL;
+static wchar_t *szMyName = NULL;
+static wchar_t *szYourName = NULL;
static int logPixelSY;
-static TCHAR szToday[22], szYesterday[22];
+static wchar_t szToday[22], szYesterday[22];
char rtfFontsGlobal[MSGDLGFONTCOUNT + 2][RTFCACHELINESIZE];
char *rtfFonts;
@@ -107,7 +107,7 @@ __forceinline char *GetRTFFont(DWORD dwIndex) * the highlight code (individual background colors).
* Doesn't touch the message for sure, but empty lines at the end are ugly anyway.
*/
-static void TrimMessage(TCHAR *msg)
+static void TrimMessage(wchar_t *msg)
{
size_t iLen = mir_tstrlen(msg) - 1;
size_t i = iLen;
@@ -132,8 +132,8 @@ void TSAPI CacheLogFonts() }
mir_snprintf(rtfFontsGlobal[MSGDLGFONTCOUNT], "\\f%u\\cf%u\\b%d\\i%d\\fs%u", MSGDLGFONTCOUNT, MSGDLGFONTCOUNT, 0, 0, 0);
- _tcsncpy(szToday, TranslateT("Today"), 20);
- _tcsncpy(szYesterday, TranslateT("Yesterday"), 20);
+ wcsncpy(szToday, TranslateT("Today"), 20);
+ wcsncpy(szYesterday, TranslateT("Yesterday"), 20);
szToday[19] = szYesterday[19] = 0;
// cache/create the info panel fonts
@@ -198,14 +198,14 @@ static int TSAPI GetColorIndex(char *rtffont) return 0;
}
-static int AppendUnicodeToBuffer(CMStringA &str, const TCHAR *line, int mode)
+static int AppendUnicodeToBuffer(CMStringA &str, const wchar_t *line, int mode)
{
str.Append("{\\uc1 ");
int textCharsCount = 0;
for (; *line; line++, textCharsCount++) {
if (*line == 127 && line[1] != 0) {
- TCHAR code = line[2];
+ wchar_t code = line[2];
if (((code == '0' || code == '1') && line[3] == ' ') || (line[1] == 'c' && code == 'x')) {
int begin = (code == '1');
switch (line[1]) {
@@ -336,7 +336,7 @@ static char* CreateRTFHeader(TWindowData *dat) return str.Detach();
}
-static void AppendTimeStamp(TCHAR *szFinalTimestamp, int isSent, CMStringA &str, int skipFont, TWindowData *dat, int iFontIDOffset)
+static void AppendTimeStamp(wchar_t *szFinalTimestamp, int isSent, CMStringA &str, int skipFont, TWindowData *dat, int iFontIDOffset)
{
if (skipFont)
AppendUnicodeToBuffer(str, szFinalTimestamp, MAKELONG(isSent, dat->bIsHistory));
@@ -347,14 +347,14 @@ static void AppendTimeStamp(TCHAR *szFinalTimestamp, int isSent, CMStringA &str, }
}
-static TCHAR* Template_MakeRelativeDate(HANDLE hTimeZone, time_t check, TCHAR code)
+static wchar_t* Template_MakeRelativeDate(HANDLE hTimeZone, time_t check, wchar_t code)
{
- static TCHAR szResult[100];
- const TCHAR *szFormat;
+ static wchar_t szResult[100];
+ const wchar_t *szFormat;
- if ((code == (TCHAR)'R' || code == (TCHAR)'r') && check >= today)
+ if ((code == (wchar_t)'R' || code == (wchar_t)'r') && check >= today)
mir_tstrcpy(szResult, szToday);
- else if ((code == (TCHAR)'R' || code == (TCHAR)'r') && check > (today - 86400))
+ else if ((code == (wchar_t)'R' || code == (wchar_t)'r') && check > (today - 86400))
mir_tstrcpy(szResult, szYesterday);
else {
if (code == 'D' || code == 'R')
@@ -419,14 +419,14 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, if (dbei.eventType == EVENTTYPE_MESSAGE && !dbei.markedRead())
dat->cache->updateStats(TSessionStats::SET_LAST_RCV, mir_strlen((char *)dbei.pBlob));
- TCHAR *formatted = NULL;
- TCHAR *msg = DbGetEventTextT(&dbei, CP_UTF8);
+ wchar_t *formatted = NULL;
+ wchar_t *msg = DbGetEventTextT(&dbei, CP_UTF8);
if (!msg) {
mir_free(dbei.pBlob);
return NULL;
}
TrimMessage(msg);
- formatted = const_cast<TCHAR *>(Utils::FormatRaw(dat, msg, dwFormattingParams, FALSE));
+ formatted = const_cast<wchar_t *>(Utils::FormatRaw(dat, msg, dwFormattingParams, FALSE));
mir_free(msg);
CMStringA str;
@@ -501,7 +501,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, TTemplateSet *this_templateset = dbei.flags & DBEF_RTL ? dat->pContainer->rtl_templates : dat->pContainer->ltr_templates;
- TCHAR *szTemplate;
+ wchar_t *szTemplate;
if (bIsStatusChangeEvent)
szTemplate = this_templateset->szTemplates[TMPL_STATUSCHG];
else if (dbei.eventType == EVENTTYPE_ERRMSG)
@@ -529,9 +529,9 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, str.Append("\\ul0\\b0\\i0\\v0 ");
for (size_t i = 0; i < iTemplateLen;) {
- TCHAR ci = szTemplate[i];
+ wchar_t ci = szTemplate[i];
if (ci == '%') {
- TCHAR cc = szTemplate[i + 1];
+ wchar_t cc = szTemplate[i + 1];
skipToNext = FALSE;
skipFont = FALSE;
@@ -584,7 +584,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, }
}
- TCHAR color, code;
+ wchar_t color, code;
switch (cc) {
case 'V':
//str.Append("\\fs0\\\expnd-40 ~-%d-~", hDbEvent);
@@ -615,14 +615,14 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, break;
case 'D': // long date
if (showTime && showDate) {
- TCHAR *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, 'D');
+ wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, 'D');
AppendTimeStamp(szFinalTimestamp, isSent, str, skipFont, dat, iFontIDOffset);
}
else skipToNext = TRUE;
break;
case 'E': // short date...
if (showTime && showDate) {
- TCHAR *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, 'E');
+ wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, 'E');
AppendTimeStamp(szFinalTimestamp, isSent, str, skipFont, dat, iFontIDOffset);
}
else skipToNext = TRUE;
@@ -721,7 +721,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, case 'R':
case 'r': // long date
if (showTime && showDate) {
- TCHAR *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, cc);
+ wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, cc);
AppendTimeStamp(szFinalTimestamp, isSent, str, skipFont, dat, iFontIDOffset);
}
else skipToNext = TRUE;
@@ -729,7 +729,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, case 't':
case 'T':
if (showTime) {
- TCHAR *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, (TCHAR)((dwEffectiveFlags & MWF_LOG_SHOWSECONDS) ? cc : (TCHAR)'t'));
+ wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, (wchar_t)((dwEffectiveFlags & MWF_LOG_SHOWSECONDS) ? cc : (wchar_t)'t'));
AppendTimeStamp(szFinalTimestamp, isSent, str, skipFont, dat, iFontIDOffset);
}
else skipToNext = TRUE;
@@ -830,7 +830,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, if (*szDescr != 0) {
ptrT tszDescr(DbGetEventStringT(&dbei, szDescr));
- TCHAR buf[1000];
+ wchar_t buf[1000];
mir_sntprintf(buf, L"%s (%s)", tszFileName, tszDescr);
AppendUnicodeToBuffer(str, buf, 0);
}
@@ -1035,7 +1035,7 @@ static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppe {
DWORD dwScale = M.GetDword("iconscale", 0);
- TCHAR trbuffer[40];
+ wchar_t trbuffer[40];
TEXTRANGE tr;
tr.lpstrText = trbuffer;
@@ -1062,8 +1062,8 @@ static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppe cr.cpMax = cr.cpMin + 18;
SendMessage(hwndrtf, EM_EXSETSEL, 0, (LPARAM)&cr);
SendMessage(hwndrtf, EM_REPLACESEL, FALSE, (LPARAM)L"");
- UINT length = (unsigned int)_ttol(&trbuffer[7]);
- int index = _ttol(&trbuffer[14]);
+ UINT length = (unsigned int)_wtol(&trbuffer[7]);
+ int index = _wtol(&trbuffer[14]);
if (length > 0 && length < 20000 && index >= RTF_CTABLE_DEFSIZE && index < Utils::rtf_ctable_size) {
cf2.crTextColor = Utils::rtf_ctable[index].clr;
cr.cpMin = fi.chrgText.cpMin;
@@ -1234,7 +1234,7 @@ void TSAPI StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAp if (dat->szMicroLf[0] == 0)
SetupLogFormatting(dat);
- szYourName = const_cast<TCHAR *>(dat->cache->getNick());
+ szYourName = const_cast<wchar_t *>(dat->cache->getNick());
szMyName = dat->szMyNickname;
SendMessage(hwndrtf, EM_HIDESELECTION, TRUE, 0);
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index 9cb53d4b0c..4928636933 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -93,16 +93,16 @@ static HWND hwndTabConfig = 0; //
// [Global]/Name property is new in TabSRMM version 3.
-static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox)
+static int TSAPI ScanSkinDir(const wchar_t* tszFolder, HWND hwndCombobox)
{
bool fValid = false;
- TCHAR tszMask[MAX_PATH];
+ wchar_t tszMask[MAX_PATH];
mir_sntprintf(tszMask, L"%s*.*", tszFolder);
WIN32_FIND_DATA fd = { 0 };
HANDLE h = FindFirstFile(tszMask, &fd);
while (h != INVALID_HANDLE_VALUE) {
- if (mir_tstrlen(fd.cFileName) >= 5 && !_tcsnicmp(fd.cFileName + mir_tstrlen(fd.cFileName) - 4, L".tsk", 4)) {
+ if (mir_tstrlen(fd.cFileName) >= 5 && !wcsnicmp(fd.cFileName + mir_tstrlen(fd.cFileName) - 4, L".tsk", 4)) {
fValid = true;
break;
}
@@ -113,21 +113,21 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox) FindClose(h);
if (fValid) {
- TCHAR tszFinalName[MAX_PATH], tszRel[MAX_PATH];
+ wchar_t tszFinalName[MAX_PATH], tszRel[MAX_PATH];
LRESULT lr;
- TCHAR szBuf[255];
+ wchar_t szBuf[255];
mir_sntprintf(tszFinalName, L"%s%s", tszFolder, fd.cFileName);
GetPrivateProfileString(L"Global", L"Name", L"None", szBuf, _countof(szBuf), tszFinalName);
if (!mir_tstrcmp(szBuf, L"None")) {
fd.cFileName[mir_tstrlen(fd.cFileName) - 4] = 0;
- _tcsncpy_s(szBuf, fd.cFileName, _TRUNCATE);
+ wcsncpy_s(szBuf, fd.cFileName, _TRUNCATE);
}
PathToRelativeT(tszFinalName, tszRel, M.getSkinPath());
if ((lr = SendMessage(hwndCombobox, CB_INSERTSTRING, -1, (LPARAM)szBuf)) != CB_ERR) {
- TCHAR *idata = (TCHAR*)mir_alloc((mir_tstrlen(tszRel) + 1) * sizeof(TCHAR));
+ wchar_t *idata = (wchar_t*)mir_alloc((mir_tstrlen(tszRel) + 1) * sizeof(wchar_t));
mir_tstrcpy(idata, tszRel);
SendMessage(hwndCombobox, CB_SETITEMDATA, lr, (LPARAM)idata);
@@ -149,8 +149,8 @@ static int TSAPI RescanSkins(HWND hwndCombobox) {
DBVARIANT dbv = { 0 };
- TCHAR tszSkinRoot[MAX_PATH], tszFindMask[MAX_PATH];
- _tcsncpy_s(tszSkinRoot, M.getSkinPath(), _TRUNCATE);
+ wchar_t tszSkinRoot[MAX_PATH], tszFindMask[MAX_PATH];
+ wcsncpy_s(tszSkinRoot, M.getSkinPath(), _TRUNCATE);
SetDlgItemText(GetParent(hwndCombobox), IDC_SKINROOTFOLDER, tszSkinRoot);
mir_sntprintf(tszFindMask, L"%s*.*", tszSkinRoot);
@@ -162,7 +162,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox) HANDLE h = FindFirstFile(tszFindMask, &fd);
while (h != INVALID_HANDLE_VALUE) {
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY && fd.cFileName[0] != '.') {
- TCHAR tszSubDir[MAX_PATH];
+ wchar_t tszSubDir[MAX_PATH];
mir_sntprintf(tszSubDir, L"%s%s\\", tszSkinRoot, fd.cFileName);
ScanSkinDir(tszSubDir, hwndCombobox);
}
@@ -176,8 +176,8 @@ static int TSAPI RescanSkins(HWND hwndCombobox) if (0 == db_get_ts(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
LRESULT lr = SendMessage(hwndCombobox, CB_GETCOUNT, 0, 0);
for (int i = 1; i < lr; i++) {
- TCHAR *idata = (TCHAR*)SendMessage(hwndCombobox, CB_GETITEMDATA, i, 0);
- if (idata && idata != (TCHAR*)CB_ERR) {
+ wchar_t *idata = (wchar_t*)SendMessage(hwndCombobox, CB_GETITEMDATA, i, 0);
+ if (idata && idata != (wchar_t*)CB_ERR) {
if (!mir_tstrcmpi(dbv.ptszVal, idata)) {
SendMessage(hwndCombobox, CB_SETCURSEL, i, 0);
break;
@@ -291,7 +291,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case IDC_THEMEEXPORT:
{
- const TCHAR *szFilename = GetThemeFileName(1);
+ const wchar_t *szFilename = GetThemeFileName(1);
if (szFilename != NULL)
WriteThemeToINI(szFilename, 0);
}
@@ -342,8 +342,8 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L if (HIWORD(wParam) == CBN_SELCHANGE) {
LRESULT lr = SendDlgItemMessage(hwndDlg, IDC_SKINNAME, CB_GETCURSEL, 0, 0);
if (lr != CB_ERR && lr > 0) {
- TCHAR *tszRelPath = (TCHAR*)SendDlgItemMessage(hwndDlg, IDC_SKINNAME, CB_GETITEMDATA, lr, 0);
- if (tszRelPath && tszRelPath != (TCHAR*)CB_ERR)
+ wchar_t *tszRelPath = (wchar_t*)SendDlgItemMessage(hwndDlg, IDC_SKINNAME, CB_GETITEMDATA, lr, 0);
+ if (tszRelPath && tszRelPath != (wchar_t*)CB_ERR)
db_set_ts(0, SRMSGMOD_T, "ContainerSkin", tszRelPath);
SendMessage(hwndDlg, WM_COMMAND, IDC_RELOADSKIN, 0);
}
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 657c3643ec..1301f3af80 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -281,7 +281,7 @@ static INT_PTR ReadMessageCommand(WPARAM, LPARAM lParam) if (hwndExisting != 0)
SendMessage(hwndExisting, DM_ACTIVATEME, 0, 0);
else {
- TCHAR szName[CONTAINER_NAMELEN + 1];
+ wchar_t szName[CONTAINER_NAMELEN + 1];
GetContainerNameForContact(hContact, szName, CONTAINER_NAMELEN);
TContainerData *pContainer = FindContainerByName(szName);
if (pContainer == NULL)
@@ -330,7 +330,7 @@ INT_PTR SendMessageCommand_Worker(MCONTACT hContact, LPCSTR pszMsg, bool isWchar SendMessage(hwnd, DM_ACTIVATEME, 0, 0);
}
else {
- TCHAR szName[CONTAINER_NAMELEN + 1];
+ wchar_t szName[CONTAINER_NAMELEN + 1];
GetContainerNameForContact(hContact, szName, CONTAINER_NAMELEN);
TContainerData *pContainer = FindContainerByName(szName);
@@ -473,7 +473,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, }
// if we have a max # of tabs/container set and want to open something in the default container...
- if (hContact != 0 && M.GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, L"default", 6))
+ if (hContact != 0 && M.GetByte("limittabs", 0) && !wcsncmp(pContainer->szName, L"default", 6))
if ((pContainer = FindMatchingContainer(L"default")) == NULL)
if ((pContainer = CreateContainer(L"default", CNT_CREATEFLAG_CLONED, hContact)) == NULL)
return 0;
@@ -487,21 +487,21 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, memset(&newData.item, 0, sizeof(newData.item));
// obtain various status information about the contact
- TCHAR *contactName = pcli->pfnGetContactDisplayName(newData.hContact, 0);
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(newData.hContact, 0);
// cut nickname if larger than x chars...
- TCHAR newcontactname[128], tabtitle[128];
+ wchar_t newcontactname[128], tabtitle[128];
if (contactName && mir_tstrlen(contactName) > 0) {
if (M.GetByte("cuttitle", 0))
CutContactName(contactName, newcontactname, _countof(newcontactname));
else
- _tcsncpy_s(newcontactname, contactName, _TRUNCATE);
+ wcsncpy_s(newcontactname, contactName, _TRUNCATE);
Utils::DoubleAmpersands(newcontactname, _countof(newcontactname));
}
- else _tcsncpy_s(newcontactname, L"_U_", _TRUNCATE);
+ else wcsncpy_s(newcontactname, L"_U_", _TRUNCATE);
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
if (M.GetByte("tabstatus", 1))
mir_sntprintf(tabtitle, L"%s (%s) ", newcontactname, szStatus);
@@ -618,13 +618,13 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, // it searches a container with "room" for the new tabs or otherwise creates
// a new (cloned) one.
-TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName)
+TContainerData* TSAPI FindMatchingContainer(const wchar_t *szName)
{
int iMaxTabs = M.GetDword("maxtabs", 0);
- if (iMaxTabs > 0 && M.GetByte("limittabs", 0) && !_tcsncmp(szName, L"default", 6)) {
+ if (iMaxTabs > 0 && M.GetByte("limittabs", 0) && !wcsncmp(szName, L"default", 6)) {
// search a "default" with less than iMaxTabs opened...
for (TContainerData *p = pFirstContainer; p; p = p->pNext)
- if (!_tcsncmp(p->szName, L"default", 6) && p->iChilds < iMaxTabs)
+ if (!wcsncmp(p->szName, L"default", 6) && p->iChilds < iMaxTabs)
return p;
return NULL;
@@ -800,8 +800,8 @@ static int TSAPI SetupIconLibConfig() {
int j = 2, version = 0;
- TCHAR szFilename[MAX_PATH];
- _tcsncpy(szFilename, L"icons\\tabsrmm_icons.dll", MAX_PATH);
+ wchar_t szFilename[MAX_PATH];
+ wcsncpy(szFilename, L"icons\\tabsrmm_icons.dll", MAX_PATH);
g_hIconDLL = LoadLibrary(szFilename);
if (g_hIconDLL == 0) {
CWarning::show(CWarning::WARN_ICONPACKMISSING, CWarning::CWF_NOALLOWHIDE | MB_ICONERROR | MB_OK);
@@ -815,7 +815,7 @@ static int TSAPI SetupIconLibConfig() g_hIconDLL = 0;
SKINICONDESC sid = { 0 };
- sid.defaultFile.t = szFilename;
+ sid.defaultFile.w = szFilename;
sid.flags = SIDF_PATH_TCHAR;
for (int n = 0; n < _countof(ICONBLOCKS); n++) {
@@ -838,7 +838,7 @@ static int TSAPI SetupIconLibConfig() sid.iDefaultIndex = -IDI_CLOCK;
IcoLib_AddIcon(&sid);
- _tcsncpy(szFilename, L"plugins\\tabsrmm.dll", MAX_PATH);
+ wcsncpy(szFilename, L"plugins\\tabsrmm.dll", MAX_PATH);
sid.pszName = "tabSRMM_overlay_disabled";
sid.description.a = LPGEN("Feature disabled (used as overlay)");
@@ -1068,7 +1068,7 @@ STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEU STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE *lplpstg)
{
- TCHAR sztName[64];
+ wchar_t sztName[64];
mir_sntprintf(sztName, L"s%u", nextStgId++);
if (pictStg == NULL)
return STG_E_MEDIUMFULL;
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index e096eae9ec..b58246c00e 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -113,7 +113,7 @@ struct TTemplateSet {
BOOL valid; // all templates populated (may still contain crap.. so it's only half-assed safety :)
- TCHAR szTemplates[TMPL_ERRMSG + 1][TEMPLATE_LENGTH]; // the template strings
+ wchar_t szTemplates[TMPL_ERRMSG + 1][TEMPLATE_LENGTH]; // the template strings
char szSetName[20]; // everything in this world needs a name. so does this poor template set.
};
@@ -161,7 +161,7 @@ struct TContainerSettings DWORD dwTransparency;
DWORD panelheight;
DWORD splitterPos;
- TCHAR szTitleFormat[TITLE_FORMATLEN + 2];
+ wchar_t szTitleFormat[TITLE_FORMATLEN + 2];
WORD avatarMode;
WORD ownAvatarMode;
WORD autoCloseSeconds;
@@ -174,7 +174,7 @@ struct TContainerData {
TContainerData *pNext;
- TCHAR szName[CONTAINER_NAMELEN + 4]; // container name
+ wchar_t szName[CONTAINER_NAMELEN + 4]; // container name
HWND hwndActive; // active message window
HWND hwnd; // the container handle
int iTabIndex; // next tab id
@@ -198,7 +198,7 @@ struct TContainerData DWORD dwFlashingStarted;
HWND hWndOptions;
BOOL bSizingLoop;
- TCHAR szRelThemeFile[MAX_PATH], szAbsThemeFile[MAX_PATH];
+ wchar_t szRelThemeFile[MAX_PATH], szAbsThemeFile[MAX_PATH];
TTemplateSet *ltr_templates, *rtl_templates;
HDC cachedDC;
HBITMAP cachedHBM, oldHBM;
@@ -239,11 +239,11 @@ struct TWindowData DWORD dwFlagsEx;
MCONTACT hContact;
char *szProto;
- TCHAR szMyNickname[130];
- TCHAR szStatusBar[100];
+ wchar_t szMyNickname[130];
+ wchar_t szStatusBar[100];
StatusTextData *sbCustom;
- TCHAR newtitle[130]; // tab title...
- TCHAR szStatus[50];
+ wchar_t newtitle[130]; // tab title...
+ wchar_t szStatus[50];
WORD wStatus;
char *sendBuffer;
size_t iSendBufferSize;
@@ -287,14 +287,14 @@ struct TWindowData int iOpenJobs;
int iCurrentQueueError;
MEVENT hFlashingEvent;
- TCHAR myUin[80];
+ wchar_t myUin[80];
int SendFormat;
MEVENT *hQueuedEvents;
int iNextQueuedEvent;
#define EVENT_QUEUE_SIZE 10
int iEventQueueSize;
LCID lcid;
- TCHAR lcID[10];
+ wchar_t lcID[10];
int iPanelAvatarX, iPanelAvatarY;
DWORD idle;
HWND hwndTip;
@@ -370,8 +370,8 @@ struct TIconDesc struct TIconDescW
{
- TCHAR *szName;
- TCHAR *szDesc;
+ wchar_t *szName;
+ wchar_t *szDesc;
HICON *phIcon; // where the handle is saved...
INT_PTR uId; // icon ID
BOOL bForceSmall; // true: force 16x16
@@ -754,7 +754,7 @@ struct TLogIcon { struct TCpTable {
UINT cpId;
- TCHAR *cpName;
+ wchar_t *cpName;
};
#define LOI_TYPE_FLAG 1
@@ -762,12 +762,12 @@ struct TCpTable { struct TOptionListGroup {
LRESULT handle;
- TCHAR *szName;
+ wchar_t *szName;
};
struct TOptionListItem {
LRESULT handle;
- TCHAR *szName;
+ wchar_t *szName;
UINT id;
UINT uType;
UINT_PTR lParam;
@@ -797,10 +797,10 @@ struct SIDEBARITEM { UINT uId;
DWORD dwFlags;
HICON *hIcon, *hIconPressed, *hIconHover;
- TCHAR *szName;
+ wchar_t *szName;
void(*pfnAction)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem);
void(*pfnCallback)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem);
- TCHAR *tszTip;
+ wchar_t *tszTip;
};
#define FONTF_BOLD 1
@@ -971,7 +971,7 @@ void CheckStatusIconClick(TWindowData *dat, POINT pt, const RECT &rc, int gap, i struct SKINDESC
{
ULONG ulID; // resource id
- TCHAR tszName[30];
+ wchar_t tszName[30];
};
#define SKIN_NR_ELEMENTS 6
diff --git a/plugins/TabSRMM/src/nen.h b/plugins/TabSRMM/src/nen.h index 04cd1a7a70..ac0ab76372 100644 --- a/plugins/TabSRMM/src/nen.h +++ b/plugins/TabSRMM/src/nen.h @@ -133,7 +133,7 @@ struct NEN_OPTIONS struct EVENT_DATAT
{
MEVENT hEvent;
- TCHAR tszText[MAX_SECONDLINE + 2];
+ wchar_t tszText[MAX_SECONDLINE + 2];
DWORD timestamp;
};
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp index b743ef8868..d52a25f738 100644 --- a/plugins/TabSRMM/src/selectcontainer.cpp +++ b/plugins/TabSRMM/src/selectcontainer.cpp @@ -36,7 +36,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L switch (msg) {
case WM_INITDIALOG: {
- TCHAR szNewTitle[128];
+ wchar_t szNewTitle[128];
RECT rc, rcParent;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
@@ -65,7 +65,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK: {
- TCHAR szName[CONTAINER_NAMELEN];
+ wchar_t szName[CONTAINER_NAMELEN];
LRESULT iItem;
if ((iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETCURSEL, 0, 0)) != LB_ERR) {
@@ -81,12 +81,12 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L DestroyWindow(hwndDlg);
break;
case IDC_DELETECONTAINER: {
- TCHAR szName[CONTAINER_NAMELEN + 1];
+ wchar_t szName[CONTAINER_NAMELEN + 1];
LRESULT iItem;
if ((iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETCURSEL, 0, 0)) != LB_ERR) {
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szName);
- if (!_tcsncmp(szName, L"default", CONTAINER_NAMELEN) || !_tcsncmp(szName, TranslateT("Default container"), CONTAINER_NAMELEN))
+ if (!wcsncmp(szName, L"default", CONTAINER_NAMELEN) || !wcsncmp(szName, TranslateT("Default container"), CONTAINER_NAMELEN))
MessageBox(hwndDlg, TranslateT("You cannot delete the default container"), TranslateT("Error"), MB_OK | MB_ICONERROR);
else {
int iIndex = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETITEMDATA, (WPARAM)iItem, 0);
@@ -99,18 +99,18 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L break;
}
case IDC_RENAMECONTAINER: {
- TCHAR szNewName[CONTAINER_NAMELEN], szName[CONTAINER_NAMELEN + 1];
+ wchar_t szNewName[CONTAINER_NAMELEN], szName[CONTAINER_NAMELEN + 1];
int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_NEWCONTAINERNAME));
if (iLen) {
GetDlgItemText(hwndDlg, IDC_NEWCONTAINERNAME, szNewName, _countof(szNewName));
- if (!_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN) || !_tcsncmp(szNewName, TranslateT("Default container"), CONTAINER_NAMELEN)) {
+ if (!wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN) || !wcsncmp(szNewName, TranslateT("Default container"), CONTAINER_NAMELEN)) {
MessageBox(hwndDlg, TranslateT("You cannot rename the default container"), TranslateT("Error"), MB_OK | MB_ICONERROR);
break;
}
int iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_FINDSTRING, (WPARAM)-1, (LPARAM)szNewName);
if (iItem != LB_ERR) {
- TCHAR szOldName[CONTAINER_NAMELEN + 1];
+ wchar_t szOldName[CONTAINER_NAMELEN + 1];
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szOldName);
if (mir_tstrlen(szOldName) == mir_tstrlen(szNewName)) {
MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
@@ -120,15 +120,15 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L }
if ((iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETCURSEL, 0, 0)) != LB_ERR) {
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szName);
- if (!_tcsncmp(szName, L"default", CONTAINER_NAMELEN) || !_tcsncmp(szName, TranslateT("Default container"), CONTAINER_NAMELEN))
+ if (!wcsncmp(szName, L"default", CONTAINER_NAMELEN) || !wcsncmp(szName, TranslateT("Default container"), CONTAINER_NAMELEN))
MessageBox(hwndDlg, TranslateT("You cannot rename the default container"), TranslateT("Error"), MB_OK | MB_ICONERROR);
else {
int iIndex = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETITEMDATA, (WPARAM)iItem, 0);
RenameContainer(iIndex, szNewName);
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_RESETCONTENT, 0, 0);
for (TContainerData *p = pFirstContainer; p; p = p->pNext) {
- if (!_tcsncmp(p->szName, szName, CONTAINER_NAMELEN) && mir_tstrlen(p->szName) == mir_tstrlen(szName)) {
- _tcsncpy(p->szName, szNewName, CONTAINER_NAMELEN);
+ if (!wcsncmp(p->szName, szName, CONTAINER_NAMELEN) && mir_tstrlen(p->szName) == mir_tstrlen(szName)) {
+ wcsncpy(p->szName, szNewName, CONTAINER_NAMELEN);
SendMessage(p->hwnd, DM_CONFIGURECONTAINER, 0, 0);
}
}
@@ -140,15 +140,15 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L break;
}
case IDC_CREATENEW: {
- TCHAR szNewName[CONTAINER_NAMELEN], szName[CONTAINER_NAMELEN + 1];
+ wchar_t szNewName[CONTAINER_NAMELEN], szName[CONTAINER_NAMELEN + 1];
int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_NEWCONTAINER));
if (iLen) {
GetDlgItemText(hwndDlg, IDC_NEWCONTAINER, szNewName, _countof(szNewName));
int iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_FINDSTRING, (WPARAM)-1, (LPARAM)szNewName);
- if (iItem != LB_ERR || !_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
+ if (iItem != LB_ERR || !wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szName);
- if (mir_tstrlen(szName) == mir_tstrlen(szNewName) || !_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
+ if (mir_tstrlen(szName) == mir_tstrlen(szNewName) || !wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
SetFocus(GetDlgItem(hwndDlg, IDC_NEWCONTAINER));
break;
@@ -182,7 +182,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (db_get_ts(NULL, szKey, szValue, &dbv))
break; // end of list
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) {
- if (_tcsncmp(dbv.ptszVal, L"**mir_free**", CONTAINER_NAMELEN)) {
+ if (wcsncmp(dbv.ptszVal, L"**mir_free**", CONTAINER_NAMELEN)) {
iItemNew = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_ADDSTRING, 0, (LPARAM)(!mir_tstrcmp(dbv.ptszVal, L"default") ?
TranslateT("Default container") : dbv.ptszVal));
if (iItemNew != LB_ERR)
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index 1c74331fa1..e52fb5adb0 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -116,12 +116,12 @@ CSendLaterJob::~CSendLaterJob() * show a popup notification, unless they are disabled
*/
if (PluginConfig.g_bPopupAvail && fShowPopup) {
- TCHAR *tszName = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *tszName = pcli->pfnGetContactDisplayName(hContact, 0);
POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
- _tcsncpy_s(ppd.lptzContactName, (tszName ? tszName : TranslateT("'(Unknown contact)'")), _TRUNCATE);
- TCHAR *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast<TCHAR *>(&pBuf[mir_strlen((char *)pBuf) + 1]), 100);
+ wcsncpy_s(ppd.lptzContactName, (tszName ? tszName : TranslateT("'(Unknown contact)'")), _TRUNCATE);
+ wchar_t *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast<wchar_t *>(&pBuf[mir_strlen((char *)pBuf) + 1]), 100);
if (fSuccess) {
mir_sntprintf(ppd.lptzText, TranslateT("A send later job completed successfully.\nThe original message: %s"),
msgPreview);
@@ -479,7 +479,7 @@ void CSendLater::qMgrUpdate(bool fReEnable) }
}
-LRESULT CSendLater::qMgrAddFilter(const MCONTACT hContact, const TCHAR* tszNick)
+LRESULT CSendLater::qMgrAddFilter(const MCONTACT hContact, const wchar_t* tszNick)
{
LRESULT lr = ::SendMessage(m_hwndFilter, CB_FINDSTRING, 0, LPARAM(tszNick));
if (lr == CB_ERR) {
@@ -495,7 +495,7 @@ LRESULT CSendLater::qMgrAddFilter(const MCONTACT hContact, const TCHAR* tszNick) // filters by m_hFilter (contact handle)
void CSendLater::qMgrFillList(bool fClear)
{
- TCHAR *formatTime = L"%Y.%m.%d - %H:%M";
+ wchar_t *formatTime = L"%Y.%m.%d - %H:%M";
if (fClear) {
::SendMessage(m_hwndList, LVM_DELETEALLITEMS, 0, 0);
@@ -515,14 +515,14 @@ void CSendLater::qMgrFillList(bool fClear) CSendLaterJob *p = m_sendLaterJobList[i];
CContactCache *c = CContactCache::getContactCache(p->hContact);
if (c) {
- const TCHAR *tszNick = c->getNick();
+ const wchar_t *tszNick = c->getNick();
if (m_hFilter && m_hFilter != p->hContact) {
qMgrAddFilter(c->getContact(), tszNick);
continue;
}
lvItem.mask = LVIF_TEXT | LVIF_PARAM;
- TCHAR tszBuf[255];
+ wchar_t tszBuf[255];
mir_sntprintf(tszBuf, L"%s [%s]", tszNick, c->getRealAccount());
lvItem.pszText = tszBuf;
lvItem.cchTextMax = _countof(tszBuf);
@@ -533,22 +533,22 @@ void CSendLater::qMgrFillList(bool fClear) qMgrAddFilter(c->getContact(), tszNick);
lvItem.mask = LVIF_TEXT;
- TCHAR tszTimestamp[30];
- _tcsftime(tszTimestamp, 30, formatTime, _localtime32((__time32_t *)&p->created));
+ wchar_t tszTimestamp[30];
+ wcsftime(tszTimestamp, 30, formatTime, _localtime32((__time32_t *)&p->created));
tszTimestamp[29] = 0;
lvItem.pszText = tszTimestamp;
lvItem.iSubItem = 1;
::SendMessage(m_hwndList, LVM_SETITEM, 0, LPARAM(&lvItem));
- TCHAR *msg = mir_utf8decodeT(p->sendBuffer);
- TCHAR *preview = Utils::GetPreviewWithEllipsis(msg, 255);
+ wchar_t *msg = mir_utf8decodeT(p->sendBuffer);
+ wchar_t *preview = Utils::GetPreviewWithEllipsis(msg, 255);
lvItem.pszText = preview;
lvItem.iSubItem = 2;
::SendMessage(m_hwndList, LVM_SETITEM, 0, LPARAM(&lvItem));
mir_free(preview);
mir_free(msg);
- const TCHAR *tszStatusText = 0;
+ const wchar_t *tszStatusText = 0;
if (p->fFailed) {
tszStatusText = p->bCode == CSendLaterJob::JOB_REMOVABLE ?
TranslateT("Removed") : TranslateT("Failed");
@@ -574,7 +574,7 @@ void CSendLater::qMgrFillList(bool fClear) if (p->bCode)
bCode = p->bCode;
- TCHAR tszStatus[20];
+ wchar_t tszStatus[20];
mir_sntprintf(tszStatus, L"X/%s[%c] (%d)", tszStatusText, bCode, p->iSendCount);
tszStatus[0] = p->szId[0];
lvItem.pszText = tszStatus;
@@ -582,9 +582,9 @@ void CSendLater::qMgrFillList(bool fClear) ::SendMessage(m_hwndList, LVM_SETITEM, 0, LPARAM(&lvItem));
if (p->lastSent == 0)
- _tcsncpy_s(tszTimestamp, L"Never", _TRUNCATE);
+ wcsncpy_s(tszTimestamp, L"Never", _TRUNCATE);
else {
- _tcsftime(tszTimestamp, 30, formatTime, _localtime32((__time32_t *)&p->lastSent));
+ wcsftime(tszTimestamp, 30, formatTime, _localtime32((__time32_t *)&p->lastSent));
tszTimestamp[29] = 0;
}
lvItem.pszText = tszTimestamp;
@@ -807,7 +807,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM job->writeFlags();
break;
case ID_QUEUEMANAGER_COPYMESSAGETOCLIPBOARD:
- Utils::CopyToClipBoard((TCHAR*)ptrT(mir_utf8decodeT(job->sendBuffer)), m_hwndDlg);
+ Utils::CopyToClipBoard((wchar_t*)ptrT(mir_utf8decodeT(job->sendBuffer)), m_hwndDlg);
break;
case ID_QUEUEMANAGER_RESETSELECTED:
if (job->bCode == CSendLaterJob::JOB_DEFERRED) {
diff --git a/plugins/TabSRMM/src/sendlater.h b/plugins/TabSRMM/src/sendlater.h index f187eb1581..76ab17e89f 100644 --- a/plugins/TabSRMM/src/sendlater.h +++ b/plugins/TabSRMM/src/sendlater.h @@ -124,7 +124,7 @@ private: void qMgrFillList(bool fClear = true);
void qMgrSetupColumns();
void qMgrSaveColumns();
- LRESULT qMgrAddFilter(const MCONTACT hContact, const TCHAR* tszNick);
+ LRESULT qMgrAddFilter(const MCONTACT hContact, const wchar_t* tszNick);
LIST<void> m_sendLaterContactList;
LIST<CSendLaterJob> m_sendLaterJobList;
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index d04b2e621b..b7a6f80f5a 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -49,10 +49,10 @@ void SendQueue::handleError(TWindowData *dat, const int iEntry) const { if (!dat) return; - TCHAR szErrorMsg[500]; + wchar_t szErrorMsg[500]; dat->iCurrentQueueError = iEntry; - _tcsncpy_s(szErrorMsg, m_jobs[iEntry].szErrorMsg, _TRUNCATE); + wcsncpy_s(szErrorMsg, m_jobs[iEntry].szErrorMsg, _TRUNCATE); logError(dat, iEntry, szErrorMsg); recallFailed(dat, iEntry); showErrorControls(dat, TRUE); @@ -218,7 +218,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry) } if (iSendLength >= iMinLength) { - TCHAR tszError[256]; + wchar_t tszError[256]; mir_sntprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), iMinLength); ::SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE, LPARAM(tszError)); sendQueue->clearJob(iEntry); @@ -270,7 +270,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry) m_jobs[iEntry].iStatus = SQ_INPROGRESS; m_jobs[iEntry].iAcksNeeded = 1; if (dat->sendMode & SMODE_SENDLATER) { - TCHAR tszError[256]; + wchar_t tszError[256]; size_t iSendLength = getSendLength(iEntry); if (iSendLength >= dat->nMax) { @@ -344,7 +344,7 @@ void SendQueue::checkQueue(const TWindowData *dat) const // logs an error message to the message window.Optionally, appends the original message // from the given sendJob (queue index) -void SendQueue::logError(const TWindowData *dat, int iSendJobIndex, const TCHAR *szErrMsg) const +void SendQueue::logError(const TWindowData *dat, int iSendJobIndex, const wchar_t *szErrMsg) const { if (dat == 0) return; @@ -473,8 +473,8 @@ void SendQueue::NotifyDeliveryFailure(const TWindowData *dat) POPUPDATAT ppd = { 0 }; ppd.lchContact = dat->hContact; - _tcsncpy_s(ppd.lptzContactName, dat->cache->getNick(), _TRUNCATE); - _tcsncpy_s(ppd.lptzText, TranslateT("A message delivery has failed.\nClick to open the message window."), _TRUNCATE); + wcsncpy_s(ppd.lptzContactName, dat->cache->getNick(), _TRUNCATE); + wcsncpy_s(ppd.lptzText, TranslateT("A message delivery has failed.\nClick to open the message window."), _TRUNCATE); if (!(BOOL)M.GetByte(MODULE, OPT_COLDEFAULT_ERR, TRUE)) { ppd.colorText = (COLORREF)M.GetDword(MODULE, OPT_COLTEXT_ERR, DEFAULT_COLTEXT); @@ -543,7 +543,7 @@ int SendQueue::ackMessage(TWindowData *dat, WPARAM wParam, LPARAM lParam) if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND)) SkinPlaySound("SendError"); - TCHAR *szAckMsg = mir_a2t((char *)ack->lParam); + wchar_t *szAckMsg = mir_a2t((char *)ack->lParam); mir_sntprintf(job.szErrorMsg, TranslateT("Delivery failure: %s"), szAckMsg); job.iStatus = SQ_ERROR; mir_free(szAckMsg); @@ -642,7 +642,7 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b { bool fAvail = sendLater->isAvail(); - const TCHAR *szNote = 0; + const wchar_t *szNote = 0; if (fIsSendLater && dat) { if (fAvail) @@ -677,12 +677,12 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b if (iJobIndex >= 0 && iJobIndex < NR_SENDJOBS) { SendJob *job = &m_jobs[iJobIndex]; char szKeyName[20]; - TCHAR tszHeader[150]; + wchar_t tszHeader[150]; if (fIsSendLater) { time_t now = time(0); - TCHAR tszTimestamp[30]; - _tcsftime(tszTimestamp, _countof(tszTimestamp), L"%Y.%m.%d - %H:%M", _localtime32((__time32_t *)&now)); + wchar_t tszTimestamp[30]; + wcsftime(tszTimestamp, _countof(tszTimestamp), L"%Y.%m.%d - %H:%M", _localtime32((__time32_t *)&now)); mir_snprintf(szKeyName, "S%d", now); mir_sntprintf(tszHeader, TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp); } diff --git a/plugins/TabSRMM/src/sendqueue.h b/plugins/TabSRMM/src/sendqueue.h index c6b736638b..48b92a8e29 100644 --- a/plugins/TabSRMM/src/sendqueue.h +++ b/plugins/TabSRMM/src/sendqueue.h @@ -50,7 +50,7 @@ struct SendJob MCONTACT hContact;
HWND hOwnerWnd;
unsigned iStatus;
- TCHAR szErrorMsg[128];
+ wchar_t szErrorMsg[128];
DWORD dwFlags;
int iAcksNeeded;
HANDLE hEventSplit;
@@ -91,7 +91,7 @@ public: int sendQueued(TWindowData *dat, const int iEntry);
size_t getSendLength(const int iEntry);
void checkQueue(const TWindowData *dat) const;
- void logError(const TWindowData *dat, int iSendJobIndex, const TCHAR *szErrMsg) const;
+ void logError(const TWindowData *dat, int iSendJobIndex, const wchar_t *szErrMsg) const;
void recallFailed(const TWindowData *dat, int iEntry) const;
void showErrorControls(TWindowData *dat, const int showCmd) const;
int ackMessage(TWindowData *dat, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp index dfce840e74..908b4b59d0 100644 --- a/plugins/TabSRMM/src/sidebar.cpp +++ b/plugins/TabSRMM/src/sidebar.cpp @@ -30,7 +30,7 @@ TSideBarLayout CSideBar::m_layouts[CSideBar::NR_LAYOUTS] = {
{
- LPGENT("Like tabs, vertical text orientation"),
+ LPGENW("Like tabs, vertical text orientation"),
26, 30,
SIDEBARLAYOUT_DYNHEIGHT | SIDEBARLAYOUT_VERTICALORIENTATION,
CSideBar::m_DefaultContentRenderer,
@@ -40,7 +40,7 @@ TSideBarLayout CSideBar::m_layouts[CSideBar::NR_LAYOUTS] = { SIDEBARLAYOUT_VERTICAL
},
{
- LPGENT("Compact layout, horizontal buttons"),
+ LPGENW("Compact layout, horizontal buttons"),
100, 24,
0,
CSideBar::m_DefaultContentRenderer,
@@ -50,7 +50,7 @@ TSideBarLayout CSideBar::m_layouts[CSideBar::NR_LAYOUTS] = { SIDEBARLAYOUT_NORMAL
},
{
- LPGENT("Advanced layout with avatars"),
+ LPGENW("Advanced layout with avatars"),
140, 40,
SIDEBARLAYOUT_NOCLOSEBUTTONS,
CSideBar::m_AdvancedContentRenderer,
@@ -60,7 +60,7 @@ TSideBarLayout CSideBar::m_layouts[CSideBar::NR_LAYOUTS] = { SIDEBARLAYOUT_NORMAL
},
{
- LPGENT("Advanced with avatars, vertical orientation"),
+ LPGENW("Advanced with avatars, vertical orientation"),
40, 40,
SIDEBARLAYOUT_DYNHEIGHT | SIDEBARLAYOUT_VERTICALORIENTATION | SIDEBARLAYOUT_NOCLOSEBUTTONS,
CSideBar::m_AdvancedContentRenderer,
@@ -140,11 +140,11 @@ const SIZE& CSideBarButton::measureItem() m_sideBarLayout->pfnMeasureItem(this); // use the current layout's function, if available, else use default
else {
HDC dc = ::GetDC(m_hwnd);
- TCHAR tszLabel[255];
+ wchar_t tszLabel[255];
HFONT oldFont = reinterpret_cast<HFONT>(::SelectObject(dc, ::GetStockObject(DEFAULT_GUI_FONT)));
- _tcsncpy_s(tszLabel, m_dat->newtitle, _TRUNCATE);
+ wcsncpy_s(tszLabel, m_dat->newtitle, _TRUNCATE);
::GetTextExtentPoint32(dc, tszLabel, (int)mir_tstrlen(tszLabel), &sz);
sz.cx += 28;
diff --git a/plugins/TabSRMM/src/sidebar.h b/plugins/TabSRMM/src/sidebar.h index 35d147f96a..4f848f289b 100644 --- a/plugins/TabSRMM/src/sidebar.h +++ b/plugins/TabSRMM/src/sidebar.h @@ -38,7 +38,7 @@ struct TSideBarNotify struct TSideBarLayout
{
- TCHAR szName[50]; // everything wants a name...
+ wchar_t szName[50]; // everything wants a name...
LONG width; // width of the switchbar element (a single button)
LONG height; // height of a single switchbar element
DWORD dwFlags; // flags, obviously :)
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index 9250052093..78ec8e47da 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -141,10 +141,10 @@ int _DebugTraceW(const wchar_t *fmt, ...) * can display the message either as systray notification (baloon popup) or using the * popup plugin. */ -int _DebugPopup(MCONTACT hContact, const TCHAR *fmt, ...) +int _DebugPopup(MCONTACT hContact, const wchar_t *fmt, ...) { va_list va; - TCHAR debug[1024]; + wchar_t debug[1024]; int ibsize = 1023; va_start(va, fmt); @@ -152,7 +152,7 @@ int _DebugPopup(MCONTACT hContact, const TCHAR *fmt, ...) if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) { MIRANDASYSTRAYNOTIFY tn; - TCHAR szTitle[128]; + wchar_t szTitle[128]; mir_sntprintf(szTitle, TranslateT("TabSRMM message (%s)"), (hContact != 0) ? pcli->pfnGetContactDisplayName(hContact, 0) : TranslateT("Global")); diff --git a/plugins/TabSRMM/src/stdafx.h b/plugins/TabSRMM/src/stdafx.h index d38bfa6cf6..39383d1ed6 100644 --- a/plugins/TabSRMM/src/stdafx.h +++ b/plugins/TabSRMM/src/stdafx.h @@ -233,7 +233,7 @@ extern HINSTANCE hinstance; extern BOOL g_bIMGtagButton;
extern HANDLE hHookToolBarLoadedEvt;
extern TLogIcon msgLogIcons[NR_LOGICONS * 3];
-extern const TCHAR *pszIDCSAVE_save, *pszIDCSAVE_close;
+extern const wchar_t *pszIDCSAVE_save, *pszIDCSAVE_close;
extern char *TemplateNames[];
extern HANDLE hUserPrefsWindowList;
extern TCpTable cpTable[];
@@ -246,7 +246,7 @@ extern CREOleCallback2 reOleCallback2; int LoadSendRecvMessageModule(void);
int SplitmsgShutdown(void);
-void LogErrorMessage(HWND hwndDlg, TWindowData *dat, int i, TCHAR *szMsg);
+void LogErrorMessage(HWND hwndDlg, TWindowData *dat, int i, wchar_t *szMsg);
int Chat_Load(), Chat_Unload();
void FreeLogFonts();
void ImageDataInsertBitmap(IRichEditOle *ole, HBITMAP hBm);
diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp index 0ac8a44021..224053c4c8 100644 --- a/plugins/TabSRMM/src/taskbar.cpp +++ b/plugins/TabSRMM/src/taskbar.cpp @@ -515,7 +515,7 @@ void CProxyWindow::Invalidate() const * update the thumb title string (usually, the nickname)
* @param tszTitle: new title string
*/
-void CProxyWindow::updateTitle(const TCHAR *tszTitle) const
+void CProxyWindow::updateTitle(const wchar_t *tszTitle) const
{
if (m_hwndProxy && tszTitle)
::SetWindowText(m_hwndProxy, tszTitle);
diff --git a/plugins/TabSRMM/src/taskbar.h b/plugins/TabSRMM/src/taskbar.h index 8a66d5a8ba..1d97f22a39 100644 --- a/plugins/TabSRMM/src/taskbar.h +++ b/plugins/TabSRMM/src/taskbar.h @@ -101,7 +101,7 @@ public: ~CProxyWindow();
void updateIcon(const HICON hIcon) const;
- void updateTitle(const TCHAR *tszTitle) const;
+ void updateTitle(const wchar_t *tszTitle) const;
void setBigIcon(const HICON hIcon, bool fInvalidate = true);
void setOverlayIcon(const HICON hIcon, bool fInvalidate = true);
void activateTab() const;
@@ -181,7 +181,7 @@ public: void unRegisterTab(const HWND hwndTab) const;
void SetTabActive(const HWND hwndTab, const HWND hwndGroup) const;
- //const TCHAR* getFileNameFromWindow (const HWND hWnd);
+ //const wchar_t* getFileNameFromWindow (const HWND hWnd);
private:
ITaskbarList3 *m_pTaskbarInterface;
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 64f4d77917..9ad2b93557 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -84,7 +84,7 @@ static void LoadTemplatesFrom(TTemplateSet *tSet, MCONTACT hContact, int rtl) if (db_get_ts(hContact, rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[i], &dbv)) continue; if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) - _tcsncpy_s(tSet->szTemplates[i], dbv.ptszVal, _TRUNCATE); + wcsncpy_s(tSet->szTemplates[i], dbv.ptszVal, _TRUNCATE); db_free(&dbv); } } @@ -247,10 +247,10 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP break; case IDC_SAVETEMPLATE: { - TCHAR newTemplate[TEMPLATE_LENGTH + 2]; + wchar_t newTemplate[TEMPLATE_LENGTH + 2]; GetDlgItemText(hwndDlg, IDC_EDITTEMPLATE, newTemplate, _countof(newTemplate)); - memcpy(tSet->szTemplates[teInfo->inEdit], newTemplate, sizeof(TCHAR) * TEMPLATE_LENGTH); + memcpy(tSet->szTemplates[teInfo->inEdit], newTemplate, sizeof(wchar_t) * TEMPLATE_LENGTH); teInfo->changed = FALSE; teInfo->updateInfo[teInfo->inEdit] = FALSE; Utils::enableDlgControl(hwndDlg, IDC_SAVETEMPLATE, FALSE); @@ -282,7 +282,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP teInfo->changed = FALSE; teInfo->updateInfo[teInfo->inEdit] = FALSE; teInfo->selchanging = TRUE; - memcpy(tSet->szTemplates[teInfo->inEdit], LTR_Default.szTemplates[teInfo->inEdit], sizeof(TCHAR) * TEMPLATE_LENGTH); + memcpy(tSet->szTemplates[teInfo->inEdit], LTR_Default.szTemplates[teInfo->inEdit], sizeof(wchar_t) * TEMPLATE_LENGTH); SetDlgItemText(hwndDlg, IDC_EDITTEMPLATE, tSet->szTemplates[teInfo->inEdit]); db_unset(teInfo->hContact, teInfo->rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[teInfo->inEdit]); SetFocus(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE)); @@ -334,10 +334,10 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP case DM_UPDATETEMPLATEPREVIEW: { DBEVENTINFO dbei = { 0 }; int iIndex = SendDlgItemMessage(hwndDlg, IDC_TEMPLATELIST, LB_GETCURSEL, 0, 0); - TCHAR szTemp[TEMPLATE_LENGTH + 2]; + wchar_t szTemp[TEMPLATE_LENGTH + 2]; if (teInfo->changed) { - memcpy(szTemp, tSet->szTemplates[teInfo->inEdit], (TEMPLATE_LENGTH * sizeof(TCHAR))); + memcpy(szTemp, tSet->szTemplates[teInfo->inEdit], (TEMPLATE_LENGTH * sizeof(wchar_t))); GetDlgItemText(hwndDlg, IDC_EDITTEMPLATE, tSet->szTemplates[teInfo->inEdit], TEMPLATE_LENGTH); } dbei.szModule = dat->szProto; @@ -361,7 +361,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP StreamInEvents(hwndDlg, 0, 1, 0, &dbei); SendDlgItemMessage(hwndDlg, IDC_PREVIEW, EM_SETSEL, -1, -1); if (teInfo->changed) - memcpy(tSet->szTemplates[teInfo->inEdit], szTemp, TEMPLATE_LENGTH * sizeof(TCHAR)); + memcpy(tSet->szTemplates[teInfo->inEdit], szTemp, TEMPLATE_LENGTH * sizeof(wchar_t)); break; } case WM_DESTROY: diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp index 204a1fa8f2..96cbe340d7 100644 --- a/plugins/TabSRMM/src/themeio.cpp +++ b/plugins/TabSRMM/src/themeio.cpp @@ -166,7 +166,7 @@ static struct _tagFontBlocks { NULL, 0, 0, NULL
};
-int TSAPI CheckThemeVersion(const TCHAR *szIniFilename)
+int TSAPI CheckThemeVersion(const wchar_t *szIniFilename)
{
int cookie = GetPrivateProfileInt(L"TabSRMM Theme", L"Cookie", 0, szIniFilename);
int version = GetPrivateProfileInt(L"TabSRMM Theme", L"Version", 0, szIniFilename);
@@ -176,7 +176,7 @@ int TSAPI CheckThemeVersion(const TCHAR *szIniFilename) return 0;
}
-void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, TWindowData *dat)
+void TSAPI WriteThemeToINI(const wchar_t *szIniFilenameT, TWindowData *dat)
{
int i, n = 0;
DBVARIANT dbv;
@@ -244,7 +244,7 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, TWindowData *dat) mir_free(szIniFilename);
}
-void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, int noAdvanced, DWORD dwFlags)
+void TSAPI ReadThemeFromINI(const wchar_t *szIniFilenameT, TContainerData *dat, int noAdvanced, DWORD dwFlags)
{
char szBuf[512], szTemp[100], szAppname[100];
int i, n = 0;
@@ -385,9 +385,9 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in db_set_utf(NULL, TEMPLATES_MODULE, TemplateNames[i], szTemplateBuffer);
decoded = mir_utf8decodeW(szTemplateBuffer);
if (dat == 0)
- _tcsncpy_s(LTR_Active.szTemplates[i], decoded, _TRUNCATE);
+ wcsncpy_s(LTR_Active.szTemplates[i], decoded, _TRUNCATE);
else
- _tcsncpy_s(dat->ltr_templates->szTemplates[i], decoded, _TRUNCATE);
+ wcsncpy_s(dat->ltr_templates->szTemplates[i], decoded, _TRUNCATE);
mir_free(decoded);
}
@@ -398,9 +398,9 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in db_set_utf(NULL, RTLTEMPLATES_MODULE, TemplateNames[i], szTemplateBuffer);
decoded = mir_utf8decodeW(szTemplateBuffer);
if (dat == 0)
- _tcsncpy_s(RTL_Active.szTemplates[i], decoded, _TRUNCATE);
+ wcsncpy_s(RTL_Active.szTemplates[i], decoded, _TRUNCATE);
else
- _tcsncpy_s(dat->rtl_templates->szTemplates[i], decoded, _TRUNCATE);
+ wcsncpy_s(dat->rtl_templates->szTemplates[i], decoded, _TRUNCATE);
mir_free(decoded);
}
}
@@ -414,17 +414,17 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in * iMode = 0 - GetOpenFilename, otherwise, GetSaveAs...
*/
-const TCHAR* TSAPI GetThemeFileName(int iMode)
+const wchar_t* TSAPI GetThemeFileName(int iMode)
{
- static TCHAR szFilename[MAX_PATH];
+ static wchar_t szFilename[MAX_PATH];
OPENFILENAME ofn = { 0 };
- TCHAR szInitialDir[MAX_PATH];
+ wchar_t szInitialDir[MAX_PATH];
- _tcsncpy_s(szInitialDir, M.getSkinPath(), _TRUNCATE);
+ wcsncpy_s(szInitialDir, M.getSkinPath(), _TRUNCATE);
szFilename[0] = 0;
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s%c*.tabsrmm%c%c", TranslateT("TabSRMM themes"), 0, 0, 0);
ofn.lpstrFilter = filter;
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 48c0a11bce..740f69c74b 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -108,10 +108,10 @@ AeroEffect *CSkin::m_pCurrentAeroEffect = 0; AeroEffect CSkin::m_aeroEffects[AERO_EFFECT_LAST] = {
{
- LPGENT("No effect"), 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0
+ LPGENW("No effect"), 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0
},
{
- LPGENT("Milky Glass"),
+ LPGENW("Milky Glass"),
0xf5f5f5, /* base color */
0xaaaaaa, /* gradient color */
70, /* base alpha */
@@ -126,7 +126,7 @@ AeroEffect CSkin::m_aeroEffects[AERO_EFFECT_LAST] = { AeroEffectCallback_Milk /* callback function to render the effect */
},
{
- LPGENT("Carbon"),
+ LPGENW("Carbon"),
0xf0f0f0,
0x000000,
75,
@@ -141,7 +141,7 @@ AeroEffect CSkin::m_aeroEffects[AERO_EFFECT_LAST] = { AeroEffectCallback_Carbon
},
{
- LPGENT("Semi transparent, custom colors"),
+ LPGENW("Semi transparent, custom colors"),
0xffffff,
0x444444,
60,
@@ -156,7 +156,7 @@ AeroEffect CSkin::m_aeroEffects[AERO_EFFECT_LAST] = { AeroEffectCallback_Solid
},
{
- LPGENT("Silver shadow"),
+ LPGENW("Silver shadow"),
0xffffff,
0xa0a0a0,
80,
@@ -171,7 +171,7 @@ AeroEffect CSkin::m_aeroEffects[AERO_EFFECT_LAST] = { AeroEffectCallback_Solid
},
{
- LPGENT("Custom (use own gradient colors)"),
+ LPGENW("Custom (use own gradient colors)"),
0xffffff,
0xa0a0a0,
80,
@@ -732,7 +732,7 @@ static CSkinItem StatusItem_Default = { static struct
{
- TCHAR *szIniKey, *szIniName;
+ wchar_t *szIniKey, *szIniName;
char *szSetting;
unsigned int size;
int defaultval;
@@ -750,7 +750,7 @@ static struct NULL, NULL, NULL, 0, 0
};
-void CImageItem::Create(const TCHAR *szImageFile)
+void CImageItem::Create(const wchar_t *szImageFile)
{
HBITMAP hbm = LoadPNG(szImageFile);
BITMAP bm;
@@ -795,15 +795,15 @@ void CImageItem::Create(const TCHAR *szImageFile) // @return char*: full path and filename to the .png image which represents this image item.
// caller MUST delete it.
-TCHAR* CImageItem::Read(const TCHAR *szFilename)
+wchar_t* CImageItem::Read(const wchar_t *szFilename)
{
- TCHAR buffer[501];
- TCHAR szDrive[MAX_PATH], szPath[MAX_PATH];
- TCHAR *szFinalName = 0;
+ wchar_t buffer[501];
+ wchar_t szDrive[MAX_PATH], szPath[MAX_PATH];
+ wchar_t *szFinalName = 0;
GetPrivateProfileString(m_szName, L"Glyph", L"None", buffer, 500, szFilename);
if (mir_tstrcmp(buffer, L"None")) {
- _stscanf(buffer, L"%d,%d,%d,%d", &m_glyphMetrics[0], &m_glyphMetrics[1],
+ swscanf(buffer, L"%d,%d,%d,%d", &m_glyphMetrics[0], &m_glyphMetrics[1],
&m_glyphMetrics[2], &m_glyphMetrics[3]);
if (m_glyphMetrics[2] > m_glyphMetrics[0] && m_glyphMetrics[3] > m_glyphMetrics[1]) {
m_dwFlags |= IMAGE_GLYPH;
@@ -814,10 +814,10 @@ TCHAR* CImageItem::Read(const TCHAR *szFilename) GetPrivateProfileString(m_szName, L"Image", L"None", buffer, 500, szFilename);
if (mir_tstrcmp(buffer, L"None") || m_dwFlags & IMAGE_GLYPH) {
- szFinalName = new TCHAR[MAX_PATH];
+ szFinalName = new wchar_t[MAX_PATH];
//strncpy(m_szName, &m_szName[1], sizeof(m_szName));
//m_szName[sizeof(m_szName) - 1] = 0;
- _tsplitpath(szFilename, szDrive, szPath, NULL, NULL);
+ _wsplitpath(szFilename, szDrive, szPath, NULL, NULL);
mir_sntprintf(szFinalName, MAX_PATH, L"%s\\%s%s", szDrive, szPath, buffer);
if (!PathFileExists(szFinalName)) {
delete[] szFinalName;
@@ -999,7 +999,7 @@ void CImageItem::Colorize(HBITMAP hBitmap, BYTE dr, BYTE dg, BYTE db, BYTE alpha /////////////////////////////////////////////////////////////////////////////////////////
// load PNG image using core service(advaimg)
-HBITMAP TSAPI CImageItem::LoadPNG(const TCHAR *szFilename)
+HBITMAP TSAPI CImageItem::LoadPNG(const wchar_t *szFilename)
{
HBITMAP hBitmap = 0;
hBitmap = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFilename, IMGL_TCHAR);
@@ -1195,19 +1195,19 @@ void CSkin::Unload() m_DisableScrollbars = M.GetByte("disableVScroll", 0) ? true : false;
}
-void CSkin::LoadIcon(const TCHAR *szSection, const TCHAR *name, HICON &hIcon)
+void CSkin::LoadIcon(const wchar_t *szSection, const wchar_t *name, HICON &hIcon)
{
if (hIcon != 0)
DestroyIcon(hIcon);
- TCHAR buffer[512];
+ wchar_t buffer[512];
GetPrivateProfileString(szSection, name, L"none", buffer, 250, m_tszFileName);
buffer[500] = 0;
if (mir_tstrcmpi(buffer, L"none")) {
- TCHAR szDrive[MAX_PATH], szDir[MAX_PATH], szImagePath[MAX_PATH];
+ wchar_t szDrive[MAX_PATH], szDir[MAX_PATH], szImagePath[MAX_PATH];
- _tsplitpath(m_tszFileName, szDrive, szDir, NULL, NULL);
+ _wsplitpath(m_tszFileName, szDrive, szDir, NULL, NULL);
mir_sntprintf(szImagePath, L"%s\\%s\\%s", szDrive, szDir, buffer);
hIcon = (HICON)LoadImage(0, szImagePath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
}
@@ -1224,10 +1224,10 @@ void CSkin::LoadIcon(const TCHAR *szSection, const TCHAR *name, HICON &hIcon) // @param szItem char *: the section name in the ini file which holds the definition for this
// item.
-void CSkin::ReadItem(const int id, const TCHAR *szItem)
+void CSkin::ReadItem(const int id, const wchar_t *szItem)
{
- TCHAR buffer[512];
- TCHAR def_color[20];
+ wchar_t buffer[512];
+ wchar_t def_color[20];
COLORREF clr;
CSkinItem *defaults = &StatusItem_Default;
@@ -1250,26 +1250,26 @@ void CSkin::ReadItem(const int id, const TCHAR *szItem) this_item->CORNER = defaults->CORNER & CORNER_ACTIVE ? defaults->CORNER : 0;
GetPrivateProfileString(szItem, L"Corner", L"None", buffer, 400, m_tszFileName);
- if (_tcsstr(buffer, L"tl"))
+ if (wcsstr(buffer, L"tl"))
this_item->CORNER |= CORNER_TL;
- if (_tcsstr(buffer, L"tr"))
+ if (wcsstr(buffer, L"tr"))
this_item->CORNER |= CORNER_TR;
- if (_tcsstr(buffer, L"bl"))
+ if (wcsstr(buffer, L"bl"))
this_item->CORNER |= CORNER_BL;
- if (_tcsstr(buffer, L"br"))
+ if (wcsstr(buffer, L"br"))
this_item->CORNER |= CORNER_BR;
if (this_item->CORNER)
this_item->CORNER |= CORNER_ACTIVE;
this_item->GRADIENT = defaults->GRADIENT & GRADIENT_ACTIVE ? defaults->GRADIENT : 0;
GetPrivateProfileString(szItem, L"Gradient", L"None", buffer, 400, m_tszFileName);
- if (_tcsstr(buffer, L"left"))
+ if (wcsstr(buffer, L"left"))
this_item->GRADIENT = GRADIENT_RL;
- else if (_tcsstr(buffer, L"right"))
+ else if (wcsstr(buffer, L"right"))
this_item->GRADIENT = GRADIENT_LR;
- else if (_tcsstr(buffer, L"up"))
+ else if (wcsstr(buffer, L"up"))
this_item->GRADIENT = GRADIENT_BT;
- else if (_tcsstr(buffer, L"down"))
+ else if (wcsstr(buffer, L"down"))
this_item->GRADIENT = GRADIENT_TB;
if (this_item->GRADIENT)
this_item->GRADIENT |= GRADIENT_ACTIVE;
@@ -1291,13 +1291,13 @@ void CSkin::ReadItem(const int id, const TCHAR *szItem) //
// @param itemname char *: image item name, also section name in the .tsk file
-void CSkin::ReadImageItem(const TCHAR *itemname)
+void CSkin::ReadImageItem(const wchar_t *itemname)
{
- TCHAR buffer[512], szItemNr[30];
+ wchar_t buffer[512], szItemNr[30];
CImageItem tmpItem(itemname);
- TCHAR *szImageFileName = tmpItem.Read(m_tszFileName);
+ wchar_t *szImageFileName = tmpItem.Read(m_tszFileName);
if (!mir_tstrcmpi(itemname, L"$glyphs") && szImageFileName != 0) { // the glyph item MUST have a valid image
tmpItem.Create(szImageFileName);
@@ -1370,7 +1370,7 @@ void CSkin::Load(void) int i = 1, j = 0;
UINT data;
- TCHAR buffer[500];
+ wchar_t buffer[500];
if (!(GetPrivateProfileInt(L"Global", L"Version", 0, m_tszFileName) >= 1 && GetPrivateProfileInt(L"Global", L"Signature", 0, m_tszFileName) == 101))
return;
@@ -1401,11 +1401,11 @@ void CSkin::Load(void) m_DisableScrollbars = M.GetByte("disableVScroll", 0) ? true : false;
- TCHAR *szSections = (TCHAR*)mir_alloc(6004);
+ wchar_t *szSections = (wchar_t*)mir_alloc(6004);
memset(szSections, 0, 6000);
GetPrivateProfileSectionNames(szSections, 3000, m_tszFileName);
szSections[3001] = szSections[3000] = 0;
- TCHAR *p = szSections;
+ wchar_t *p = szSections;
while (mir_tstrlen(p) > 1) {
if (p[0] != '%') {
p += (mir_tstrlen(p) + 1);
@@ -1464,8 +1464,8 @@ void CSkin::Load(void) m_bClipBorder = GetPrivateProfileInt(L"WindowFrame", L"ClipFrame", 0, m_tszFileName) ? true : false;
BYTE radius_tl, radius_tr, radius_bl, radius_br;
- TCHAR szFinalName[MAX_PATH];
- TCHAR szDrive[MAX_PATH], szPath[MAX_PATH];
+ wchar_t szFinalName[MAX_PATH];
+ wchar_t szDrive[MAX_PATH], szPath[MAX_PATH];
radius_tl = GetPrivateProfileInt(L"WindowFrame", L"RadiusTL", 0, m_tszFileName);
radius_tr = GetPrivateProfileInt(L"WindowFrame", L"RadiusTR", 0, m_tszFileName);
@@ -1476,7 +1476,7 @@ void CSkin::Load(void) GetPrivateProfileString(L"Theme", L"File", L"None", buffer, MAX_PATH, m_tszFileName);
- _tsplitpath(m_tszFileName, szDrive, szPath, NULL, NULL);
+ _wsplitpath(m_tszFileName, szDrive, szPath, NULL, NULL);
mir_sntprintf(szFinalName, L"%s\\%s\\%s", szDrive, szPath, buffer);
if (PathFileExists(szFinalName)) {
ReadThemeFromINI(szFinalName, 0, FALSE, m_fLoadOnStartup ? 0 : M.GetByte("skin_loadmode", 0));
@@ -1523,8 +1523,8 @@ void CSkin::Load(void) void CSkin::LoadItems()
{
- TCHAR *szSections = NULL;
- TCHAR *p, *p1;
+ wchar_t *szSections = NULL;
+ wchar_t *p, *p1;
TIconDesc tmpIconDesc = { 0 };
if (m_skinIcons == NULL)
@@ -1532,15 +1532,15 @@ void CSkin::LoadItems() m_nrSkinIcons = 0;
- szSections = (TCHAR*)mir_alloc((SECT_BUFFER_SIZE + 2) * sizeof(TCHAR));
- memset(szSections, 0, ((SECT_BUFFER_SIZE + 2) * sizeof(TCHAR)));
+ szSections = (wchar_t*)mir_alloc((SECT_BUFFER_SIZE + 2) * sizeof(wchar_t));
+ memset(szSections, 0, ((SECT_BUFFER_SIZE + 2) * sizeof(wchar_t)));
GetPrivateProfileSection(L"Icons", szSections, SECT_BUFFER_SIZE, m_tszFileName);
szSections[SECT_BUFFER_SIZE] = 0;
p = szSections;
while (mir_tstrlen(p) > 1) {
- p1 = _tcschr(p, (int)'=');
+ p1 = wcschr(p, (int)'=');
if (p1)
*p1 = 0;
if (m_nrSkinIcons < NR_MAXSKINICONS && p1) {
@@ -1549,7 +1549,7 @@ void CSkin::LoadItems() memset(&m_skinIcons[m_nrSkinIcons], 0, sizeof(TIconDesc));
m_skinIcons[m_nrSkinIcons].uId = tmpIconDesc.uId;
m_skinIcons[m_nrSkinIcons].phIcon = (HICON *)(&m_skinIcons[m_nrSkinIcons].uId);
- m_skinIcons[m_nrSkinIcons].szName = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(p) + 1));
+ m_skinIcons[m_nrSkinIcons].szName = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(p) + 1));
mir_tstrcpy(m_skinIcons[m_nrSkinIcons].szName, p);
m_nrSkinIcons++;
}
@@ -1559,7 +1559,7 @@ void CSkin::LoadItems() p += (mir_tstrlen(p) + 1);
}
- memset(szSections, 0, ((SECT_BUFFER_SIZE + 2) * sizeof(TCHAR)));
+ memset(szSections, 0, ((SECT_BUFFER_SIZE + 2) * sizeof(wchar_t)));
GetPrivateProfileSectionNames(szSections, SECT_BUFFER_SIZE, m_tszFileName);
szSections[SECT_BUFFER_SIZE] = 0;
@@ -1666,8 +1666,8 @@ void CSkin::setupAeroSkins() if (!m_fAeroSkinsValid)
return;
- TCHAR tszFilename[MAX_PATH], tszBasePath[MAX_PATH];
- _tcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE);
+ wchar_t tszFilename[MAX_PATH], tszBasePath[MAX_PATH];
+ wcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE);
if (tszBasePath[mir_tstrlen(tszBasePath) - 1] != '\\')
mir_tstrcat(tszBasePath, L"\\");
@@ -2034,16 +2034,16 @@ UINT CSkin::DrawRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID, /////////////////////////////////////////////////////////////////////////////////////////
// convert a html-style color string (without the #) to a 32bit COLORREF value
//
-// @param szSource TCHAR*: the color value as string. format:
+// @param szSource wchar_t*: the color value as string. format:
// html-style without the leading #. e.g.
// "f3e355"
//
// @return COLORREF representation of the string value.
-DWORD __fastcall CSkin::HexStringToLong(const TCHAR *szSource)
+DWORD __fastcall CSkin::HexStringToLong(const wchar_t *szSource)
{
- TCHAR *stopped;
- COLORREF clr = _tcstol(szSource, &stopped, 16);
+ wchar_t *stopped;
+ COLORREF clr = wcstol(szSource, &stopped, 16);
if (clr == -1)
return clr;
return(RGB(GetBValue(clr), GetGValue(clr), GetRValue(clr)));
@@ -2053,7 +2053,7 @@ DWORD __fastcall CSkin::HexStringToLong(const TCHAR *szSource) // Render text to the given HDC. This function is aero aware and will use uxtheme DrawThemeTextEx() when needed.
// Paramaters are pretty much comparable to GDI DrawText() API
-int CSkin::RenderText(HDC hdc, HANDLE hTheme, const TCHAR *szText, RECT *rc, DWORD dtFlags, const int iGlowSize, COLORREF clr, bool fForceAero)
+int CSkin::RenderText(HDC hdc, HANDLE hTheme, const wchar_t *szText, RECT *rc, DWORD dtFlags, const int iGlowSize, COLORREF clr, bool fForceAero)
{
if ((PluginConfig.m_bIsVista && !CSkin::m_skinEnabled && hTheme) || fForceAero) {
DTTOPTS dto = { 0 };
@@ -2437,8 +2437,8 @@ void CSkin::setAeroEffect(LRESULT effect) void CSkin::extractSkinsAndLogo(bool fForceOverwrite) const
{
- TCHAR tszBasePath[MAX_PATH];
- _tcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE);
+ wchar_t tszBasePath[MAX_PATH];
+ wcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE);
if (tszBasePath[mir_tstrlen(tszBasePath) - 1] != '\\')
mir_tstrcat(tszBasePath, L"\\");
diff --git a/plugins/TabSRMM/src/themes.h b/plugins/TabSRMM/src/themes.h index 0c5d1cf32a..32d3ac2d2d 100644 --- a/plugins/TabSRMM/src/themes.h +++ b/plugins/TabSRMM/src/themes.h @@ -33,7 +33,7 @@ #ifndef __THEMES_H
#define __THEMES_H
-HBITMAP IMG_LoadLogo(const TCHAR *szName);
+HBITMAP IMG_LoadLogo(const wchar_t *szName);
class CSideBarButton;
@@ -118,7 +118,7 @@ void CustomizeButton(HWND hwndButton); struct AeroEffect
{
- TCHAR tszName[40];
+ wchar_t tszName[40];
DWORD m_baseColor;
DWORD m_gradientColor;
BYTE m_baseAlpha;
@@ -148,7 +148,7 @@ public: *this = From;
m_nextItem = 0;
}
- CImageItem(const TCHAR *szName)
+ CImageItem(const wchar_t *szName)
{
memset(this, 0, sizeof(CImageItem));
mir_sntprintf(m_szName, szName);
@@ -220,19 +220,19 @@ public: const BLENDFUNCTION &bf = m_bf;
return(bf);
}
- const TCHAR* getName() const { return (m_szName); }
- TCHAR* Read(const TCHAR *szFilename);
- void Create(const TCHAR *szImageFile);
+ const wchar_t* getName() const { return (m_szName); }
+ wchar_t* Read(const wchar_t *szFilename);
+ void Create(const wchar_t *szImageFile);
void __fastcall Render(const HDC hdc, const RECT *rc, bool fIgnoreGlyph) const;
static void TSAPI PreMultiply(HBITMAP hBitmap, int mode);
static void TSAPI SetBitmap32Alpha(HBITMAP hBitmap, BYTE bAlpha = 255);
static void TSAPI Colorize(HBITMAP hBitmap, BYTE dr, BYTE dg, BYTE db, BYTE alpha = 0);
- static HBITMAP TSAPI LoadPNG(const TCHAR *szFilename);
+ static HBITMAP TSAPI LoadPNG(const wchar_t *szFilename);
public:
bool m_fValid; // verified item, indicates that all parameters are valid
private:
- TCHAR m_szName[40]; // everything wants a name, an image item doesn't need one though
+ wchar_t m_szName[40]; // everything wants a name, an image item doesn't need one though
HBITMAP m_hbm; // the bitmap handle
BYTE m_bLeft, m_bRight, m_bTop, m_bBottom; // sizing margins for the outer 8 image parts
BYTE m_alpha; // constant alpha for the entire image, applied via m_bf. sums with perpixel alpha
@@ -250,7 +250,7 @@ private: struct CSkinItem {
- TCHAR szName[40];
+ wchar_t szName[40];
char szDBname[40];
int statusID;
@@ -335,11 +335,11 @@ public: void Unload();
void UnloadAeroTabs();
void setFileName();
- void ReadItem(const int id, const TCHAR *section);
+ void ReadItem(const int id, const wchar_t *section);
void LoadItems();
- void LoadIcon(const TCHAR *szSection, const TCHAR *name, HICON &hIcon);
- void ReadImageItem(const TCHAR *szItemName);
- void ReadButtonItem(const TCHAR *itemName) const;
+ void LoadIcon(const wchar_t *szSection, const wchar_t *name, HICON &hIcon);
+ void ReadImageItem(const wchar_t *szItemName);
+ void ReadButtonItem(const wchar_t *itemName) const;
bool haveGlyphItem() const { return(m_fHaveGlyph); }
int getNrIcons() const { return(m_nrSkinIcons); }
DWORD getDwmColor() const { return(m_dwmColor); }
@@ -370,11 +370,11 @@ public: static void TSAPI SkinDrawBGFromDC(HWND hwndClient, HWND hwnd, RECT *rcClient, HDC hdcTarget);
static void TSAPI SkinDrawBG(HWND hwndClient, HWND hwnd, TContainerData *pContainer, RECT *rcClient, HDC hdcTarget);
static void TSAPI DrawDimmedIcon(HDC hdc, LONG left, LONG top, LONG dx, LONG dy, HICON hIcon, BYTE alpha);
- static DWORD __fastcall HexStringToLong(const TCHAR *szSource);
+ static DWORD __fastcall HexStringToLong(const wchar_t *szSource);
static UINT TSAPI DrawRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID, UINT msg, WPARAM wParam, LPARAM lParam, WNDPROC OldWndProc);
static UINT TSAPI NcCalcRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID, UINT msg, WPARAM wParam, LPARAM lParam, WNDPROC OldWndProc);
static HBITMAP TSAPI CreateAeroCompatibleBitmap(const RECT &rc, HDC dc);
- static int TSAPI RenderText(HDC hdc, HANDLE hTheme, const TCHAR *szText, RECT *rc, DWORD dtFlags, const int iGlowSize = DEFAULT_GLOW_SIZE, COLORREF clr = 0, bool fForceAero = false);
+ static int TSAPI RenderText(HDC hdc, HANDLE hTheme, const wchar_t *szText, RECT *rc, DWORD dtFlags, const int iGlowSize = DEFAULT_GLOW_SIZE, COLORREF clr = 0, bool fForceAero = false);
static void TSAPI MapClientToParent(HWND hwndClient, HWND hwndParent, RECT &rc);
static void TSAPI RenderToolbarBG(const TWindowData *dat, HDC hdc, const RECT &rcWindow);
static HBITMAP TSAPI ResizeBitmap(HBITMAP hBmpSrc, LONG width, LONG height, bool &mustFree);
@@ -431,7 +431,7 @@ public: static bool m_fAeroSkinsValid;
private:
- TCHAR m_tszFileName[MAX_PATH]; // full path and filename of the currently loaded skin
+ wchar_t m_tszFileName[MAX_PATH]; // full path and filename of the currently loaded skin
CSkinItem* m_SkinItems;
CImageItem* m_ImageItems; // the list of image item objects
CImageItem m_glyphItem;
@@ -484,7 +484,7 @@ extern CSkin *Skin; */
struct ButtonItem {
- TCHAR szName[40];
+ wchar_t szName[40];
HWND hWnd;
LONG xOff, yOff;
LONG width, height;
@@ -494,14 +494,14 @@ struct ButtonItem { LONG_PTR pressedGlyphMetrics[4];
DWORD dwFlags, dwStockFlags;
DWORD uId;
- TCHAR szTip[256];
+ wchar_t szTip[256];
char szService[256];
char szModule[256], szSetting[256];
BYTE bValuePush[256], bValueRelease[256];
DWORD type;
void(*pfnAction)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem);
void(*pfnCallback)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem);
- TCHAR tszLabel[40];
+ wchar_t tszLabel[40];
ButtonItem* nextItem;
HANDLE hContact;
TWindowData *dat;
diff --git a/plugins/TabSRMM/src/translator.cpp b/plugins/TabSRMM/src/translator.cpp index d0893ea53c..a3ab89b044 100644 --- a/plugins/TabSRMM/src/translator.cpp +++ b/plugins/TabSRMM/src/translator.cpp @@ -30,149 +30,149 @@ TOptionListGroup m_lvGroupsModPlus[] =
{
- { 0, LPGENT("Message window tweaks") },
- { 0, LPGENT("Display metacontact icons") },
- { 0, LPGENT("Error feedback") },
+ { 0, LPGENW("Message window tweaks") },
+ { 0, LPGENW("Display metacontact icons") },
+ { 0, LPGENW("Error feedback") },
{ 0, NULL }
};
TOptionListItem m_lvItemsModPlus[] =
{
- { 0, LPGENT("Show skinnable tooltip in chat (Tipper plugin required)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"adv_TipperTooltip", 0 },
- { 0, LPGENT("Enable typing sounds"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_soundontyping", 0 },
- { 0, LPGENT("Close current tab on send"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_AutoClose_2", 0 },
- { 0, LPGENT("Automatic keyboard layout: Do not load the system default for new contacts"), 1, LOI_TYPE_SETTING, (UINT_PTR)"adv_leaveKeyboardAlone", 0 },
- { 0, LPGENT("Enable unattended send (experimental feature, required for multisend and send later) (*)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendLaterAvail", 0 },
- { 0, LPGENT("Show client description in info panel"), 1, LOI_TYPE_SETTING, (UINT_PTR)"ShowClientDescription", 0 },
- { 0, LPGENT("On tab control"), 1, LOI_TYPE_SETTING, (UINT_PTR)"MetaiconTab", 1 },
- { 0, LPGENT("On the button bar"), 0, LOI_TYPE_SETTING, (UINT_PTR)"MetaiconBar", 1 },
- { 0, LPGENT("Disable error popups on sending failures"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_noErrorPopups", 2 },
+ { 0, LPGENW("Show skinnable tooltip in chat (Tipper plugin required)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"adv_TipperTooltip", 0 },
+ { 0, LPGENW("Enable typing sounds"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_soundontyping", 0 },
+ { 0, LPGENW("Close current tab on send"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_AutoClose_2", 0 },
+ { 0, LPGENW("Automatic keyboard layout: Do not load the system default for new contacts"), 1, LOI_TYPE_SETTING, (UINT_PTR)"adv_leaveKeyboardAlone", 0 },
+ { 0, LPGENW("Enable unattended send (experimental feature, required for multisend and send later) (*)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendLaterAvail", 0 },
+ { 0, LPGENW("Show client description in info panel"), 1, LOI_TYPE_SETTING, (UINT_PTR)"ShowClientDescription", 0 },
+ { 0, LPGENW("On tab control"), 1, LOI_TYPE_SETTING, (UINT_PTR)"MetaiconTab", 1 },
+ { 0, LPGENW("On the button bar"), 0, LOI_TYPE_SETTING, (UINT_PTR)"MetaiconBar", 1 },
+ { 0, LPGENW("Disable error popups on sending failures"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_noErrorPopups", 2 },
{ 0, NULL, 0, 0, 0, 0 }
};
TOptionListItem m_lvItemsNEN[] =
{
- { 0, LPGENT("Show a preview of the event"), IDC_CHKPREVIEW, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bPreview, 1 },
- { 0, LPGENT("Don't announce event when message dialog is open"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bWindowCheck, 1 },
- { 0, LPGENT("Don't announce events from RSS protocols"), IDC_NORSS, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bNoRSS, 1 },
- { 0, LPGENT("Enable the system tray icon"), IDC_ENABLETRAYSUPPORT, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bTraySupport, 2 },
- { 0, LPGENT("Merge new events for the same contact into existing popup"), 1, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bMergePopup, 6 },
- { 0, LPGENT("Show headers"), IDC_CHKSHOWHEADERS, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bShowHeaders, 6 },
- { 0, LPGENT("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 },
- { 0, LPGENT("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 },
- { 0, LPGENT("Dismiss event"), MASK_REMOVE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 },
-
- { 0, LPGENT("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 },
- { 0, LPGENT("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 },
- { 0, LPGENT("Dismiss event"), MASK_REMOVE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 },
-
- { 0, LPGENT("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActTE, 5 },
- { 0, LPGENT("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActTE, 5 },
-
- { 0, LPGENT("Disable event notifications for instant messages"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.iDisable, 0 },
- { 0, LPGENT("Disable event notifications for group chats"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.iMUCDisable, 0 },
- { 0, LPGENT("Disable notifications for non-message events"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bDisableNonMessage, 0 },
-
- { 0, LPGENT("Remove popups for a contact when the message window is focused"), PU_REMOVE_ON_FOCUS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 },
- { 0, LPGENT("Remove popups for a contact when I start typing a reply"), PU_REMOVE_ON_TYPE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 },
- { 0, LPGENT("Remove popups for a contact when I send a reply"), PU_REMOVE_ON_SEND, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 },
+ { 0, LPGENW("Show a preview of the event"), IDC_CHKPREVIEW, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bPreview, 1 },
+ { 0, LPGENW("Don't announce event when message dialog is open"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bWindowCheck, 1 },
+ { 0, LPGENW("Don't announce events from RSS protocols"), IDC_NORSS, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bNoRSS, 1 },
+ { 0, LPGENW("Enable the system tray icon"), IDC_ENABLETRAYSUPPORT, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bTraySupport, 2 },
+ { 0, LPGENW("Merge new events for the same contact into existing popup"), 1, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bMergePopup, 6 },
+ { 0, LPGENW("Show headers"), IDC_CHKSHOWHEADERS, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bShowHeaders, 6 },
+ { 0, LPGENW("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 },
+ { 0, LPGENW("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 },
+ { 0, LPGENW("Dismiss event"), MASK_REMOVE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 },
+
+ { 0, LPGENW("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 },
+ { 0, LPGENW("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 },
+ { 0, LPGENW("Dismiss event"), MASK_REMOVE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 },
+
+ { 0, LPGENW("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActTE, 5 },
+ { 0, LPGENW("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActTE, 5 },
+
+ { 0, LPGENW("Disable event notifications for instant messages"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.iDisable, 0 },
+ { 0, LPGENW("Disable event notifications for group chats"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.iMUCDisable, 0 },
+ { 0, LPGENW("Disable notifications for non-message events"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bDisableNonMessage, 0 },
+
+ { 0, LPGENW("Remove popups for a contact when the message window is focused"), PU_REMOVE_ON_FOCUS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 },
+ { 0, LPGENW("Remove popups for a contact when I start typing a reply"), PU_REMOVE_ON_TYPE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 },
+ { 0, LPGENW("Remove popups for a contact when I send a reply"), PU_REMOVE_ON_SEND, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 },
{ 0, NULL, 0, 0, 0, 0 }
};
TOptionListGroup m_lvGroupsNEN[] =
{
- { 0, LPGENT("Disable notifications") },
- { 0, LPGENT("General options") },
- { 0, LPGENT("System tray icon") },
- { 0, LPGENT("Left click actions (popups only)") },
- { 0, LPGENT("Right click actions (popups only)") },
- { 0, LPGENT("Timeout actions (popups only)") },
- { 0, LPGENT("Combine notifications for the same contact") },
- { 0, LPGENT("Remove popups under following conditions") },
+ { 0, LPGENW("Disable notifications") },
+ { 0, LPGENW("General options") },
+ { 0, LPGENW("System tray icon") },
+ { 0, LPGENW("Left click actions (popups only)") },
+ { 0, LPGENW("Right click actions (popups only)") },
+ { 0, LPGENW("Timeout actions (popups only)") },
+ { 0, LPGENW("Combine notifications for the same contact") },
+ { 0, LPGENW("Remove popups under following conditions") },
{ 0, NULL }
};
TOptionListGroup m_lvGroupsMsg[] =
{
- { 0, LPGENT("Message window behavior") },
- { 0, LPGENT("Sending messages") },
- { 0, LPGENT("Other options") },
+ { 0, LPGENW("Message window behavior") },
+ { 0, LPGENW("Sending messages") },
+ { 0, LPGENW("Other options") },
{ 0, NULL }
};
TOptionListItem m_lvItemsMsg[] =
{
- { 0, LPGENT("Send on Shift+Enter"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendonshiftenter", 1 },
- { 0, LPGENT("Send message on 'Enter'"), SRMSGDEFSET_SENDONENTER, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_SENDONENTER, 1 },
- { 0, LPGENT("Send message on double 'Enter'"), 0, LOI_TYPE_SETTING, (UINT_PTR)"SendOnDblEnter", 1 },
- { 0, LPGENT("Minimize the message window on send"), SRMSGDEFSET_AUTOMIN, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_AUTOMIN, 1 },
- { 0, LPGENT("Close the message window on send"), 0, LOI_TYPE_SETTING, (UINT_PTR)"AutoClose", 1 },
- { 0, LPGENT("Always flash contact list and tray icon for new messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"flashcl", 0 },
- { 0, LPGENT("Delete temporary contacts on close"), 0, LOI_TYPE_SETTING, (UINT_PTR)"deletetemp", 0 },
- { 0, LPGENT("Enable \"Paste and send\" feature"), 0, LOI_TYPE_SETTING, (UINT_PTR)"pasteandsend", 1 },
- { 0, LPGENT("Allow BBCode formatting in outgoing messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendformat", 1 },
- { 0, LPGENT("Automatically split long messages (experimental, use with care)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"autosplit", 2 },
- { 0, LPGENT("Log status changes"), 0, LOI_TYPE_SETTING, (UINT_PTR)"logstatuschanges", 2 },
- { 0, LPGENT("Automatically copy selected text"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autocopy", 2 },
+ { 0, LPGENW("Send on Shift+Enter"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendonshiftenter", 1 },
+ { 0, LPGENW("Send message on 'Enter'"), SRMSGDEFSET_SENDONENTER, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_SENDONENTER, 1 },
+ { 0, LPGENW("Send message on double 'Enter'"), 0, LOI_TYPE_SETTING, (UINT_PTR)"SendOnDblEnter", 1 },
+ { 0, LPGENW("Minimize the message window on send"), SRMSGDEFSET_AUTOMIN, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_AUTOMIN, 1 },
+ { 0, LPGENW("Close the message window on send"), 0, LOI_TYPE_SETTING, (UINT_PTR)"AutoClose", 1 },
+ { 0, LPGENW("Always flash contact list and tray icon for new messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"flashcl", 0 },
+ { 0, LPGENW("Delete temporary contacts on close"), 0, LOI_TYPE_SETTING, (UINT_PTR)"deletetemp", 0 },
+ { 0, LPGENW("Enable \"Paste and send\" feature"), 0, LOI_TYPE_SETTING, (UINT_PTR)"pasteandsend", 1 },
+ { 0, LPGENW("Allow BBCode formatting in outgoing messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendformat", 1 },
+ { 0, LPGENW("Automatically split long messages (experimental, use with care)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"autosplit", 2 },
+ { 0, LPGENW("Log status changes"), 0, LOI_TYPE_SETTING, (UINT_PTR)"logstatuschanges", 2 },
+ { 0, LPGENW("Automatically copy selected text"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autocopy", 2 },
{ 0, NULL, 0, 0, 0, 0 }
};
TOptionListGroup m_lvGroupsLog[] =
{
- { 0, LPGENT("Message log appearance") },
- { 0, LPGENT("Support for external plugins") },
- { 0, LPGENT("Timestamp settings (note: timestamps also depend on your templates)") },
- { 0, LPGENT("Message log icons") },
+ { 0, LPGENW("Message log appearance") },
+ { 0, LPGENW("Support for external plugins") },
+ { 0, LPGENW("Timestamp settings (note: timestamps also depend on your templates)") },
+ { 0, LPGENW("Message log icons") },
{ 0, NULL }
};
TOptionListItem m_lvItemsLog[] =
{
- { 0, LPGENT("Show timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWTIME, 2 },
- { 0, LPGENT("Show dates in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWDATES, 2 },
- { 0, LPGENT("Show seconds in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWSECONDS, 2 },
- { 0, LPGENT("Use contacts local time (if timezone info available)"), 0, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_LOCALTIME, 2 },
- { 0, LPGENT("Draw grid lines"), 1, LOI_TYPE_FLAG, MWF_LOG_GRID, 0 },
- { 0, LPGENT("Event type icons in the message log"), 1, LOI_TYPE_FLAG, MWF_LOG_SHOWICONS, 3 },
- { 0, LPGENT("Text symbols as event markers"), 0, LOI_TYPE_FLAG, MWF_LOG_SYMBOLS, 3 },
- { 0, LPGENT("Use incoming/outgoing icons"), 1, LOI_TYPE_FLAG, MWF_LOG_INOUTICONS, 3 },
- { 0, LPGENT("Use message grouping"), 1, LOI_TYPE_FLAG, MWF_LOG_GROUPMODE, 0 },
- { 0, LPGENT("Indent message body"), 1, LOI_TYPE_FLAG, MWF_LOG_INDENT, 0 },
- { 0, LPGENT("Simple text formatting (*bold*, etc.)"), 0, LOI_TYPE_FLAG, MWF_LOG_TEXTFORMAT, 0 },
- { 0, LPGENT("Support BBCode formatting"), 1, LOI_TYPE_FLAG, MWF_LOG_BBCODE, 0 },
- { 0, LPGENT("Place a separator in the log after a window lost its foreground status"), 0, LOI_TYPE_SETTING, (UINT_PTR)"usedividers", 0 },
- { 0, LPGENT("Only place a separator when an incoming event is announced with a popup"), 0, LOI_TYPE_SETTING, (UINT_PTR)"div_popupconfig", 0 },
- { 0, LPGENT("RTL is default text direction"), 0, LOI_TYPE_FLAG, MWF_LOG_RTL, 0 },
- { 0, LPGENT("Show events at the new line (IEView Compatibility Mode)"), 1, LOI_TYPE_FLAG, MWF_LOG_NEWLINE, 1 },
- { 0, LPGENT("Underline timestamp/nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_UNDERLINE, 1 },
- { 0, LPGENT("Show timestamp after nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_SWAPNICK, 1 },
- { 0, LPGENT("Use normal templates (uncheck to use simple templates if your template set supports them)"), 1, LOI_TYPE_FLAG, MWF_LOG_NORMALTEMPLATES, 0 },
+ { 0, LPGENW("Show timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWTIME, 2 },
+ { 0, LPGENW("Show dates in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWDATES, 2 },
+ { 0, LPGENW("Show seconds in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWSECONDS, 2 },
+ { 0, LPGENW("Use contacts local time (if timezone info available)"), 0, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_LOCALTIME, 2 },
+ { 0, LPGENW("Draw grid lines"), 1, LOI_TYPE_FLAG, MWF_LOG_GRID, 0 },
+ { 0, LPGENW("Event type icons in the message log"), 1, LOI_TYPE_FLAG, MWF_LOG_SHOWICONS, 3 },
+ { 0, LPGENW("Text symbols as event markers"), 0, LOI_TYPE_FLAG, MWF_LOG_SYMBOLS, 3 },
+ { 0, LPGENW("Use incoming/outgoing icons"), 1, LOI_TYPE_FLAG, MWF_LOG_INOUTICONS, 3 },
+ { 0, LPGENW("Use message grouping"), 1, LOI_TYPE_FLAG, MWF_LOG_GROUPMODE, 0 },
+ { 0, LPGENW("Indent message body"), 1, LOI_TYPE_FLAG, MWF_LOG_INDENT, 0 },
+ { 0, LPGENW("Simple text formatting (*bold*, etc.)"), 0, LOI_TYPE_FLAG, MWF_LOG_TEXTFORMAT, 0 },
+ { 0, LPGENW("Support BBCode formatting"), 1, LOI_TYPE_FLAG, MWF_LOG_BBCODE, 0 },
+ { 0, LPGENW("Place a separator in the log after a window lost its foreground status"), 0, LOI_TYPE_SETTING, (UINT_PTR)"usedividers", 0 },
+ { 0, LPGENW("Only place a separator when an incoming event is announced with a popup"), 0, LOI_TYPE_SETTING, (UINT_PTR)"div_popupconfig", 0 },
+ { 0, LPGENW("RTL is default text direction"), 0, LOI_TYPE_FLAG, MWF_LOG_RTL, 0 },
+ { 0, LPGENW("Show events at the new line (IEView Compatibility Mode)"), 1, LOI_TYPE_FLAG, MWF_LOG_NEWLINE, 1 },
+ { 0, LPGENW("Underline timestamp/nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_UNDERLINE, 1 },
+ { 0, LPGENW("Show timestamp after nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_SWAPNICK, 1 },
+ { 0, LPGENW("Use normal templates (uncheck to use simple templates if your template set supports them)"), 1, LOI_TYPE_FLAG, MWF_LOG_NORMALTEMPLATES, 0 },
{ 0, NULL, 0, 0, 0, 0 }
};
TOptionListGroup m_lvGroupsTab[] =
{
- { 0, LPGENT("Tab options") },
- { 0, LPGENT("How to create tabs and windows for incoming messages") },
- { 0, LPGENT("Miscellaneous options") },
+ { 0, LPGENW("Tab options") },
+ { 0, LPGENW("How to create tabs and windows for incoming messages") },
+ { 0, LPGENW("Miscellaneous options") },
{ 0, NULL }
};
TOptionListItem m_lvItemsTab[] =
{
- { 0, LPGENT("Show status text on tabs"), 1, LOI_TYPE_SETTING, (UINT_PTR)"tabstatus", 0 },
- { 0, LPGENT("Prefer xStatus icons when available"), 1, LOI_TYPE_SETTING, (UINT_PTR)"use_xicons", 0 },
- { 0, LPGENT("Detailed tooltip on tabs (requires Tipper plugin)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"d_tooltips", 0 },
- { 0, LPGENT("ALWAYS activate new message sessions (has PRIORITY over the options below)"), SRMSGDEFSET_AUTOPOPUP, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_AUTOPOPUP, 1 },
- { 0, LPGENT("Automatically create new message sessions without activating them"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autotabs", 1 },
- { 0, LPGENT("New windows are minimized (the option above MUST be active)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autocontainer", 1 },
- { 0, LPGENT("Activate a minimized window when a new tab is created inside it"), 0, LOI_TYPE_SETTING, (UINT_PTR)"cpopup", 1 },
- { 0, LPGENT("Automatically switch existing tabs in minimized windows on incoming messages (ignored when using Aero Peek task bar features)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autoswitchtabs", 1 },
- { 0, LPGENT("Remember and set keyboard layout per contact"), 1, LOI_TYPE_SETTING, (UINT_PTR)"al", 2 },
- { 0, LPGENT("Close button only hides message windows"), 0, LOI_TYPE_SETTING, (UINT_PTR)"hideonclose", 2 },
- { 0, LPGENT("Allow TAB key in typing area (this will disable focus selection by TAB key)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"tabmode", 2 },
- { 0, LPGENT("Add offline contacts to multisend list"), 0, LOI_TYPE_SETTING, (UINT_PTR) "AllowOfflineMultisend", 2 },
+ { 0, LPGENW("Show status text on tabs"), 1, LOI_TYPE_SETTING, (UINT_PTR)"tabstatus", 0 },
+ { 0, LPGENW("Prefer xStatus icons when available"), 1, LOI_TYPE_SETTING, (UINT_PTR)"use_xicons", 0 },
+ { 0, LPGENW("Detailed tooltip on tabs (requires Tipper plugin)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"d_tooltips", 0 },
+ { 0, LPGENW("ALWAYS activate new message sessions (has PRIORITY over the options below)"), SRMSGDEFSET_AUTOPOPUP, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_AUTOPOPUP, 1 },
+ { 0, LPGENW("Automatically create new message sessions without activating them"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autotabs", 1 },
+ { 0, LPGENW("New windows are minimized (the option above MUST be active)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autocontainer", 1 },
+ { 0, LPGENW("Activate a minimized window when a new tab is created inside it"), 0, LOI_TYPE_SETTING, (UINT_PTR)"cpopup", 1 },
+ { 0, LPGENW("Automatically switch existing tabs in minimized windows on incoming messages (ignored when using Aero Peek task bar features)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autoswitchtabs", 1 },
+ { 0, LPGENW("Remember and set keyboard layout per contact"), 1, LOI_TYPE_SETTING, (UINT_PTR)"al", 2 },
+ { 0, LPGENW("Close button only hides message windows"), 0, LOI_TYPE_SETTING, (UINT_PTR)"hideonclose", 2 },
+ { 0, LPGENW("Allow TAB key in typing area (this will disable focus selection by TAB key)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"tabmode", 2 },
+ { 0, LPGENW("Add offline contacts to multisend list"), 0, LOI_TYPE_SETTING, (UINT_PTR) "AllowOfflineMultisend", 2 },
{ 0, NULL, 0, 0, 0, 0 }
};
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index d27a5446ca..f13c5195c5 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -33,7 +33,7 @@ static HANDLE hTrayAnimThread = 0; static HICON hIconTrayCurrent = 0;
HANDLE g_hEvent = 0;
-static TCHAR g_eventName[100];
+static wchar_t g_eventName[100];
static void TrayAnimThread(LPVOID)
{
@@ -142,7 +142,7 @@ void TSAPI CreateSystrayIcon(int create) nim.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
nim.hIcon = PluginConfig.g_iconContainer;
nim.uCallbackMessage = DM_TRAYICONNOTIFY;
- _tcsncpy_s(nim.szTip, L"tabSRMM", _TRUNCATE);
+ wcsncpy_s(nim.szTip, L"tabSRMM", _TRUNCATE);
if (create && !nen_options.bTrayExist) {
Shell_NotifyIcon(NIM_ADD, &nim);
nen_options.bTrayExist = TRUE;
@@ -189,15 +189,15 @@ void TSAPI FlashTrayIcon(HICON hIcon) * maximum number of allowed entries (20 at the moment). The oldest (topmost) entry
* is deleted, if necessary.
*/
-void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, const char *szProto, TCHAR *szStatus, WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu)
+void TSAPI AddContactToFavorites(MCONTACT hContact, const wchar_t *szNickname, const char *szProto, wchar_t *szStatus, WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu)
{
- TCHAR szMenuEntry[80];
- TCHAR szFinalNick[100];
+ wchar_t szMenuEntry[80];
+ wchar_t szFinalNick[100];
if (szNickname == NULL)
- _tcsncpy_s(szFinalNick, pcli->pfnGetContactDisplayName(hContact, 0), _TRUNCATE);
+ wcsncpy_s(szFinalNick, pcli->pfnGetContactDisplayName(hContact, 0), _TRUNCATE);
else
- _tcsncpy_s(szFinalNick, szNickname, _TRUNCATE);
+ wcsncpy_s(szFinalNick, szNickname, _TRUNCATE);
if (szProto == NULL)
szProto = GetContactProto(hContact);
@@ -236,7 +236,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con AppendMenu(hMenu, MF_BYCOMMAND, (UINT_PTR)hContact, szMenuEntry);
}
else if (hMenu == PluginConfig.g_hMenuFavorites) { // insert the item sorted...
- TCHAR szBuffer[142];
+ wchar_t szBuffer[142];
int i, c = GetMenuItemCount(PluginConfig.g_hMenuFavorites);
MENUITEMINFO mii2 = { 0 };
@@ -252,7 +252,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con mii2.cch++;
mii2.dwTypeData = szBuffer;
GetMenuItemInfo(PluginConfig.g_hMenuFavorites, i, TRUE, &mii2);
- if (_tcsncmp((TCHAR*)mii2.dwTypeData, szMenuEntry, 140) > 0 || i == c) {
+ if (wcsncmp((wchar_t*)mii2.dwTypeData, szMenuEntry, 140) > 0 || i == c) {
InsertMenu(PluginConfig.g_hMenuFavorites, i, MF_BYPOSITION, (UINT_PTR)hContact, szMenuEntry);
break;
}
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index a3a78f74cc..a9a06b6611 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -21,8 +21,8 @@ static int newTimeout2; static BYTE newTimeoutMode;
static BYTE newTimeoutMode2;
static BYTE newColorMode;
-static TCHAR szStart[128];
-static TCHAR szStop[128];
+static wchar_t szStart[128];
+static wchar_t szStop[128];
static HANDLE hntfStarted = 0;
static HANDLE hntfStopped = 0;
@@ -47,9 +47,9 @@ static INT_PTR EnableDisableMenuCommand(WPARAM, LPARAM) if (PluginConfig.g_bPopupAvail) {
if (!Disabled)
- Menu_ModifyItem(hDisableMenu, LPGENT("Disable &typing notification"), LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ENABLED)));
+ Menu_ModifyItem(hDisableMenu, LPGENW("Disable &typing notification"), LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ENABLED)));
else
- Menu_ModifyItem(hDisableMenu, LPGENT("Enable &typing notification"), LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_DISABLED)));
+ Menu_ModifyItem(hDisableMenu, LPGENW("Enable &typing notification"), LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_DISABLED)));
}
return 0;
@@ -90,7 +90,7 @@ void TN_TypingMessage(MCONTACT hContact, int iMode) if (!PluginConfig.g_bPopupAvail || Disabled)
return;
- TCHAR *szContactName = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *szContactName = pcli->pfnGetContactDisplayName(hContact, 0);
if (OnePopup) {
HWND hPopupWnd = WindowList_Find(hPopupsList, hContact);
@@ -107,16 +107,16 @@ void TN_TypingMessage(MCONTACT hContact, int iMode) if (iMode == PROTOTYPE_CONTACTTYPING_OFF) {
if (StopDisabled)
return;
- _tcsncpy_s(ppd.lptzContactName, szContactName, _TRUNCATE);
- _tcsncpy_s(ppd.lptzText, szStop, _TRUNCATE);
+ wcsncpy_s(ppd.lptzContactName, szContactName, _TRUNCATE);
+ wcsncpy_s(ppd.lptzText, szStop, _TRUNCATE);
ppd.hNotification = hntfStopped;
notyping = 1;
}
else {
if (StartDisabled)
return;
- _tcsncpy_s(ppd.lptzContactName, szContactName, _TRUNCATE);
- _tcsncpy_s(ppd.lptzText, szStart, _TRUNCATE);
+ wcsncpy_s(ppd.lptzContactName, szContactName, _TRUNCATE);
+ wcsncpy_s(ppd.lptzText, szStart, _TRUNCATE);
ppd.hNotification = hntfStarted;
notyping = 0;
}
@@ -297,13 +297,13 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA for (int i = 0; i < 2; i++) {
int notyping;
if (i == PROTOTYPE_CONTACTTYPING_OFF) {
- _tcsncpy_s(ppd.lptzContactName, TranslateT("Contact"), _TRUNCATE);
- _tcsncpy_s(ppd.lptzText, szStop, _TRUNCATE);
+ wcsncpy_s(ppd.lptzContactName, TranslateT("Contact"), _TRUNCATE);
+ wcsncpy_s(ppd.lptzText, szStop, _TRUNCATE);
notyping = 1;
}
else {
- _tcsncpy_s(ppd.lptzContactName, TranslateT("Contact"), _TRUNCATE);
- _tcsncpy_s(ppd.lptzText, szStart, _TRUNCATE);
+ wcsncpy_s(ppd.lptzContactName, TranslateT("Contact"), _TRUNCATE);
+ wcsncpy_s(ppd.lptzText, szStart, _TRUNCATE);
notyping = 0;
}
@@ -545,7 +545,7 @@ int TN_ModuleInit() mi.hIcolibItem = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_DISABLED));
}
mi.pszService = "TypingNotify/EnableDisableMenuCommand";
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Popups"), 0);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 0);
hDisableMenu = Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp index 442335bde0..39f367e2c1 100644 --- a/plugins/TabSRMM/src/userprefs.cpp +++ b/plugins/TabSRMM/src/userprefs.cpp @@ -415,7 +415,7 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP RECT rcClient;
GetClientRect(hwndDlg, &rcClient);
- TCHAR szBuffer[180];
+ wchar_t szBuffer[180];
mir_sntprintf(szBuffer, TranslateT("Set messaging options for %s"), pcli->pfnGetContactDisplayName(hContact, 0));
SetWindowText(hwndDlg, szBuffer);
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 674872b380..82918649a4 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -30,7 +30,7 @@ #include <string>
-typedef std::basic_string<TCHAR> tstring;
+typedef std::basic_string<wchar_t> tstring;
#define MWF_LOG_BBCODE 1
#define MWF_LOG_TEXTFORMAT 0x2000000
@@ -54,11 +54,11 @@ TRTFColorTable* Utils::rtf_ctable = 0; MWindowList CWarning::hWindowList = 0;
-static TCHAR *w_bbcodes_begin[] = { L"[b]", L"[i]", L"[u]", L"[s]", L"[color=" };
-static TCHAR *w_bbcodes_end[] = { L"[/b]", L"[/i]", L"[/u]", L"[/s]", L"[/color]" };
+static wchar_t *w_bbcodes_begin[] = { L"[b]", L"[i]", L"[u]", L"[s]", L"[color=" };
+static wchar_t *w_bbcodes_end[] = { L"[/b]", L"[/i]", L"[/u]", L"[/s]", L"[/color]" };
-static TCHAR *formatting_strings_begin[] = { L"b1 ", L"i1 ", L"u1 ", L"s1 ", L"c1 " };
-static TCHAR *formatting_strings_end[] = { L"b0 ", L"i0 ", L"u0 ", L"s0 ", L"c0 " };
+static wchar_t *formatting_strings_begin[] = { L"b1 ", L"i1 ", L"u1 ", L"s1 ", L"c1 " };
+static wchar_t *formatting_strings_end[] = { L"b0 ", L"i0 ", L"u0 ", L"s0 ", L"c0 " };
#define NR_CODES 5
@@ -67,13 +67,13 @@ static TCHAR *formatting_strings_end[] = { L"b0 ", L"i0 ", L"u0 ", L"s0 ", L // flags: loword = words only for simple * /_ formatting
// hiword = bbcode support (strip bbcodes if 0)
-const TCHAR* Utils::FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOOL isSent)
+const wchar_t* Utils::FormatRaw(TWindowData *dat, const wchar_t *msg, int flags, BOOL isSent)
{
bool clr_was_added = false, was_added;
static tstring message(msg);
size_t beginmark = 0, endmark = 0, tempmark = 0, index;
int i, endindex;
- TCHAR endmarker;
+ wchar_t endmarker;
DWORD dwFlags = dat->dwFlags;
message.assign(msg);
@@ -103,7 +103,7 @@ const TCHAR* Utils::FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOO search_again:
bool clr_found = false;
for (int ii = 0; ii < rtf_ctable_size; ii++) {
- if (!_tcsnicmp((TCHAR*)colorname.c_str(), rtf_ctable[ii].szName, mir_tstrlen(rtf_ctable[ii].szName))) {
+ if (!wcsnicmp((wchar_t*)colorname.c_str(), rtf_ctable[ii].szName, mir_tstrlen(rtf_ctable[ii].szName))) {
closing = beginmark + 7 + mir_tstrlen(rtf_ctable[ii].szName);
if (endmark != message.npos) {
message.erase(endmark, 4);
@@ -111,14 +111,14 @@ search_again: }
message.erase(beginmark, (closing - beginmark));
- TCHAR szTemp[5];
+ wchar_t szTemp[5];
message.insert(beginmark, L"cxxx ");
mir_sntprintf(szTemp, L"%02d", MSGDLGFONTCOUNT + 13 + ii);
message[beginmark + 3] = szTemp[0];
message[beginmark + 4] = szTemp[1];
clr_found = true;
if (was_added) {
- TCHAR wszTemp[100];
+ wchar_t wszTemp[100];
mir_sntprintf(wszTemp, L"##col##%06u:%04u", endmark - closing, ii);
wszTemp[99] = 0;
message.insert(beginmark, wszTemp);
@@ -130,7 +130,7 @@ search_again: size_t c_closing = colorname.find_first_of(L"]", 0);
if (c_closing == colorname.npos)
c_closing = colorname.length();
- const TCHAR *wszColname = colorname.c_str();
+ const wchar_t *wszColname = colorname.c_str();
if (endmark != message.npos && c_closing > 2 && c_closing <= 6 && iswalnum(colorname[0]) && iswalnum(colorname[c_closing - 1])) {
RTF_ColorAdd(wszColname, c_closing);
if (!was_added) {
@@ -166,7 +166,7 @@ invalid_code: while ((beginmark = message.find_first_of(L"*/_", beginmark)) != message.npos) {
endmarker = message[beginmark];
if (LOWORD(flags)) {
- if (beginmark > 0 && !_istspace(message[beginmark - 1]) && !_istpunct(message[beginmark - 1])) {
+ if (beginmark > 0 && !iswspace(message[beginmark - 1]) && !iswpunct(message[beginmark - 1])) {
beginmark++;
continue;
}
@@ -174,7 +174,7 @@ invalid_code: // search a corresponding endmarker which fulfills the criteria
INT_PTR mark = beginmark + 1;
while ((endmark = message.find(endmarker, mark)) != message.npos) {
- if (_istpunct(message[endmark + 1]) || _istspace(message[endmark + 1]) || message[endmark + 1] == 0 || _tcschr(L"*/_", message[endmark + 1]) != NULL)
+ if (iswpunct(message[endmark + 1]) || iswspace(message[endmark + 1]) || message[endmark + 1] == 0 || wcschr(L"*/_", message[endmark + 1]) != NULL)
goto ok;
mark = endmark + 1;
}
@@ -212,7 +212,7 @@ ok: smbp.cbSize = sizeof(smbp);
smbp.Protocolname = dat->cache->getActiveProto();
smbp.flag = SAFL_TCHAR | SAFL_PATH | (isSent ? SAFL_OUTGOING : 0);
- smbp.str = (TCHAR*)smcode.c_str();
+ smbp.str = (wchar_t*)smcode.c_str();
smbp.hContact = dat->hContact;
SMADD_BATCHPARSERES *smbpr = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&smbp);
if (smbpr) {
@@ -234,19 +234,19 @@ ok: // format the title bar string for IM chat sessions using placeholders.
// the caller must mir_free() the returned string
-static TCHAR* Trunc500(TCHAR *str)
+static wchar_t* Trunc500(wchar_t *str)
{
if (mir_tstrlen(str) > 500)
str[500] = 0;
return str;
}
-bool Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat, CMString &dest)
+bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMString &dest)
{
if (dat == 0)
return false;
- for (const TCHAR *src = szFormat; *src; src++) {
+ for (const wchar_t *src = szFormat; *src; src++) {
if (*src != '%') {
dest.AppendChar(*src);
continue;
@@ -361,7 +361,7 @@ WCHAR* Utils::FilterEventMarkers(WCHAR *wszText) /////////////////////////////////////////////////////////////////////////////////////////
-void Utils::DoubleAmpersands(TCHAR *pszText, size_t len)
+void Utils::DoubleAmpersands(wchar_t *pszText, size_t len)
{
CMString text(pszText);
text.Replace(L"&", L"&&");
@@ -373,12 +373,12 @@ void Utils::DoubleAmpersands(TCHAR *pszText, size_t len) //
// @param szText source text
// @param iMaxLen max length of the preview
-// @return TCHAR* result (caller must mir_free() it)
+// @return wchar_t* result (caller must mir_free() it)
-TCHAR* Utils::GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen)
+wchar_t* Utils::GetPreviewWithEllipsis(wchar_t *szText, size_t iMaxLen)
{
size_t uRequired;
- TCHAR *p = 0, cSaved;
+ wchar_t *p = 0, cSaved;
bool fEllipsis = false;
if (mir_tstrlen(szText) <= iMaxLen) {
@@ -398,7 +398,7 @@ TCHAR* Utils::GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen) *p = 0;
uRequired = (p - szText) + 6;
}
- TCHAR *szResult = reinterpret_cast<TCHAR *>(mir_alloc((uRequired + 1) * sizeof(TCHAR)));
+ wchar_t *szResult = reinterpret_cast<wchar_t *>(mir_alloc((uRequired + 1) * sizeof(wchar_t)));
mir_sntprintf(szResult, (uRequired + 1), fEllipsis ? L"%s..." : L"%s", szText);
if (p)
@@ -450,17 +450,17 @@ void Utils::RTF_CTableInit() /////////////////////////////////////////////////////////////////////////////////////////
// add a color to the global rtf color table
-void Utils::RTF_ColorAdd(const TCHAR *tszColname, size_t length)
+void Utils::RTF_ColorAdd(const wchar_t *tszColname, size_t length)
{
- TCHAR *stopped;
+ wchar_t *stopped;
rtf_ctable_size++;
rtf_ctable = (TRTFColorTable *)mir_realloc(rtf_ctable, sizeof(TRTFColorTable) * rtf_ctable_size);
- COLORREF clr = _tcstol(tszColname, &stopped, 16);
+ COLORREF clr = wcstol(tszColname, &stopped, 16);
mir_sntprintf(rtf_ctable[rtf_ctable_size - 1].szName, length + 1, L"%06x", clr);
rtf_ctable[rtf_ctable_size - 1].menuid = 0;
- clr = _tcstol(tszColname, &stopped, 16);
+ clr = wcstol(tszColname, &stopped, 16);
rtf_ctable[rtf_ctable_size - 1].clr = (RGB(GetBValue(clr), GetGValue(clr), GetRValue(clr)));
}
@@ -710,11 +710,11 @@ void Utils::getIconSize(HICON hIcon, int& sizeX, int& sizeY) // @param uID the item command id
// @param pos zero-based position index
-void Utils::addMenuItem(const HMENU& m, MENUITEMINFO &mii, HICON hIcon, const TCHAR *szText, UINT uID, UINT pos)
+void Utils::addMenuItem(const HMENU& m, MENUITEMINFO &mii, HICON hIcon, const wchar_t *szText, UINT uID, UINT pos)
{
mii.wID = uID;
mii.dwItemData = (ULONG_PTR)hIcon;
- mii.dwTypeData = const_cast<TCHAR *>(szText);
+ mii.dwTypeData = const_cast<wchar_t *>(szText);
mii.cch = (int)mir_tstrlen(mii.dwTypeData) + 1;
::InsertMenuItem(m, pos, TRUE, &mii);
@@ -772,7 +772,7 @@ void Utils::showDlgControl(const HWND hwnd, UINT id, int showCmd) // stream function to write the contents of the message log to an rtf file
DWORD CALLBACK Utils::StreamOut(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG * pcb)
{
- TCHAR *szFilename = (TCHAR*)dwCookie;
+ wchar_t *szFilename = (wchar_t*)dwCookie;
HANDLE hFile = CreateFile(szFilename, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
SetFilePointer(hFile, 0, NULL, FILE_END);
@@ -789,8 +789,8 @@ DWORD CALLBACK Utils::StreamOut(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG // extract a resource from the given module
// tszPath must end with \
-bool Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR *tszName, const TCHAR *tszPath,
- const TCHAR *tszFilename, bool fForceOverwrite)
+bool Utils::extractResource(const HMODULE h, const UINT uID, const wchar_t *tszName, const wchar_t *tszPath,
+ const wchar_t *tszFilename, bool fForceOverwrite)
{
HRSRC hRes = FindResource(h, MAKEINTRESOURCE(uID), tszName);
if (hRes) {
@@ -799,7 +799,7 @@ bool Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR *tszNam char *pData = (char *)LockResource(hResource);
DWORD dwSize = SizeofResource(g_hInst, hRes), written = 0;
- TCHAR szFilename[MAX_PATH];
+ wchar_t szFilename[MAX_PATH];
mir_sntprintf(szFilename, L"%s%s", tszPath, tszFilename);
if (!fForceOverwrite)
if (PathFileExists(szFilename))
@@ -817,12 +817,12 @@ bool Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR *tszNam }
/////////////////////////////////////////////////////////////////////////////////////////
-// extract the clicked URL from a rich edit control. Return the URL as TCHAR*
+// extract the clicked URL from a rich edit control. Return the URL as wchar_t*
// caller MUST mir_free() the returned string
// @param hwndRich - rich edit window handle
// @return wchar_t* extracted URL
-TCHAR* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRich)
+wchar_t* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRich)
{
CHARRANGE sel = { 0 };
::SendMessage(hwndRich, EM_EXGETSEL, 0, (LPARAM)&sel);
@@ -831,9 +831,9 @@ TCHAR* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRich) TEXTRANGE tr;
tr.chrg = _e->chrg;
- tr.lpstrText = (TCHAR*)mir_alloc(sizeof(TCHAR) * (tr.chrg.cpMax - tr.chrg.cpMin + 8));
+ tr.lpstrText = (wchar_t*)mir_alloc(sizeof(wchar_t) * (tr.chrg.cpMax - tr.chrg.cpMin + 8));
::SendMessage(hwndRich, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
- if (_tcschr(tr.lpstrText, '@') != NULL && _tcschr(tr.lpstrText, ':') == NULL && _tcschr(tr.lpstrText, '/') == NULL) {
+ if (wcschr(tr.lpstrText, '@') != NULL && wcschr(tr.lpstrText, ':') == NULL && wcschr(tr.lpstrText, '/') == NULL) {
mir_tstrncpy(tr.lpstrText, L"mailto:", 7);
mir_tstrncpy(tr.lpstrText + 7, tr.lpstrText, tr.chrg.cpMax - tr.chrg.cpMin + 1);
}
@@ -935,7 +935,7 @@ size_t Utils::CopyToClipBoard(const wchar_t *str, const HWND hwndOwner) if (!OpenClipboard(hwndOwner) || str == 0)
return 0;
- size_t i = sizeof(TCHAR) * (mir_tstrlen(str) + 1);
+ size_t i = sizeof(wchar_t) * (mir_tstrlen(str) + 1);
EmptyClipboard();
HGLOBAL hData = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, i);
@@ -950,15 +950,15 @@ size_t Utils::CopyToClipBoard(const wchar_t *str, const HWND hwndOwner) /////////////////////////////////////////////////////////////////////////////////////////
// file list handler
-void Utils::AddToFileList(TCHAR ***pppFiles, int *totalCount, LPCTSTR szFilename)
+void Utils::AddToFileList(wchar_t ***pppFiles, int *totalCount, LPCTSTR 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_tstrcpy(szPath, szFilename);
mir_tstrcat(szPath, L"\\*");
HANDLE hFind = FindFirstFile(szPath, &fd);
@@ -993,20 +993,20 @@ void Utils::AddToFileList(TCHAR ***pppFiles, int *totalCount, LPCTSTR szFilename // some strings are empty, this is intentional and used for error messages that share
// the message with other possible error notifications (popups, tool tips etc.)
//
-// Entries that do not use the LPGENT() macro are NOT TRANSLATABLE, so don't bother translating them.
+// Entries that do not use the LPGENW() macro are NOT TRANSLATABLE, so don't bother translating them.
static wchar_t* warnings[] = {
- LPGENT("Important release notes|A test warning message"), /* WARN_TEST */ /* reserved for important notes after upgrade - NOT translatable */
- LPGENT("Icon pack version check|The installed icon pack is outdated and might be incompatible with TabSRMM version 3.\n\n\\b1Missing or misplaced icons are possible issues with the currently installed icon pack.\\b0"), /* WARN_ICONPACKVERSION */
- LPGENT("Edit user notes|You are editing the user notes. Click the button again or use the hotkey (default: Alt-N) to save the notes and return to normal messaging mode"), /* WARN_EDITUSERNOTES */
- LPGENT("Missing component|The icon pack is missing. Please install it to the default icons folder.\n\nNo icons will be available"), /* WARN_ICONPACKMISSING */
- LPGENT("Aero peek warning|You have enabled Aero Peek features and loaded a custom container window skin\n\nThis can result in minor visual anomalies in the live preview feature."), /* WARN_AEROPEEKSKIN */
- LPGENT("File transfer problem|Sending the image by file transfer failed.\n\nPossible reasons: File transfers not supported, either you or the target contact is offline, or you are invisible and the target contact is not on your visibility list."), /* WARN_IMGSVC_MISSING */
- LPGENT("Settings problem|The option \\b1 History -> Imitate IEView API\\b0 is enabled and the History++ plugin is active. This can cause problems when using IEView as message log viewer.\n\nShould I correct the option (a restart is required)?"), /* WARN_HPP_APICHECK */
+ LPGENW("Important release notes|A test warning message"), /* WARN_TEST */ /* reserved for important notes after upgrade - NOT translatable */
+ LPGENW("Icon pack version check|The installed icon pack is outdated and might be incompatible with TabSRMM version 3.\n\n\\b1Missing or misplaced icons are possible issues with the currently installed icon pack.\\b0"), /* WARN_ICONPACKVERSION */
+ LPGENW("Edit user notes|You are editing the user notes. Click the button again or use the hotkey (default: Alt-N) to save the notes and return to normal messaging mode"), /* WARN_EDITUSERNOTES */
+ LPGENW("Missing component|The icon pack is missing. Please install it to the default icons folder.\n\nNo icons will be available"), /* WARN_ICONPACKMISSING */
+ LPGENW("Aero peek warning|You have enabled Aero Peek features and loaded a custom container window skin\n\nThis can result in minor visual anomalies in the live preview feature."), /* WARN_AEROPEEKSKIN */
+ LPGENW("File transfer problem|Sending the image by file transfer failed.\n\nPossible reasons: File transfers not supported, either you or the target contact is offline, or you are invisible and the target contact is not on your visibility list."), /* WARN_IMGSVC_MISSING */
+ LPGENW("Settings problem|The option \\b1 History -> Imitate IEView API\\b0 is enabled and the History++ plugin is active. This can cause problems when using IEView as message log viewer.\n\nShould I correct the option (a restart is required)?"), /* WARN_HPP_APICHECK */
L" ", /* WARN_NO_SENDLATER */ /*uses "Configuration issue|The unattended send feature is disabled. The \\b1 send later\\b0 and \\b1 send to multiple contacts\\b0 features depend on it.\n\nYou must enable it under \\b1Options -> Message sessions -> Advanced tweaks\\b0. Changing this option requires a restart." */
- LPGENT("Closing Window|You are about to close a window with multiple tabs open.\n\nProceed?"), /* WARN_CLOSEWINDOW */
- LPGENT("Closing options dialog|To reflect the changes done by importing a theme in the options dialog, the dialog must be closed after loading a theme \\b1 and unsaved changes might be lost\\b0 .\n\nDo you want to continue?"), /* WARN_OPTION_CLOSE */
- LPGENT("Loading a theme|Loading a color and font theme can overwrite the settings defined by your skin.\n\nDo you want to continue?"), /* WARN_THEME_OVERWRITE */
+ LPGENW("Closing Window|You are about to close a window with multiple tabs open.\n\nProceed?"), /* WARN_CLOSEWINDOW */
+ LPGENW("Closing options dialog|To reflect the changes done by importing a theme in the options dialog, the dialog must be closed after loading a theme \\b1 and unsaved changes might be lost\\b0 .\n\nDo you want to continue?"), /* WARN_OPTION_CLOSE */
+ LPGENW("Loading a theme|Loading a color and font theme can overwrite the settings defined by your skin.\n\nDo you want to continue?"), /* WARN_THEME_OVERWRITE */
};
CWarning::CWarning(const wchar_t *tszTitle, const wchar_t *tszText, const UINT uId, const DWORD dwFlags) :
@@ -1168,7 +1168,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP {
HICON hIcon = 0;
UINT uResId = 0;
- TCHAR temp[1024];
+ wchar_t temp[1024];
SETTEXTEX stx = { ST_SELECTION, CP_UTF8 };
size_t pos = 0;
@@ -1303,7 +1303,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP const wchar_t *wszUrl = Utils::extractURLFromRichEdit(e, ::GetDlgItem(hwnd, IDC_WARNTEXT));
if (wszUrl) {
Utils_OpenUrlW(wszUrl);
- mir_free(const_cast<TCHAR *>(wszUrl));
+ mir_free(const_cast<wchar_t *>(wszUrl));
}
}
}
diff --git a/plugins/TabSRMM/src/utils.h b/plugins/TabSRMM/src/utils.h index a5bed3cef5..245db9db97 100644 --- a/plugins/TabSRMM/src/utils.h +++ b/plugins/TabSRMM/src/utils.h @@ -38,7 +38,7 @@ struct TRTFColorTable
{
- TCHAR szName[10];
+ wchar_t szName[10];
COLORREF clr;
int menuid;
};
@@ -53,14 +53,14 @@ public: };
static int FindRTLLocale(TWindowData *dat);
- static TCHAR* GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen);
- static TCHAR* FilterEventMarkers(TCHAR *wszText);
- static LPCTSTR FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOOL isSent);
- static bool FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat, CMString &dest);
+ static wchar_t* GetPreviewWithEllipsis(wchar_t *szText, size_t iMaxLen);
+ static wchar_t* FilterEventMarkers(wchar_t *wszText);
+ static LPCTSTR FormatRaw(TWindowData *dat, const wchar_t *msg, int flags, BOOL isSent);
+ static bool FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMString &dest);
static char* FilterEventMarkers(char *szText);
- static void DoubleAmpersands(TCHAR *pszText, size_t len);
+ static void DoubleAmpersands(wchar_t *pszText, size_t len);
static void RTF_CTableInit();
- static void RTF_ColorAdd(const TCHAR *tszColname, size_t length);
+ static void RTF_ColorAdd(const wchar_t *tszColname, size_t length);
static int ReadContainerSettingsFromDB(const MCONTACT hContact, TContainerSettings *cs, const char *szKey = 0);
static int WriteContainerSettingsToDB(const MCONTACT hContact, TContainerSettings *cs, const char *szKey = 0);
static void SettingsToContainer(TContainerData *pContainer);
@@ -71,7 +71,7 @@ public: static DWORD CALLBACK StreamOut(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG * pcb);
static LRESULT CmdDispatcher(UINT uType, HWND hwndDlg, UINT cmd, WPARAM wParam, LPARAM lParam, TWindowData *dat = 0, TContainerData *pContainer = 0);
- static void addMenuItem(const HMENU& m, MENUITEMINFO& mii, HICON hIcon, const TCHAR *szText, UINT uID, UINT pos);
+ static void addMenuItem(const HMENU& m, MENUITEMINFO& mii, HICON hIcon, const wchar_t *szText, UINT uID, UINT pos);
static void enableDlgControl(const HWND hwnd, UINT id, bool fEnable = true);
static void showDlgControl(const HWND hwnd, UINT id, int showCmd);
static int mustPlaySound(const TWindowData *dat);
@@ -79,7 +79,7 @@ public: static void setAvatarContact(HWND hWnd, MCONTACT hContact);
static void getIconSize(HICON hIcon, int& sizeX, int& sizeY);
- static bool extractResource(const HMODULE h, const UINT uID, const TCHAR *tszName, const TCHAR *tszPath, const TCHAR *tszFilename, bool fForceOverwrite);
+ static bool extractResource(const HMODULE h, const UINT uID, const wchar_t *tszName, const wchar_t *tszPath, const wchar_t *tszFilename, bool fForceOverwrite);
static void scaleAvatarHeightLimited(const HBITMAP hBm, double& dNewWidth, double& dNewHeight, const LONG maxHeight);
static AVATARCACHEENTRY* loadAvatarFromAVS(const MCONTACT hContact);
@@ -96,7 +96,7 @@ public: static size_t CopyToClipBoard(const wchar_t *str, const HWND hwndOwner);
- static void AddToFileList(TCHAR ***pppFiles, int *totalCount, LPCTSTR szFilename);
+ static void AddToFileList(wchar_t ***pppFiles, int *totalCount, LPCTSTR szFilename);
//////////////////////////////////////////////////////////////////////////////////////
// safe mir_strlen function - do not overflow the given buffer length
diff --git a/plugins/TipperYM/src/bitmap_func.cpp b/plugins/TipperYM/src/bitmap_func.cpp index cdd1a71bb0..fe9ecfce84 100644 --- a/plugins/TipperYM/src/bitmap_func.cpp +++ b/plugins/TipperYM/src/bitmap_func.cpp @@ -150,7 +150,7 @@ void CreateFromBitmaps(bool bServiceTip) if (i == SKIN_ITEM_SIDEBAR && (!opt.iSidebarWidth || bServiceTip))
continue;
- TCHAR* tszFileName = opt.szImgFile[i];
+ wchar_t* tszFileName = opt.szImgFile[i];
if (tszFileName && *tszFileName != 0) {
FIBITMAP *fib = NULL;
if (!skin.bCached) {
diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp index 4f07b1395d..d19096e067 100644 --- a/plugins/TipperYM/src/message_pump.cpp +++ b/plugins/TipperYM/src/message_pump.cpp @@ -20,6 +20,8 @@ Boston, MA 02111-1307, USA. #include "stdafx.h"
+#include <tchar.h>
+
HMODULE hDwmapiDll = 0;
HRESULT (WINAPI *MyDwmEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind) = 0;
@@ -150,7 +152,7 @@ unsigned int CALLBACK MessagePumpThread(void*) case MUM_GOTSTATUS:
{
MCONTACT hContact = (MCONTACT)hwndMsg.wParam;
- TCHAR *swzMsg = (TCHAR *)hwndMsg.lParam;
+ wchar_t *swzMsg = (wchar_t *)hwndMsg.lParam;
if (opt.bWaitForContent && !bStatusMsgReady && clcitex && clcitex->hItem == (HANDLE)hContact) {
if (WaitForContentTimerID) {
@@ -282,7 +284,7 @@ INT_PTR ShowTipW(WPARAM wParam, LPARAM lParam) if (wParam) // wParam is char pointer containing text - e.g. status bar tooltip
{
- clcit2->swzText = mir_tstrdup((TCHAR *)wParam);
+ clcit2->swzText = mir_tstrdup((wchar_t *)wParam);
GetCursorPos(&clcit2->ptCursor);
}
@@ -313,7 +315,7 @@ int ProtoAck(WPARAM, LPARAM lParam) return 0;
if (ack->type == ACKTYPE_AWAYMSG) {
- TCHAR *tszMsg = (TCHAR*)ack->lParam;
+ wchar_t *tszMsg = (wchar_t*)ack->lParam;
if (mir_tstrlen(tszMsg))
PostMPMessage(MUM_GOTSTATUS, (WPARAM)ack->hContact, (LPARAM)mir_tstrdup(tszMsg));
}
diff --git a/plugins/TipperYM/src/mir_smileys.cpp b/plugins/TipperYM/src/mir_smileys.cpp index 3e2df38660..5e8c62b8c9 100644 --- a/plugins/TipperYM/src/mir_smileys.cpp +++ b/plugins/TipperYM/src/mir_smileys.cpp @@ -20,6 +20,8 @@ Boston, MA 02111-1307, USA. #include "stdafx.h"
+#include <tchar.h>
+
int InitTipperSmileys()
{
// Register smiley category
@@ -104,13 +106,13 @@ int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT return text_size.cy;
}
-SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_width)
+SIZE GetTextSize(HDC hdcMem, const wchar_t *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_width)
{
SIZE text_size = { 0 };
int text_height;
int row_count = 0, pos_x = 0;
- if (szText == NULL || _tcsclen(szText) == 0) {
+ if (szText == NULL || wcslen(szText) == 0) {
text_size.cy = 0;
text_size.cx = 0;
}
@@ -177,7 +179,7 @@ SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTe return text_size;
}
-void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat)
+void DrawTextSmiley(HDC hdcMem, RECT free_rc, const wchar_t *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat)
{
if (szText == NULL)
return;
@@ -304,7 +306,7 @@ void DestroySmileyList(SortedList* p_list) }
// Generate the list of smileys / text to be drawn
-SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height)
+SortedList *ReplaceSmileys(const wchar_t *text, int text_size, const char *protocol, int *max_smiley_height)
{
*max_smiley_height = 0;
@@ -322,7 +324,7 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco // Parse it!
SMADD_BATCHPARSE2 sp = { 0 };
sp.cbSize = sizeof(sp);
- sp.str = (TCHAR *)text;
+ sp.str = (wchar_t *)text;
sp.flag = SAFL_TCHAR;
sp.Protocolname = (opt.iSmileyAddFlags & SMILEYADD_USEPROTO) ? smileyProto : "tipper";
SMADD_BATCHPARSERES *spres = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&sp);
@@ -333,11 +335,11 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco // Lets add smileys
SortedList *plText = List_Create(0, 10);
- TCHAR *word_start, *word_end;
- TCHAR *smiley_start, *smiley_end;
- TCHAR *last_text_pos = _tcsninc(text, text_size);
+ wchar_t *word_start, *word_end;
+ wchar_t *smiley_start, *smiley_end;
+ wchar_t *last_text_pos = _tcsninc(text, text_size);
- word_start = word_end = (TCHAR *)text;
+ word_start = word_end = (wchar_t *)text;
for (unsigned i = 0; i < sp.numSmileys; i++) {
// Get smile position
diff --git a/plugins/TipperYM/src/mir_smileys.h b/plugins/TipperYM/src/mir_smileys.h index 0e95710240..eead1110b3 100644 --- a/plugins/TipperYM/src/mir_smileys.h +++ b/plugins/TipperYM/src/mir_smileys.h @@ -59,9 +59,9 @@ int InitTipperSmileys(); SMILEYPARSEINFO Smileys_PreParse(LPCTSTR lpString, int nCount, const char *protocol);
void Smileys_FreeParse(SMILEYPARSEINFO parseInfo);
-SortedList* ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height);
-SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_width);
-void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat);
+SortedList* ReplaceSmileys(const wchar_t *text, int text_size, const char *protocol, int *max_smiley_height);
+SIZE GetTextSize(HDC hdcMem, const wchar_t *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_width);
+void DrawTextSmiley(HDC hdcMem, RECT free_rc, const wchar_t *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat);
void DestroySmileyList(SortedList* p_list);
int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, SMILEYPARSEINFO parseInfo);
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 63ca767e1e..d083f1bc98 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA. OPTIONS opt;
ICONSTATE exIcons[EXICONS_COUNT];
-extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip)
+extern int IsTrayProto(const wchar_t *swzProto, BOOL bExtendedTip)
{
if (swzProto == NULL)
return 0;
@@ -37,7 +37,7 @@ extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip) DBVARIANT dbv;
int result = 1;
if (!db_get_ts(NULL, MODULE, szSetting, &dbv)) {
- result = _tcsstr(dbv.ptszVal, swzProto) ? 1 : 0;
+ result = wcsstr(dbv.ptszVal, swzProto) ? 1 : 0;
db_free(&dbv);
}
@@ -49,8 +49,8 @@ void CreateDefaultItems() for (int i = 0; defaultItemList[i].szName; i++) {
if (defaultItemList[i].szName[0] == '-') {
DIListNode *di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
- _tcsncpy(di_node->di.swzLabel, L"", LABEL_LEN);
- _tcsncpy(di_node->di.swzValue, L"", VALUE_LEN);
+ wcsncpy(di_node->di.swzLabel, L"", LABEL_LEN);
+ wcsncpy(di_node->di.swzValue, L"", VALUE_LEN);
di_node->di.bLineAbove = true;
di_node->di.bIsVisible = true;
di_node->di.bParseTipperVarsFirst = false;
@@ -67,7 +67,7 @@ void CreateDefaultItems() if (subst == NULL) continue;
DSListNode *ds_node = (DSListNode *)mir_alloc(sizeof(DSListNode));
- _tcsncpy(ds_node->ds.swzName, subst->swzName, LABEL_LEN);
+ wcsncpy(ds_node->ds.swzName, subst->swzName, LABEL_LEN);
ds_node->ds.type = subst->type;
strncpy(ds_node->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN);
ds_node->ds.iTranslateFuncId = subst->iTranslateFuncId;
@@ -77,8 +77,8 @@ void CreateDefaultItems() }
DIListNode *di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
- _tcsncpy(di_node->di.swzLabel, TranslateTS(item->swzLabel), LABEL_LEN);
- _tcsncpy(di_node->di.swzValue, item->swzValue, VALUE_LEN);
+ wcsncpy(di_node->di.swzLabel, TranslateTS(item->swzLabel), LABEL_LEN);
+ wcsncpy(di_node->di.swzValue, item->swzValue, VALUE_LEN);
di_node->di.bLineAbove = false;
di_node->di.bValueNewline = defaultItemList[i].bValueNewline;
di_node->di.bIsVisible = true;
@@ -100,7 +100,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index) if (db_get_ts(0, MODULE_ITEMS, setting, &dbv))
return false;
- _tcsncpy(ds->swzName, dbv.ptszVal, _countof(ds->swzName));
+ wcsncpy(ds->swzName, dbv.ptszVal, _countof(ds->swzName));
ds->swzName[_countof(ds->swzName) - 1] = 0;
db_free(&dbv);
@@ -161,14 +161,14 @@ bool LoadDI(DISPLAYITEM *di, int index) if (db_get_ts(0, MODULE_ITEMS, setting, &dbv))
return false;
- _tcsncpy(di->swzLabel, dbv.ptszVal, _countof(di->swzLabel));
+ wcsncpy(di->swzLabel, dbv.ptszVal, _countof(di->swzLabel));
di->swzLabel[_countof(di->swzLabel) - 1] = 0;
db_free(&dbv);
mir_snprintf(setting, "DIValue%d", index);
di->swzValue[0] = 0;
if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv)) {
- _tcsncpy(di->swzValue, dbv.ptszVal, _countof(di->swzValue));
+ wcsncpy(di->swzValue, dbv.ptszVal, _countof(di->swzValue));
di->swzValue[_countof(di->swzValue) - 1] = 0;
db_free(&dbv);
}
@@ -275,7 +275,7 @@ void SaveItems() opt.bWaitForStatusMsg = false;
while (di_node) {
SaveDI(&di_node->di, index);
- if (di_node->di.bIsVisible && _tcsstr(di_node->di.swzValue, L"sys:status_msg"))
+ if (di_node->di.bIsVisible && wcsstr(di_node->di.swzValue, L"sys:status_msg"))
opt.bWaitForStatusMsg = true;
di_node = di_node->next;
index++;
@@ -372,7 +372,7 @@ void LoadOptions() di_node->next = opt.diList;
opt.diList = di_node;
real_count++;
- if (di_node->di.bIsVisible && _tcsstr(di_node->di.swzValue, L"sys:status_msg"))
+ if (di_node->di.bIsVisible && wcsstr(di_node->di.swzValue, L"sys:status_msg"))
opt.bWaitForStatusMsg = true;
}
else
@@ -411,8 +411,8 @@ void LoadOptions() di_node = opt.diList;
}
- _tcsncpy(di_node->di.swzLabel, L"Last message: (%sys:last_msg_reltime% ago)", LABEL_LEN);
- _tcsncpy(di_node->di.swzValue, L"%sys:last_msg%", VALUE_LEN);
+ wcsncpy(di_node->di.swzLabel, L"Last message: (%sys:last_msg_reltime% ago)", LABEL_LEN);
+ wcsncpy(di_node->di.swzValue, L"%sys:last_msg%", VALUE_LEN);
di_node->di.bLineAbove = di_node->di.bValueNewline = true;
di_node->next = 0;
opt.iDiCount++;
@@ -436,8 +436,8 @@ void LoadOptions() di_node = opt.diList;
}
- _tcsncpy(di_node->di.swzLabel, L"Status message:", LABEL_LEN);
- _tcsncpy(di_node->di.swzValue, L"%sys:status_msg%", VALUE_LEN);
+ wcsncpy(di_node->di.swzLabel, L"Status message:", LABEL_LEN);
+ wcsncpy(di_node->di.swzValue, L"%sys:status_msg%", VALUE_LEN);
di_node->di.bLineAbove = di_node->di.bValueNewline = true;
di_node->next = 0;
opt.iDiCount++;
@@ -516,7 +516,7 @@ void LoadOptions() }
else if (opt.skinMode == SM_IMAGE) {
if (!db_get_ts(NULL, MODULE, "SkinName", &dbv)) {
- _tcsncpy(opt.szSkinName, dbv.ptszVal, _countof(opt.szSkinName) - 1);
+ wcsncpy(opt.szSkinName, dbv.ptszVal, _countof(opt.szSkinName) - 1);
db_free(&dbv);
}
}
@@ -584,7 +584,7 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETCURSEL, 0, 0);
if (sel != CB_ERR) {
- TCHAR buff[256];
+ wchar_t buff[256];
SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
for (int i = 0; presetItems[i].szID; i++) {
if (mir_tstrcmp(buff, TranslateTS(presetItems[i].swzName)) == 0) {
@@ -620,7 +620,7 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (LOWORD(wParam) == IDC_CMB_PRESETITEMS) {
int sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETCURSEL, 0, 0);
if (sel != CB_ERR) {
- TCHAR buff[256];
+ wchar_t buff[256];
SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
for (int i = 0; presetItems[i].szID; i++) {
if (mir_tstrcmp(buff, TranslateTS(presetItems[i].swzName)) == 0) {
@@ -737,7 +737,7 @@ INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l return 0;
}
-static void SetTreeItemText(DIListNode *node, TCHAR **pszText)
+static void SetTreeItemText(DIListNode *node, wchar_t **pszText)
{
if (node->di.swzLabel[0] == 0) {
if (node->di.swzValue[0] == 0 && node->di.bLineAbove)
@@ -750,15 +750,15 @@ static void SetTreeItemText(DIListNode *node, TCHAR **pszText) }
static OPTBUTTON btns[9] = {
- IDC_BTN_ADD, SKINICON_OTHER_ADDCONTACT, 0, LPGENT("Add item"),
- IDC_BTN_SEPARATOR, 0, IDI_SEPARATOR, LPGENT("Add separator"),
- IDC_BTN_EDIT, SKINICON_OTHER_RENAME, 0, LPGENT("Edit"),
- IDC_BTN_REMOVE, SKINICON_OTHER_DELETE, 0, LPGENT("Remove"),
- IDC_BTN_UP, 0, IDI_UP, LPGENT("Move up"),
- IDC_BTN_DOWN, 0, IDI_DOWN, LPGENT("Move down"),
- IDC_BTN_ADD2, SKINICON_OTHER_ADDCONTACT, 0, LPGENT("Add"),
- IDC_BTN_REMOVE2, SKINICON_OTHER_DELETE, 0, LPGENT("Remove"),
- IDC_BTN_EDIT2, SKINICON_OTHER_RENAME, 0, LPGENT("Edit")
+ IDC_BTN_ADD, SKINICON_OTHER_ADDCONTACT, 0, LPGENW("Add item"),
+ IDC_BTN_SEPARATOR, 0, IDI_SEPARATOR, LPGENW("Add separator"),
+ IDC_BTN_EDIT, SKINICON_OTHER_RENAME, 0, LPGENW("Edit"),
+ IDC_BTN_REMOVE, SKINICON_OTHER_DELETE, 0, LPGENW("Remove"),
+ IDC_BTN_UP, 0, IDI_UP, LPGENW("Move up"),
+ IDC_BTN_DOWN, 0, IDI_DOWN, LPGENW("Move down"),
+ IDC_BTN_ADD2, SKINICON_OTHER_ADDCONTACT, 0, LPGENW("Add"),
+ IDC_BTN_REMOVE2, SKINICON_OTHER_DELETE, 0, LPGENW("Remove"),
+ IDC_BTN_EDIT2, SKINICON_OTHER_RENAME, 0, LPGENW("Edit")
};
INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -907,7 +907,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA memset(ds_value, 0, sizeof(DSListNode));
ds_value->next = NULL;
ds_value->ds.type = subst->type;
- _tcsncpy(ds_value->ds.swzName, subst->swzName, LABEL_LEN - 1);
+ wcsncpy(ds_value->ds.swzName, subst->swzName, LABEL_LEN - 1);
if (ds_value->ds.type == DVT_DB && subst->szModuleName)
strncpy(ds_value->ds.szModuleName, subst->szModuleName, MODULE_NAME_LEN - 1);
@@ -985,7 +985,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA hNewItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem);
if (hNewItem) {
- TCHAR buff[512], buff2[512];
+ wchar_t buff[512], buff2[512];
LPARAM tmpParam;
UINT tmpState;
@@ -1643,7 +1643,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &item);
if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT) || (hti.hItem == TVI_FIRST)) {
TVINSERTSTRUCT tvis;
- TCHAR swzName[256];
+ wchar_t swzName[256];
tvis.item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.pszText = swzName;
@@ -1794,7 +1794,7 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l EnableControls(hwndDlg, false);
}
else if (iSel != LB_ERR) {
- TCHAR swzSkinName[256];
+ wchar_t swzSkinName[256];
if (ListBox_GetText(hwndList, iSel, swzSkinName) > 0)
ParseSkinFile(swzSkinName, false, true);
EnableControls(hwndDlg, true);
@@ -2026,8 +2026,8 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA switch (((LPNMHDR)lParam)->idFrom) {
case 0:
if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY) {
- TCHAR buff[256];
- TCHAR swzProtos[1024] = { 0 };
+ wchar_t buff[256];
+ wchar_t swzProtos[1024] = { 0 };
TVITEM item;
item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS));
diff --git a/plugins/TipperYM/src/options.h b/plugins/TipperYM/src/options.h index f75e828d89..3161b5e2d4 100644 --- a/plugins/TipperYM/src/options.h +++ b/plugins/TipperYM/src/options.h @@ -35,13 +35,13 @@ Boston, MA 02111-1307, USA. typedef struct {
UINT id, uintCoreIconId, uintResIconId;
- TCHAR *swzTooltip;
+ wchar_t *swzTooltip;
} OPTBUTTON;
typedef enum { DIT_ALL = 0, DIT_CONTACTS = 1, DIT_CHATS = 2 } DisplayItemType;
typedef struct {
- TCHAR swzLabel[LABEL_LEN];
- TCHAR swzValue[VALUE_LEN];
+ wchar_t swzLabel[LABEL_LEN];
+ wchar_t swzValue[VALUE_LEN];
DisplayItemType type;
bool bLineAbove, bValueNewline;
bool bIsVisible;
@@ -51,16 +51,16 @@ typedef struct { // display item types
static struct {
DisplayItemType type;
- TCHAR *title;
+ wchar_t *title;
} displayItemTypes[] = {
- { DIT_ALL, LPGENT("Show for all contact types") },
- { DIT_CONTACTS, LPGENT("Show only for contacts") },
- { DIT_CHATS, LPGENT("Show only for chatrooms") }
+ { DIT_ALL, LPGENW("Show for all contact types") },
+ { DIT_CONTACTS, LPGENW("Show only for contacts") },
+ { DIT_CHATS, LPGENW("Show only for chatrooms") }
};
typedef enum { DVT_DB = 0, DVT_PROTODB = 1 } DisplaySubstType;
typedef struct {
- TCHAR swzName[LABEL_LEN];
+ wchar_t swzName[LABEL_LEN];
DisplaySubstType type;
char szModuleName[MODULE_NAME_LEN];
char szSettingName[SETTING_NAME_LEN];
@@ -85,28 +85,28 @@ typedef struct { } MARGINS;
// tray tooltip items
-static TCHAR *trayTipItems[TRAYTIP_ITEMS_COUNT] = {
- LPGENT("Number of contacts"),
- LPGENT("Protocol lock status"),
- LPGENT("Logon time"),
- LPGENT("Unread emails"),
- LPGENT("Status"),
- LPGENT("Status message"),
- LPGENT("Extra status"),
- LPGENT("Listening to"),
- LPGENT("Favorite contacts"),
- LPGENT("Miranda uptime"),
- LPGENT("Contact list event")
+static wchar_t *trayTipItems[TRAYTIP_ITEMS_COUNT] = {
+ LPGENW("Number of contacts"),
+ LPGENW("Protocol lock status"),
+ LPGENW("Logon time"),
+ LPGENW("Unread emails"),
+ LPGENW("Status"),
+ LPGENW("Status message"),
+ LPGENW("Extra status"),
+ LPGENW("Listening to"),
+ LPGENW("Favorite contacts"),
+ LPGENW("Miranda uptime"),
+ LPGENW("Contact list event")
};
// extra icons
-static TCHAR *extraIconName[6] = {
- LPGENT("Status"),
- LPGENT("Extra status"),
- LPGENT("Jabber activity"),
- LPGENT("Gender"),
- LPGENT("Country flag"),
- LPGENT("Client")
+static wchar_t *extraIconName[6] = {
+ LPGENW("Status"),
+ LPGENW("Extra status"),
+ LPGENW("Jabber activity"),
+ LPGENW("Gender"),
+ LPGENW("Country flag"),
+ LPGENW("Client")
};
typedef struct {
@@ -148,9 +148,9 @@ typedef struct { // tooltip skin
SkinMode skinMode;
- TCHAR szSkinName[256];
- TCHAR szPreviewFile[1024];
- TCHAR *szImgFile[SKIN_ITEMS_COUNT];
+ wchar_t szSkinName[256];
+ wchar_t szPreviewFile[1024];
+ wchar_t *szImgFile[SKIN_ITEMS_COUNT];
MARGINS margins[SKIN_ITEMS_COUNT];
TransformationMode transfMode[SKIN_ITEMS_COUNT];
PopupShowEffect showEffect;
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 1a238d7ba9..2b0cbebb6b 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. #include "stdafx.h" -__inline void AddRow(PopupWindowData *pwd, TCHAR *swzLabel, TCHAR *swzValue, char *szProto, bool bParseSmileys, bool bNewline, bool bLineAbove, bool bIsTitle = false, HICON hIcon = NULL) +__inline void AddRow(PopupWindowData *pwd, wchar_t *swzLabel, wchar_t *swzValue, char *szProto, bool bParseSmileys, bool bNewline, bool bLineAbove, bool bIsTitle = false, HICON hIcon = NULL) { RowData *pRows = (RowData *)mir_realloc(pwd->rows, sizeof(RowData) * (pwd->iRowCount + 1)); if (pRows == NULL) @@ -97,31 +97,31 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } // uid info - TCHAR swzUid[256], swzUidName[256]; + wchar_t swzUid[256], swzUidName[256]; if (Uid(0, pwd->clcit.szProto, swzUid, 256) && UidName(pwd->clcit.szProto, swzUidName, 253)) { mir_tstrcat(swzUidName, L": "); AddRow(pwd, swzUidName, swzUid, NULL, false, false, false); } // logon info - TCHAR swzLogon[64]; + wchar_t swzLogon[64]; if (TimestampToTimeDifference(NULL, pwd->clcit.szProto, "LogonTS", swzLogon, 59)) { - TCHAR ago[96]; + wchar_t ago[96]; mir_sntprintf(ago, TranslateT("%s ago"), swzLogon); AddRow(pwd, TranslateT("Log on:"), ago, NULL, false, false, false); } // number of unread emails - TCHAR swzEmailCount[64]; + wchar_t swzEmailCount[64]; if (ProtoServiceExists(pwd->clcit.szProto, PS_GETUNREADEMAILCOUNT)) { int iCount = (int)CallProtoService(pwd->clcit.szProto, PS_GETUNREADEMAILCOUNT, 0, 0); if (iCount > 0) { - _itot(iCount, swzEmailCount, 10); + _itow(iCount, swzEmailCount, 10); AddRow(pwd, TranslateT("Unread emails:"), swzEmailCount, NULL, false, false, false); } } - TCHAR *swzText = pcli->pfnGetStatusModeDescription(wStatus, 0); + wchar_t *swzText = pcli->pfnGetStatusModeDescription(wStatus, 0); if (swzText) AddRow(pwd, TranslateT("Status:"), swzText, NULL, false, false, false); @@ -134,7 +134,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } // jabber mood or icq xstatus - TCHAR *swzAdvTitle = GetJabberAdvStatusText(pwd->clcit.szProto, "mood", "title"); + wchar_t *swzAdvTitle = GetJabberAdvStatusText(pwd->clcit.szProto, "mood", "title"); if (swzAdvTitle) { StripBBCodesInPlace(swzAdvTitle); AddRow(pwd, TranslateT("Mood:"), swzAdvTitle, pwd->clcit.szProto, true, false, true); @@ -217,14 +217,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa SetTimer(hwnd, ID_TIMER_TRAYTIP, opt.iExpandTime, 0); } else { - TCHAR buff[2048], *swzText = pwd->clcit.swzText; + wchar_t buff[2048], *swzText = pwd->clcit.swzText; size_t iBuffPos, i = 0, iSize = mir_tstrlen(pwd->clcit.swzText); bool bTopMessage = false; - while (i < iSize && swzText[i] != _T('<')) { + while (i < iSize && swzText[i] != '<') { iBuffPos = 0; - while (swzText[i] != _T('\n') && swzText[i] != _T('\r') && i < iSize && iBuffPos < 2048) { - if (swzText[i] != _T('\t')) + while (swzText[i] != '\n' && swzText[i] != '\r' && i < iSize && iBuffPos < 2048) { + if (swzText[i] != '\t') buff[iBuffPos++] = swzText[i]; i++; } @@ -236,21 +236,21 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa bTopMessage = true; } - while (i < iSize && (swzText[i] == _T('\n') || swzText[i] == _T('\r'))) + while (i < iSize && (swzText[i] == '\n' || swzText[i] == '\r')) i++; } // parse bold bits into labels and the rest into items while (i < iSize) { - while (i + 2 < iSize && (swzText[i] != _T('<') || swzText[i + 1] != _T('b') || swzText[i + 2] != _T('>'))) + while (i + 2 < iSize && (swzText[i] != '<' || swzText[i + 1] != 'b' || swzText[i + 2] != '>')) i++; i += 3; iBuffPos = 0; - while (i + 3 < iSize && iBuffPos < 2048 && (swzText[i] != _T('<') - || swzText[i + 1] != _T('/') || swzText[i + 2] != _T('b') || swzText[i + 3] != _T('>'))) { - if (swzText[i] != _T('\t')) + while (i + 3 < iSize && iBuffPos < 2048 && (swzText[i] != '<' + || swzText[i + 1] != '/' || swzText[i + 2] != 'b' || swzText[i + 3] != '>')) { + if (swzText[i] != '\t') buff[iBuffPos++] = swzText[i]; i++; } @@ -269,8 +269,8 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa pwd->rows[pwd->iRowCount].bLineAbove = false; iBuffPos = 0; - while (i < iSize && iBuffPos < 2048 && swzText[i] != _T('\n')) { - if (swzText[i] != _T('\t') && swzText[i] != _T('\r')) + while (i < iSize && iBuffPos < 2048 && swzText[i] != '\n') { + if (swzText[i] != '\t' && swzText[i] != '\r') buff[iBuffPos++] = swzText[i]; i++; } @@ -306,7 +306,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (!opt.bWaitForContent) db_unset(pwd->hContact, MODULE, "TempStatusMsg"); - _tcsncpy_s(pwd->swzTitle, pcli->pfnGetContactDisplayName(pwd->hContact, 0), _TRUNCATE); + wcsncpy_s(pwd->swzTitle, pcli->pfnGetContactDisplayName(pwd->hContact, 0), _TRUNCATE); char *szProto = GetContactProto(pwd->hContact); pwd->spiTitle = Smileys_PreParse(pwd->swzTitle, -1, szProto); @@ -741,10 +741,10 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa HBITMAP hbmpAllItems = iconInfo.hbmColor; DestroyIcon(hIcon); - AppendMenu(hMenu, MF_STRING, COPYMENU_ALLITEMS_LABELS, LPGENT("Copy all items with labels")); - AppendMenu(hMenu, MF_STRING, COPYMENU_ALLITEMS, LPGENT("Copy all items")); + AppendMenu(hMenu, MF_STRING, COPYMENU_ALLITEMS_LABELS, LPGENW("Copy all items with labels")); + AppendMenu(hMenu, MF_STRING, COPYMENU_ALLITEMS, LPGENW("Copy all items")); if (pwd->clcit.szProto || pwd->hContact) - AppendMenu(hMenu, MF_STRING, COPYMENU_AVATAR, LPGENT("Copy avatar")); + AppendMenu(hMenu, MF_STRING, COPYMENU_AVATAR, LPGENW("Copy avatar")); AppendMenu(hMenu, MF_SEPARATOR, 2000, 0); TranslateMenu(hMenu); @@ -765,11 +765,11 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa for (int i = 0; i < pwd->iRowCount; i++) { if (pwd->rows[i].swzValue) { - TCHAR buff[128]; + wchar_t buff[128]; int iLen = (int)mir_tstrlen(pwd->rows[i].swzValue); if (iLen) { if (iLen > MAX_VALUE_LEN) { - _tcsncpy(buff, pwd->rows[i].swzValue, MAX_VALUE_LEN); + wcsncpy(buff, pwd->rows[i].swzValue, MAX_VALUE_LEN); buff[MAX_VALUE_LEN] = 0; mir_tstrcat(buff, L"..."); } @@ -816,7 +816,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } else { // copy text HGLOBAL hClipboardData = GlobalAlloc(GMEM_DDESHARE, 4096); - TCHAR *pchData = (TCHAR *)GlobalLock(hClipboardData); + wchar_t *pchData = (wchar_t *)GlobalLock(hClipboardData); pchData[0] = 0; if (iSelItem == COPYMENU_ALLITEMS_LABELS) { // copy all items with labels for (int i = 0; i < pwd->iRowCount; i++) { @@ -965,7 +965,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa case PUM_SETSTATUSTEXT: if (pwd && wParam == pwd->hContact) { - db_set_ts(pwd->hContact, MODULE, "TempStatusMsg", (TCHAR *)lParam); + db_set_ts(pwd->hContact, MODULE, "TempStatusMsg", (wchar_t *)lParam); pwd->bIsPainted = false; pwd->bNeedRefresh = true; SendMessage(hwnd, PUM_REFRESH_VALUES, TRUE, 0); @@ -1035,7 +1035,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa pwd->iRowCount = 0; DIListNode *node = opt.diList; - TCHAR buff_label[LABEL_LEN], buff[VALUE_LEN]; + wchar_t buff_label[LABEL_LEN], buff[VALUE_LEN]; while (node) { if (node->di.bIsVisible && CheckContactType(pwd->hContact, node->di)) { if (GetLabelText(pwd->hContact, node->di, buff_label, LABEL_LEN) && GetValueText(pwd->hContact, node->di, buff, VALUE_LEN)) { @@ -1453,7 +1453,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa DWORD dwItems = (wParam == 0) ? opt.iFirstItems : opt.iSecondItems; bool bFirstItem = true; - TCHAR buff[64]; + wchar_t buff[64]; int oldOrder = -1, iProtoCount = 0; PROTOACCOUNT **accs; @@ -1488,7 +1488,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } else buff[0] = 0; - TCHAR swzProto[256]; + wchar_t swzProto[256]; mir_tstrcpy(swzProto, pa->tszAccountName); if (dwItems & TRAYTIP_LOCKSTATUS) if (Proto_IsAccountLocked(pa)) @@ -1499,7 +1499,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (dwItems & TRAYTIP_LOGON) { if (TimestampToTimeDifference(NULL, pa->szModuleName, "LogonTS", buff, 59)) { - TCHAR ago[96]; + wchar_t ago[96]; mir_sntprintf(ago, TranslateT("%s ago"), buff); AddRow(pwd, TranslateT("Log on:"), ago, NULL, false, false, false); } @@ -1508,20 +1508,20 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (dwItems & TRAYTIP_UNREAD_EMAILS && ProtoServiceExists(pa->szModuleName, PS_GETUNREADEMAILCOUNT)) { int iCount = (int)CallProtoService(pa->szModuleName, PS_GETUNREADEMAILCOUNT, 0, 0); if (iCount > 0) { - _itot(iCount, buff, 10); + _itow(iCount, buff, 10); AddRow(pwd, TranslateT("Unread emails:"), buff, NULL, false, false, false); } } if (dwItems & TRAYTIP_STATUS) { - TCHAR *swzText = pcli->pfnGetStatusModeDescription(wStatus, 0); + wchar_t *swzText = pcli->pfnGetStatusModeDescription(wStatus, 0); if (swzText) AddRow(pwd, TranslateT("Status:"), swzText, NULL, false, false, false); } if (wStatus >= ID_STATUS_ONLINE && wStatus <= ID_STATUS_OUTTOLUNCH) { if (dwItems & TRAYTIP_STATUS_MSG) { - TCHAR *swzText = GetProtoStatusMessage(pa->szModuleName, wStatus); + wchar_t *swzText = GetProtoStatusMessage(pa->szModuleName, wStatus); if (swzText) { StripBBCodesInPlace(swzText); AddRow(pwd, TranslateT("Status message:"), swzText, pa->szModuleName, true, true, false); @@ -1531,13 +1531,13 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (dwItems & TRAYTIP_EXTRA_STATUS) { // jabber mood or icq xstatus - TCHAR *swzAdvTitle = GetJabberAdvStatusText(pa->szModuleName, "mood", "title"); + wchar_t *swzAdvTitle = GetJabberAdvStatusText(pa->szModuleName, "mood", "title"); if (swzAdvTitle) { StripBBCodesInPlace(swzAdvTitle); AddRow(pwd, TranslateT("Mood:"), swzAdvTitle, pa->szModuleName, true, false, false); mir_free(swzAdvTitle); - TCHAR *swzAdvText = GetJabberAdvStatusText(pa->szModuleName, "mood", "text"); + wchar_t *swzAdvText = GetJabberAdvStatusText(pa->szModuleName, "mood", "text"); if (swzAdvText) { StripBBCodesInPlace(swzAdvText); AddRow(pwd, L"", swzAdvText, pa->szModuleName, true, true, false); @@ -1555,7 +1555,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } // xstatus message - TCHAR *swzAdvText = GetProtoExtraStatusMessage(pa->szModuleName); + wchar_t *swzAdvText = GetProtoExtraStatusMessage(pa->szModuleName); if (swzAdvText) { StripBBCodesInPlace(swzAdvText); AddRow(pwd, L"", swzAdvText, pa->szModuleName, true, true, false); @@ -1564,14 +1564,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } } - TCHAR *swzActTitle = GetJabberAdvStatusText(pa->szModuleName, "activity", "title"); + wchar_t *swzActTitle = GetJabberAdvStatusText(pa->szModuleName, "activity", "title"); if (swzActTitle) { StripBBCodesInPlace(swzActTitle); AddRow(pwd, TranslateT("Activity:"), swzActTitle, pa->szModuleName, true, false, false); mir_free(swzActTitle); } - TCHAR *swzActText = GetJabberAdvStatusText(pa->szModuleName, "activity", "text"); + wchar_t *swzActText = GetJabberAdvStatusText(pa->szModuleName, "activity", "text"); if (swzActText) { StripBBCodesInPlace(swzActText); AddRow(pwd, L"", swzActText, pa->szModuleName, true, true, false); @@ -1580,7 +1580,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } if (dwItems & TRAYTIP_LISTENINGTO) { - TCHAR *swzListening = GetListeningTo(pa->szModuleName); + wchar_t *swzListening = GetListeningTo(pa->szModuleName); if (swzListening) { StripBBCodesInPlace(swzListening); AddRow(pwd, TranslateT("Listening to:"), swzListening, NULL, false, true, false); @@ -1592,8 +1592,8 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (dwItems & TRAYTIP_FAVCONTACTS) { if (db_get_dw(0, MODULE, "FavouriteContactsCount", 0)) { - TCHAR swzName[256]; - TCHAR swzStatus[256]; + wchar_t swzName[256]; + wchar_t swzStatus[256]; bool bTitlePainted = false; int iCount = 0, iCountOnline = 0; @@ -1618,9 +1618,9 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa bTitlePainted = true; } - TCHAR *swzNick = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0); + wchar_t *swzNick = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0); if (opt.iFavoriteContFlags & FAVCONT_APPEND_PROTO) { - TCHAR *swzProto = a2t(proto); + wchar_t *swzProto = a2t(proto); mir_sntprintf(swzName, L"%s (%s)", swzNick, swzProto); mir_free(swzProto); } @@ -1652,11 +1652,11 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } if (dwItems & TRAYTIP_CLIST_EVENT && pwd->clcit.swzText) { - TCHAR *pchBr = _tcschr(pwd->clcit.swzText, '\n'); - TCHAR *pchBold = _tcsstr(pwd->clcit.swzText, L"<b>"); + wchar_t *pchBr = wcschr(pwd->clcit.swzText, '\n'); + wchar_t *pchBold = wcsstr(pwd->clcit.swzText, L"<b>"); if (!pchBold || pchBold != pwd->clcit.swzText) { - TCHAR swzText[256]; + wchar_t swzText[256]; mir_tstrcpy(swzText, pwd->clcit.swzText); if (pchBr) swzText[pchBr - pwd->clcit.swzText] = 0; AddRow(pwd, swzText, L"", NULL, false, true, false, true, Skin_LoadIcon(SKINICON_OTHER_FILLEDBLOB)); diff --git a/plugins/TipperYM/src/popwin.h b/plugins/TipperYM/src/popwin.h index 92ac1e2855..d63ca07b33 100644 --- a/plugins/TipperYM/src/popwin.h +++ b/plugins/TipperYM/src/popwin.h @@ -89,12 +89,12 @@ typedef struct { HANDLE hItem; //handle to group or contact
POINT ptCursor;
RECT rcItem;
- TCHAR *swzText; // for tips with specific text
+ wchar_t *swzText; // for tips with specific text
char *szProto; // for proto tips
} CLCINFOTIPEX;
typedef struct {
- TCHAR *swzLabel, *swzValue;
+ wchar_t *swzLabel, *swzValue;
HICON hIcon;
bool bValueNewline;
bool bLineAbove;
@@ -110,7 +110,7 @@ typedef struct { MCONTACT hContact;
int iIconIndex;
CLCINFOTIPEX clcit;
- TCHAR swzTitle[TITLE_TEXT_LEN];
+ wchar_t swzTitle[TITLE_TEXT_LEN];
SMILEYPARSEINFO spiTitle;
RowData *rows;
int iRowCount;
@@ -132,7 +132,7 @@ typedef struct { LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
-extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip);
+extern int IsTrayProto(const wchar_t *swzProto, BOOL bExtendedTip);
#endif
diff --git a/plugins/TipperYM/src/preset_items.cpp b/plugins/TipperYM/src/preset_items.cpp index 764264c42d..e29ca11708 100644 --- a/plugins/TipperYM/src/preset_items.cpp +++ b/plugins/TipperYM/src/preset_items.cpp @@ -22,42 +22,42 @@ Boston, MA 02111-1307, USA. PRESETITEM presetItems[] =
{
- "account", LPGENT("Account"), LPGENT("Account:"), L"%sys:account%", 0, 0, 0,
- "birth", LPGENT("Birthday"), LPGENT("Birthday:"), L"%birthday_date% (%birthday_age%) @ Next: %birthday_next%", "birthdate", "birthage", "birthnext",
- "client", LPGENT("Client"), LPGENT("Client:"), L"%raw:/MirVer%", 0, 0, 0,
- "email", LPGENT("Email"), LPGENT("Email:"), L"%raw:/e-mail%", 0, 0, 0,
- "gender", LPGENT("Gender"), LPGENT("Gender:"), L"%gender%", 0, 0, 0,
- "homepage", LPGENT("Homepage"), LPGENT("Homepage:"), L"%raw:/Homepage%", 0, 0, 0,
- "id", LPGENT("Identifier"), L"%sys:uidname|UID^!MetaContacts%:", L"%sys:uid%", 0, 0, 0,
- "idle", LPGENT("Idle"), LPGENT("Idle:"), L"%idle% (%idle_diff% ago)", "idle", "idlediff", 0,
+ "account", LPGENW("Account"), LPGENW("Account:"), L"%sys:account%", 0, 0, 0,
+ "birth", LPGENW("Birthday"), LPGENW("Birthday:"), L"%birthday_date% (%birthday_age%) @ Next: %birthday_next%", "birthdate", "birthage", "birthnext",
+ "client", LPGENW("Client"), LPGENW("Client:"), L"%raw:/MirVer%", 0, 0, 0,
+ "email", LPGENW("Email"), LPGENW("Email:"), L"%raw:/e-mail%", 0, 0, 0,
+ "gender", LPGENW("Gender"), LPGENW("Gender:"), L"%gender%", 0, 0, 0,
+ "homepage", LPGENW("Homepage"), LPGENW("Homepage:"), L"%raw:/Homepage%", 0, 0, 0,
+ "id", LPGENW("Identifier"), L"%sys:uidname|UID^!MetaContacts%:", L"%sys:uid%", 0, 0, 0,
+ "idle", LPGENW("Idle"), LPGENW("Idle:"), L"%idle% (%idle_diff% ago)", "idle", "idlediff", 0,
"ip", L"IP", L"IP:", L"%ip%", "ip", 0, 0,
- "ipint", LPGENT("IP internal"), LPGENT("IP internal:"), L"%ip_internal%", "ipint", 0, 0,
- "lastmsg", LPGENT("Last message"), LPGENT("Last message: (%sys:last_msg_reltime% ago)"), L"%sys:last_msg%", 0, 0, 0,
- "listening", LPGENT("Listening to"), LPGENT("Listening to:"), L"%raw:/ListeningTo%", 0, 0, 0,
- "name", LPGENT("Name"), LPGENT("Name:"), L"%raw:/FirstName|% %raw:/LastName%", 0, 0, 0,
- "received", LPGENT("Number of received messages"), LPGENT("Number of msg [IN]:"), L"%sys:msg_count_in%", 0, 0, 0,
- "sended", LPGENT("Number of sent messages"), LPGENT("Number of msg [OUT]:"), L"%sys:msg_count_out%", 0, 0, 0,
- "status", LPGENT("Status"), LPGENT("Status:"), L"%Status%", "status", 0, 0,
- "statusmsg", LPGENT("Status message"), LPGENT("Status message:"), L"%sys:status_msg%", 0, 0, 0,
- "time", LPGENT("Contact time"), LPGENT("Time:"), L"%sys:time%", 0, 0, 0,
- "xtitle", LPGENT("xStatus title"), LPGENT("xStatus title:"), L"%xsname%", "xname", 0, 0,
- "xtext", LPGENT("xStatus text"), LPGENT("xStatus text:"), L"%raw:/XStatusMsg%", 0, 0, 0,
- "acttitle", LPGENT("[jabber.dll] Activity title"), LPGENT("Activity title:"), L"%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/title%", 0, 0, 0,
- "acttext", LPGENT("[jabber.dll] Activity text"), LPGENT("Activity text:"), L"%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/text%", 0, 0, 0,
- "lastseentime", LPGENT("[seenplugin.dll] Last seen time"), LPGENT("Last seen time:"), L"%lastseen_date% @ %lastseen_time%", "lsdate", "lstime", 0,
- "lastseenstatus", LPGENT("[seenplugin.dll] Last seen status"), LPGENT("Last seen status:"), L"%lastseen_status% (%lastseen_ago% ago)", "lsstatus", "lsago", 0,
- "cond", LPGENT("[weather.dll] Condition"), LPGENT("Condition:"), L"%raw:Current/Condition%", 0, 0, 0,
- "humidity", LPGENT("[weather.dll] Humidity"), LPGENT("Humidity:"), L"%raw:Current/Humidity%", 0, 0, 0,
- "minmaxtemp", LPGENT("[weather.dll] Max/Min temperature"), LPGENT("Max/Min:"), L"%raw:Current/High%/%raw:Current/Low%", 0, 0, 0,
- "moon", LPGENT("[weather.dll] Moon"), LPGENT("Moon:"), L"%raw:Current/Moon%", 0, 0, 0,
- "pressure", LPGENT("[weather.dll] Pressure"), LPGENT("Pressure:"), L"%raw:Current/Pressure% (%raw:Current/Pressure Tendency%)", 0, 0, 0,
- "sunrise", LPGENT("[weather.dll] Sunrise"), LPGENT("Sunrise:"), L"%raw:Current/Sunrise%", 0, 0, 0,
- "sunset", LPGENT("[weather.dll] Sunset"), LPGENT("Sunset:"), L"%raw:Current/Sunset%", 0, 0, 0,
- "temp", LPGENT("[weather.dll] Temperature"), LPGENT("Temperature:"), L"%raw:Current/Temperature%", 0, 0, 0,
- "uptime", LPGENT("[weather.dll] Update time"), LPGENT("Update time:"), L"%raw:Current/Update%", 0, 0, 0,
- "uvindex", LPGENT("[weather.dll] UV Index"), LPGENT("UV Index:"), L"%raw:Current/UV% - %raw:Current/UVI%", 0, 0, 0,
- "vis", LPGENT("[weather.dll] Visibility"), LPGENT("Visibility:"), L"%raw:Current/Visibility%", 0, 0, 0,
- "wind", LPGENT("[weather.dll] Wind"), LPGENT("Wind:"), L"%raw:Current/Wind Direction% (%raw:Current/Wind Direction DEG%)/%raw:Current/Wind Speed%", 0, 0, 0,
+ "ipint", LPGENW("IP internal"), LPGENW("IP internal:"), L"%ip_internal%", "ipint", 0, 0,
+ "lastmsg", LPGENW("Last message"), LPGENW("Last message: (%sys:last_msg_reltime% ago)"), L"%sys:last_msg%", 0, 0, 0,
+ "listening", LPGENW("Listening to"), LPGENW("Listening to:"), L"%raw:/ListeningTo%", 0, 0, 0,
+ "name", LPGENW("Name"), LPGENW("Name:"), L"%raw:/FirstName|% %raw:/LastName%", 0, 0, 0,
+ "received", LPGENW("Number of received messages"), LPGENW("Number of msg [IN]:"), L"%sys:msg_count_in%", 0, 0, 0,
+ "sended", LPGENW("Number of sent messages"), LPGENW("Number of msg [OUT]:"), L"%sys:msg_count_out%", 0, 0, 0,
+ "status", LPGENW("Status"), LPGENW("Status:"), L"%Status%", "status", 0, 0,
+ "statusmsg", LPGENW("Status message"), LPGENW("Status message:"), L"%sys:status_msg%", 0, 0, 0,
+ "time", LPGENW("Contact time"), LPGENW("Time:"), L"%sys:time%", 0, 0, 0,
+ "xtitle", LPGENW("xStatus title"), LPGENW("xStatus title:"), L"%xsname%", "xname", 0, 0,
+ "xtext", LPGENW("xStatus text"), LPGENW("xStatus text:"), L"%raw:/XStatusMsg%", 0, 0, 0,
+ "acttitle", LPGENW("[jabber.dll] Activity title"), LPGENW("Activity title:"), L"%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/title%", 0, 0, 0,
+ "acttext", LPGENW("[jabber.dll] Activity text"), LPGENW("Activity text:"), L"%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/text%", 0, 0, 0,
+ "lastseentime", LPGENW("[seenplugin.dll] Last seen time"), LPGENW("Last seen time:"), L"%lastseen_date% @ %lastseen_time%", "lsdate", "lstime", 0,
+ "lastseenstatus", LPGENW("[seenplugin.dll] Last seen status"), LPGENW("Last seen status:"), L"%lastseen_status% (%lastseen_ago% ago)", "lsstatus", "lsago", 0,
+ "cond", LPGENW("[weather.dll] Condition"), LPGENW("Condition:"), L"%raw:Current/Condition%", 0, 0, 0,
+ "humidity", LPGENW("[weather.dll] Humidity"), LPGENW("Humidity:"), L"%raw:Current/Humidity%", 0, 0, 0,
+ "minmaxtemp", LPGENW("[weather.dll] Max/Min temperature"), LPGENW("Max/Min:"), L"%raw:Current/High%/%raw:Current/Low%", 0, 0, 0,
+ "moon", LPGENW("[weather.dll] Moon"), LPGENW("Moon:"), L"%raw:Current/Moon%", 0, 0, 0,
+ "pressure", LPGENW("[weather.dll] Pressure"), LPGENW("Pressure:"), L"%raw:Current/Pressure% (%raw:Current/Pressure Tendency%)", 0, 0, 0,
+ "sunrise", LPGENW("[weather.dll] Sunrise"), LPGENW("Sunrise:"), L"%raw:Current/Sunrise%", 0, 0, 0,
+ "sunset", LPGENW("[weather.dll] Sunset"), LPGENW("Sunset:"), L"%raw:Current/Sunset%", 0, 0, 0,
+ "temp", LPGENW("[weather.dll] Temperature"), LPGENW("Temperature:"), L"%raw:Current/Temperature%", 0, 0, 0,
+ "uptime", LPGENW("[weather.dll] Update time"), LPGENW("Update time:"), L"%raw:Current/Update%", 0, 0, 0,
+ "uvindex", LPGENW("[weather.dll] UV Index"), LPGENW("UV Index:"), L"%raw:Current/UV% - %raw:Current/UVI%", 0, 0, 0,
+ "vis", LPGENW("[weather.dll] Visibility"), LPGENW("Visibility:"), L"%raw:Current/Visibility%", 0, 0, 0,
+ "wind", LPGENW("[weather.dll] Wind"), LPGENW("Wind:"), L"%raw:Current/Wind Direction% (%raw:Current/Wind Direction DEG%)/%raw:Current/Wind Speed%", 0, 0, 0,
0, 0, 0, 0, 0, 0, 0
};
diff --git a/plugins/TipperYM/src/preset_items.h b/plugins/TipperYM/src/preset_items.h index 8b07f0069c..a402cca5d6 100644 --- a/plugins/TipperYM/src/preset_items.h +++ b/plugins/TipperYM/src/preset_items.h @@ -25,15 +25,15 @@ Boston, MA 02111-1307, USA. typedef struct {
char *szID;
- TCHAR *swzName;
- TCHAR *swzLabel;
- TCHAR *swzValue;
+ wchar_t *swzName;
+ wchar_t *swzLabel;
+ wchar_t *swzValue;
char *szNeededSubst[MAX_PRESET_SUBST_COUNT];
} PRESETITEM;
typedef struct {
char *szID;
- TCHAR *swzName;
+ wchar_t *swzName;
DisplaySubstType type;
char *szModuleName;
char *szSettingName;
diff --git a/plugins/TipperYM/src/skin_parser.cpp b/plugins/TipperYM/src/skin_parser.cpp index 9f4416e51b..8bcb23daca 100644 --- a/plugins/TipperYM/src/skin_parser.cpp +++ b/plugins/TipperYM/src/skin_parser.cpp @@ -26,7 +26,7 @@ int RefreshSkinList(HWND hwndDlg) ListBox_ResetContent(hwndSkins);
ListBox_AddString(hwndSkins, TranslateT("# Solid color fill"));
- TCHAR szDirSave[1024];
+ wchar_t szDirSave[1024];
GetCurrentDirectory(1024, szDirSave);
SetCurrentDirectory(SKIN_FOLDER);
@@ -56,7 +56,7 @@ int RefreshSkinList(HWND hwndDlg) return ListBox_SelectString(GetDlgItem(hwndDlg, IDC_LB_SKINS), -1, opt.szSkinName);
}
-bool FileExists(TCHAR *filename)
+bool FileExists(wchar_t *filename)
{
HANDLE hFile = CreateFile(filename, 0, 0, 0, OPEN_EXISTING, 0, 0);
if (hFile != INVALID_HANDLE_VALUE)
@@ -68,14 +68,14 @@ bool FileExists(TCHAR *filename) return false;
}
-void ParseAboutPart(FILE *fp, TCHAR *buff, TCHAR *szSkinName)
+void ParseAboutPart(FILE *fp, wchar_t *buff, wchar_t *szSkinName)
{
myfgets(buff, 1024, fp);
while (buff[0] != '[')
{
if (buff[0] != ';')
{
- TCHAR *pch = _tcschr(buff, '=');
+ wchar_t *pch = wcschr(buff, '=');
if (pch++)
{
while (pch && (*pch == ' ' || *pch == '\t'))
@@ -83,11 +83,11 @@ void ParseAboutPart(FILE *fp, TCHAR *buff, TCHAR *szSkinName) if (pch)
{
- if (_tcsstr(buff, L"author"))
+ if (wcsstr(buff, L"author"))
{}
- else if (_tcsstr(buff, L"preview"))
+ else if (wcsstr(buff, L"preview"))
{
- TCHAR szImgPath[1024];
+ wchar_t szImgPath[1024];
mir_sntprintf(szImgPath, L"%s\\%s\\%s", SKIN_FOLDER, szSkinName, pch);
if (FileExists(szImgPath))
mir_tstrcpy(opt.szPreviewFile, szImgPath);
@@ -101,7 +101,7 @@ void ParseAboutPart(FILE *fp, TCHAR *buff, TCHAR *szSkinName) }
}
-void ParseImagePart(FILE *fp, TCHAR *buff, int iPart)
+void ParseImagePart(FILE *fp, wchar_t *buff, int iPart)
{
opt.szImgFile[iPart] = NULL;
opt.transfMode[iPart] = TM_NONE;
@@ -115,7 +115,7 @@ void ParseImagePart(FILE *fp, TCHAR *buff, int iPart) {
if (buff[0] != ';')
{
- TCHAR *pch = _tcschr(buff, '=');
+ wchar_t *pch = wcschr(buff, '=');
if (pch++)
{
while (pch && (*pch == ' ' || *pch == '\t'))
@@ -123,13 +123,13 @@ void ParseImagePart(FILE *fp, TCHAR *buff, int iPart) if (pch)
{
- if (_tcsstr(buff, L"image"))
+ if (wcsstr(buff, L"image"))
{
- TCHAR szImgPath[1024];
+ wchar_t szImgPath[1024];
mir_sntprintf(szImgPath, L"%s\\%s\\%s", SKIN_FOLDER, opt.szSkinName, pch);
opt.szImgFile[iPart] = mir_tstrdup(szImgPath);
}
- else if (_tcsstr(buff, L"tm"))
+ else if (wcsstr(buff, L"tm"))
{
if (!mir_tstrcmpi(pch, L"TM_NONE"))
opt.transfMode[iPart] = TM_NONE;
@@ -150,14 +150,14 @@ void ParseImagePart(FILE *fp, TCHAR *buff, int iPart) else
opt.transfMode[iPart] = TM_NONE;
}
- else if (_tcsstr(buff, L"left"))
- opt.margins[iPart].left = _ttoi(pch);
- else if (_tcsstr(buff, L"top"))
- opt.margins[iPart].top = _ttoi(pch);
- else if (_tcsstr(buff, L"right"))
- opt.margins[iPart].right = _ttoi(pch);
- else if (_tcsstr(buff, L"bottom"))
- opt.margins[iPart].bottom = _ttoi(pch);
+ else if (wcsstr(buff, L"left"))
+ opt.margins[iPart].left = _wtoi(pch);
+ else if (wcsstr(buff, L"top"))
+ opt.margins[iPart].top = _wtoi(pch);
+ else if (wcsstr(buff, L"right"))
+ opt.margins[iPart].right = _wtoi(pch);
+ else if (wcsstr(buff, L"bottom"))
+ opt.margins[iPart].bottom = _wtoi(pch);
}
}
}
@@ -167,25 +167,25 @@ void ParseImagePart(FILE *fp, TCHAR *buff, int iPart) }
}
-char *GetSettingName(TCHAR *szValue, char *szPostfix, char *buff, size_t buffsize)
+char *GetSettingName(wchar_t *szValue, char *szPostfix, char *buff, size_t buffsize)
{
buff[0] = 0;
- if (_tcsstr(szValue, L"traytitle"))
+ if (wcsstr(szValue, L"traytitle"))
mir_snprintf(buff, buffsize, "FontTrayTitle%s", szPostfix);
- else if (_tcsstr(szValue, L"title"))
+ else if (wcsstr(szValue, L"title"))
mir_snprintf(buff, buffsize, "FontFirst%s", szPostfix);
- else if (_tcsstr(szValue, L"label"))
+ else if (wcsstr(szValue, L"label"))
mir_snprintf(buff, buffsize, "FontLabels%s", szPostfix);
- else if (_tcsstr(szValue, L"value"))
+ else if (wcsstr(szValue, L"value"))
mir_snprintf(buff, buffsize, "FontValues%s", szPostfix);
- else if (_tcsstr(szValue, L"divider"))
+ else if (wcsstr(szValue, L"divider"))
mir_snprintf(buff, buffsize, "Divider%s", szPostfix);
return buff[0] ? buff : NULL;
}
-void ParseFontPart(FILE *fp, TCHAR *buff)
+void ParseFontPart(FILE *fp, wchar_t *buff)
{
char szSetting[64];
@@ -194,7 +194,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff) {
if (buff[0] != ';')
{
- TCHAR *pch = _tcschr(buff, '=');
+ wchar_t *pch = wcschr(buff, '=');
if (pch++)
{
while (pch && (*pch == ' ' || *pch == '\t'))
@@ -202,7 +202,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff) if (pch)
{
- if (_tcsstr(buff, L"face"))
+ if (wcsstr(buff, L"face"))
{
if (GetSettingName(buff, "", szSetting, sizeof(szSetting) - 1))
{
@@ -212,45 +212,45 @@ void ParseFontPart(FILE *fp, TCHAR *buff) db_set_ts(0, MODULE, szSetting, pch);
}
}
- else if (_tcsstr(buff, L"color"))
+ else if (wcsstr(buff, L"color"))
{
if (GetSettingName(buff, "Col", szSetting, sizeof(szSetting) - 1))
{
- BYTE r = _ttoi(pch);
- pch = _tcschr(pch, ' ');
+ BYTE r = _wtoi(pch);
+ pch = wcschr(pch, ' ');
if (++pch)
{
- BYTE g = _ttoi(pch);
- pch = _tcschr(pch, ' ');
+ BYTE g = _wtoi(pch);
+ pch = wcschr(pch, ' ');
if (++pch)
{
- BYTE b = _ttoi(pch);
+ BYTE b = _wtoi(pch);
COLORREF color = RGB(r, g ,b);
db_set_dw(0, MODULE, szSetting, color);
}
}
}
}
- else if (_tcsstr(buff, L"size"))
+ else if (wcsstr(buff, L"size"))
{
if (GetSettingName(buff, "Size", szSetting, sizeof(szSetting) - 1))
{
HDC hdc = GetDC(0);
- int size = -MulDiv(_ttoi(pch), GetDeviceCaps(hdc, LOGPIXELSY), 72);
+ int size = -MulDiv(_wtoi(pch), GetDeviceCaps(hdc, LOGPIXELSY), 72);
db_set_b(0, MODULE, szSetting, (BYTE)size);
ReleaseDC(0, hdc);
}
}
- else if (_tcsstr(buff, L"effect"))
+ else if (wcsstr(buff, L"effect"))
{
if (GetSettingName(buff, "Sty", szSetting, sizeof(szSetting) - 1))
{
BYTE effect = 0;
- if (_tcsstr(pch, L"font_bold"))
+ if (wcsstr(pch, L"font_bold"))
effect |= DBFONTF_BOLD;
- if (_tcsstr(pch, L"font_italic"))
+ if (wcsstr(pch, L"font_italic"))
effect |= DBFONTF_ITALIC;
- if (_tcsstr(pch, L"font_underline"))
+ if (wcsstr(pch, L"font_underline"))
effect |= DBFONTF_UNDERLINE;
db_set_b(0, MODULE, szSetting, effect);
@@ -265,14 +265,14 @@ void ParseFontPart(FILE *fp, TCHAR *buff) }
}
-void ParseAppearancePart(FILE *fp, TCHAR *buff)
+void ParseAppearancePart(FILE *fp, wchar_t *buff)
{
myfgets(buff, 1024, fp);
while (buff[0] != '[')
{
if (buff[0] != ';')
{
- TCHAR *pch = _tcschr(buff, '=');
+ wchar_t *pch = wcschr(buff, '=');
if (pch++)
{
while (pch && (*pch == ' ' || *pch == '\t'))
@@ -280,24 +280,24 @@ void ParseAppearancePart(FILE *fp, TCHAR *buff) if (pch)
{
- if (_tcsstr(buff, L"general-padding"))
- opt.iPadding = _ttoi(pch);
- else if (_tcsstr(buff, L"title-indent"))
- opt.iTitleIndent = _ttoi(pch);
- else if (_tcsstr(buff, L"text-indent"))
- opt.iTextIndent = _ttoi(pch);
- else if (_tcsstr(buff, L"value-indent"))
- opt.iValueIndent = _ttoi(pch);
- else if (_tcsstr(buff, L"text-padding"))
- opt.iTextPadding = _ttoi(pch);
- else if (_tcsstr(buff, L"outer-avatar-padding"))
- opt.iOuterAvatarPadding = _ttoi(pch);
- else if (_tcsstr(buff, L"inner-avatar-padding"))
- opt.iInnerAvatarPadding = _ttoi(pch);
- else if (_tcsstr(buff, L"sidebar-width"))
- opt.iSidebarWidth = _ttoi(pch);
- else if (_tcsstr(buff, L"opacity"))
- opt.iOpacity = _ttoi(pch);
+ if (wcsstr(buff, L"general-padding"))
+ opt.iPadding = _wtoi(pch);
+ else if (wcsstr(buff, L"title-indent"))
+ opt.iTitleIndent = _wtoi(pch);
+ else if (wcsstr(buff, L"text-indent"))
+ opt.iTextIndent = _wtoi(pch);
+ else if (wcsstr(buff, L"value-indent"))
+ opt.iValueIndent = _wtoi(pch);
+ else if (wcsstr(buff, L"text-padding"))
+ opt.iTextPadding = _wtoi(pch);
+ else if (wcsstr(buff, L"outer-avatar-padding"))
+ opt.iOuterAvatarPadding = _wtoi(pch);
+ else if (wcsstr(buff, L"inner-avatar-padding"))
+ opt.iInnerAvatarPadding = _wtoi(pch);
+ else if (wcsstr(buff, L"sidebar-width"))
+ opt.iSidebarWidth = _wtoi(pch);
+ else if (wcsstr(buff, L"opacity"))
+ opt.iOpacity = _wtoi(pch);
}
}
}
@@ -307,14 +307,14 @@ void ParseAppearancePart(FILE *fp, TCHAR *buff) }
}
-void ParseOtherPart(FILE *fp, TCHAR *buff)
+void ParseOtherPart(FILE *fp, wchar_t *buff)
{
myfgets(buff, 1024, fp);
while (buff[0] != '[')
{
if (buff[0] != ';')
{
- TCHAR *pch = _tcschr(buff, '=');
+ wchar_t *pch = wcschr(buff, '=');
if (pch++)
{
while (pch && (*pch == ' ' || *pch == '\t'))
@@ -322,9 +322,9 @@ void ParseOtherPart(FILE *fp, TCHAR *buff) if (pch)
{
- if (_tcsstr(buff, L"enable-coloring"))
+ if (wcsstr(buff, L"enable-coloring"))
{
- if (_tcsstr(pch, L"false"))
+ if (wcsstr(pch, L"false"))
opt.iEnableColoring = -1;
}
}
@@ -336,9 +336,9 @@ void ParseOtherPart(FILE *fp, TCHAR *buff) }
}
-void ParseSkinFile(TCHAR *szSkinName, bool bStartup, bool bOnlyPreview)
+void ParseSkinFile(wchar_t *szSkinName, bool bStartup, bool bOnlyPreview)
{
- TCHAR szDirSave[1024], buff[1024];
+ wchar_t szDirSave[1024], buff[1024];
if (opt.skinMode == SM_OBSOLOTE && bStartup)
return;
@@ -354,7 +354,7 @@ void ParseSkinFile(TCHAR *szSkinName, bool bStartup, bool bOnlyPreview) HANDLE hFind = FindFirstFile(L"*.tsf", &ffd);
if (hFind != INVALID_HANDLE_VALUE)
{
- FILE *fp = _tfopen(ffd.cFileName, L"r");
+ FILE *fp = _wfopen(ffd.cFileName, L"r");
if (fp)
{
myfgets(buff, 1024, fp);
diff --git a/plugins/TipperYM/src/skin_parser.h b/plugins/TipperYM/src/skin_parser.h index ca83f47915..c7981709b2 100644 --- a/plugins/TipperYM/src/skin_parser.h +++ b/plugins/TipperYM/src/skin_parser.h @@ -26,5 +26,5 @@ typedef enum { } SkinMode;
int RefreshSkinList(HWND hwndDlg);
-void ParseSkinFile(TCHAR *szSkinName, bool bStartup, bool bOnlyPreview);
+void ParseSkinFile(wchar_t *szSkinName, bool bStartup, bool bOnlyPreview);
#endif
\ No newline at end of file diff --git a/plugins/TipperYM/src/stdafx.h b/plugins/TipperYM/src/stdafx.h index b0bd0ad7df..b6facc2c8d 100644 --- a/plugins/TipperYM/src/stdafx.h +++ b/plugins/TipperYM/src/stdafx.h @@ -66,9 +66,9 @@ Boston, MA 02111-1307, USA. #include "preset_items.h"
#include "translations.h"
-#define MODULE "Tipper"
-#define MODULE_ITEMS "Tipper_Items"
-#define DEFAULT_SKIN_FOLDER "Skins\\Tipper"
+#define MODULE "Tipper"
+#define MODULE_ITEMS "Tipper_Items"
+#define DEFAULT_SKIN_FOLDER L"Skins\\Tipper"
extern HMODULE hInst;
@@ -80,6 +80,6 @@ extern int iCodePage; extern FI_INTERFACE *fii;
extern TOOLTIPSKIN skin;
-extern TCHAR SKIN_FOLDER[256];
+extern wchar_t SKIN_FOLDER[256];
extern int ReloadFont(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/TipperYM/src/str_utils.cpp b/plugins/TipperYM/src/str_utils.cpp index 63ccd39165..ccc537581a 100644 --- a/plugins/TipperYM/src/str_utils.cpp +++ b/plugins/TipperYM/src/str_utils.cpp @@ -67,34 +67,34 @@ bool utf2a(const char *us, char *buff, int bufflen) }
-bool t2w(const TCHAR *ts, wchar_t *buff, int bufflen)
+bool t2w(const wchar_t *ts, wchar_t *buff, int bufflen)
{
wcsncpy(buff, ts, bufflen);
return true;
}
-bool w2t(const wchar_t *ws, TCHAR *buff, int bufflen)
+bool w2t(const wchar_t *ws, wchar_t *buff, int bufflen)
{
wcsncpy(buff, ws, bufflen);
return true;
}
-bool t2a(const TCHAR *ts, char *buff, int bufflen)
+bool t2a(const wchar_t *ts, char *buff, int bufflen)
{
return w2a(ts, buff, bufflen);
}
-bool a2t(const char *as, TCHAR *buff, int bufflen)
+bool a2t(const char *as, wchar_t *buff, int bufflen)
{
return a2w(as, buff, bufflen);
}
-bool t2utf(const TCHAR *ts, char *buff, int bufflen)
+bool t2utf(const wchar_t *ts, char *buff, int bufflen)
{
return w2utf(ts, buff, bufflen);
}
-bool utf2t(const char *us, TCHAR *buff, int bufflen)
+bool utf2t(const char *us, wchar_t *buff, int bufflen)
{
return utf2w(us, buff, bufflen);
}
@@ -161,40 +161,40 @@ char *a2utf(const char *as) return ret;
}
-TCHAR *w2t(const wchar_t *ws)
+wchar_t *w2t(const wchar_t *ws)
{
return mir_wstrdup(ws);
}
-wchar_t *t2w(const TCHAR *ts)
+wchar_t *t2w(const wchar_t *ts)
{
return mir_tstrdup(ts);
}
-char *t2a(const TCHAR *ts)
+char *t2a(const wchar_t *ts)
{
return w2a(ts);
}
-TCHAR *a2t(const char *as)
+wchar_t *a2t(const char *as)
{
return a2w(as);
}
-TCHAR *utf2t(const char *utfs)
+wchar_t *utf2t(const char *utfs)
{
return utf2w(utfs);
}
-char *t2utf(const TCHAR *ts)
+char *t2utf(const wchar_t *ts)
{
return w2utf(ts);
}
-TCHAR *myfgets(TCHAR *Buf, int MaxCount, FILE *File)
+wchar_t *myfgets(wchar_t *Buf, int MaxCount, FILE *File)
{
- _fgetts(Buf, MaxCount, File);
+ fgetws(Buf, MaxCount, File);
for (size_t i = mir_tstrlen(Buf) - 1; ; i--)
{
if (Buf[i] == '\n' || Buf[i] == ' ')
diff --git a/plugins/TipperYM/src/str_utils.h b/plugins/TipperYM/src/str_utils.h index 26fbb613fa..4beca4e51b 100644 --- a/plugins/TipperYM/src/str_utils.h +++ b/plugins/TipperYM/src/str_utils.h @@ -32,14 +32,14 @@ bool w2utf(const wchar_t *ws, char *buff, int bufflen); bool a2utf(const char *as, char *buff, int bufflen);
bool utf2a(const char *ws, char *buff, int bufflen);
-bool t2w(const TCHAR *ts, wchar_t *buff, int bufflen);
-bool w2t(const wchar_t *ws, TCHAR *buff, int bufflen);
+bool t2w(const wchar_t *ts, wchar_t *buff, int bufflen);
+bool w2t(const wchar_t *ws, wchar_t *buff, int bufflen);
-bool t2a(const TCHAR *ts, char *buff, int bufflen);
-bool a2t(const char *as, TCHAR *buff, int bufflen);
+bool t2a(const wchar_t *ts, char *buff, int bufflen);
+bool a2t(const char *as, wchar_t *buff, int bufflen);
-bool t2utf(const TCHAR *ts, char *buff, int bufflen);
-bool utf2t(const char *us, TCHAR *buff, int bufflen);
+bool t2utf(const wchar_t *ts, char *buff, int bufflen);
+bool utf2t(const char *us, wchar_t *buff, int bufflen);
// remember to free return value
wchar_t *a2w(const char *as);
@@ -51,16 +51,16 @@ char *w2utf(const wchar_t *ws); char *utf2a(const char *us);
char *a2utf(const char *as);
-wchar_t *t2w(const TCHAR *ts);
-TCHAR *w2t(const wchar_t *ws);
+wchar_t *t2w(const wchar_t *ts);
+wchar_t *w2t(const wchar_t *ws);
-TCHAR *utf2t(const char *us);
-char *t2utf(const TCHAR *ts);
+wchar_t *utf2t(const char *us);
+char *t2utf(const wchar_t *ts);
-char *t2a(const TCHAR *ts);
-TCHAR *a2t(const char *as);
+char *t2a(const wchar_t *ts);
+wchar_t *a2t(const char *as);
-TCHAR *myfgets(TCHAR *Buf, int MaxCount, FILE *File);
+wchar_t *myfgets(wchar_t *Buf, int MaxCount, FILE *File);
#endif
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index fb0674de07..071e73c212 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. #include "stdafx.h" -bool DBGetContactSettingAsString(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen) +bool DBGetContactSettingAsString(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen) { DBVARIANT dbv; buff[0] = 0; @@ -31,13 +31,13 @@ bool DBGetContactSettingAsString(MCONTACT hContact, const char *szModuleName, co if (!db_get(hContact, szModuleName, szSettingName, &dbv)) { switch (dbv.type) { case DBVT_BYTE: - _itot(dbv.bVal, buff, 10); + _itow(dbv.bVal, buff, 10); break; case DBVT_WORD: - _ltot(dbv.wVal, buff, 10); + _ltow(dbv.wVal, buff, 10); break; case DBVT_DWORD: - _ltot(dbv.dVal, buff, 10); + _ltow(dbv.dVal, buff, 10); break; case DBVT_ASCIIZ: if (dbv.pszVal) a2t(dbv.pszVal, buff, bufflen); @@ -76,7 +76,7 @@ bool CheckContactType(MCONTACT hContact, const DISPLAYITEM &di) return false; } -void StripBBCodesInPlace(TCHAR *ptszText) +void StripBBCodesInPlace(wchar_t *ptszText) { if (!db_get_b(0, MODULE, "StripBBCodes", 1)) return; @@ -96,21 +96,21 @@ void StripBBCodesInPlace(TCHAR *ptszText) if (iRead > iLen) break; - if (iLen - iRead >= 3 && (_tcsnicmp(ptszText + iRead, L"[b]", 3) == 0 || _tcsnicmp(ptszText + iRead, L"[i]", 3) == 0)) + if (iLen - iRead >= 3 && (wcsnicmp(ptszText + iRead, L"[b]", 3) == 0 || wcsnicmp(ptszText + iRead, L"[i]", 3) == 0)) iRead += 3; - else if (iLen - iRead >= 4 && (_tcsnicmp(ptszText + iRead, L"[/b]", 4) == 0 || _tcsnicmp(ptszText + iRead, L"[/i]", 4) == 0)) + else if (iLen - iRead >= 4 && (wcsnicmp(ptszText + iRead, L"[/b]", 4) == 0 || wcsnicmp(ptszText + iRead, L"[/i]", 4) == 0)) iRead += 4; - else if (iLen - iRead >= 6 && (_tcsnicmp(ptszText + iRead, L"[color", 6) == 0)) { + else if (iLen - iRead >= 6 && (wcsnicmp(ptszText + iRead, L"[color", 6) == 0)) { while (iRead < iLen && ptszText[iRead] != ']') iRead++; iRead++;// skip the ']' } - else if (iLen - iRead >= 8 && (_tcsnicmp(ptszText + iRead, L"[/color]", 8) == 0)) + else if (iLen - iRead >= 8 && (wcsnicmp(ptszText + iRead, L"[/color]", 8) == 0)) iRead += 8; - else if (iLen - iRead >= 5 && (_tcsnicmp(ptszText + iRead, L"[size", 5) == 0)) { + else if (iLen - iRead >= 5 && (wcsnicmp(ptszText + iRead, L"[size", 5) == 0)) { while (iRead < iLen && ptszText[iRead] != ']') iRead++; iRead++;// skip the ']' } - else if (iLen - iRead >= 7 && (_tcsnicmp(ptszText + iRead, L"[/size]", 7) == 0)) + else if (iLen - iRead >= 7 && (wcsnicmp(ptszText + iRead, L"[/size]", 7) == 0)) iRead += 7; else { if (ptszText[iRead] != ptszText[iWrite]) ptszText[iWrite] = ptszText[iRead]; @@ -131,14 +131,14 @@ DWORD LastMessageTimestamp(MCONTACT hContact, bool received) return 0; } -void FormatTimestamp(DWORD ts, char *szFormat, TCHAR *buff, int bufflen) +void FormatTimestamp(DWORD ts, char *szFormat, wchar_t *buff, int bufflen) { - TCHAR swzForm[16]; + wchar_t swzForm[16]; a2t(szFormat, swzForm, 16); TimeZone_ToStringT(ts, swzForm, buff, bufflen); } -bool Uid(MCONTACT hContact, char *szProto, TCHAR *buff, int bufflen) +bool Uid(MCONTACT hContact, char *szProto, wchar_t *buff, int bufflen) { char *tmpProto = (hContact ? GetContactProto(hContact) : szProto); if (tmpProto) { @@ -150,7 +150,7 @@ bool Uid(MCONTACT hContact, char *szProto, TCHAR *buff, int bufflen) return false; } -bool UidName(char *szProto, TCHAR *buff, int bufflen) +bool UidName(char *szProto, wchar_t *buff, int bufflen) { if (szProto) { char *szUidName = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDTEXT, 0); @@ -162,7 +162,7 @@ bool UidName(char *szProto, TCHAR *buff, int bufflen) return false; } -TCHAR* GetLastMessageText(MCONTACT hContact, bool received) +wchar_t* GetLastMessageText(MCONTACT hContact, bool received) { for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) { DBEVENTINFO dbei = { sizeof(dbei) }; @@ -173,8 +173,8 @@ TCHAR* GetLastMessageText(MCONTACT hContact, bool received) if (dbei.cbBlob == 0 || dbei.pBlob == 0) return 0; - TCHAR *buff = DbGetEventTextT( &dbei, CP_ACP ); - TCHAR *swzMsg = mir_tstrdup(buff); + wchar_t *buff = DbGetEventTextT( &dbei, CP_ACP ); + wchar_t *swzMsg = mir_tstrdup(buff); mir_free(buff); StripBBCodesInPlace(swzMsg); @@ -206,9 +206,9 @@ bool CanRetrieveStatusMsg(MCONTACT hContact, char *szProto) return false; } -TCHAR* GetStatusMessageText(MCONTACT hContact) +wchar_t* GetStatusMessageText(MCONTACT hContact) { - TCHAR *swzMsg = NULL; + wchar_t *swzMsg = NULL; DBVARIANT dbv; char *szProto = GetContactProto(hContact); @@ -246,7 +246,7 @@ TCHAR* GetStatusMessageText(MCONTACT hContact) return swzMsg; } -bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int bufflen) +bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int bufflen) { bool recv = false; @@ -268,7 +268,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff else if (szProto) { PROTOACCOUNT *pa = Proto_GetAccount(szProto); if (pa && pa->tszAccountName) { - _tcsncpy(buff, pa->tszAccountName, bufflen); + wcsncpy(buff, pa->tszAccountName, bufflen); return true; } else @@ -284,17 +284,17 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff return UidName(szProto, buff, bufflen); } else if (!mir_tstrcmp(swzRawSpec, L"status_msg")) { - TCHAR *swzMsg = GetStatusMessageText(hContact); + wchar_t *swzMsg = GetStatusMessageText(hContact); if (swzMsg) { - _tcsncpy(buff, swzMsg, bufflen); + wcsncpy(buff, swzMsg, bufflen); mir_free(swzMsg); return true; } } else if ((recv = !mir_tstrcmp(swzRawSpec, L"last_msg")) || !mir_tstrcmp(swzRawSpec, L"last_msg_out")) { - TCHAR *swzMsg = GetLastMessageText(hContact, recv); + wchar_t *swzMsg = GetLastMessageText(hContact, recv); if (swzMsg) { - _tcsncpy(buff, swzMsg, bufflen); + wcsncpy(buff, swzMsg, bufflen); mir_free(swzMsg); return true; } @@ -305,9 +305,9 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff if (!hSubContact) return false; - TCHAR *swzNick = pcli->pfnGetContactDisplayName(hSubContact, 0); + wchar_t *swzNick = pcli->pfnGetContactDisplayName(hSubContact, 0); if (swzNick) - _tcsncpy(buff, swzNick, bufflen); + wcsncpy(buff, swzNick, bufflen); return true; } else if (!mir_tstrcmp(swzRawSpec, L"meta_subuid")) { @@ -418,7 +418,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff return false; } -bool GetSubstText(MCONTACT hContact, const DISPLAYSUBST &ds, TCHAR *buff, int bufflen) +bool GetSubstText(MCONTACT hContact, const DISPLAYSUBST &ds, wchar_t *buff, int bufflen) { TranslateFunc *transFunc = 0; for (int i = 0; i < iTransFuncsCount; i++) @@ -445,7 +445,7 @@ bool GetSubstText(MCONTACT hContact, const DISPLAYSUBST &ds, TCHAR *buff, int bu return false; } -bool GetRawSubstText(MCONTACT hContact, char *szRawSpec, TCHAR *buff, int bufflen) +bool GetRawSubstText(MCONTACT hContact, char *szRawSpec, wchar_t *buff, int bufflen) { size_t lenght = mir_strlen(szRawSpec); for (size_t i = 0; i < lenght; i++) { @@ -466,7 +466,7 @@ bool GetRawSubstText(MCONTACT hContact, char *szRawSpec, TCHAR *buff, int buffle return false; } -bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsFirst, TCHAR *swzDest, size_t iDestLen) +bool ApplySubst(MCONTACT hContact, const wchar_t *swzSource, bool parseTipperVarsFirst, wchar_t *swzDest, size_t iDestLen) { // hack - allow empty strings before passing to variables (note - zero length strings return false after this) if (swzDest && swzSource && (*swzSource == 0)) { @@ -475,18 +475,18 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF } // pass to variables plugin if available - TCHAR *swzVarSrc = (parseTipperVarsFirst ? mir_tstrdup(swzSource) : variables_parsedup((TCHAR *)swzSource, 0, hContact)); + wchar_t *swzVarSrc = (parseTipperVarsFirst ? mir_tstrdup(swzSource) : variables_parsedup((wchar_t *)swzSource, 0, hContact)); size_t iSourceLen = mir_tstrlen(swzVarSrc); size_t si = 0, di = 0, v = 0; - TCHAR swzVName[LABEL_LEN], swzRep[VALUE_LEN], swzAlt[VALUE_LEN]; + wchar_t swzVName[LABEL_LEN], swzRep[VALUE_LEN], swzAlt[VALUE_LEN]; while (si < iSourceLen && di < iDestLen - 1) { - if (swzVarSrc[si] == _T('%')) { + if (swzVarSrc[si] == '%') { si++; v = 0; while (si < iSourceLen && v < LABEL_LEN - 1) { - if (swzVarSrc[si] == _T('%')) + if (swzVarSrc[si] == '%') break; swzVName[v] = swzVarSrc[si]; @@ -494,7 +494,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF } if (v == 0) // bSubst len is 0 - just a % symbol - swzDest[di] = _T('%'); + swzDest[di] = '%'; else if (si < iSourceLen) // we found end % { swzVName[v] = 0; @@ -502,7 +502,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF bool bAltSubst = false, bSubst = false; // apply only to specific protocols - TCHAR *p = _tcsrchr(swzVName, _T('^')); // use last '^', so if you want a ^ in swzAlt text, you can just put a '^' on the end + wchar_t *p = wcsrchr(swzVName, '^'); // use last '^', so if you want a ^ in swzAlt text, you can just put a '^' on the end if (p) { *p = 0; p++; @@ -519,7 +519,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF goto empty; bool negate = false; - if (*p == _T('!')) { + if (*p == '!') { p++; if (*p == 0) goto error; negate = true; @@ -529,11 +529,11 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF bool spec = false; int len; - TCHAR *last = _tcsrchr(p, _T(',')); + wchar_t *last = wcsrchr(p, ','); if (!last) last = p; while (p <= last + 1) { - len = (int)_tcscspn(p, L","); + len = (int)wcscspn(p, L","); t2a(p, sproto, len); sproto[len] = 0; p += len + 1; @@ -551,17 +551,17 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF // get alternate text, if bSubst fails swzAlt[0] = 0; - p = _tcschr(swzVName, _T('|')); // use first '|' - so you can use the '|' symbol in swzAlt text + p = wcschr(swzVName, '|'); // use first '|' - so you can use the '|' symbol in swzAlt text if (p) { *p = 0; // clip swzAlt from swzVName p++; - if (mir_tstrlen(p) > 4 && _tcsncmp(p, L"raw:", 4) == 0) { // raw db substitution + if (mir_tstrlen(p) > 4 && wcsncmp(p, L"raw:", 4) == 0) { // raw db substitution char raw_spec[LABEL_LEN]; p += 4; t2a(p, raw_spec, LABEL_LEN); GetRawSubstText(hContact, raw_spec, swzAlt, VALUE_LEN); } - else if (mir_tstrlen(p) > 4 && _tcsncmp(p, L"sys:", 4) == 0) { // 'system' substitution + else if (mir_tstrlen(p) > 4 && wcsncmp(p, L"sys:", 4) == 0) { // 'system' substitution p += 4; GetSysSubstText(hContact, p, swzAlt, VALUE_LEN); } @@ -578,7 +578,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF if (ds_node) GetSubstText(hContact, ds_node->ds, swzAlt, VALUE_LEN); else { - _tcsncpy(swzAlt, p, VALUE_LEN); + wcsncpy(swzAlt, p, VALUE_LEN); bAltSubst = true; } } @@ -588,13 +588,13 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF } // get bSubst text - if (v > 4 && _tcsncmp(swzVName, L"raw:", 4) == 0) // raw db substitution + if (v > 4 && wcsncmp(swzVName, L"raw:", 4) == 0) // raw db substitution { char raw_spec[LABEL_LEN]; t2a(&swzVName[4], raw_spec, LABEL_LEN); bSubst = GetRawSubstText(hContact, raw_spec, swzRep, VALUE_LEN); } - else if (v > 4 && _tcsncmp(swzVName, L"sys:", 4) == 0) // 'system' substitution + else if (v > 4 && wcsncmp(swzVName, L"sys:", 4) == 0) // 'system' substitution { bSubst = GetSysSubstText(hContact, &swzVName[4], swzRep, VALUE_LEN); } @@ -616,12 +616,12 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF if (bSubst) { size_t rep_len = mir_tstrlen(swzRep); - _tcsncpy(&swzDest[di], swzRep, min(rep_len, iDestLen - di)); + wcsncpy(&swzDest[di], swzRep, min(rep_len, iDestLen - di)); di += rep_len - 1; // -1 because we inc at bottom of loop } else if (bAltSubst) { size_t alt_len = mir_tstrlen(swzAlt); - _tcsncpy(&swzDest[di], swzAlt, min(alt_len, iDestLen - di)); + wcsncpy(&swzDest[di], swzAlt, min(alt_len, iDestLen - di)); di += alt_len - 1; // -1 because we inc at bottom of loop } else goto empty; // empty value @@ -640,14 +640,14 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF if (parseTipperVarsFirst) { swzVarSrc = variables_parsedup(swzDest, 0, hContact); - _tcsncpy(swzDest, swzVarSrc, iDestLen); + wcsncpy(swzDest, swzVarSrc, iDestLen); mir_free(swzVarSrc); } // check for a 'blank' string - just spaces etc for (si = 0; si <= di; si++) { - if (swzDest[si] != 0 && swzDest[si] != _T(' ') && swzDest[si] != _T('\t') && swzDest[si] != _T('\r') && swzDest[si] != _T('\n')) + if (swzDest[si] != 0 && swzDest[si] != ' ' && swzDest[si] != '\t' && swzDest[si] != '\r' && swzDest[si] != '\n') return true; } @@ -658,23 +658,23 @@ empty: return false; error: - swzDest[0] = _T('*'); + swzDest[0] = '*'; swzDest[1] = 0; mir_free(swzVarSrc); return true; } -bool GetLabelText(MCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, size_t bufflen) +bool GetLabelText(MCONTACT hContact, const DISPLAYITEM &di, wchar_t *buff, size_t bufflen) { return ApplySubst(hContact, di.swzLabel, false, buff, bufflen); } -bool GetValueText(MCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, size_t bufflen) +bool GetValueText(MCONTACT hContact, const DISPLAYITEM &di, wchar_t *buff, size_t bufflen) { return ApplySubst(hContact, di.swzValue, di.bParseTipperVarsFirst, buff, bufflen); } -void TruncateString(TCHAR *ptszText) +void TruncateString(wchar_t *ptszText) { if (ptszText && opt.iLimitCharCount > 3) { if ((int)mir_tstrlen(ptszText) > opt.iLimitCharCount) { @@ -684,7 +684,7 @@ void TruncateString(TCHAR *ptszText) } } -TCHAR* GetProtoStatusMessage(char *szProto, WORD wStatus) +wchar_t* GetProtoStatusMessage(char *szProto, WORD wStatus) { if (!szProto || wStatus == ID_STATUS_OFFLINE) return NULL; @@ -694,9 +694,9 @@ TCHAR* GetProtoStatusMessage(char *szProto, WORD wStatus) if (!(flags & Proto_Status2Flag(wStatus))) return NULL; - TCHAR *ptszText = (TCHAR *)CallProtoService(szProto, PS_GETMYAWAYMSG, 0, SGMA_TCHAR); + wchar_t *ptszText = (wchar_t *)CallProtoService(szProto, PS_GETMYAWAYMSG, 0, SGMA_TCHAR); if ((INT_PTR)ptszText == CALLSERVICE_NOTFOUND) - ptszText = (TCHAR *)CallService(MS_AWAYMSG_GETSTATUSMSGT, wStatus, (LPARAM)szProto); + ptszText = (wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGT, wStatus, (LPARAM)szProto); else if (ptszText == NULL) { // try to use service without SGMA_TCHAR @@ -719,14 +719,14 @@ TCHAR* GetProtoStatusMessage(char *szProto, WORD wStatus) return ptszText; } -TCHAR* GetProtoExtraStatusTitle(char *szProto) +wchar_t* GetProtoExtraStatusTitle(char *szProto) { if (!szProto) return NULL; - TCHAR *ptszText = db_get_tsa(0, szProto, "XStatusName"); + wchar_t *ptszText = db_get_tsa(0, szProto, "XStatusName"); if (!ptszText) { - TCHAR buff[256]; + wchar_t buff[256]; if (EmptyXStatusToDefaultName(0, szProto, 0, buff, 256)) ptszText = mir_tstrdup(buff); } @@ -737,12 +737,12 @@ TCHAR* GetProtoExtraStatusTitle(char *szProto) return ptszText; } -TCHAR* GetProtoExtraStatusMessage(char *szProto) +wchar_t* GetProtoExtraStatusMessage(char *szProto) { if (!szProto) return NULL; - TCHAR *ptszText = db_get_tsa(0, szProto, "XStatusMsg"); + wchar_t *ptszText = db_get_tsa(0, szProto, "XStatusMsg"); if (ptszText == NULL) return NULL; @@ -759,7 +759,7 @@ TCHAR* GetProtoExtraStatusMessage(char *szProto) } } - TCHAR *tszParsed = variables_parse(ptszText, NULL, hContact); + wchar_t *tszParsed = variables_parse(ptszText, NULL, hContact); if (tszParsed) { mir_free(ptszText); @@ -773,26 +773,26 @@ TCHAR* GetProtoExtraStatusMessage(char *szProto) return ptszText; } -TCHAR* GetListeningTo(char *szProto) +wchar_t* GetListeningTo(char *szProto) { if (!szProto) return NULL; - TCHAR *ptszText = db_get_tsa(0, szProto, "ListeningTo"); + wchar_t *ptszText = db_get_tsa(0, szProto, "ListeningTo"); if (opt.bLimitMsg) TruncateString(ptszText); return ptszText; } -TCHAR* GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szValue) +wchar_t* GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szValue) { if (!szProto) return NULL; char szSetting[128]; mir_snprintf(szSetting, "%s/%s/%s", szProto, szSlot, szValue); - TCHAR *ptszText = db_get_tsa(0, "AdvStatus", szSetting); + wchar_t *ptszText = db_get_tsa(0, "AdvStatus", szSetting); if (opt.bLimitMsg) TruncateString(ptszText); diff --git a/plugins/TipperYM/src/subst.h b/plugins/TipperYM/src/subst.h index 66b5712462..888ca5b9cb 100644 --- a/plugins/TipperYM/src/subst.h +++ b/plugins/TipperYM/src/subst.h @@ -21,25 +21,25 @@ Boston, MA 02111-1307, USA. #ifndef _SUBST_INC
#define _SUBST_INC
-bool GetLabelText(MCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, size_t iBufflen);
-bool GetValueText(MCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, size_t iBufflen);
+bool GetLabelText(MCONTACT hContact, const DISPLAYITEM &di, wchar_t *buff, size_t iBufflen);
+bool GetValueText(MCONTACT hContact, const DISPLAYITEM &di, wchar_t *buff, size_t iBufflen);
bool CheckContactType(MCONTACT hContact, const DISPLAYITEM &di);
-void StripBBCodesInPlace(TCHAR *text);
+void StripBBCodesInPlace(wchar_t *text);
// can be used with hContact == 0 to get uid for a given proto
-bool UidName(char *szProto, TCHAR *buff, int bufflen);
-bool Uid(MCONTACT hContact, char *szProto, TCHAR *buff, int bufflen);
+bool UidName(char *szProto, wchar_t *buff, int bufflen);
+bool Uid(MCONTACT hContact, char *szProto, wchar_t *buff, int bufflen);
// get info for status and tray tooltip
-bool DBGetContactSettingAsString(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
+bool DBGetContactSettingAsString(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen);
bool CanRetrieveStatusMsg(MCONTACT hContact, char *szProto);
-TCHAR *GetProtoStatusMessage(char *szProto, WORD status);
-TCHAR *GetProtoExtraStatusTitle(char *szProto);
-TCHAR *GetProtoExtraStatusMessage(char *szProto);
-TCHAR *GetListeningTo(char *szProto);
-TCHAR *GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szValue);
+wchar_t *GetProtoStatusMessage(char *szProto, WORD status);
+wchar_t *GetProtoExtraStatusTitle(char *szProto);
+wchar_t *GetProtoExtraStatusMessage(char *szProto);
+wchar_t *GetListeningTo(char *szProto);
+wchar_t *GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szValue);
HICON GetJabberActivityIcon(MCONTACT hContact, char *szProto);
#endif
diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index 125867150e..770d1348ce 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -33,7 +33,7 @@ HANDLE hShowTipService, hShowTipWService, hHideTipService; HANDLE hReloadFonts = NULL;
HANDLE hFolderChanged, hSkinFolder;
-TCHAR SKIN_FOLDER[256];
+wchar_t SKIN_FOLDER[256];
CLIST_INTERFACE *pcli = NULL;
FI_INTERFACE *fii = NULL;
@@ -117,15 +117,15 @@ int EventDeleted(WPARAM wParam, LPARAM lParam) int ReloadSkinFolder(WPARAM, LPARAM)
{
- FoldersGetCustomPathT(hSkinFolder, SKIN_FOLDER, _countof(SKIN_FOLDER), _T(DEFAULT_SKIN_FOLDER));
+ FoldersGetCustomPathT(hSkinFolder, SKIN_FOLDER, _countof(SKIN_FOLDER), DEFAULT_SKIN_FOLDER);
return 0;
}
void InitFonts()
{
colourBg.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourBg.group, LPGENT("Tooltips"));
- mir_tstrcpy(colourBg.name, LPGENT("Background"));
+ mir_tstrcpy(colourBg.group, LPGENW("Tooltips"));
+ mir_tstrcpy(colourBg.name, LPGENW("Background"));
mir_strcpy(colourBg.dbSettingsGroup, MODULE);
mir_strcpy(colourBg.setting, "ColourBg");
colourBg.defcolour = RGB(219, 219, 219);
@@ -133,8 +133,8 @@ void InitFonts() ColourRegisterT(&colourBg);
colourBorder.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourBorder.group, LPGENT("Tooltips"));
- mir_tstrcpy(colourBorder.name, LPGENT("Border"));
+ mir_tstrcpy(colourBorder.group, LPGENW("Tooltips"));
+ mir_tstrcpy(colourBorder.name, LPGENW("Border"));
mir_strcpy(colourBorder.dbSettingsGroup, MODULE);
mir_strcpy(colourBorder.setting, "BorderCol");
colourBorder.defcolour = 0;
@@ -142,8 +142,8 @@ void InitFonts() ColourRegisterT(&colourBorder);
colourAvatarBorder.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourAvatarBorder.group, LPGENT("Tooltips"));
- mir_tstrcpy(colourAvatarBorder.name, LPGENT("Avatar border"));
+ mir_tstrcpy(colourAvatarBorder.group, LPGENW("Tooltips"));
+ mir_tstrcpy(colourAvatarBorder.name, LPGENW("Avatar border"));
mir_strcpy(colourAvatarBorder.dbSettingsGroup, MODULE);
mir_strcpy(colourAvatarBorder.setting, "AvBorderCol");
colourAvatarBorder.defcolour = 0;
@@ -151,8 +151,8 @@ void InitFonts() ColourRegisterT(&colourAvatarBorder);
colourDivider.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourDivider.group, LPGENT("Tooltips"));
- mir_tstrcpy(colourDivider.name, LPGENT("Dividers"));
+ mir_tstrcpy(colourDivider.group, LPGENW("Tooltips"));
+ mir_tstrcpy(colourDivider.name, LPGENW("Dividers"));
mir_strcpy(colourDivider.dbSettingsGroup, MODULE);
mir_strcpy(colourDivider.setting, "DividerCol");
colourDivider.defcolour = 0;
@@ -160,8 +160,8 @@ void InitFonts() ColourRegisterT(&colourDivider);
colourSidebar.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourSidebar.group, LPGENT("Tooltips"));
- mir_tstrcpy(colourSidebar.name, LPGENT("Sidebar"));
+ mir_tstrcpy(colourSidebar.group, LPGENW("Tooltips"));
+ mir_tstrcpy(colourSidebar.name, LPGENW("Sidebar"));
mir_strcpy(colourSidebar.dbSettingsGroup, MODULE);
mir_strcpy(colourSidebar.setting, "SidebarCol");
colourSidebar.defcolour = RGB(192, 192, 192);
@@ -170,12 +170,12 @@ void InitFonts() fontTitle.cbSize = sizeof(FontIDT);
fontTitle.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(fontTitle.group, LPGENT("Tooltips"));
- mir_tstrcpy(fontTitle.name, LPGENT("Title"));
+ mir_tstrcpy(fontTitle.group, LPGENW("Tooltips"));
+ mir_tstrcpy(fontTitle.name, LPGENW("Title"));
mir_strcpy(fontTitle.dbSettingsGroup, MODULE);
mir_strcpy(fontTitle.prefix, "FontFirst");
- mir_tstrcpy(fontTitle.backgroundGroup, LPGENT("Tooltips"));
- mir_tstrcpy(fontTitle.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(fontTitle.backgroundGroup, LPGENW("Tooltips"));
+ mir_tstrcpy(fontTitle.backgroundName, LPGENW("Background"));
fontTitle.order = 0;
fontTitle.deffontsettings.charset = DEFAULT_CHARSET;
@@ -186,12 +186,12 @@ void InitFonts() fontLabels.cbSize = sizeof(FontIDT);
fontLabels.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(fontLabels.group, LPGENT("Tooltips"));
- mir_tstrcpy(fontLabels.name, LPGENT("Labels"));
+ mir_tstrcpy(fontLabels.group, LPGENW("Tooltips"));
+ mir_tstrcpy(fontLabels.name, LPGENW("Labels"));
mir_strcpy(fontLabels.dbSettingsGroup, MODULE);
mir_strcpy(fontLabels.prefix, "FontLabels");
- mir_tstrcpy(fontLabels.backgroundGroup, LPGENT("Tooltips"));
- mir_tstrcpy(fontLabels.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(fontLabels.backgroundGroup, LPGENW("Tooltips"));
+ mir_tstrcpy(fontLabels.backgroundName, LPGENW("Background"));
fontLabels.order = 1;
fontLabels.deffontsettings.charset = DEFAULT_CHARSET;
@@ -202,12 +202,12 @@ void InitFonts() fontValues.cbSize = sizeof(FontIDT);
fontValues.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(fontValues.group, LPGENT("Tooltips"));
- mir_tstrcpy(fontValues.name, LPGENT("Values"));
+ mir_tstrcpy(fontValues.group, LPGENW("Tooltips"));
+ mir_tstrcpy(fontValues.name, LPGENW("Values"));
mir_strcpy(fontValues.dbSettingsGroup, MODULE);
mir_strcpy(fontValues.prefix, "FontValues");
- mir_tstrcpy(fontValues.backgroundGroup, LPGENT("Tooltips"));
- mir_tstrcpy(fontValues.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(fontValues.backgroundGroup, LPGENW("Tooltips"));
+ mir_tstrcpy(fontValues.backgroundName, LPGENW("Background"));
fontValues.order = 2;
fontValues.deffontsettings.charset = DEFAULT_CHARSET;
@@ -218,12 +218,12 @@ void InitFonts() fontTrayTitle.cbSize = sizeof(FontIDT);
fontTrayTitle.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(fontTrayTitle.group, LPGENT("Tooltips"));
- mir_tstrcpy(fontTrayTitle.name, LPGENT("Tray title"));
+ mir_tstrcpy(fontTrayTitle.group, LPGENW("Tooltips"));
+ mir_tstrcpy(fontTrayTitle.name, LPGENW("Tray title"));
mir_strcpy(fontTrayTitle.dbSettingsGroup, MODULE);
mir_strcpy(fontTrayTitle.prefix, "FontTrayTitle");
- mir_tstrcpy(fontTrayTitle.backgroundGroup, LPGENT("Tooltips"));
- mir_tstrcpy(fontTrayTitle.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(fontTrayTitle.backgroundGroup, LPGENW("Tooltips"));
+ mir_tstrcpy(fontTrayTitle.backgroundName, LPGENW("Background"));
fontTrayTitle.order = 0;
fontTrayTitle.deffontsettings.charset = DEFAULT_CHARSET;
@@ -254,8 +254,8 @@ int ModulesLoaded(WPARAM, LPARAM) hFolderChanged = HookEvent(ME_FOLDERS_PATH_CHANGED, ReloadSkinFolder);
- hSkinFolder = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("Tipper"), MIRANDA_PATHT L"\\" _T(DEFAULT_SKIN_FOLDER));
- FoldersGetCustomPathT(hSkinFolder, SKIN_FOLDER, _countof(SKIN_FOLDER), _T(DEFAULT_SKIN_FOLDER));
+ hSkinFolder = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("Tipper"), MIRANDA_PATHT L"\\" DEFAULT_SKIN_FOLDER);
+ FoldersGetCustomPathT(hSkinFolder, SKIN_FOLDER, _countof(SKIN_FOLDER), DEFAULT_SKIN_FOLDER);
InitTipperSmileys();
LoadOptions();
@@ -298,7 +298,7 @@ static INT_PTR ReloadSkin(WPARAM wParam, LPARAM lParam) LoadOptions();
opt.skinMode = (SkinMode)wParam;
if (lParam != 0)
- _tcscpy_s(opt.szSkinName, _A2T((char*)(lParam)));
+ wcscpy_s(opt.szSkinName, _A2T((char*)(lParam)));
ParseSkinFile(opt.szSkinName, false, false);
ReloadFont(0, 0);
SaveOptions();
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index b89c3c2b07..87679f08a7 100644 --- a/plugins/TipperYM/src/translations.cpp +++ b/plugins/TipperYM/src/translations.cpp @@ -63,14 +63,14 @@ void AddTranslation(DBVTranslation *newTrans) mir_free(szName);
}
-TCHAR *NullTranslation(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *NullTranslation(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
if (DBGetContactSettingAsString(hContact, szModuleName, szSettingName, buff, bufflen))
return buff;
return NULL;
}
-TCHAR* TimestampToShortDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t* TimestampToShortDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
@@ -79,7 +79,7 @@ TCHAR* TimestampToShortDate(MCONTACT hContact, const char *szModuleName, const c return TimeZone_ToStringT(ts, L"d", buff, bufflen);
}
-TCHAR* TimestampToLongDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t* TimestampToLongDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
@@ -88,7 +88,7 @@ TCHAR* TimestampToLongDate(MCONTACT hContact, const char *szModuleName, const ch return TimeZone_ToStringT(ts, L"D", buff, bufflen);
}
-TCHAR* TimestampToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t* TimestampToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
@@ -97,7 +97,7 @@ TCHAR* TimestampToTime(MCONTACT hContact, const char *szModuleName, const char * return TimeZone_ToStringT(ts, L"s", buff, bufflen);
}
-TCHAR* TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t* TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
@@ -106,7 +106,7 @@ TCHAR* TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, const return TimeZone_ToStringT(ts, L"t", buff, bufflen);
}
-TCHAR* TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t* TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
DWORD t = (DWORD)time(0);
@@ -126,7 +126,7 @@ TCHAR* TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, co return buff;
}
-TCHAR *SecondsToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *SecondsToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD diff = db_get_dw(hContact, szModuleName, szSettingName, 0);
int d = (diff / 60 / 60 / 24);
@@ -142,15 +142,15 @@ TCHAR *SecondsToTimeDifference(MCONTACT hContact, const char *szModuleName, cons return buff;
}
-TCHAR *WordToStatusDesc(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *WordToStatusDesc(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
WORD wStatus = db_get_w(hContact, szModuleName, szSettingName, ID_STATUS_OFFLINE);
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
- _tcsncpy_s(buff, bufflen, szStatus, _TRUNCATE);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
+ wcsncpy_s(buff, bufflen, szStatus, _TRUNCATE);
return buff;
}
-TCHAR *ByteToYesNo(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *ByteToYesNo(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
@@ -158,9 +158,9 @@ TCHAR *ByteToYesNo(MCONTACT hContact, const char *szModuleName, const char *szSe if (dbv.type == DBVT_BYTE)
{
if (dbv.bVal != 0)
- _tcsncpy(buff, L"Yes", bufflen);
+ wcsncpy(buff, L"Yes", bufflen);
else
- _tcsncpy(buff, L"No", bufflen);
+ wcsncpy(buff, L"No", bufflen);
buff[bufflen - 1] = 0;
db_free(&dbv);
return buff;
@@ -170,13 +170,13 @@ TCHAR *ByteToYesNo(MCONTACT hContact, const char *szModuleName, const char *szSe return 0;
}
-TCHAR *ByteToGender(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *ByteToGender(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
BYTE val = (BYTE)db_get_b(hContact, szModuleName, szSettingName, 0);
if (val == 'F')
- _tcsncpy(buff, TranslateT("Female"), bufflen);
+ wcsncpy(buff, TranslateT("Female"), bufflen);
else if (val == 'M')
- _tcsncpy(buff, TranslateT("Male"), bufflen);
+ wcsncpy(buff, TranslateT("Male"), bufflen);
else
return 0;
@@ -184,7 +184,7 @@ TCHAR *ByteToGender(MCONTACT hContact, const char *szModuleName, const char *szS return buff;
}
-TCHAR *WordToCountry(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *WordToCountry(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
char *szCountryName = 0;
WORD cid = (WORD)db_get_w(hContact, szModuleName, szSettingName, (WORD)-1);
@@ -199,7 +199,7 @@ TCHAR *WordToCountry(MCONTACT hContact, const char *szModuleName, const char *sz return 0;
}
-TCHAR *DwordToIp(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *DwordToIp(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ip = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ip) {
@@ -229,7 +229,7 @@ bool GetInt(const DBVARIANT &dbv, int *iVal) return false;
}
-TCHAR *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const char *prefix, TCHAR *buff, int bufflen)
+wchar_t *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const char *prefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -259,7 +259,7 @@ TCHAR *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const cha time.tm_mon = month - 1;
time.tm_year = year - 1900;
- _tcsftime(buff, bufflen, L"%x", &time);
+ wcsftime(buff, bufflen, L"%x", &time);
return buff;
@@ -274,7 +274,7 @@ TCHAR *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const cha return 0;
}
-TCHAR *DayMonthYearToAge(MCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+wchar_t *DayMonthYearToAge(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -323,7 +323,7 @@ TCHAR *DayMonthYearToAge(MCONTACT hContact, const char *szModuleName, const char return 0;
}
-TCHAR *HoursMinutesSecondsToTime(MCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+wchar_t *HoursMinutesSecondsToTime(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -367,7 +367,7 @@ TCHAR *HoursMinutesSecondsToTime(MCONTACT hContact, const char *szModuleName, co return 0;
}
-TCHAR *HoursMinutesToTime(MCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+wchar_t *HoursMinutesToTime(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -403,7 +403,7 @@ TCHAR *HoursMinutesToTime(MCONTACT hContact, const char *szModuleName, const cha return 0;
}
-TCHAR *DmyToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+wchar_t *DmyToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -505,7 +505,7 @@ TCHAR *DmyToTimeDifference(MCONTACT hContact, const char *szModuleName, const ch return 0;
}
-TCHAR *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+wchar_t *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -558,9 +558,9 @@ TCHAR *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleName, }
-TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
- TCHAR szDefaultName[1024];
+ wchar_t szDefaultName[1024];
CUSTOM_STATUS xstatus = {0};
DBVARIANT dbv;
@@ -569,7 +569,7 @@ TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, co {
if (!db_get_ts(hContact, szModuleName, szSettingName, &dbv))
{
- _tcsncpy(buff, TranslateTS(dbv.ptszVal), bufflen);
+ wcsncpy(buff, TranslateTS(dbv.ptszVal), bufflen);
buff[bufflen - 1] = 0;
return buff;
}
@@ -590,7 +590,7 @@ TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, co if (CallProtoService(szModuleName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus))
return 0;
- _tcsncpy(buff, TranslateTS(szDefaultName), bufflen);
+ wcsncpy(buff, TranslateTS(szDefaultName), bufflen);
buff[bufflen - 1] = 0;
return buff;
}
@@ -598,7 +598,7 @@ TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, co return 0;
}
-TCHAR *TimezoneToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *TimezoneToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
int timezone = db_get_b(hContact,szModuleName,szSettingName,256);
if (timezone==256 || (char)timezone==-100)
@@ -623,7 +623,7 @@ TCHAR *TimezoneToTime(MCONTACT hContact, const char *szModuleName, const char *s return buff;
}
-TCHAR *ByteToDay(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *ByteToDay(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
int iDay = db_get_w(hContact, szModuleName, szSettingName, -1);
if (iDay > -1 && iDay < 7)
@@ -636,7 +636,7 @@ TCHAR *ByteToDay(MCONTACT hContact, const char *szModuleName, const char *szSett return 0;
}
-TCHAR *ByteToMonth(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *ByteToMonth(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
int iMonth = db_get_w(hContact, szModuleName, szSettingName, 0);
if (iMonth > 0 && iMonth < 13)
@@ -649,7 +649,7 @@ TCHAR *ByteToMonth(MCONTACT hContact, const char *szModuleName, const char *szSe return 0;
}
-TCHAR *ByteToLanguage(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *ByteToLanguage(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
int iLang = db_get_b(hContact, szModuleName, szSettingName, 0);
if (iLang)
@@ -680,29 +680,29 @@ INT_PTR ServiceAddTranslation(WPARAM, LPARAM lParam) static DBVTranslation internalTranslations[] =
{
- { NullTranslation, LPGENT("[No translation]") },
- { WordToStatusDesc, LPGENT("WORD to status description") },
- { TimestampToTime, LPGENT("DWORD timestamp to time") },
- { TimestampToTimeDifference, LPGENT("DWORD timestamp to time difference") },
- { ByteToYesNo, LPGENT("BYTE to Yes/No") },
- { ByteToGender, LPGENT("BYTE to Male/Female (ICQ)") },
- { WordToCountry, LPGENT("WORD to country name") },
- { DwordToIp, LPGENT("DWORD to IP address") },
- { DayMonthYearToDate, LPGENT("<prefix>Day|Month|Year to date") },
- { DayMonthYearToAge, LPGENT("<prefix>Day|Month|Year to age") },
- { HoursMinutesSecondsToTime, LPGENT("<prefix>Hours|Minutes|Seconds to time") },
- { DmyToTimeDifference, LPGENT("<prefix>Day|Month|Year|Hours|Minutes|Seconds to time difference") },
- { DayMonthToDaysToNextBirthday, LPGENT("<prefix>Day|Month to days to next birthday") },
- { TimestampToTimeNoSecs, LPGENT("DWORD timestamp to time (no seconds)") },
- { HoursMinutesToTime, LPGENT("<prefix>Hours|Minutes to time") },
- { TimestampToShortDate, LPGENT("DWORD timestamp to date (short)") },
- { TimestampToLongDate, LPGENT("DWORD timestamp to date (long)") },
- { EmptyXStatusToDefaultName, LPGENT("xStatus: empty xStatus name to default name") },
- { SecondsToTimeDifference, LPGENT("DWORD seconds to time difference") },
- { TimezoneToTime, LPGENT("BYTE timezone to time") },
- { ByteToDay, LPGENT("WORD to name of a day (0..6, 0 is Sunday)") },
- { ByteToMonth, LPGENT("WORD to name of a month (1..12, 1 is January)") },
- { ByteToLanguage, LPGENT("BYTE to language (ICQ)") },
+ { NullTranslation, LPGENW("[No translation]") },
+ { WordToStatusDesc, LPGENW("WORD to status description") },
+ { TimestampToTime, LPGENW("DWORD timestamp to time") },
+ { TimestampToTimeDifference, LPGENW("DWORD timestamp to time difference") },
+ { ByteToYesNo, LPGENW("BYTE to Yes/No") },
+ { ByteToGender, LPGENW("BYTE to Male/Female (ICQ)") },
+ { WordToCountry, LPGENW("WORD to country name") },
+ { DwordToIp, LPGENW("DWORD to IP address") },
+ { DayMonthYearToDate, LPGENW("<prefix>Day|Month|Year to date") },
+ { DayMonthYearToAge, LPGENW("<prefix>Day|Month|Year to age") },
+ { HoursMinutesSecondsToTime, LPGENW("<prefix>Hours|Minutes|Seconds to time") },
+ { DmyToTimeDifference, LPGENW("<prefix>Day|Month|Year|Hours|Minutes|Seconds to time difference") },
+ { DayMonthToDaysToNextBirthday, LPGENW("<prefix>Day|Month to days to next birthday") },
+ { TimestampToTimeNoSecs, LPGENW("DWORD timestamp to time (no seconds)") },
+ { HoursMinutesToTime, LPGENW("<prefix>Hours|Minutes to time") },
+ { TimestampToShortDate, LPGENW("DWORD timestamp to date (short)") },
+ { TimestampToLongDate, LPGENW("DWORD timestamp to date (long)") },
+ { EmptyXStatusToDefaultName, LPGENW("xStatus: empty xStatus name to default name") },
+ { SecondsToTimeDifference, LPGENW("DWORD seconds to time difference") },
+ { TimezoneToTime, LPGENW("BYTE timezone to time") },
+ { ByteToDay, LPGENW("WORD to name of a day (0..6, 0 is Sunday)") },
+ { ByteToMonth, LPGENW("WORD to name of a month (1..12, 1 is January)") },
+ { ByteToLanguage, LPGENW("BYTE to language (ICQ)") },
};
void InitTranslations()
diff --git a/plugins/TipperYM/src/translations.h b/plugins/TipperYM/src/translations.h index 1ed2e8f53e..d981a2601c 100644 --- a/plugins/TipperYM/src/translations.h +++ b/plugins/TipperYM/src/translations.h @@ -117,9 +117,9 @@ static char *months[12] = { void InitTranslations();
void DeinitTranslations();
-TCHAR *TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
-TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
-TCHAR *WordToStatusDesc(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
+wchar_t *TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen);
+wchar_t *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen);
+wchar_t *WordToStatusDesc(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen);
#endif
diff --git a/plugins/Toaster/src/options.cpp b/plugins/Toaster/src/options.cpp index d023d19d67..0dcfe12f64 100644 --- a/plugins/Toaster/src/options.cpp +++ b/plugins/Toaster/src/options.cpp @@ -46,10 +46,10 @@ void COptions::Enabled_OnChange(CCtrlCheck* chk) int OnOptionsInitialized(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.ptszTitle = L"Popups"; //_T(MODULE);
+ odp.pwszTitle = L"Popups"; //_T(MODULE);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.position = -790000000;
- odp.ptszTab = _T(MODULE);
+ odp.pwszTab = _T(MODULE);
odp.pDialog = new COptions();
Options_AddPage(wParam, &odp);
diff --git a/plugins/Toaster/src/structs.h b/plugins/Toaster/src/structs.h index d304141f2f..fe8a658850 100644 --- a/plugins/Toaster/src/structs.h +++ b/plugins/Toaster/src/structs.h @@ -3,8 +3,8 @@ struct ToastData : public MZeroedObject
{
MCONTACT hContact;
- TCHAR *tszTitle;
- TCHAR *tszText;
+ wchar_t *tszTitle;
+ wchar_t *tszText;
union
{
HICON hIcon;
@@ -15,7 +15,7 @@ struct ToastData : public MZeroedObject WNDPROC pPopupProc;
void *vPopupData;
- ToastData(MCONTACT _hContact, const TCHAR *_tszTitle, const TCHAR *_tszText, HICON _hIcon = NULL) :
+ ToastData(MCONTACT _hContact, const wchar_t *_tszTitle, const wchar_t *_tszText, HICON _hIcon = NULL) :
hContact(_hContact),
tszTitle(mir_tstrdup(_tszTitle)),
tszText(mir_tstrdup(_tszText)),
@@ -24,7 +24,7 @@ struct ToastData : public MZeroedObject pPopupProc(NULL),
vPopupData(NULL)
{}
- ToastData(MCONTACT _hContact, const TCHAR *_tszTitle, const TCHAR *_tszText, HBITMAP bmp = NULL) :
+ ToastData(MCONTACT _hContact, const wchar_t *_tszTitle, const wchar_t *_tszText, HBITMAP bmp = NULL) :
hContact(_hContact),
tszTitle(mir_tstrdup(_tszTitle)),
tszText(mir_tstrdup(_tszText)),
diff --git a/plugins/TooltipNotify/src/Tooltip.cpp b/plugins/TooltipNotify/src/Tooltip.cpp index 2b5cc39063..9f9edc03e4 100644 --- a/plugins/TooltipNotify/src/Tooltip.cpp +++ b/plugins/TooltipNotify/src/Tooltip.cpp @@ -4,7 +4,7 @@ #include "stdafx.h"
-/*static*/ const TCHAR *CTooltip::s_szTooltipClass = L"MimTooltipNotify";
+/*static*/ const wchar_t *CTooltip::s_szTooltipClass = L"MimTooltipNotify";
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
@@ -192,9 +192,9 @@ void CTooltip::set_Position(INT x, INT y) SetWindowPos(m_hWnd, 0, x, y, 0, 0, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE);
}
-void CTooltip::set_Text(const TCHAR* szText)
+void CTooltip::set_Text(const wchar_t* szText)
{
if (m_szText) free(m_szText);
- m_szText = _tcsdup(szText);
+ m_szText = wcsdup(szText);
}
diff --git a/plugins/TooltipNotify/src/Tooltip.h b/plugins/TooltipNotify/src/Tooltip.h index 2ad5bea397..9e47040bf6 100644 --- a/plugins/TooltipNotify/src/Tooltip.h +++ b/plugins/TooltipNotify/src/Tooltip.h @@ -19,7 +19,7 @@ public: void get_Rect(RECT *Rect) const;
void set_TransparentInput(BOOL bOnOff);
void set_Translucency(BYTE bAlpha);
- void set_Text(const TCHAR* szText);
+ void set_Text(const wchar_t* szText);
void set_Font(const LOGFONT& Font) { m_lfFont = Font; }
void set_TextColor(DWORD TextColor) { m_dwTextColor = TextColor; }
void set_BgColor(DWORD BgColor) { m_dwBgColor = BgColor; }
@@ -43,11 +43,11 @@ private: DWORD m_dwTextColor;
DWORD m_dwBgColor;
LOGFONT m_lfFont;
- TCHAR *m_szText;
+ wchar_t *m_szText;
BYTE m_bAlpha;
BOOL m_bTranspInput;
BYTE m_bLDblClick;
CTooltipNotify *m_pTooltipNotify;
- static const TCHAR *s_szTooltipClass;
+ static const wchar_t *s_szTooltipClass;
};
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 439ca55f58..3bb08f45ad 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -20,17 +20,17 @@ static const int ID_TTNTF_STATUS_TYPING = ID_STATUS_INVISIBLE + 10; static const int ID_TTNTF_STATUS_IDLE = ID_STATUS_INVISIBLE + 11;
static const int ID_TTNTF_STATUS_NOT_IDLE = ID_STATUS_INVISIBLE + 12;
-#define FONTSERV_GROUP LPGENT("Tooltip Notify")
-#define FONTSERV_ONLINE LPGENT("Online")
-#define FONTSERV_OFFLINE LPGENT("Offline")
-#define FONTSERV_OTHER LPGENT("Other status")
-#define FONTSERV_TYPING LPGENT("Typing")
-#define FONTSERV_IDLE LPGENT("Idle")
+#define FONTSERV_GROUP LPGENW("Tooltip Notify")
+#define FONTSERV_ONLINE LPGENW("Online")
+#define FONTSERV_OFFLINE LPGENW("Offline")
+#define FONTSERV_OTHER LPGENW("Other status")
+#define FONTSERV_TYPING LPGENW("Typing")
+#define FONTSERV_IDLE LPGENW("Idle")
struct FontEntry
{
int status;
- TCHAR* name;
+ wchar_t* name;
char* fontPrefix;
char* clrPrefix;
};
@@ -73,31 +73,31 @@ CTooltipNotify::~CTooltipNotify() void CTooltipNotify::RegisterFonts()
{
FontIDT fontId = { sizeof(fontId) };
- _tcsncpy(fontId.group, FONTSERV_GROUP, _countof(fontId.group) - 1);
+ wcsncpy(fontId.group, FONTSERV_GROUP, _countof(fontId.group) - 1);
strncpy(fontId.dbSettingsGroup, MODULENAME, _countof(fontId.dbSettingsGroup) - 1);
fontId.flags = FIDF_DEFAULTVALID;
fontId.deffontsettings.colour = DEF_SETTING_TXTCOLOR;
fontId.deffontsettings.size = -MulDiv(DEF_SETTING_FONT_SIZE, DEF_LOGPIXELSY, 72);
fontId.deffontsettings.style = DEF_SETTING_FONT_STYLE;
fontId.deffontsettings.charset = DEF_SETTING_FONT_CHARSET;
- _tcsncpy(fontId.deffontsettings.szFace, DEF_SETTING_FONT_FACE, _countof(fontId.deffontsettings.szFace) - 1);
+ wcsncpy(fontId.deffontsettings.szFace, DEF_SETTING_FONT_FACE, _countof(fontId.deffontsettings.szFace) - 1);
fontId.order = 0;
- _tcsncpy(fontId.backgroundGroup, FONTSERV_GROUP, _countof(fontId.backgroundGroup) - 1);
+ wcsncpy(fontId.backgroundGroup, FONTSERV_GROUP, _countof(fontId.backgroundGroup) - 1);
ColourIDT colorId = { sizeof(colorId) };
- _tcsncpy(colorId.group, FONTSERV_GROUP, _countof(colorId.group) - 1);
+ wcsncpy(colorId.group, FONTSERV_GROUP, _countof(colorId.group) - 1);
strncpy(colorId.dbSettingsGroup, MODULENAME, _countof(colorId.dbSettingsGroup) - 1);
colorId.flags = 0;
colorId.defcolour = DEF_SETTING_BGCOLOR;
colorId.order = 0;
for (int i = 0; i < _countof(s_fontTable); i++) {
- _tcsncpy(fontId.name, s_fontTable[i].name, _countof(fontId.name) - 1);
+ wcsncpy(fontId.name, s_fontTable[i].name, _countof(fontId.name) - 1);
strncpy(fontId.prefix, s_fontTable[i].fontPrefix, _countof(fontId.prefix) - 1);
- _tcsncpy(fontId.backgroundName, s_fontTable[i].name, _countof(fontId.backgroundName) - 1);
+ wcsncpy(fontId.backgroundName, s_fontTable[i].name, _countof(fontId.backgroundName) - 1);
::FontRegisterT(&fontId);
- _tcsncpy(colorId.name, s_fontTable[i].name, _countof(colorId.name) - 1);
+ wcsncpy(colorId.name, s_fontTable[i].name, _countof(colorId.name) - 1);
strncpy(colorId.setting, s_fontTable[i].clrPrefix, _countof(colorId.setting) - 1);
::ColourRegisterT(&colorId);
}
@@ -105,7 +105,7 @@ void CTooltipNotify::RegisterFonts() void CTooltipNotify::GetFont(int iStatus, LOGFONT* lf, COLORREF* text, COLORREF* bg)
{
- TCHAR* fontName = 0;
+ wchar_t* fontName = 0;
for (int i = 0; i < _countof(s_fontTable); i++) {
if (s_fontTable[i].status == iStatus) {
fontName = s_fontTable[i].name;
@@ -117,10 +117,10 @@ void CTooltipNotify::GetFont(int iStatus, LOGFONT* lf, COLORREF* text, COLORREF* // name and group only
FontIDT fontId = { sizeof(fontId), FONTSERV_GROUP, 0 };
- _tcsncpy(fontId.name, fontName, _countof(fontId.name) - 1);
+ wcsncpy(fontId.name, fontName, _countof(fontId.name) - 1);
*text = (COLORREF)::CallService(MS_FONT_GETT, (WPARAM)&fontId, (LPARAM)lf);
ColourIDT colorId = { sizeof(colorId), FONTSERV_GROUP, 0 };
- _tcsncpy(colorId.name, fontName, _countof(colorId.name) - 1);
+ wcsncpy(colorId.name, fontName, _countof(colorId.name) - 1);
*bg = (COLORREF)::CallService(MS_COLOUR_GETT, (WPARAM)&colorId, 0);
}
@@ -276,7 +276,7 @@ int CTooltipNotify::InitializeOptions(WPARAM wParam, LPARAM) CTooltip *CTooltipNotify::BeginNotify(STooltipData *pTooltipData)
{
- TCHAR szTooltipText[64] = { 0 };
+ wchar_t szTooltipText[64] = { 0 };
MakeTooltipString(pTooltipData->hContact, pTooltipData->iStatus, szTooltipText, 64);
LOGFONT lf = { 0 };
@@ -536,7 +536,7 @@ BOOL CTooltipNotify::OptionsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l case WM_VSCROLL:
case WM_HSCROLL:
- TCHAR str[10];
+ wchar_t str[10];
mir_sntprintf(str, L"%d%%", 100 * SendDlgItemMessage(hDlg, IDC_TRANSPARENCY_SLIDER, TBM_GETPOS, 0, 0) / 255);
SetDlgItemText(hDlg, IDC_TRANSPERC, str);
if (wParam != 0x12345678)
@@ -674,7 +674,7 @@ BOOL CTooltipNotify::ProtosDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM) int proto_count = ListView_GetItemCount(GetDlgItem(hDlg, IDC_PROTOS));
for (int i = 0; i < proto_count; i++) {
- TCHAR szProto[64];
+ wchar_t szProto[64];
ListView_GetItemText(GetDlgItem(hDlg, IDC_PROTOS), i, 0, szProto, _countof(szProto));
@@ -796,7 +796,7 @@ BOOL CTooltipNotify::ContactsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM) }
-TCHAR* CTooltipNotify::StatusToString(int iStatus, TCHAR *szStatus, int iBufSize)
+wchar_t* CTooltipNotify::StatusToString(int iStatus, wchar_t *szStatus, int iBufSize)
{
if (iStatus >= ID_STATUS_OFFLINE && iStatus <= ID_STATUS_OUTTOLUNCH)
mir_tstrncpy(szStatus, pcli->pfnGetStatusModeDescription(iStatus, 0), iBufSize);
@@ -822,24 +822,24 @@ TCHAR* CTooltipNotify::StatusToString(int iStatus, TCHAR *szStatus, int iBufSize return szStatus;
}
-TCHAR* CTooltipNotify::MakeTooltipString(MCONTACT hContact, int iStatus, TCHAR *szString, int iBufSize)
+wchar_t* CTooltipNotify::MakeTooltipString(MCONTACT hContact, int iStatus, wchar_t *szString, int iBufSize)
{
- TCHAR szStatus[32];
+ wchar_t szStatus[32];
StatusToString(iStatus, szStatus, _countof(szStatus));
// "proro: user is online"
- const TCHAR *szFormatString = m_sOptions.bPrefixProto ? L"%s%s%s" : L"%.0s%.0s%s";
- const TCHAR* szIs = TranslateT("is");
+ const wchar_t *szFormatString = m_sOptions.bPrefixProto ? L"%s%s%s" : L"%.0s%.0s%s";
+ const wchar_t* szIs = TranslateT("is");
const char* szProto = hContact == 0 ? "Proto" : ::GetContactProto(hContact);
- const TCHAR* szContactName = ::pcli->pfnGetContactDisplayName(hContact, 0);
+ const wchar_t* szContactName = ::pcli->pfnGetContactDisplayName(hContact, 0);
- memset(szString, 0, iBufSize*sizeof(TCHAR));
+ memset(szString, 0, iBufSize*sizeof(wchar_t));
WCHAR wszProto[32];
long lLen = MultiByteToWideChar(CP_ACP, 0, szProto, (int)mir_strlen(szProto), wszProto, _countof(wszProto));
- wszProto[lLen] = _T('\0');
+ wszProto[lLen] = '\0';
mir_sntprintf(szString, iBufSize - 1, szFormatString, wszProto, L": ", szContactName);
diff --git a/plugins/TooltipNotify/src/TooltipNotify.h b/plugins/TooltipNotify/src/TooltipNotify.h index 50f507da31..793d1d6500 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.h +++ b/plugins/TooltipNotify/src/TooltipNotify.h @@ -87,8 +87,8 @@ private: MapTimerIdProtoIter FindProtoByTimer(UINT idTimer);
template<typename T> TooltipsListIter FindBy(T STooltipData::* m, const T& value);
- TCHAR *StatusToString(int iStatus, TCHAR *szStatus, int iBufSize);
- TCHAR *MakeTooltipString(MCONTACT hContact, int iStatus, TCHAR *szString, int iBufSize);
+ wchar_t *StatusToString(int iStatus, wchar_t *szStatus, int iBufSize);
+ wchar_t *MakeTooltipString(MCONTACT hContact, int iStatus, wchar_t *szString, int iBufSize);
void MigrateSettings();
void RegisterFonts();
void GetFont(int iStatus, LOGFONT* lf, COLORREF* text, COLORREF* bg);
diff --git a/plugins/TooltipNotify/src/Utils.cpp b/plugins/TooltipNotify/src/Utils.cpp index c0d4a25fc8..4d102f9822 100644 --- a/plugins/TooltipNotify/src/Utils.cpp +++ b/plugins/TooltipNotify/src/Utils.cpp @@ -11,14 +11,14 @@ BOOL IsNt50() return (bMajorVer>=5);
}
-void TruncateWithDots(TCHAR* szString, size_t iNewLen)
+void TruncateWithDots(wchar_t* szString, size_t iNewLen)
{
size_t iOrigLen = mir_tstrlen(szString);
if (iNewLen < iOrigLen) {
- TCHAR* p = szString+iNewLen;
- *p = _T('\0');
+ wchar_t* p = szString+iNewLen;
+ *p = '\0';
for(int i=0; --p>=szString && i<3; i++)
- *p = _T('.');
+ *p = '.';
}
}
diff --git a/plugins/TooltipNotify/src/Utils.h b/plugins/TooltipNotify/src/Utils.h index b0baf7c0da..36270e8311 100644 --- a/plugins/TooltipNotify/src/Utils.h +++ b/plugins/TooltipNotify/src/Utils.h @@ -3,4 +3,4 @@ //
BOOL IsNt50();
-void TruncateWithDots(TCHAR* szString, size_t iNewLen);
\ No newline at end of file +void TruncateWithDots(wchar_t* szString, size_t iNewLen);
diff --git a/plugins/TopToolBar/src/stdafx.h b/plugins/TopToolBar/src/stdafx.h index babf433470..57e4e39329 100644 --- a/plugins/TopToolBar/src/stdafx.h +++ b/plugins/TopToolBar/src/stdafx.h @@ -68,9 +68,9 @@ struct TopButtonInt : public MZeroedObject HANDLE hIconHandleUp, hIconHandleDn;
char *pszService;
- TCHAR *ptszProgram;
+ wchar_t *ptszProgram;
char *pszName;
- TCHAR *ptszTooltip;
+ wchar_t *ptszTooltip;
LPARAM lParamUp;
WPARAM wParamUp;
@@ -78,7 +78,7 @@ struct TopButtonInt : public MZeroedObject WPARAM wParamDown;
int hLangpack;
- TCHAR *ptszTooltipUp, *ptszTooltipDn;
+ wchar_t *ptszTooltipUp, *ptszTooltipDn;
};
///////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp index 56577b4703..73661085dd 100644 --- a/plugins/TopToolBar/src/toolbarwnd.cpp +++ b/plugins/TopToolBar/src/toolbarwnd.cpp @@ -5,7 +5,7 @@ COLORREF bkColour; HBITMAP hBmpBackground, hBmpSeparator;
int backgroundBmpUse;
-static TCHAR pluginname[] = L"TopToolBar";
+static wchar_t pluginname[] = L"TopToolBar";
/////////////////////////////////////////////////////////////////////////////////////////
// Toolbar window procedure
diff --git a/plugins/TopToolBar/src/topbutton.cpp b/plugins/TopToolBar/src/topbutton.cpp index 1fe3eb2488..4be939ba8b 100644 --- a/plugins/TopToolBar/src/topbutton.cpp +++ b/plugins/TopToolBar/src/topbutton.cpp @@ -159,7 +159,7 @@ void TopButtonInt::SetBitmap() if (GetWindowLongPtr(hwnd, GWL_STYLE) & SS_ICON)
SetWindowLongPtr(hwnd, GWL_STYLE, curstyle | SS_ICON);
- TCHAR *pTooltip;
+ wchar_t *pTooltip;
if (bPushed) {
SendMessage(hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)(hIconDn ? hIconDn : hIconUp));
SendMessage(hwnd, BM_SETCHECK, BST_CHECKED, 0);
diff --git a/plugins/TopToolBar/src/ttbopt.cpp b/plugins/TopToolBar/src/ttbopt.cpp index f048adfda3..b78101a566 100644 --- a/plugins/TopToolBar/src/ttbopt.cpp +++ b/plugins/TopToolBar/src/ttbopt.cpp @@ -18,7 +18,7 @@ static HTREEITEM AddLine(HWND hTree,TopButtonInt *b, HTREEITEM hItem, HIMAGELIST tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
int index;
- TCHAR* tmp;
+ wchar_t* tmp;
if (b->dwFlags & TTBBF_ISSEPARATOR) {
tvis.item.pszText = L"------------------";
@@ -239,7 +239,7 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR //----- Launch buttons -----
if (ctrlid == IDC_BROWSE) {
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
OPENFILENAME ofn = {0};
GetDlgItemText(hwndDlg, IDC_EPATH, str, _countof(str));
@@ -272,7 +272,7 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR TreeView_GetItem(hTree, &tvi);
TopButtonInt* btn = (TopButtonInt*)tvi.lParam;
- TCHAR buf [256];
+ wchar_t buf [256];
// probably, condition not needs
if (btn->dwFlags & TTBBF_ISLBUTTON) {
if (!(btn->dwFlags & TTBBF_OPTIONAL)) {
@@ -509,7 +509,7 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR TreeView_GetItem(hTree, &tvi);
if ( (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT)) || (hti.hItem==TVI_FIRST)) {
TVINSERTSTRUCT tvis;
- TCHAR name[128];
+ wchar_t name[128];
tvis.item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE;
tvis.item.stateMask = 0xFFFFFFFF;
tvis.item.pszText = name;
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index 3dea6dd19d..9619347bc3 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -34,7 +34,7 @@ CLIST_INTERFACE *pcli; int hLangpack = 0; // Ïîääåðæêà ïëàãèíîçàâèñèìîãî ïåðåâîäà.
BOOL bPopupExists = FALSE, bVariablesExists = FALSE, bTooltipExists = FALSE;
-static TCHAR tszFormat[] =
+static wchar_t tszFormat[] =
_T("{I4}\x0D\x0A\x0A\
{R65}?tc_GetTraffic(%extratext%,now,sent,d)\x0D\x0A\x0A\
{R115}?tc_GetTraffic(%extratext%,now,received,d)\x0D\x0A\x0A\
@@ -42,7 +42,7 @@ _T("{I4}\x0D\x0A\x0A\ {L180}?if3(?tc_GetTime(%extratext%,now,hh:mm:ss),)\x0D\x0A\x0A\
{L230}?if3(?tc_GetTime(%extratext%,total,d hh:mm),)");
-TCHAR* TRAFFIC_COUNTER_WINDOW_CLASS = L"TrafficCounterWnd";
+wchar_t* TRAFFIC_COUNTER_WINDOW_CLASS = L"TrafficCounterWnd";
/*-------------------------------------------------------------------------------------------------------------------*/
//TRAFFIC COUNTER
@@ -64,8 +64,8 @@ char Traffic_PopupTimeoutValue; unsigned short int Traffic_LineHeight;
//
-TCHAR Traffic_CounterFormat[512];
-TCHAR Traffic_TooltipFormat[512];
+wchar_t Traffic_CounterFormat[512];
+wchar_t Traffic_TooltipFormat[512];
//
HANDLE Traffic_FrameID = NULL;
@@ -245,8 +245,8 @@ int TrafficCounterModulesLoaded(WPARAM, LPARAM) //register traffic font
TrafficFontID.cbSize = sizeof(FontIDT);
- mir_tstrcpy(TrafficFontID.group, LPGENT("Traffic counter"));
- mir_tstrcpy(TrafficFontID.name, LPGENT("Font"));
+ mir_tstrcpy(TrafficFontID.group, LPGENW("Traffic counter"));
+ mir_tstrcpy(TrafficFontID.name, LPGENW("Font"));
mir_strcpy(TrafficFontID.dbSettingsGroup, TRAFFIC_SETTINGS_GROUP);
mir_strcpy(TrafficFontID.prefix, "Font");
TrafficFontID.flags = FIDF_DEFAULTVALID | FIDF_SAVEPOINTSIZE;
@@ -260,8 +260,8 @@ int TrafficCounterModulesLoaded(WPARAM, LPARAM) // Ðåãèñòðèðóåì öâåò ôîíà
TrafficBackgroundColorID.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(TrafficBackgroundColorID.group, LPGENT("Traffic counter"));
- mir_tstrcpy(TrafficBackgroundColorID.name, LPGENT("Font"));
+ mir_tstrcpy(TrafficBackgroundColorID.group, LPGENW("Traffic counter"));
+ mir_tstrcpy(TrafficBackgroundColorID.name, LPGENW("Font"));
mir_strcpy(TrafficBackgroundColorID.dbSettingsGroup, TRAFFIC_SETTINGS_GROUP);
mir_strcpy(TrafficBackgroundColorID.setting, "FontBkColor");
TrafficBackgroundColorID.defcolour = GetSysColor(COLOR_BTNFACE);
@@ -485,14 +485,14 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) // Ñëåäóþùèå ïîçèöèè ñòðîÿòñÿ îò ïðàâîãî êðàÿ.
// Îáùåå âðåìÿ.
if (unOptions.DrawTotalTimeCounter) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetDurationFormatM(ProtoList[i].Total.Timer, L"h:mm:ss", bu, 32);
TC_AlphaText(hdc, bu, &rect, DT_SINGLELINE | DT_RIGHT | DT_TOP, ClistModernPresent);
}
// Òåêóùåå âðåìÿ.
if (unOptions.DrawCurrentTimeCounter) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetDurationFormatM(ProtoList[i].Session.Timer, L"h:mm:ss", bu, 32);
rect.right -= 50;
@@ -501,7 +501,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) }
// Èçîáðàæàåì îáùèé òðàôèê.
if (unOptions.DrawTotalTraffic) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetFormattedTraffic(ProtoList[i].TotalSentTraffic + ProtoList[i].TotalRecvTraffic, 3, bu, 32);
rect.right -= 100;
@@ -513,7 +513,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) }
// Èçîáðàæàåì òåêóùèé òðàôèê.
if (unOptions.DrawCurrentTraffic) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetFormattedTraffic(ProtoList[i].CurrentRecvTraffic + ProtoList[i].CurrentSentTraffic, 3, bu, 32);
rect.right -= 150;
@@ -539,7 +539,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) // Âûâîäèì òåêñò
// Èçîáðàæàåì èìÿ
if (unOptions.DrawProtoName) {
- TCHAR *bu = mir_a2t("Summary");
+ wchar_t *bu = mir_a2t("Summary");
rect.left += dx;
TC_AlphaText(hdc, bu, &rect, DT_SINGLELINE | DT_LEFT | DT_TOP, ClistModernPresent);
@@ -548,14 +548,14 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) }
// Îáùåå âðåìÿ.
if (unOptions.DrawTotalTimeCounter) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetDurationFormatM(OverallInfo.Total.Timer, L"h:mm:ss", bu, 32);
TC_AlphaText(hdc, bu, &rect, DT_SINGLELINE | DT_RIGHT | DT_TOP, ClistModernPresent);
}
// Òåêóùåå âðåìÿ.
if (unOptions.DrawCurrentTimeCounter) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetDurationFormatM(OverallInfo.Session.Timer, L"h:mm:ss", bu, 32);
rect.right -= 50;
@@ -564,7 +564,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) }
// Èçîáðàæàåì îáùèé òðàôèê.
if (unOptions.DrawTotalTraffic) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetFormattedTraffic(SummaryTotal, 3, bu, 32);
rect.right -= 100;
@@ -573,7 +573,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) }
// Èçîáðàæàåì òåêóùèé òðàôèê.
if (unOptions.DrawCurrentTraffic) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetFormattedTraffic(SummarySession, 3, bu, 32);
rect.right -= 150;
@@ -594,7 +594,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) // Âûâîäèì òåêñò
// Èçîáðàæàåì èìÿ
if (unOptions.DrawProtoName) {
- TCHAR *bu = mir_a2t("Overall");
+ wchar_t *bu = mir_a2t("Overall");
rect.left += dx;
TC_AlphaText(hdc, bu, &rect, DT_SINGLELINE | DT_LEFT | DT_TOP, ClistModernPresent);
@@ -604,7 +604,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) // Ñëåäóþùèå ïîçèöèè ñòðîÿòñÿ îò ïðàâîãî êðàÿ.
// Èçîáðàæàåì îáùèé òðàôèê.
if (unOptions.DrawTotalTraffic) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetFormattedTraffic(OverallInfo.TotalSentTraffic + OverallInfo.TotalRecvTraffic, 3, bu, 32);
rect.right -= 100;
@@ -613,7 +613,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) }
// Èçîáðàæàåì òåêóùèé òðàôèê.
if (unOptions.DrawCurrentTraffic) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetFormattedTraffic(OverallInfo.CurrentRecvTraffic + OverallInfo.CurrentSentTraffic, 3, bu, 32);
rect.right -= 150;
@@ -630,13 +630,13 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) WORD ItemsNumber, RowsNumber;
// Ãîòîâèì ñïèñîê ñòðîê äëÿ Variables è èêîíîê.
- TCHAR **ExtraText = (TCHAR**)mir_alloc(sizeof(TCHAR*));
+ wchar_t **ExtraText = (wchar_t**)mir_alloc(sizeof(wchar_t*));
HICON *ahIcon = (HICON*)mir_alloc(sizeof(HICON));
RowsNumber = 0;
// Öèêë ïî àêêàóíòàì.
for (int i = 0; i < NumberOfAccounts; i++) {
if (ProtoList[i].Visible && ProtoList[i].Enabled) {
- ExtraText = (TCHAR**)mir_realloc(ExtraText, sizeof(TCHAR*) * (RowsNumber + 1));
+ ExtraText = (wchar_t**)mir_realloc(ExtraText, sizeof(wchar_t*) * (RowsNumber + 1));
ahIcon = (HICON*)mir_realloc(ahIcon, sizeof(HICON) * (RowsNumber + 1));
ExtraText[RowsNumber] = mir_a2t(ProtoList[i].name);
@@ -645,14 +645,14 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) }
// Åù¸ 2 îñîáûõ ýëåìåíòà.
if (unOptions.ShowSummary) {
- ExtraText = (TCHAR**)mir_realloc(ExtraText, sizeof(TCHAR*) * (RowsNumber + 1));
+ ExtraText = (wchar_t**)mir_realloc(ExtraText, sizeof(wchar_t*) * (RowsNumber + 1));
ahIcon = (HICON*)mir_realloc(ahIcon, sizeof(HICON) * (RowsNumber + 1));
ExtraText[RowsNumber] = mir_a2t("summary");
ahIcon[RowsNumber++] = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
}
if (unOptions.ShowOverall) {
- ExtraText = (TCHAR**)mir_realloc(ExtraText, sizeof(TCHAR*) * (RowsNumber + 1));
+ ExtraText = (wchar_t**)mir_realloc(ExtraText, sizeof(wchar_t*) * (RowsNumber + 1));
ahIcon = (HICON*)mir_realloc(ahIcon, sizeof(HICON) * (RowsNumber + 1));
ExtraText[RowsNumber] = mir_a2t("overall");
@@ -661,7 +661,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) // Ðèñóåì ñâîé ñ÷¸ò÷èê äëÿ êàæäîãî èç âûáðàííûõ ïðîòîêîëîâ
for (int i = 0; i < RowsNumber; i++) {
- TCHAR *buf = variables_parse(Traffic_CounterFormat, ExtraText[i], NULL);
+ wchar_t *buf = variables_parse(Traffic_CounterFormat, ExtraText[i], NULL);
if (ItemsNumber = GetRowItems(buf, &ItemsList)) {
// Ðèñóåì òåêñò.
for (int dx = 0; dx < ItemsNumber; dx++) {
@@ -943,7 +943,7 @@ LRESULT CALLBACK TrafficCounterWndProc_MW(HWND hwnd, UINT msg, WPARAM wParam, LP case TIMER_TOOLTIP:
{
- TCHAR *TooltipText;
+ wchar_t *TooltipText;
CLCINFOTIP ti = { 0 };
RECT rt;
@@ -1064,7 +1064,7 @@ void NotifyOnSend(void) memset(&ppd, 0, sizeof(ppd));
ppd.lchContact = NULL;
ppd.lchIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
- _tcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
mir_sntprintf(ppd.lptzText, TranslateT("%d kilobytes sent"), notify_send_size = OverallInfo.CurrentSentTraffic >> 10);
ppd.colorBack = Traffic_PopupBkColor;
ppd.colorText = Traffic_PopupFontColor;
@@ -1080,7 +1080,7 @@ void NotifyOnRecv(void) memset(&ppd, 0, sizeof(ppd));
ppd.lchContact = NULL;
ppd.lchIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
- _tcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
mir_sntprintf(ppd.lptzText, TranslateT("%d kilobytes received"), notify_recv_size = OverallInfo.CurrentRecvTraffic >> 10);
ppd.colorBack = Traffic_PopupBkColor;
ppd.colorText = Traffic_PopupFontColor;
diff --git a/plugins/TrafficCounter/src/misc.cpp b/plugins/TrafficCounter/src/misc.cpp index 5c23fd4541..398feaab96 100644 --- a/plugins/TrafficCounter/src/misc.cpp +++ b/plugins/TrafficCounter/src/misc.cpp @@ -25,13 +25,13 @@ InputString - ñòðîêà äëÿ ðàçáîðà; RowItemsList - ñïèñîê íàéäåííûõ ýëåìåíòîâ.
Âîçâðàùàåìîå çíà÷åíèå - êîëè÷åñòâî ýëåìåíòîâ â ñïèñêàõ. */
-WORD GetRowItems(TCHAR *InputString, RowItemInfo **RowItemsList)
+WORD GetRowItems(wchar_t *InputString, RowItemInfo **RowItemsList)
{
- TCHAR *begin, *end;
+ wchar_t *begin, *end;
WORD c = 0;
// Èùåì ñëåâà îòêðûâàþùóþ ñêîáêó.
- begin = _tcschr(InputString, '{');
+ begin = wcschr(InputString, '{');
// Åñëè ñêîáêà íàéäåíà...
if (begin) {
// Âûäåëÿåì ïàìÿòü ïîä óêàçàòåëè
@@ -41,31 +41,31 @@ WORD GetRowItems(TCHAR *InputString, RowItemInfo **RowItemsList) do {
// Ñðàçó âñëåä çà íåé èùåì çàêðûâàþùóþ.
- end = _tcschr(begin, '}');
+ end = wcschr(begin, '}');
// Âûäåëÿåì ïàìÿòü ïîä óêàçàòåëè
*RowItemsList = (RowItemInfo*)mir_realloc(*RowItemsList, sizeof(RowItemInfo) * (c + 1));
// Ðàçáèðàåì òåã.
- _stscanf(begin + 1, L"%c%hd",
+ swscanf(begin + 1, L"%c%hd",
&((*RowItemsList)[c].Alignment),
&((*RowItemsList)[c].Interval));
// Èùåì äàëåå îòêðûâàþùóþ ñêîáêó - ýòî êîíåö ñòðîêè, ñîîòâåòñòâóþùåé òåãó.
- begin = _tcschr(end, '{');
+ begin = wcschr(end, '{');
if (begin) {
// Âûäåëÿåì ïàìÿòü ïîä ñòðîêó.
- (*RowItemsList)[c].String = (TCHAR*)mir_alloc(sizeof(TCHAR) * (begin - end));
+ (*RowItemsList)[c].String = (wchar_t*)mir_alloc(sizeof(wchar_t) * (begin - end));
// Êîïèðóåì ñòðîêó.
- _tcsncpy((*RowItemsList)[c].String, end + 1, begin - end - 1);
+ wcsncpy((*RowItemsList)[c].String, end + 1, begin - end - 1);
(*RowItemsList)[c].String[begin - end - 1] = 0;
}
else {
// Âûäåëÿåì ïàìÿòü ïîä ñòðîêó.
- (*RowItemsList)[c].String = (TCHAR*)mir_alloc(sizeof(TCHAR) * mir_tstrlen(end));
+ (*RowItemsList)[c].String = (wchar_t*)mir_alloc(sizeof(wchar_t) * mir_tstrlen(end));
// Êîïèðóåì ñòðîêó.
- _tcsncpy((*RowItemsList)[c].String, end + 1, mir_tstrlen(end));
+ wcsncpy((*RowItemsList)[c].String, end + 1, mir_tstrlen(end));
}
c++;
@@ -118,12 +118,12 @@ Buffer - àäðåñ ñòðîêè äëÿ çàïèñè ðåçóëüòàòà; Size - ðàçìåð áóôåðà.
Âîçâðàùàåìîå çíà÷åíèå: òðåáóåìûé ðàçìåð áóôåðà.
*/
-size_t GetFormattedTraffic(DWORD Value, BYTE Unit, TCHAR *Buffer, size_t Size)
+size_t GetFormattedTraffic(DWORD Value, BYTE Unit, wchar_t *Buffer, size_t Size)
{
- TCHAR Str1[32], szUnit[4] = { ' ', 0 };
+ wchar_t Str1[32], szUnit[4] = { ' ', 0 };
DWORD Divider;
NUMBERFMT nf = { 0, 1, 3, L",", L" ", 0 };
- TCHAR *Res; // Ïðîìåæóòî÷íûé ðåçóëüòàò.
+ wchar_t *Res; // Ïðîìåæóòî÷íûé ðåçóëüòàò.
switch (Unit) {
case 0: //bytes
@@ -152,7 +152,7 @@ size_t GetFormattedTraffic(DWORD Value, BYTE Unit, TCHAR *Buffer, size_t Size) size_t l = GetNumberFormat(LOCALE_USER_DEFAULT, 0, Str1, &nf, NULL, 0);
if (!l) return 0;
l += mir_tstrlen(szUnit) + 1;
- Res = (TCHAR*)malloc(l * sizeof(TCHAR));
+ Res = (wchar_t*)malloc(l * sizeof(wchar_t));
if (!Res) return 0;
GetNumberFormat(LOCALE_USER_DEFAULT, 0, Str1, &nf, Res, (int)l);
mir_tstrcat(Res, szUnit);
@@ -174,26 +174,26 @@ Format: ñòðîêà ôîðìàòà; Buffer: àäðåñ áóôåðà, êóäà ôóíêöèÿ ïîìåùàåò ðåçóëüòàò.
Size - ðàçìåð áóôåðà. */
-size_t GetDurationFormatM(DWORD Duration, TCHAR *Format, TCHAR *Buffer, size_t Size)
+size_t GetDurationFormatM(DWORD Duration, wchar_t *Format, wchar_t *Buffer, size_t Size)
{
size_t Length;
DWORD q;
WORD TokenIndex, FormatIndex;
- TCHAR Token[256], // Àêêóìóëÿòîð.
+ wchar_t Token[256], // Àêêóìóëÿòîð.
*Res; // Ïðîìåæóòî÷íûé ðåçóëüòàò.
- Res = (TCHAR*)malloc(sizeof(TCHAR)); // Âûäåëÿåì ÷óòü-÷óòü ïàìÿòè ïîä ðåçóëüòàò, íî ýòî òîëüêî íà÷àëî.
- //SecureZeroMemory(Res, sizeof(TCHAR));
+ Res = (wchar_t*)malloc(sizeof(wchar_t)); // Âûäåëÿåì ÷óòü-÷óòü ïàìÿòè ïîä ðåçóëüòàò, íî ýòî òîëüêî íà÷àëî.
+ //SecureZeroMemory(Res, sizeof(wchar_t));
Res[0] = 0;
for (FormatIndex = 0; Format[FormatIndex];) {
// Èùåì òîêåíû. Ñ÷èòàåòñÿ, ÷òî òîêåí - òîëüêî áóêâû.
TokenIndex = 0;
- q = _istalpha(Format[FormatIndex]);
+ q = iswalpha(Format[FormatIndex]);
// Êîïèðóåì ñèìâîëû â àêêóìóëÿòîð äî ñìåíû ôëàãà.
do {
Token[TokenIndex++] = Format[FormatIndex++];
- } while (q == _istalpha(Format[FormatIndex]));
+ } while (q == iswalpha(Format[FormatIndex]));
Token[TokenIndex] = 0;
// ×òî ïîëó÷èëè â àêêóìóëÿòîðå?
@@ -235,12 +235,12 @@ size_t GetDurationFormatM(DWORD Duration, TCHAR *Format, TCHAR *Buffer, size_t S // Äîáàâèì ïàìÿòè, åñëè íóæíî.
Length = mir_tstrlen(Res) + mir_tstrlen(Token) + 1;
- Res = (TCHAR*)realloc(Res, Length * sizeof(TCHAR));
+ Res = (wchar_t*)realloc(Res, Length * sizeof(wchar_t));
mir_tstrcat(Res, Token);
}
if (Size && Buffer) {
- _tcsncpy(Buffer, Res, Size);
+ wcsncpy(Buffer, Res, Size);
Length = mir_tstrlen(Buffer);
}
else Length = mir_tstrlen(Res) + 1;
diff --git a/plugins/TrafficCounter/src/misc.h b/plugins/TrafficCounter/src/misc.h index 0f4b418bdc..d0d784e6cf 100644 --- a/plugins/TrafficCounter/src/misc.h +++ b/plugins/TrafficCounter/src/misc.h @@ -1,8 +1,8 @@ typedef struct
{
- TCHAR Alignment; // Âûðàâíèâàíèå. L - ê ëåâîé ãðàíèöå, R - ê ïðàâîé.
+ wchar_t Alignment; // Âûðàâíèâàíèå. L - ê ëåâîé ãðàíèöå, R - ê ïðàâîé.
WORD Interval; // Ðàññòîÿíèå, íà êîòîðîå ãðàíèöà ñòðîêè îòñòîèò îò ëåâîãî êðàÿ ôðåéìà.
- TCHAR *String; // Ñîáñòâåííî ñòðîêà.
+ wchar_t *String; // Ñîáñòâåííî ñòðîêà.
} RowItemInfo;
/* Ôóíêöèÿ ðàçáèðàåò ñòðîêó è âîçâðàùàåò ñïèñîê òåãîâ è ñîîòâåòñòâóþùèõ èì ñòðîê.
@@ -10,7 +10,7 @@ typedef struct InputString - ñòðîêà äëÿ ðàçáîðà;
RowItemsList - ñïèñîê íàéäåííûõ ýëåìåíòîâ.
Âîçâðàùàåìîå çíà÷åíèå - êîëè÷åñòâî ýëåìåíòîâ â ñïèñêàõ. */
-WORD GetRowItems(TCHAR *InputString, RowItemInfo **RowItemsList);
+WORD GetRowItems(wchar_t *InputString, RowItemInfo **RowItemsList);
/* Ôóíêöèÿ âîçâðàùàåò êîëè÷åñòâî äíåé â óêàçàííîì ìåñÿöå óêàçàííîãî ãîäà. */
BYTE DaysInMonth(BYTE Month, WORD Year);
@@ -25,8 +25,8 @@ BYTE DayOfWeek(BYTE Day, BYTE Month, WORD Year); Buffer - àäðåñ ñòðîêè äëÿ çàïèñè ðåçóëüòàòà;
Size - ðàçìåð áóôåðà.
Âîçâðàùàåìîå çíà÷åíèå: òðåáóåìûé ðàçìåð áóôåðà. */
-size_t GetFormattedTraffic(DWORD Value, BYTE Unit, TCHAR *Buffer, size_t Size);
+size_t GetFormattedTraffic(DWORD Value, BYTE Unit, wchar_t *Buffer, size_t Size);
-size_t GetDurationFormatM(DWORD Duration, TCHAR *Format, TCHAR *Buffer, size_t Size);
+size_t GetDurationFormatM(DWORD Duration, wchar_t *Format, wchar_t *Buffer, size_t Size);
signed short int TimeCompare(SYSTEMTIME st1, SYSTEMTIME st2);
\ No newline at end of file diff --git a/plugins/TrafficCounter/src/options.cpp b/plugins/TrafficCounter/src/options.cpp index 81fc55b629..02bfd9d5d5 100644 --- a/plugins/TrafficCounter/src/options.cpp +++ b/plugins/TrafficCounter/src/options.cpp @@ -126,15 +126,15 @@ static INT_PTR CALLBACK DlgProcPopupsTraffic(HWND hwndDlg, UINT msg, WPARAM wPar static OPTTREE_OPTION options[] =
{
- {0, LPGENT("Display") L"/" LPGENT("Icon"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawProtoIcon"},
- {0, LPGENT("Display") L"/" LPGENT("Account name"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawProtoName"},
- {0, LPGENT("Display") L"/" LPGENT("Current traffic"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawCurrentTraffic"},
- {0, LPGENT("Display") L"/" LPGENT("Total traffic"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawTotalTraffic"},
- {0, LPGENT("Display") L"/" LPGENT("Current online"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawCurrentTime"},
- {0, LPGENT("Display") L"/" LPGENT("Total online"),OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawTotalTime"},
- {0, LPGENT("General") L"/" LPGENT("Draw frame as skin element"), OPTTREE_CHECK, 1, NULL, "DrawFrmAsSkin"},
- {0, LPGENT("General") L"/" LPGENT("Show tooltip in traffic window"), OPTTREE_CHECK, 1, NULL, "ShowTooltip"},
- {0, LPGENT("General") L"/" LPGENT("\"Toggle traffic counter\" in main menu"), OPTTREE_CHECK, 1, NULL, "ShowMainMenuItem"},
+ {0, LPGENW("Display") L"/" LPGENW("Icon"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawProtoIcon"},
+ {0, LPGENW("Display") L"/" LPGENW("Account name"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawProtoName"},
+ {0, LPGENW("Display") L"/" LPGENW("Current traffic"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawCurrentTraffic"},
+ {0, LPGENW("Display") L"/" LPGENW("Total traffic"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawTotalTraffic"},
+ {0, LPGENW("Display") L"/" LPGENW("Current online"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawCurrentTime"},
+ {0, LPGENW("Display") L"/" LPGENW("Total online"),OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawTotalTime"},
+ {0, LPGENW("General") L"/" LPGENW("Draw frame as skin element"), OPTTREE_CHECK, 1, NULL, "DrawFrmAsSkin"},
+ {0, LPGENW("General") L"/" LPGENW("Show tooltip in traffic window"), OPTTREE_CHECK, 1, NULL, "ShowTooltip"},
+ {0, LPGENW("General") L"/" LPGENW("\"Toggle traffic counter\" in main menu"), OPTTREE_CHECK, 1, NULL, "ShowMainMenuItem"},
// Ðåçåðâèðóåì ìåñòî ïîä àêòèâíûå è âèäèìûå ïðîòîêîëû
// Ìàêñèìóì 16 ïîçèöèé âèäèìûõ è 16 àêòèâíûõ
{0, NULL, OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, NULL},
@@ -169,8 +169,8 @@ static OPTTREE_OPTION options[] = {0, NULL, OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, NULL},
{0, NULL, OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, NULL},
{0, NULL, OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, NULL},
- {0, LPGENT("Visible accounts")L"/" LPGENT("Summary traffic for visible accounts"), OPTTREE_CHECK, 1, NULL, "ShowSummary"},
- {0, LPGENT("Visible accounts")L"/" LPGENT("Overall traffic"), OPTTREE_CHECK, 1, NULL, "ShowOverall"},
+ {0, LPGENW("Visible accounts")L"/" LPGENW("Summary traffic for visible accounts"), OPTTREE_CHECK, 1, NULL, "ShowSummary"},
+ {0, LPGENW("Visible accounts")L"/" LPGENW("Overall traffic"), OPTTREE_CHECK, 1, NULL, "ShowOverall"},
};
static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -195,7 +195,7 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, options[i].szSettingName = (char*)mir_alloc(1 + mir_strlen(ProtoList[j].name));
mir_strcpy(options[i].szSettingName, ProtoList[j].name);
size_t l = 20 + mir_tstrlen(ProtoList[j].tszAccountName);
- options[i].szOptionName = (TCHAR*)mir_alloc(sizeof(TCHAR) * l);
+ options[i].szOptionName = (wchar_t*)mir_alloc(sizeof(wchar_t) * l);
mir_sntprintf(options[i].szOptionName, l, L"Visible accounts/%s", ProtoList[j].tszAccountName);
options[i].dwFlag = (ProtoList[j++].Enabled ? 1 : OPTTREE_INVISIBLE) | OPTTREE_NOTRANSLATE;
}
diff --git a/plugins/TrafficCounter/src/opttree.cpp b/plugins/TrafficCounter/src/opttree.cpp index 09447b2c85..337fca2806 100644 --- a/plugins/TrafficCounter/src/opttree.cpp +++ b/plugins/TrafficCounter/src/opttree.cpp @@ -23,12 +23,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHAR *name);
-HTREEITEM OptTree_AddItem(HWND hwndTree, TCHAR *name, LPARAM lParam, int iconIndex);
+HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const wchar_t *name);
+HTREEITEM OptTree_AddItem(HWND hwndTree, wchar_t *name, LPARAM lParam, int iconIndex);
static void OptTree_TranslateItem(HWND hwndTree, HTREEITEM hItem)
{
- TCHAR buf[128];
+ wchar_t buf[128];
TVITEM tvi = {0};
tvi.mask = TVIF_HANDLE|TVIF_TEXT;
@@ -72,10 +72,10 @@ void OptTree_Translate(HWND hwndTree) }
}
-HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHAR *name)
+HTREEITEM OptTree_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);
@@ -101,11 +101,11 @@ HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHA return NULL;
}
-HTREEITEM OptTree_AddItem(HWND hwndTree, TCHAR *name, LPARAM lParam, int iconIndex)
+HTREEITEM OptTree_AddItem(HWND hwndTree, wchar_t *name, LPARAM lParam, int iconIndex)
{
- TCHAR itemName[1024];
+ wchar_t itemName[1024];
- TCHAR* sectionName;
+ wchar_t* sectionName;
int sectionLevel = 0;
HTREEITEM hSection = NULL, result = NULL;
@@ -115,10 +115,10 @@ HTREEITEM OptTree_AddItem(HWND hwndTree, TCHAR *name, LPARAM lParam, int iconInd 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;
@@ -169,7 +169,7 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, BOOL*, case WM_INITDIALOG:
{
int indx;
- TCHAR itemName[1024];
+ wchar_t itemName[1024];
HIMAGELIST hImgLst;
TreeView_SelectItem(hwndTree, NULL);
@@ -188,7 +188,7 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, BOOL*, /* build options tree. based on code from IcoLib */
for (indx = 0; indx < optionCount; indx++)
{
- TCHAR* sectionName;
+ wchar_t* sectionName;
int sectionLevel = 0;
HTREEITEM hSection = NULL;
@@ -202,10 +202,10 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, BOOL*, 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;
diff --git a/plugins/TrafficCounter/src/opttree.h b/plugins/TrafficCounter/src/opttree.h index de3a8ddbbb..8c80b599eb 100644 --- a/plugins/TrafficCounter/src/opttree.h +++ b/plugins/TrafficCounter/src/opttree.h @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct {
int iconIndex;
- TCHAR *szOptionName;
+ wchar_t *szOptionName;
int groupId;
DWORD dwFlag;
HTREEITEM hItem;
diff --git a/plugins/TrafficCounter/src/statistics.cpp b/plugins/TrafficCounter/src/statistics.cpp index 709d7e3724..cb0f7e3f6d 100644 --- a/plugins/TrafficCounter/src/statistics.cpp +++ b/plugins/TrafficCounter/src/statistics.cpp @@ -174,7 +174,7 @@ INT_PTR CALLBACK DlgProcOptStatistics(HWND hwndDlg, UINT msg, WPARAM wParam, LPA SYSTEMTIME st = { 0 };
DWORD Index, Value;
double vartime;
- TCHAR szBufW[64];
+ wchar_t szBufW[64];
BYTE EldestAcc;
if (!(pdi->item.mask & LVIF_TEXT)) return 0;
@@ -229,7 +229,7 @@ INT_PTR CALLBACK DlgProcOptStatistics(HWND hwndDlg, UINT msg, WPARAM wParam, LPA break;
case 4: // Âðåìÿ
{
- TCHAR *Fmt[5] = { L"m:ss", L"h:mm:ss", L"h:mm:ss", L"d hh:mm:ss", L"d hh:mm:ss" };
+ wchar_t *Fmt[5] = { L"m:ss", L"h:mm:ss", L"h:mm:ss", L"d hh:mm:ss", L"d hh:mm:ss" };
GetDurationFormatM(Value, Fmt[unOptions.Stat_Tab], pdi->item.pszText, 32);
}
break;
@@ -297,7 +297,7 @@ void Stat_ReadFile(BYTE n) {
LARGE_INTEGER Size;
DWORD BytesRead;
- TCHAR FileName[MAX_PATH], *pszPath;
+ wchar_t FileName[MAX_PATH], *pszPath;
SYSTEMTIME stNow;
pszPath = Utils_ReplaceVarsT(L"%miranda_userdata%\\statistics");
@@ -350,7 +350,7 @@ void Stat_Show(HWND hwndDialog) void Stat_UpdateTotalTraffic(HWND hwndDialog, DWORD Incoming, DWORD Outgoing)
{
- TCHAR tmp[32];
+ wchar_t tmp[32];
GetFormattedTraffic(Incoming, unOptions.Stat_Units, tmp, 32);
SetDlgItemText(hwndDialog, IDC_STATIC_DNL, tmp);
diff --git a/plugins/TrafficCounter/src/stdafx.h b/plugins/TrafficCounter/src/stdafx.h index abeb7badd6..2868dc3b87 100644 --- a/plugins/TrafficCounter/src/stdafx.h +++ b/plugins/TrafficCounter/src/stdafx.h @@ -107,7 +107,7 @@ typedef struct // äàòà êîòîðîé ñîîòâåòñòâóåò íà÷àëó ñòàòèñòèêè äàííîãî àêêàóíòà.
// 0.1.1.6
- TCHAR *tszAccountName; // ×åëîâå÷åñêîå èìÿ àêêàóíòà äëÿ èñïîëüçîâàíèÿ â ãðàôè÷åñêîì èíòåðôåéñå.
+ wchar_t *tszAccountName; // ×åëîâå÷åñêîå èìÿ àêêàóíòà äëÿ èñïîëüçîâàíèÿ â ãðàôè÷åñêîì èíòåðôåéñå.
} PROTOLIST;
//---------------------------------------------------------------------------------------------
@@ -155,8 +155,8 @@ extern char Traffic_PopupTimeoutDefault; extern char Traffic_PopupTimeoutValue;
extern char Traffic_AdditionSpace;
-extern TCHAR Traffic_CounterFormat[512];
-extern TCHAR Traffic_TooltipFormat[512];
+extern wchar_t Traffic_CounterFormat[512];
+extern wchar_t Traffic_TooltipFormat[512];
extern BOOL bPopupExists, bVariablesExists, bTooltipExists;
diff --git a/plugins/TrafficCounter/src/vars.cpp b/plugins/TrafficCounter/src/vars.cpp index 62da3f32f7..64a71c71b5 100644 --- a/plugins/TrafficCounter/src/vars.cpp +++ b/plugins/TrafficCounter/src/vars.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-static TCHAR* GetTraffic(ARGUMENTSINFO *ai)
+static wchar_t* GetTraffic(ARGUMENTSINFO *ai)
{
DWORD tmp, tmpsn = 0, tmprn = 0, tmpst = 0, tmprt = 0;
BYTE ed;
@@ -54,7 +54,7 @@ static TCHAR* GetTraffic(ARGUMENTSINFO *ai) for (tmp = ed = 0; ed < NumberOfAccounts; ed++)
{
if (!ProtoList[ed].name) continue;
- TCHAR *buf = mir_a2t(ProtoList[ed].name);
+ wchar_t *buf = mir_a2t(ProtoList[ed].name);
if (!mir_tstrcmp(buf, ai->targv[1]))
{
tmpsn = ProtoList[ed].CurrentSentTraffic;
@@ -101,7 +101,7 @@ static TCHAR* GetTraffic(ARGUMENTSINFO *ai) // Ïîëó÷àåì ôîðìàòèðîâàííóþ ñòðîêó è âîçâðàùàåì óêàçàòåëü íà íå¸.
// Ñíà÷àëà óçíàåì ðàçìåð áóôåðà.
size_t l = GetFormattedTraffic(tmp, ed, NULL, 0);
- TCHAR *res = (TCHAR*)mir_alloc(l * sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc(l * sizeof(wchar_t));
if (!res) return NULL;
if (GetFormattedTraffic(tmp, ed, res, l))
return res;
@@ -110,7 +110,7 @@ static TCHAR* GetTraffic(ARGUMENTSINFO *ai) return NULL;
}
-static TCHAR* GetTime(ARGUMENTSINFO *ai)
+static wchar_t* GetTime(ARGUMENTSINFO *ai)
{
BYTE ed, flag;
DWORD Duration;
@@ -120,7 +120,7 @@ static TCHAR* GetTime(ARGUMENTSINFO *ai) // Èùåì èíäåêñ ïðîòîêîëà, ïåðåäàííîãî ïåðâûì àðãóìåíòîì
for (flag = ed = 0; ed < NumberOfAccounts; ed++)
{
- TCHAR *buf;
+ wchar_t *buf;
if (!ProtoList[ed].name) continue;
buf = mir_a2t(ProtoList[ed].name);
if (!mir_tstrcmp(buf, ai->targv[1]))
@@ -150,7 +150,7 @@ static TCHAR* GetTime(ARGUMENTSINFO *ai) // Ïîëó÷àåì ôîðìàòèðîâàííóþ ñòðîêó è âîçâðàùàåì óêàçàòåëü íà íå¸.
// Ñíà÷àëà óçíàåì ðàçìåð áóôåðà.
size_t l = GetDurationFormatM(Duration, ai->targv[3], NULL, 0);
- TCHAR *res = (TCHAR*)mir_alloc(l * sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc(l * sizeof(wchar_t));
if (!res) return NULL;
GetDurationFormatM(Duration, ai->targv[3], res, l);
diff --git a/plugins/TranslitSwitcher/src/Layoutproc.cpp b/plugins/TranslitSwitcher/src/Layoutproc.cpp index 74132b55d3..e0c08bb045 100644 --- a/plugins/TranslitSwitcher/src/Layoutproc.cpp +++ b/plugins/TranslitSwitcher/src/Layoutproc.cpp @@ -39,18 +39,18 @@ bool isItSmiley(unsigned int position) static DWORD CALLBACK StreamOutCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
- TCHAR **ppText = (TCHAR**)dwCookie;
- *ppText = mir_tstrndup((TCHAR*)pbBuff, cb / sizeof(TCHAR));
+ wchar_t **ppText = (wchar_t**)dwCookie;
+ *ppText = mir_tstrndup((wchar_t*)pbBuff, cb / sizeof(wchar_t));
*pcb = cb;
return 0;
}
-TCHAR* Message_GetFromStream(HWND hwndRtf, DWORD dwPassedFlags)
+wchar_t* Message_GetFromStream(HWND hwndRtf, DWORD dwPassedFlags)
{
if (hwndRtf == 0)
return NULL;
- TCHAR *pszText = NULL;
+ wchar_t *pszText = NULL;
EDITSTREAM stream = { 0 };
stream.pfnCallback = StreamOutCallback;
stream.dwCookie = (DWORD_PTR)&pszText;
@@ -58,88 +58,88 @@ TCHAR* Message_GetFromStream(HWND hwndRtf, DWORD dwPassedFlags) return pszText;
}
-void Transliterate(TCHAR *&str)
+void Transliterate(wchar_t *&str)
{
- TCHAR *newStr = (TCHAR*)mir_alloc(sizeof(TCHAR) * mir_tstrlen(str) * 3 + 1);
+ wchar_t *newStr = (wchar_t*)mir_alloc(sizeof(wchar_t) * mir_tstrlen(str) * 3 + 1);
newStr[0] = 0;
for (; *str != 0; str++) {
switch (str[0]) {
- case _T('à'): mir_tstrcat(newStr, L"a"); break;
- case _T('á'): mir_tstrcat(newStr, L"b"); break;
- case _T('â'): mir_tstrcat(newStr, L"v"); break;
- case _T('ã'): mir_tstrcat(newStr, L"g"); break;
- case _T('ä'): mir_tstrcat(newStr, L"d"); break;
- case _T('å'): mir_tstrcat(newStr, L"e"); break;
- case _T('¸'): mir_tstrcat(newStr, L"ye"); break;
- case _T('æ'): mir_tstrcat(newStr, L"zh"); break;
- case _T('ç'): mir_tstrcat(newStr, L"z"); break;
- case _T('è'): mir_tstrcat(newStr, L"i"); break;
- case _T('é'): mir_tstrcat(newStr, L"y"); break;
- case _T('ê'): mir_tstrcat(newStr, L"k"); break;
- case _T('ë'): mir_tstrcat(newStr, L"l"); break;
- case _T('ì'): mir_tstrcat(newStr, L"m"); break;
- case _T('í'): mir_tstrcat(newStr, L"n"); break;
- case _T('î'): mir_tstrcat(newStr, L"o"); break;
- case _T('ï'): mir_tstrcat(newStr, L"p"); break;
- case _T('ð'): mir_tstrcat(newStr, L"r"); break;
- case _T('ñ'): mir_tstrcat(newStr, L"s"); break;
- case _T('ò'): mir_tstrcat(newStr, L"t"); break;
- case _T('ó'): mir_tstrcat(newStr, L"u"); break;
- case _T('ô'): mir_tstrcat(newStr, L"f"); break;
- case _T('õ'): mir_tstrcat(newStr, L"kh"); break;
- case _T('ö'): mir_tstrcat(newStr, L"ts"); break;
- case _T('÷'): mir_tstrcat(newStr, L"ch"); break;
- case _T('ø'): mir_tstrcat(newStr, L"sh"); break;
- case _T('ù'): mir_tstrcat(newStr, L"sch"); break;
- case _T('ú'): mir_tstrcat(newStr, L"'"); break;
- case _T('û'): mir_tstrcat(newStr, L"yi"); break;
- case _T('ü'): mir_tstrcat(newStr, L""); break;
- case _T('ý'): mir_tstrcat(newStr, L"e"); break;
- case _T('þ'): mir_tstrcat(newStr, L"yu"); break;
- case _T('ÿ'): mir_tstrcat(newStr, L"ya"); break;
- case _T('À'): mir_tstrcat(newStr, L"A"); break;
- case _T('Á'): mir_tstrcat(newStr, L"B"); break;
- case _T('Â'): mir_tstrcat(newStr, L"V"); break;
- case _T('Ã'): mir_tstrcat(newStr, L"G"); break;
- case _T('Ä'): mir_tstrcat(newStr, L"D"); break;
- case _T('Å'): mir_tstrcat(newStr, L"E"); break;
- case _T('¨'): mir_tstrcat(newStr, L"Ye"); break;
- case _T('Æ'): mir_tstrcat(newStr, L"Zh"); break;
- case _T('Ç'): mir_tstrcat(newStr, L"Z"); break;
- case _T('È'): mir_tstrcat(newStr, L"I"); break;
- case _T('É'): mir_tstrcat(newStr, L"Y"); break;
- case _T('Ê'): mir_tstrcat(newStr, L"K"); break;
- case _T('Ë'): mir_tstrcat(newStr, L"L"); break;
- case _T('Ì'): mir_tstrcat(newStr, L"M"); break;
- case _T('Í'): mir_tstrcat(newStr, L"N"); break;
- case _T('Î'): mir_tstrcat(newStr, L"O"); break;
- case _T('Ï'): mir_tstrcat(newStr, L"P"); break;
- case _T('Ð'): mir_tstrcat(newStr, L"R"); break;
- case _T('Ñ'): mir_tstrcat(newStr, L"S"); break;
- case _T('Ò'): mir_tstrcat(newStr, L"T"); break;
- case _T('Ó'): mir_tstrcat(newStr, L"U"); break;
- case _T('Ô'): mir_tstrcat(newStr, L"F"); break;
- case _T('Õ'): mir_tstrcat(newStr, L"Kh"); break;
- case _T('Ö'): mir_tstrcat(newStr, L"Ts"); break;
- case _T('×'): mir_tstrcat(newStr, L"Ch"); break;
- case _T('Ø'): mir_tstrcat(newStr, L"Sh"); break;
- case _T('Ù'): mir_tstrcat(newStr, L"Sch"); break;
- case _T('Ú'): mir_tstrcat(newStr, L"'"); break;
- case _T('Û'): mir_tstrcat(newStr, L"Yi"); break;
- case _T('Ü'): mir_tstrcat(newStr, L""); break;
- case _T('Ý'): mir_tstrcat(newStr, L"E"); break;
- case _T('Þ'): mir_tstrcat(newStr, L"Yu"); break;
- case _T('ß'): mir_tstrcat(newStr, L"Ya"); break;
-
- case _T('a'): mir_tstrcat(newStr, L"à"); break;
- case _T('b'): mir_tstrcat(newStr, L"á"); break;
- case _T('v'): mir_tstrcat(newStr, L"â"); break;
- case _T('g'): mir_tstrcat(newStr, L"ã"); break;
- case _T('d'): mir_tstrcat(newStr, L"ä"); break;
- case _T('e'): mir_tstrcat(newStr, L"å"); break;
- case _T('z'):
+ case 'à': mir_tstrcat(newStr, L"a"); break;
+ case 'á': mir_tstrcat(newStr, L"b"); break;
+ case 'â': mir_tstrcat(newStr, L"v"); break;
+ case 'ã': mir_tstrcat(newStr, L"g"); break;
+ case 'ä': mir_tstrcat(newStr, L"d"); break;
+ case 'å': mir_tstrcat(newStr, L"e"); break;
+ case '¸': mir_tstrcat(newStr, L"ye"); break;
+ case 'æ': mir_tstrcat(newStr, L"zh"); break;
+ case 'ç': mir_tstrcat(newStr, L"z"); break;
+ case 'è': mir_tstrcat(newStr, L"i"); break;
+ case 'é': mir_tstrcat(newStr, L"y"); break;
+ case 'ê': mir_tstrcat(newStr, L"k"); break;
+ case 'ë': mir_tstrcat(newStr, L"l"); break;
+ case 'ì': mir_tstrcat(newStr, L"m"); break;
+ case 'í': mir_tstrcat(newStr, L"n"); break;
+ case 'î': mir_tstrcat(newStr, L"o"); break;
+ case 'ï': mir_tstrcat(newStr, L"p"); break;
+ case 'ð': mir_tstrcat(newStr, L"r"); break;
+ case 'ñ': mir_tstrcat(newStr, L"s"); break;
+ case 'ò': mir_tstrcat(newStr, L"t"); break;
+ case 'ó': mir_tstrcat(newStr, L"u"); break;
+ case 'ô': mir_tstrcat(newStr, L"f"); break;
+ case 'õ': mir_tstrcat(newStr, L"kh"); break;
+ case 'ö': mir_tstrcat(newStr, L"ts"); break;
+ case '÷': mir_tstrcat(newStr, L"ch"); break;
+ case 'ø': mir_tstrcat(newStr, L"sh"); break;
+ case 'ù': mir_tstrcat(newStr, L"sch"); break;
+ case 'ú': mir_tstrcat(newStr, L"'"); break;
+ case 'û': mir_tstrcat(newStr, L"yi"); break;
+ case 'ü': mir_tstrcat(newStr, L""); break;
+ case 'ý': mir_tstrcat(newStr, L"e"); break;
+ case 'þ': mir_tstrcat(newStr, L"yu"); break;
+ case 'ÿ': mir_tstrcat(newStr, L"ya"); break;
+ case 'À': mir_tstrcat(newStr, L"A"); break;
+ case 'Á': mir_tstrcat(newStr, L"B"); break;
+ case 'Â': mir_tstrcat(newStr, L"V"); break;
+ case 'Ã': mir_tstrcat(newStr, L"G"); break;
+ case 'Ä': mir_tstrcat(newStr, L"D"); break;
+ case 'Å': mir_tstrcat(newStr, L"E"); break;
+ case '¨': mir_tstrcat(newStr, L"Ye"); break;
+ case 'Æ': mir_tstrcat(newStr, L"Zh"); break;
+ case 'Ç': mir_tstrcat(newStr, L"Z"); break;
+ case 'È': mir_tstrcat(newStr, L"I"); break;
+ case 'É': mir_tstrcat(newStr, L"Y"); break;
+ case 'Ê': mir_tstrcat(newStr, L"K"); break;
+ case 'Ë': mir_tstrcat(newStr, L"L"); break;
+ case 'Ì': mir_tstrcat(newStr, L"M"); break;
+ case 'Í': mir_tstrcat(newStr, L"N"); break;
+ case 'Î': mir_tstrcat(newStr, L"O"); break;
+ case 'Ï': mir_tstrcat(newStr, L"P"); break;
+ case 'Ð': mir_tstrcat(newStr, L"R"); break;
+ case 'Ñ': mir_tstrcat(newStr, L"S"); break;
+ case 'Ò': mir_tstrcat(newStr, L"T"); break;
+ case 'Ó': mir_tstrcat(newStr, L"U"); break;
+ case 'Ô': mir_tstrcat(newStr, L"F"); break;
+ case 'Õ': mir_tstrcat(newStr, L"Kh"); break;
+ case 'Ö': mir_tstrcat(newStr, L"Ts"); break;
+ case '×': mir_tstrcat(newStr, L"Ch"); break;
+ case 'Ø': mir_tstrcat(newStr, L"Sh"); break;
+ case 'Ù': mir_tstrcat(newStr, L"Sch"); break;
+ case 'Ú': mir_tstrcat(newStr, L"'"); break;
+ case 'Û': mir_tstrcat(newStr, L"Yi"); break;
+ case 'Ü': mir_tstrcat(newStr, L""); break;
+ case 'Ý': mir_tstrcat(newStr, L"E"); break;
+ case 'Þ': mir_tstrcat(newStr, L"Yu"); break;
+ case 'ß': mir_tstrcat(newStr, L"Ya"); break;
+
+ case 'a': mir_tstrcat(newStr, L"à"); break;
+ case 'b': mir_tstrcat(newStr, L"á"); break;
+ case 'v': mir_tstrcat(newStr, L"â"); break;
+ case 'g': mir_tstrcat(newStr, L"ã"); break;
+ case 'd': mir_tstrcat(newStr, L"ä"); break;
+ case 'e': mir_tstrcat(newStr, L"å"); break;
+ case 'z':
{
- if (str[1] == _T('h')) {
+ if (str[1] == 'h') {
mir_tstrcat(newStr, L"æ");
str++;
break;
@@ -149,25 +149,25 @@ void Transliterate(TCHAR *&str) break;
}
}
- case _T('i'): mir_tstrcat(newStr, L"è"); break;
- case _T('y'):
+ case 'i': mir_tstrcat(newStr, L"è"); break;
+ case 'y':
{
- if (str[1] == _T('a')) {
+ if (str[1] == 'a') {
mir_tstrcat(newStr, L"ÿ");
str++;
break;
}
- else if (str[1] == _T('e')) {
+ else if (str[1] == 'e') {
mir_tstrcat(newStr, L"¸");
str++;
break;
}
- else if (str[1] == _T('u')) {
+ else if (str[1] == 'u') {
mir_tstrcat(newStr, L"þ");
str++;
break;
}
- else if (str[1] == _T('i')) {
+ else if (str[1] == 'i') {
mir_tstrcat(newStr, L"û");
str++;
break;
@@ -177,9 +177,9 @@ void Transliterate(TCHAR *&str) break;
}
}
- case _T('k'):
+ case 'k':
{
- if (str[1] == _T('h')) {
+ if (str[1] == 'h') {
mir_tstrcat(newStr, L"õ");
str++;
break;
@@ -189,20 +189,20 @@ void Transliterate(TCHAR *&str) break;
}
}
- case _T('l'): mir_tstrcat(newStr, L"ë"); break;
- case _T('m'): mir_tstrcat(newStr, L"ì"); break;
- case _T('n'): mir_tstrcat(newStr, L"í"); break;
- case _T('o'): mir_tstrcat(newStr, L"î"); break;
- case _T('p'): mir_tstrcat(newStr, L"ï"); break;
- case _T('r'): mir_tstrcat(newStr, L"ð"); break;
- case _T('s'):
+ case 'l': mir_tstrcat(newStr, L"ë"); break;
+ case 'm': mir_tstrcat(newStr, L"ì"); break;
+ case 'n': mir_tstrcat(newStr, L"í"); break;
+ case 'o': mir_tstrcat(newStr, L"î"); break;
+ case 'p': mir_tstrcat(newStr, L"ï"); break;
+ case 'r': mir_tstrcat(newStr, L"ð"); break;
+ case 's':
{
- if (str[1] == _T('h')) {
+ if (str[1] == 'h') {
mir_tstrcat(newStr, L"ø");
str++;
break;
}
- else if (str[1] == _T('c') && str[2] == _T('h')) {
+ else if (str[1] == 'c' && str[2] == 'h') {
mir_tstrcat(newStr, L"ù");
str += 2;
break;
@@ -212,9 +212,9 @@ void Transliterate(TCHAR *&str) break;
}
}
- case _T('t'):
+ case 't':
{
- if (str[1] == _T('s')) {
+ if (str[1] == 's') {
mir_tstrcat(newStr, L"ö");
str++;
break;
@@ -224,40 +224,40 @@ void Transliterate(TCHAR *&str) break;
}
}
- case _T('u'): mir_tstrcat(newStr, L"ó"); break;
- case _T('f'): mir_tstrcat(newStr, L"ô"); break;
- case _T('c'):
+ case 'u': mir_tstrcat(newStr, L"ó"); break;
+ case 'f': mir_tstrcat(newStr, L"ô"); break;
+ case 'c':
{
- if (str[1] == _T('h')) {
+ if (str[1] == 'h') {
mir_tstrcat(newStr, L"÷");
str++;
break;
}
}
- case _T('A'): mir_tstrcat(newStr, L"À"); break;
- case _T('B'): mir_tstrcat(newStr, L"Á"); break;
- case _T('V'): mir_tstrcat(newStr, L"Â"); break;
- case _T('G'): mir_tstrcat(newStr, L"Ã"); break;
- case _T('D'): mir_tstrcat(newStr, L"Ä"); break;
- case _T('E'): mir_tstrcat(newStr, L"Å"); break;
- case _T('Y'):
+ case 'A': mir_tstrcat(newStr, L"À"); break;
+ case 'B': mir_tstrcat(newStr, L"Á"); break;
+ case 'V': mir_tstrcat(newStr, L"Â"); break;
+ case 'G': mir_tstrcat(newStr, L"Ã"); break;
+ case 'D': mir_tstrcat(newStr, L"Ä"); break;
+ case 'E': mir_tstrcat(newStr, L"Å"); break;
+ case 'Y':
{
- if (str[1] == _T('a')) {
+ if (str[1] == 'a') {
mir_tstrcat(newStr, L"ß");
str++;
break;
}
- else if (str[1] == _T('e')) {
+ else if (str[1] == 'e') {
mir_tstrcat(newStr, L"¨");
str++;
break;
}
- else if (str[1] == _T('u')) {
+ else if (str[1] == 'u') {
mir_tstrcat(newStr, L"Þ");
str++;
break;
}
- else if (str[1] == _T('i')) {
+ else if (str[1] == 'i') {
mir_tstrcat(newStr, L"Û");
str++;
break;
@@ -267,9 +267,9 @@ void Transliterate(TCHAR *&str) break;
}
}
- case _T('Z'):
+ case 'Z':
{
- if (str[1] == _T('h')) {
+ if (str[1] == 'h') {
mir_tstrcat(newStr, L"Æ");
str++;
break;
@@ -279,10 +279,10 @@ void Transliterate(TCHAR *&str) break;
}
}
- case _T('I'): mir_tstrcat(newStr, L"È"); break;
- case _T('K'):
+ case 'I': mir_tstrcat(newStr, L"È"); break;
+ case 'K':
{
- if (str[1] == _T('h')) {
+ if (str[1] == 'h') {
mir_tstrcat(newStr, L"Õ");
str++;
break;
@@ -292,20 +292,20 @@ void Transliterate(TCHAR *&str) break;
}
}
- case _T('L'): mir_tstrcat(newStr, L"Ë"); break;
- case _T('M'): mir_tstrcat(newStr, L"Ì"); break;
- case _T('N'): mir_tstrcat(newStr, L"Í"); break;
- case _T('O'): mir_tstrcat(newStr, L"Î"); break;
- case _T('P'): mir_tstrcat(newStr, L"Ï"); break;
- case _T('R'): mir_tstrcat(newStr, L"Ð"); break;
- case _T('S'):
+ case 'L': mir_tstrcat(newStr, L"Ë"); break;
+ case 'M': mir_tstrcat(newStr, L"Ì"); break;
+ case 'N': mir_tstrcat(newStr, L"Í"); break;
+ case 'O': mir_tstrcat(newStr, L"Î"); break;
+ case 'P': mir_tstrcat(newStr, L"Ï"); break;
+ case 'R': mir_tstrcat(newStr, L"Ð"); break;
+ case 'S':
{
- if (str[1] == _T('h')) {
+ if (str[1] == 'h') {
mir_tstrcat(newStr, L"Ø");
str++;
break;
}
- else if (str[1] == _T('c') && str[2] == _T('h')) {
+ else if (str[1] == 'c' && str[2] == 'h') {
mir_tstrcat(newStr, L"Ù");
str += 2;
break;
@@ -315,9 +315,9 @@ void Transliterate(TCHAR *&str) break;
}
}
- case _T('T'):
+ case 'T':
{
- if (str[1] == _T('s')) {
+ if (str[1] == 's') {
mir_tstrcat(newStr, L"Ö");
str++;
break;
@@ -327,35 +327,35 @@ void Transliterate(TCHAR *&str) break;
}
}
- case _T('U'): mir_tstrcat(newStr, L"Ó"); break;
- case _T('F'): mir_tstrcat(newStr, L"Ô"); break;
- case _T('C'):
+ case 'U': mir_tstrcat(newStr, L"Ó"); break;
+ case 'F': mir_tstrcat(newStr, L"Ô"); break;
+ case 'C':
{
- if (str[1] == _T('h')) {
+ if (str[1] == 'h') {
mir_tstrcat(newStr, L"×");
str++;
break;
}
}
- case _T('\''): mir_tstrcat(newStr, L"ú"); break;
+ case '\'': mir_tstrcat(newStr, L"ú"); break;
- default: { TCHAR Temp[2] = { str[0], 0 }; mir_tstrcat(newStr, &Temp[0]); }
+ default: { wchar_t Temp[2] = { str[0], 0 }; mir_tstrcat(newStr, &Temp[0]); }
}
}
size_t len = mir_tstrlen(newStr);
- str = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ str = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
str[0] = 0;
mir_tstrcpy(str, newStr);
mir_free(newStr);
}
-void Invert(TCHAR *str)
+void Invert(wchar_t *str)
{
while (*str) {
if (IsCharUpper(*str))
- *str = (TCHAR)CharLower((LPTSTR)*str);
+ *str = (wchar_t)CharLower((LPTSTR)*str);
else if (IsCharLower(*str))
- *str = (TCHAR)CharUpper((LPTSTR)*str);
+ *str = (wchar_t)CharUpper((LPTSTR)*str);
str++;
}
keybd_event(VK_CAPITAL, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
@@ -374,10 +374,10 @@ void SwitchLayout(bool lastword) if (hwnd2 == NULL)
return;
- TCHAR szClassName[MAX_PATH];
+ wchar_t szClassName[MAX_PATH];
GetClassName(hwnd2, szClassName, _countof(szClassName));
if ((mir_tstrcmp(szClassName, L"THppRichEdit.UnicodeClass") == 0 || mir_tstrcmp(szClassName, L"THistoryGrid.UnicodeClass") == 0 || mir_tstrcmp(szClassName, L"TExtHistoryGrid.UnicodeClass") == 0 || mir_tstrcmp(szClassName, L"Internet Explorer_Server") == 0) && ServiceExists(MS_POPUP_SHOWMESSAGE)) { // make popup here
- TCHAR buf[2048];
+ wchar_t buf[2048];
if (mir_tstrcmp(szClassName, L"Internet Explorer_Server") == 0) {
IEVIEWEVENT event;
HWND hwnd3 = GetParent(GetParent(hwnd2));
@@ -387,7 +387,7 @@ void SwitchLayout(bool lastword) event.dwFlags = 0;
event.iType = IEE_GET_SELECTION;
event.hwnd = hwnd3;
- TCHAR *selected = (TCHAR *)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event);
+ wchar_t *selected = (wchar_t *)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event);
mir_tstrncpy(buf, selected, _countof(buf));
}
else GetWindowText(hwnd2, buf, _countof(buf)); // gimme, gimme, gimme...
@@ -418,7 +418,7 @@ void SwitchLayout(bool lastword) keys[VK_MENU] = (HIBYTE(vks) & 4) ? 0xFF : 0x00; // alt
if (!isItSmiley(DWORD(i))) {
- TCHAR tchr;
+ wchar_t tchr;
if (ToUnicodeEx(LOBYTE(vks), 0, keys, &tchr, 1, 0, GetKeyboardLayout(dwThreadID)) == 1)
buf[i] = tchr;
}
@@ -446,7 +446,7 @@ void SwitchLayout(bool lastword) if (somethingIsSelected)
dwFlags += SFF_SELECTION;
- TCHAR *sel = Message_GetFromStream(hwnd2, dwFlags);
+ wchar_t *sel = Message_GetFromStream(hwnd2, dwFlags);
size_t slen = mir_tstrlen(sel);
if (slen != 0) {
if (ServiceExists(MS_SMILEYADD_BATCHPARSE)) {
@@ -461,13 +461,13 @@ void SwitchLayout(bool lastword) if (lastword && !somethingIsSelected) {
end = (size_t)dwStart;
while (end < slen) {
- if (_istspace(sel[end]) || isItSmiley((int)end))
+ if (iswspace(sel[end]) || isItSmiley((int)end))
break;
end++;
}
start = dwStart - 1;
while (start > 0 && start < dwStart) {
- if ((_istspace(sel[start]) && !_istspace(sel[start + 1])) || isItSmiley((int)start))
+ if ((iswspace(sel[start]) && !iswspace(sel[start + 1])) || isItSmiley((int)start))
break;
start--;
}
@@ -483,7 +483,7 @@ void SwitchLayout(bool lastword) keys[VK_MENU] = (HIBYTE(vks) & 4) ? 0xFF : 0x00; // alt
if (!isItSmiley((int)i)) {
- TCHAR tchr;
+ wchar_t tchr;
if (ToUnicodeEx(LOBYTE(vks), 0, keys, &tchr, 1, 0, GetKeyboardLayout(dwThreadID)) == 1)
sel[i] = tchr;
}
@@ -513,7 +513,7 @@ void TranslitLayout(bool lastword) if (hwnd2 == NULL)
return;
- TCHAR szClassName[16];
+ wchar_t szClassName[16];
GetClassName(hwnd2, szClassName, _countof(szClassName));
if (mir_tstrcmpi(szClassName, L"RichEdit50W") != 0)
return;
@@ -524,29 +524,29 @@ void TranslitLayout(bool lastword) if (somethingIsSelected)
dwFlags += SFF_SELECTION;
- TCHAR *boo, *sel = Message_GetFromStream(hwnd2, dwFlags);
+ wchar_t *boo, *sel = Message_GetFromStream(hwnd2, dwFlags);
size_t slen = mir_tstrlen(sel), start = 0, end = 0;
if (slen != 0) {
end = slen;
if (lastword && !somethingIsSelected) {
end = (size_t)dwStart;
while (end < slen) {
- if (_istspace(sel[end]) || isItSmiley((int)end))
+ if (iswspace(sel[end]) || isItSmiley((int)end))
break;
end++;
}
start = (size_t)dwStart - 1;
while (start > 0 && start < (size_t)dwStart) {
- if ((_istspace(sel[start]) && (end - start > 2)) || isItSmiley((int)start))
+ if ((iswspace(sel[start]) && (end - start > 2)) || isItSmiley((int)start))
break;
start--;
}
- boo = (TCHAR*)mir_alloc((end - start + 1) * sizeof(TCHAR));
+ boo = (wchar_t*)mir_alloc((end - start + 1) * sizeof(wchar_t));
mir_tstrncpy(boo, sel + start, end - start);
boo[end - start] = 0;
}
else {
- boo = (TCHAR*)mir_alloc((slen + 1) * sizeof(TCHAR));
+ boo = (wchar_t*)mir_alloc((slen + 1) * sizeof(wchar_t));
mir_tstrcpy(boo, sel);
}
@@ -555,7 +555,7 @@ void TranslitLayout(bool lastword) if (somethingIsSelected)
SendMessage(hwnd2, EM_REPLACESEL, false, (LPARAM)boo);
else {
- TCHAR *NewText = (TCHAR*)mir_alloc((start + mir_tstrlen(boo) + (slen - start) + 1) * sizeof(TCHAR));
+ wchar_t *NewText = (wchar_t*)mir_alloc((start + mir_tstrlen(boo) + (slen - start) + 1) * sizeof(wchar_t));
NewText[0] = 0;
mir_tstrncat(NewText, sel, start);
mir_tstrcat(NewText, boo);
@@ -580,7 +580,7 @@ void InvertCase(bool lastword) if (hwnd2 == NULL)
return;
- TCHAR szClassName[16];
+ wchar_t szClassName[16];
GetClassName(hwnd2, szClassName, _countof(szClassName));
if (mir_tstrcmpi(szClassName, L"RichEdit50W") != 0)
@@ -592,29 +592,29 @@ void InvertCase(bool lastword) if (somethingIsSelected)
dwFlags += SFF_SELECTION;
- TCHAR *boo, *sel = Message_GetFromStream(hwnd2, dwFlags);
+ wchar_t *boo, *sel = Message_GetFromStream(hwnd2, dwFlags);
size_t slen = mir_tstrlen(sel), start = 0, end = 0;
if (slen != 0) {
end = slen;
if (lastword && !somethingIsSelected) {
end = (size_t)dwStart;
while (end < slen) {
- if (_istspace(sel[end]) || isItSmiley((int)end))
+ if (iswspace(sel[end]) || isItSmiley((int)end))
break;
end++;
}
start = (size_t)dwStart - 1;
while (start > 0 && start < (size_t)dwStart) {
- if ((_istspace(sel[start]) && (end - start > 2)) || isItSmiley((int)start))
+ if ((iswspace(sel[start]) && (end - start > 2)) || isItSmiley((int)start))
break;
start--;
}
- boo = (TCHAR*)mir_alloc((end - start + 1) * sizeof(TCHAR));
+ boo = (wchar_t*)mir_alloc((end - start + 1) * sizeof(wchar_t));
mir_tstrncpy(boo, sel + start, end - start);
boo[end - start] = 0;
}
else {
- boo = (TCHAR*)mir_alloc((slen + 1) * sizeof(TCHAR));
+ boo = (wchar_t*)mir_alloc((slen + 1) * sizeof(wchar_t));
mir_tstrcpy(boo, sel);
}
@@ -623,7 +623,7 @@ void InvertCase(bool lastword) if (somethingIsSelected)
SendMessage(hwnd2, EM_REPLACESEL, false, (LPARAM)boo);
else {
- TCHAR *NewText = (TCHAR*)mir_alloc((start + mir_tstrlen(boo) + (slen - start) + 1) * sizeof(TCHAR));
+ wchar_t *NewText = (wchar_t*)mir_alloc((start + mir_tstrlen(boo) + (slen - start) + 1) * sizeof(wchar_t));
NewText[0] = 0;
mir_tstrncat(NewText, sel, start);
mir_tstrcat(NewText, boo);
@@ -664,7 +664,7 @@ int OnButtonPressed(WPARAM, LPARAM lParam) byKeybState[VK_CONTROL] = 0;
SetKeyboardState(byKeybState);
- TCHAR *sel = Message_GetFromStream(hEdit, SF_TEXT | SF_UNICODE);
+ wchar_t *sel = Message_GetFromStream(hEdit, SF_TEXT | SF_UNICODE);
size_t slen = mir_tstrlen(sel);
if (slen != 0) {
switch (iType) {
@@ -686,7 +686,7 @@ int OnButtonPressed(WPARAM, LPARAM lParam) ActivateKeyboardLayout((HKL)HKL_PREV, KLF_ACTIVATE);
for (int i = 0; i < (int)slen; i++) {
- TCHAR tchr;
+ wchar_t tchr;
BYTE keys[256] = { 0 };
SHORT vks = VkKeyScanEx(sel[i], hkl);
diff --git a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp index daf47f1298..046d982675 100644 --- a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp +++ b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp @@ -156,40 +156,40 @@ extern "C" __declspec(dllexport) int Load(void) HOTKEYDESC hkd = { sizeof(hkd) };
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "TranslitSwitcher/ConvertAllOrSelected";
- hkd.ptszDescription = LPGENT("Convert All / Selected");
+ hkd.ptszDescription = LPGENW("Convert All / Selected");
hkd.ptszSection = L"TranslitSwitcher";
hkd.pszService = MS_TS_SWITCHLAYOUT;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL + HKCOMB_A, 'R') | HKF_MIRANDA_LOCAL;
Hotkey_Register(&hkd);
hkd.pszName = "TranslitSwitcher/ConvertLastOrSelected";
- hkd.ptszDescription = LPGENT("Convert Last / Selected");
+ hkd.ptszDescription = LPGENW("Convert Last / Selected");
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT + HKCOMB_A, 'R') | HKF_MIRANDA_LOCAL;
hkd.lParam = true;
Hotkey_Register(&hkd);
hkd.pszName = "TranslitSwitcher/TranslitAllOrSelected";
- hkd.ptszDescription = LPGENT("Translit All / Selected");
+ hkd.ptszDescription = LPGENW("Translit All / Selected");
hkd.pszService = MS_TS_TRANSLITLAYOUT;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL + HKCOMB_A, 'T') | HKF_MIRANDA_LOCAL;
hkd.lParam = false;
Hotkey_Register(&hkd);
hkd.pszName = "TranslitSwitcher/TranslitLastOrSelected";
- hkd.ptszDescription = LPGENT("Translit Last / Selected");
+ hkd.ptszDescription = LPGENW("Translit Last / Selected");
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT + HKCOMB_A, 'T') | HKF_MIRANDA_LOCAL;
hkd.lParam = true;
Hotkey_Register(&hkd);
hkd.pszName = "TranslitSwitcher/InvertCaseAllOrSelected";
- hkd.ptszDescription = LPGENT("Invert Case All / Selected");
+ hkd.ptszDescription = LPGENW("Invert Case All / Selected");
hkd.pszService = MS_TS_INVERTCASE;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL + HKCOMB_A, 'Y') | HKF_MIRANDA_LOCAL;
hkd.lParam = false;
Hotkey_Register(&hkd);
hkd.pszName = "TranslitSwitcher/InvertCaseLastOrSelected";
- hkd.ptszDescription = LPGENT("Invert Case Last / Selected");
+ hkd.ptszDescription = LPGENW("Invert Case Last / Selected");
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT + HKCOMB_A, 'Y') | HKF_MIRANDA_LOCAL;
hkd.lParam = true;
Hotkey_Register(&hkd);
diff --git a/plugins/UserGuide/src/main.cpp b/plugins/UserGuide/src/main.cpp index 9492c6896b..2d591663ba 100644 --- a/plugins/UserGuide/src/main.cpp +++ b/plugins/UserGuide/src/main.cpp @@ -21,10 +21,10 @@ PLUGININFOEX pluginInfo = { static INT_PTR ShowGuideFile(WPARAM, LPARAM)
{
- LPTSTR pszDirName = (LPTSTR)mir_alloc(250*sizeof(TCHAR));
- LPTSTR pszFileName = (LPTSTR)mir_alloc(250*sizeof(TCHAR));
+ LPTSTR pszDirName = (LPTSTR)mir_alloc(250*sizeof(wchar_t));
+ LPTSTR pszFileName = (LPTSTR)mir_alloc(250*sizeof(wchar_t));
- TCHAR *ptszHelpFile = db_get_tsa(NULL, "UserGuide", "PathToHelpFile");
+ wchar_t *ptszHelpFile = db_get_tsa(NULL, "UserGuide", "PathToHelpFile");
if (ptszHelpFile==0)
{
@@ -40,17 +40,17 @@ static INT_PTR ShowGuideFile(WPARAM, LPARAM) }
else
{
- LPTSTR pszDivider = _tcsrchr(ptszHelpFile, '\\');
+ LPTSTR pszDivider = wcsrchr(ptszHelpFile, '\\');
if (pszDivider == NULL)
{
mir_tstrcpy(pszDirName, L"");
- _tcsncpy(pszFileName, ptszHelpFile, mir_tstrlen(ptszHelpFile));
+ wcsncpy(pszFileName, ptszHelpFile, mir_tstrlen(ptszHelpFile));
}
else
{
- _tcsncpy(pszFileName, pszDivider + 1, mir_tstrlen(ptszHelpFile) - mir_tstrlen(pszDivider) - 1);
+ wcsncpy(pszFileName, pszDivider + 1, mir_tstrlen(ptszHelpFile) - mir_tstrlen(pszDivider) - 1);
pszFileName[mir_tstrlen(ptszHelpFile) - mir_tstrlen(pszDivider) - 1] = 0;
- _tcsncpy(pszDirName, ptszHelpFile, pszDivider - ptszHelpFile);
+ wcsncpy(pszDirName, ptszHelpFile, pszDivider - ptszHelpFile);
pszDirName[pszDivider - ptszHelpFile] = 0;
}
}
@@ -87,7 +87,7 @@ extern "C" __declspec(dllexport) int Load(void) mi.position = 500000;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_HELP);
- mi.name.t = LPGENT("User Guide");
+ mi.name.w = LPGENW("User Guide");
mi.pszService = "UserGuide/ShowGuide";
Menu_AddMainMenuItem(&mi);
diff --git a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp index d28f9fcd36..445928a641 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp @@ -342,12 +342,12 @@ void InitIcons() if (phIconHandles != NULL) {
char szId[20];
SKINICONDESC sid = { 0 };
- sid.section.t = LPGENT("Country flags");
+ sid.section.w = LPGENW("Country flags");
sid.pszName = szId; // name to refer to icon when playing and in db
sid.flags = SIDF_SORTED | SIDF_TCHAR;
for (int i=0; i < nCountriesCount; i++) {
- sid.description.t = mir_a2t(LPGEN(countries[i].szName));
+ sid.description.w = mir_a2t(LPGEN(countries[i].szName));
/* create identifier */
mir_snprintf(szId, (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countries[i].id); /* buffer safe */
int index = CountryNumberToBitmapIndex(countries[i].id);
@@ -358,7 +358,7 @@ void InitIcons() phIconHandles[index] = IcoLib_AddIcon(&sid);
if (sid.hDefaultIcon != NULL)
DestroyIcon(sid.hDefaultIcon);
- mir_free(sid.description.t); sid.description.t = NULL;
+ mir_free(sid.description.w); sid.description.w = NULL;
}
}
ImageList_Destroy(himl);
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index 9567506ab3..2bf0c62670 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -218,19 +218,19 @@ struct LPCSTR szZodiacIcon;
}
static zodiac[] = {
- { 80, 110, LPGENT("Aries"), ICO_ZOD_ARIES }, // Widder
- { 111, 140, LPGENT("Taurus"), ICO_ZOD_TAURUS }, // Stier
- { 141, 172, LPGENT("Gemini"), ICO_ZOD_GEMINI }, // Zwillinge
- { 173, 203, LPGENT("Cancer"), ICO_ZOD_CANCER }, // Krebs
- { 204, 235, LPGENT("Leo"), ICO_ZOD_LEO }, // Löwe
- { 236, 266, LPGENT("Virgo"), ICO_ZOD_VIRGO }, // Jungfrau
- { 267, 296, LPGENT("Libra"), ICO_ZOD_LIBRA }, // Waage
- { 297, 326, LPGENT("Scorpio"), ICO_ZOD_SCORPIO }, // Scorpion
- { 327, 355, LPGENT("Sagittarius"), ICO_ZOD_SAGITTARIUS }, // Schütze
- { 356, 364, LPGENT("Capricorn"), ICO_ZOD_CAPRICORN }, // Steinbock
- { 1, 19, LPGENT("Capricorn"), ICO_ZOD_CAPRICORN }, // Steinbock
- { 20, 49, LPGENT("Aquarius"), ICO_ZOD_AQUARIUS }, // Wassermann
- { 50, 79, LPGENT("Pisces"), ICO_ZOD_PISCES }, // Fische
+ { 80, 110, LPGENW("Aries"), ICO_ZOD_ARIES }, // Widder
+ { 111, 140, LPGENW("Taurus"), ICO_ZOD_TAURUS }, // Stier
+ { 141, 172, LPGENW("Gemini"), ICO_ZOD_GEMINI }, // Zwillinge
+ { 173, 203, LPGENW("Cancer"), ICO_ZOD_CANCER }, // Krebs
+ { 204, 235, LPGENW("Leo"), ICO_ZOD_LEO }, // Löwe
+ { 236, 266, LPGENW("Virgo"), ICO_ZOD_VIRGO }, // Jungfrau
+ { 267, 296, LPGENW("Libra"), ICO_ZOD_LIBRA }, // Waage
+ { 297, 326, LPGENW("Scorpio"), ICO_ZOD_SCORPIO }, // Scorpion
+ { 327, 355, LPGENW("Sagittarius"), ICO_ZOD_SAGITTARIUS }, // Schütze
+ { 356, 364, LPGENW("Capricorn"), ICO_ZOD_CAPRICORN }, // Steinbock
+ { 1, 19, LPGENW("Capricorn"), ICO_ZOD_CAPRICORN }, // Steinbock
+ { 20, 49, LPGENW("Aquarius"), ICO_ZOD_AQUARIUS }, // Wassermann
+ { 50, 79, LPGENW("Pisces"), ICO_ZOD_PISCES }, // Fische
{ 0, 0, NULL, "" } // end of array
};
@@ -680,9 +680,9 @@ int MAnnivDate::DBWriteAnniversaryDate(MCONTACT hContact, WORD wIndex) static WORD AskUser(MCONTACT hContact, MAnnivDate *pOldCustomDate, MAnnivDate *pNewProtoDate)
{
MSGBOX MB;
- TCHAR szMsg[MAXDATASIZE];
- TCHAR szDate[MAX_PATH];
- TCHAR szoldDate[MAX_PATH];
+ wchar_t szMsg[MAXDATASIZE];
+ wchar_t szDate[MAX_PATH];
+ wchar_t szoldDate[MAX_PATH];
pOldCustomDate->DateFormat(szoldDate, _countof(szoldDate));
pNewProtoDate->DateFormat(szDate, _countof(szDate));
@@ -696,8 +696,8 @@ static WORD AskUser(MCONTACT hContact, MAnnivDate *pOldCustomDate, MAnnivDate *p MB.hiLogo = IcoLib_GetIcon(ICO_DLG_ANNIVERSARY);
MB.hiMsg = NULL;
MB.uType = MB_YESALLNO|MB_ICON_QUESTION|MB_INFOBAR|MB_NOPOPUP;
- MB.ptszTitle = LPGENT("Update custom birthday");
- MB.ptszInfoText = LPGENT("Keeps your custom birthday up to date.");
+ MB.ptszTitle = LPGENW("Update custom birthday");
+ MB.ptszInfoText = LPGENW("Keeps your custom birthday up to date.");
MB.ptszMsg = szMsg;
return MsgBoxService(NULL, (LPARAM)&MB);
}
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.h b/plugins/UserInfoEx/src/classMAnnivDate.h index 14246f79f6..9d600eb814 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.h +++ b/plugins/UserInfoEx/src/classMAnnivDate.h @@ -44,7 +44,7 @@ public: private:
WORD _wID; // index to anniversary in database or ANID_BIRTHDAY
- tstring _strDesc; // descripes the anniversary (e.g. birthday)
+ wstring _strDesc; // descripes the anniversary (e.g. birthday)
string _strModule; // the module the anniversary has been read from
WORD _wFlags; // the flags
BYTE _bRemind; // per user setting for reminder (0 - disabled, 1 - use local offset, 2 - use global offset)
diff --git a/plugins/UserInfoEx/src/classMTime.cpp b/plugins/UserInfoEx/src/classMTime.cpp index 8c2049b3d7..03cc310118 100644 --- a/plugins/UserInfoEx/src/classMTime.cpp +++ b/plugins/UserInfoEx/src/classMTime.cpp @@ -363,9 +363,9 @@ WORD MTime::DateFormatAlt(LPTSTR ptszTimeFormat, WORD cchTimeFormat) return 0;
}
- TCHAR tszText[10];
- _itot(mtNow.Year(), tszText, 10);
- TCHAR * tszYear = _tcsstr(ptszTimeFormat, tszText);
+ wchar_t tszText[10];
+ _itow(mtNow.Year(), tszText, 10);
+ wchar_t * tszYear = wcsstr(ptszTimeFormat, tszText);
if (tszYear && mir_tstrlen(tszYear) == 4)
mir_tstrcpy(tszYear, L"????");
diff --git a/plugins/UserInfoEx/src/classMTime.h b/plugins/UserInfoEx/src/classMTime.h index 78ff1b23dd..623b1a156b 100644 --- a/plugins/UserInfoEx/src/classMTime.h +++ b/plugins/UserInfoEx/src/classMTime.h @@ -59,7 +59,6 @@ public: WORD AdjustYear(const int nDiffDays);
WORD TimeFormat(LPTSTR ptszTimeFormat, WORD cchTimeFormat);
- WORD TimeFormat(tstring& str);
WORD DateFormat(LPTSTR ptszTimeFormat, WORD cchTimeFormat);
WORD DateFormatAlt(LPTSTR ptszTimeFormat, WORD cchTimeFormat);
WORD DateFormatLong(LPTSTR ptszTimeFormat, WORD cchTimeFormat);
diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp index 6cbd32fe43..ba83d12e61 100644 --- a/plugins/UserInfoEx/src/classPsTree.cpp +++ b/plugins/UserInfoEx/src/classPsTree.cpp @@ -130,10 +130,10 @@ int CPsTree::AddDummyItem(LPCSTR pszGroup) OPTIONSDIALOGPAGE odp = { 0 }; odp.hInstance = ghInst; odp.flags = ODPF_TCHAR; - odp.ptszTitle = mir_utf8decodeT(pszGroup); + odp.pwszTitle = mir_utf8decodeT(pszGroup); INT_PTR rc = UserInfo_AddPage((WPARAM)&psh, &odp); - mir_free(odp.ptszTitle); + mir_free(odp.pwszTitle); if (!rc) { _pItems = psh._pPages; _numItems = psh._numPages; @@ -368,7 +368,7 @@ HTREEITEM CPsTree::ShowItem(const int iPageIndex, LPWORD needWidth) !pti->Name() || !pti->Label()) { - MsgErr(GetParent(_hWndTree), LPGENT("Due to a parameter error, one of the treeitems can't be added!")); + MsgErr(GetParent(_hWndTree), LPGENW("Due to a parameter error, one of the treeitems can't be added!")); return NULL; } // item is visible at the moment @@ -393,7 +393,7 @@ HTREEITEM CPsTree::ShowItem(const int iPageIndex, LPWORD needWidth) // insert item into tree if set visible if ((tvii.itemex.hItem = TreeView_InsertItem(_hWndTree, &tvii)) == NULL) { - MsgErr(GetParent(_hWndTree), LPGENT("A fatal error occurred on adding a property sheet page!\nDialog creation aborted!")); + MsgErr(GetParent(_hWndTree), LPGENW("A fatal error occurred on adding a property sheet page!\nDialog creation aborted!")); return NULL; } pti->Hti(tvii.itemex.hItem); @@ -685,7 +685,7 @@ int CPsTree::BeginLabelEdit(HTREEITEM hItem) **/ int CPsTree::EndLabelEdit(const BYTE bSave) { - TCHAR szEdit[MAX_TINAME]; + wchar_t szEdit[MAX_TINAME]; TVITEM tvi; WORD cchEdit; diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index ca46d61dfa..2035874a55 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. **/
BOOL CALLBACK BoldGroupTitlesEnumChildren(HWND hWnd, LPARAM lParam)
{
- TCHAR szClass[64];
+ wchar_t szClass[64];
GetClassName(hWnd, szClass, 64);
if (!mir_tstrcmp(szClass, L"Button") && (GetWindowLongPtr(hWnd, GWL_STYLE) & 0x0F) == BS_GROUPBOX)
SendMessage(hWnd, WM_SETFONT, lParam, NULL);
@@ -318,8 +318,8 @@ int CPsTreeItem::Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, BYTE bInitIconsOn SKINICONDESC sid = { 0 };
sid.flags = SIDF_ALL_TCHAR;
sid.pszName = (LPSTR)pszIconName;
- sid.description.t = _ptszLabel;
- sid.section.t = LPGENT(SECT_TREE);
+ sid.description.w = _ptszLabel;
+ sid.section.w = _A2W(SECT_TREE);
// the item to insert brings along an icon?
if (odp->flags & ODPF_ICON) {
@@ -327,10 +327,10 @@ int CPsTreeItem::Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, BYTE bInitIconsOn if (odp->hInstance == ghInst) {
// the pszGroup holds the iconfile for items added by uinfoex
- sid.defaultFile.t = odp->ptszGroup;
+ sid.defaultFile.w = odp->pwszGroup;
// icon library exists?
- if (sid.defaultFile.t)
+ if (sid.defaultFile.w)
sid.iDefaultIndex = (INT_PTR)odp->hIcon;
// no valid icon library
else {
@@ -385,7 +385,7 @@ int CPsTreeItem::Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, BYTE bInitIconsOn int CPsTreeItem::Create(CPsHdr* pPsh, OPTIONSDIALOGPAGE *odp)
{
int err;
- TCHAR szTitle[ MAXSETTING ];
+ wchar_t szTitle[ MAXSETTING ];
// check parameter
if (pPsh && pPsh->_dwSize == sizeof(CPsHdr) && odp && PtrIsValid(odp->hInstance)) {
@@ -403,23 +403,23 @@ int CPsTreeItem::Create(CPsHdr* pPsh, OPTIONSDIALOGPAGE *odp) if (pPsh->_dwFlags & PSF_PROTOPAGESONLY) {
if (_dwFlags & ODPF_USERINFOTAB)
- mir_sntprintf(szTitle, L"%s %d\\%s", odp->ptszTitle, pPsh->_nSubContact+1, odp->ptszTab);
+ mir_sntprintf(szTitle, L"%s %d\\%s", odp->pwszTitle, pPsh->_nSubContact+1, odp->pwszTab);
else
- mir_sntprintf(szTitle, L"%s %d", odp->ptszTitle, pPsh->_nSubContact+1);
+ mir_sntprintf(szTitle, L"%s %d", odp->pwszTitle, pPsh->_nSubContact+1);
}
else {
if (_dwFlags & ODPF_USERINFOTAB)
- mir_sntprintf(szTitle, L"%s\\%s", odp->ptszTitle, odp->ptszTab);
+ mir_sntprintf(szTitle, L"%s\\%s", odp->pwszTitle, odp->pwszTab);
else
- mir_tstrcpy(szTitle, odp->ptszTitle);
+ mir_tstrcpy(szTitle, odp->pwszTitle);
}
// set the unique utf8 encoded name for the item
if (err = Name(szTitle, (_dwFlags & ODPF_UNICODE) == ODPF_UNICODE))
- MsgErr(NULL, LPGENT("Creating unique name for a page failed with %d and error code %d"), err, GetLastError());
+ MsgErr(NULL, LPGENW("Creating unique name for a page failed with %d and error code %d"), err, GetLastError());
// read label from database or create it
else if (err = ItemLabel(TRUE))
- MsgErr(NULL, LPGENT("Creating the label for a page failed with %d and error code %d"), err, GetLastError());
+ MsgErr(NULL, LPGENW("Creating the label for a page failed with %d and error code %d"), err, GetLastError());
else {
// load icon for the item
Icon(pPsh->_hImages, odp, (pPsh->_dwFlags & PSTVF_INITICONS) == PSTVF_INITICONS);
@@ -439,7 +439,7 @@ int CPsTreeItem::Create(CPsHdr* pPsh, OPTIONSDIALOGPAGE *odp) // error for no longer supported dialog template type
if (((UINT_PTR)odp->pszTemplate & 0xFFFF0000))
- MsgErr(NULL, LPGENT("The dialog template type is no longer supported"));
+ MsgErr(NULL, LPGENW("The dialog template type is no longer supported"));
else {
// fetch dialog resource id
_idDlg = (INT_PTR)odp->pszTemplate;
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp index 591df8f8b3..a8fcf14a4d 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp +++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp @@ -403,7 +403,7 @@ INT_PTR CAnnivEditCtrl::SetCurSel(WORD wIndex) DateTime_SetFormat(_hwndDate, NULL);
}
else {
- TCHAR szText[MAX_DESC];
+ wchar_t szText[MAX_DESC];
mir_sntprintf(szText, L"'%s'", TranslateT("Unspecified"));
DateTime_SetSystemtime(_hwndDate, GDT_NONE, NULL);
DateTime_SetFormat(_hwndDate, szText);
@@ -528,7 +528,7 @@ void CAnnivEditCtrl::OnReminderChecked() MCONTACT hContact;
LPCSTR pszProto;
int state;
- TCHAR buf[6];
+ wchar_t buf[6];
MAnnivDate *pCurrent = Current();
PSGetContact(_hwndDlg, hContact);
@@ -540,7 +540,7 @@ void CAnnivEditCtrl::OnReminderChecked() {
if (IsDlgButtonChecked(_hwndDlg, RADIO_REMIND1))
{
- _itot(db_get_b(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), buf, 10);
+ _itow(db_get_b(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), buf, 10);
EnableWindow(GetDlgItem(_hwndDlg, EDIT_REMIND), FALSE);
EnableWindow(GetDlgItem(_hwndDlg, SPIN_REMIND), FALSE);
state = BST_INDETERMINATE;
@@ -549,11 +549,11 @@ void CAnnivEditCtrl::OnReminderChecked() {
if (pCurrent->RemindOffset() == (WORD)-1)
{
- _itot(db_get_b(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), buf, 10);
+ _itow(db_get_b(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), buf, 10);
}
else
{
- _itot(pCurrent->RemindOffset(), buf, 10);
+ _itow(pCurrent->RemindOffset(), buf, 10);
}
EnableWindow(GetDlgItem(_hwndDlg, EDIT_REMIND), _ReminderEnabled);
EnableWindow(GetDlgItem(_hwndDlg, SPIN_REMIND), _ReminderEnabled);
diff --git a/plugins/UserInfoEx/src/ctrl_button.cpp b/plugins/UserInfoEx/src/ctrl_button.cpp index e2ec2b7292..59ccb0a1ee 100644 --- a/plugins/UserInfoEx/src/ctrl_button.cpp +++ b/plugins/UserInfoEx/src/ctrl_button.cpp @@ -41,7 +41,7 @@ typedef struct TMBCtrl{ int stateId; // button state
int defbutton; // default button
int pbState;
- TCHAR cHot;
+ wchar_t cHot;
} BTNCTRL, *LPBTNCTRL;
// External theme methods and properties
@@ -254,7 +254,7 @@ static void __fastcall PaintThemeButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClien static void __fastcall PaintButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClient)
{
RECT rcText = { 0, 0, 0, 0 };
- TCHAR szText[MAX_PATH] = { 0 };
+ wchar_t szText[MAX_PATH] = { 0 };
WORD ccText;
// Draw the flat button
@@ -408,7 +408,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L while (*tmp) {
if (*tmp == '&' && *(tmp + 1)) {
- bct->cHot = _totlower(*(tmp + 1));
+ bct->cHot = towlower(*(tmp + 1));
break;
}
tmp++;
@@ -417,7 +417,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L }
break;
case WM_SYSKEYUP:
- if (bct->stateId != PBS_DISABLED && bct->cHot && bct->cHot == _totlower((TCHAR)wParam)) {
+ if (bct->stateId != PBS_DISABLED && bct->cHot && bct->cHot == towlower((wchar_t)wParam)) {
if (bct->dwStyle & MBS_PUSHBUTTON) {
if (bct->pbState) bct->pbState = 0;
else bct->pbState = 1;
@@ -542,7 +542,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L break;
case BUTTONTRANSLATE:
{
- TCHAR szButton[MAX_PATH];
+ wchar_t szButton[MAX_PATH];
GetWindowText(bct->hwnd, szButton, _countof(szButton));
SetWindowText(bct->hwnd, TranslateTS(szButton));
}
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp index b37897793b..ae37e6eaac 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.cpp +++ b/plugins/UserInfoEx/src/ctrl_contact.cpp @@ -35,7 +35,7 @@ typedef struct TCbExItem WORD wMask;
WORD wFlags;
DWORD dwID;
- TCHAR szCat[MAX_CAT];
+ wchar_t szCat[MAX_CAT];
LPTSTR pszVal;
LPCSTR pszIcon;
HICON hIcon;
@@ -158,7 +158,7 @@ static INT_PTR CALLBACK DlgProc_EMail(HWND hDlg, UINT msg, WPARAM wParam, LPARAM }
if (*cbi->pszVal)
- SetWindowText(hDlg, LPGENT("Edit e-mail"));
+ SetWindowText(hDlg, LPGENW("Edit e-mail"));
TranslateDialogDefault(hDlg);
SendDlgItemMessage(hDlg, EDIT_CATEGORY, EM_LIMITTEXT, cbi->ccCat - 1, 0);
SendDlgItemMessage(hDlg, EDIT_EMAIL, EM_LIMITTEXT, cbi->ccVal - 1, 0);
@@ -169,7 +169,7 @@ static INT_PTR CALLBACK DlgProc_EMail(HWND hDlg, UINT msg, WPARAM wParam, LPARAM // translate Userinfo buttons
{
- TCHAR szButton[MAX_PATH];
+ wchar_t szButton[MAX_PATH];
HWND hBtn = GetDlgItem(hDlg, IDOK);
GetWindowText(hBtn, szButton, _countof(szButton));
SetWindowText(hBtn, TranslateTS(szButton));
@@ -202,14 +202,14 @@ static INT_PTR CALLBACK DlgProc_EMail(HWND hDlg, UINT msg, WPARAM wParam, LPARAM }
case EDIT_EMAIL:
if (HIWORD(wParam) == EN_UPDATE) {
- TCHAR szText[MAXDATASIZE];
+ wchar_t szText[MAXDATASIZE];
LPTSTR pszAdd, pszDot;
if (PtrIsValid(cbi)) {
GetWindowText((HWND)lParam, szText, _countof(szText));
EnableWindow(GetDlgItem(hDlg, IDOK),
- ((pszAdd = _tcschr(szText, '@')) &&
+ ((pszAdd = wcschr(szText, '@')) &&
*(pszAdd + 1) != '.' &&
- (pszDot = _tcschr(pszAdd, '.')) &&
+ (pszDot = wcschr(pszAdd, '.')) &&
*(pszDot + 1) &&
mir_tstrcmp(szText, cbi->pszVal)));
}
@@ -251,7 +251,7 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam // translate Userinfo buttons
{
- TCHAR szButton[MAX_PATH];
+ wchar_t szButton[MAX_PATH];
HWND hBtn;
hBtn = GetDlgItem(hDlg, IDOK);
@@ -261,7 +261,7 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam GetWindowText(hBtn, szButton, _countof(szButton));
SetWindowText(hBtn, TranslateTS(szButton));
}
- if (*cbi->pszVal) SetWindowText(hDlg, LPGENT("Edit phone number"));
+ if (*cbi->pszVal) SetWindowText(hDlg, LPGENW("Edit phone number"));
if (cbi->wFlags & CBEXIF_SMS) CheckDlgButton(hDlg, CHECK_SMS, BST_CHECKED);
TranslateDialogDefault(hDlg);
@@ -292,7 +292,7 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam switch (LOWORD(wParam)) {
case IDOK:
if (HIWORD(wParam) == BN_CLICKED) {
- TCHAR szText[MAXDATASIZE];
+ wchar_t szText[MAXDATASIZE];
int errorPos;
if (!GetDlgItemText(hDlg, EDIT_PHONE, szText, _countof(szText)) || !CheckPhoneSyntax(szText, cbi->pszVal, cbi->ccVal, errorPos) || errorPos > -1) {
@@ -322,7 +322,7 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam if (noRecursion) break;
EnableWindow(GetDlgItem(hDlg, IDOK), TRUE);
{
- TCHAR szPhone[MAXDATASIZE], szArea[32], szData[64];
+ wchar_t szPhone[MAXDATASIZE], szArea[32], szData[64];
int nCurSel = SendDlgItemMessage(hDlg, EDIT_COUNTRY, CB_GETCURSEL, 0, 0);
UINT nCountry = (nCurSel != CB_ERR) ? SendDlgItemMessage(hDlg, EDIT_COUNTRY, CB_GETITEMDATA, nCurSel, 0) : 0;
@@ -340,13 +340,13 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam if (noRecursion) break;
noRecursion = 1;
{
- TCHAR szText[MAXDATASIZE], *pText = 0, *pArea, *pNumber;
+ wchar_t szText[MAXDATASIZE], *pText = 0, *pArea, *pNumber;
bool isValid = true;
GetDlgItemText(hDlg, EDIT_PHONE, szText, _countof(szText));
if (szText[0] != '+')
isValid = false;
if (isValid) {
- int country = _tcstol(szText + 1, &pText, 10);
+ int country = wcstol(szText + 1, &pText, 10);
if (pText - szText > 4)
isValid = false;
else {
@@ -362,11 +362,11 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam }
}
if (isValid) {
- pArea = pText + _tcscspn(pText, L"0123456789");
+ pArea = pText + wcscspn(pText, L"0123456789");
pText = pArea + _tcsspn(pArea, L"0123456789");
if (*pText) {
*pText = '\0';
- pNumber = pText + 1 + _tcscspn(pText + 1, L"0123456789");
+ pNumber = pText + 1 + wcscspn(pText + 1, L"0123456789");
SetDlgItemText(hDlg, EDIT_NUMBER, pNumber);
}
SetDlgItemText(hDlg, EDIT_AREA, pArea);
@@ -659,8 +659,8 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (HIWORD(wParam) == BN_CLICKED) {
DLGPROC dlgProc;
WORD dlgID;
- TCHAR szCat[MAX_CAT] = { 0 };
- TCHAR szVal[MAXDATASIZE] = { 0 };
+ wchar_t szCat[MAX_CAT] = { 0 };
+ wchar_t szVal[MAXDATASIZE] = { 0 };
CBEXITEM cbi;
HWND hDlgDetails;
@@ -716,8 +716,8 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (HIWORD(wParam) == BN_CLICKED) {
DLGPROC dlgProc;
WORD dlgID;
- TCHAR szCat[MAX_CAT] = { 0 };
- TCHAR szVal[MAXDATASIZE] = { 0 };
+ wchar_t szCat[MAX_CAT] = { 0 };
+ wchar_t szVal[MAXDATASIZE] = { 0 };
CBEXITEM cbi;
HWND hDlgDetails;
@@ -746,7 +746,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L cbi.ccCat = MAX_CAT;
cbi.ccVal = MAXDATASIZE;
if (!CtrlContactWndProc(hwnd, CBEXM_GETITEM, NULL, (LPARAM)&cbi)) {
- MsgErr(hwnd, LPGENT("CRITICAL: Unable to edit current entry!\nThis should not happen!"));
+ MsgErr(hwnd, LPGENW("CRITICAL: Unable to edit current entry!\nThis should not happen!"));
return 1;
}
@@ -772,7 +772,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (HIWORD(wParam) == BN_CLICKED) {
HWND hDlgDetails;
MSGBOX mBox;
- TCHAR szMsg[MAXDATASIZE];
+ wchar_t szMsg[MAXDATASIZE];
SetFocus((HWND)lParam);
if (!(hDlgDetails = GetParent(GetParent(hwnd))) ||
@@ -827,7 +827,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L switch (HIWORD(wParam)) {
case EN_UPDATE:
{
- TCHAR szVal[MAXDATASIZE] = { 0 };
+ wchar_t szVal[MAXDATASIZE] = { 0 };
int ccVal;
MCONTACT hContact;
HWND hDlgDetails = GetParent(GetParent(hwnd));
@@ -845,7 +845,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case EDIT_PHONE:
{
int errorPos;
- TCHAR szEdit[MAXDATASIZE];
+ wchar_t szEdit[MAXDATASIZE];
if (ccVal = GetWindowText(cbex->hEdit, szEdit, _countof(szEdit))) {
if (!(ccVal = CheckPhoneSyntax(szEdit, szVal, MAXDATASIZE, errorPos)) || errorPos > -1) {
@@ -894,7 +894,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L cbex->bIsChanged = TRUE;
}
else
- if (cbex->pItems[cbex->iSelectedItem].pszVal = (LPTSTR)mir_realloc(cbex->pItems[cbex->iSelectedItem].pszVal, (ccText + 2) * sizeof(TCHAR))) {
+ if (cbex->pItems[cbex->iSelectedItem].pszVal = (LPTSTR)mir_realloc(cbex->pItems[cbex->iSelectedItem].pszVal, (ccText + 2) * sizeof(wchar_t))) {
cbex->pItems[cbex->iSelectedItem].pszVal[ccText + 1] = 0;
GetWindowText(cbex->hEdit, cbex->pItems[cbex->iSelectedItem].pszVal, ccText + 1);
}
@@ -1297,7 +1297,7 @@ int CtrlContactAddItemFromDB( cbi.pszVal = NULL;
else { // check the database value
cbi.pszVal = dbv.ptszVal;
- if (LPTSTR sms = _tcsstr(cbi.pszVal, L" SMS")) {
+ if (LPTSTR sms = wcsstr(cbi.pszVal, L" SMS")) {
cbi.wFlags |= CBEXIF_SMS;
*sms = 0;
}
@@ -1377,7 +1377,7 @@ int CtrlContactAddMyItemsFromDB( dbv.ptszVal = NULL;
}
}
- if (sms = _tcsstr(cbi.pszVal, L" SMS")) {
+ if (sms = wcsstr(cbi.pszVal, L" SMS")) {
cbi.wFlags |= CBEXIF_SMS;
*sms = 0;
}
@@ -1411,7 +1411,7 @@ int CtrlContactWriteItemToDB( LPCSTR pszProto,
LPCSTR pszSetting)
{
- TCHAR szVal[MAXDATASIZE];
+ wchar_t szVal[MAXDATASIZE];
CBEXITEM cbi;
if (!CtrlContactWndProc(hCtrl, CBEXM_ISCHANGED, NULL, NULL)) return 1;
@@ -1455,8 +1455,8 @@ int CtrlContactWriteMyItemsToDB( LPCSTR szFormatVal)
{
CHAR pszSetting[MAXSETTING];
- TCHAR szCat[MAX_CAT];
- TCHAR szVal[MAXDATASIZE];
+ wchar_t szCat[MAX_CAT];
+ wchar_t szVal[MAXDATASIZE];
LPTSTR pszOther;
CBEXITEM cbi;
INT_PTR ccOther;
@@ -1481,7 +1481,7 @@ int CtrlContactWriteMyItemsToDB( mir_tstrncat(szVal, L" SMS", _countof(szVal) - mir_tstrlen(szVal));
}
mir_snprintf(pszSetting, szFormatCat, i);
- if (*szCat && _tcsncmp(szCat, pszOther, ccOther)) {
+ if (*szCat && wcsncmp(szCat, pszOther, ccOther)) {
if (db_set_ts(hContact, pszModule, pszSetting, szCat)) return 1;
}
else
diff --git a/plugins/UserInfoEx/src/ctrl_edit.cpp b/plugins/UserInfoEx/src/ctrl_edit.cpp index 77a3904eb6..04bfdbe2b8 100644 --- a/plugins/UserInfoEx/src/ctrl_edit.cpp +++ b/plugins/UserInfoEx/src/ctrl_edit.cpp @@ -108,7 +108,7 @@ BOOL CEditCtrl::OnInfoChanged(MCONTACT hContact, LPCSTR pszProto) { if (!_Flags.B.hasChanged) { DBVARIANT dbv; - TCHAR szText[64]; + wchar_t szText[64]; _Flags.B.hasCustom = _Flags.B.hasProto = _Flags.B.hasMeta = false; _Flags.W |= DB::Setting::GetTStringCtrl(hContact, _pszModule, _pszModule, pszProto, _pszSetting, &dbv); @@ -171,7 +171,7 @@ void CEditCtrl::OnApply(MCONTACT hContact, LPCSTR pszProto) DWORD cch = GetWindowTextLength(_hwnd); if (cch > 0) { - LPTSTR val = (LPTSTR)mir_alloc((cch + 1) * sizeof(TCHAR)); + LPTSTR val = (LPTSTR)mir_alloc((cch + 1) * sizeof(wchar_t)); if (GetWindowText(_hwnd, val, cch + 1) > 0) { DBVARIANT dbv; @@ -179,15 +179,15 @@ void CEditCtrl::OnApply(MCONTACT hContact, LPCSTR pszProto) dbv.type = _dbType; switch (_dbType) { case DBVT_BYTE: - dbv.bVal = (BYTE)_tcstol(val, NULL, 10); + dbv.bVal = (BYTE)wcstol(val, NULL, 10); break; case DBVT_WORD: - dbv.wVal = (WORD)_tcstol(val, NULL, 10); + dbv.wVal = (WORD)wcstol(val, NULL, 10); break; case DBVT_DWORD: - dbv.dVal = (DWORD)_tcstol(val, NULL, 10); + dbv.dVal = (DWORD)wcstol(val, NULL, 10); break; case DBVT_TCHAR: @@ -245,11 +245,11 @@ void CEditCtrl::OnChangedByUser(WORD wChangedMsg) LPTSTR szText; __try { - szText = (LPTSTR)alloca((cch + 1) * sizeof(TCHAR)); + szText = (LPTSTR)alloca((cch + 1) * sizeof(wchar_t)); } __except (EXCEPTION_EXECUTE_HANDLER) { - szText = (LPTSTR)mir_alloc((cch + 1) * sizeof(TCHAR)); + szText = (LPTSTR)mir_alloc((cch + 1) * sizeof(wchar_t)); need_free = 1; } @@ -278,11 +278,11 @@ void CEditCtrl::OpenUrl() BYTE need_free = 0; __try { - szUrl = (LPTSTR)alloca((8 + lenUrl) * sizeof(TCHAR)); + szUrl = (LPTSTR)alloca((8 + lenUrl) * sizeof(wchar_t)); } __except (EXCEPTION_EXECUTE_HANDLER) { - szUrl = (LPTSTR)mir_alloc((8 + lenUrl) * sizeof(TCHAR)); + szUrl = (LPTSTR)mir_alloc((8 + lenUrl) * sizeof(wchar_t)); need_free = 1; } @@ -315,17 +315,17 @@ LRESULT CEditCtrl::LinkNotificationHandler(ENLINK* lnk) tr.chrg = lnk->chrg; __try { - tr.lpstrText = (LPTSTR)alloca((tr.chrg.cpMax - tr.chrg.cpMin + 8) * sizeof(TCHAR)); + tr.lpstrText = (LPTSTR)alloca((tr.chrg.cpMax - tr.chrg.cpMin + 8) * sizeof(wchar_t)); } __except (EXCEPTION_EXECUTE_HANDLER) { - tr.lpstrText = (LPTSTR)mir_alloc((tr.chrg.cpMax - tr.chrg.cpMin + 8) * sizeof(TCHAR)); + tr.lpstrText = (LPTSTR)mir_alloc((tr.chrg.cpMax - tr.chrg.cpMin + 8) * sizeof(wchar_t)); need_free = 1; } if (tr.lpstrText && (SendMessage(_hwnd, EM_GETTEXTRANGE, NULL, (LPARAM)&tr) > 0)) { - 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))); } Utils_OpenUrlT(tr.lpstrText); diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index a1c3fb3be8..ede54b4d37 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -234,8 +234,8 @@ class CAnnivList int result;
if (pDlg) {
- TCHAR szText1[MAX_PATH];
- TCHAR szText2[MAX_PATH];
+ wchar_t szText1[MAX_PATH];
+ wchar_t szText2[MAX_PATH];
szText1[0] = szText2[0] = 0;
switch (pDlg->_sortHeader) {
@@ -251,7 +251,7 @@ class CAnnivList case COLUMN_ETA:
ListView_GetItemText(pDlg->_hList, iItem1, pDlg->_sortHeader, szText1, _countof(szText1));
ListView_GetItemText(pDlg->_hList, iItem2, pDlg->_sortHeader, szText2, _countof(szText2));
- result = pDlg->_sortOrder * (_ttoi(szText1) - _ttoi(szText2));
+ result = pDlg->_sortOrder * (_wtoi(szText1) - _wtoi(szText2));
break;
case COLUMN_DATE:
@@ -314,12 +314,12 @@ class CAnnivList ListView_SetExtendedListViewStyle(pDlg->_hList, LVS_EX_FULLROWSELECT);
// add columns
- if (pDlg->AddColumn(CAnnivList::COLUMN_ETA, LPGENT("ETA"), 40)
- || pDlg->AddColumn(CAnnivList::COLUMN_CONTACT, LPGENT("Contact"), 160)
- || pDlg->AddColumn(CAnnivList::COLUMN_PROTO, LPGENT("Proto"), 50)
- || pDlg->AddColumn(CAnnivList::COLUMN_AGE, LPGENT("Age/Nr."), 40)
- || pDlg->AddColumn(CAnnivList::COLUMN_DESC, LPGENT("Anniversary"), 100)
- || pDlg->AddColumn(CAnnivList::COLUMN_DATE, LPGENT("Date"), 80))
+ if (pDlg->AddColumn(CAnnivList::COLUMN_ETA, LPGENW("ETA"), 40)
+ || pDlg->AddColumn(CAnnivList::COLUMN_CONTACT, LPGENW("Contact"), 160)
+ || pDlg->AddColumn(CAnnivList::COLUMN_PROTO, LPGENW("Proto"), 50)
+ || pDlg->AddColumn(CAnnivList::COLUMN_AGE, LPGENW("Age/Nr."), 40)
+ || pDlg->AddColumn(CAnnivList::COLUMN_DESC, LPGENW("Anniversary"), 100)
+ || pDlg->AddColumn(CAnnivList::COLUMN_DATE, LPGENW("Date"), 80))
break;
TranslateDialogDefault(hDlg);
@@ -666,7 +666,7 @@ class CAnnivList **/
BYTE AddRow(MCONTACT hContact, LPCSTR pszProto, MAnnivDate &ad, MTime &mtNow, WORD wDaysBefore)
{
- TCHAR szText[MAX_PATH];
+ wchar_t szText[MAX_PATH];
int diff, iItem = -1;
CItemData *pdata;
@@ -688,7 +688,7 @@ class CAnnivList if (!pdata)
return FALSE;
// add item
- iItem = AddItem(_itot(diff, szText, 10), (LPARAM)pdata);
+ iItem = AddItem(_itow(diff, szText, 10), (LPARAM)pdata);
if (iItem == -1) {
delete pdata;
return FALSE;
@@ -698,13 +698,13 @@ class CAnnivList AddSubItem(iItem, COLUMN_CONTACT, DB::Contact::DisplayName(hContact));
// third column: protocol
- TCHAR *ptszProto = mir_a2t(pszProto);
+ wchar_t *ptszProto = mir_a2t(pszProto);
AddSubItem(iItem, COLUMN_PROTO, ptszProto);
mir_free(ptszProto);
// forth line: age
if (ad.Age(&mtNow))
- AddSubItem(iItem, COLUMN_AGE, _itot(ad.Age(&mtNow), szText, 10));
+ AddSubItem(iItem, COLUMN_AGE, _itow(ad.Age(&mtNow), szText, 10));
else
AddSubItem(iItem, COLUMN_AGE, L"???");
diff --git a/plugins/UserInfoEx/src/dlg_msgbox.cpp b/plugins/UserInfoEx/src/dlg_msgbox.cpp index 8cb11462e3..a3b3444e43 100644 --- a/plugins/UserInfoEx/src/dlg_msgbox.cpp +++ b/plugins/UserInfoEx/src/dlg_msgbox.cpp @@ -322,9 +322,9 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_OKCANCEL:
retOk = IDRETRY;
- SetDlgItemText(hDlg, IDOK, LPGENT("OK"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("OK"));
retCancel = IDCANCEL;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("Cancel"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("Cancel"));
rcOk.left = dlgMid - okWidth - 10;
rcOk.right = rcOk.left + okWidth;
rcCancel.left = dlgMid + 10;
@@ -335,9 +335,9 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_RETRYCANCEL:
retOk = IDRETRY;
- SetDlgItemText(hDlg, IDOK, LPGENT("Retry"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("Retry"));
retCancel = IDCANCEL;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("Cancel"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("Cancel"));
rcOk.left = dlgMid - okWidth - 10;
rcOk.right = rcOk.left + okWidth;
rcCancel.left = dlgMid + 10;
@@ -348,9 +348,9 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_YESNO:
retOk = IDYES;
- SetDlgItemText(hDlg, IDOK, LPGENT("Yes"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("Yes"));
retCancel = IDNO;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("No"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("No"));
rcOk.left = dlgMid - okWidth - 10;
rcOk.right = rcOk.left + okWidth;
rcCancel.left = dlgMid + 10;
@@ -361,11 +361,11 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_ABORTRETRYIGNORE:
retOk = IDABORT;
- SetDlgItemText(hDlg, IDOK, LPGENT("Abort"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("Abort"));
retAll = IDABORT;
- SetDlgItemText(hDlg, IDALL, LPGENT("Retry"));
+ SetDlgItemText(hDlg, IDALL, LPGENW("Retry"));
retCancel = IDCANCEL;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("Ignore"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("Ignore"));
rcAll.left = dlgMid - (allWidth / 2);
rcAll.right = rcAll.left + allWidth;
rcOk.left = rcAll.left - okWidth - 5;
@@ -379,11 +379,11 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_YESNOCANCEL:
retOk = IDYES;
- SetDlgItemText(hDlg, IDOK, LPGENT("Yes"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("Yes"));
retAll = IDNO;
- SetDlgItemText(hDlg, IDALL, LPGENT("No"));
+ SetDlgItemText(hDlg, IDALL, LPGENW("No"));
retCancel = IDCANCEL;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("Cancel"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("Cancel"));
rcAll.left = dlgMid - (allWidth / 2);
rcAll.right = rcAll.left + allWidth;
rcOk.left = rcAll.left - okWidth - 5;
@@ -397,13 +397,13 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_YESALLNO:
retOk = IDYES;
- SetDlgItemText(hDlg, IDOK, LPGENT("Yes"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("Yes"));
retAll = IDALL;
- SetDlgItemText(hDlg, IDALL, LPGENT("All"));
+ SetDlgItemText(hDlg, IDALL, LPGENW("All"));
//retNon = IDNONE;
- SetDlgItemText(hDlg, IDNONE, LPGENT("None"));
+ SetDlgItemText(hDlg, IDNONE, LPGENW("None"));
retCancel = IDNO;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("No"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("No"));
rcCancel.right = rcDlg.right - rcDlg.left - 10;
rcCancel.left = rcCancel.right - caWidth;
rcNone.right = rcCancel.left - 5;
@@ -660,7 +660,7 @@ INT_PTR MsgBoxService(WPARAM, LPARAM lParam) **/
INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszInfo, LPCTSTR pszFormat, ...)
{
- TCHAR tszMsg[MAX_SECONDLINE];
+ wchar_t tszMsg[MAX_SECONDLINE];
va_list vl;
va_start(vl, pszFormat);
@@ -686,7 +686,7 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI **/
INT_PTR CALLBACK MsgErr(HWND hParent, LPCTSTR pszFormat, ...)
{
- TCHAR tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE];
+ wchar_t tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE];
mir_sntprintf(tszTitle, L"%s - %s", _T(MODNAME), TranslateT("Error"));
va_list vl;
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index c03a5a75db..b70724c993 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -268,7 +268,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM) metrics.x = GetSystemMetrics(SM_CXSMICON);
metrics.y = GetSystemMetrics(SM_CYSMICON);
if ((psh._hImages = ImageList_Create(metrics.x, metrics.y, ILC_COLOR32 | ILC_MASK, 0, 1)) == NULL) {
- MsgErr(NULL, LPGENT("Creating the image list failed!"));
+ MsgErr(NULL, LPGENW("Creating the image list failed!"));
return 1;
}
@@ -291,7 +291,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM) // get contact's protocol
psh._pszPrefix = psh._pszProto = Proto_GetBaseAccountName(wParam);
if (psh._pszProto == NULL) {
- MsgErr(NULL, LPGENT("Could not find contact's protocol. Maybe it is not active!"));
+ MsgErr(NULL, LPGENW("Could not find contact's protocol. Maybe it is not active!"));
return 1;
}
// prepare scanning for metacontact's subcontact's pages
@@ -302,7 +302,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM) // add the pages
NotifyEventHooks(g_hDetailsInitEvent, (WPARAM)&psh, wParam);
if (!psh._pPages || !psh._numPages) {
- MsgErr(NULL, LPGENT("No pages have been added. Canceling dialog creation!"));
+ MsgErr(NULL, LPGENW("No pages have been added. Canceling dialog creation!"));
return 1;
}
@@ -330,7 +330,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM) // create the dialog itself
if (!CreateDialogParam(ghInst, MAKEINTRESOURCE(IDD_DETAILS), NULL, DlgProc, (LPARAM)&psh))
- MsgErr(NULL, LPGENT("Details dialog failed to be created. Returning error is %d."), GetLastError());
+ MsgErr(NULL, LPGENW("Details dialog failed to be created. Returning error is %d."), GetLastError());
return 0;
}
@@ -356,7 +356,7 @@ static INT_PTR AddPage(WPARAM wParam, LPARAM lParam) if (pPsh->_dwFlags & (PSF_PROTOPAGESONLY | PSF_PROTOPAGESONLY_INIT)) {
BYTE bIsUnicode = (odp->flags & ODPF_UNICODE) == ODPF_UNICODE;
- TCHAR *ptszTitle = bIsUnicode ? mir_tstrdup(odp->ptszTitle) : mir_a2t(odp->pszTitle);
+ wchar_t *ptszTitle = bIsUnicode ? mir_tstrdup(odp->pwszTitle) : mir_a2t(odp->pszTitle);
// avoid adding pages for a meta subcontact, which have been added for a metacontact.
if (pPsh->_dwFlags & PSF_PROTOPAGESONLY) {
@@ -428,65 +428,65 @@ static int OnShutdown(WPARAM, LPARAM) **/
static int AddProtocolPages(OPTIONSDIALOGPAGE& odp, WPARAM wParam, LPSTR pszProto = NULL)
{
- TCHAR szTitle[MAX_PATH];
+ wchar_t szTitle[MAX_PATH];
const BYTE ofs = (pszProto) ? mir_sntprintf(szTitle, L"%S\\", pszProto) : 0;
- odp.ptszTitle = szTitle;
+ odp.pwszTitle = szTitle;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_GENERAL);
odp.position = 0x8000000;
odp.pfnDlgProc = PSPProcGeneral;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_GENERAL);
- mir_tstrncpy(szTitle + ofs, LPGENT("General"), _countof(szTitle) - ofs);
+ mir_tstrncpy(szTitle + ofs, LPGENW("General"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ADDRESS);
odp.position = 0x8000001;
odp.pfnDlgProc = PSPProcContactHome;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_ADDRESS);
- mir_tstrncpy(szTitle + ofs, LPGENT("General") L"\\" LPGENT("Contact (private)"), _countof(szTitle) - ofs);
+ mir_tstrncpy(szTitle + ofs, LPGENW("General") L"\\" LPGENW("Contact (private)"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ORIGIN);
odp.position = 0x8000002;
odp.pfnDlgProc = PSPProcOrigin;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_ADVANCED);
- mir_tstrncpy(szTitle + ofs, LPGENT("General") L"\\" LPGENT("Origin"), _countof(szTitle) - ofs);
+ mir_tstrncpy(szTitle + ofs, LPGENW("General") L"\\" LPGENW("Origin"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ANNIVERSARY);
odp.position = 0x8000003;
odp.pfnDlgProc = PSPProcAnniversary;
odp.hIcon = (HICON)ICONINDEX(IDI_BIRTHDAY);
- mir_tstrncpy(szTitle + ofs, LPGENT("General") L"\\" LPGENT("Anniversaries"), _countof(szTitle) - ofs);
+ mir_tstrncpy(szTitle + ofs, LPGENW("General") L"\\" LPGENW("Anniversaries"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_COMPANY);
odp.position = 0x8000004;
odp.pfnDlgProc = PSPProcCompany;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_COMPANY);
- mir_tstrncpy(szTitle + ofs, LPGENT("Work"), _countof(szTitle) - ofs);
+ mir_tstrncpy(szTitle + ofs, LPGENW("Work"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ADDRESS);
odp.position = 0x8000005;
odp.pfnDlgProc = PSPProcContactWork;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_ADDRESS);
- mir_tstrncpy(szTitle + ofs, LPGENT("Work") L"\\" LPGENT("Contact (work)"), _countof(szTitle) - ofs);
+ mir_tstrncpy(szTitle + ofs, LPGENW("Work") L"\\" LPGENW("Contact (work)"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ABOUT);
odp.position = 0x8000006;
odp.pfnDlgProc = PSPProcAbout;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_ABOUT);
- mir_tstrncpy(szTitle + ofs, LPGENT("About"), _countof(szTitle) - ofs);
+ mir_tstrncpy(szTitle + ofs, LPGENW("About"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_PROFILE);
odp.position = 0x8000007;
odp.pfnDlgProc = PSPProcContactProfile;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_PROFILE);
- mir_tstrncpy(szTitle + ofs, LPGENT("About") L"\\" LPGENT("Profile"), _countof(szTitle) - ofs);
+ mir_tstrncpy(szTitle + ofs, LPGENW("About") L"\\" LPGENW("Profile"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
return 0;
}
@@ -508,16 +508,16 @@ static int InitDetails(WPARAM wParam, LPARAM lParam) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = ghInst;
odp.flags = ODPF_ICON | ODPF_TCHAR;
- odp.ptszGroup = IcoLib_GetDefaultIconFileName();
+ odp.pwszGroup = IcoLib_GetDefaultIconFileName();
if (lParam) {
// ignore common pages for weather contacts
if (!pPsh->_pszProto || _stricmp(pPsh->_pszProto, "weather")) {
AddProtocolPages(odp, wParam);
- odp.ptszTitle = LPGENT("About") L"\\" LPGENT("Notes");
+ odp.pwszTitle = LPGENW("About") L"\\" LPGENW("Notes");
}
else
- odp.ptszTitle = LPGENT("Notes");
+ odp.pwszTitle = LPGENW("Notes");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ABOUT);
odp.position = 0x8000008;
@@ -1218,9 +1218,9 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar }
else if (ack->result == ACKRESULT_FAILED) {
MsgBox(hDlg, MB_ICON_WARNING,
- LPGENT("Upload ICQ details"),
- LPGENT("Upload failed"),
- LPGENT("Your details were not uploaded successfully.\nThey were written to database only."));
+ LPGENW("Upload ICQ details"),
+ LPGENW("Upload failed"),
+ LPGENW("Your details were not uploaded successfully.\nThey were written to database only."));
KillTimer(hDlg, TIMERID_UPDATING);
ShowWindow(GetDlgItem(hDlg, TXT_UPDATING), SW_HIDE);
DlgProc(hDlg, M_CHECKONLINE, NULL, NULL);
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.h b/plugins/UserInfoEx/src/dlg_propsheet.h index 8e28a102cc..f2e1d88871 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.h +++ b/plugins/UserInfoEx/src/dlg_propsheet.h @@ -226,7 +226,7 @@ public: WORD _numPages; // number of pages
DWORD _dwFlags; // some option flags
HIMAGELIST _hImages; // the imagelist with all tree item icons
- LIST<TCHAR> _ignore; // list of to skipp items when adding metasubcontacts pages
+ LIST<wchar_t> _ignore; // list of to skipp items when adding metasubcontacts pages
int _nSubContact; // index of a current subcontact
CPsHdr();
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp index 27c15f4d03..96cd972f8c 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp @@ -477,8 +477,8 @@ BYTE CExImContactBase::isHandle(MCONTACT hContact) if (dbv.type == DBVT_UTF8 && dbv.pszVal && !mir_strcmpi(dbv.pszVal,_pszNick)) { LPTSTR ptszNick = mir_utf8decodeT(_pszNick); LPTSTR ptszProto = mir_a2t(_pszProto); - int ans = MsgBox(NULL, MB_ICONQUESTION|MB_YESNO, LPGENT("Question"), LPGENT("contact identification"), - LPGENT("The contact %s(%s) has no unique ID in the vCard,\nbut there is a contact in your contact list with the same nick and protocol.\nDo you wish to use this contact?"), + int ans = MsgBox(NULL, MB_ICONQUESTION|MB_YESNO, LPGENW("Question"), LPGENW("contact identification"), + LPGENW("The contact %s(%s) has no unique ID in the vCard,\nbut there is a contact in your contact list with the same nick and protocol.\nDo you wish to use this contact?"), ptszNick, ptszProto); MIR_FREE(ptszNick); MIR_FREE(ptszProto); diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index 39e31af3ab..e75750654f 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -603,9 +603,9 @@ int CExImContactXML::ImportContact() // ask to delete new incomplete contact
if (_isNewContact && _hContact != NULL) {
int result = MsgBox(NULL, MB_YESNO|MB_ICONWARNING,
- LPGENT("Question"),
- LPGENT("Importing a new contact was aborted!"),
- LPGENT("You aborted import of a new contact.\nSome information may be missing for this contact.\n\nDo you want to delete the incomplete contact?"));
+ LPGENW("Question"),
+ LPGENW("Importing a new contact was aborted!"),
+ LPGENW("You aborted import of a new contact.\nSome information may be missing for this contact.\n\nDo you want to delete the incomplete contact?"));
if (result == IDYES) {
DB::Contact::Delete(_hContact);
_hContact = INVALID_CONTACT_ID;
@@ -742,9 +742,9 @@ int CExImContactXML::ImportMetaSubContact(CExImContactXML * pMetaContact) LPTSTR ptszNick = mir_utf8decodeT(_pszNick);
LPTSTR ptszMetaNick = mir_utf8decodeT(pMetaContact->_pszNick);
int result = MsgBox(NULL, MB_YESNO|MB_ICONWARNING,
- LPGENT("Question"),
- LPGENT("Importing a new meta subcontact failed!"),
- LPGENT("The newly created meta subcontact '%s'\ncould not be added to metacontact '%s'!\n\nDo you want to delete this contact?"),
+ LPGENW("Question"),
+ LPGENW("Importing a new meta subcontact failed!"),
+ LPGENW("The newly created meta subcontact '%s'\ncould not be added to metacontact '%s'!\n\nDo you want to delete this contact?"),
ptszNick, ptszMetaNick);
MIR_FREE(ptszNick);
MIR_FREE(ptszMetaNick);
@@ -821,7 +821,7 @@ int CExImContactXML::ImportModule(TiXmlNode* xmlModule) else if (ImportSetting(pszModule, xKey->ToElement()) == ERROR_OK) {
_pXmlFile->_numSettingsDone++;
}
- if (!_pXmlFile->_progress.UpdateSetting(LPGENT("Settings: %S"), pszModule))
+ if (!_pXmlFile->_progress.UpdateSetting(LPGENW("Settings: %S"), pszModule))
return ERROR_ABORTED;
}
// import event
@@ -835,7 +835,7 @@ int CExImContactXML::ImportModule(TiXmlNode* xmlModule) _pXmlFile->_numEventsDuplicated++;
break;
}
- if (!_pXmlFile->_progress.UpdateSetting(LPGENT("Events: %S"), pszModule))
+ if (!_pXmlFile->_progress.UpdateSetting(LPGENW("Events: %S"), pszModule))
return ERROR_ABORTED;
}
} //*end for
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp index 5c43c0a7f1..10c51971b4 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp @@ -196,7 +196,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar // Set the Window Title and description
{
LPCTSTR name = NULL;
- TCHAR oldTitle[MAXDATASIZE],
+ wchar_t oldTitle[MAXDATASIZE],
newTitle[MAXDATASIZE];
switch (pDat->ExImContact->Typ) {
case EXIM_ALL:
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp index e54f06003b..380e238788 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp @@ -106,7 +106,7 @@ static LRESULT CALLBACK PlacesBarSubclassProc(HWND hWnd, UINT uMsg, WPARAM wPara {
if (uMsg == TB_ADDBUTTONS) {
TBBUTTON *tbb = (TBBUTTON *)lParam;
- TCHAR szBtnText[MAX_PATH];
+ wchar_t szBtnText[MAX_PATH];
int iString;
HWND hWndToolTip;
@@ -280,7 +280,7 @@ int DlgExIm_OpenFileName(HWND hWndParent, LPCSTR pszTitle, LPCSTR pszFilter, LPS ofn.Flags |= OFN_PATHMUSTEXIST;
if (!GetOpenFileNameA(&ofn)) {
DWORD dwError = CommDlgExtendedError();
- if (dwError) MsgErr(ofn.hwndOwner, LPGENT("The OpenFileDialog returned an error: %d!"), dwError);
+ if (dwError) MsgErr(ofn.hwndOwner, LPGENW("The OpenFileDialog returned an error: %d!"), dwError);
return -1;
}
SaveInitialDir(pszFile);
@@ -307,7 +307,7 @@ int DlgExIm_SaveFileName(HWND hWndParent, LPCSTR pszTitle, LPCSTR pszFilter, LPS if (!GetSaveFileNameA(&ofn)) {
DWORD dwError = CommDlgExtendedError();
- if (dwError) MsgErr(ofn.hwndOwner, LPGENT("The SaveFileDialog returned an error: %d!"), dwError);
+ if (dwError) MsgErr(ofn.hwndOwner, LPGENW("The SaveFileDialog returned an error: %d!"), dwError);
return -1;
}
SaveInitialDir(pszFile);
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp index 524b3d2169..92981e12d7 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp @@ -187,7 +187,7 @@ BYTE CProgress::UpdateContact(LPCTSTR pszFormat, ...) if (_hDlg != NULL) {
HWND hProg = GetDlgItem(_hDlg, IDC_PROGRESS2);
if (pszFormat) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
va_list vl;
va_start(vl, pszFormat);
@@ -213,8 +213,8 @@ BYTE CProgress::UpdateSetting(LPCTSTR pszFormat, ...) if (_hDlg != NULL) {
HWND hProg = GetDlgItem(_hDlg, IDC_PROGRESS);
if (pszFormat) {
- TCHAR buf[MAX_PATH];
- TCHAR tmp[MAX_PATH];
+ wchar_t buf[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
va_list vl;
va_start(vl, pszFormat);
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp index a45dc00c67..dfc1499a08 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp @@ -172,7 +172,7 @@ int SvcExImINI_Export(lpExImParam ExImContact, LPCSTR pszFileName) if (err != NULL) { MsgErr(NULL, - LPGENT("The ini-file \"%s\"\nfor saving contact information could not be opened."), + LPGENW("The ini-file \"%s\"\nfor saving contact information could not be opened."), pszFileName); return 1; } @@ -500,19 +500,19 @@ int SvcExImINI_Import(MCONTACT hContact, LPCSTR pszFileName) // the contact was not found in the file if (numContactsInFile > 0 && !numContactsAdded) { MsgErr(NULL, - LPGENT("None of the %d contacts, stored in the ini-file, match the selected contact!\nNothing will be imported"), + LPGENW("None of the %d contacts, stored in the ini-file, match the selected contact!\nNothing will be imported"), numContactsInFile); } // Import complete else{ - MsgBox(NULL, MB_ICON_INFO, LPGENT("Import complete"), LPGENT("Some basic statistics"), - LPGENT("Added %d of %d contacts stored in the ini-file."), + MsgBox(NULL, MB_ICON_INFO, LPGENW("Import complete"), LPGENW("Some basic statistics"), + LPGENW("Added %d of %d contacts stored in the ini-file."), numContactsAdded, numContactsInFile); } return 0; } MsgErr(NULL, - LPGENT("The ini-file \"%s\"\nfor reading contact information could not be opened."), + LPGENW("The ini-file \"%s\"\nfor reading contact information could not be opened."), pszFileName); return 1; } diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp index 35975b1abd..30f7151067 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp @@ -107,7 +107,7 @@ int CFileXml::Export(lpExImParam ExImContact, LPCSTR pszFileName) FILE *xmlfile = fopen(pszFileName, "wt");
if (!xmlfile)
{
- MsgErr(NULL, LPGENT("Can't create xml file!\n%S"), pszFileName);
+ MsgErr(NULL, LPGENW("Can't create xml file!\n%S"), pszFileName);
return 1;
}
@@ -183,7 +183,7 @@ int CFileXml::Export(lpExImParam ExImContact, LPCSTR pszFileName) } // *end for
#ifdef _DEBUG
QueryPerformanceCounter(&t2);
- MsgErr(NULL, LPGENT("Export took %f ms"),
+ MsgErr(NULL, LPGENW("Export took %f ms"),
(long double)(t2.QuadPart - t1.QuadPart) / freq.QuadPart * 1000.);
#endif
}// *end other export mode
@@ -255,7 +255,7 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent) // update progressbar and abort if user clicked cancel
LPTSTR pszNick = mir_utf8decodeT(xContact->Attribute("nick"));
// user clicked abort button
- if (_progress.UpdateContact(LPGENT("Contact: %s (%S)"), pszNick, xContact->Attribute("proto"))) {
+ if (_progress.UpdateContact(LPGENW("Contact: %s (%S)"), pszNick, xContact->Attribute("proto"))) {
int result = vContact.LoadXmlElemnt(xContact);
switch (result) {
case ERROR_OK:
@@ -271,7 +271,7 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent) return ERROR_ABORTED;
#ifdef _DEBUG
default:
- MsgErr(NULL, LPGENT("Importing %s caused error %d"), pszNick, result);
+ MsgErr(NULL, LPGENW("Importing %s caused error %d"), pszNick, result);
break;
#endif
}
@@ -282,7 +282,7 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent) return ERROR_ABORTED;
#ifdef _DEBUG
default:
- MsgErr(NULL, LPGENT("Loading contact %s from xml failed with error %d"), pszNick, result);
+ MsgErr(NULL, LPGENW("Loading contact %s from xml failed with error %d"), pszNick, result);
break;
#endif
}
@@ -300,7 +300,7 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent) return ERROR_ABORTED;
#ifdef _DEBUG
default:
- MsgErr(NULL, LPGENT("Importing Owner caused error %d"), result);
+ MsgErr(NULL, LPGENW("Importing Owner caused error %d"), result);
#endif
}
}
@@ -345,19 +345,19 @@ int CFileXml::Import(MCONTACT hContact, LPCSTR pszFileName) // load xml file
TiXmlDocument doc;
if (!doc.LoadFile(pszFileName)) {
- MsgErr(NULL, LPGENT("Parser is unable to load XMLCard \"%s\"\nError: %d\nDescription: %s"),
+ MsgErr(NULL, LPGENW("Parser is unable to load XMLCard \"%s\"\nError: %d\nDescription: %s"),
pszFileName, doc.ErrorId(), doc.ErrorDesc());
return 1;
}
// is xmlfile a XMLCard ?
TiXmlElement *xmlCard = doc.FirstChildElement("XMLCard");
if (xmlCard == NULL) {
- MsgErr(NULL, LPGENT("The selected file is no valid XMLCard"));
+ MsgErr(NULL, LPGENW("The selected file is no valid XMLCard"));
return 1;
}
// check version
if (mir_strcmp(xmlCard->Attribute("ver"), XMLCARD_VERSION)) {
- MsgErr(NULL, LPGENT("The version of the XMLCard is not supported by UserInfoEx"));
+ MsgErr(NULL, LPGENW("The version of the XMLCard is not supported by UserInfoEx"));
return 1;
}
@@ -374,12 +374,12 @@ int CFileXml::Import(MCONTACT hContact, LPCSTR pszFileName) if (!ret) {
MsgBox(NULL, MB_ICONINFORMATION,
- LPGENT("Complete"),
- LPGENT("Import complete"),
- LPGENT("Owner contact successfully imported."));
+ LPGENW("Complete"),
+ LPGENW("Import complete"),
+ LPGENW("Owner contact successfully imported."));
return 0;
} else {
- MsgErr(NULL, LPGENT("Selected XMLCard does not contain an owner contact!"));
+ MsgErr(NULL, LPGENW("Selected XMLCard does not contain an owner contact!"));
return 1;
}
}
@@ -406,12 +406,12 @@ int CFileXml::Import(MCONTACT hContact, LPCSTR pszFileName) #ifdef _DEBUG
QueryPerformanceCounter(&t2);
- MsgErr(NULL, LPGENT("Import took %f ms"),
+ MsgErr(NULL, LPGENW("Import took %f ms"),
(long double)(t2.QuadPart - t1.QuadPart) / freq.QuadPart * 1000.);
#endif
// show results
- MsgBox(NULL, MB_ICONINFORMATION, LPGENT("Import complete"), LPGENT("Some basic statistics"),
- LPGENT("added contacts: %u / %u\nadded settings: %u / %u\nadded events %u / %u\nduplicated events: %u"),
+ MsgBox(NULL, MB_ICONINFORMATION, LPGENW("Import complete"), LPGENW("Some basic statistics"),
+ LPGENW("added contacts: %u / %u\nadded settings: %u / %u\nadded events %u / %u\nduplicated events: %u"),
_numContactsDone, _numContactsTodo,
_numSettingsDone, _numSettingsTodo,
_numEventsDone, _numEventsTodo,
@@ -421,7 +421,7 @@ int CFileXml::Import(MCONTACT hContact, LPCSTR pszFileName) return 0;
}
catch(...) {
- MsgErr(NULL, LPGENT("FATAL: An exception was thrown while importing contacts from xmlCard!"));
+ MsgErr(NULL, LPGENW("FATAL: An exception was thrown while importing contacts from xmlCard!"));
return 1;
}
}
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp index 157094e89e..864129010c 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp @@ -266,7 +266,7 @@ INT_PTR svcExIm_Group_Service(WPARAM wParam, LPARAM) {
ExImParam ExIm;
INT_PTR hItem = 0, hRoot = 0, hParent = 0;
- TCHAR tszGroup[120], tszItem[120];
+ wchar_t tszGroup[120], tszItem[120];
memset(&tszGroup, 0, sizeof(tszGroup));
memset(&tszItem, 0, sizeof(tszItem));
memset(&ExIm, 0, sizeof(ExIm));
diff --git a/plugins/UserInfoEx/src/mir_icolib.cpp b/plugins/UserInfoEx/src/mir_icolib.cpp index 9f39826acd..6cb53675a8 100644 --- a/plugins/UserInfoEx/src/mir_icolib.cpp +++ b/plugins/UserInfoEx/src/mir_icolib.cpp @@ -132,7 +132,7 @@ LPTSTR IcoLib_GetDefaultIconFileName() L"Plugins\\uinfoex_icons.dll",
L"Customize\\Icons\\uinfoex_icons.dll"
};
- TCHAR absolute[MAX_PATH];
+ wchar_t absolute[MAX_PATH];
for (int i = 0; i < _countof(path); i++) {
PathToAbsoluteT(path[i], absolute);
@@ -156,7 +156,7 @@ static void IcoLib_CheckIconPackVersion(LPTSTR szIconPack) {
if (db_get_b(NULL, MODNAME, SET_ICONS_CHECKFILEVERSION, TRUE)) {
if (szIconPack) {
- TCHAR szAbsolutePath[MAX_PATH];
+ wchar_t szAbsolutePath[MAX_PATH];
PathToAbsoluteT(szIconPack, szAbsolutePath);
HMODULE hIconDll = LoadLibrary(szAbsolutePath);
@@ -165,12 +165,12 @@ static void IcoLib_CheckIconPackVersion(LPTSTR szIconPack) if (!LoadStringA(hIconDll, IDS_ICOPACKVERSION, szFileVersion, sizeof(szFileVersion))
|| mir_strcmp(szFileVersion, "__UserInfoEx_IconPack_1.2__"))
- MsgErr(NULL, LPGENT("Warning: Your current IconPack's version differs from the one UserInfoEx is designed for.\nSome icons may not be displayed correctly"));
+ MsgErr(NULL, LPGENW("Warning: Your current IconPack's version differs from the one UserInfoEx is designed for.\nSome icons may not be displayed correctly"));
FreeLibrary(hIconDll);
}
}
else
- MsgErr(NULL, LPGENT("Warning: No IconPack found in one of the following directories: 'customize\\icons', 'icons' or 'plugins'!"));
+ MsgErr(NULL, LPGENW("Warning: No IconPack found in one of the following directories: 'customize\\icons', 'icons' or 'plugins'!"));
}
}
@@ -229,10 +229,10 @@ static HANDLE IcoLib_RegisterIconHandleEx(LPSTR szIconID, LPSTR szDescription, L SKINICONDESC sid = { 0 };
sid.flags = SIDF_ALL_TCHAR;
sid.pszName = szIconID;
- sid.description.t = mir_a2t(szDescription);
- sid.section.t = mir_a2t(szSection);
+ sid.description.w = mir_a2t(szDescription);
+ sid.section.w = mir_a2t(szSection);
- if (sid.description.t && sid.section.t) {
+ if (sid.description.w && sid.section.w) {
switch (Size) {
// small icons (16x16)
case 0:
@@ -252,8 +252,8 @@ static HANDLE IcoLib_RegisterIconHandleEx(LPSTR szIconID, LPSTR szDescription, L break;
}
- sid.defaultFile.t = szDefaultFile;
- if (sid.defaultFile.t && sid.defaultFile.t[0])
+ sid.defaultFile.w = szDefaultFile;
+ if (sid.defaultFile.w && sid.defaultFile.w[0])
sid.iDefaultIndex = -idIcon;
else {
sid.hDefaultIcon = hDefIcon;
@@ -261,8 +261,8 @@ static HANDLE IcoLib_RegisterIconHandleEx(LPSTR szIconID, LPSTR szDescription, L }
hIconHandle = IcoLib_AddIcon(&sid);
}
- MIR_FREE(sid.description.t);
- MIR_FREE(sid.section.t);
+ MIR_FREE(sid.description.w);
+ MIR_FREE(sid.section.w);
}
return hIconHandle;
}
diff --git a/plugins/UserInfoEx/src/mir_icolib.h b/plugins/UserInfoEx/src/mir_icolib.h index 7ac5bd5e36..f6220fda85 100644 --- a/plugins/UserInfoEx/src/mir_icolib.h +++ b/plugins/UserInfoEx/src/mir_icolib.h @@ -24,11 +24,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // sections
#define SECT_COMMON LPGEN("Extended user info")
-#define SECT_ZODIAC "Extended user info/Zodiacs"
-#define SECT_DLG "Extended user info/Dialogs"
-#define SECT_BUTTONS "Extended user info/Buttons"
-#define SECT_TREE "Extended user info/Treeview"
-#define SECT_REMIND "Extended user info/Reminder"
+#define SECT_ZODIAC LPGEN("Extended user info/Zodiacs")
+#define SECT_DLG LPGEN("Extended user info/Dialogs")
+#define SECT_BUTTONS LPGEN("Extended user info/Buttons")
+#define SECT_TREE LPGEN("Extended user info/Treeview")
+#define SECT_REMIND LPGEN("Extended user info/Reminder")
// icons
#define ICO_COMMON_MAIN MODNAME"_common_main"
diff --git a/plugins/UserInfoEx/src/psp_about.cpp b/plugins/UserInfoEx/src/psp_about.cpp index d097a200b6..d19175763e 100644 --- a/plugins/UserInfoEx/src/psp_about.cpp +++ b/plugins/UserInfoEx/src/psp_about.cpp @@ -43,9 +43,9 @@ INT_PTR CALLBACK PSPProcEdit(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam, SendDlgItemMessage(hDlg, IDC_PAGETITLE, WM_SETFONT, (WPARAM)hBoldFont, 0);
if (!mir_strcmp(pszSetting, SET_CONTACT_MYNOTES))
- SetDlgItemText(hDlg, IDC_PAGETITLE, LPGENT("My notes:"));
+ SetDlgItemText(hDlg, IDC_PAGETITLE, LPGENW("My notes:"));
else
- SetDlgItemText(hDlg, IDC_PAGETITLE, LPGENT("About:"));
+ SetDlgItemText(hDlg, IDC_PAGETITLE, LPGENW("About:"));
TranslateDialogDefault(hDlg);
diff --git a/plugins/UserInfoEx/src/psp_anniversary.cpp b/plugins/UserInfoEx/src/psp_anniversary.cpp index 8683a347c7..b1c7514edc 100644 --- a/plugins/UserInfoEx/src/psp_anniversary.cpp +++ b/plugins/UserInfoEx/src/psp_anniversary.cpp @@ -78,10 +78,10 @@ static INT_PTR CALLBACK DlgProc_AnniversaryEditor(HWND hDlg, UINT uMsg, WPARAM w LPTSTR pszText;
if (len == 0
- || (pszText = (LPTSTR)_alloca((len + 1) * sizeof(TCHAR))) == NULL
+ || (pszText = (LPTSTR)_alloca((len + 1) * sizeof(wchar_t))) == NULL
|| !Edit_GetText(hEdit, pszText, len + 1))
{
- MsgErr(hDlg, LPGENT("Please enter a valid description first!"));
+ MsgErr(hDlg, LPGENW("Please enter a valid description first!"));
break;
}
@@ -213,7 +213,7 @@ INT_PTR CALLBACK PSPProcAnniversary(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM if (HIWORD(wParam) == BN_CLICKED && PtrIsValid(pDateCtrl)) {
MAnnivDate *pDate = pDateCtrl->Current();
if (!pDate)
- MsgErr(hDlg, LPGENT("No valid date selected for editing!"));
+ MsgErr(hDlg, LPGENW("No valid date selected for editing!"));
else if (
IDOK == DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_ANNIVERSARY_EDITOR), hDlg, DlgProc_AnniversaryEditor, (LPARAM)pDate) &&
(pDate->Flags() & (MAnnivDate::MADF_CHANGED | MAnnivDate::MADF_REMINDER_CHANGED)))
@@ -232,8 +232,8 @@ INT_PTR CALLBACK PSPProcAnniversary(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM if (HIWORD(wParam) == BN_CLICKED && PtrIsValid(pDateCtrl)) {
MAnnivDate *pCurrent = pDateCtrl->Current();
if (pCurrent) {
- int rc = MsgBox(hDlg, MB_YESNO | MB_ICON_QUESTION | MB_NOPOPUP, LPGENT("Delete"), NULL,
- LPGENT("Do you really want to delete the %s?"), pCurrent->Description());
+ int rc = MsgBox(hDlg, MB_YESNO | MB_ICON_QUESTION | MB_NOPOPUP, LPGENW("Delete"), NULL,
+ LPGENW("Do you really want to delete the %s?"), pCurrent->Description());
if (rc == IDYES)
pDateCtrl->DeleteDate(pDateCtrl->CurrentIndex());
diff --git a/plugins/UserInfoEx/src/psp_contact.cpp b/plugins/UserInfoEx/src/psp_contact.cpp index 997df02d38..2f0f6a9fa0 100644 --- a/plugins/UserInfoEx/src/psp_contact.cpp +++ b/plugins/UserInfoEx/src/psp_contact.cpp @@ -38,7 +38,7 @@ INT_PTR CALLBACK PSPProcContactHome(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM {
CCtrlList *pCtrlList = CCtrlList::CreateObj(hDlg);
if (pCtrlList) {
- TCHAR szAddr[MAX_PATH];
+ wchar_t szAddr[MAX_PATH];
LPIDSTRLIST pList;
UINT nList;
@@ -184,7 +184,7 @@ INT_PTR CALLBACK PSPProcContactWork(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM CCtrlList *pCtrlList = CCtrlList::CreateObj(hDlg);
if (pCtrlList)
{
- TCHAR szAddr[MAX_PATH];
+ wchar_t szAddr[MAX_PATH];
LPIDSTRLIST pList;
UINT nList;
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index 50819e7922..fa6a41a010 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -447,9 +447,9 @@ static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam case BTN_OPT_RESET:
BYTE WantReset = MsgBox(hDlg,
MB_ICON_WARNING | MB_YESNO,
- LPGENT("Question"),
- LPGENT("Reset factory defaults"),
- LPGENT("This will delete all settings, you've made!\nAll TreeView settings, window positions and any other settings!\n\nAre you sure to proceed?"));
+ LPGENW("Question"),
+ LPGENW("Reset factory defaults"),
+ LPGENW("This will delete all settings, you've made!\nAll TreeView settings, window positions and any other settings!\n\nAre you sure to proceed?"));
if (WantReset) {
MCONTACT hContact;
@@ -485,9 +485,9 @@ static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam SendMessage(GetParent(hDlg), PSM_FORCECHANGED, NULL, NULL);
MsgBox(hDlg, MB_ICON_INFO,
- LPGENT("Ready"),
- LPGENT("Everything is done!"),
- LPGENT("All settings are reset to default values now!"));
+ LPGENW("Ready"),
+ LPGENW("Everything is done!"),
+ LPGENW("All settings are reset to default values now!"));
}
}
}
@@ -635,7 +635,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam SendDlgItemMessage(hDlg, EDIT_BIRTHMODULE, CB_SETCURSEL, db_get_b(NULL, MODNAME, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE), NULL);
MTime mtLast;
- TCHAR szTime[MAX_PATH];
+ wchar_t szTime[MAX_PATH];
mtLast.DBGetStamp(NULL, MODNAME, SET_REMIND_LASTCHECK);
mtLast.UTCToLocal();
@@ -868,9 +868,9 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR if (IsDlgButtonChecked(hDlg, RADIO_OPT_POPUP_PERMANENT))
db_set_b(NULL, MODNAME, SET_POPUP_DELAY, 255);
else if (IsDlgButtonChecked(hDlg, RADIO_OPT_POPUP_CUSTOM)) {
- TCHAR szDelay[4];
+ wchar_t szDelay[4];
GetDlgItemText(hDlg, EDIT_DELAY, szDelay, _countof(szDelay));
- db_set_b(NULL, MODNAME, SET_POPUP_DELAY, (BYTE)_tcstol(szDelay, NULL, 10));
+ db_set_b(NULL, MODNAME, SET_POPUP_DELAY, (BYTE)wcstol(szDelay, NULL, 10));
}
else
db_unset(NULL, MODNAME, SET_POPUP_DELAY);
diff --git a/plugins/UserInfoEx/src/psp_origin.cpp b/plugins/UserInfoEx/src/psp_origin.cpp index a2c35c73b2..7dd0f8cc53 100644 --- a/plugins/UserInfoEx/src/psp_origin.cpp +++ b/plugins/UserInfoEx/src/psp_origin.cpp @@ -86,7 +86,7 @@ INT_PTR CALLBACK PSPProcOrigin(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara mt.FromStampAsUTC(dwStamp);
}
if (mt.IsValid()) {
- TCHAR szTime[MAX_PATH];
+ wchar_t szTime[MAX_PATH];
LPTSTR ptr;
mt.UTCToLocal();
@@ -133,7 +133,7 @@ INT_PTR CALLBACK PSPProcOrigin(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara case WM_TIMER:
{
- TCHAR szTime[32];
+ wchar_t szTime[32];
CTzCombo::GetObj(hDlg, EDIT_TIMEZONE)->GetTime(szTime, _countof(szTime));
SetDlgItemText(hDlg, TXT_TIME, szTime);
break;
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp index a2a6917b3c..ead5c48503 100644 --- a/plugins/UserInfoEx/src/psp_profile.cpp +++ b/plugins/UserInfoEx/src/psp_profile.cpp @@ -67,9 +67,9 @@ typedef struct TProfileEntries { } PROFILEENTRY, *LPPROFILEENTRY;
static const PROFILEENTRY pFmt[3] = {
- { LPGENT("Past"), "Past%d", "Past%dText", (MIRANDASERVICE)GetPastList },
- { LPGENT("Affiliation"), "Affiliation%d", "Affiliation%dText", (MIRANDASERVICE)GetAffiliationsList },
- { LPGENT("Interest"), "Interest%dCat", "Interest%dText", (MIRANDASERVICE)GetInterestsList }
+ { LPGENW("Past"), "Past%d", "Past%dText", (MIRANDASERVICE)GetPastList },
+ { LPGENW("Affiliation"), "Affiliation%d", "Affiliation%dText", (MIRANDASERVICE)GetAffiliationsList },
+ { LPGENW("Interest"), "Interest%dCat", "Interest%dText", (MIRANDASERVICE)GetInterestsList }
};
static LRESULT CALLBACK ProfileList_LabelEditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -112,7 +112,7 @@ static int ProfileList_AddGroup(HWND hList, LPTSTR pszText, int iItem) static int ProfileList_GetItemText(HWND hList, int iItem, int iSubItem, LPTSTR pszText, int ccText)
{
LVITEM lvi;
- TCHAR szNull[2];
+ wchar_t szNull[2];
lvi.mask = LVIF_TEXT;
lvi.iItem = iItem;
@@ -223,7 +223,7 @@ static int ProfileList_EndLabelEdit(LPLISTCTRL pList, BYTE bSave) }
// value was edited
else {
- if ((ccText = GetWindowTextLength(hEdit)) > 0 && (szEdit = (LPTSTR)mir_alloc((ccText + 2) * sizeof(TCHAR)))) {
+ if ((ccText = GetWindowTextLength(hEdit)) > 0 && (szEdit = (LPTSTR)mir_alloc((ccText + 2) * sizeof(wchar_t)))) {
GetWindowText(hEdit, szEdit, ccText + 1);
szEdit[ccText + 1] = 0;
@@ -446,7 +446,7 @@ static BYTE ProfileList_AddNewItem(HWND hDlg, LPLISTCTRL pList, const PROFILEENT return TRUE;
}
mir_free(pItem);
- MsgErr(hDlg, LPGENT("Sorry, but there is a problem with adding a new item of type \"%s\""), pEntry->szGroup);
+ MsgErr(hDlg, LPGENW("Sorry, but there is a problem with adding a new item of type \"%s\""), pEntry->szGroup);
}
return FALSE;
}
@@ -907,7 +907,7 @@ static LRESULT CALLBACK ProfileList_SubclassProc(HWND hwnd, UINT msg, WPARAM wPa case BTN_EDIT:
{
int i;
- TCHAR szEdit[MAX_PATH];
+ wchar_t szEdit[MAX_PATH];
if (!PtrIsValid(pList = (LPLISTCTRL)GetUserData(hwnd)))
break;
@@ -1181,7 +1181,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR BYTE iFmt = -1;
int iItem;
LVITEM lvi;
- TCHAR szGroup[MAX_PATH];
+ wchar_t szGroup[MAX_PATH];
CHAR pszSetting[MAXSETTING];
LPLCITEM pItem;
LPSTR pszModule = USERINFO;
@@ -1332,7 +1332,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR ListView_GetItemRect(cd->nmcd.hdr.hwndFrom, cd->nmcd.dwItemSpec, &rc, LVIR_BOUNDS);
if (!PtrIsValid(pItem)) {
HFONT hBold, hFont;
- TCHAR szText[MAX_PATH];
+ wchar_t szText[MAX_PATH];
PSGetBoldFont(hDlg, hBold);
hFont = (HFONT)SelectObject(cd->nmcd.hdc, hBold);
@@ -1412,7 +1412,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR ProfileList_BeginLabelEdit(hList, ListView_GetSelectionMark(hList), 1);
break;
case BTN_DEL:
- if (IDYES == MsgBox(hDlg, MB_YESNO | MB_ICON_QUESTION, LPGENT("Question"), LPGENT("Delete an entry"), LPGENT("Do you really want to delete this entry?"))) {
+ if (IDYES == MsgBox(hDlg, MB_YESNO | MB_ICON_QUESTION, LPGENW("Question"), LPGENW("Delete an entry"), LPGENW("Do you really want to delete this entry?"))) {
int iItem = ListView_GetSelectionMark(hList);
pList = (LPLISTCTRL)GetUserData(hList);
diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp index 73a1dd982a..c47c9c5ac8 100644 --- a/plugins/UserInfoEx/src/svc_email.cpp +++ b/plugins/UserInfoEx/src/svc_email.cpp @@ -100,7 +100,7 @@ static INT_PTR MenuCommand(WPARAM wParam,LPARAM lParam) }
else {
result = 1;
- MsgBox((HWND)lParam, MB_OK, LPGENT("Send e-mail"), NULL, LPGENT("Memory allocation error!"));
+ MsgBox((HWND)lParam, MB_OK, LPGENW("Send e-mail"), NULL, LPGENW("Memory allocation error!"));
}
}
__except(GetExceptionCode()==EXCEPTION_ACCESS_VIOLATION ?
@@ -108,7 +108,7 @@ static INT_PTR MenuCommand(WPARAM wParam,LPARAM lParam) {
mir_free(val);
result = 1;
- MsgErr((HWND)lParam, LPGENT("Memory allocation error!"));
+ MsgErr((HWND)lParam, LPGENW("Memory allocation error!"));
}
return result;
}
diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index 4833e52f12..b844322721 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -115,7 +115,7 @@ public: {
if (szText)
{
- TCHAR buf[MAXDATASIZE];
+ wchar_t buf[MAXDATASIZE];
va_list vl;
va_start(vl, szText);
@@ -144,11 +144,11 @@ public: if (szText)
{
INT_PTR cch = mir_tstrlen(szText);
- LPTSTR fmt = (LPTSTR) mir_alloc((cch + 1) * sizeof(TCHAR));
+ LPTSTR fmt = (LPTSTR) mir_alloc((cch + 1) * sizeof(wchar_t));
if (fmt)
{
- TCHAR buf[MAXDATASIZE];
+ wchar_t buf[MAXDATASIZE];
va_list vl;
mir_tstrcpy(fmt, szText);
@@ -165,13 +165,13 @@ public: // leading bbcode tag (e.g.: [b], [u], [i])
if ((s[1] == 'b' || s[1] == 'u' || s[1] == 'i') && s[2] == ']')
{
- memmove(s, s + 3, (e - s - 2) * sizeof(TCHAR));
+ memmove(s, s + 3, (e - s - 2) * sizeof(wchar_t));
e -= 3;
}
// ending bbcode tag (e.g.: [/b], [/u], [/i])
else if (s[1] == '/' && (s[2] == 'b' || s[2] == 'u' || s[2] == 'i') && s[3] == ']')
{
- memmove(s, s + 4, (e - s - 3) * sizeof(TCHAR));
+ memmove(s, s + 4, (e - s - 3) * sizeof(wchar_t));
e -= 4;
}
}
@@ -346,7 +346,7 @@ class CPopupUpdProgress : public CUpdProgress if (_szText)
{
INT_PTR cb = mir_tstrlen(_szText) + 8;
- LPTSTR pb = (LPTSTR) mir_alloc(cb * sizeof(TCHAR));
+ LPTSTR pb = (LPTSTR) mir_alloc(cb * sizeof(wchar_t));
if (pb)
{
@@ -602,7 +602,7 @@ class CContactUpdater : public CContactQueue // reset menu
if (hMenuItemRefresh)
- Menu_ModifyItem(hMenuItemRefresh, LPGENT("Refresh contact details"), IcoLib_GetIcon(ICO_BTN_UPDATE));
+ Menu_ModifyItem(hMenuItemRefresh, LPGENW("Refresh contact details"), IcoLib_GetIcon(ICO_BTN_UPDATE));
}
/**
@@ -713,7 +713,7 @@ public: // if there are contacts in the queue, change the main menu item to indicate it is meant for canceling.
if (hMenuItemRefresh && Size() > 0)
- Menu_ModifyItem(hMenuItemRefresh, LPGENT("Abort Refreshing Contact Details"), IcoLib_GetIcon(ICO_BTN_CANCEL));
+ Menu_ModifyItem(hMenuItemRefresh, LPGENW("Abort Refreshing Contact Details"), IcoLib_GetIcon(ICO_BTN_CANCEL));
}
/**
@@ -785,20 +785,20 @@ static INT_PTR RefreshService(WPARAM, LPARAM) {
ContactUpdater->RefreshAll();
}
- else if (IDYES == MsgBox(NULL, MB_YESNO|MB_ICON_QUESTION, LPGENT("Refresh contact details"), NULL,
- LPGENT("Do you want to cancel the current refresh procedure?")))
+ else if (IDYES == MsgBox(NULL, MB_YESNO|MB_ICON_QUESTION, LPGENW("Refresh contact details"), NULL,
+ LPGENW("Do you want to cancel the current refresh procedure?")))
{
ContactUpdater->Cancel();
}
}
else
{
- MsgErr(NULL, LPGENT("Miranda must be online for refreshing contact information!"));
+ MsgErr(NULL, LPGENW("Miranda must be online for refreshing contact information!"));
}
}
catch(...)
{
- MsgErr(NULL, LPGENT("The function caused an exception!"));
+ MsgErr(NULL, LPGENW("The function caused an exception!"));
}
return 0;
}
@@ -838,7 +838,7 @@ static int OnContactAdded(WPARAM hContact, LPARAM) }
catch(...)
{
- MsgErr(NULL, LPGENT("The function caused an exception!"));
+ MsgErr(NULL, LPGENW("The function caused an exception!"));
}
return 0;
}
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index de7ee4ee19..700575c708 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -308,7 +308,7 @@ static void NotifyFlashCListIcon(MCONTACT hContact, const CEvent &evt) if (!gRemindOpts.bFlashCList || evt._wDaysLeft != 0)
return;
- TCHAR szMsg[MAX_PATH];
+ wchar_t szMsg[MAX_PATH];
CLISTEVENT cle = {};
cle.hContact = hContact;
@@ -431,7 +431,7 @@ static BYTE CheckAnniversaries(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE tszMsg.Append(L"\n...");
}
- NotifyWithPopup(hContact, CEvent::ANNIVERSARY, Diff, LPGENT("Anniversaries"), tszMsg);
+ NotifyWithPopup(hContact, CEvent::ANNIVERSARY, Diff, LPGENW("Anniversaries"), tszMsg);
}
return numAnniversaries != 0;
@@ -476,7 +476,7 @@ static bool CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNoti }
if (bNotify) {
- TCHAR szMsg[MAXDATASIZE];
+ wchar_t szMsg[MAXDATASIZE];
WORD cchMsg = 0;
switch (Diff) {
diff --git a/plugins/UserInfoEx/src/svc_timezone_old.cpp b/plugins/UserInfoEx/src/svc_timezone_old.cpp index bd08054600..dfc50be0ed 100644 --- a/plugins/UserInfoEx/src/svc_timezone_old.cpp +++ b/plugins/UserInfoEx/src/svc_timezone_old.cpp @@ -176,7 +176,7 @@ public: hKeyTz;
DWORD i,
cbData;
- TCHAR szName[MAX_PATH],
+ wchar_t szName[MAX_PATH],
szDisplay[MAX_PATH];
CTimeZone *pTimeZone;
diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index 0ab768ffd4..416cc360c8 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -22,7 +22,7 @@ struct _tagType
{
int cnfCode;
- TCHAR* str;
+ wchar_t* str;
}
static builtinCnfs[] =
{
@@ -77,7 +77,7 @@ static builtinCnfs[] = struct CONTACTCE
{
int flags;
- TCHAR* tszContact;
+ wchar_t* tszContact;
MCONTACT hContact;
};
@@ -94,7 +94,7 @@ static OBJLIST<CONTACTCE> arContactCache(20, SortContactCache); static mir_cs csContactCache;
// converts a string into a CNF_ type
-BYTE getContactInfoType(TCHAR* type)
+BYTE getContactInfoType(wchar_t* type)
{
if (type == NULL || mir_tstrlen(type) == 0)
return 0;
@@ -107,7 +107,7 @@ BYTE getContactInfoType(TCHAR* type) }
// returns info about a contact as a string
-TCHAR* getContactInfoT(BYTE type, MCONTACT hContact)
+wchar_t* getContactInfoT(BYTE type, MCONTACT hContact)
{
/* returns dynamic allocated buffer with info, or NULL if failed */
if (hContact == NULL)
@@ -117,7 +117,7 @@ TCHAR* getContactInfoT(BYTE type, MCONTACT hContact) if (szProto == NULL)
return NULL;
- TCHAR *res = NULL;
+ wchar_t *res = NULL;
switch (type) {
case CCNF_PROTOID:
return mir_a2t(szProto);
@@ -168,7 +168,7 @@ TCHAR* getContactInfoT(BYTE type, MCONTACT hContact) }
// MS_VARS_GETCONTACTFROMSTRING
-MCONTACT getContactFromString(const TCHAR *tszContact, DWORD dwFlags, int nMatch)
+MCONTACT getContactFromString(const wchar_t *tszContact, DWORD dwFlags, int nMatch)
{
/* service to retrieve a contact's HANDLE from a given string */
if (tszContact == NULL || *tszContact == 0)
@@ -183,7 +183,7 @@ MCONTACT getContactFromString(const TCHAR *tszContact, DWORD dwFlags, int nMatch // search the cache
{
- CONTACTCE tmp = { dwFlags, (TCHAR*)tszContact, 0 };
+ CONTACTCE tmp = { dwFlags, (wchar_t*)tszContact, 0 };
mir_cslock lck(csContactCache);
CONTACTCE *p = arContactCache.find(&tmp);
@@ -355,18 +355,18 @@ int deinitContactModule() // returns a string in the form <PROTOID:UNIQUEID>, cannot be _HANDLE_!
// result must be freed
-TCHAR* encodeContactToString(MCONTACT hContact)
+wchar_t* encodeContactToString(MCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (szProto == NULL)
return NULL;
- TCHAR *tszUniqueId = getContactInfoT(CNF_UNIQUEID, hContact);
+ wchar_t *tszUniqueId = getContactInfoT(CNF_UNIQUEID, hContact);
if (tszUniqueId == NULL)
return NULL;
size_t size = mir_tstrlen(tszUniqueId) + mir_strlen(szProto) + 4;
- TCHAR *tszResult = (TCHAR *)mir_calloc(size * sizeof(TCHAR));
+ wchar_t *tszResult = (wchar_t *)mir_calloc(size * sizeof(wchar_t));
if (tszResult)
mir_sntprintf(tszResult, size, L"<%S:%s>", szProto, tszUniqueId);
return tszResult;
diff --git a/plugins/Variables/src/contact.h b/plugins/Variables/src/contact.h index 55e292677c..b145a48f4f 100644 --- a/plugins/Variables/src/contact.h +++ b/plugins/Variables/src/contact.h @@ -96,4 +96,4 @@ // CNF_ type possible
#define CI_NEEDCOUNT 0x80000000 // returns contacts count
-TCHAR *encodeContactToString(MCONTACT hContact);
+wchar_t *encodeContactToString(MCONTACT hContact);
diff --git a/plugins/Variables/src/help.cpp b/plugins/Variables/src/help.cpp index 842695deb3..57d5ad1e0c 100644 --- a/plugins/Variables/src/help.cpp +++ b/plugins/Variables/src/help.cpp @@ -129,7 +129,7 @@ static INT_PTR CALLBACK clistDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM MCONTACT hItem, hContact = wParam; log_debugA("VARM_SETSUBJECT: %u", hContact); if (hContact == INVALID_CONTACT_ID) { - TCHAR *tszContact = db_get_tsa(NULL, MODULENAME, SETTING_SUBJECT); + wchar_t *tszContact = db_get_tsa(NULL, MODULENAME, SETTING_SUBJECT); log_debugA("VARM_SETSUBJECT: %s", tszContact); if (tszContact != NULL) { hContact = getContactFromString(tszContact, CI_PROTOID); @@ -202,7 +202,7 @@ static INT_PTR CALLBACK clistDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM MCONTACT hContact = (MCONTACT)SendMessage(hwndDlg, VARM_GETSUBJECT, 0, 0); if (hContact != NULL) { - TCHAR *tszContact = encodeContactToString(hContact); + wchar_t *tszContact = encodeContactToString(hContact); if (tszContact != NULL) { db_set_ts(NULL, MODULENAME, SETTING_SUBJECT, tszContact); mir_free(tszContact); @@ -214,7 +214,7 @@ static INT_PTR CALLBACK clistDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM } // dialog box for the tokens -static TCHAR *getTokenCategory(TOKENREGISTEREX *tr) { +static wchar_t *getTokenCategory(TOKENREGISTEREX *tr) { if (tr == NULL) { return NULL; } @@ -228,20 +228,20 @@ static TCHAR *getTokenCategory(TOKENREGISTEREX *tr) { *cur = 0; helpText = ( char* )mir_realloc(helpText, mir_strlen(helpText)+1); - TCHAR *res = mir_a2t(helpText); + wchar_t *res = mir_a2t(helpText); mir_free(helpText); return res; } cur++; } - TCHAR *res = mir_a2t(helpText); + wchar_t *res = mir_a2t(helpText); mir_free(helpText); return res; } -static TCHAR *getHelpDescription(TOKENREGISTEREX *tr) +static wchar_t *getHelpDescription(TOKENREGISTEREX *tr) { if (tr == NULL) return NULL; @@ -251,7 +251,7 @@ static TCHAR *getHelpDescription(TOKENREGISTEREX *tr) if (*cur == '\t') { cur = mir_strdup(cur+1); - TCHAR *res = mir_a2t(cur); + wchar_t *res = mir_a2t(cur); mir_free(cur); return res; @@ -263,7 +263,7 @@ static TCHAR *getHelpDescription(TOKENREGISTEREX *tr) } -static TCHAR *getTokenDescription(TOKENREGISTEREX *tr) +static wchar_t *getTokenDescription(TOKENREGISTEREX *tr) { if (tr == NULL) return NULL; @@ -276,7 +276,7 @@ static TCHAR *getTokenDescription(TOKENREGISTEREX *tr) return NULL; char *cur = helpText; - TCHAR *tArgs = NULL; + wchar_t *tArgs = NULL; char *args = NULL, *first = NULL, *second = NULL; while (*cur != 0) { if (*cur == '\t') { @@ -295,7 +295,7 @@ static TCHAR *getTokenDescription(TOKENREGISTEREX *tr) else args = NULL; size_t len = mir_tstrlen(tr->tszTokenString) + (args!=NULL?mir_strlen(args):0) + 3; - TCHAR *desc = (TCHAR*)mir_calloc(len * sizeof(TCHAR)); + wchar_t *desc = (wchar_t*)mir_calloc(len * sizeof(wchar_t)); if (desc == NULL) { mir_free(helpText); return NULL; @@ -344,7 +344,7 @@ static BOOL CALLBACK processTokenListMessage(HWND hwndDlg, UINT msg, WPARAM, LPA case WM_INITDIALOG: { TOKENREGISTEREX *tr; - TCHAR *tszTokenDesc, *tszHelpDesc, *last, *cat, *text; + wchar_t *tszTokenDesc, *tszHelpDesc, *last, *cat, *text; // token list things HWND hList = GetDlgItem(hwndDlg, IDC_TOKENLIST); @@ -465,11 +465,11 @@ static BOOL CALLBACK processTokenListMessage(HWND hwndDlg, UINT msg, WPARAM, LPA break; size_t len = mir_tstrlen(tr->tszTokenString) + 2; - TCHAR *tokenString = (TCHAR*)mir_alloc((len+1)*sizeof(TCHAR)); + wchar_t *tokenString = (wchar_t*)mir_alloc((len+1)*sizeof(wchar_t)); if (tokenString == NULL) break; - memset(tokenString, 0, ((len + 1) * sizeof(TCHAR))); + memset(tokenString, 0, ((len + 1) * sizeof(wchar_t))); mir_sntprintf(tokenString, len + 1, L"%c%s%c", (tr->flags & TRF_FIELD) ? FIELD_CHAR : FUNC_CHAR, tr->tszTokenString, (tr->flags & TRF_FIELD) ? FIELD_CHAR : '('); SendDlgItemMessage(hwndInputDlg, IDC_TESTSTRING, EM_REPLACESEL, TRUE, (LPARAM)tokenString); mir_free(tokenString); @@ -673,18 +673,18 @@ static INT_PTR CALLBACK inputDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM case VARM_PARSE: { - TCHAR *string = Hlp_GetDlgItemText(hwndDlg, IDC_TESTSTRING), *extraText; + wchar_t *string = Hlp_GetDlgItemText(hwndDlg, IDC_TESTSTRING), *extraText; int len = SendMessage(GetParent(hwndDlg), VARM_GETEXTRATEXTLENGTH, 0, 0); if (len > 0) { - extraText = (TCHAR*)mir_calloc((len + 1)* sizeof(TCHAR)); + extraText = (wchar_t*)mir_calloc((len + 1)* sizeof(wchar_t)); SendMessage(GetParent(hwndDlg), VARM_GETEXTRATEXT, (WPARAM)len + 1, (LPARAM)extraText); } else extraText = NULL; if (string != NULL) { - TCHAR *newString = variables_parsedup(string, extraText, (MCONTACT)SendMessage(GetParent(hwndDlg), VARM_GETSUBJECT, 0, 0)); + wchar_t *newString = variables_parsedup(string, extraText, (MCONTACT)SendMessage(GetParent(hwndDlg), VARM_GETSUBJECT, 0, 0)); if (newString != NULL) { - TCHAR *oldString = Hlp_GetDlgItemText(hwndDlg, IDC_RESULT); + wchar_t *oldString = Hlp_GetDlgItemText(hwndDlg, IDC_RESULT); if (oldString == NULL || mir_tstrcmp(oldString, newString)) SetDlgItemText(hwndDlg, IDC_RESULT, newString); @@ -819,7 +819,7 @@ static INT_PTR CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM l } } else if (dat->vhs->hwndCtrl != NULL) { - TCHAR *tszText = Hlp_GetWindowText(dat->vhs->hwndCtrl); + wchar_t *tszText = Hlp_GetWindowText(dat->vhs->hwndCtrl); if (tszText != NULL) { SendMessage(hwndDlg, VARM_SETINPUTTEXT, 0, (LPARAM)tszText); mir_free(tszText); @@ -908,7 +908,7 @@ static INT_PTR CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM l if (len > 0) { if ((dat->vhs->fi != NULL) && (!(dat->vhs->flags&VHF_DONTFILLSTRUCT))) { if (dat->vhs->fi->flags&FIF_UNICODE) { - dat->vhs->fi->tszFormat = (TCHAR*)mir_calloc((len + 1)*sizeof(WCHAR)); + dat->vhs->fi->tszFormat = (wchar_t*)mir_calloc((len + 1)*sizeof(WCHAR)); SendMessage(hwndDlg, VARM_GETINPUTTEXT, (WPARAM)len + 1, (LPARAM)dat->vhs->fi->tszFormat); } else { @@ -922,9 +922,9 @@ static INT_PTR CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM l if (dat->vhs->hwndCtrl != NULL) { int len = SendMessage(hwndDlg, VARM_GETINPUTTEXTLENGTH, 0, 0); if (len > 0) { - TCHAR *tszText; + wchar_t *tszText; - tszText = (TCHAR*)mir_calloc((len + 1)*sizeof(TCHAR)); + tszText = (wchar_t*)mir_calloc((len + 1)*sizeof(wchar_t)); if (tszText != NULL) { SendMessage(hwndDlg, VARM_GETINPUTTEXT, (WPARAM)len + 1, (LPARAM)tszText); SetWindowText(dat->vhs->hwndCtrl, tszText); @@ -942,7 +942,7 @@ static INT_PTR CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM l int len = SendMessage(hwndDlg, VARM_GETEXTRATEXTLENGTH, 0, 0); if (len > 0) { if (dat->vhs->fi->flags&FIF_UNICODE) { - dat->vhs->fi->tszExtraText = (TCHAR*)mir_calloc((len + 1)*sizeof(WCHAR)); + dat->vhs->fi->tszExtraText = (wchar_t*)mir_calloc((len + 1)*sizeof(WCHAR)); SendMessage(hwndDlg, VARM_GETEXTRATEXT, (WPARAM)len + 1, (LPARAM)dat->vhs->fi->tszExtraText); } else { diff --git a/plugins/Variables/src/options.cpp b/plugins/Variables/src/options.cpp index bb381ef238..d07ad89999 100644 --- a/plugins/Variables/src/options.cpp +++ b/plugins/Variables/src/options.cpp @@ -85,7 +85,7 @@ static INT_PTR CALLBACK SetOptsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA if (((LPNMHDR)lParam)->code == PSN_APPLY) {
int len = SendDlgItemMessage(hwndDlg, IDC_FORMATTEXT, WM_GETTEXTLENGTH, 0, 0);
if (len >= 0) {
- TCHAR *szFormatText = (TCHAR*)mir_calloc((len+1)* sizeof(TCHAR));
+ wchar_t *szFormatText = (wchar_t*)mir_calloc((len+1)* sizeof(wchar_t));
if (szFormatText == NULL)
break;
@@ -103,9 +103,9 @@ static INT_PTR CALLBACK SetOptsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA case VARM_PARSE:
{
- TCHAR *string = Hlp_GetDlgItemText(hwndDlg, IDC_FORMATTEXT);
+ wchar_t *string = Hlp_GetDlgItemText(hwndDlg, IDC_FORMATTEXT);
if (string != NULL) {
- TCHAR *newString = variables_parsedup(string, NULL, NULL);
+ wchar_t *newString = variables_parsedup(string, NULL, NULL);
if (newString != NULL) {
SetDlgItemText(hwndDlg, IDC_RESULT, newString);
mir_free(newString);
diff --git a/plugins/Variables/src/parse_alias.cpp b/plugins/Variables/src/parse_alias.cpp index 9a29840a18..8f7ccd9f2e 100644 --- a/plugins/Variables/src/parse_alias.cpp +++ b/plugins/Variables/src/parse_alias.cpp @@ -21,16 +21,16 @@ struct ALIASREGISTER
{
- TCHAR *szAlias;
+ wchar_t *szAlias;
unsigned int argc;
- TCHAR **argv;
- TCHAR *szTranslation;
+ wchar_t **argv;
+ wchar_t *szTranslation;
};
static LIST<ALIASREGISTER> arAliases(5);
static mir_cs csAliasRegister;
-static ALIASREGISTER* searchAliasRegister(TCHAR *szAlias)
+static ALIASREGISTER* searchAliasRegister(wchar_t *szAlias)
{
if (szAlias == NULL || *szAlias == 0)
return NULL;
@@ -43,7 +43,7 @@ static ALIASREGISTER* searchAliasRegister(TCHAR *szAlias) return NULL;
}
-static TCHAR *replaceArguments(TCHAR *res, TCHAR *tArg, TCHAR *rArg)
+static wchar_t *replaceArguments(wchar_t *res, wchar_t *tArg, wchar_t *rArg)
{
if (mir_tstrlen(tArg) == 0)
return res;
@@ -55,14 +55,14 @@ static TCHAR *replaceArguments(TCHAR *res, TCHAR *tArg, TCHAR *rArg) while ((*(res + ecur) != ')') && (*(res + ecur) != ','))
ecur++;
- if (((signed int)mir_tstrlen(tArg) == (ecur - cur)) && (!_tcsncmp(tArg, res + cur, mir_tstrlen(tArg)))) {
+ if (((signed int)mir_tstrlen(tArg) == (ecur - cur)) && (!wcsncmp(tArg, res + cur, mir_tstrlen(tArg)))) {
if (mir_tstrlen(rArg) > mir_tstrlen(tArg)) {
- res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + (mir_tstrlen(rArg) - mir_tstrlen(tArg)) + 1)*sizeof(TCHAR));
+ res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + (mir_tstrlen(rArg) - mir_tstrlen(tArg)) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
}
- memmove(res + ecur + (mir_tstrlen(rArg) - mir_tstrlen(tArg)), res + ecur, (mir_tstrlen(res + ecur) + 1)*sizeof(TCHAR));
- _tcsncpy(res + cur, rArg, mir_tstrlen(rArg));
+ memmove(res + ecur + (mir_tstrlen(rArg) - mir_tstrlen(tArg)), res + ecur, (mir_tstrlen(res + ecur) + 1)*sizeof(wchar_t));
+ wcsncpy(res + cur, rArg, mir_tstrlen(rArg));
}
}
cur++;
@@ -71,13 +71,13 @@ static TCHAR *replaceArguments(TCHAR *res, TCHAR *tArg, TCHAR *rArg) return res;
}
-static TCHAR *parseTranslateAlias(ARGUMENTSINFO *ai)
+static wchar_t *parseTranslateAlias(ARGUMENTSINFO *ai)
{
ALIASREGISTER *areg = searchAliasRegister(ai->targv[0]);
if (areg == NULL || areg->argc != ai->argc - 1)
return NULL;
- TCHAR *res = mir_tstrdup(areg->szTranslation);
+ wchar_t *res = mir_tstrdup(areg->szTranslation);
for (unsigned i = 0; i < areg->argc; i++) {
res = replaceArguments(res, areg->argv[i], ai->targv[i + 1]);
if (res == NULL)
@@ -87,7 +87,7 @@ static TCHAR *parseTranslateAlias(ARGUMENTSINFO *ai) return res;
}
-static int addToAliasRegister(TCHAR *szAlias, unsigned int argc, TCHAR** argv, TCHAR *szTranslation)
+static int addToAliasRegister(wchar_t *szAlias, unsigned int argc, wchar_t** argv, wchar_t *szTranslation)
{
if (szAlias == NULL || szTranslation == NULL || mir_tstrlen(szAlias) == 0)
return -1;
@@ -104,7 +104,7 @@ static int addToAliasRegister(TCHAR *szAlias, unsigned int argc, TCHAR** argv, T mir_free(p->argv[j]);
p->argc = argc;
- p->argv = (TCHAR**)mir_realloc(p->argv, argc * sizeof(TCHAR*));
+ p->argv = (wchar_t**)mir_realloc(p->argv, argc * sizeof(wchar_t*));
if (p->argv == NULL)
return -1;
@@ -116,7 +116,7 @@ static int addToAliasRegister(TCHAR *szAlias, unsigned int argc, TCHAR** argv, T }
return 0;
}
- TCHAR **pargv = (TCHAR**)mir_alloc(argc * sizeof(TCHAR*));
+ wchar_t **pargv = (wchar_t**)mir_alloc(argc * sizeof(wchar_t*));
if (pargv == NULL)
return -1;
@@ -136,13 +136,13 @@ static int addToAliasRegister(TCHAR *szAlias, unsigned int argc, TCHAR** argv, T return 0;
}
-static TCHAR *parseAddAlias(ARGUMENTSINFO *ai)
+static wchar_t *parseAddAlias(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
char *szHelp, *szArgsA;
- TCHAR *cur = ai->targv[1];
+ wchar_t *cur = ai->targv[1];
while (isValidTokenChar(*cur))
cur++;
@@ -153,12 +153,12 @@ static TCHAR *parseAddAlias(ARGUMENTSINFO *ai) deRegisterToken(alias);
addToAliasRegister(alias, argv.getCount(), argv.getArray(), ai->targv[2]);
- TCHAR *szArgs = NULL;
+ wchar_t *szArgs = NULL;
for (int i = 0; i < argv.getCount(); i++) {
if (i == 0)
- szArgs = (TCHAR*)mir_calloc((mir_tstrlen(argv[i]) + 2)*sizeof(TCHAR));
+ szArgs = (wchar_t*)mir_calloc((mir_tstrlen(argv[i]) + 2)*sizeof(wchar_t));
else
- szArgs = (TCHAR*)mir_realloc(szArgs, (mir_tstrlen(szArgs) + mir_tstrlen(argv[i]) + 2)*sizeof(TCHAR));
+ szArgs = (wchar_t*)mir_realloc(szArgs, (mir_tstrlen(szArgs) + mir_tstrlen(argv[i]) + 2)*sizeof(wchar_t));
mir_tstrcat(szArgs, argv[i]);
if (i != argv.getCount() - 1)
diff --git a/plugins/Variables/src/parse_alias.h b/plugins/Variables/src/parse_alias.h index 5876367aad..8cec5ded4f 100644 --- a/plugins/Variables/src/parse_alias.h +++ b/plugins/Variables/src/parse_alias.h @@ -19,12 +19,12 @@ #define ADDALIAS L"alias"
-int isValidTokenChar(TCHAR tc);
+int isValidTokenChar(wchar_t tc);
-struct TArgList : public LIST<TCHAR>
+struct TArgList : public LIST<wchar_t>
{
TArgList() :
- LIST<TCHAR>(1)
+ LIST<wchar_t>(1)
{}
void destroy()
@@ -35,4 +35,4 @@ struct TArgList : public LIST<TCHAR> }
};
-TCHAR* getArguments(TCHAR *string, TArgList &aargv);
+wchar_t* getArguments(wchar_t *string, TArgList &aargv);
diff --git a/plugins/Variables/src/parse_external.cpp b/plugins/Variables/src/parse_external.cpp index 4dca2905f2..873be4f90b 100644 --- a/plugins/Variables/src/parse_external.cpp +++ b/plugins/Variables/src/parse_external.cpp @@ -19,7 +19,7 @@ #include "stdafx.h"
-static TCHAR *getFullWinampTitleText()
+static wchar_t *getFullWinampTitleText()
{
HWND hwndWinamp = FindWindow(L"STUDIO", NULL);
if (hwndWinamp == NULL)
@@ -29,7 +29,7 @@ static TCHAR *getFullWinampTitleText() return NULL;
SIZE_T dwWinTextLength = (GetWindowTextLength(hwndWinamp) + 1);
- TCHAR *szWinText = (TCHAR*)mir_alloc(dwWinTextLength * sizeof(TCHAR));
+ wchar_t *szWinText = (wchar_t*)mir_alloc(dwWinTextLength * sizeof(wchar_t));
if (szWinText == NULL)
return NULL;
@@ -37,7 +37,7 @@ static TCHAR *getFullWinampTitleText() mir_free(szWinText);
return NULL;
}
- TCHAR *szTitle = (TCHAR*)mir_alloc((2 * mir_tstrlen(szWinText) + 1)*sizeof(TCHAR));
+ wchar_t *szTitle = (wchar_t*)mir_alloc((2 * mir_tstrlen(szWinText) + 1)*sizeof(wchar_t));
if (szTitle == NULL) {
mir_free(szWinText);
return NULL;
@@ -49,19 +49,19 @@ static TCHAR *getFullWinampTitleText() return szTitle;
}
-static TCHAR *parseWinampSong(ARGUMENTSINFO *ai)
+static wchar_t *parseWinampSong(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
- TCHAR *res = NULL;
- TCHAR *szTitle = getFullWinampTitleText();
+ wchar_t *res = NULL;
+ wchar_t *szTitle = getFullWinampTitleText();
if (szTitle == NULL)
return NULL;
- TCHAR *scur = _tcschr(szTitle, '.');
- TCHAR *cur;
- if ((scur == NULL) || ((cur = _tcsstr(scur, L" - Winamp")) == NULL) || (scur >= cur) || (scur > (szTitle + mir_tstrlen(szTitle) - 2)) || (cur > (szTitle + mir_tstrlen(szTitle)))) {
+ wchar_t *scur = wcschr(szTitle, '.');
+ wchar_t *cur;
+ if ((scur == NULL) || ((cur = wcsstr(scur, L" - Winamp")) == NULL) || (scur >= cur) || (scur > (szTitle + mir_tstrlen(szTitle) - 2)) || (cur > (szTitle + mir_tstrlen(szTitle)))) {
mir_free(szTitle);
return NULL;
}
@@ -75,23 +75,23 @@ static TCHAR *parseWinampSong(ARGUMENTSINFO *ai) return res;
}
-static TCHAR *parseWinampState(ARGUMENTSINFO *ai)
+static wchar_t *parseWinampState(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
- TCHAR *res = NULL;
- TCHAR *szTitle = getFullWinampTitleText();
+ wchar_t *res = NULL;
+ wchar_t *szTitle = getFullWinampTitleText();
if (szTitle == NULL)
return NULL;
- TCHAR *scur = _tcschr(szTitle, '.');
- TCHAR *cur;
- if (scur == NULL || (cur = _tcsstr(scur, L" - Winamp")) == NULL)
+ wchar_t *scur = wcschr(szTitle, '.');
+ wchar_t *cur;
+ if (scur == NULL || (cur = wcsstr(scur, L" - Winamp")) == NULL)
res = mir_tstrdup(TranslateT("Stopped"));
- else if ((!_tcsncmp(cur + 10, L"[Stopped]", 9)))
+ else if ((!wcsncmp(cur + 10, L"[Stopped]", 9)))
res = mir_tstrdup(TranslateT("Stopped"));
- else if ((!_tcsncmp(cur + 10, L"[Paused]", 8)))
+ else if ((!wcsncmp(cur + 10, L"[Paused]", 8)))
res = mir_tstrdup(TranslateT("Paused"));
else
res = mir_tstrdup(L"Playing");
diff --git a/plugins/Variables/src/parse_inet.cpp b/plugins/Variables/src/parse_inet.cpp index 59d3cc4ce8..58c96df015 100644 --- a/plugins/Variables/src/parse_inet.cpp +++ b/plugins/Variables/src/parse_inet.cpp @@ -19,7 +19,7 @@ #include "stdafx.h"
-static TCHAR *parseUrlEnc(ARGUMENTSINFO *ai)
+static wchar_t *parseUrlEnc(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -45,12 +45,12 @@ static TCHAR *parseUrlEnc(ARGUMENTSINFO *ai) cur += mir_strlen(hex);
}
- TCHAR *tres = mir_a2t(res);
+ wchar_t *tres = mir_a2t(res);
mir_free(res);
return tres;
}
-static TCHAR *parseUrlDec(ARGUMENTSINFO *ai)
+static wchar_t *parseUrlDec(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -72,12 +72,12 @@ static TCHAR *parseUrlDec(ARGUMENTSINFO *ai) }
res = (char*)mir_realloc(res, mir_strlen(res) + 1);
- TCHAR *tres = mir_a2t(res);
+ wchar_t *tres = mir_a2t(res);
mir_free(res);
return tres;
}
-static TCHAR *parseNToA(ARGUMENTSINFO *ai)
+static wchar_t *parseNToA(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -87,7 +87,7 @@ static TCHAR *parseNToA(ARGUMENTSINFO *ai) return mir_a2t(inet_ntoa(in));
}
-static TCHAR *parseHToA(ARGUMENTSINFO *ai)
+static wchar_t *parseHToA(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
diff --git a/plugins/Variables/src/parse_logic.cpp b/plugins/Variables/src/parse_logic.cpp index c06d8445a9..763136f821 100644 --- a/plugins/Variables/src/parse_logic.cpp +++ b/plugins/Variables/src/parse_logic.cpp @@ -19,7 +19,7 @@ #include "stdafx.h"
-static TCHAR *parseAnd(ARGUMENTSINFO *ai)
+static wchar_t *parseAnd(ARGUMENTSINFO *ai)
{
if (ai->argc < 3)
return NULL;
@@ -39,7 +39,7 @@ static TCHAR *parseAnd(ARGUMENTSINFO *ai) return mir_tstrdup(L"");
}
-static TCHAR *parseFalse(ARGUMENTSINFO *ai)
+static wchar_t *parseFalse(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
@@ -48,7 +48,7 @@ static TCHAR *parseFalse(ARGUMENTSINFO *ai) return mir_tstrdup(L"");
}
-static TCHAR *parseIf(ARGUMENTSINFO *ai)
+static wchar_t *parseIf(ARGUMENTSINFO *ai)
{
if (ai->argc != 4)
return NULL;
@@ -62,7 +62,7 @@ static TCHAR *parseIf(ARGUMENTSINFO *ai) return mir_tstrdup((fi.eCount == 0) ? ai->targv[2] : ai->targv[3]);
}
-static TCHAR *parseIf2(ARGUMENTSINFO *ai)
+static wchar_t *parseIf2(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -71,7 +71,7 @@ static TCHAR *parseIf2(ARGUMENTSINFO *ai) memcpy(&fi, ai->fi, sizeof(fi));
fi.eCount = fi.pCount = 0;
fi.tszFormat = ai->targv[1];
- TCHAR *szCondition = formatString(&fi);
+ wchar_t *szCondition = formatString(&fi);
if (fi.eCount == 0)
return szCondition;
@@ -79,14 +79,14 @@ static TCHAR *parseIf2(ARGUMENTSINFO *ai) return mir_tstrdup(ai->targv[2]);
}
-static TCHAR *parseIf3(ARGUMENTSINFO *ai)
+static wchar_t *parseIf3(ARGUMENTSINFO *ai)
{
FORMATINFO fi;
memcpy(&fi, ai->fi, sizeof(fi));
for (unsigned i = 1; i < ai->argc; i++) {
fi.eCount = fi.pCount = 0;
fi.tszFormat = ai->targv[i];
- TCHAR *szCondition = formatString(&fi);
+ wchar_t *szCondition = formatString(&fi);
if (fi.eCount == 0)
return szCondition;
@@ -96,7 +96,7 @@ static TCHAR *parseIf3(ARGUMENTSINFO *ai) return NULL;
}
-static TCHAR *parseIfequal(ARGUMENTSINFO *ai)
+static wchar_t *parseIfequal(ARGUMENTSINFO *ai)
{
if (ai->argc != 5)
return NULL;
@@ -116,7 +116,7 @@ static TCHAR *parseIfequal(ARGUMENTSINFO *ai) return mir_tstrdup(ai->targv[4]);
}
-static TCHAR *parseIfgreater(ARGUMENTSINFO *ai)
+static wchar_t *parseIfgreater(ARGUMENTSINFO *ai)
{
if (ai->argc != 5)
return NULL;
@@ -136,7 +136,7 @@ static TCHAR *parseIfgreater(ARGUMENTSINFO *ai) return mir_tstrdup(ai->targv[4]);
}
-static TCHAR *parseIflonger(ARGUMENTSINFO *ai)
+static wchar_t *parseIflonger(ARGUMENTSINFO *ai)
{
if (ai->argc != 5)
return NULL;
@@ -161,12 +161,12 @@ static TCHAR *parseIflonger(ARGUMENTSINFO *ai) ?for(init, cond, incr, show)
*/
-static TCHAR *parseFor(ARGUMENTSINFO *ai)
+static wchar_t *parseFor(ARGUMENTSINFO *ai)
{
if (ai->argc != 5)
return NULL;
- TCHAR *res = mir_tstrdup(L"");
+ wchar_t *res = mir_tstrdup(L"");
FORMATINFO fi;
memcpy(&fi, ai->fi, sizeof(fi));
@@ -177,16 +177,16 @@ static TCHAR *parseFor(ARGUMENTSINFO *ai) mir_free(formatString(&fi));
while (fi.eCount == 0) {
fi.tszFormat = ai->targv[4];
- TCHAR *parsed = formatString(&fi);
+ wchar_t *parsed = formatString(&fi);
if (parsed != NULL) {
if (res == NULL) {
- res = (TCHAR*)mir_alloc(mir_tstrlen(parsed) + 1 * sizeof(TCHAR));
+ res = (wchar_t*)mir_alloc(mir_tstrlen(parsed) + 1 * sizeof(wchar_t));
if (res == NULL) {
mir_free(parsed);
return NULL;
}
}
- else res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(parsed) + 1)*sizeof(TCHAR));
+ else res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(parsed) + 1)*sizeof(wchar_t));
mir_tstrcat(res, parsed);
mir_free(parsed);
@@ -201,7 +201,7 @@ static TCHAR *parseFor(ARGUMENTSINFO *ai) return res;
}
-static TCHAR *parseEqual(ARGUMENTSINFO *ai)
+static wchar_t *parseEqual(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -212,7 +212,7 @@ static TCHAR *parseEqual(ARGUMENTSINFO *ai) return mir_tstrdup(L"");
}
-static TCHAR *parseGreater(ARGUMENTSINFO *ai)
+static wchar_t *parseGreater(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -223,7 +223,7 @@ static TCHAR *parseGreater(ARGUMENTSINFO *ai) return mir_tstrdup(L"");
}
-static TCHAR *parseLonger(ARGUMENTSINFO *ai)
+static wchar_t *parseLonger(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -234,7 +234,7 @@ static TCHAR *parseLonger(ARGUMENTSINFO *ai) return mir_tstrdup(L"");
}
-static TCHAR *parseNot(ARGUMENTSINFO *ai)
+static wchar_t *parseNot(ARGUMENTSINFO *ai)
{
if (ai->argc != 2) {
return NULL;
@@ -251,7 +251,7 @@ static TCHAR *parseNot(ARGUMENTSINFO *ai) return mir_tstrdup(L"");
}
-static TCHAR *parseOr(ARGUMENTSINFO *ai)
+static wchar_t *parseOr(ARGUMENTSINFO *ai)
{
if (ai->argc < 2)
return NULL;
@@ -271,12 +271,12 @@ static TCHAR *parseOr(ARGUMENTSINFO *ai) return mir_tstrdup(L"");
}
-static TCHAR *parseTrue(ARGUMENTSINFO *ai)
+static wchar_t *parseTrue(ARGUMENTSINFO *ai)
{
return (ai->argc != 1) ? NULL : mir_tstrdup(L"");
}
-static TCHAR *parseXor(ARGUMENTSINFO *ai)
+static wchar_t *parseXor(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
diff --git a/plugins/Variables/src/parse_math.cpp b/plugins/Variables/src/parse_math.cpp index 0e65e29da2..a9946d8a7a 100644 --- a/plugins/Variables/src/parse_math.cpp +++ b/plugins/Variables/src/parse_math.cpp @@ -19,7 +19,7 @@ #include "stdafx.h"
-static TCHAR *parseAdd(ARGUMENTSINFO *ai)
+static wchar_t *parseAdd(ARGUMENTSINFO *ai)
{
if (ai->argc < 3)
return NULL;
@@ -31,7 +31,7 @@ static TCHAR *parseAdd(ARGUMENTSINFO *ai) return itot(result);
}
-static TCHAR *parseDiv(ARGUMENTSINFO *ai)
+static wchar_t *parseDiv(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -44,10 +44,10 @@ static TCHAR *parseDiv(ARGUMENTSINFO *ai) return itot(val1 / val2);
}
-static TCHAR *parseHex(ARGUMENTSINFO *ai)
+static wchar_t *parseHex(ARGUMENTSINFO *ai)
{
unsigned int i;
- TCHAR szVal[34];
+ wchar_t szVal[34];
if (ai->argc != 3)
return NULL;
@@ -56,11 +56,11 @@ static TCHAR *parseHex(ARGUMENTSINFO *ai) int padding = ttoi(ai->targv[2]);
mir_sntprintf(szVal, L"%x", val);
unsigned int zeros = max(padding - (signed int)mir_tstrlen(szVal), 0);
- TCHAR *res = (TCHAR*)mir_alloc((zeros + mir_tstrlen(szVal) + 3)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((zeros + mir_tstrlen(szVal) + 3)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((zeros + mir_tstrlen(szVal) + 3) * sizeof(TCHAR)));
+ memset(res, 0, ((zeros + mir_tstrlen(szVal) + 3) * sizeof(wchar_t)));
mir_tstrcpy(res, L"0x");
for (i = 0; i < zeros; i++)
*(res + 2 + i) = '0';
@@ -69,7 +69,7 @@ static TCHAR *parseHex(ARGUMENTSINFO *ai) return res;
}
-static TCHAR *parseMod(ARGUMENTSINFO *ai)
+static wchar_t *parseMod(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -82,7 +82,7 @@ static TCHAR *parseMod(ARGUMENTSINFO *ai) return itot(val1 % val2);
}
-static TCHAR *parseMul(ARGUMENTSINFO *ai)
+static wchar_t *parseMul(ARGUMENTSINFO *ai)
{
if (ai->argc < 3)
return NULL;
@@ -94,7 +94,7 @@ static TCHAR *parseMul(ARGUMENTSINFO *ai) return itot(result);
}
-static TCHAR *parseMuldiv(ARGUMENTSINFO *ai)
+static wchar_t *parseMuldiv(ARGUMENTSINFO *ai)
{
if (ai->argc != 4)
return NULL;
@@ -105,7 +105,7 @@ static TCHAR *parseMuldiv(ARGUMENTSINFO *ai) return itot((ttoi(ai->targv[1])*ttoi(ai->targv[2])) / ttoi(ai->targv[3]));
}
-static TCHAR *parseMin(ARGUMENTSINFO *ai)
+static wchar_t *parseMin(ARGUMENTSINFO *ai)
{
if (ai->argc < 2)
return NULL;
@@ -117,7 +117,7 @@ static TCHAR *parseMin(ARGUMENTSINFO *ai) return itot(minVal);
}
-static TCHAR *parseMax(ARGUMENTSINFO *ai)
+static wchar_t *parseMax(ARGUMENTSINFO *ai)
{
if (ai->argc < 2)
return NULL;
@@ -129,26 +129,26 @@ static TCHAR *parseMax(ARGUMENTSINFO *ai) return itot(maxVal);
}
-static TCHAR *parseNum(ARGUMENTSINFO *ai)
+static wchar_t *parseNum(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
int val = ttoi(ai->targv[1]);
int padding = ttoi(ai->targv[2]);
- TCHAR *szVal = itot(val);
+ wchar_t *szVal = itot(val);
if (szVal == NULL)
return NULL;
unsigned zeros = max(padding - (signed int)mir_tstrlen(szVal), 0);
- TCHAR *res = (TCHAR*)mir_alloc((zeros + mir_tstrlen(szVal) + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((zeros + mir_tstrlen(szVal) + 1)*sizeof(wchar_t));
if (res == NULL) {
mir_free(szVal);
return NULL;
}
- memset(res, 0, ((zeros + mir_tstrlen(szVal) + 1) * sizeof(TCHAR)));
- TCHAR *cur = res;
+ memset(res, 0, ((zeros + mir_tstrlen(szVal) + 1) * sizeof(wchar_t)));
+ wchar_t *cur = res;
for (unsigned i = 0; i < zeros; i++)
*cur++ = '0';
@@ -158,12 +158,12 @@ static TCHAR *parseNum(ARGUMENTSINFO *ai) return res;
}
-static TCHAR *parseRand(ARGUMENTSINFO *)
+static wchar_t *parseRand(ARGUMENTSINFO *)
{
return itot(rand());
}
-static TCHAR *parseSub(ARGUMENTSINFO *ai)
+static wchar_t *parseSub(ARGUMENTSINFO *ai)
{
if (ai->argc < 3)
return NULL;
diff --git a/plugins/Variables/src/parse_metacontacts.cpp b/plugins/Variables/src/parse_metacontacts.cpp index 71ab1c08a6..ac1185edb3 100644 --- a/plugins/Variables/src/parse_metacontacts.cpp +++ b/plugins/Variables/src/parse_metacontacts.cpp @@ -19,7 +19,7 @@ #include "stdafx.h"
-static TCHAR *parseGetParent(ARGUMENTSINFO *ai)
+static wchar_t *parseGetParent(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -39,7 +39,7 @@ static TCHAR *parseGetParent(ARGUMENTSINFO *ai) if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
- TCHAR tszID[40];
+ wchar_t tszID[40];
mir_sntprintf(tszID, L"%p", hContact);
szUniqueID = mir_tstrdup(tszID);
}
@@ -47,7 +47,7 @@ static TCHAR *parseGetParent(ARGUMENTSINFO *ai) return CMString(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
}
-static TCHAR *parseGetDefault(ARGUMENTSINFO *ai)
+static wchar_t *parseGetDefault(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -67,7 +67,7 @@ static TCHAR *parseGetDefault(ARGUMENTSINFO *ai) if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
- TCHAR tszID[40];
+ wchar_t tszID[40];
mir_sntprintf(tszID, L"%p", hContact);
szUniqueID = mir_tstrdup(tszID);
}
@@ -75,7 +75,7 @@ static TCHAR *parseGetDefault(ARGUMENTSINFO *ai) return CMString(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
}
-static TCHAR *parseGetMostOnline(ARGUMENTSINFO *ai)
+static wchar_t *parseGetMostOnline(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -95,7 +95,7 @@ static TCHAR *parseGetMostOnline(ARGUMENTSINFO *ai) if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
- TCHAR tszID[40];
+ wchar_t tszID[40];
mir_sntprintf(tszID, L"%p", hContact);
szUniqueID = mir_tstrdup(tszID);
}
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 088fb00497..a25e303247 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -19,48 +19,48 @@ #include "stdafx.h"
-static TCHAR* parseCodeToStatus(ARGUMENTSINFO *ai)
+static wchar_t* parseCodeToStatus(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
unsigned int status = ttoi(ai->targv[1]);
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
if (szStatus != NULL)
return mir_tstrdup(szStatus);
return NULL;
}
-static int getContactInfoFlags(TCHAR *tszDesc)
+static int getContactInfoFlags(wchar_t *tszDesc)
{
int flags = 0;
- for (TCHAR *cur = tszDesc; (cur < (tszDesc + mir_tstrlen(tszDesc))); cur++) {
- if (!_tcsnicmp(cur, STR_PROTOID, mir_tstrlen(STR_PROTOID))) {
+ for (wchar_t *cur = tszDesc; (cur < (tszDesc + mir_tstrlen(tszDesc))); cur++) {
+ if (!wcsnicmp(cur, STR_PROTOID, mir_tstrlen(STR_PROTOID))) {
flags |= CI_PROTOID;
cur += mir_tstrlen(STR_PROTOID) - 1;
}
- else if (!_tcsnicmp(cur, STR_NICK, mir_tstrlen(STR_NICK))) {
+ else if (!wcsnicmp(cur, STR_NICK, mir_tstrlen(STR_NICK))) {
flags |= CI_NICK;
cur += mir_tstrlen(STR_NICK) - 1;
}
- else if (!_tcsnicmp(cur, STR_FIRSTNAME, mir_tstrlen(STR_FIRSTNAME))) {
+ else if (!wcsnicmp(cur, STR_FIRSTNAME, mir_tstrlen(STR_FIRSTNAME))) {
flags |= CI_FIRSTNAME;
cur += mir_tstrlen(STR_FIRSTNAME) - 1;
}
- else if (!_tcsnicmp(cur, STR_LASTNAME, mir_tstrlen(STR_LASTNAME))) {
+ else if (!wcsnicmp(cur, STR_LASTNAME, mir_tstrlen(STR_LASTNAME))) {
flags |= CI_LASTNAME;
cur += mir_tstrlen(STR_LASTNAME) - 1;
}
- else if (!_tcsnicmp(cur, STR_DISPLAY, mir_tstrlen(STR_DISPLAY))) {
+ else if (!wcsnicmp(cur, STR_DISPLAY, mir_tstrlen(STR_DISPLAY))) {
flags |= CI_LISTNAME;
cur += mir_tstrlen(STR_DISPLAY) - 1;
}
- else if (!_tcsnicmp(cur, STR_EMAIL, mir_tstrlen(STR_EMAIL))) {
+ else if (!wcsnicmp(cur, STR_EMAIL, mir_tstrlen(STR_EMAIL))) {
flags |= CI_EMAIL;
cur += mir_tstrlen(STR_EMAIL) - 1;
}
- else if (!_tcsnicmp(cur, STR_UNIQUEID, mir_tstrlen(STR_UNIQUEID))) {
+ else if (!wcsnicmp(cur, STR_UNIQUEID, mir_tstrlen(STR_UNIQUEID))) {
flags |= CI_UNIQUEID;
cur += mir_tstrlen(STR_UNIQUEID) - 1;
}
@@ -74,7 +74,7 @@ static int getContactInfoFlags(TCHAR *tszDesc) return flags;
}
-static TCHAR* parseContact(ARGUMENTSINFO *ai)
+static wchar_t* parseContact(ARGUMENTSINFO *ai)
{
if (ai->argc < 3 || ai->argc > 4)
return NULL;
@@ -95,7 +95,7 @@ static TCHAR* parseContact(ARGUMENTSINFO *ai) return encodeContactToString(hContact);
}
-static TCHAR* parseContactCount(ARGUMENTSINFO *ai)
+static wchar_t* parseContactCount(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -104,7 +104,7 @@ static TCHAR* parseContactCount(ARGUMENTSINFO *ai) return itot(count);
}
-static TCHAR* parseContactInfo(ARGUMENTSINFO *ai)
+static wchar_t* parseContactInfo(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -120,37 +120,37 @@ static TCHAR* parseContactInfo(ARGUMENTSINFO *ai) return getContactInfoT(type, hContact);
}
-static TCHAR* parseDBProfileName(ARGUMENTSINFO *ai)
+static wchar_t* parseDBProfileName(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
- TCHAR name[MAX_PATH];
+ wchar_t name[MAX_PATH];
if (CallService(MS_DB_GETPROFILENAMET, _countof(name), (LPARAM)name))
return NULL;
return mir_tstrdup(name);
}
-static TCHAR* parseDBProfilePath(ARGUMENTSINFO *ai)
+static wchar_t* parseDBProfilePath(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
if (CallService(MS_DB_GETPROFILEPATHT, _countof(path), (LPARAM)path))
return NULL;
return mir_tstrdup(path);
}
-static TCHAR* getDBSetting(MCONTACT hContact, char* module, char* setting, TCHAR* defaultValue)
+static wchar_t* getDBSetting(MCONTACT hContact, char* module, char* setting, wchar_t* defaultValue)
{
DBVARIANT dbv;
if (db_get_s(hContact, module, setting, &dbv, 0))
return defaultValue;
- TCHAR *var = NULL;
+ wchar_t *var = NULL;
switch (dbv.type) {
case DBVT_BYTE:
var = itot(dbv.bVal);
@@ -176,7 +176,7 @@ static TCHAR* getDBSetting(MCONTACT hContact, char* module, char* setting, TCHAR return var;
}
-static TCHAR* parseDBSetting(ARGUMENTSINFO *ai)
+static wchar_t* parseDBSetting(ARGUMENTSINFO *ai)
{
if (ai->argc < 4)
return NULL;
@@ -198,15 +198,15 @@ static TCHAR* parseDBSetting(ARGUMENTSINFO *ai) return NULL;
}
- TCHAR *szDefaultValue = ((ai->argc > 4 && mir_tstrlen(ai->targv[4]) > 0) ? mir_tstrdup(ai->targv[4]) : NULL);
- TCHAR *res = getDBSetting(hContact, szModule, szSetting, szDefaultValue);
+ wchar_t *szDefaultValue = ((ai->argc > 4 && mir_tstrlen(ai->targv[4]) > 0) ? mir_tstrdup(ai->targv[4]) : NULL);
+ wchar_t *res = getDBSetting(hContact, szModule, szSetting, szDefaultValue);
mir_free(szDefaultValue);
mir_free(szSetting);
mir_free(szModule);
return res;
}
-static TCHAR* parseLastSeenDate(ARGUMENTSINFO *ai)
+static wchar_t* parseLastSeenDate(ARGUMENTSINFO *ai)
{
if (ai->argc <= 1)
return NULL;
@@ -215,7 +215,7 @@ static TCHAR* parseLastSeenDate(ARGUMENTSINFO *ai) if (hContact == INVALID_CONTACT_ID)
return NULL;
- TCHAR *szFormat;
+ wchar_t *szFormat;
if (ai->argc == 2 || (ai->argc > 2 && mir_tstrlen(ai->targv[2]) == 0))
szFormat = NULL;
else
@@ -236,7 +236,7 @@ static TCHAR* parseLastSeenDate(ARGUMENTSINFO *ai) lsTime.wMonth = db_get_w(hContact, szModule, "Month", 0);
int len = GetDateFormat(LOCALE_USER_DEFAULT, 0, &lsTime, szFormat, NULL, 0);
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -248,7 +248,7 @@ static TCHAR* parseLastSeenDate(ARGUMENTSINFO *ai) return res;
}
-static TCHAR* parseLastSeenTime(ARGUMENTSINFO *ai)
+static wchar_t* parseLastSeenTime(ARGUMENTSINFO *ai)
{
if (ai->argc <= 1)
return NULL;
@@ -257,7 +257,7 @@ static TCHAR* parseLastSeenTime(ARGUMENTSINFO *ai) if (hContact == INVALID_CONTACT_ID)
return NULL;
- TCHAR *szFormat;
+ wchar_t *szFormat;
if (ai->argc == 2 || (ai->argc > 2 && mir_tstrlen(ai->targv[2]) == 0))
szFormat = NULL;
else
@@ -279,7 +279,7 @@ static TCHAR* parseLastSeenTime(ARGUMENTSINFO *ai) lsTime.wYear = db_get_w(hContact, szModule, "Year", 0);
int len = GetTimeFormat(LOCALE_USER_DEFAULT, 0, &lsTime, szFormat, NULL, 0);
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -291,7 +291,7 @@ static TCHAR* parseLastSeenTime(ARGUMENTSINFO *ai) return res;
}
-static TCHAR* parseLastSeenStatus(ARGUMENTSINFO *ai)
+static wchar_t* parseLastSeenStatus(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -305,27 +305,27 @@ static TCHAR* parseLastSeenStatus(ARGUMENTSINFO *ai) if (status == 0)
return NULL;
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
if (szStatus != NULL)
return mir_tstrdup(szStatus);
return NULL;
}
-static TCHAR* parseMirandaPath(ARGUMENTSINFO *ai)
+static wchar_t* parseMirandaPath(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
ai->flags |= AIF_DONTPARSE;
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
if (GetModuleFileName(NULL, path, _countof(path)) == 0)
return NULL;
return mir_tstrdup(path);
}
-static TCHAR* parseMyStatus(ARGUMENTSINFO *ai)
+static wchar_t* parseMyStatus(ARGUMENTSINFO *ai)
{
if (ai->argc > 2)
return NULL;
@@ -336,17 +336,17 @@ static TCHAR* parseMyStatus(ARGUMENTSINFO *ai) else
status = CallProtoService(_T2A(ai->targv[1]), PS_GETSTATUS, 0, 0);
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
return (szStatus != NULL) ? mir_tstrdup(szStatus) : NULL;
}
-static TCHAR* parseProtoInfo(ARGUMENTSINFO *ai)
+static wchar_t* parseProtoInfo(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
char *szRes = NULL;
- TCHAR *tszRes = NULL;
+ wchar_t *tszRes = NULL;
ptrA szProto(mir_t2a(ai->targv[1]));
if (!mir_tstrcmp(ai->targv[2], _T(STR_PINAME)))
@@ -373,7 +373,7 @@ static TCHAR* parseProtoInfo(ARGUMENTSINFO *ai) return tszRes;
}
-static TCHAR* parseSpecialContact(ARGUMENTSINFO *ai)
+static wchar_t* parseSpecialContact(ARGUMENTSINFO *ai)
{
if (ai->argc != 1 || ai->fi->hContact == NULL)
return NULL;
@@ -386,7 +386,7 @@ static TCHAR* parseSpecialContact(ARGUMENTSINFO *ai) if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
- szUniqueID = (TCHAR*)mir_alloc(40);
+ szUniqueID = (wchar_t*)mir_alloc(40);
if (szUniqueID == NULL)
return NULL;
mir_sntprintf(szUniqueID, 20, L"%p", ai->fi->hContact);
@@ -526,7 +526,7 @@ static MEVENT findDbEvent(MCONTACT hContact, MEVENT hDbEvent, int flags) }
// ?message(%subject%,last|first,sent|recv,read|unread)
-static TCHAR* parseDbEvent(ARGUMENTSINFO *ai)
+static wchar_t* parseDbEvent(ARGUMENTSINFO *ai)
{
if (ai->argc != 5)
return NULL;
@@ -579,21 +579,21 @@ static TCHAR* parseDbEvent(ARGUMENTSINFO *ai) return NULL;
}
- TCHAR *res = DbGetEventTextT(&dbe, CP_ACP);
+ wchar_t *res = DbGetEventTextT(&dbe, CP_ACP);
mir_free(dbe.pBlob);
return res;
}
-static TCHAR* parseTranslate(ARGUMENTSINFO *ai)
+static wchar_t* parseTranslate(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
- TCHAR *res = TranslateTS(ai->targv[1]);
+ wchar_t *res = TranslateTS(ai->targv[1]);
return (res == NULL) ? NULL : mir_tstrdup(res);
}
-static TCHAR* parseVersionString(ARGUMENTSINFO *ai)
+static wchar_t* parseVersionString(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
@@ -606,40 +606,40 @@ static TCHAR* parseVersionString(ARGUMENTSINFO *ai) return mir_a2t(versionString);
}
-static TCHAR *parseContactNameString(ARGUMENTSINFO *ai)
+static wchar_t *parseContactNameString(ARGUMENTSINFO *ai)
{
if (ai->argc != 1 || ai->fi->hContact == NULL)
return NULL;
ai->flags |= AIF_DONTPARSE;
- TCHAR *ret = (TCHAR*)pcli->pfnGetContactDisplayName(ai->fi->hContact, 0);
+ wchar_t *ret = (wchar_t*)pcli->pfnGetContactDisplayName(ai->fi->hContact, 0);
return (ret == NULL) ? NULL : mir_tstrdup(ret);
}
-static TCHAR *parseMirDateString(ARGUMENTSINFO *ai)
+static wchar_t *parseMirDateString(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
ai->flags |= AIF_DONTPARSE;
- TCHAR ret[128];
+ wchar_t ret[128];
return mir_tstrdup(TimeZone_ToStringT(time(NULL), L"d s", ret, _countof(ret)));
}
-static TCHAR *parseMirandaCoreVar(ARGUMENTSINFO *ai)
+static wchar_t *parseMirandaCoreVar(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
ai->flags |= AIF_DONTPARSE;
- TCHAR corevar[MAX_PATH];
+ wchar_t corevar[MAX_PATH];
mir_sntprintf(corevar, L"%%%s%%", ai->targv[0]);
return Utils_ReplaceVarsT(corevar);
}
-static TCHAR *parseMirSrvExists(ARGUMENTSINFO *ai)
+static wchar_t *parseMirSrvExists(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
diff --git a/plugins/Variables/src/parse_regexp.cpp b/plugins/Variables/src/parse_regexp.cpp index f3e968ddb2..f5cb3c6ba8 100644 --- a/plugins/Variables/src/parse_regexp.cpp +++ b/plugins/Variables/src/parse_regexp.cpp @@ -22,7 +22,7 @@ /*
pattern, subject
*/
-static TCHAR *parseRegExpCheck(ARGUMENTSINFO *ai)
+static wchar_t *parseRegExpCheck(ARGUMENTSINFO *ai)
{
const char *err;
int erroffset;
@@ -52,17 +52,17 @@ static TCHAR *parseRegExpCheck(ARGUMENTSINFO *ai) /*
pattern, subject, substring no (== PCRE string no (starting at 0))
*/
-static TCHAR *parseRegExpSubstr(ARGUMENTSINFO *ai)
+static wchar_t *parseRegExpSubstr(ARGUMENTSINFO *ai)
{
const char *err;
- const TCHAR *substring;
+ const wchar_t *substring;
int erroffset, number;
int offsets[99];
if (ai->argc != 4)
return NULL;
- number = _ttoi(ai->targv[3]);
+ number = _wtoi(ai->targv[3]);
if (number < 0)
return NULL;
@@ -79,7 +79,7 @@ static TCHAR *parseRegExpSubstr(ARGUMENTSINFO *ai) if (pcre16_get_substring(ai->targv[2], offsets, nmat, number, &substring) < 0)
ai->flags |= AIF_FALSE;
else {
- TCHAR *tres = mir_tstrdup(substring);
+ wchar_t *tres = mir_tstrdup(substring);
pcre16_free_substring(substring);
return tres;
}
diff --git a/plugins/Variables/src/parse_str.cpp b/plugins/Variables/src/parse_str.cpp index 23a18acc7e..5ee00fb0f7 100644 --- a/plugins/Variables/src/parse_str.cpp +++ b/plugins/Variables/src/parse_str.cpp @@ -19,75 +19,75 @@ #include "stdafx.h"
-static TCHAR *parseCaps(ARGUMENTSINFO *ai)
+static wchar_t *parseCaps(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
- TCHAR *res = mir_tstrdup(ai->targv[1]);
- TCHAR *cur = res;
+ wchar_t *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *cur = res;
CharLower(res);
- *cur = (TCHAR)CharUpper((LPTSTR)*cur);
+ *cur = (wchar_t)CharUpper((LPTSTR)*cur);
cur++;
while (*cur != 0) {
if ((*cur == ' ') && (*(cur + 1) != 0)) {
cur++;
if (IsCharLower(*cur))
- *cur = (TCHAR)CharUpper((LPTSTR)*cur);
+ *cur = (wchar_t)CharUpper((LPTSTR)*cur);
}
else {
cur++;
if (IsCharUpper(*cur))
- *cur = (TCHAR)CharLower((LPTSTR)*cur);
+ *cur = (wchar_t)CharLower((LPTSTR)*cur);
}
}
return res;
}
-static TCHAR *parseCaps2(ARGUMENTSINFO *ai)
+static wchar_t *parseCaps2(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
- TCHAR *res = mir_tstrdup(ai->targv[1]);
- TCHAR *cur = res;
- *cur = (TCHAR)CharUpper((LPTSTR)*cur);
+ wchar_t *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *cur = res;
+ *cur = (wchar_t)CharUpper((LPTSTR)*cur);
cur++;
while (*cur != 0) {
if ((*cur == ' ') && (*(cur + 1) != 0)) {
cur++;
if (IsCharLower(*cur))
- *cur = (TCHAR)CharUpper((LPTSTR)*cur);
+ *cur = (wchar_t)CharUpper((LPTSTR)*cur);
}
else cur++;
}
return res;
}
-static TCHAR *parseCrlf(ARGUMENTSINFO *ai)
+static wchar_t *parseCrlf(ARGUMENTSINFO *ai)
{
ai->flags |= AIF_DONTPARSE;
return mir_tstrdup(L"\r\n");
}
-static TCHAR *parseEolToCrlf(ARGUMENTSINFO *ai)
+static wchar_t *parseEolToCrlf(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
- TCHAR *res = mir_tstrdup(ai->targv[1]);
- TCHAR *cur = res;
+ wchar_t *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *cur = res;
do {
- cur = _tcschr(cur, '\n');
+ cur = wcschr(cur, '\n');
if ((cur == NULL) || ((cur > res) && (*(cur - 1) == '\r')))
continue;
log_debug(cur);
int loc = cur - res;
- res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + 2)*sizeof(TCHAR));
+ res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + 2)*sizeof(wchar_t));
cur = res + loc;
- memmove(cur + 2, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(TCHAR));
- memcpy(cur, L"\r\n", 2 * sizeof(TCHAR));
+ memmove(cur + 2, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(wchar_t));
+ memcpy(cur, L"\r\n", 2 * sizeof(wchar_t));
cur += 2;
}
while (cur != NULL);
@@ -95,9 +95,9 @@ static TCHAR *parseEolToCrlf(ARGUMENTSINFO *ai) return res;
}
-static TCHAR *parseFixeol(ARGUMENTSINFO *ai)
+static wchar_t *parseFixeol(ARGUMENTSINFO *ai)
{
- TCHAR *szReplacement;
+ wchar_t *szReplacement;
if (ai->argc == 2)
szReplacement = L"(...)";
else if (ai->argc == 3)
@@ -105,7 +105,7 @@ static TCHAR *parseFixeol(ARGUMENTSINFO *ai) else
return NULL;
- TCHAR *cur = ai->targv[1];
+ wchar_t *cur = ai->targv[1];
while (mir_tstrcmp(cur, L"\r\n") && *cur != '\n' && *cur != 0)
cur++;
@@ -113,30 +113,30 @@ static TCHAR *parseFixeol(ARGUMENTSINFO *ai) return mir_tstrdup(ai->targv[1]);
cur--;
- TCHAR *res = (TCHAR*)mir_alloc((cur - ai->targv[1] + mir_tstrlen(szReplacement) + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((cur - ai->targv[1] + mir_tstrlen(szReplacement) + 1)*sizeof(wchar_t));
if (res == NULL)
return res;
- memset(res, 0, (((cur - ai->targv[1]) + 1) * sizeof(TCHAR)));
- _tcsncpy(res, ai->targv[1], cur - ai->targv[1]);
+ memset(res, 0, (((cur - ai->targv[1]) + 1) * sizeof(wchar_t)));
+ wcsncpy(res, ai->targv[1], cur - ai->targv[1]);
mir_tstrcat(res, szReplacement);
return res;
}
-static TCHAR *parseFixeol2(ARGUMENTSINFO *ai)
+static wchar_t *parseFixeol2(ARGUMENTSINFO *ai)
{
- TCHAR *szReplacement;
+ wchar_t *szReplacement;
switch (ai->argc) {
case 2: szReplacement = L" "; break;
case 3: szReplacement = ai->targv[2]; break;
default: return NULL;
}
- TCHAR *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *res = mir_tstrdup(ai->targv[1]);
for (size_t pos = 0; pos < mir_tstrlen(res); pos++) {
- TCHAR *cur = res + pos;
- TCHAR *szEol = NULL;
- if (!_tcsncmp(cur, L"\r\n", mir_tstrlen(L"\r\n")))
+ wchar_t *cur = res + pos;
+ wchar_t *szEol = NULL;
+ if (!wcsncmp(cur, L"\r\n", mir_tstrlen(L"\r\n")))
szEol = L"\r\n";
if (*cur == '\n')
@@ -144,18 +144,18 @@ static TCHAR *parseFixeol2(ARGUMENTSINFO *ai) if (szEol != NULL) {
if (mir_tstrlen(szReplacement) > mir_tstrlen(szEol)) {
- res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(szReplacement) - mir_tstrlen(szEol) + 1)*sizeof(TCHAR));
+ res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(szReplacement) - mir_tstrlen(szEol) + 1)*sizeof(wchar_t));
cur = res + pos;
}
- memmove(cur + mir_tstrlen(szReplacement), cur + mir_tstrlen(szEol), (mir_tstrlen(cur + mir_tstrlen(szEol)) + 1)*sizeof(TCHAR));
- memcpy(cur, szReplacement, mir_tstrlen(szReplacement)*sizeof(TCHAR));
+ memmove(cur + mir_tstrlen(szReplacement), cur + mir_tstrlen(szEol), (mir_tstrlen(cur + mir_tstrlen(szEol)) + 1)*sizeof(wchar_t));
+ memcpy(cur, szReplacement, mir_tstrlen(szReplacement)*sizeof(wchar_t));
pos += mir_tstrlen(szReplacement) - 1;
}
}
- return (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(TCHAR));
+ return (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(wchar_t));
}
-static TCHAR *parseInsert(ARGUMENTSINFO *ai)
+static wchar_t *parseInsert(ARGUMENTSINFO *ai)
{
if (ai->argc != 4)
return NULL;
@@ -164,18 +164,18 @@ static TCHAR *parseInsert(ARGUMENTSINFO *ai) if (pos > mir_tstrlen(ai->targv[1]))
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((mir_tstrlen(ai->targv[1]) + mir_tstrlen(ai->targv[2]) + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((mir_tstrlen(ai->targv[1]) + mir_tstrlen(ai->targv[2]) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((mir_tstrlen(ai->targv[1]) + mir_tstrlen(ai->targv[2]) + 1) * sizeof(TCHAR)));
- _tcsncpy(res, ai->targv[1], pos);
+ memset(res, 0, ((mir_tstrlen(ai->targv[1]) + mir_tstrlen(ai->targv[2]) + 1) * sizeof(wchar_t)));
+ wcsncpy(res, ai->targv[1], pos);
mir_tstrcpy(res + pos, ai->targv[2]);
mir_tstrcpy(res + pos + mir_tstrlen(ai->targv[2]), ai->targv[1] + pos);
return res;
}
-static TCHAR *parseLeft(ARGUMENTSINFO *ai)
+static wchar_t *parseLeft(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -185,16 +185,16 @@ static TCHAR *parseLeft(ARGUMENTSINFO *ai) return NULL;
len = min(len, (signed int)mir_tstrlen(ai->targv[1]));
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((len + 1) * sizeof(TCHAR)));
- _tcsncpy(res, ai->targv[1], len);
+ memset(res, 0, ((len + 1) * sizeof(wchar_t)));
+ wcsncpy(res, ai->targv[1], len);
return res;
}
-static TCHAR *parseLen(ARGUMENTSINFO *ai)
+static wchar_t *parseLen(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -202,15 +202,15 @@ static TCHAR *parseLen(ARGUMENTSINFO *ai) return itot((int)mir_tstrlen(ai->targv[1]));
}
-static TCHAR *parseLineCount(ARGUMENTSINFO *ai)
+static wchar_t *parseLineCount(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
int count = 1;
- TCHAR *cur = ai->targv[1];
+ wchar_t *cur = ai->targv[1];
while (cur < (ai->targv[1] + mir_tstrlen(ai->targv[1]))) {
- if (!_tcsncmp(cur, L"\r\n", 2)) {
+ if (!wcsncmp(cur, L"\r\n", 2)) {
count++;
cur++;
}
@@ -223,19 +223,19 @@ static TCHAR *parseLineCount(ARGUMENTSINFO *ai) return itot(count);
}
-static TCHAR *parseLower(ARGUMENTSINFO *ai)
+static wchar_t *parseLower(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
- TCHAR *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *res = mir_tstrdup(ai->targv[1]);
if (res == NULL)
return NULL;
return CharLower(res);
}
-static TCHAR *parseLongest(ARGUMENTSINFO *ai)
+static wchar_t *parseLongest(ARGUMENTSINFO *ai)
{
if (ai->argc < 2)
return NULL;
@@ -248,7 +248,7 @@ static TCHAR *parseLongest(ARGUMENTSINFO *ai) return mir_tstrdup(ai->targv[iLong]);
}
-static TCHAR *parseNoOp(ARGUMENTSINFO *ai)
+static wchar_t *parseNoOp(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -256,9 +256,9 @@ static TCHAR *parseNoOp(ARGUMENTSINFO *ai) return mir_tstrdup(ai->targv[1]);
}
-static TCHAR *parsePad(ARGUMENTSINFO *ai)
+static wchar_t *parsePad(ARGUMENTSINFO *ai)
{
- TCHAR padchar;
+ wchar_t padchar;
switch (ai->argc) {
case 3: padchar = ' '; break;
case 4: padchar = *ai->targv[3]; break;
@@ -270,12 +270,12 @@ static TCHAR *parsePad(ARGUMENTSINFO *ai) return NULL;
unsigned int addcount = max(padding - (signed int)mir_tstrlen(ai->targv[1]), 0);
- TCHAR *res = (TCHAR*)mir_alloc((addcount + mir_tstrlen(ai->targv[1]) + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((addcount + mir_tstrlen(ai->targv[1]) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((addcount + mir_tstrlen(ai->targv[1]) + 1) * sizeof(TCHAR)));
- TCHAR *cur = res;
+ memset(res, 0, ((addcount + mir_tstrlen(ai->targv[1]) + 1) * sizeof(wchar_t)));
+ wchar_t *cur = res;
for (unsigned int i = 0; i < addcount; i++)
*cur++ = padchar;
@@ -283,9 +283,9 @@ static TCHAR *parsePad(ARGUMENTSINFO *ai) return res;
}
-static TCHAR *parsePadright(ARGUMENTSINFO *ai)
+static wchar_t *parsePadright(ARGUMENTSINFO *ai)
{
- TCHAR padchar;
+ wchar_t padchar;
switch (ai->argc) {
case 3: padchar = ' '; break;
case 4: padchar = *ai->targv[3]; break;
@@ -297,22 +297,22 @@ static TCHAR *parsePadright(ARGUMENTSINFO *ai) return NULL;
unsigned int addcount = max(padding - (signed int)mir_tstrlen(ai->targv[1]), 0);
- TCHAR *res = (TCHAR*)mir_alloc((addcount + mir_tstrlen(ai->targv[1]) + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((addcount + mir_tstrlen(ai->targv[1]) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((addcount + mir_tstrlen(ai->targv[1]) + 1) * sizeof(TCHAR)));
+ memset(res, 0, ((addcount + mir_tstrlen(ai->targv[1]) + 1) * sizeof(wchar_t)));
mir_tstrcpy(res, ai->targv[1]);
- TCHAR *cur = res + mir_tstrlen(ai->targv[1]);
+ wchar_t *cur = res + mir_tstrlen(ai->targv[1]);
for (unsigned int i = 0; i < addcount; i++)
*cur++ = padchar;
return res;
}
-static TCHAR *parsePadcut(ARGUMENTSINFO *ai)
+static wchar_t *parsePadcut(ARGUMENTSINFO *ai)
{
- TCHAR padchar;
+ wchar_t padchar;
switch (ai->argc) {
case 3: padchar = ' '; break;
case 4: padchar = *ai->targv[3]; break;
@@ -324,24 +324,24 @@ static TCHAR *parsePadcut(ARGUMENTSINFO *ai) return NULL;
int addcount = max(padding - (signed int)mir_tstrlen(ai->targv[1]), 0);
- TCHAR *res = (TCHAR*)mir_alloc((padding + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((padding + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((padding + 1) * sizeof(TCHAR)));
- TCHAR *cur = res;
+ memset(res, 0, ((padding + 1) * sizeof(wchar_t)));
+ wchar_t *cur = res;
for (int i = 0; i < addcount; i++)
*cur++ = padchar;
if (padding > addcount)
- _tcsncpy(res + addcount, ai->targv[1], padding - addcount);
+ wcsncpy(res + addcount, ai->targv[1], padding - addcount);
return res;
}
-static TCHAR *parsePadcutright(ARGUMENTSINFO *ai)
+static wchar_t *parsePadcutright(ARGUMENTSINFO *ai)
{
- TCHAR padchar;
+ wchar_t padchar;
switch (ai->argc) {
case 3: padchar = ' '; break;
case 4: padchar = *ai->targv[3]; break;
@@ -353,22 +353,22 @@ static TCHAR *parsePadcutright(ARGUMENTSINFO *ai) return NULL;
int addcount = max(padding - (signed int)mir_tstrlen(ai->targv[1]), 0);
- TCHAR *res = (TCHAR*)mir_alloc((padding + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((padding + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((padding + 1) * sizeof(TCHAR)));
- TCHAR *cur = res + padding - addcount;
+ memset(res, 0, ((padding + 1) * sizeof(wchar_t)));
+ wchar_t *cur = res + padding - addcount;
for (int i = 0; i < addcount; i++)
*cur++ = padchar;
if (padding > addcount)
- _tcsncpy(res, ai->targv[1], padding - addcount);
+ wcsncpy(res, ai->targv[1], padding - addcount);
return res;
}
-static TCHAR *parseRepeat(ARGUMENTSINFO *ai)
+static wchar_t *parseRepeat(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -377,49 +377,49 @@ static TCHAR *parseRepeat(ARGUMENTSINFO *ai) if (count < 0)
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((count * mir_tstrlen(ai->targv[1]) + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((count * mir_tstrlen(ai->targv[1]) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((count * mir_tstrlen(ai->targv[1]) + 1) * sizeof(TCHAR)));
+ memset(res, 0, ((count * mir_tstrlen(ai->targv[1]) + 1) * sizeof(wchar_t)));
for (int i = 0; i < count; i++)
mir_tstrcat(res, ai->targv[1]);
return res;
}
-static TCHAR *parseReplace(ARGUMENTSINFO *ai)
+static wchar_t *parseReplace(ARGUMENTSINFO *ai)
{
if ((ai->argc < 4) || (ai->argc % 2 != 0))
return NULL;
- TCHAR *cur;
+ wchar_t *cur;
size_t pos = 0;
- TCHAR *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *res = mir_tstrdup(ai->targv[1]);
for (size_t i = 2; i < ai->argc; i += 2) {
if (mir_tstrlen(ai->targv[i]) == 0)
continue;
for (pos = 0; pos<mir_tstrlen(res); pos++) {
cur = res + pos;
- if (!_tcsncmp(cur, ai->targv[i], mir_tstrlen(ai->targv[i]))) {
+ if (!wcsncmp(cur, ai->targv[i], mir_tstrlen(ai->targv[i]))) {
if (mir_tstrlen(ai->targv[i + 1]) > mir_tstrlen(ai->targv[i])) {
- res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(ai->targv[i + 1]) - mir_tstrlen(ai->targv[i]) + 1)*sizeof(TCHAR));
+ res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(ai->targv[i + 1]) - mir_tstrlen(ai->targv[i]) + 1)*sizeof(wchar_t));
cur = res + pos;
}
- memmove(cur + mir_tstrlen(ai->targv[i + 1]), cur + mir_tstrlen(ai->targv[i]), (mir_tstrlen(cur + mir_tstrlen(ai->targv[i])) + 1)*sizeof(TCHAR));
- memcpy(cur, ai->targv[i + 1], mir_tstrlen(ai->targv[i + 1])*sizeof(TCHAR));
+ memmove(cur + mir_tstrlen(ai->targv[i + 1]), cur + mir_tstrlen(ai->targv[i]), (mir_tstrlen(cur + mir_tstrlen(ai->targv[i])) + 1)*sizeof(wchar_t));
+ memcpy(cur, ai->targv[i + 1], mir_tstrlen(ai->targv[i + 1])*sizeof(wchar_t));
pos += mir_tstrlen(ai->targv[i + 1]) - 1;
}
}
- res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(TCHAR));
+ res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(wchar_t));
}
return res;
}
-static TCHAR *parseRight(ARGUMENTSINFO *ai)
+static wchar_t *parseRight(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -429,19 +429,19 @@ static TCHAR *parseRight(ARGUMENTSINFO *ai) return NULL;
len = min(len, (signed int)mir_tstrlen(ai->targv[1]));
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((len + 1)*sizeof(TCHAR)));
- _tcsncpy(res, ai->targv[1] + mir_tstrlen(ai->targv[1]) - len, len);
+ memset(res, 0, ((len + 1)*sizeof(wchar_t)));
+ wcsncpy(res, ai->targv[1] + mir_tstrlen(ai->targv[1]) - len, len);
return res;
}
/*
string, display size, scroll amount
*/
-static TCHAR *parseScroll(ARGUMENTSINFO *ai)
+static wchar_t *parseScroll(ARGUMENTSINFO *ai)
{
if (ai->argc != 4)
return NULL;
@@ -454,21 +454,21 @@ static TCHAR *parseScroll(ARGUMENTSINFO *ai) if (display > mir_tstrlen(ai->targv[1]))
display = (unsigned)mir_tstrlen(ai->targv[1]);
- TCHAR *res = (TCHAR*)mir_alloc((2 * mir_tstrlen(ai->targv[1]) + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((2 * mir_tstrlen(ai->targv[1]) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((2 * mir_tstrlen(ai->targv[1]) + 1) * sizeof(TCHAR)));
+ memset(res, 0, ((2 * mir_tstrlen(ai->targv[1]) + 1) * sizeof(wchar_t)));
mir_tstrcpy(res, ai->targv[1]);
mir_tstrcat(res, ai->targv[1]);
- memmove(res, res + move, (mir_tstrlen(res + move) + 1)*sizeof(TCHAR));
+ memmove(res, res + move, (mir_tstrlen(res + move) + 1)*sizeof(wchar_t));
*(res + display) = 0;
- res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(TCHAR));
+ res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(wchar_t));
return res;
}
-static TCHAR *parseShortest(ARGUMENTSINFO *ai)
+static wchar_t *parseShortest(ARGUMENTSINFO *ai)
{
if (ai->argc <= 1)
return NULL;
@@ -481,21 +481,21 @@ static TCHAR *parseShortest(ARGUMENTSINFO *ai) return mir_tstrdup(ai->targv[iShort]);
}
-static TCHAR *parseStrchr(ARGUMENTSINFO *ai)
+static wchar_t *parseStrchr(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
char *szVal[34];
memset(szVal, 0, sizeof(szVal));
- TCHAR *c = _tcschr(ai->targv[1], *ai->targv[2]);
+ wchar_t *c = wcschr(ai->targv[1], *ai->targv[2]);
if (c == NULL || *c == 0)
return mir_tstrdup(L"0");
return itot(c - ai->targv[1] + 1);
}
-static TCHAR *parseStrcmp(ARGUMENTSINFO *ai)
+static wchar_t *parseStrcmp(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -506,7 +506,7 @@ static TCHAR *parseStrcmp(ARGUMENTSINFO *ai) return mir_tstrdup(L"");
}
-static TCHAR *parseStrmcmp(ARGUMENTSINFO *ai)
+static wchar_t *parseStrmcmp(ARGUMENTSINFO *ai)
{
if (ai->argc < 3)
return NULL;
@@ -522,7 +522,7 @@ static TCHAR *parseStrmcmp(ARGUMENTSINFO *ai) return mir_tstrdup(L"");
}
-static TCHAR *parseStrncmp(ARGUMENTSINFO *ai)
+static wchar_t *parseStrncmp(ARGUMENTSINFO *ai)
{
if (ai->argc != 4)
return NULL;
@@ -531,13 +531,13 @@ static TCHAR *parseStrncmp(ARGUMENTSINFO *ai) if (n <= 0)
return NULL;
- if (_tcsncmp(ai->targv[1], ai->targv[2], n))
+ if (wcsncmp(ai->targv[1], ai->targv[2], n))
ai->flags |= AIF_FALSE;
return mir_tstrdup(L"");
}
-static TCHAR *parseStricmp(ARGUMENTSINFO *ai)
+static wchar_t *parseStricmp(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -548,7 +548,7 @@ static TCHAR *parseStricmp(ARGUMENTSINFO *ai) return mir_tstrdup(L"");
}
-static TCHAR *parseStrnicmp(ARGUMENTSINFO *ai)
+static wchar_t *parseStrnicmp(ARGUMENTSINFO *ai)
{
if (ai->argc != 4)
return NULL;
@@ -557,37 +557,37 @@ static TCHAR *parseStrnicmp(ARGUMENTSINFO *ai) if (n <= 0)
return NULL;
- if (_tcsnicmp(ai->targv[1], ai->targv[2], n))
+ if (wcsnicmp(ai->targv[1], ai->targv[2], n))
ai->flags |= AIF_FALSE;
return mir_tstrdup(L"");
}
-static TCHAR *parseStrrchr(ARGUMENTSINFO *ai)
+static wchar_t *parseStrrchr(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
- TCHAR *c = _tcsrchr(ai->targv[1], *ai->targv[2]);
+ wchar_t *c = wcsrchr(ai->targv[1], *ai->targv[2]);
if ((c == NULL) || (*c == 0))
return mir_tstrdup(L"0");
return itot(c - ai->targv[1] + 1);
}
-static TCHAR *parseStrstr(ARGUMENTSINFO *ai)
+static wchar_t *parseStrstr(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
- TCHAR *c = _tcsstr(ai->targv[1], ai->targv[2]);
+ wchar_t *c = wcsstr(ai->targv[1], ai->targv[2]);
if ((c == NULL) || (*c == 0))
return mir_tstrdup(L"0");
return itot(c - ai->targv[1] + 1);
}
-static TCHAR *parseSubstr(ARGUMENTSINFO *ai)
+static wchar_t *parseSubstr(ARGUMENTSINFO *ai)
{
if (ai->argc < 3)
return NULL;
@@ -601,13 +601,13 @@ static TCHAR *parseSubstr(ARGUMENTSINFO *ai) if (to < from)
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((to - from + 1)*sizeof(TCHAR));
- memset(res, 0, ((to - from + 1) * sizeof(TCHAR)));
- _tcsncpy(res, ai->targv[1] + from, to - from);
+ wchar_t *res = (wchar_t*)mir_alloc((to - from + 1)*sizeof(wchar_t));
+ memset(res, 0, ((to - from + 1) * sizeof(wchar_t)));
+ wcsncpy(res, ai->targv[1] + from, to - from);
return res;
}
-static TCHAR *parseSelect(ARGUMENTSINFO *ai)
+static wchar_t *parseSelect(ARGUMENTSINFO *ai)
{
if (ai->argc <= 1)
return NULL;
@@ -619,7 +619,7 @@ static TCHAR *parseSelect(ARGUMENTSINFO *ai) return mir_tstrdup(ai->targv[n + 1]);
}
-static TCHAR *parseSwitch(ARGUMENTSINFO *ai)
+static wchar_t *parseSwitch(ARGUMENTSINFO *ai)
{
if (ai->argc % 2 != 0)
return NULL;
@@ -631,33 +631,33 @@ static TCHAR *parseSwitch(ARGUMENTSINFO *ai) return NULL;
}
-static TCHAR *parseTrim(ARGUMENTSINFO *ai)
+static wchar_t *parseTrim(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
- TCHAR *scur = ai->targv[1];
+ wchar_t *scur = ai->targv[1];
while (*scur == ' ')
scur++;
- TCHAR *ecur = ai->targv[1] + mir_tstrlen(ai->targv[1]) - 1;
+ wchar_t *ecur = ai->targv[1] + mir_tstrlen(ai->targv[1]) - 1;
while ((*ecur == ' ') && (ecur > ai->targv[1]))
ecur--;
if (scur >= ecur)
return mir_tstrdup(L"");
- TCHAR *res = (TCHAR*)mir_alloc((ecur - scur + 2)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((ecur - scur + 2)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((ecur - scur + 2) * sizeof(TCHAR)));
- _tcsncpy(res, scur, ecur - scur + 1);
+ memset(res, 0, ((ecur - scur + 2) * sizeof(wchar_t)));
+ wcsncpy(res, scur, ecur - scur + 1);
return res;
}
-static TCHAR *parseTab(ARGUMENTSINFO *ai)
+static wchar_t *parseTab(ARGUMENTSINFO *ai)
{
int count = 1;
if ((ai->argc == 2) && (mir_tstrlen(ai->targv[1]) > 0))
@@ -666,37 +666,37 @@ static TCHAR *parseTab(ARGUMENTSINFO *ai) if (count < 0)
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((count + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((count + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, (count + 1)*sizeof(TCHAR));
- TCHAR *cur = res;
+ memset(res, 0, (count + 1)*sizeof(wchar_t));
+ wchar_t *cur = res;
for (int i = 0; i < count; i++)
*cur++ = '\t';
return res;
}
-static TCHAR *parseUpper(ARGUMENTSINFO *ai)
+static wchar_t *parseUpper(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
- TCHAR *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *res = mir_tstrdup(ai->targv[1]);
if (res == NULL)
return NULL;
return CharUpper(res);
}
-static TCHAR *getNthWord(TCHAR *szString, int w)
+static wchar_t *getNthWord(wchar_t *szString, int w)
{
if (szString == NULL)
return NULL;
int count = 0;
- TCHAR *scur = szString;
+ wchar_t *scur = szString;
while (*scur == ' ')
scur++;
@@ -714,25 +714,25 @@ static TCHAR *getNthWord(TCHAR *szString, int w) if (count != w)
return NULL;
- TCHAR *ecur = scur;
+ wchar_t *ecur = scur;
while ((*ecur != ' ') && (*ecur != 0))
ecur++;
- TCHAR *res = (TCHAR*)mir_alloc((ecur - scur + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((ecur - scur + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((ecur - scur + 1) * sizeof(TCHAR)));
- _tcsncpy(res, scur, ecur - scur);
+ memset(res, 0, ((ecur - scur + 1) * sizeof(wchar_t)));
+ wcsncpy(res, scur, ecur - scur);
return res;
}
-static TCHAR *parseWord(ARGUMENTSINFO *ai)
+static wchar_t *parseWord(ARGUMENTSINFO *ai)
{
if (ai->argc < 3 || ai->argc > 4)
return NULL;
- TCHAR *res = NULL;
+ wchar_t *res = NULL;
int to, from = ttoi(ai->targv[2]);
if (ai->argc == 4) {
if (mir_tstrlen(ai->targv[3]) > 0)
@@ -746,12 +746,12 @@ static TCHAR *parseWord(ARGUMENTSINFO *ai) return NULL;
for (int i = from; i <= to; i++) {
- TCHAR *szWord = getNthWord(ai->targv[1], i);
+ wchar_t *szWord = getNthWord(ai->targv[1], i);
if (szWord == NULL)
return res;
if (res != NULL) {
- TCHAR *pres = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(szWord) + 2)*sizeof(TCHAR));
+ wchar_t *pres = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(szWord) + 2)*sizeof(wchar_t));
if (pres != NULL) {
res = pres;
mir_tstrcat(res, L" ");
@@ -765,7 +765,7 @@ static TCHAR *parseWord(ARGUMENTSINFO *ai) return res;
}
-static TCHAR *parseExtratext(ARGUMENTSINFO *ai)
+static wchar_t *parseExtratext(ARGUMENTSINFO *ai)
{
if (ai->argc > 1)
return NULL;
diff --git a/plugins/Variables/src/parse_system.cpp b/plugins/Variables/src/parse_system.cpp index 43695c7db0..370c84881e 100644 --- a/plugins/Variables/src/parse_system.cpp +++ b/plugins/Variables/src/parse_system.cpp @@ -19,14 +19,14 @@ #include "stdafx.h"
-static TCHAR *parseComputerName(ARGUMENTSINFO *ai)
+static wchar_t *parseComputerName(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
ai->flags |= AIF_DONTPARSE;
DWORD len = MAX_COMPUTERNAME_LENGTH;
- TCHAR *res = (TCHAR*)mir_calloc((len + 1) * sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_calloc((len + 1) * sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -40,13 +40,13 @@ static TCHAR *parseComputerName(ARGUMENTSINFO *ai) #include <pdh.h>
#include <pdhmsg.h>
-static TCHAR *parseCpuLoad(ARGUMENTSINFO *ai)
+static wchar_t *parseCpuLoad(ARGUMENTSINFO *ai)
{
HQUERY hQuery;
PDH_FMT_COUNTERVALUE cValue;
HCOUNTER hCounter;
- TCHAR *szCounter, szVal[32];
+ wchar_t *szCounter, szVal[32];
if (ai->argc != 2)
return NULL;
@@ -55,7 +55,7 @@ static TCHAR *parseCpuLoad(ARGUMENTSINFO *ai) szCounter = mir_tstrdup(L"\\Processor(_Total)\\% Processor Time");
else {
int size = (int)mir_tstrlen(ai->targv[1]) + 32;
- szCounter = (TCHAR *)mir_alloc(size * sizeof(TCHAR));
+ szCounter = (wchar_t *)mir_alloc(size * sizeof(wchar_t));
if (szCounter == NULL)
return NULL;
@@ -113,16 +113,16 @@ static TCHAR *parseCpuLoad(ARGUMENTSINFO *ai) return mir_tstrdup(szVal);
}
-static TCHAR *parseCurrentDate(ARGUMENTSINFO *ai)
+static wchar_t *parseCurrentDate(ARGUMENTSINFO *ai)
{
- TCHAR *szFormat;
+ wchar_t *szFormat;
if (ai->argc == 1 || (ai->argc > 1 && mir_tstrlen(ai->targv[1]) == 0))
szFormat = NULL;
else
szFormat = ai->targv[1];
int len = GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, szFormat, NULL, 0);
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -134,16 +134,16 @@ static TCHAR *parseCurrentDate(ARGUMENTSINFO *ai) return res;
}
-static TCHAR *parseCurrentTime(ARGUMENTSINFO *ai)
+static wchar_t *parseCurrentTime(ARGUMENTSINFO *ai)
{
- TCHAR *szFormat;
+ wchar_t *szFormat;
if (ai->argc == 1 || (ai->argc > 1) && (mir_tstrlen(ai->targv[1]) == 0))
szFormat = NULL;
else
szFormat = ai->targv[1];
int len = GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, szFormat, NULL, 0);
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -155,7 +155,7 @@ static TCHAR *parseCurrentTime(ARGUMENTSINFO *ai) return res;
}
-static TCHAR *parseDirectory(ARGUMENTSINFO *ai)
+static wchar_t *parseDirectory(ARGUMENTSINFO *ai)
{
if (ai->argc < 2 || ai->argc > 3)
return NULL;
@@ -181,8 +181,8 @@ static TCHAR *parseDirectory(ARGUMENTSINFO *ai) if (ai->targv[1][bi - 1] == '\\')
break;
- TCHAR *res = (TCHAR*)mir_alloc((ei - bi + 1) * sizeof(TCHAR));
- _tcsncpy(res, ai->targv[1] + bi, ei - bi);
+ wchar_t *res = (wchar_t*)mir_alloc((ei - bi + 1) * sizeof(wchar_t));
+ wcsncpy(res, ai->targv[1] + bi, ei - bi);
res[ei - bi] = 0;
return res;
}
@@ -191,7 +191,7 @@ static TCHAR *parseDirectory(ARGUMENTSINFO *ai) path, depth
returns complete path up to "path depth - depth"
*/
-static TCHAR *parseDirectory2(ARGUMENTSINFO *ai)
+static wchar_t *parseDirectory2(ARGUMENTSINFO *ai)
{
if (ai->argc < 2 || ai->argc > 3)
return NULL;
@@ -203,7 +203,7 @@ static TCHAR *parseDirectory2(ARGUMENTSINFO *ai) if (depth <= 0)
return NULL;
- TCHAR *ecur = ai->targv[1] + mir_tstrlen(ai->targv[1]);
+ wchar_t *ecur = ai->targv[1] + mir_tstrlen(ai->targv[1]);
while (depth > 0) {
while ((*ecur != '\\') && (ecur > ai->targv[1]))
ecur--;
@@ -214,32 +214,32 @@ static TCHAR *parseDirectory2(ARGUMENTSINFO *ai) depth -= 1;
ecur--;
}
- TCHAR *res = (TCHAR*)mir_calloc((ecur - ai->targv[1] + 2) * sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_calloc((ecur - ai->targv[1] + 2) * sizeof(wchar_t));
if (res == NULL)
return NULL;
- _tcsncpy(res, ai->targv[1], (ecur - ai->targv[1]) + 1);
+ wcsncpy(res, ai->targv[1], (ecur - ai->targv[1]) + 1);
return res;
}
-static int getTime(TCHAR *szTime, struct tm *date)
+static int getTime(wchar_t *szTime, struct tm *date)
{
// do some extra checks here
- TCHAR *cur = szTime;
+ wchar_t *cur = szTime;
if (cur >= szTime + mir_tstrlen(szTime))
return -1;
- date->tm_mon = _tcstoul(cur, &cur, 10) - 1;
+ date->tm_mon = wcstoul(cur, &cur, 10) - 1;
cur++;
if (cur >= szTime + mir_tstrlen(szTime))
return -1;
- date->tm_mday = _tcstoul(cur, &cur, 10);
+ date->tm_mday = wcstoul(cur, &cur, 10);
cur++;
if (cur >= szTime + mir_tstrlen(szTime))
return -1;
- date->tm_year = _tcstoul(cur, &cur, 10);
+ date->tm_year = wcstoul(cur, &cur, 10);
if (date->tm_year > 2000)
date->tm_year -= 2000;
else if (date->tm_year > 1900)
@@ -250,24 +250,24 @@ static int getTime(TCHAR *szTime, struct tm *date) if (cur >= szTime + mir_tstrlen(szTime))
return -1;
- date->tm_hour = _tcstoul(cur, &cur, 10);
+ date->tm_hour = wcstoul(cur, &cur, 10);
cur++;
if (cur >= szTime + mir_tstrlen(szTime))
return -1;
- date->tm_min = _tcstoul(cur, &cur, 10);
+ date->tm_min = wcstoul(cur, &cur, 10);
cur++;
if (cur >= szTime + mir_tstrlen(szTime))
return -1;
- date->tm_sec = _tcstoul(cur, &cur, 10);
+ date->tm_sec = wcstoul(cur, &cur, 10);
return 0;
}
-static TCHAR *parseDiffTime(ARGUMENTSINFO *ai)
+static wchar_t *parseDiffTime(ARGUMENTSINFO *ai)
{
struct tm t0, t1;
- TCHAR szTime[32];
+ wchar_t szTime[32];
double diff;
if (ai->argc != 3)
@@ -287,7 +287,7 @@ static TCHAR *parseDiffTime(ARGUMENTSINFO *ai) return mir_tstrdup(szTime);
}
-static TCHAR *parseDirExists(ARGUMENTSINFO *ai)
+static wchar_t *parseDirExists(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -301,7 +301,7 @@ static TCHAR *parseDirExists(ARGUMENTSINFO *ai) return mir_tstrdup(L"");
}
-static TCHAR *parseEnvironmentVariable(ARGUMENTSINFO *ai)
+static wchar_t *parseEnvironmentVariable(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -310,11 +310,11 @@ static TCHAR *parseEnvironmentVariable(ARGUMENTSINFO *ai) if (len <= 0)
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((len + 1) * sizeof(TCHAR)));
+ memset(res, 0, ((len + 1) * sizeof(wchar_t)));
if (ExpandEnvironmentStrings(ai->targv[1], res, len) == 0) {
mir_free(res);
return NULL;
@@ -322,7 +322,7 @@ static TCHAR *parseEnvironmentVariable(ARGUMENTSINFO *ai) return res;
}
-static TCHAR *parseFileExists(ARGUMENTSINFO *ai)
+static wchar_t *parseFileExists(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -336,7 +336,7 @@ static TCHAR *parseFileExists(ARGUMENTSINFO *ai) return mir_tstrdup(L"");
}
-static TCHAR *parseFindWindow(ARGUMENTSINFO *ai)
+static wchar_t *parseFindWindow(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -349,8 +349,8 @@ static TCHAR *parseFindWindow(ARGUMENTSINFO *ai) if (len == 0)
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
- memset(res, 0, ((len + 1) * sizeof(TCHAR)));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
+ memset(res, 0, ((len + 1) * sizeof(wchar_t)));
GetWindowText(hWin, res, len + 1);
return res;
}
@@ -359,19 +359,19 @@ static TCHAR *parseFindWindow(ARGUMENTSINFO *ai) // 2 = filter
// 3 = sperator
// 4 = [f]iles, [d]irs
-static TCHAR *parseListDir(ARGUMENTSINFO *ai)
+static wchar_t *parseListDir(ARGUMENTSINFO *ai)
{
if (ai->argc < 2)
return NULL;
- TCHAR tszFirst[MAX_PATH], *tszRes, *tszSeperator, *tszFilter;
+ wchar_t tszFirst[MAX_PATH], *tszRes, *tszSeperator, *tszFilter;
tszFirst[0] = 0;
tszSeperator = L"\r\n";
tszFilter = L"*";
tszRes = NULL;
if (ai->argc > 1)
- _tcsncpy(tszFirst, ai->targv[1], _countof(tszFirst) - 1);
+ wcsncpy(tszFirst, ai->targv[1], _countof(tszFirst) - 1);
if (ai->argc > 2)
tszFilter = ai->targv[2];
@@ -399,17 +399,17 @@ static TCHAR *parseListDir(ARGUMENTSINFO *ai) return NULL;
}
if (((ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && (bDirs)) || ((!(ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) && (bFiles))) {
- tszRes = (TCHAR*)mir_alloc((mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(TCHAR));
+ tszRes = (wchar_t*)mir_alloc((mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(wchar_t));
mir_tstrcpy(tszRes, ffd.cFileName);
}
while (FindNextFile(hFind, &ffd) != 0) {
if (((ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && (bDirs)) || ((!(ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) && (bFiles))) {
if (tszRes != NULL) {
mir_tstrcat(tszRes, tszSeperator);
- tszRes = (TCHAR*)mir_realloc(tszRes, (mir_tstrlen(tszRes) + mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(TCHAR));
+ tszRes = (wchar_t*)mir_realloc(tszRes, (mir_tstrlen(tszRes) + mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(wchar_t));
}
else {
- tszRes = (TCHAR*)mir_alloc((mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(TCHAR));
+ tszRes = (wchar_t*)mir_alloc((mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(wchar_t));
mir_tstrcpy(tszRes, L"");
}
mir_tstrcat(tszRes, ffd.cFileName);
@@ -430,7 +430,7 @@ static BOOL CALLBACK MyProcessEnumerator(DWORD, WORD, char *szProcess, LPARAM lP return TRUE;
}
-static TCHAR *parseProcessRunning(ARGUMENTSINFO *ai)
+static wchar_t *parseProcessRunning(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -447,18 +447,18 @@ static TCHAR *parseProcessRunning(ARGUMENTSINFO *ai) }
#endif
-static TCHAR *parseRegistryValue(ARGUMENTSINFO *ai)
+static wchar_t *parseRegistryValue(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
DWORD len, type;
- TCHAR *key = mir_tstrdup(ai->targv[1]);
+ wchar_t *key = mir_tstrdup(ai->targv[1]);
if (key == NULL)
return NULL;
- TCHAR *cur = _tcschr(key, '\\');
+ wchar_t *cur = wcschr(key, '\\');
if (cur == NULL) {
mir_free(key);
return NULL;
@@ -478,18 +478,18 @@ static TCHAR *parseRegistryValue(ARGUMENTSINFO *ai) mir_free(key);
return NULL;
}
- TCHAR *subKey = cur + 1;
+ wchar_t *subKey = cur + 1;
if (RegOpenKeyEx(hKey, subKey, 0, KEY_READ, &hKey) != ERROR_SUCCESS) {
mir_free(key);
return NULL;
}
mir_free(key);
len = MAX_REGVALUE_LENGTH + 1;
- TCHAR *res = (TCHAR*)mir_alloc(len*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc(len*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, (len * sizeof(TCHAR)));
+ memset(res, 0, (len * sizeof(wchar_t)));
int err = RegQueryValueEx(hKey, ai->targv[2], NULL, &type, (BYTE*)res, &len);
if ((err != ERROR_SUCCESS) || (type != REG_SZ)) {
RegCloseKey(hKey);
@@ -519,13 +519,13 @@ static int TsToSystemTime(SYSTEMTIME *sysTime, time_t timestamp) return 0;
}
-static TCHAR *parseTimestamp2Date(ARGUMENTSINFO *ai)
+static wchar_t *parseTimestamp2Date(ARGUMENTSINFO *ai)
{
if (ai->argc <= 1)
return NULL;
SYSTEMTIME sysTime;
- TCHAR *szFormat;
+ wchar_t *szFormat;
time_t timestamp = ttoi(ai->targv[1]);
if (timestamp == 0)
return NULL;
@@ -539,7 +539,7 @@ static TCHAR *parseTimestamp2Date(ARGUMENTSINFO *ai) return NULL;
int len = GetDateFormat(LOCALE_USER_DEFAULT, 0, &sysTime, szFormat, NULL, 0);
- TCHAR *res = (TCHAR*)mir_calloc((len + 1) * sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_calloc((len + 1) * sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -551,7 +551,7 @@ static TCHAR *parseTimestamp2Date(ARGUMENTSINFO *ai) return res;
}
-static TCHAR *parseTimestamp2Time(ARGUMENTSINFO *ai)
+static wchar_t *parseTimestamp2Time(ARGUMENTSINFO *ai)
{
if (ai->argc <= 1)
return NULL;
@@ -561,7 +561,7 @@ static TCHAR *parseTimestamp2Time(ARGUMENTSINFO *ai) if (timestamp == 0)
return NULL;
- TCHAR *szFormat;
+ wchar_t *szFormat;
if ((ai->argc == 2) || ((ai->argc > 2) && (mir_tstrlen(ai->targv[2]) == 0)))
szFormat = NULL;
else
@@ -571,7 +571,7 @@ static TCHAR *parseTimestamp2Time(ARGUMENTSINFO *ai) return NULL;
int len = GetTimeFormat(LOCALE_USER_DEFAULT, 0, &sysTime, szFormat, NULL, 0);
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -583,7 +583,7 @@ static TCHAR *parseTimestamp2Time(ARGUMENTSINFO *ai) return res;
}
-static TCHAR *parseTextFile(ARGUMENTSINFO *ai)
+static wchar_t *parseTextFile(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -603,15 +603,15 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) unsigned int icur, bufSz;
DWORD readSz, totalReadSz;
unsigned long linePos;
- TCHAR tUC, *res;
+ wchar_t tUC, *res;
BYTE *pBuf, *pCur;
- ReadFile(hFile, &tUC, sizeof(TCHAR), &readSz, NULL);
- if (tUC != (TCHAR)0xFEFF) {
+ ReadFile(hFile, &tUC, sizeof(wchar_t), &readSz, NULL);
+ if (tUC != (wchar_t)0xFEFF) {
tUC = 0;
csz = sizeof(char);
SetFilePointer(hFile, 0, NULL, FILE_BEGIN);
}
- else csz = sizeof(TCHAR);
+ else csz = sizeof(wchar_t);
totalReadSz = 0;
lineCount = 1;
@@ -632,7 +632,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) CloseHandle(hFile);
if (tUC)
- res = (TCHAR*)pBuf;
+ res = (wchar_t*)pBuf;
else {
res = mir_a2t((char *)pBuf);
mir_free(pBuf);
@@ -659,11 +659,11 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) totalReadSz += readSz;
for (pCur = pBuf; *pCur != '\0'; pCur += csz) {
if (tUC) {
- if (!_tcsncmp((TCHAR*)pCur, L"\r\n", 2)) {
+ if (!wcsncmp((wchar_t*)pCur, L"\r\n", 2)) {
lineCount++;
pCur += csz;
}
- else if (*(TCHAR*)pCur == '\n')
+ else if (*(wchar_t*)pCur == '\n')
lineCount++;
}
else {
@@ -699,11 +699,11 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) linePos = (tUC ? csz : 0) + totalReadSz - readSz + pCur - pBuf;
if (tUC) {
- if (!_tcsncmp((TCHAR*)pCur, L"\r\n", 2)) {
+ if (!wcsncmp((wchar_t*)pCur, L"\r\n", 2)) {
lineCount++;
pCur += csz;
}
- else if (*(TCHAR*)pCur == '\n')
+ else if (*(wchar_t*)pCur == '\n')
lineCount++;
}
else {
@@ -715,7 +715,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) lineCount++;
}
}
- if (((tUC) && (*(TCHAR*)pCur == '\r')) || ((!tUC) && (*(char *)pCur == '\r'))) {
+ if (((tUC) && (*(wchar_t*)pCur == '\r')) || ((!tUC) && (*(char *)pCur == '\r'))) {
// in case the \r was at the end of the buffer, \n could be next
SetFilePointer(hFile, -1 * csz, NULL, FILE_CURRENT);
totalReadSz -= csz;
@@ -738,16 +738,16 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) return NULL;
}
for (pCur = pBuf; (pCur < pBuf + readSz); pCur += csz) {
- if ((tUC) && ((!_tcsncmp((TCHAR*)pCur, L"\r\n", 2)) || (*(TCHAR*)pCur == '\n')) ||
+ if ((tUC) && ((!wcsncmp((wchar_t*)pCur, L"\r\n", 2)) || (*(wchar_t*)pCur == '\n')) ||
((!tUC) && (((!strncmp((char *)pCur, "\r\n", 2)) || (*(char *)pCur == '\n'))))) {
CloseHandle(hFile);
if (tUC)
- *(TCHAR*)pCur = 0;
+ *(wchar_t*)pCur = 0;
else
*(char *)pCur = '\0';
if (tUC)
- res = (TCHAR*)pBuf;
+ res = (wchar_t*)pBuf;
else {
res = mir_a2t((char *)pBuf);
mir_free(pBuf);
@@ -760,7 +760,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) CloseHandle(hFile);
if (tUC) {
- res = (TCHAR*)pBuf;
+ res = (wchar_t*)pBuf;
}
else {
res = mir_a2t((char *)pBuf);
@@ -772,7 +772,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) if (readSz == bufSz - csz) {
// buffer must be increased
bufSz += TXTFILEBUFSZ*csz;
- if (((tUC) && (*(TCHAR*)pCur == '\r')) || ((!tUC) && (*(char *)pCur == '\r'))) {
+ if (((tUC) && (*(wchar_t*)pCur == '\r')) || ((!tUC) && (*(char *)pCur == '\r'))) {
pCur -= csz;
}
icur = pCur - pBuf;
@@ -787,7 +787,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) return NULL;
}
-static TCHAR *parseUpTime(ARGUMENTSINFO *ai)
+static wchar_t *parseUpTime(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
@@ -818,21 +818,21 @@ static TCHAR *parseUpTime(ARGUMENTSINFO *ai) return NULL;
}
- TCHAR szVal[32];
+ wchar_t szVal[32];
mir_sntprintf(szVal, L"%u", cValue.largeValue);
PdhRemoveCounter(hCounter);
PdhCloseQuery(hQuery);
return mir_tstrdup(szVal);
}
-static TCHAR *parseUserName(ARGUMENTSINFO *ai)
+static wchar_t *parseUserName(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
ai->flags |= AIF_DONTPARSE;
DWORD len = UNLEN;
- TCHAR *res = (TCHAR*)mir_alloc(len + 1);
+ wchar_t *res = (wchar_t*)mir_alloc(len + 1);
if (res == NULL)
return NULL;
@@ -845,22 +845,22 @@ static TCHAR *parseUserName(ARGUMENTSINFO *ai) }
// clipboard support
-static TCHAR *parseClipboard(ARGUMENTSINFO *ai)
+static wchar_t *parseClipboard(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
ai->flags |= AIF_DONTPARSE;
- TCHAR *res = NULL;
+ wchar_t *res = NULL;
if (IsClipboardFormatAvailable(CF_TEXT)) {
if (OpenClipboard(NULL)) {
HANDLE hData = GetClipboardData(CF_UNICODETEXT);
if (hData != NULL) {
- TCHAR *tszText = (TCHAR*)GlobalLock(hData);
+ wchar_t *tszText = (wchar_t*)GlobalLock(hData);
size_t len = mir_tstrlen(tszText);
- res = (TCHAR*)mir_alloc((len + 1) * sizeof(TCHAR));
+ res = (wchar_t*)mir_alloc((len + 1) * sizeof(wchar_t));
mir_tstrcpy(res, tszText);
res[len] = 0;
GlobalUnlock(hData);
diff --git a/plugins/Variables/src/parse_variables.cpp b/plugins/Variables/src/parse_variables.cpp index bc19f44cfc..c54bbf6dce 100644 --- a/plugins/Variables/src/parse_variables.cpp +++ b/plugins/Variables/src/parse_variables.cpp @@ -24,7 +24,7 @@ static mir_cs csVarRegister; static VARIABLEREGISTER *vr = NULL;
static int vrCount = 0;
-static int addToVariablesRegister(TCHAR *szName, TCHAR *szText)
+static int addToVariablesRegister(wchar_t *szName, wchar_t *szText)
{
if ((szName == NULL) || (szText == NULL) || (mir_tstrlen(szName) <= 0))
return -1;
@@ -48,7 +48,7 @@ static int addToVariablesRegister(TCHAR *szName, TCHAR *szText) return 0;
}
-static TCHAR *searchVariableRegister(TCHAR *szName)
+static wchar_t *searchVariableRegister(wchar_t *szName)
{
if ((szName == NULL) || (mir_tstrlen(szName) <= 0))
return NULL;
@@ -61,7 +61,7 @@ static TCHAR *searchVariableRegister(TCHAR *szName) return NULL;
}
-static TCHAR *parsePut(ARGUMENTSINFO *ai)
+static wchar_t *parsePut(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -77,7 +77,7 @@ static TCHAR *parsePut(ARGUMENTSINFO *ai) return formatString(&fi);
}
-static TCHAR *parsePuts(ARGUMENTSINFO *ai)
+static wchar_t *parsePuts(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -88,7 +88,7 @@ static TCHAR *parsePuts(ARGUMENTSINFO *ai) return mir_tstrdup(L"");
}
-static TCHAR *parseGet(ARGUMENTSINFO *ai)
+static wchar_t *parseGet(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
diff --git a/plugins/Variables/src/parse_variables.h b/plugins/Variables/src/parse_variables.h index b623f5a4c1..ea83c3b1e0 100644 --- a/plugins/Variables/src/parse_variables.h +++ b/plugins/Variables/src/parse_variables.h @@ -18,8 +18,8 @@ */
typedef struct {
- TCHAR *szName;
- TCHAR *szText;
+ wchar_t *szName;
+ wchar_t *szText;
DWORD dwOwnerThread;
} VARIABLEREGISTER;
diff --git a/plugins/Variables/src/stdafx.h b/plugins/Variables/src/stdafx.h index 66570a7aa6..87b596ae77 100644 --- a/plugins/Variables/src/stdafx.h +++ b/plugins/Variables/src/stdafx.h @@ -88,7 +88,7 @@ #define SUBJECT L"subject"
#define MIR_EXTRATEXT L"extratext"
-#define VAR_HELP_TEXT LPGENT("--- Special characters ---\r\n\r\n\
+#define VAR_HELP_TEXT LPGENW("--- Special characters ---\r\n\r\n\
The following characters have a special meaning in a formatting string:\r\n\r\n\
?<function>(<arguments>)\r\n\
This will parse the function given the arguments, the result will be parsed again. Example: Today is ?cdate(yyyy/MM/dd).\r\n\r\n\
@@ -152,16 +152,16 @@ extern int hLangpack; // variables.c
//int isValidTokenChar(char c);
-TCHAR *formatString(FORMATINFO *fi);
+wchar_t *formatString(FORMATINFO *fi);
int setParseOptions(struct ParseOptions *po);
int LoadVarModule();
int UnloadVarModule();
// tokenregister.c
-int registerIntToken(TCHAR *szToken, TCHAR *(*parseFunction)(ARGUMENTSINFO *ai), int extraFlags, char* szHelpText);
+int registerIntToken(wchar_t *szToken, wchar_t *(*parseFunction)(ARGUMENTSINFO *ai), int extraFlags, char* szHelpText);
INT_PTR registerToken(WPARAM wParam, LPARAM lParam);
-int deRegisterToken(TCHAR *var);
-TOKENREGISTEREX *searchRegister(TCHAR *var, int type);
-TCHAR *parseFromRegister(ARGUMENTSINFO *ai);
+int deRegisterToken(wchar_t *var);
+TOKENREGISTEREX *searchRegister(wchar_t *var, int type);
+wchar_t *parseFromRegister(ARGUMENTSINFO *ai);
TOKENREGISTEREX *getTokenRegister(int i);
int getTokenRegisterCount();
TOKENREGISTER *getTokenRegisterByIndex(int i);
@@ -169,9 +169,9 @@ void deRegisterTemporaryVariables(); int initTokenRegister();
int deinitTokenRegister();
// contact.c
-BYTE getContactInfoType(TCHAR* type);
-TCHAR* getContactInfoT(BYTE type, MCONTACT hContact);
-MCONTACT getContactFromString(const TCHAR *tszContact, DWORD dwFlags, int nMatch = 0);
+BYTE getContactInfoType(wchar_t* type);
+wchar_t* getContactInfoT(BYTE type, MCONTACT hContact);
+MCONTACT getContactFromString(const wchar_t *tszContact, DWORD dwFlags, int nMatch = 0);
int initContactModule();
int deinitContactModule();
// alias
@@ -206,5 +206,5 @@ INT_PTR showHelpExService(WPARAM wParam, LPARAM lParam); INT_PTR getSkinItemService(WPARAM wParam, LPARAM lParam);
int iconsChanged(WPARAM wParam, LPARAM lParam);
-int ttoi(TCHAR *string);
-TCHAR *itot(int num);
+int ttoi(wchar_t *string);
+wchar_t *itot(int num);
diff --git a/plugins/Variables/src/tokenregister.cpp b/plugins/Variables/src/tokenregister.cpp index b74465ce99..101d8024f1 100644 --- a/plugins/Variables/src/tokenregister.cpp +++ b/plugins/Variables/src/tokenregister.cpp @@ -39,19 +39,19 @@ static mir_cs csRegister; unsigned long int hashlittle(void *key, size_t length, unsigned long int initval);
-static DWORD NameHashFunction(TCHAR *tszStr)
+static DWORD NameHashFunction(wchar_t *tszStr)
{
- return (DWORD)hashlittle(tszStr, mir_tstrlen(tszStr)*sizeof(TCHAR), 0);
+ return (DWORD)hashlittle(tszStr, mir_tstrlen(tszStr)*sizeof(wchar_t), 0);
}
-static TokenRegisterEntry* FindTokenRegisterByName(TCHAR *name)
+static TokenRegisterEntry* FindTokenRegisterByName(wchar_t *name)
{
TokenRegisterEntry temp;
temp.nameHash = NameHashFunction(name);
return tokens.find(&temp);
}
-int registerIntToken(TCHAR *szToken, TCHAR *(*parseFunction)(ARGUMENTSINFO *ai), int extraFlags, char* szHelpText)
+int registerIntToken(wchar_t *szToken, wchar_t *(*parseFunction)(ARGUMENTSINFO *ai), int extraFlags, char* szHelpText)
{
TOKENREGISTEREX tr = { 0 };
tr.cbSize = sizeof(tr);
@@ -65,7 +65,7 @@ int registerIntToken(TCHAR *szToken, TCHAR *(*parseFunction)(ARGUMENTSINFO *ai), return registerToken(0, (LPARAM)&tr);
}
-int deRegisterToken(TCHAR *token)
+int deRegisterToken(wchar_t *token)
{
if (token == NULL)
return -1;
@@ -143,7 +143,7 @@ INT_PTR registerToken(WPARAM, LPARAM lParam) return 0;
}
-TOKENREGISTEREX *searchRegister(TCHAR *tvar, int type)
+TOKENREGISTEREX *searchRegister(wchar_t *tvar, int type)
{
if (tvar == NULL)
return 0;
@@ -156,13 +156,13 @@ TOKENREGISTEREX *searchRegister(TCHAR *tvar, int type) return &tre->tr;
}
-TCHAR *parseFromRegister(ARGUMENTSINFO *ai)
+wchar_t *parseFromRegister(ARGUMENTSINFO *ai)
{
if (ai == NULL || ai->argc == 0 || ai->targv[0] == NULL)
return NULL;
INT_PTR callRes = 0;
- TCHAR *res = NULL;
+ wchar_t *res = NULL;
mir_cslock lck(csRegister);
@@ -200,14 +200,14 @@ TCHAR *parseFromRegister(ARGUMENTSINFO *ai) else if (thisVr->szService != NULL)
callRes = CallService(thisVr->szService, 0, (LPARAM)ai);
- if ((TCHAR*)callRes != NULL)
- res = mir_tstrdup((TCHAR*)callRes);
+ if ((wchar_t*)callRes != NULL)
+ res = mir_tstrdup((wchar_t*)callRes);
}
if (callRes != NULL) {
if (trCopy.flags & TRF_CLEANUP) {
if (trCopy.flags & TRF_CLEANUPFUNC)
- trCopy.cleanupFunctionT((TCHAR*)callRes);
+ trCopy.cleanupFunctionT((wchar_t*)callRes);
else if (trCopy.szCleanupService != NULL)
CallService(trCopy.szCleanupService, 0, (LPARAM)callRes);
}
diff --git a/plugins/Variables/src/variables.cpp b/plugins/Variables/src/variables.cpp index 83c34b279a..44920139f4 100644 --- a/plugins/Variables/src/variables.cpp +++ b/plugins/Variables/src/variables.cpp @@ -36,16 +36,16 @@ HCURSOR hCurSplitNS; struct ParseOptions gParseOpts; -TCHAR* getArguments(TCHAR *string, TArgList &argv) +wchar_t* getArguments(wchar_t *string, TArgList &argv) { - TCHAR *cur = string; + wchar_t *cur = string; while (*cur == ' ') cur++; if (*cur != '(') return NULL; - TCHAR *scur = cur; + wchar_t *scur = cur; cur++; int brackets = 0; bool bDontParse = false, bNewArg = false, bDone = false; @@ -74,7 +74,7 @@ TCHAR* getArguments(TCHAR *string, TArgList &argv) } if (bNewArg) { - TCHAR *tszArg = NULL; + wchar_t *tszArg = NULL; if (cur > scur) tszArg = mir_tstrndup(scur + 1, cur - (scur + 1)); if (tszArg == NULL) @@ -96,7 +96,7 @@ TCHAR* getArguments(TCHAR *string, TArgList &argv) return cur; } -int isValidTokenChar(TCHAR tc) +int isValidTokenChar(wchar_t tc) { return @@ -111,14 +111,14 @@ int isValidTokenChar(TCHAR tc) } /* pretty much the main loop */ -static TCHAR* replaceDynVars(FORMATINFO *fi) +static wchar_t* replaceDynVars(FORMATINFO *fi) { if (fi->tszFormat == NULL) return NULL; int i, scurPos, curPos, tmpVarPos; - TCHAR *string = mir_tstrdup(fi->tszFormat); + wchar_t *string = mir_tstrdup(fi->tszFormat); if (string == NULL) return NULL; @@ -129,56 +129,56 @@ static TCHAR* replaceDynVars(FORMATINFO *fi) for (size_t pos = 0; pos < mir_tstrlen(string); pos++) { // string may move in memory, iterate by remembering the position in the string - TCHAR *cur = string + pos; + wchar_t *cur = string + pos; // new round if (*cur == DONTPARSE_CHAR) { - memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(TCHAR)); + memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(wchar_t)); if (*cur == DONTPARSE_CHAR) continue; while ((*cur != DONTPARSE_CHAR) && (*cur != 0)) cur++; - memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(TCHAR)); + memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(wchar_t)); pos = cur - string - 1; continue; } // remove end of lines - else if ((!_tcsncmp(cur, L"\r\n", 2)) && (gParseOpts.bStripEOL)) { - memmove(cur, cur + 2, (mir_tstrlen(cur + 2) + 1)*sizeof(TCHAR)); + else if ((!wcsncmp(cur, L"\r\n", 2)) && (gParseOpts.bStripEOL)) { + memmove(cur, cur + 2, (mir_tstrlen(cur + 2) + 1)*sizeof(wchar_t)); pos = cur - string - 1; continue; } else if ((*cur == '\n' && gParseOpts.bStripEOL) || (*cur == ' ' && gParseOpts.bStripWS)) { - memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(TCHAR)); + memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(wchar_t)); pos = cur - string - 1; continue; } // remove comments - else if (!_tcsncmp(cur, _T(COMMENT_STRING), mir_tstrlen(_T(COMMENT_STRING)))) { - TCHAR *scur = cur; - while (_tcsncmp(cur, L"\r\n", 2) && *cur != '\n' && *cur != 0) + else if (!wcsncmp(cur, _T(COMMENT_STRING), mir_tstrlen(_T(COMMENT_STRING)))) { + wchar_t *scur = cur; + while (wcsncmp(cur, L"\r\n", 2) && *cur != '\n' && *cur != 0) cur++; if (*cur == 0) { *scur = 0; - string = (TCHAR*)mir_realloc(string, (mir_tstrlen(string) + 1)*sizeof(TCHAR)); + string = (wchar_t*)mir_realloc(string, (mir_tstrlen(string) + 1)*sizeof(wchar_t)); continue; } - memmove(scur, cur, (mir_tstrlen(cur) + 1)*sizeof(TCHAR)); + memmove(scur, cur, (mir_tstrlen(cur) + 1)*sizeof(wchar_t)); pos = scur - string - 1; continue; } else if ((*cur != FIELD_CHAR) && (*cur != FUNC_CHAR) && (*cur != FUNC_ONCE_CHAR)) { if (gParseOpts.bStripAll) { - memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(TCHAR)); + memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(wchar_t)); pos = cur - string - 1; } continue; } - TCHAR *scur = cur + 1, *tcur = scur; + wchar_t *scur = cur + 1, *tcur = scur; while (isValidTokenChar(*tcur)) tcur++; @@ -224,7 +224,7 @@ static TCHAR* replaceDynVars(FORMATINFO *fi) } else if ((*cur == FUNC_CHAR) || (*cur == FUNC_ONCE_CHAR)) { cur += mir_tstrlen(tr->tszTokenString) + 1; - TCHAR *argcur = getArguments(cur, argv); + wchar_t *argcur = getArguments(cur, argv); if (argcur == cur || argcur == NULL) { fi->eCount++; // error getting arguments @@ -282,7 +282,7 @@ static TCHAR* replaceDynVars(FORMATINFO *fi) curPos = cur - string; if (tokenLen < parsedTokenLen) { // string needs more memory - string = (TCHAR*)mir_realloc(string, (initStrLen - tokenLen + parsedTokenLen + 1)*sizeof(TCHAR)); + string = (wchar_t*)mir_realloc(string, (initStrLen - tokenLen + parsedTokenLen + 1)*sizeof(wchar_t)); if (string == NULL) { fi->eCount++; return NULL; @@ -290,11 +290,11 @@ static TCHAR* replaceDynVars(FORMATINFO *fi) } scur = string + scurPos; cur = string + curPos; - memmove(scur + parsedTokenLen, cur, (mir_tstrlen(cur) + 1)*sizeof(TCHAR)); - memcpy(scur, parsedToken, parsedTokenLen*sizeof(TCHAR)); + memmove(scur + parsedTokenLen, cur, (mir_tstrlen(cur) + 1)*sizeof(wchar_t)); + memcpy(scur, parsedToken, parsedTokenLen*sizeof(wchar_t)); { size_t len = mir_tstrlen(string); - string = (TCHAR*)mir_realloc(string, (len + 1)*sizeof(TCHAR)); + string = (wchar_t*)mir_realloc(string, (len + 1)*sizeof(wchar_t)); } if ((ai.flags & AIF_DONTPARSE) || tmpVarPos >= 0) pos += parsedTokenLen; @@ -302,7 +302,7 @@ static TCHAR* replaceDynVars(FORMATINFO *fi) pos--; // parse the same pos again, it changed } - return (TCHAR*)mir_realloc(string, (mir_tstrlen(string) + 1)*sizeof(TCHAR)); + return (wchar_t*)mir_realloc(string, (mir_tstrlen(string) + 1)*sizeof(wchar_t)); } /* @@ -314,7 +314,7 @@ static INT_PTR formatStringService(WPARAM wParam, LPARAM) int i; BOOL copied; FORMATINFO *fi, tempFi; - TCHAR *tszFormat, *orgFormat, *tszSource, *orgSource, *tRes; + wchar_t *tszFormat, *orgFormat, *tszSource, *orgSource, *tRes; if (((FORMATINFO *)wParam)->cbSize >= sizeof(FORMATINFO)) { memset(&tempFi, 0, sizeof(FORMATINFO)); @@ -384,7 +384,7 @@ static INT_PTR formatStringService(WPARAM wParam, LPARAM) return res; } -TCHAR* formatString(FORMATINFO *fi) +wchar_t* formatString(FORMATINFO *fi) { if (fi == NULL) return NULL; diff --git a/plugins/Watrack_MPD/src/init.cpp b/plugins/Watrack_MPD/src/init.cpp index b93924c163..d5328df19b 100755 --- a/plugins/Watrack_MPD/src/init.cpp +++ b/plugins/Watrack_MPD/src/init.cpp @@ -19,7 +19,7 @@ HINSTANCE hInst;
BOOL bWatrackService = FALSE;
int hLangpack = 0;
-TCHAR *gbHost, *gbPassword;
+wchar_t *gbHost, *gbPassword;
WORD gbPort;
HANDLE ghNetlibUser;
diff --git a/plugins/Watrack_MPD/src/options.cpp b/plugins/Watrack_MPD/src/options.cpp index 54d0c2d6ce..315c2f4100 100755 --- a/plugins/Watrack_MPD/src/options.cpp +++ b/plugins/Watrack_MPD/src/options.cpp @@ -24,7 +24,7 @@ static INT_PTR CALLBACK DlgProcWaMpdOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM { TranslateDialogDefault(hwndDlg); SetDlgItemInt(hwndDlg, IDC_PORT, db_get_w(NULL, szModuleName, "Port", 6600), FALSE); - TCHAR *tmp = UniGetContactSettingUtf(NULL, szModuleName, "Server", L"127.0.0.1"); + wchar_t *tmp = UniGetContactSettingUtf(NULL, szModuleName, "Server", L"127.0.0.1"); SetDlgItemText(hwndDlg, IDC_SERVER, tmp); mir_free(tmp); tmp = UniGetContactSettingUtf(NULL, szModuleName, "Password", L""); @@ -47,7 +47,7 @@ static INT_PTR CALLBACK DlgProcWaMpdOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM case PSN_APPLY: { - TCHAR szText[256]; + wchar_t szText[256]; db_set_w(NULL, szModuleName, "Port", (WORD)GetDlgItemInt(hwndDlg, IDC_PORT, NULL, FALSE)); gbPort = (WORD)GetDlgItemInt(hwndDlg, IDC_PORT, NULL, FALSE); GetDlgItemText(hwndDlg, IDC_SERVER, szText, _countof(szText)); @@ -71,9 +71,9 @@ int WaMpdOptInit(WPARAM wParam,LPARAM) OPTIONSDIALOGPAGE odp = { 0 }; odp.hInstance = hInst; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_WA_MPD); - odp.ptszTitle = LPGENT("Winamp Track"); - odp.ptszGroup = LPGENT("Plugins"); - odp.ptszTab = LPGENT("Watrack MPD"); + odp.pwszTitle = LPGENW("Winamp Track"); + odp.pwszGroup = LPGENW("Plugins"); + odp.pwszTab = LPGENW("Watrack MPD"); odp.flags=ODPF_BOLDGROUPS|ODPF_TCHAR; odp.pfnDlgProc = DlgProcWaMpdOpts; Options_AddPage(wParam, &odp); diff --git a/plugins/Watrack_MPD/src/stdafx.h b/plugins/Watrack_MPD/src/stdafx.h index ae1ef95c07..f339704541 100755 --- a/plugins/Watrack_MPD/src/stdafx.h +++ b/plugins/Watrack_MPD/src/stdafx.h @@ -36,7 +36,7 @@ extern HINSTANCE hInst;
extern HANDLE ghNetlibUser;
extern BOOL bWatrackService;
-extern TCHAR *gbHost, *gbPassword;
+extern wchar_t *gbHost, *gbPassword;
extern WORD gbPort;
extern char *date();
diff --git a/plugins/Watrack_MPD/src/utilities.cpp b/plugins/Watrack_MPD/src/utilities.cpp index 735c5f121a..edaf3f42bd 100755 --- a/plugins/Watrack_MPD/src/utilities.cpp +++ b/plugins/Watrack_MPD/src/utilities.cpp @@ -17,8 +17,8 @@ #include "stdafx.h" -TCHAR* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, TCHAR* szDef) +wchar_t* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, wchar_t* szDef) { - TCHAR *szRes = db_get_tsa(hContact, szModule, szSetting); + wchar_t *szRes = db_get_tsa(hContact, szModule, szSetting); return szRes ? szRes : mir_tstrdup(szDef); } diff --git a/plugins/Watrack_MPD/src/utilities.h b/plugins/Watrack_MPD/src/utilities.h index 39ee598973..3f594c7084 100755 --- a/plugins/Watrack_MPD/src/utilities.h +++ b/plugins/Watrack_MPD/src/utilities.h @@ -1,6 +1,6 @@ #ifndef UTILITIES_H #define UTILITIES_H -TCHAR* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, TCHAR* szDef); +wchar_t* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, wchar_t* szDef); #endif diff --git a/plugins/Weather/src/stdafx.h b/plugins/Weather/src/stdafx.h index a0bced3797..73a3eb9a60 100644 --- a/plugins/Weather/src/stdafx.h +++ b/plugins/Weather/src/stdafx.h @@ -187,19 +187,19 @@ struct MYOPTIONS WORD pUnit;
WORD dUnit;
WORD eUnit;
- TCHAR DegreeSign[4];
+ wchar_t DegreeSign[4];
BYTE DoNotAppendUnit;
BYTE NoFrac;
// texts
- TCHAR *cText;
- TCHAR *bTitle;
- TCHAR *bText;
- TCHAR *nText;
- TCHAR *eText;
- TCHAR *hText;
- TCHAR *xText;
- TCHAR *sText;
+ wchar_t *cText;
+ wchar_t *bTitle;
+ wchar_t *bText;
+ wchar_t *nText;
+ wchar_t *eText;
+ wchar_t *hText;
+ wchar_t *xText;
+ wchar_t *sText;
// advanced
BYTE DisCondIcon;
@@ -224,11 +224,11 @@ struct MYOPTIONS DWORD pDelay;
// popup texts
- TCHAR *pTitle;
- TCHAR *pText;
+ wchar_t *pTitle;
+ wchar_t *pText;
// other misc stuff
- TCHAR Default[64];
+ wchar_t Default[64];
MCONTACT DefStn;
};
@@ -253,12 +253,12 @@ void DestroyUpdateList(void); #define WID_BREAK 2
typedef struct {
- TCHAR *Name;
- TCHAR *Start;
- TCHAR *End;
- TCHAR *Unit;
+ wchar_t *Name;
+ wchar_t *Start;
+ wchar_t *End;
+ wchar_t *Unit;
char *Url;
- TCHAR *Break;
+ wchar_t *Break;
int Type;
} WIDATAITEM;
@@ -272,27 +272,27 @@ typedef struct WITEMLIST WIDATAITEMLIST; typedef struct {
BOOL Available;
char *SearchURL;
- TCHAR *NotFoundStr;
+ wchar_t *NotFoundStr;
WIDATAITEM Name;
} WIIDSEARCH;
typedef struct {
BOOL Available;
- TCHAR *First;
+ wchar_t *First;
WIDATAITEM Name;
WIDATAITEM ID;
} WINAMESEARCHTYPE;
typedef struct {
char *SearchURL;
- TCHAR *NotFoundStr;
- TCHAR *SingleStr;
+ wchar_t *NotFoundStr;
+ wchar_t *SingleStr;
WINAMESEARCHTYPE Single;
WINAMESEARCHTYPE Multiple;
} WINAMESEARCH;
struct STRLIST {
- TCHAR *Item;
+ wchar_t *Item;
struct STRLIST *Next;
};
@@ -304,22 +304,22 @@ typedef struct { } WICONDLIST;
typedef struct {
- TCHAR *FileName;
- TCHAR *ShortFileName;
+ wchar_t *FileName;
+ wchar_t *ShortFileName;
BOOL Enabled;
// header
- TCHAR *DisplayName;
- TCHAR *InternalName;
- TCHAR *Description;
- TCHAR *Author;
- TCHAR *Version;
+ wchar_t *DisplayName;
+ wchar_t *InternalName;
+ wchar_t *Description;
+ wchar_t *Author;
+ wchar_t *Version;
int InternalVer;
size_t MemUsed;
// default
char *DefaultURL;
- TCHAR *DefaultMap;
+ wchar_t *DefaultMap;
char *UpdateURL;
char *UpdateURL2;
char *UpdateURL3;
@@ -371,8 +371,8 @@ extern BOOL ThreadRunning; INT_PTR WeatherAddToList(WPARAM wParam,LPARAM lParam);
BOOL CheckSearch();
-int IDSearch(TCHAR *id, const int searchId);
-int NameSearch(TCHAR *name, const int searchId);
+int IDSearch(wchar_t *id, const int searchId);
+int NameSearch(wchar_t *name, const int searchId);
INT_PTR WeatherBasicSearch(WPARAM wParam,LPARAM lParam);
INT_PTR WeatherCreateAdvancedSearchUI(WPARAM wParam, LPARAM lParam);
@@ -391,36 +391,36 @@ int ContactDeleted(WPARAM wParam,LPARAM lParam); BOOL IsMyContact(MCONTACT hContact);
// functions in weather_conv.c
-void GetTemp(TCHAR *tempchar, TCHAR *unit, TCHAR *str);
-void GetSpeed(TCHAR *tempchar, TCHAR *unit, TCHAR *str);
-void GetPressure(TCHAR *tempchar, TCHAR *unit, TCHAR *str);
-void GetDist(TCHAR *tempchar, TCHAR *unit, TCHAR *str);
-void GetElev(TCHAR *tempchar, TCHAR *unit, TCHAR *str);
-
-WORD GetIcon(const TCHAR* cond, WIDATA *Data);
-void CaseConv(TCHAR *str);
+void GetTemp(wchar_t *tempchar, wchar_t *unit, wchar_t *str);
+void GetSpeed(wchar_t *tempchar, wchar_t *unit, wchar_t *str);
+void GetPressure(wchar_t *tempchar, wchar_t *unit, wchar_t *str);
+void GetDist(wchar_t *tempchar, wchar_t *unit, wchar_t *str);
+void GetElev(wchar_t *tempchar, wchar_t *unit, wchar_t *str);
+
+WORD GetIcon(const wchar_t* cond, WIDATA *Data);
+void CaseConv(wchar_t *str);
void TrimString(char *str);
void TrimString(WCHAR *str);
void ConvertBackslashes(char *str);
char *GetSearchStr(char *dis);
-TCHAR *GetDisplay(WEATHERINFO *w, const TCHAR *dis, TCHAR* str);
+wchar_t *GetDisplay(WEATHERINFO *w, const wchar_t *dis, wchar_t* str);
INT_PTR GetDisplaySvcFunc(WPARAM wParam, LPARAM lParam);
-void GetSvc(TCHAR *pszID);
-void GetID(TCHAR *pszID);
+void GetSvc(wchar_t *pszID);
+void GetID(wchar_t *pszID);
-TCHAR *GetError(int code);
+wchar_t *GetError(int code);
// functions in weather_data.c
-void GetStationID(MCONTACT hContact, TCHAR* id, int idlen);
+void GetStationID(MCONTACT hContact, wchar_t* id, int idlen);
WEATHERINFO LoadWeatherInfo(MCONTACT Change);
int DBGetData(MCONTACT hContact, char *setting, DBVARIANT *dbv);
void EraseAllInfo(void);
-void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szInfo);
-void ConvertDataValue(WIDATAITEM *UpdateData, TCHAR *Data);
+void GetDataValue(WIDATAITEM *UpdateData, wchar_t *Data, wchar_t** szInfo);
+void ConvertDataValue(WIDATAITEM *UpdateData, wchar_t *Data);
void wSetData(char **Data, const char *Value);
void wSetData(WCHAR **Data, const char *Value);
void wSetData(WCHAR **Data, const WCHAR *Value);
@@ -430,14 +430,14 @@ void wfree(WCHAR **Data); void DBDataManage(MCONTACT hContact, WORD Mode, WPARAM wParam, LPARAM lParam);
// functions in weather_http.c
-int InternetDownloadFile (char *szUrl, char *cookie, char *userAgent, TCHAR** szData);
+int InternetDownloadFile (char *szUrl, char *cookie, char *userAgent, wchar_t** szData);
void NetlibInit();
void NetlibHttpDisconnect(void);
// functions in weather_ini.c
-WIDATA* GetWIData(TCHAR *pszServ);
+WIDATA* GetWIData(wchar_t *pszServ);
-bool IsContainedInCondList(const TCHAR *pszStr, WICONDLIST *List);
+bool IsContainedInCondList(const wchar_t *pszStr, WICONDLIST *List);
void DestroyWIList();
bool LoadWIData(bool dial);
@@ -445,7 +445,7 @@ bool LoadWIData(bool dial); INT_PTR CALLBACK DlgPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
// functions in weather_info.c
-void GetINIInfo(TCHAR *pszSvc);
+void GetINIInfo(wchar_t *pszSvc);
void MoreVarList();
@@ -460,7 +460,7 @@ int OptInit(WPARAM wParam,LPARAM lParam); // functions in weather_popup.c
int WeatherPopup(WPARAM wParam, LPARAM lParam);
int WeatherError(WPARAM wParam, LPARAM lParam);
-int WPShowMessage(TCHAR* lpzText, WORD kind);
+int WPShowMessage(wchar_t* lpzText, WORD kind);
LRESULT CALLBACK PopupWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index 00d6b0baee..188bd35fe3 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -226,11 +226,11 @@ extern "C" int __declspec(dllexport) Load(void) InitServices();
// add sound event
- SkinAddNewSoundExT("weatherupdated", _T(WEATHERPROTONAME), LPGENT("Weather Condition Changed"));
- SkinAddNewSoundExT("weatheralert", _T(WEATHERPROTONAME), LPGENT("Weather Alert Issued"));
+ SkinAddNewSoundExT("weatherupdated", _T(WEATHERPROTONAME), LPGENW("Weather Condition Changed"));
+ SkinAddNewSoundExT("weatheralert", _T(WEATHERPROTONAME), LPGENW("Weather Alert Issued"));
// window needed for popup commands
- TCHAR SvcFunc[100];
+ wchar_t SvcFunc[100];
mir_sntprintf(SvcFunc, L"%s__PopupWindow", _T(WEATHERPROTONAME));
hPopupWindow = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", SvcFunc, 0, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, hInst, NULL);
diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index 304f1d2641..bf999c9dea 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -26,7 +26,7 @@ to the contact list. Contain code for both name and ID search. // variables used for weather_addstn.c
static int sttSearchId = -1;
-static TCHAR name1[256];
+static wchar_t name1[256];
// ============ ADDING NEW STATION ============
@@ -35,7 +35,7 @@ static TCHAR name1[256]; INT_PTR WeatherAddToList(WPARAM, LPARAM lParam)
{
PROTOSEARCHRESULT *psr = (PROTOSEARCHRESULT*)lParam;
- if (!psr || !psr->email.t)
+ if (!psr || !psr->email.w)
return 0;
// search for existing contact
@@ -45,7 +45,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) DBVARIANT dbv;
// check ID to see if the contact already exist in the database
if (!db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) {
- if (!mir_tstrcmpi(psr->email.t, dbv.ptszVal)) {
+ if (!mir_tstrcmpi(psr->email.w, dbv.ptszVal)) {
// remove the flag for not on list and hidden, thus make the contact visible
// and add them on the list
if (db_get_b(hContact, "CList", "NotOnList", 1)) {
@@ -69,11 +69,11 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE);
// set contact info and settings
- TCHAR svc[256];
- _tcsncpy(svc, psr->email.t, _countof(svc)); svc[_countof(svc) - 1] = 0;
+ wchar_t svc[256];
+ wcsncpy(svc, psr->email.w, _countof(svc)); svc[_countof(svc) - 1] = 0;
GetSvc(svc);
// set settings by obtaining the default for the service
- if (psr->lastName.t[0] != 0) {
+ if (psr->lastName.w[0] != 0) {
WIDATA *sData = GetWIData(svc);
db_set_ts(hContact, WEATHERPROTONAME, "MapURL", sData->DefaultMap);
db_set_s(hContact, WEATHERPROTONAME, "InfoURL", sData->DefaultURL);
@@ -83,14 +83,14 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) db_set_s(hContact, WEATHERPROTONAME, "InfoURL", "");
}
// write the other info and settings to the database
- db_set_ts(hContact, WEATHERPROTONAME, "ID", psr->email.t);
- db_set_ts(hContact, WEATHERPROTONAME, "Nick", psr->nick.t);
+ db_set_ts(hContact, WEATHERPROTONAME, "ID", psr->email.w);
+ db_set_ts(hContact, WEATHERPROTONAME, "Nick", psr->nick.w);
db_set_w(hContact, WEATHERPROTONAME, "Status", ID_STATUS_OFFLINE);
AvatarDownloaded(hContact);
- TCHAR str[256];
- mir_sntprintf(str, TranslateT("Current weather information for %s."), psr->nick.t);
+ wchar_t str[256];
+ mir_sntprintf(str, TranslateT("Current weather information for %s."), psr->nick.w);
db_set_ts(hContact, WEATHERPROTONAME, "About", str);
// make the last update tags to something invalid
@@ -134,7 +134,7 @@ BOOL CheckSearch() // ============ BASIC ID SEARCH ============
-static TCHAR sttSID[32];
+static wchar_t sttSID[32];
// A timer process for the ID search (threaded)
static void __cdecl BasicSearchTimerProc(LPVOID)
@@ -156,7 +156,7 @@ static void __cdecl BasicSearchTimerProc(LPVOID) INT_PTR WeatherBasicSearch(WPARAM, LPARAM lParam)
{
if (sttSearchId != -1) return 0; //only one search at a time
- _tcsncpy(sttSID, (TCHAR*)lParam, _countof(sttSID));
+ wcsncpy(sttSID, (wchar_t*)lParam, _countof(sttSID));
sttSID[_countof(sttSID) - 1] = 0;
sttSearchId = 1;
// create a thread for the ID search
@@ -225,22 +225,22 @@ INT_PTR WeatherAdvancedSearch(WPARAM, LPARAM lParam) // searchId = -1
// sData = the ID search data for that particular weather service
// svcname = the name of the weather service that is currently searching (ie. Yahoo Weather)
-int IDSearchProc(TCHAR *sID, const int searchId, WIIDSEARCH *sData, TCHAR *svc, TCHAR *svcname)
+int IDSearchProc(wchar_t *sID, const int searchId, WIIDSEARCH *sData, wchar_t *svc, wchar_t *svcname)
{
- TCHAR str[MAX_DATA_LEN], newID[MAX_DATA_LEN];
+ wchar_t str[MAX_DATA_LEN], newID[MAX_DATA_LEN];
if (sData->Available) {
char loc[255];
- TCHAR *szData = NULL;
+ wchar_t *szData = NULL;
// load the page
mir_snprintf(loc, sData->SearchURL, sID);
BOOL bFound = (InternetDownloadFile(loc, NULL, NULL, &szData) == 0);
if (bFound) {
- TCHAR* szInfo = szData;
+ wchar_t* szInfo = szData;
// not found
- if (_tcsstr(szInfo, sData->NotFoundStr) == NULL)
+ if (wcsstr(szInfo, sData->NotFoundStr) == NULL)
GetDataValue(&sData->Name, str, &szInfo);
}
@@ -250,16 +250,16 @@ int IDSearchProc(TCHAR *sID, const int searchId, WIIDSEARCH *sData, TCHAR *svc, }
// give no station name but only ID if the search is unavailable
- else _tcsncpy(str, TranslateT("<Enter station name here>"), MAX_DATA_LEN - 1);
+ else wcsncpy(str, TranslateT("<Enter station name here>"), MAX_DATA_LEN - 1);
mir_sntprintf(newID, L"%s/%s", svc, sID);
// set the search result and broadcast it
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.flags = PSR_TCHAR;
- psr.nick.t = str;
- psr.firstName.t = L" ";
- psr.lastName.t = svcname;
- psr.email.t = newID;
+ psr.nick.w = str;
+ psr.firstName.w = L" ";
+ psr.lastName.w = svcname;
+ psr.email.w = newID;
ProtoBroadcastAck(WEATHERPROTONAME, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)searchId, (LPARAM)&psr);
return 0;
@@ -269,7 +269,7 @@ int IDSearchProc(TCHAR *sID, const int searchId, WIIDSEARCH *sData, TCHAR *svc, // sID: the ID to search for
// searchId: don't change
// return 0 if no error
-int IDSearch(TCHAR *sID, const int searchId)
+int IDSearch(wchar_t *sID, const int searchId)
{
// for a normal ID search (ID != #)
if (mir_tstrcmp(sID, L"#")) {
@@ -287,10 +287,10 @@ int IDSearch(TCHAR *sID, const int searchId) // return an empty contact on "#"
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.flags = PSR_TCHAR;
- psr.nick.t = TranslateT("<Enter station name here>"); // to be entered
- psr.firstName.t = L" ";
- psr.lastName.t = L"";
- psr.email.t = TranslateT("<Enter station ID here>"); // to be entered
+ psr.nick.w = TranslateT("<Enter station name here>"); // to be entered
+ psr.firstName.w = L" ";
+ psr.lastName.w = L"";
+ psr.email.w = TranslateT("<Enter station ID here>"); // to be entered
ProtoBroadcastAck(WEATHERPROTONAME, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)searchId, (LPARAM)&psr);
}
@@ -304,21 +304,21 @@ int IDSearch(TCHAR *sID, const int searchId) // searchId = -1
// sData = the name search data for that particular weather service
// svcname = the name of the weather service that is currently searching (ie. Yahoo Weather)
-int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR *svc, TCHAR *svcname)
+int NameSearchProc(wchar_t *name, const int searchId, WINAMESEARCH *sData, wchar_t *svc, wchar_t *svcname)
{
- TCHAR Name[MAX_DATA_LEN], str[MAX_DATA_LEN], sID[MAX_DATA_LEN], *szData = NULL, *search;
+ wchar_t Name[MAX_DATA_LEN], str[MAX_DATA_LEN], sID[MAX_DATA_LEN], *szData = NULL, *search;
// replace spaces with %20
char loc[256];
T2Utf szSearchName(name);
mir_snprintf(loc, sData->SearchURL, ptrA(mir_urlEncode(szSearchName)));
if (InternetDownloadFile(loc, NULL, NULL, &szData) == 0) {
- TCHAR* szInfo = szData;
- search = _tcsstr(szInfo, sData->NotFoundStr); // determine if data is available
+ wchar_t* szInfo = szData;
+ search = wcsstr(szInfo, sData->NotFoundStr); // determine if data is available
if (search == NULL) { // if data is found
// test if it is single result
if (sData->Single.Available && sData->Multiple.Available)
- search = _tcsstr(szInfo, sData->SingleStr);
+ search = wcsstr(szInfo, sData->SingleStr);
// for single result
if (sData->Single.Available && (search != NULL || !sData->Multiple.Available)) { // single result
// if station ID appears first in the downloaded data
@@ -344,16 +344,16 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR * // if can't get the name, use the search string as name
if (Name[0] == 0)
- _tcsncpy(Name, name, _countof(Name));
+ wcsncpy(Name, name, _countof(Name));
// set the data and broadcast it
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.flags = PSR_TCHAR;
- psr.nick.t = Name;
- psr.firstName.t = L" ";
- psr.lastName.t = svcname;
- psr.email.t = sID;
- psr.id.t = sID;
+ psr.nick.w = Name;
+ psr.firstName.w = L" ";
+ psr.lastName.w = svcname;
+ psr.email.w = sID;
+ psr.id.w = sID;
ProtoBroadcastAck(WEATHERPROTONAME, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)searchId, (LPARAM)&psr);
mir_free(szData);
return 0;
@@ -383,15 +383,15 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR * // if can't get the name, use the search string as name
if (Name[0] == 0)
- _tcsncpy(Name, name, _countof(Name));
+ wcsncpy(Name, name, _countof(Name));
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.flags = PSR_TCHAR;
- psr.nick.t = Name;
- psr.firstName.t = L"";
- psr.lastName.t = svcname;
- psr.email.t = sID;
- psr.id.t = sID;
+ psr.nick.w = Name;
+ psr.firstName.w = L"";
+ psr.lastName.w = svcname;
+ psr.email.w = sID;
+ psr.id.w = sID;
ProtoBroadcastAck(WEATHERPROTONAME, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)searchId, (LPARAM)&psr);
}
}
@@ -409,7 +409,7 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR * // name: the station name to search for
// searchId: don't change
// return 0 if no error
-int NameSearch(TCHAR *name, const int searchId)
+int NameSearch(wchar_t *name, const int searchId)
{
WIDATALIST *Item = WIHead;
diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp index 447837c76e..77ecbb11cd 100644 --- a/plugins/Weather/src/weather_contacts.cpp +++ b/plugins/Weather/src/weather_contacts.cpp @@ -25,9 +25,9 @@ the contact. #include "stdafx.h"
-static void OpenUrl(TCHAR* format, TCHAR* id)
+static void OpenUrl(wchar_t* format, wchar_t* id)
{
- TCHAR loc[512];
+ wchar_t loc[512];
GetID(id);
mir_sntprintf(loc, format, id);
Utils_OpenUrlT(loc);
@@ -56,7 +56,7 @@ INT_PTR ViewLog(WPARAM wParam, LPARAM lParam) // wParam = current contact
INT_PTR LoadForecast(WPARAM wParam, LPARAM)
{
- TCHAR id[256], loc2[256];
+ wchar_t id[256], loc2[256];
GetStationID(wParam, id, _countof(id));
if (id[0] != 0) {
// check if the complte forecast URL is set. If it is not, display warning and quit
@@ -74,7 +74,7 @@ INT_PTR LoadForecast(WPARAM wParam, LPARAM) // wParam = current contact
INT_PTR WeatherMap(WPARAM wParam, LPARAM)
{
- TCHAR id[256], loc2[256];
+ wchar_t id[256], loc2[256];
GetStationID(wParam, id, _countof(id));
if (id[0] != 0) {
// check if the weather map URL is set. If it is not, display warning and quit
@@ -106,7 +106,7 @@ typedef struct static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv;
- TCHAR str[MAX_DATA_LEN], str2[256], city[256], filter[256], *pfilter, *chop;
+ wchar_t str[MAX_DATA_LEN], str2[256], city[256], filter[256], *pfilter, *chop;
char loc[512];
OPENFILENAME ofn; // common dialog box structure
MCONTACT hContact;
@@ -145,13 +145,13 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA SendDlgItemMessage(hwndDlg, IDC_RESET2, BUTTONSETASFLATBTN, TRUE, 0);
// set tooltip for the buttons
- SendDlgItemMessage(hwndDlg, IDC_GETNAME, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Get city name from ID"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_SVCINFO, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Weather INI information"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_BROWSE, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Browse"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_VIEW1, BUTTONADDTOOLTIP, (WPARAM)LPGENT("View webpage"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_RESET1, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Reset to default"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_VIEW2, BUTTONADDTOOLTIP, (WPARAM)LPGENT("View webpage"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_RESET2, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Reset to default"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_GETNAME, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Get city name from ID"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_SVCINFO, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Weather INI information"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BROWSE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Browse"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_VIEW1, BUTTONADDTOOLTIP, (WPARAM)LPGENW("View webpage"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_RESET1, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset to default"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_VIEW2, BUTTONADDTOOLTIP, (WPARAM)LPGENW("View webpage"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_RESET2, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset to default"), BATF_TCHAR);
// save the handle for the contact
WindowList_Add(hWindowList, hwndDlg, hContact);
@@ -205,7 +205,7 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA // check if there are 2 parts in the ID (svc/id) seperated by "/"
// if not, don't let user change the setting
GetDlgItemText(hwndDlg, IDC_ID, str, _countof(str));
- chop = _tcsstr(str, L"/");
+ chop = wcsstr(str, L"/");
if (chop == NULL)
EnableWindow(GetDlgItem(hwndDlg, IDC_CHANGE), FALSE);
else
@@ -236,10 +236,10 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA // load the page
mir_snprintf(loc, sData->IDSearch.SearchURL, str);
str[0] = 0;
- TCHAR *pData = NULL;
+ wchar_t *pData = NULL;
if (InternetDownloadFile(loc, NULL, sData->UserAgent, &pData) == 0) {
- TCHAR *szInfo = pData;
- TCHAR* search = _tcsstr(szInfo, sData->IDSearch.NotFoundStr);
+ wchar_t *szInfo = pData;
+ wchar_t* search = wcsstr(szInfo, sData->IDSearch.NotFoundStr);
// if the page is found (ie. valid ID), get the name of the city
if (search == NULL)
@@ -271,15 +271,15 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA ofn.lpstrFile = str;
ofn.nMaxFile = _countof(str);
// set filters
- _tcsncpy(filter, TranslateT("Text Files"), _countof(filter) - 1);
+ wcsncpy(filter, TranslateT("Text Files"), _countof(filter) - 1);
mir_tstrncat(filter, L" (*.txt)", _countof(filter) - mir_tstrlen(filter));
pfilter = filter + mir_tstrlen(filter) + 1;
- _tcsncpy(pfilter, L"*.txt", _countof(filter) - 1);
+ wcsncpy(pfilter, L"*.txt", _countof(filter) - 1);
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
- _tcsncpy(pfilter, TranslateT("All Files"), _countof(filter) - 1);
+ wcsncpy(pfilter, TranslateT("All Files"), _countof(filter) - 1);
mir_tstrncat(pfilter, L" (*.*)", _countof(filter) - mir_tstrlen(filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
- _tcsncpy(pfilter, L"*.*", _countof(filter) - 1);
+ wcsncpy(pfilter, L"*.*", _countof(filter) - 1);
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
*pfilter = '\0';
ofn.lpstrFilter = filter;
@@ -452,12 +452,12 @@ int ContactDeleted(WPARAM wParam, LPARAM) // if the station is not a default station, set it as the new default station
// this is the first weather station encountered from the search
if (mir_tstrcmp(opt.Default, tszID)) {
- _tcsncpy_s(opt.Default, tszID, _TRUNCATE);
+ wcsncpy_s(opt.Default, tszID, _TRUNCATE);
opt.DefStn = hContact;
ptrT tszNick(db_get_tsa(hContact, WEATHERPROTONAME, "Nick"));
if (tszNick != NULL) {
- TCHAR str[255];
- mir_sntprintf(str, TranslateT("%s is now the default weather station"), (TCHAR*)tszNick);
+ wchar_t str[255];
+ mir_sntprintf(str, TranslateT("%s is now the default weather station"), (wchar_t*)tszNick);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default);
diff --git a/plugins/Weather/src/weather_conv.cpp b/plugins/Weather/src/weather_conv.cpp index ec5cd06521..31b0e1b93a 100644 --- a/plugins/Weather/src/weather_conv.cpp +++ b/plugins/Weather/src/weather_conv.cpp @@ -30,7 +30,7 @@ string conversions, display text parsing, etc // see if a string is a number
// s = the string to be determined
// return value = true if the string is a number, false if it isn't
-BOOL is_number(TCHAR *s)
+BOOL is_number(wchar_t *s)
{
BOOL tag = FALSE;
// looking character by character
@@ -47,7 +47,7 @@ BOOL is_number(TCHAR *s) return FALSE;
}
-static void numToStr(double num, TCHAR *str, size_t strSize)
+static void numToStr(double num, wchar_t *str, size_t strSize)
{
int i = (int)(num * (opt.NoFrac ? 10 : 100));
int u = abs(i);
@@ -75,15 +75,15 @@ static void numToStr(double num, TCHAR *str, size_t strSize) // tempchar = the string containing the temperature value
// unit = the unit for temperature
// return value = the converted temperature with degree sign and unit; if fails, return N/A
-void GetTemp(TCHAR *tempchar, TCHAR *unit, TCHAR* str)
+void GetTemp(wchar_t *tempchar, wchar_t *unit, wchar_t* str)
{
// unit can be C, F
double temp;
- TCHAR tstr[20];
+ wchar_t tstr[20];
TrimString(tempchar);
if (tempchar[0] == '-' && tempchar[1] == ' ')
- memmove(&tempchar[1], &tempchar[2], sizeof(TCHAR)*(mir_tstrlen(&tempchar[2]) + 1));
+ memmove(&tempchar[1], &tempchar[2], sizeof(wchar_t)*(mir_tstrlen(&tempchar[2]) + 1));
// quit if the value obtained is N/A or not a number
if (!mir_tstrcmp(tempchar, NODATA) || !mir_tstrcmp(tempchar, L"N/A")) {
@@ -108,7 +108,7 @@ void GetTemp(TCHAR *tempchar, TCHAR *unit, TCHAR* str) // rounding
numToStr((temp - 32) / 9 * 5, tstr, _countof(tstr));
if (opt.DoNotAppendUnit)
- _tcsncpy_s(str, MAX_DATA_LEN, tstr, _TRUNCATE);
+ wcsncpy_s(str, MAX_DATA_LEN, tstr, _TRUNCATE);
else
mir_sntprintf(str, MAX_DATA_LEN, L"%s%sC", tstr, opt.DegreeSign);
break;
@@ -116,7 +116,7 @@ void GetTemp(TCHAR *tempchar, TCHAR *unit, TCHAR* str) case 2:
numToStr(temp, tstr, _countof(tstr));
if (opt.DoNotAppendUnit)
- _tcsncpy_s(str, MAX_DATA_LEN, tstr, _TRUNCATE);
+ wcsncpy_s(str, MAX_DATA_LEN, tstr, _TRUNCATE);
else
mir_sntprintf(str, MAX_DATA_LEN, L"%s%sF", tstr, opt.DegreeSign);
break;
@@ -127,7 +127,7 @@ void GetTemp(TCHAR *tempchar, TCHAR *unit, TCHAR* str) // tempchar = the string containing the pressure value
// unit = the unit for pressure
// return value = the converted pressure with unit; if fail, return the original string
-void GetPressure(TCHAR *tempchar, TCHAR *unit, TCHAR* str)
+void GetPressure(wchar_t *tempchar, wchar_t *unit, wchar_t* str)
{
// unit can be kPa, hPa, mb, in, mm, torr
double tempunit = 0, output;
@@ -184,11 +184,11 @@ void GetPressure(TCHAR *tempchar, TCHAR *unit, TCHAR* str) // tempchar = the string containing the speed value
// unit = the unit for speed
// return value = the converted speed with unit; if fail, return _T(""
-void GetSpeed(TCHAR *tempchar, TCHAR *unit, TCHAR *str)
+void GetSpeed(wchar_t *tempchar, wchar_t *unit, wchar_t *str)
{
// unit can be km/h, mph, m/s, knots
double tempunit;
- TCHAR tstr[20];
+ wchar_t tstr[20];
str[0] = 0;
@@ -233,7 +233,7 @@ void GetSpeed(TCHAR *tempchar, TCHAR *unit, TCHAR *str) // tempchar = the string containing the distance value
// unit = the unit for distance
// return value = the converted distance with unit; if fail, return original string
-void GetDist(TCHAR *tempchar, TCHAR *unit, TCHAR *str)
+void GetDist(wchar_t *tempchar, wchar_t *unit, wchar_t *str)
{
// unit can be km, miles
double tempunit = 0, output;
@@ -273,7 +273,7 @@ void GetDist(TCHAR *tempchar, TCHAR *unit, TCHAR *str) // tempchar = the string containing the elevation value
// unit = the unit for elevation
// return value = the converted elevation with unit; if fail, return original string
-void GetElev(TCHAR *tempchar, TCHAR *unit, TCHAR *str)
+void GetElev(wchar_t *tempchar, wchar_t *unit, wchar_t *str)
{
// unit can be ft, m
double tempunit = 0, output;
@@ -316,10 +316,10 @@ void GetElev(TCHAR *tempchar, TCHAR *unit, TCHAR *str) // cond = the string for weather condition
// return value = status for the icon (ONLINE, OFFLINE, etc)
-static const TCHAR *statusStr[10] = { L"Lightning", L"Fog", L"Snow Shower", L"Snow", L"Rain Shower", L"Rain", L"Partly Cloudy", L"Cloudy", L"Sunny", L"N/A" };
+static const wchar_t *statusStr[10] = { L"Lightning", L"Fog", L"Snow Shower", L"Snow", L"Rain Shower", L"Rain", L"Partly Cloudy", L"Cloudy", L"Sunny", L"N/A" };
static const WORD statusValue[10] = { LIGHT, FOG, SSHOWER, SNOW, RSHOWER, RAIN, PCLOUDY, CLOUDY, SUNNY, NA };
-WORD GetIcon(const TCHAR* cond, WIDATA *Data)
+WORD GetIcon(const wchar_t* cond, WIDATA *Data)
{
// set the icon using ini
for (int i = 0; i < 10; i++)
@@ -328,72 +328,72 @@ WORD GetIcon(const TCHAR* cond, WIDATA *Data) // internal detection
if (
- _tcsstr(cond, L"mainy sunny") != NULL ||
- _tcsstr(cond, L"mainy clear") != NULL ||
- _tcsstr(cond, L"partly cloudy") != NULL ||
- _tcsstr(cond, L"mostly") != NULL ||
- _tcsstr(cond, L"clouds") != NULL) {
+ wcsstr(cond, L"mainy sunny") != NULL ||
+ wcsstr(cond, L"mainy clear") != NULL ||
+ wcsstr(cond, L"partly cloudy") != NULL ||
+ wcsstr(cond, L"mostly") != NULL ||
+ wcsstr(cond, L"clouds") != NULL) {
return PCLOUDY;
}
else if (
- _tcsstr(cond, L"sunny") != NULL ||
- _tcsstr(cond, L"clear") != NULL ||
- _tcsstr(cond, L"fair") != NULL) {
+ wcsstr(cond, L"sunny") != NULL ||
+ wcsstr(cond, L"clear") != NULL ||
+ wcsstr(cond, L"fair") != NULL) {
return SUNNY;
}
else if (
- _tcsstr(cond, L"thunder") != NULL ||
- _tcsstr(cond, L"t-storm") != NULL) {
+ wcsstr(cond, L"thunder") != NULL ||
+ wcsstr(cond, L"t-storm") != NULL) {
return LIGHT;
}
else if (
- _tcsstr(cond, L"cloud") != NULL ||
- _tcsstr(cond, L"overcast") != NULL) {
+ wcsstr(cond, L"cloud") != NULL ||
+ wcsstr(cond, L"overcast") != NULL) {
return CLOUDY;
}
else if (
- _tcsstr(cond, L"fog") != NULL ||
- _tcsstr(cond, L"mist") != NULL ||
- _tcsstr(cond, L"smoke") != NULL ||
- _tcsstr(cond, L"sand") != NULL ||
- _tcsstr(cond, L"dust") != NULL ||
- _tcsstr(cond, L"haze") != NULL) {
+ wcsstr(cond, L"fog") != NULL ||
+ wcsstr(cond, L"mist") != NULL ||
+ wcsstr(cond, L"smoke") != NULL ||
+ wcsstr(cond, L"sand") != NULL ||
+ wcsstr(cond, L"dust") != NULL ||
+ wcsstr(cond, L"haze") != NULL) {
return FOG;
}
else if (
- (_tcsstr(cond, L"shower") != NULL && _tcsstr(cond, L"snow") != NULL) ||
- _tcsstr(cond, L"flurries") != NULL) {
+ (wcsstr(cond, L"shower") != NULL && wcsstr(cond, L"snow") != NULL) ||
+ wcsstr(cond, L"flurries") != NULL) {
return SSHOWER;
}
else if (
- _tcsstr(cond, L"rain shower") != NULL ||
- _tcsstr(cond, L"shower") != NULL) {
+ wcsstr(cond, L"rain shower") != NULL ||
+ wcsstr(cond, L"shower") != NULL) {
return RSHOWER;
}
else if (
- _tcsstr(cond, L"snow") != NULL ||
- _tcsstr(cond, L"ice") != NULL ||
- _tcsstr(cond, L"freezing") != NULL ||
- _tcsstr(cond, L"wintry") != NULL) {
+ wcsstr(cond, L"snow") != NULL ||
+ wcsstr(cond, L"ice") != NULL ||
+ wcsstr(cond, L"freezing") != NULL ||
+ wcsstr(cond, L"wintry") != NULL) {
return SNOW;
}
else if (
- _tcsstr(cond, L"drizzle") != NULL ||
- _tcsstr(cond, L"rain") != NULL) {
+ wcsstr(cond, L"drizzle") != NULL ||
+ wcsstr(cond, L"rain") != NULL) {
return RAIN;
}
// set the icon using langpack
for (int i = 0; i < 9; i++) {
- TCHAR LangPackStr[64], LangPackStr1[128];
+ wchar_t LangPackStr[64], LangPackStr1[128];
int j = 0;
do {
j++;
// using the format _T("# Weather <condition name> <counter> #"
mir_sntprintf(LangPackStr, L"# Weather %s %i #", statusStr[i], j);
- _tcsncpy_s(LangPackStr1, TranslateTS(LangPackStr), _TRUNCATE);
+ wcsncpy_s(LangPackStr1, TranslateTS(LangPackStr), _TRUNCATE);
CharLowerBuff(LangPackStr1, (DWORD)mir_tstrlen(LangPackStr1));
- if (_tcsstr(cond, LangPackStr1) != NULL)
+ if (wcsstr(cond, LangPackStr1) != NULL)
return statusValue[i];
// loop until the translation string exists (ie, the translated string is differ from original)
} while (mir_tstrcmp(TranslateTS(LangPackStr), LangPackStr));
@@ -405,18 +405,18 @@ WORD GetIcon(const TCHAR* cond, WIDATA *Data) //============ STRING CONVERSIONS ============
//
// this function convert the string to the format with 1 upper case followed by lower case char
-void CaseConv(TCHAR *str)
+void CaseConv(wchar_t *str)
{
BOOL nextUp = TRUE;
CharLowerBuff(str, (DWORD)mir_tstrlen(str));
- for (TCHAR *pstr = str; *pstr; pstr++) {
+ for (wchar_t *pstr = str; *pstr; pstr++) {
if (*pstr == ' ' || *pstr == '-')
nextUp = TRUE;
else {
- TCHAR ch = *pstr;
+ wchar_t ch = *pstr;
if (nextUp)
- *pstr = (TCHAR)CharUpper((LPTSTR)ch);
+ *pstr = (wchar_t)CharUpper((LPTSTR)ch);
nextUp = FALSE;
}
}
@@ -485,9 +485,9 @@ char *GetSearchStr(char *dis) // w = WEATHERINFO data to be parsed
// dis = the string to parse
// return value = the parsed string
-TCHAR* GetDisplay(WEATHERINFO *w, const TCHAR *dis, TCHAR* str)
+wchar_t* GetDisplay(WEATHERINFO *w, const wchar_t *dis, wchar_t* str)
{
- TCHAR lpzDate[32], chr;
+ wchar_t lpzDate[32], chr;
char name[256], temp[2];
DBVARIANT dbv;
size_t i;
@@ -566,11 +566,11 @@ TCHAR* GetDisplay(WEATHERINFO *w, const TCHAR *dis, TCHAR* str) return str;
}
-TCHAR svcReturnText[MAX_TEXT_SIZE];
+wchar_t svcReturnText[MAX_TEXT_SIZE];
INT_PTR GetDisplaySvcFunc(WPARAM wParam, LPARAM lParam)
{
WEATHERINFO winfo = LoadWeatherInfo(wParam);
- return (INT_PTR)GetDisplay(&winfo, (TCHAR*)lParam, svcReturnText);
+ return (INT_PTR)GetDisplay(&winfo, (wchar_t*)lParam, svcReturnText);
}
//============ ID MANAGEMENT ============
@@ -578,9 +578,9 @@ INT_PTR GetDisplaySvcFunc(WPARAM wParam, LPARAM lParam) // get service data module internal name
// mod/id <- the mod part
// pszID = original 2-part id, return the service internal name
-void GetSvc(TCHAR *pszID)
+void GetSvc(wchar_t *pszID)
{
- TCHAR *chop = _tcsstr(pszID, L"/");
+ wchar_t *chop = wcsstr(pszID, L"/");
if (chop != NULL) *chop = '\0';
else pszID[0] = 0;
}
@@ -588,9 +588,9 @@ void GetSvc(TCHAR *pszID) // get the id use for update without the service internal name
// mod/id <- the id part
// pszID = original 2-part id, return the single part id
-void GetID(TCHAR *pszID)
+void GetID(wchar_t *pszID)
{
- TCHAR *chop = _tcsstr(pszID, L"/");
+ wchar_t *chop = wcsstr(pszID, L"/");
if (chop != NULL) mir_tstrcpy(pszID, chop + 1);
else pszID[0] = 0;
}
@@ -601,9 +601,9 @@ void GetID(TCHAR *pszID) // code = the error code obtained when updating weather
// str = the string for the error
//
-TCHAR *GetError(int code)
+wchar_t *GetError(int code)
{
- TCHAR *str, str2[100];
+ wchar_t *str, str2[100];
switch (code) {
case 10: str = E10; break;
case 11: str = E11; break;
diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp index 2fdd74ec15..88e9ca12e4 100644 --- a/plugins/Weather/src/weather_data.cpp +++ b/plugins/Weather/src/weather_data.cpp @@ -30,7 +30,7 @@ saving individual weather data for a weather contact. // hContact = the current contact handle
// return value = the string for station ID
//
-void GetStationID(MCONTACT hContact, TCHAR* id, int idlen)
+void GetStationID(MCONTACT hContact, wchar_t* id, int idlen)
{
// accessing the database
if (db_get_tstatic(hContact, WEATHERPROTONAME, "ID", id, idlen))
@@ -50,35 +50,35 @@ WEATHERINFO LoadWeatherInfo(MCONTACT hContact) GetStationID(hContact, winfo.id, _countof(winfo.id));
if (db_get_tstatic(hContact, WEATHERPROTONAME, "Nick", winfo.city, _countof(winfo.city)))
- _tcsncpy(winfo.city, NODATA, _countof(winfo.city) - 1);
+ wcsncpy(winfo.city, NODATA, _countof(winfo.city) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Update", winfo.update, _countof(winfo.update)))
- _tcsncpy(winfo.update, NODATA, _countof(winfo.update) - 1);
+ wcsncpy(winfo.update, NODATA, _countof(winfo.update) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Condition", winfo.cond, _countof(winfo.cond)))
- _tcsncpy(winfo.cond, NODATA, _countof(winfo.cond) - 1);
+ wcsncpy(winfo.cond, NODATA, _countof(winfo.cond) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Temperature", winfo.temp, _countof(winfo.temp)))
- _tcsncpy(winfo.temp, NODATA, _countof(winfo.temp) - 1);
+ wcsncpy(winfo.temp, NODATA, _countof(winfo.temp) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "High", winfo.high, _countof(winfo.high)))
- _tcsncpy(winfo.high, NODATA, _countof(winfo.high) - 1);
+ wcsncpy(winfo.high, NODATA, _countof(winfo.high) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Low", winfo.low, _countof(winfo.low)))
- _tcsncpy(winfo.low, NODATA, _countof(winfo.low) - 1);
+ wcsncpy(winfo.low, NODATA, _countof(winfo.low) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Sunset", winfo.sunset, _countof(winfo.sunset)))
- _tcsncpy(winfo.sunset, NODATA, _countof(winfo.sunset) - 1);
+ wcsncpy(winfo.sunset, NODATA, _countof(winfo.sunset) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Sunrise", winfo.sunrise, _countof(winfo.sunrise)))
- _tcsncpy(winfo.sunrise, NODATA, _countof(winfo.sunrise) - 1);
+ wcsncpy(winfo.sunrise, NODATA, _countof(winfo.sunrise) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Wind Speed", winfo.wind, _countof(winfo.wind)))
- _tcsncpy(winfo.wind, NODATA, _countof(winfo.wind) - 1);
+ wcsncpy(winfo.wind, NODATA, _countof(winfo.wind) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Wind Direction", winfo.winddir, _countof(winfo.winddir)))
- _tcsncpy(winfo.winddir, NODATA, _countof(winfo.winddir) - 1);
+ wcsncpy(winfo.winddir, NODATA, _countof(winfo.winddir) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Dewpoint", winfo.dewpoint, _countof(winfo.dewpoint)))
- _tcsncpy(winfo.dewpoint, NODATA, _countof(winfo.dewpoint) - 1);
+ wcsncpy(winfo.dewpoint, NODATA, _countof(winfo.dewpoint) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Pressure", winfo.pressure, _countof(winfo.pressure)))
- _tcsncpy(winfo.pressure, NODATA, _countof(winfo.pressure) - 1);
+ wcsncpy(winfo.pressure, NODATA, _countof(winfo.pressure) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Visibility", winfo.vis, _countof(winfo.vis)))
- _tcsncpy(winfo.vis, NODATA, _countof(winfo.vis) - 1);
+ wcsncpy(winfo.vis, NODATA, _countof(winfo.vis) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Humidity", winfo.humid, _countof(winfo.humid)))
- _tcsncpy(winfo.humid, NODATA, _countof(winfo.humid) - 1);
+ wcsncpy(winfo.humid, NODATA, _countof(winfo.humid) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Feel", winfo.feel, _countof(winfo.feel)))
- _tcsncpy(winfo.feel, NODATA, _countof(winfo.feel) - 1);
+ wcsncpy(winfo.feel, NODATA, _countof(winfo.feel) - 1);
winfo.status = (WORD)db_get_w(hContact, WEATHERPROTONAME, "StatusIcon", ID_STATUS_OFFLINE);
return winfo;
@@ -107,7 +107,7 @@ int DBGetData(MCONTACT hContact, char *setting, DBVARIANT *dbv) // lastver = the last used version number in dword (using PLUGIN_MAKE_VERSION)
void EraseAllInfo()
{
- TCHAR str[255];
+ wchar_t str[255];
int ContactCount = 0;
MCONTACT LastContact = NULL;
DBVARIANT dbv;
@@ -164,7 +164,7 @@ void EraseAllInfo() // in case where the default station is missing
if (opt.DefStn == NULL && ContactCount != 0) {
if (!db_get_ts(LastContact, WEATHERPROTONAME, "ID", &dbv)) {
- _tcsncpy(opt.Default, dbv.ptszVal, _countof(opt.Default) - 1);
+ wcsncpy(opt.Default, dbv.ptszVal, _countof(opt.Default) - 1);
db_free(&dbv);
}
opt.DefStn = LastContact;
@@ -178,9 +178,9 @@ void EraseAllInfo() db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default);
}
-void ConvertDataValue(WIDATAITEM *UpdateData, TCHAR *Data)
+void ConvertDataValue(WIDATAITEM *UpdateData, wchar_t *Data)
{
- TCHAR str[MAX_DATA_LEN];
+ wchar_t str[MAX_DATA_LEN];
// convert the unit
if (mir_tstrcmp(Data, TranslateT("<Error>")) && mir_tstrcmp(Data, NODATA) && mir_tstrcmp(Data, TranslateTS(NODATA))) {
@@ -245,12 +245,12 @@ void ConvertDataValue(WIDATAITEM *UpdateData, TCHAR *Data) // Data = the string containing weather data obtained from UpdateData
// global var. used: szInfo = the downloaded string
//
-void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szData)
+void GetDataValue(WIDATAITEM *UpdateData, wchar_t *Data, wchar_t** szData)
{
- TCHAR last = 0, current, *start, *end;
+ wchar_t last = 0, current, *start, *end;
unsigned startloc = 0, endloc = 0, respos = 0;
BOOL tag = FALSE, symb = FALSE;
- TCHAR *szInfo = *szData;
+ wchar_t *szInfo = *szData;
Data[0] = 0;
// parse the data if available
@@ -258,7 +258,7 @@ void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szData) start = szInfo;
// the start string must be found
if (UpdateData->Start[0] != 0) {
- start = _tcsstr(szInfo, UpdateData->Start);
+ start = wcsstr(szInfo, UpdateData->Start);
if (start != NULL) {
// set the starting location for getting data
start += mir_tstrlen(UpdateData->Start);
@@ -268,9 +268,9 @@ void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szData) // the end string must be found too
if (UpdateData->End[0] != 0)
- end = _tcsstr(szInfo, UpdateData->End);
+ end = wcsstr(szInfo, UpdateData->End);
else
- end = _tcsstr(szInfo, L" ");
+ end = wcsstr(szInfo, L" ");
if (end != NULL) {
// set the ending location
@@ -291,7 +291,7 @@ void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szData) (szInfo[startloc + 1] == ';' || szInfo[startloc + 2] == ';' || szInfo[startloc + 3] == ';' ||
szInfo[startloc + 4] == ';' || szInfo[startloc + 5] == ';' || szInfo[startloc + 6] == ';')) {
// ...but do NOT strip −
- if ((endloc - startloc) > 7 && _tcsncmp(szInfo + startloc, L"−", 7) == 0) {
+ if ((endloc - startloc) > 7 && wcsncmp(szInfo + startloc, L"−", 7) == 0) {
Data[respos++] = '-';
startloc += 7;
continue;
@@ -319,7 +319,7 @@ void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szData) mir_sntprintf(Data, MAX_DATA_LEN, TranslateT("Error when obtaining data: %s"), UpdateData->Name);
WPShowMessage(Data, SM_WARNING);
}
- _tcsncpy(Data, TranslateT("<Error>"), MAX_DATA_LEN);
+ wcsncpy(Data, TranslateT("<Error>"), MAX_DATA_LEN);
last = ' ';
respos = MAX_DATA_LEN - 1;
break;
diff --git a/plugins/Weather/src/weather_http.cpp b/plugins/Weather/src/weather_http.cpp index 429f8f654c..5567dff83f 100644 --- a/plugins/Weather/src/weather_http.cpp +++ b/plugins/Weather/src/weather_http.cpp @@ -44,7 +44,7 @@ static int findHeader(const NETLIBHTTPREQUEST *nlhrReply, const char *hdr) // return value = 0 for success, 1 or HTTP error code for failure
// global var used: szData, szInfo = containing the retrieved data
//
-int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, TCHAR **szData)
+int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, wchar_t **szData)
{
if (userAgent == NULL || userAgent[0] == 0)
userAgent = NETLIB_USER_AGENT;
@@ -77,7 +77,7 @@ int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, TCHAR **szD NETLIBHTTPREQUEST *nlhrReply = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hNetlibUser, (LPARAM)&nlhr);
if (nlhrReply == 0) {
// if the data does not downloaded successfully (ie. disconnected), then return 1000 as error code
- *szData = (TCHAR*)mir_alloc(512);
+ *szData = (wchar_t*)mir_alloc(512);
// store the error code in szData
mir_tstrcpy(*szData, L"NetLib error occurred!!");
hNetlibHttp = NULL;
@@ -124,7 +124,7 @@ int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, TCHAR **szD }
}
- TCHAR *retVal = NULL;
+ wchar_t *retVal = NULL;
if (bIsUtf)
retVal = mir_utf8decodeT(nlhrReply->pData);
if (retVal == NULL)
@@ -135,7 +135,7 @@ int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, TCHAR **szD }
// return error code if the recieved code is neither 200 OK nor 302 Moved
else {
- *szData = (TCHAR*)mir_alloc(512);
+ *szData = (wchar_t*)mir_alloc(512);
// store the error code in szData
mir_sntprintf(*szData, 512, L"Error occured! HTTP Error: %i\n", nlhrReply->resultCode);
result = nlhrReply->resultCode;
diff --git a/plugins/Weather/src/weather_info.cpp b/plugins/Weather/src/weather_info.cpp index 3372d4d3ce..f0b3ca4eac 100644 --- a/plugins/Weather/src/weather_info.cpp +++ b/plugins/Weather/src/weather_info.cpp @@ -32,7 +32,7 @@ regrading the loading of ini contents // List INI Information for all loaded INI files
static void INIInfo(HWND hwndDlg)
{
- TCHAR str[16];
+ wchar_t str[16];
size_t memused = 0;
@@ -67,7 +67,7 @@ static void INIInfo(HWND hwndDlg) }
ListView_SetItem(hIniList, &lvi);
lvi.iSubItem = 4;
- lvi.pszText = _ltot(Item->Data.UpdateDataCount, str, 10);
+ lvi.pszText = _ltow(Item->Data.UpdateDataCount, str, 10);
ListView_SetItem(hIniList, &lvi);
lvi.iSubItem = 5;
lvi.pszText = Item->Data.DisplayName;
@@ -80,24 +80,24 @@ static void INIInfo(HWND hwndDlg) ++lvi.iItem;
}
- SetDlgItemText(hwndDlg, IDC_INICOUNT, _itot(lvi.iItem, str, 10));
- SetDlgItemText(hwndDlg, IDC_MEMUSED, _ltot((long)memused, str, 10));
+ SetDlgItemText(hwndDlg, IDC_INICOUNT, _itow(lvi.iItem, str, 10));
+ SetDlgItemText(hwndDlg, IDC_MEMUSED, _ltow((long)memused, str, 10));
}
static const struct tag_Columns
{
- const TCHAR *name;
+ const wchar_t *name;
unsigned size;
}
columns[] =
{
- { LPGENT("Name"), 70 },
- { LPGENT("Author"), 100 },
- { LPGENT("File Version"), 70 },
- { LPGENT("INI Version"), 70 },
- { LPGENT("Items"), 40 },
- { LPGENT("Display Name"), 200 },
- { LPGENT("File Name"), 150 },
+ { LPGENW("Name"), 70 },
+ { LPGENW("Author"), 100 },
+ { LPGENW("File Version"), 70 },
+ { LPGENW("INI Version"), 70 },
+ { LPGENW("Items"), 40 },
+ { LPGENW("Display Name"), 200 },
+ { LPGENW("File Name"), 150 },
};
@@ -141,9 +141,9 @@ INT_PTR CALLBACK DlgProcINIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM) // get the info of individual ini file
// pszSvc = the internal name of the service to get the data
-void GetINIInfo(TCHAR *pszSvc)
+void GetINIInfo(wchar_t *pszSvc)
{
- TCHAR str2[2048];
+ wchar_t str2[2048];
WIDATA *sData = GetWIData(pszSvc);
// if the service does not exist among the loaded INI's
if (sData == NULL) {
@@ -207,10 +207,10 @@ void GetINIInfo(TCHAR *pszSvc) // can be found when click on "More" in text option dialog
void MoreVarList(void)
{
- TCHAR str[10240], tempstr[1024];
+ wchar_t str[10240], tempstr[1024];
// heading
- _tcsncpy(str, VARS_LIST, _countof(str) - 1);
+ wcsncpy(str, VARS_LIST, _countof(str) - 1);
mir_tstrncat(str, L"\n\n", _countof(str) - mir_tstrlen(str));
// loop through all weather services to find custom variables
for (WIDATALIST *Item = WIHead; Item != NULL; Item = Item->next) {
@@ -220,7 +220,7 @@ void MoreVarList(void) // ignore the "hi" item and hidden items
if (mir_tstrcmp(WItem->Item.Name, L"Ignore") && WItem->Item.Name[0] != '#') {
mir_sntprintf(tempstr, L"%c[%s]", '%', WItem->Item.Name);
- TCHAR *find = _tcsstr(str, tempstr);
+ wchar_t *find = wcsstr(str, tempstr);
// if the custom variable does not exist in the list, add it to the list
if (find == NULL) {
mir_tstrncat(str, tempstr, _countof(str) - mir_tstrlen(str));
@@ -230,7 +230,7 @@ void MoreVarList(void) }
}
// remove the last comma in the list
- TCHAR* find = _tcsrchr(str, ',');
+ wchar_t* find = wcsrchr(str, ',');
if (find != NULL)
*find = '\0';
diff --git a/plugins/Weather/src/weather_ini.cpp b/plugins/Weather/src/weather_ini.cpp index df49fe4d80..f3af9cb3f6 100644 --- a/plugins/Weather/src/weather_ini.cpp +++ b/plugins/Weather/src/weather_ini.cpp @@ -48,7 +48,7 @@ static void WIListAdd(WIDATA Data) // get the service data (from loaded ini file) by internal name
// pszServ = internal name for the service
// return value = the matching WIDATA struct for pszServ, NULL if no match found
-WIDATA* GetWIData(TCHAR *pszServ)
+WIDATA* GetWIData(wchar_t *pszServ)
{
// loop through the list to find matching internal name
for (WIDATALIST *Item = WIHead; Item != NULL; Item = Item->next)
@@ -76,7 +76,7 @@ void WIItemListAdd(WIDATAITEM *DataItem, WIDATA *Data) // reset the data item by using empty string
// Item = the item to set
// name = the string to store in the "name" field
-void ResetDataItem(WIDATAITEM *Item, const TCHAR *name)
+void ResetDataItem(WIDATAITEM *Item, const wchar_t *name)
{
Item->Name = mir_tstrdup(name);
Item->Start = L"";
@@ -121,12 +121,12 @@ void WICondListAdd(char *str, WICONDLIST *List) }
// check if the condition string matched for the assignment
-bool IsContainedInCondList(const TCHAR *pszStr, WICONDLIST *List)
+bool IsContainedInCondList(const wchar_t *pszStr, WICONDLIST *List)
{
// loop through the list to find matching internal name
for (WICONDITEM *Item = List->Head; Item != NULL; Item = Item->Next) {
// if internal name found, return true indicating that the data is found
- if (_tcsstr(pszStr, Item->Item))
+ if (wcsstr(pszStr, Item->Item))
return true;
}
@@ -178,13 +178,13 @@ static INT_PTR CALLBACK DlgProcSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case IDC_STEP2:
{
- TCHAR szPath[1024];
+ wchar_t szPath[1024];
GetModuleFileName(GetModuleHandle(NULL), szPath, _countof(szPath));
- TCHAR *chop = _tcsrchr(szPath, '\\');
+ wchar_t *chop = wcsrchr(szPath, '\\');
if (chop) {
*chop = '\0';
mir_tstrncat(szPath, L"\\Plugins\\weather\\", _countof(szPath) - mir_tstrlen(szPath));
- if (_tmkdir(szPath) == 0)
+ if (_wmkdir(szPath) == 0)
ShellExecute((HWND)lParam, L"open", szPath, L"", L"", SW_SHOW);
}
break;
@@ -222,7 +222,7 @@ static INT_PTR CALLBACK DlgProcSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR // pszFile = the file name + path for the ini file to be loaded
// pszShortFile = the file name of the ini file, but not including the path
// Data = the struct to load the ini content to, and return to previous function
-static void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data)
+static void LoadStationData(wchar_t *pszFile, wchar_t *pszShortFile, WIDATA *Data)
{
WIDATAITEM DataItem;
char *Group, *Temp;
@@ -269,7 +269,7 @@ static void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data) else if (!mir_strcmp(Line, "[Weather 0.3.x Update Data 1.5]"))
Data->InternalVer = 7;
else {
- TCHAR str[4096];
+ wchar_t str[4096];
mir_sntprintf(str, TranslateT("Invalid ini format for: %s"), pszFile);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONERROR);
fclose(pfile);
@@ -323,7 +323,7 @@ static void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data) // initialize the linked list for update items
Data->UpdateDataCount = 0;
- Data->MemUsed = sizeof(WIDATA) + sizeof(WIDATALIST) + (mir_tstrlen(pszShortFile) + mir_tstrlen(pszFile) + 20)*sizeof(TCHAR);
+ Data->MemUsed = sizeof(WIDATA) + sizeof(WIDATALIST) + (mir_tstrlen(pszShortFile) + mir_tstrlen(pszFile) + 20)*sizeof(wchar_t);
Data->UpdateData = NULL;
Data->UpdateDataTail = NULL;
@@ -446,11 +446,11 @@ static void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data) else if (!_stricmp(ValName, "URL")) wSetData(&Data->UpdateDataTail->Item.Url, Value);
else if (!_stricmp(ValName, "HIDDEN")) {
if (!_stricmp(Value, "TRUE")) {
- TCHAR *nm = Data->UpdateDataTail->Item.Name;
+ wchar_t *nm = Data->UpdateDataTail->Item.Name;
size_t len = mir_tstrlen(nm) + 1;
- Data->UpdateDataTail->Item.Name = nm = (TCHAR*)mir_realloc(nm, sizeof(TCHAR)*(len + 3));
- memmove(nm + 1, nm, len*sizeof(TCHAR));
+ Data->UpdateDataTail->Item.Name = nm = (wchar_t*)mir_realloc(nm, sizeof(wchar_t)*(len + 3));
+ memmove(nm + 1, nm, len*sizeof(wchar_t));
*nm = '#';
}
}
@@ -485,14 +485,14 @@ bool LoadWIData(bool dial) WIHead = WITail;
// find all *.ini file in the plugin\weather directory
- TCHAR szSearchPath[MAX_PATH], FileName[MAX_PATH];
+ wchar_t szSearchPath[MAX_PATH], FileName[MAX_PATH];
GetModuleFileName(GetModuleHandle(NULL), szSearchPath, _countof(szSearchPath));
- TCHAR *chop = _tcsrchr(szSearchPath, '\\');
+ wchar_t *chop = wcsrchr(szSearchPath, '\\');
if (chop == NULL)
return false;
*chop = '\0';
mir_tstrncat(szSearchPath, L"\\Plugins\\Weather\\*.ini", _countof(szSearchPath) - mir_tstrlen(szSearchPath));
- _tcsncpy(FileName, szSearchPath, MAX_PATH - 1);
+ wcsncpy(FileName, szSearchPath, MAX_PATH - 1);
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(szSearchPath, &fd);
@@ -501,7 +501,7 @@ bool LoadWIData(bool dial) // load the content of the ini file into memory
if (hFind != INVALID_HANDLE_VALUE) {
do {
- chop = _tcsrchr(FileName, '\\');
+ chop = wcsrchr(FileName, '\\');
chop[1] = '\0';
mir_tstrncat(FileName, fd.cFileName, _countof(FileName) - mir_tstrlen(FileName));
if (mir_tstrcmpi(fd.cFileName, L"SAMPLE_INI.INI")) {
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index 61f323d8d9..fdd83c3d94 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -159,10 +159,10 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara {
FontIDT fntid = { 0 };
mir_tstrcpy(fntid.group, _T(WEATHERPROTONAME));
- mir_tstrcpy(fntid.name, LPGENT("Frame Font"));
+ mir_tstrcpy(fntid.name, LPGENW("Frame Font"));
fntc = CallService(MS_FONT_GETT, (WPARAM)&fntid, (LPARAM)&lfnt);
- mir_tstrcpy(fntid.name, LPGENT("Frame Title Font"));
+ mir_tstrcpy(fntid.name, LPGENW("Frame Title Font"));
fntc1 = CallService(MS_FONT_GETT, (WPARAM)&fntid, (LPARAM)&lfnt1);
}
@@ -197,7 +197,7 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara HFONT hfnt = CreateFontIndirect(&lfnt1);
HFONT hfntold = (HFONT)SelectObject(hdc, hfnt);
- TCHAR *nick = (TCHAR*)pcli->pfnGetContactDisplayName(data->hContact, 0);
+ wchar_t *nick = (wchar_t*)pcli->pfnGetContactDisplayName(data->hContact, 0);
SIZE fontSize;
GetTextExtentPoint32(hdc, L"|", 1, &fontSize);
@@ -241,7 +241,7 @@ static void addWindow(MCONTACT hContact) if (db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv))
return;
- TCHAR winname[512];
+ wchar_t winname[512];
mir_sntprintf(winname, L"Weather: %s", dbv.ptszVal);
db_free(&dbv);
@@ -328,7 +328,7 @@ void InitMwin(void) colourid.cbSize = sizeof(ColourIDT);
mir_strcpy(colourid.dbSettingsGroup, WEATHERPROTONAME);
mir_strcpy(colourid.setting, "ColorMwinFrame");
- mir_tstrcpy(colourid.name, LPGENT("Frame Background"));
+ mir_tstrcpy(colourid.name, LPGENW("Frame Background"));
mir_tstrcpy(colourid.group, _T(WEATHERPROTONAME));
colourid.defcolour = GetSysColor(COLOR_3DFACE);
ColourRegisterT(&colourid);
@@ -338,7 +338,7 @@ void InitMwin(void) fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID;
mir_strcpy(fontid.dbSettingsGroup, WEATHERPROTONAME);
mir_tstrcpy(fontid.group, _T(WEATHERPROTONAME));
- mir_tstrcpy(fontid.name, LPGENT("Frame Font"));
+ mir_tstrcpy(fontid.name, LPGENW("Frame Font"));
mir_strcpy(fontid.prefix, "fnt0");
HDC hdc = GetDC(NULL);
@@ -348,11 +348,11 @@ void InitMwin(void) fontid.deffontsettings.charset = DEFAULT_CHARSET;
mir_tstrcpy(fontid.deffontsettings.szFace, L"Verdana");
mir_tstrcpy(fontid.backgroundGroup, _T(WEATHERPROTONAME));
- mir_tstrcpy(fontid.backgroundName, LPGENT("Frame Background"));
+ mir_tstrcpy(fontid.backgroundName, LPGENW("Frame Background"));
FontRegisterT(&fontid);
fontid.deffontsettings.style = DBFONTF_BOLD;
- mir_tstrcpy(fontid.name, LPGENT("Frame Title Font"));
+ mir_tstrcpy(fontid.name, LPGENW("Frame Title Font"));
mir_strcpy(fontid.prefix, "fnt1");
FontRegisterT(&fontid);
diff --git a/plugins/Weather/src/weather_opt.cpp b/plugins/Weather/src/weather_opt.cpp index 48d275e12b..ea567ff901 100644 --- a/plugins/Weather/src/weather_opt.cpp +++ b/plugins/Weather/src/weather_opt.cpp @@ -33,46 +33,46 @@ int RedrawFrame(WPARAM wParam, LPARAM lParam); // in = string to determine which field to set default "CBNEHXPp"
void SetTextDefault(const char* in)
{
- TCHAR str[MAX_TEXT_SIZE];
+ wchar_t str[MAX_TEXT_SIZE];
if (strchr(in, 'C') != NULL) {
- _tcsncpy(str, C_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, C_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.cText, str);
}
if (strchr(in, 'b') != NULL) {
- _tcsncpy(str, b_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, b_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.bTitle, str);
}
if (strchr(in, 'B') != NULL) {
- _tcsncpy(str, B_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, B_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.bText, str);
}
if (strchr(in, 'N') != NULL) {
- _tcsncpy(str, N_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, N_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.nText, str);
}
if (strchr(in, 'E') != NULL) {
- _tcsncpy(str, E_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, E_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.eText, str);
}
if (strchr(in, 'H') != NULL) {
- _tcsncpy(str, H_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, H_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.hText, str);
}
if (strchr(in, 'X') != NULL) {
- _tcsncpy(str, X_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, X_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.xText, str);
}
if (strchr(in, 'P') != NULL) {
- _tcsncpy(str, P_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, P_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.pTitle, str);
}
if (strchr(in, 'p') != NULL) {
- _tcsncpy(str, p_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, p_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.pText, str);
}
if (strchr(in, 'S') != NULL) {
- _tcsncpy(str, s_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, s_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.sText, str);
}
}
@@ -115,7 +115,7 @@ void LoadOptions(void) opt.eUnit = db_get_w(NULL, WEATHERPROTONAME, "eUnit", 2);
ptrT szValue(db_get_tsa(NULL, WEATHERPROTONAME, "DegreeSign"));
- _tcsncpy_s(opt.DegreeSign, (szValue == NULL) ? L"" : szValue, _TRUNCATE);
+ wcsncpy_s(opt.DegreeSign, (szValue == NULL) ? L"" : szValue, _TRUNCATE);
opt.DoNotAppendUnit = db_get_b(NULL, WEATHERPROTONAME, "DoNotAppendUnit", 0);
opt.NoFrac = db_get_b(NULL, WEATHERPROTONAME, "NoFractions", 0);
@@ -191,7 +191,7 @@ void LoadOptions(void) // misc
if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "Default"))
- _tcsncpy_s(opt.Default, szValue, _TRUNCATE);
+ wcsncpy_s(opt.Default, szValue, _TRUNCATE);
else
opt.Default[0] = 0;
}
@@ -255,14 +255,14 @@ void SaveOptions(void) // weather options
static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
{
- TCHAR str[512];
+ wchar_t str[512];
switch (msg) {
case WM_INITDIALOG:
opt_startup = TRUE;
TranslateDialogDefault(hdlg);
// load settings
- _ltot(opt.UpdateTime, str, 10);
+ _ltow(opt.UpdateTime, str, 10);
SetDlgItemText(hdlg, IDC_UPDATETIME, str);
SetDlgItemText(hdlg, IDC_DEGREE, opt.DegreeSign);
@@ -335,7 +335,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l // get update time and remove the old timer
GetDlgItemText(hdlg, IDC_UPDATETIME, str, _countof(str));
- opt.UpdateTime = (WORD)_ttoi(str);
+ opt.UpdateTime = (WORD)_wtoi(str);
if (opt.UpdateTime < 1) opt.UpdateTime = 1;
KillTimer(NULL, timerId);
timerId = SetTimer(NULL, 0, opt.UpdateTime * 60000, timerProc);
@@ -417,14 +417,14 @@ static void FreeTextVar(void) static const char *varname[8] = { "C", "b", "B", "N", "X", "E", "H", "S" };
static const int cname[8] = { IDC_CTEXT, IDC_BTITLE, IDC_BTEXT, IDC_NTEXT, IDC_XTEXT, IDC_ETEXT, IDC_HTEXT, IDC_BTITLE2 };
-static TCHAR* const *var[8] = { &opt.cText, &opt.bTitle, &opt.bText, &opt.nText, &opt.xText, &opt.eText, &opt.hText, &opt.sText };
+static wchar_t* const *var[8] = { &opt.cText, &opt.bTitle, &opt.bText, &opt.nText, &opt.xText, &opt.eText, &opt.hText, &opt.sText };
static INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
RECT rc, pos;
HWND button;
HMENU hMenu, hMenu1;
- TCHAR str[4096];
+ wchar_t str[4096];
switch (msg) {
case WM_INITDIALOG:
opt_startup = TRUE;
@@ -433,7 +433,7 @@ static INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM l SetWindowPos(hdlg, HWND_TOPMOST, rc.left, rc.top, 0, 0, SWP_NOSIZE);
TranslateDialogDefault(hdlg);
// generate the display text for variable list
- _tcsncpy(str, VAR_LIST_OPT, _countof(str) - 1);
+ wcsncpy(str, VAR_LIST_OPT, _countof(str) - 1);
SetDlgItemText(hdlg, IDC_VARLIST, str);
// make the more variable and other buttons flat
@@ -498,7 +498,7 @@ static INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM l case ID_MRESET:
unsigned varo = LOWORD(wParam) - IDC_TM1;
// remove the old setting from db and free memory
- TCHAR* vartmp = *var[varo];
+ wchar_t* vartmp = *var[varo];
wfree(&vartmp);
SetTextDefault(varname[varo]);
SetDlgItemText(hdlg, cname[varo], *var[varo]);
@@ -535,7 +535,7 @@ static INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM l switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
// save the option
- TCHAR textstr[MAX_TEXT_SIZE];
+ wchar_t textstr[MAX_TEXT_SIZE];
// free memory for old settings
FreeTextVar();
// save new settings to memory
@@ -577,25 +577,25 @@ int OptInit(WPARAM wParam, LPARAM) odp.position = 95600;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.pfnDlgProc = OptionsProc;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTitle = _T(WEATHERPROTOTEXT);
- odp.ptszTab = LPGENT("General");
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTitle = _T(WEATHERPROTOTEXT);
+ odp.pwszTab = LPGENW("General");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &odp);
// text options
odp.pszTemplate = MAKEINTRESOURCEA(IDD_TEXTOPT);
odp.pfnDlgProc = DlgProcText;
- odp.ptszTab = LPGENT("Display");
+ odp.pwszTab = LPGENW("Display");
Options_AddPage(wParam, &odp);
// if popup service exists, load the weather popup options
if ((ServiceExists(MS_POPUP_ADDPOPUPT))) {
odp.position = 100000000;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUP);
- odp.ptszGroup = LPGENT("Popups");
+ odp.pwszGroup = LPGENW("Popups");
odp.groupPosition = 910000000;
- odp.ptszTab = NULL;
+ odp.pwszTab = NULL;
odp.pfnDlgProc = DlgPopupOpts;
Options_AddPage(wParam, &odp);
}
diff --git a/plugins/Weather/src/weather_popup.cpp b/plugins/Weather/src/weather_popup.cpp index fcd891e70c..4e721a07a5 100644 --- a/plugins/Weather/src/weather_popup.cpp +++ b/plugins/Weather/src/weather_popup.cpp @@ -40,7 +40,7 @@ int WeatherError(WPARAM wParam, LPARAM lParam) if (!opt.UsePopup)
return 0;
- TCHAR* tszMsg = (TCHAR*)wParam;
+ wchar_t* tszMsg = (wchar_t*)wParam;
if ((DWORD)lParam == SM_WARNING)
PUShowMessageT(tszMsg, SM_WARNING);
@@ -48,19 +48,19 @@ int WeatherError(WPARAM wParam, LPARAM lParam) PUShowMessageT(tszMsg, SM_NOTIFY);
else if ((DWORD)lParam == SM_WEATHERALERT) {
POPUPDATAT ppd = { 0 };
- TCHAR str1[512], str2[512];
+ wchar_t str1[512], str2[512];
// get the 2 strings
- _tcsncpy(str1, tszMsg, _countof(str1) - 1);
- _tcsncpy(str2, tszMsg, _countof(str2) - 1);
- TCHAR *chop = _tcschr(str1, 255);
+ wcsncpy(str1, tszMsg, _countof(str1) - 1);
+ wcsncpy(str2, tszMsg, _countof(str2) - 1);
+ wchar_t *chop = wcschr(str1, 255);
if (chop != NULL)
*chop = '\0';
else
str1[0] = 0;
- chop = _tcschr(str2, 255);
+ chop = wcschr(str2, 255);
if (chop != NULL)
- _tcsncpy(str2, chop + 1, _countof(str2) - 1);
+ wcsncpy(str2, chop + 1, _countof(str2) - 1);
else
str2[0] = 0;
@@ -81,7 +81,7 @@ int WeatherError(WPARAM wParam, LPARAM lParam) // (threaded)
// lpzText = error text
// kind = display type (see m_popup.h)
-int WPShowMessage(TCHAR* lpzText, WORD kind)
+int WPShowMessage(wchar_t* lpzText, WORD kind)
{
NotifyEventHooks(hHookWeatherError, (WPARAM)lpzText, (LPARAM)kind);
return 0;
@@ -211,8 +211,8 @@ static void SelectMenuItem(HMENU hMenu, int Check) // but does not write to the database
void ReadPopupOpt(HWND hdlg)
{
- TCHAR text[MAX_TEXT_SIZE];
- TCHAR str[512];
+ wchar_t text[MAX_TEXT_SIZE];
+ wchar_t str[512];
// popup colour
opt.TextColour = SendDlgItemMessage(hdlg, IDC_TEXTCOLOUR, CPM_GETCOLOUR, 0, 0);
@@ -220,7 +220,7 @@ void ReadPopupOpt(HWND hdlg) // get delay time
GetDlgItemText(hdlg, IDC_DELAY, str, _countof(str));
- int num = _ttoi(str);
+ int num = _wtoi(str);
opt.pDelay = num;
// other options
@@ -244,7 +244,7 @@ void ReadPopupOpt(HWND hdlg) INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
int ID;
- TCHAR str[512];
+ wchar_t str[512];
HMENU hMenu, hMenu1;
RECT pos;
HWND button;
@@ -273,7 +273,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) SetDlgItemText(hdlg, IDC_PText, opt.pText);
SetDlgItemText(hdlg, IDC_PTitle, opt.pTitle);
// setting popup delay option
- _ltot(opt.pDelay, str, 10);
+ _ltow(opt.pDelay, str, 10);
SetDlgItemText(hdlg, IDC_DELAY, str);
if (opt.pDelay == -1)
CheckRadioButton(hdlg, IDC_PD1, IDC_PD3, IDC_PD2);
@@ -394,7 +394,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) case IDC_VAR3:
// display variable list
- _tcsncpy(str, L" \n", _countof(str) - 1); // to make the message box wider
+ wcsncpy(str, L" \n", _countof(str) - 1); // to make the message box wider
mir_tstrncat(str, VAR_LIST_POPUP, _countof(str) - mir_tstrlen(str));
mir_tstrncat(str, L"\n", _countof(str) - mir_tstrlen(str));
mir_tstrncat(str, CUSTOM_VARS, _countof(str) - mir_tstrlen(str));
diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp index 753c91c1e8..cd283324bb 100644 --- a/plugins/Weather/src/weather_svcs.cpp +++ b/plugins/Weather/src/weather_svcs.cpp @@ -123,17 +123,17 @@ INT_PTR WeatherGetInfo(WPARAM, LPARAM lParam) }
// avatars
-static const TCHAR *statusStr[] = { L"Light", L"Fog", L"SShower", L"Snow", L"RShower", L"Rain", L"PCloudy", L"Cloudy", L"Sunny", L"NA" };
+static const wchar_t *statusStr[] = { L"Light", L"Fog", L"SShower", L"Snow", L"RShower", L"Rain", L"PCloudy", L"Cloudy", L"Sunny", L"NA" };
static const WORD statusValue[] = { LIGHT, FOG, SSHOWER, SNOW, RSHOWER, RAIN, PCLOUDY, CLOUDY, SUNNY, NA };
INT_PTR WeatherGetAvatarInfo(WPARAM, LPARAM lParam)
{
- TCHAR szSearchPath[MAX_PATH], *chop;
+ wchar_t szSearchPath[MAX_PATH], *chop;
unsigned i;
PROTO_AVATAR_INFORMATION *pai = (PROTO_AVATAR_INFORMATION*)lParam;
GetModuleFileName(GetModuleHandle(NULL), szSearchPath, _countof(szSearchPath));
- chop = _tcsrchr(szSearchPath, '\\');
+ chop = wcsrchr(szSearchPath, '\\');
if (chop) *chop = '\0';
else szSearchPath[0] = 0;
@@ -148,12 +148,12 @@ INT_PTR WeatherGetAvatarInfo(WPARAM, LPARAM lParam) pai->format = PA_FORMAT_PNG;
mir_sntprintf(pai->filename, L"%s\\Plugins\\Weather\\%s.png", szSearchPath, statusStr[i]);
- if (_taccess(pai->filename, 4) == 0)
+ if (_waccess(pai->filename, 4) == 0)
return GAIR_SUCCESS;
pai->format = PA_FORMAT_GIF;
mir_sntprintf(pai->filename, L"%s\\Plugins\\Weather\\%s.gif", szSearchPath, statusStr[i]);
- if (_taccess(pai->filename, 4) == 0)
+ if (_waccess(pai->filename, 4) == 0)
return GAIR_SUCCESS;
pai->format = PA_FORMAT_UNKNOWN;
@@ -225,11 +225,11 @@ void UpdateMenu(BOOL State) db_set_b(NULL, WEATHERPROTONAME, "AutoUpdate", (BYTE)State);
if (State) { // to enable auto-update
- Menu_ModifyItem(hEnableDisableMenu, LPGENT("Auto Update Enabled"), GetIconHandle("main"));
+ Menu_ModifyItem(hEnableDisableMenu, LPGENW("Auto Update Enabled"), GetIconHandle("main"));
opt.AutoUpdate = 1;
}
else { // to disable auto-update
- Menu_ModifyItem(hEnableDisableMenu, LPGENT("Auto Update Disabled"), GetIconHandle("disabled"));
+ Menu_ModifyItem(hEnableDisableMenu, LPGENW("Auto Update Disabled"), GetIconHandle("disabled"));
opt.AutoUpdate = 0;
}
@@ -243,9 +243,9 @@ void UpdatePopupMenu(BOOL State) db_set_b(NULL, WEATHERPROTONAME, "UsePopup", (BYTE)opt.UsePopup);
if (State) // to enable popup
- Menu_ModifyItem(hEnableDisablePopupMenu, LPGENT("Disable &weather notification"), GetIconHandle("popup"));
+ Menu_ModifyItem(hEnableDisablePopupMenu, LPGENW("Disable &weather notification"), GetIconHandle("popup"));
else // to disable popup
- Menu_ModifyItem(hEnableDisablePopupMenu, LPGENT("Enable &weather notification"), GetIconHandle("nopopup"));
+ Menu_ModifyItem(hEnableDisablePopupMenu, LPGENW("Enable &weather notification"), GetIconHandle("nopopup"));
}
// update the weather auto-update menu item when click on it
@@ -326,7 +326,7 @@ void AddMenuItems(void) Menu_AddContactMenuItem(&mi, WEATHERPROTONAME);
// adding main menu items
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Weather"), 500099000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Weather"), 500099000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "82809D2F-2CF0-4E15-9350-D257A7748552");
SET_UID(mi, 0x5ad16188, 0xe0a0, 0x4c31, 0x85, 0xc3, 0xe4, 0x85, 0x79, 0x7e, 0x4b, 0x9c);
@@ -361,7 +361,7 @@ void AddMenuItems(void) mi.name.a = LPGEN("Weather Notification");
mi.hIcolibItem = GetIconHandle("popup");
mi.position = 0;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Popups"), 0);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 0);
mi.pszService = WEATHERPROTONAME "/PopupMenu";
hEnableDisablePopupMenu = Menu_AddMainMenuItem(&mi);
UpdatePopupMenu(opt.UsePopup);
diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index 6a6403dbdd..65c814dee1 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -34,7 +34,7 @@ UPDATELIST *UpdateListHead, *UpdateListTail; // hContact = current contact
int UpdateWeather(MCONTACT hContact)
{
- TCHAR str[256], str2[MAX_TEXT_SIZE];
+ wchar_t str[256], str2[MAX_TEXT_SIZE];
DBVARIANT dbv;
BOOL Ch = FALSE;
@@ -59,7 +59,7 @@ int UpdateWeather(MCONTACT hContact) mir_sntprintf(str, _countof(str) - 105,
TranslateT("Unable to retrieve weather information for %s"), dbv.ptszVal);
mir_tstrncat(str, L"\n", _countof(str) - mir_tstrlen(str));
- TCHAR *tszError = GetError(code);
+ wchar_t *tszError = GetError(code);
mir_tstrncat(str, tszError, _countof(str) - mir_tstrlen(str));
WPShowMessage(str, SM_WARNING);
mir_free(tszError);
@@ -172,12 +172,12 @@ int UpdateWeather(MCONTACT hContact) DeleteFile(dbv.ptszVal);
// open the file and set point to the end of file
- FILE *file = _tfopen(dbv.ptszVal, L"a");
+ FILE *file = _wfopen(dbv.ptszVal, L"a");
db_free(&dbv);
if (file != NULL) {
// write data to the file and close
GetDisplay(&winfo, opt.eText, str2);
- _fputts(str2, file);
+ fputws(str2, file);
fclose(file);
}
}
@@ -379,17 +379,17 @@ INT_PTR UpdateAllRemove(WPARAM, LPARAM) int GetWeatherData(MCONTACT hContact)
{
// get each part of the id's
- TCHAR id[256];
+ wchar_t id[256];
GetStationID(hContact, id, _countof(id));
// test ID format
- TCHAR* szInfo = _tcschr(id, '/');
+ wchar_t* szInfo = wcschr(id, '/');
if (szInfo == NULL)
return INVALID_ID_FORMAT;
GetID(id);
- TCHAR Svc[256];
+ wchar_t Svc[256];
GetStationID(hContact, Svc, _countof(Svc));
GetSvc(Svc);
@@ -431,13 +431,13 @@ int GetWeatherData(MCONTACT hContact) continue;
// download the html file from the internet
- TCHAR* szData = NULL;
+ wchar_t* szData = NULL;
int retval = InternetDownloadFile(loc, Data->Cookie, Data->UserAgent, &szData);
if (retval != 0) {
mir_free(szData);
return retval;
}
- if (_tcsstr(szData, L"Document Not Found") != NULL) {
+ if (wcsstr(szData, L"Document Not Found") != NULL) {
mir_free(szData);
return DOC_NOT_FOUND;
}
@@ -452,21 +452,21 @@ int GetWeatherData(MCONTACT hContact) continue;
}
- TCHAR DataValue[MAX_DATA_LEN];
+ wchar_t DataValue[MAX_DATA_LEN];
switch (Item->Item.Type) {
case WID_NORMAL:
// if it is a normal item with start= and end=, then parse through the downloaded string
// to get a data value.
GetDataValue(&Item->Item, DataValue, &szInfo);
if (mir_tstrcmp(Item->Item.Name, L"Condition") && mir_tstrcmpi(Item->Item.Unit, L"Cond"))
- _tcsncpy(DataValue, TranslateTS(DataValue), MAX_DATA_LEN - 1);
+ wcsncpy(DataValue, TranslateTS(DataValue), MAX_DATA_LEN - 1);
break;
case WID_SET:
{
// for the "Set Data=" operation
DBVARIANT dbv;
- TCHAR *chop, *str, str2[MAX_DATA_LEN];
+ wchar_t *chop, *str, str2[MAX_DATA_LEN];
BOOL hasvar = FALSE;
size_t stl;
@@ -476,12 +476,12 @@ int GetWeatherData(MCONTACT hContact) // go through each part of the operation string seperated by the & operator
do {
// the end of the string, last item
- chop = _tcsstr(str, L" & ");
+ chop = wcsstr(str, L" & ");
if (chop == NULL)
- chop = _tcschr(str, '\0');
+ chop = wcschr(str, '\0');
stl = min(sizeof(str2) - 1, (unsigned)(chop - str - 2));
- _tcsncpy(str2, str + 1, stl);
+ wcsncpy(str2, str + 1, stl);
str2[stl] = 0;
switch (str[0]) {
@@ -512,7 +512,7 @@ int GetWeatherData(MCONTACT hContact) // for the "Break Data=" operation
DBVARIANT dbv;
if (!DBGetData(hContact, _T2A(Item->Item.Start), &dbv)) {
- _tcsncpy(DataValue, dbv.ptszVal, _countof(DataValue));
+ wcsncpy(DataValue, dbv.ptszVal, _countof(DataValue));
DataValue[_countof(DataValue) - 1] = 0;
db_free(&dbv);
}
@@ -522,7 +522,7 @@ int GetWeatherData(MCONTACT hContact) }
// generate the strings
- TCHAR* end = _tcsstr(DataValue, Item->Item.Break);
+ wchar_t* end = wcsstr(DataValue, Item->Item.Break);
if (end == NULL) {
DataValue[0] = 0;
break; // exit if break string is not found
@@ -552,7 +552,7 @@ int GetWeatherData(MCONTACT hContact) if (!mir_tstrcmp(Svc, opt.Default))
db_set_ts(NULL, DEFCURRENTWEATHER, _T2A(Item->Item.Name), DataValue);
if (!mir_tstrcmp(Item->Item.Name, L"Condition")) {
- TCHAR buf[128], *cbuf;
+ wchar_t buf[128], *cbuf;
mir_sntprintf(buf, L"#%s Weather", DataValue);
cbuf = TranslateTS(buf);
if (cbuf[0] == '#')
@@ -562,7 +562,7 @@ int GetWeatherData(MCONTACT hContact) cond = GetIcon(DataValue, Data);
}
else if (mir_tstrcmpi(Item->Item.Unit, L"Cond") == 0) {
- TCHAR buf[128], *cbuf;
+ wchar_t buf[128], *cbuf;
mir_sntprintf(buf, L"#%s Weather", DataValue);
cbuf = TranslateTS(buf);
if (cbuf[0] == '#')
diff --git a/plugins/Weather/src/weather_userinfo.cpp b/plugins/Weather/src/weather_userinfo.cpp index b1538f332e..b4adc2bf28 100644 --- a/plugins/Weather/src/weather_userinfo.cpp +++ b/plugins/Weather/src/weather_userinfo.cpp @@ -55,13 +55,13 @@ static int BriefDlgResizer(HWND, LPARAM, UTILRESIZECONTROL *urc) static void LoadBriefInfoText(HWND hwndDlg, MCONTACT hContact)
{
WEATHERINFO winfo;
- TCHAR str[4096];
+ wchar_t str[4096];
// load weather information from the contact into the WEATHERINFO struct
winfo = LoadWeatherInfo(hContact);
// check if data exist. If not, display error message box
if (!(BOOL)db_get_b(hContact, WEATHERPROTONAME, "IsUpdated", FALSE))
- _tcsncpy(str, WEATHER_NO_INFO, _countof(str) - 1);
+ wcsncpy(str, WEATHER_NO_INFO, _countof(str) - 1);
else
// set the display text and show the message box
GetDisplay(&winfo, opt.bText, str);
@@ -210,7 +210,7 @@ static INT_PTR CALLBACK DlgProcMoreData(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_LBUTTONUP:
TEXTRANGE tr;
tr.chrg = enlink->chrg;
- tr.lpstrText = (LPTSTR)mir_alloc(sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 8));
+ tr.lpstrText = (LPTSTR)mir_alloc(sizeof(wchar_t)*(tr.chrg.cpMax - tr.chrg.cpMin + 8));
SendMessage(pNmhdr->hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
Utils_OpenUrlT(tr.lpstrText);
mir_free(tr.lpstrText);
@@ -239,7 +239,7 @@ static INT_PTR CALLBACK DlgProcMoreData(HWND hwndDlg, UINT msg, WPARAM wParam, L static INT_PTR CALLBACK DlgProcUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
WEATHERINFO w;
- TCHAR str[MAX_TEXT_SIZE];
+ wchar_t str[MAX_TEXT_SIZE];
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
@@ -316,7 +316,7 @@ int UserInfoInit(WPARAM wParam, LPARAM lParam) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.position = 100000000;
- odp.ptszTitle = _T(WEATHERPROTONAME);
+ odp.pwszTitle = _T(WEATHERPROTONAME);
if (lParam == 0) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO);
diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index fbdc6e9442..802227954d 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -164,7 +164,7 @@ extern "C" int __declspec(dllexport) Load() InitServices();
//add sound event to options
- SkinAddNewSoundExT("webviewalert", _T(MODULENAME), LPGENT("Alert event"));
+ SkinAddNewSoundExT("webviewalert", _T(MODULENAME), LPGENW("Alert event"));
//value is 1 if menu is disabled
db_set_b(NULL, MODULENAME, MENU_IS_DISABLED_KEY, 1);
@@ -183,9 +183,9 @@ extern "C" int __declspec(dllexport) Load() CreateServiceFunction("DisableWebview", AutoUpdateMCmd);
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
if (db_get_b(NULL, MODULENAME, DISABLE_AUTOUPDATE_KEY, 0))
- mi.name.t = LPGENT("Auto update disabled");
+ mi.name.w = LPGENW("Auto update disabled");
else
- mi.name.t = LPGENT("Auto update enabled");
+ mi.name.w = LPGENW("Auto update enabled");
mi.pszService = "DisableWebview";
hMenuItem1 = Menu_AddMainMenuItem(&mi);
@@ -194,7 +194,7 @@ extern "C" int __declspec(dllexport) Load() CreateServiceFunction("UpdateAll", UpdateAllMenuCommand);
mi.position = 500090002;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
- mi.name.t = LPGENT("Update all Webview sites");
+ mi.name.w = LPGENW("Update all Webview sites");
mi.pszService = "UpdateAll";
Menu_AddMainMenuItem(&mi);
@@ -203,7 +203,7 @@ extern "C" int __declspec(dllexport) Load() CreateServiceFunction("MarkAllSitesRead", MarkAllReadMenuCommand);
mi.position = 500090099;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_MARKALLREAD));
- mi.name.t = LPGENT("Mark all Webview sites as read");
+ mi.name.w = LPGENW("Mark all Webview sites as read");
mi.pszService = "MarkAllSitesRead";
Menu_AddMainMenuItem(&mi);
@@ -212,7 +212,7 @@ extern "C" int __declspec(dllexport) Load() CreateServiceFunction("OpenCacheFolder", OpenCacheDir);
mi.position = 500090099;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_FOLDER));
- mi.name.t = LPGENT("Open cache folder");
+ mi.name.w = LPGENW("Open cache folder");
mi.pszService = "OpenCacheFolder";
Menu_AddMainMenuItem(&mi);
@@ -220,11 +220,11 @@ extern "C" int __declspec(dllexport) Load() SET_UID(mi, 0xbb1a94a9, 0xca63, 0x4966, 0x98, 0x48, 0x8b, 0x3f, 0x9d, 0xac, 0x6a, 0x10);
CreateServiceFunction("Countdown", CountdownMenuCommand);
mi.flags |= CMIF_KEEPUNTRANSLATED;
- TCHAR countername[100];
+ wchar_t countername[100];
mir_sntprintf(countername, TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
mi.position = 600090099;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
- mi.name.t = countername;
+ mi.name.w = countername;
mi.pszService = "Countdown";
hMenuItemCountdown = Menu_AddMainMenuItem(&mi);
}
@@ -237,49 +237,49 @@ extern "C" int __declspec(dllexport) Load() mi.position = 100;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_URL));
mi.pszService = "Open web page";
- mi.name.t = LPGENT("Open web page");
+ mi.name.w = LPGENW("Open web page");
Menu_AddContactMenuItem(&mi, MODULENAME);
SET_UID(mi, 0x9d803e61, 0xc929, 0x4c6e, 0x9e, 0x7, 0x93, 0x0, 0xab, 0x14, 0x13, 0x50);
CreateServiceFunction("OpenClose Window", DataWndMenuCommand);
mi.pszService = "OpenClose Window";
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SHOW_HIDE));
- mi.name.t = LPGENT("Open/Close window");
+ mi.name.w = LPGENW("Open/Close window");
Menu_AddContactMenuItem(&mi, MODULENAME);
SET_UID(mi, 0x3840cc71, 0xcc85, 0x448d, 0xb5, 0xc8, 0x1a, 0x7d, 0xfe, 0xf0, 0x8, 0x85);
mi.position = 2222220;
mi.pszService = "UpdateData";
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATE));
- mi.name.t = LPGENT("Update data");
+ mi.name.w = LPGENW("Update data");
Menu_AddContactMenuItem(&mi, MODULENAME);
SET_UID(mi, 0xd1ab586c, 0x2c71, 0x429c, 0xb1, 0x79, 0x7b, 0x3a, 0x1d, 0x4a, 0xc1, 0x7d);
CreateServiceFunction("ContactOptions", CntOptionsMenuCommand);
mi.pszService = "ContactOptions";
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_OPTIONS));
- mi.name.t = LPGENT("Contact options");
+ mi.name.w = LPGENW("Contact options");
Menu_AddContactMenuItem(&mi, MODULENAME);
SET_UID(mi, 0xe4cda597, 0x9def, 0x4f54, 0x8a, 0xc6, 0x69, 0x3b, 0x5a, 0x7d, 0x77, 0xb6);
CreateServiceFunction("ContactAlertOpts", CntAlertMenuCommand);
mi.pszService = "ContactAlertOpts";
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ALERT));
- mi.name.t = LPGENT("Contact alert options");
+ mi.name.w = LPGENW("Contact alert options");
Menu_AddContactMenuItem(&mi, MODULENAME);
SET_UID(mi, 0x63fdeed8, 0xf880, 0x423f, 0x95, 0xae, 0x20, 0x8c, 0x86, 0x3c, 0x5, 0xd8);
CreateServiceFunction("PingWebsite", PingWebsiteMenuCommand);
mi.pszService = "PingWebsite";
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_PING));
- mi.name.t = LPGENT("Ping web site");
+ mi.name.w = LPGENW("Ping web site");
Menu_AddContactMenuItem(&mi, MODULENAME);
SET_UID(mi, 0x28fd36de, 0x6ce1, 0x43d0, 0xa1, 0x6e, 0x98, 0x71, 0x53, 0xe8, 0xc9, 0xf4);
CreateServiceFunction("StopDataProcessing", StpPrcssMenuCommand);
mi.pszService = "StopDataProcessing";
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_STOP));
- mi.name.t = LPGENT("Stop data processing");
+ mi.name.w = LPGENW("Stop data processing");
Menu_AddContactMenuItem(&mi, MODULENAME);
hWindowList = WindowList_Create();
diff --git a/plugins/WebView/src/stdafx.h b/plugins/WebView/src/stdafx.h index 7b97ef0a5d..2dc3a797e8 100644 --- a/plugins/WebView/src/stdafx.h +++ b/plugins/WebView/src/stdafx.h @@ -9,7 +9,6 @@ #include <process.h>
#include <stdio.h>
#include <string.h>
-#include <tchar.h>
#include <time.h>
#include <wchar.h>
diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index 74c4c28809..78721ee7e5 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -50,9 +50,9 @@ void ChangeMenuItem1() // Enable or Disable auto updates
LPCTSTR ptszName;
if (!db_get_b(NULL, MODULENAME, DISABLE_AUTOUPDATE_KEY, 0))
- ptszName = LPGENT("Auto update enabled");
+ ptszName = LPGENW("Auto update enabled");
else
- ptszName = LPGENT("Auto update disabled");
+ ptszName = LPGENW("Auto update disabled");
Menu_ModifyItem(hMenuItem1, ptszName, LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE)));
}
@@ -63,7 +63,7 @@ void ChangeMenuItemCountdown() // countdown
HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
- TCHAR countername[100];
+ wchar_t countername[100];
mir_sntprintf(countername, TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
Menu_ModifyItem(hMenuItemCountdown, countername, hIcon, CMIF_KEEPUNTRANSLATED);
@@ -295,8 +295,8 @@ static int OptInitialise(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT);
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTitle = _T(MODULENAME);
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTitle = _T(MODULENAME);
odp.pfnDlgProc = DlgProcOpt;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &odp);
@@ -304,7 +304,7 @@ static int OptInitialise(WPARAM wParam, LPARAM) // if popup service exists
if ((ServiceExists(MS_POPUP_ADDPOPUPT))) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUP);
- odp.ptszGroup = LPGENT("Popups");
+ odp.pwszGroup = LPGENW("Popups");
odp.pfnDlgProc = DlgPopUpOpts;
Options_AddPage(wParam, &odp);
}
diff --git a/plugins/WebView/src/webview.h b/plugins/WebView/src/webview.h index 82a264fc1b..967645e4b8 100644 --- a/plugins/WebView/src/webview.h +++ b/plugins/WebView/src/webview.h @@ -23,6 +23,7 @@ #define CFM_BACKCOLOR 0x04000000
#define MODULENAME "WebView"
+#define MODULENAMEW L"WebView"
#define MENU_OFF "DisableMenu"
#define REFRESH_KEY "Refresh interval"
@@ -156,7 +157,7 @@ void SavewinSettings(void); void ValidatePosition(HWND hwndDlg);
int ModulesLoaded(WPARAM wParam, LPARAM lParam);
void ChangeMenuItem3();
-TCHAR* FixButtonText(TCHAR *url, size_t len);
+wchar_t* FixButtonText(wchar_t *url, size_t len);
int ContactMenuItemUpdateData (WPARAM wParam, LPARAM lParam);
int Doubleclick(WPARAM wParam, LPARAM lParam);
@@ -224,8 +225,8 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM void AckFunc(void *dummy);
int SiteDeleted(WPARAM wParam, LPARAM lParam);
-int WErrorPopup(MCONTACT hContact, TCHAR *textdisplay);
-int WAlertPopup(MCONTACT hContact, TCHAR *displaytext);
+int WErrorPopup(MCONTACT hContact, wchar_t *textdisplay);
+int WAlertPopup(MCONTACT hContact, wchar_t *displaytext);
//////////////////////
// wrappers
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index 6397413cda..8c909b50d0 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -88,21 +88,21 @@ int WDisplayDataAlert(MCONTACT hContact) }
/*****************************************************************************/
-int WAlertPopup(MCONTACT hContact, TCHAR *displaytext)
+int WAlertPopup(MCONTACT hContact, wchar_t *displaytext)
{
NotifyEventHooks(hHookAlertPopup, hContact, (LPARAM)displaytext);
return 0;
}
/*****************************************************************************/
-int WErrorPopup(MCONTACT hContact, TCHAR *textdisplay)
+int WErrorPopup(MCONTACT hContact, wchar_t *textdisplay)
{
NotifyEventHooks(hHookErrorPopup, hContact, (LPARAM) textdisplay);
return 0;
}
/*****************************************************************************/
-int WAlertOSD(MCONTACT hContact, TCHAR *displaytext)
+int WAlertOSD(MCONTACT hContact, wchar_t *displaytext)
{
NotifyEventHooks(hHookAlertOSD, hContact, (LPARAM) displaytext);
return 0;
@@ -124,7 +124,7 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) ppd.lchContact = wParam;
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
- TCHAR *displaytext = (TCHAR*)lParam;
+ wchar_t *displaytext = (wchar_t*)lParam;
if ((mir_tstrlen(displaytext) == MAX_SECONDLINE) || (mir_tstrlen(displaytext) > MAX_SECONDLINE))
mir_sntprintf(ppd.lptzText, displaytext);
else if (mir_tstrlen(displaytext) < MAX_SECONDLINE)
@@ -181,12 +181,12 @@ int OSDAlert(WPARAM hContact, LPARAM lParam) int ErrorMsgs(WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = wParam;
- TCHAR newdisplaytext[2000], *displaytext = (TCHAR*)lParam;
+ wchar_t newdisplaytext[2000], *displaytext = (wchar_t*)lParam;
if (db_get_b(NULL, MODULENAME, SUPPRESS_ERR_KEY, 0))
return 0;
- TCHAR *ptszContactName = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *ptszContactName = pcli->pfnGetContactDisplayName(hContact, 0);
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, MODULENAME, ERROR_POPUP_KEY, 0)) {
mir_sntprintf(newdisplaytext, L"%s\n%s", ptszContactName, displaytext);
PUShowMessageT(newdisplaytext, SM_WARNING);
@@ -255,7 +255,7 @@ void SaveToFile(MCONTACT hContact, char *truncated) int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactname, int notpresent)
{
char alertstring[255];
- TCHAR displaystring[300];
+ wchar_t displaystring[300];
FILE *pcachefile;
DBVARIANT tdbv;
int wasAlert = 0;
@@ -420,9 +420,9 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn }
else if (eventIndex == 1) { // webpage changed
// TEST GET NAME FOR CACHE
- TCHAR cachepath[MAX_PATH], cachedirectorypath[MAX_PATH], newcachepath[MAX_PATH + 50];
+ wchar_t cachepath[MAX_PATH], cachedirectorypath[MAX_PATH], newcachepath[MAX_PATH + 50];
GetModuleFileName(hInst, cachepath, _countof(cachepath));
- TCHAR *cacheend = _tcsrchr(cachepath, '\\');
+ wchar_t *cacheend = wcsrchr(cachepath, '\\');
cacheend++;
*cacheend = '\0';
@@ -430,8 +430,8 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn CreateDirectory(cachedirectorypath, NULL);
mir_sntprintf(newcachepath, L"%s%S%S%S%S", cachepath, MODULENAME, "cache\\", contactname, ".txt");
// file exists?
- if ( _taccess(newcachepath, 0) != -1) {
- if ((pcachefile = _tfopen(newcachepath, L"r")) == NULL)
+ if ( _waccess(newcachepath, 0) != -1) {
+ if ((pcachefile = _wfopen(newcachepath, L"r")) == NULL)
WErrorPopup((UINT_PTR)contactname, TranslateT("Cannot read from file"));
else {
memset(&cachecompare, 0, sizeof(cachecompare));
@@ -440,7 +440,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn }
}
// write to cache
- if ((pcachefile = _tfopen(newcachepath, L"w")) == NULL)
+ if ((pcachefile = _wfopen(newcachepath, L"w")) == NULL)
WErrorPopup((UINT_PTR)contactname, TranslateT("Cannot write to file 1"));
else {
fwrite(tempraw, mir_strlen(tempraw), 1, pcachefile); //smaller cache
@@ -632,9 +632,9 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn ///////////////
if (((strstr(tempraw, Alerttempstring)) != 0) && ((strstr(tempraw, Alerttempstring2)) != 0)) {
// TEST GET NAME FOR CACHE
- TCHAR cachepath[MAX_PATH], cachedirectorypath[MAX_PATH], newcachepath[MAX_PATH + 50];
+ wchar_t cachepath[MAX_PATH], cachedirectorypath[MAX_PATH], newcachepath[MAX_PATH + 50];
GetModuleFileName(hInst, cachepath, _countof(cachepath));
- TCHAR *cacheend = _tcsrchr(cachepath, '\\');
+ wchar_t *cacheend = wcsrchr(cachepath, '\\');
cacheend++;
*cacheend = '\0';
@@ -642,8 +642,8 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn CreateDirectory(cachedirectorypath, NULL);
mir_sntprintf(newcachepath, L"%s%S%S%S%S", cachepath, MODULENAME, "cache\\", contactname, ".txt");
// file exists?
- if ( _taccess(newcachepath, 0) != -1) {
- if ((pcachefile = _tfopen(newcachepath, L"r")) == NULL)
+ if ( _waccess(newcachepath, 0) != -1) {
+ if ((pcachefile = _wfopen(newcachepath, L"r")) == NULL)
WErrorPopup((UINT_PTR)contactname, TranslateT("Cannot read from file"));
else {
memset(&cachecompare, 0, sizeof(cachecompare));
@@ -652,7 +652,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn }
}
// write to cache
- if ((pcachefile = _tfopen(newcachepath, L"w")) == NULL)
+ if ((pcachefile = _wfopen(newcachepath, L"w")) == NULL)
WErrorPopup((UINT_PTR)contactname, TranslateT("Cannot write to file 2"));
else {
fwrite(raw, mir_strlen(raw), 1, pcachefile); //smaller cache
diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index da1314d9a1..57d59b4bba 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -117,12 +117,12 @@ INT_PTR CALLBACK DlgProcFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara /*****************************************************************************/
-static TCHAR tszSizeString[] = L"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
+static wchar_t tszSizeString[] = L"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
static MCONTACT FindContactByUrl(HWND hwndDlg)
{
MCONTACT res = NULL;
- TCHAR urltext[300], titlebartxt[300];
+ wchar_t urltext[300], titlebartxt[300];
int contactcount = 0;
GetDlgItemText(hwndDlg, IDC_OPEN_URL, urltext, _countof(urltext));
@@ -148,7 +148,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA {
DBVARIANT dbv;
RECT rc;
- TCHAR url[300];
+ wchar_t url[300];
MCONTACT hContact;
switch (msg) {
@@ -162,7 +162,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA url[0] = '\0';
if (!db_get_ts(hContact2, MODULENAME, URL_KEY, &dbv)) {
- _tcsncpy_s(url, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(url, dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
SetDlgItemText(hwndDlg, IDC_OPEN_URL, FixButtonText(url, _countof(url)));
@@ -358,7 +358,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (hContact = FindContactByUrl(hwndDlg))
OnTopMenuCommand(wParam, lParam, hContact);
{
- TCHAR *ptszToolTip;
+ wchar_t *ptszToolTip;
HWND hTopmost;
if (!db_get_b(hContact, MODULENAME, ON_TOP_KEY, 0)) {
hTopmost = HWND_NOTOPMOST;
diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp index a97f3c31e2..55299017a5 100644 --- a/plugins/WebView/src/webview_getdata.cpp +++ b/plugins/WebView/src/webview_getdata.cpp @@ -139,7 +139,7 @@ void GetData(void *param) if (nlhrReply->resultCode < 200 || nlhrReply->resultCode >= 300) {
db_set_w(hContact, MODULENAME, "Status", ID_STATUS_AWAY);
- TCHAR *statusText = TranslateT("The server replied with a failure code");
+ wchar_t *statusText = TranslateT("The server replied with a failure code");
SetDlgItemText(hwndDlg, IDC_STATUSBAR, statusText);
WErrorPopup(hContact, statusText);
db_set_ts(hContact, "CList", "StatusMsg", statusText);
@@ -155,7 +155,7 @@ void GetData(void *param) if (!nlhrReply) {
db_set_w(hContact, MODULENAME, "Status", ID_STATUS_NA);
- TCHAR *statusText = TranslateT("The server is down or lagging.");
+ wchar_t *statusText = TranslateT("The server is down or lagging.");
SetDlgItemText(hwndDlg, IDC_STATUSBAR, statusText);
WErrorPopup(hContact, statusText);
db_set_ts(hContact, "CList", "StatusMsg", statusText);
@@ -232,7 +232,7 @@ void GetData(void *param) DownloadSuccess = 1;
}
else if (db_get_b(hContact, MODULENAME, U_ALLSITE_KEY, 0) == 0) {
- TCHAR *szStatusText = TranslateT("Invalid search parameters.");
+ wchar_t *szStatusText = TranslateT("Invalid search parameters.");
WErrorPopup(hContact, szStatusText);
DownloadSuccess = 0;
@@ -246,7 +246,7 @@ void GetData(void *param) if (DownloadSuccess) { // download success
if (statpos == 0 && statposend == 0) {
if (db_get_b(hContact, MODULENAME, U_ALLSITE_KEY, 0) == 0) {
- TCHAR *statusText = TranslateT("Both search strings not found or strings not set.");
+ wchar_t *statusText = TranslateT("Both search strings not found or strings not set.");
WErrorPopup(hContact, statusText);
db_set_ts(hContact, "CList", "StatusMsg", statusText);
@@ -355,7 +355,7 @@ void GetData(void *param) SetDlgItemText(hwndDlg, IDC_STATUSBAR, TranslateT("Processing data (Stage 1)"));
if (db_get_b(hContact, MODULENAME, STOP_KEY, 1) == 1) {
-LBL_Stop: TCHAR *statusText = TranslateT("Processing data stopped by user.");
+LBL_Stop: wchar_t *statusText = TranslateT("Processing data stopped by user.");
SetDlgItemText(hwndDlg, IDC_STATUSBAR, statusText);
db_set_b(hContact, MODULENAME, STOP_KEY, 0);
db_set_w(hContact, MODULENAME, "Status", ID_STATUS_ONLINE);
diff --git a/plugins/WebView/src/webview_opts.cpp b/plugins/WebView/src/webview_opts.cpp index dc894668fd..206334e5e1 100644 --- a/plugins/WebView/src/webview_opts.cpp +++ b/plugins/WebView/src/webview_opts.cpp @@ -23,38 +23,38 @@ #include "stdafx.h"
#include "webview.h"
-const TCHAR *szTrackerBarDescr[] = {
- LPGENT("No whitespace removal"),
- LPGENT("Minimal level of whitespace removal"),
- LPGENT("Medium level of whitespace removal"),
- LPGENT("Large level of whitespace removal"),
- LPGENT("Remove all whitespace")
+const wchar_t *szTrackerBarDescr[] = {
+ LPGENW("No whitespace removal"),
+ LPGENW("Minimal level of whitespace removal"),
+ LPGENW("Medium level of whitespace removal"),
+ LPGENW("Large level of whitespace removal"),
+ LPGENW("Remove all whitespace")
};
static char *fontSizes[] = { "8", "10", "14", "16", "18", "20", "24", "28" };
-static TCHAR *AlertTypes[] = { LPGENT("Popup plugin"), LPGENT("Log to file"), LPGENT("Open data display window"), LPGENT("Use OSD plugin") };
-static TCHAR *EventTypes[] = { LPGENT("A string is present"), LPGENT("The web page changes"), LPGENT("A specific part of web page changes") };
+static wchar_t *AlertTypes[] = { LPGENW("Popup plugin"), LPGENW("Log to file"), LPGENW("Open data display window"), LPGENW("Use OSD plugin") };
+static wchar_t *EventTypes[] = { LPGENW("A string is present"), LPGENW("The web page changes"), LPGENW("A specific part of web page changes") };
#define M_FILLSCRIPTCOMBO (WM_USER+16)
-TCHAR* FixButtonText(TCHAR *url, size_t len)
+wchar_t* FixButtonText(wchar_t *url, size_t len)
{
- TCHAR buttontext[256], stringbefore[256], newbuttontext[256];
- _tcsncpy_s(buttontext, url, _TRUNCATE);
- _tcsncpy_s(newbuttontext, url, _TRUNCATE);
+ wchar_t buttontext[256], stringbefore[256], newbuttontext[256];
+ wcsncpy_s(buttontext, url, _TRUNCATE);
+ wcsncpy_s(newbuttontext, url, _TRUNCATE);
- if (_tcschr(newbuttontext, '&') != 0) {
+ if (wcschr(newbuttontext, '&') != 0) {
while (true) {
- if (_tcschr(newbuttontext, '&') == 0)
+ if (wcschr(newbuttontext, '&') == 0)
break;
- _tcsncpy_s(buttontext, newbuttontext, _TRUNCATE);
- TCHAR *stringafter = _tcschr(buttontext, '&');
+ wcsncpy_s(buttontext, newbuttontext, _TRUNCATE);
+ wchar_t *stringafter = wcschr(buttontext, '&');
int pos = (stringafter - buttontext);
int posbefore = (stringafter - buttontext) - 1;
int posafter = (stringafter - buttontext) + 1;
strdelt(stringafter, 1);
- _tcsncpy_s(stringbefore, pos, buttontext, _TRUNCATE);
+ wcsncpy_s(stringbefore, pos, buttontext, _TRUNCATE);
mir_sntprintf(newbuttontext, L"%s!!%s", stringbefore, stringafter);
posafter = 0;
@@ -62,17 +62,17 @@ TCHAR* FixButtonText(TCHAR *url, size_t len) }
while (true) {
- if (_tcschr(newbuttontext, '!') != 0) {
- TCHAR *stringafter = _tcschr(newbuttontext, '!');
+ if (wcschr(newbuttontext, '!') != 0) {
+ wchar_t *stringafter = wcschr(newbuttontext, '!');
int pos = (stringafter - newbuttontext);
newbuttontext[pos] = '&';
}
- if (_tcschr(newbuttontext, '!') == 0)
+ if (wcschr(newbuttontext, '!') == 0)
break;
}
}
- _tcsncpy_s(url, len, newbuttontext, _TRUNCATE);
+ wcsncpy_s(url, len, newbuttontext, _TRUNCATE);
return url;
}
@@ -188,7 +188,7 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) case IDC_PREVIEW:
{
- TCHAR str3[512];
+ wchar_t str3[512];
POPUPDATAT ppd = { 0 };
GetDlgItemText(hdlg, IDC_DELAY, str3, _countof(str3));
@@ -212,7 +212,7 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) ppd.colorBack = BGColour;
ppd.colorText = TextColour;
ppd.PluginWindowProc = NULL;
- ppd.iSeconds = _ttol(str3);
+ ppd.iSeconds = _wtol(str3);
// display popups
PUAddPopupT(&ppd);
}
@@ -224,10 +224,10 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) case PSN_APPLY:
{
int popupdelayval = 0;
- TCHAR str2[512];
+ wchar_t str2[512];
GetDlgItemText(hdlg, IDC_DELAY, str2, _countof(str2));
- popupdelayval = _ttol(str2);
+ popupdelayval = _wtol(str2);
db_set_dw(NULL, MODULENAME, POP_DELAY_KEY, popupdelayval);
db_set_b(NULL, MODULENAME, LCLK_WINDOW_KEY, (BYTE)IsDlgButtonChecked(hdlg, IDC_LCLK_WINDOW));
@@ -439,7 +439,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l switch (LOWORD(wParam)) {
case IDC_BROWSE:
{
- TCHAR szFileName[MAX_PATH];
+ wchar_t szFileName[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILENAME, szFileName, _countof(szFileName));
OPENFILENAME ofn = { 0 };
@@ -698,7 +698,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_OK2:
{
hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
eventIndex = db_get_b(hContact, MODULENAME, EVNT_INDEX_KEY, 0);
alertIndex = db_get_b(hContact, MODULENAME, ALRT_INDEX_KEY, 0);
@@ -799,7 +799,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv;
- TCHAR url[300];
+ wchar_t url[300];
HWND ParentHwnd = GetParent(hwndDlg);
static int test;
static int test2;
@@ -914,7 +914,7 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_CPY_STRINGS:
{
- TCHAR string[128];
+ wchar_t string[128];
hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
GetDlgItemText(hwndDlg, IDC_START, string, _countof(string));
@@ -950,7 +950,7 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_OPT_APPLY:
case IDOK:
{
- TCHAR str[128], contactname[128];
+ wchar_t str[128], contactname[128];
if (!GetWindowTextLength(GetDlgItem(hwndDlg, IDC_URL))) {
MessageBox(NULL, TranslateT("You need to supply a URL."), _T(MODULENAME), MB_OK);
break;
@@ -973,39 +973,39 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
GetDlgItemText(hwndDlg, IDC_SITE_NAME, contactname, _countof(contactname));
- if (_tcschr(contactname, '\\') != NULL) {
+ if (wcschr(contactname, '\\') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
- if (_tcschr(contactname, '/') != NULL) {
+ if (wcschr(contactname, '/') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
- if (_tcschr(contactname, ':') != NULL) {
+ if (wcschr(contactname, ':') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
- if (_tcschr(contactname, '*') != NULL) {
+ if (wcschr(contactname, '*') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
- if (_tcschr(contactname, '?') != NULL) {
+ if (wcschr(contactname, '?') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
- if (_tcschr(contactname, '\"') != NULL) {
+ if (wcschr(contactname, '\"') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
- if (_tcschr(contactname, '<') != NULL) {
+ if (wcschr(contactname, '<') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
- if (_tcschr(contactname, '>') != NULL) {
+ if (wcschr(contactname, '>') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
- if (_tcschr(contactname, '|') != NULL) {
+ if (wcschr(contactname, '|') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
@@ -1267,7 +1267,7 @@ INT_PTR CALLBACK DlgProcOpt(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara db_set_b(NULL, MODULENAME, NO_PROTECT_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NO_PROTECT));
db_set_b(NULL, MODULENAME, DATA_POPUP_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DATAPOPUP));
- TCHAR str[100];
+ wchar_t str[100];
GetDlgItemText(hwndDlg, IDC_TYPEFACE, str, _countof(str));
db_set_ts(NULL, MODULENAME, FONT_FACE_KEY, str);
diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp index 537c83fe86..718c57fdbf 100644 --- a/plugins/WebView/src/webview_services.cpp +++ b/plugins/WebView/src/webview_services.cpp @@ -24,7 +24,7 @@ #include "webview.h" static int searchId = -1; -static TCHAR sID[32]; +static wchar_t sID[32]; /*****************************************************************************/ static char szInvalidChars[] = { '\\', '/', ':', '*', '?', '\"', '<', '>', '|' }; @@ -50,15 +50,15 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) if (oldName == NULL) return 0; - TCHAR nick[100]; + wchar_t nick[100]; ptrT oldnick( db_get_tsa(hContact, "CList", "MyHandle")); if (oldnick != NULL) - _tcsncpy_s(nick, oldnick, _TRUNCATE); + wcsncpy_s(nick, oldnick, _TRUNCATE); else nick[0] = 0; for (int i=0; i < _countof(szInvalidChars); i++ ) { - TCHAR *p = _tcschr(nick, szInvalidChars[i]); + wchar_t *p = wcschr(nick, szInvalidChars[i]); if (p != NULL) { WErrorPopup((UINT_PTR)"ERROR", TranslateT("Invalid symbol present in contact name.")); *p = '_'; @@ -68,33 +68,33 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) if (invalidpresent) { srand((unsigned)time(NULL)); - TCHAR ranStr[7]; - _itot((int)10000 *rand() / (RAND_MAX + 1.0), ranStr, 10); + wchar_t ranStr[7]; + _itow((int)10000 *rand() / (RAND_MAX + 1.0), ranStr, 10); mir_tstrcat(nick, ranStr); } - if ( _tcschr(nick, '(') == 0) { + if ( wcschr(nick, '(') == 0) { db_set_ts(hContact, MODULENAME, PRESERVE_NAME_KEY, nick); db_set_ts(hContact, MODULENAME, "Nick", nick); db_set_ts(hContact, "CList", "MyHandle", nick); } // TEST GET NAME FOR CACHE - TCHAR cachepath[MAX_PATH], cachedirectorypath[MAX_PATH]; + wchar_t cachepath[MAX_PATH], cachedirectorypath[MAX_PATH]; GetModuleFileName(hInst, cachepath, _countof(cachepath)); - TCHAR *cacheend = _tcsrchr(cachepath, '\\'); + wchar_t *cacheend = wcsrchr(cachepath, '\\'); cacheend++; *cacheend = '\0'; - mir_sntprintf(cachedirectorypath, L"%s" MODULENAME L"cache\\", cachepath); + mir_sntprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\", cachepath); CreateDirectory(cachedirectorypath, NULL); - TCHAR newcachepath[MAX_PATH + 50], renamedcachepath[MAX_PATH + 50]; - mir_sntprintf(newcachepath, L"%s" MODULENAME L"cache\\%s.txt", cachepath, oldName); - mir_sntprintf(renamedcachepath, L"%s" MODULENAME L"cache\\%s.txt", cachepath, nick); + wchar_t newcachepath[MAX_PATH + 50], renamedcachepath[MAX_PATH + 50]; + mir_sntprintf(newcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, oldName); + mir_sntprintf(renamedcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, nick); // file exists? - if ( _taccess(newcachepath, 0) != -1) { - FILE *pcachefile = _tfopen(newcachepath, L"r"); + if ( _waccess(newcachepath, 0) != -1) { + FILE *pcachefile = _wfopen(newcachepath, L"r"); if (pcachefile != NULL) { fclose(pcachefile); if (mir_tstrcmp(newcachepath, renamedcachepath)) { @@ -118,18 +118,18 @@ int SiteDeleted(WPARAM wParam, LPARAM) ptrT contactName( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); // TEST GET NAME FOR CACHE - TCHAR cachepath[MAX_PATH], cachedirectorypath[MAX_PATH], newcachepath[MAX_PATH + 50]; + wchar_t cachepath[MAX_PATH], cachedirectorypath[MAX_PATH], newcachepath[MAX_PATH + 50]; GetModuleFileName(hInst, cachepath, _countof(cachepath)); - TCHAR *cacheend = _tcsrchr(cachepath, '\\'); + wchar_t *cacheend = wcsrchr(cachepath, '\\'); cacheend++; *cacheend = '\0'; - mir_sntprintf(cachedirectorypath, L"%s" MODULENAME L"cache\\", cachepath); + mir_sntprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\", cachepath); CreateDirectory(cachedirectorypath, NULL); - mir_sntprintf(newcachepath, L"%s" MODULENAME L"cache\\%s.txt", cachepath, contactName); + mir_sntprintf(newcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, contactName); // file exists? - if ( _taccess(newcachepath, 0) != -1) { - FILE *pcachefile = _tfopen(newcachepath, L"r"); + if ( _waccess(newcachepath, 0) != -1) { + FILE *pcachefile = _wfopen(newcachepath, L"r"); if (pcachefile != NULL) { fclose(pcachefile); DeleteFile(newcachepath); @@ -143,15 +143,15 @@ int SiteDeleted(WPARAM wParam, LPARAM) INT_PTR OpenCacheDir(WPARAM, LPARAM) { //GET NAME FOR CACHE - TCHAR cachepath[MAX_PATH], cachedirectorypath[MAX_PATH]; + wchar_t cachepath[MAX_PATH], cachedirectorypath[MAX_PATH]; GetModuleFileName(hInst, cachepath, _countof(cachepath)); - TCHAR *cacheend = _tcsrchr(cachepath, '\\'); + wchar_t *cacheend = wcsrchr(cachepath, '\\'); cacheend++; *cacheend = '\0'; - mir_sntprintf(cachedirectorypath, L"%s" MODULENAME L"cache\\%s", cachepath, cacheend); + mir_sntprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\%s", cachepath, cacheend); - if( _taccess(cachedirectorypath, 0) != 0) + if( _waccess(cachedirectorypath, 0) != 0) WErrorPopup((UINT_PTR)"ERROR", TranslateT("Cache folder does not exist.")); else ShellExecute(NULL, L"open", cachedirectorypath, NULL, NULL, SW_SHOWNORMAL); @@ -171,14 +171,14 @@ INT_PTR PingWebsiteMenuCommand(WPARAM wParam, LPARAM) if (url == NULL) return 0; - TCHAR Cnick[200], *Oldnick; - _tcsncpy(Cnick, url, _countof(Cnick)); - if ((Oldnick = _tcsstr(Cnick, L"://")) != 0) + wchar_t Cnick[200], *Oldnick; + wcsncpy(Cnick, url, _countof(Cnick)); + if ((Oldnick = wcsstr(Cnick, L"://")) != 0) Oldnick += 3; else Oldnick = Cnick; - TCHAR *Nend = _tcschr(Oldnick, '/'); + wchar_t *Nend = wcschr(Oldnick, '/'); if (Nend) *Nend = '\0'; ShellExecute(NULL, L"open", L"psite.bat", Oldnick, NULL, SW_HIDE); @@ -304,7 +304,7 @@ INT_PTR BPLoadIcon(WPARAM wParam, LPARAM) static void __cdecl BasicSearchTimerProc(void *pszNick) { PROTOSEARCHRESULT psr = { sizeof(psr) }; - psr.nick.t = (TCHAR*) pszNick; + psr.nick.w = (wchar_t*) pszNick; // broadcast the search result ProtoBroadcastAck(MODULENAME, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr); @@ -316,15 +316,15 @@ static void __cdecl BasicSearchTimerProc(void *pszNick) INT_PTR BasicSearch(WPARAM, LPARAM lParam) { - static TCHAR buf[300]; + static wchar_t buf[300]; if (lParam) - mir_tstrncpy(buf, (const TCHAR*) lParam, 256); + mir_tstrncpy(buf, (const wchar_t*) lParam, 256); if (searchId != -1) return 0; // only one search at a time - mir_tstrncpy(sID, (TCHAR*)lParam, _countof(sID)); + mir_tstrncpy(sID, (wchar_t*)lParam, _countof(sID)); searchId = 1; // create a thread for the ID search @@ -343,7 +343,7 @@ INT_PTR AddToList(WPARAM, LPARAM lParam) if (psr == NULL) return 0; - if (psr->nick.t == NULL) { + if (psr->nick.w == NULL) { WErrorPopup((UINT_PTR)"ERROR", TranslateT("Please select site in Find/Add contacts...")); return 0; } @@ -355,7 +355,7 @@ INT_PTR AddToList(WPARAM, LPARAM lParam) // check ID to see if the contact already exist in the database if (db_get_ts(hContact, MODULENAME, "URL", &dbv)) continue; - if (!mir_tstrcmpi(psr->nick.t, dbv.ptszVal)) { + if (!mir_tstrcmpi(psr->nick.w, dbv.ptszVal)) { // remove the flag for not on list and hidden, thus make the // contact visible // and add them on the list @@ -378,30 +378,30 @@ INT_PTR AddToList(WPARAM, LPARAM lParam) db_set_b(hContact, MODULENAME, RWSPACE_KEY, 1); //Convert url into a name for contact - TCHAR Cnick[255]; - if (psr->nick.t != NULL) - _tcsncpy(Cnick, psr->nick.t, _countof(Cnick)); + wchar_t Cnick[255]; + if (psr->nick.w != NULL) + wcsncpy(Cnick, psr->nick.w, _countof(Cnick)); else Cnick[0] = 0; - TCHAR *Oldnick = _tcsstr(Cnick, L"://"); + wchar_t *Oldnick = wcsstr(Cnick, L"://"); if (Oldnick != 0) Oldnick += 3; else Oldnick = Cnick; - TCHAR *Newnick = _tcsstr(Oldnick, L"www."); + wchar_t *Newnick = wcsstr(Oldnick, L"www."); if (Newnick != 0) Newnick += 4; else { - Newnick = _tcsstr(Oldnick, L"WWW."); + Newnick = wcsstr(Oldnick, L"WWW."); if (Newnick != 0) Newnick += 4; else Newnick = Oldnick; } - TCHAR *Nend = _tcschr(Newnick, '.'); + wchar_t *Nend = wcschr(Newnick, '.'); if (Nend) *Nend = '\0'; for (MCONTACT hContact2 = db_find_first(MODULENAME); hContact2 != NULL; hContact2 = db_find_next(hContact2, MODULENAME)) { @@ -425,8 +425,8 @@ INT_PTR AddToList(WPARAM, LPARAM lParam) { srand((unsigned) time(NULL)); - TCHAR ranStr[10]; - _itot((int) 10000 *rand() / (RAND_MAX + 1.0), ranStr, 10); + wchar_t ranStr[10]; + _itow((int) 10000 *rand() / (RAND_MAX + 1.0), ranStr, 10); mir_tstrcat(Newnick, ranStr); } //end convert @@ -436,8 +436,8 @@ INT_PTR AddToList(WPARAM, LPARAM lParam) db_set_ts(hContact, MODULENAME, "Nick", Newnick); db_set_b(hContact, MODULENAME, CLEAR_DISPLAY_KEY, 1); db_set_s(hContact, MODULENAME, START_STRING_KEY, ""); - db_set_ts(hContact, MODULENAME, URL_KEY, psr->nick.t); - db_set_ts(hContact, MODULENAME, "Homepage", psr->nick.t); + db_set_ts(hContact, MODULENAME, URL_KEY, psr->nick.w); + db_set_ts(hContact, MODULENAME, "Homepage", psr->nick.w); db_set_b(hContact, MODULENAME, U_ALLSITE_KEY, 1); db_set_w(hContact, MODULENAME, "Status", ID_STATUS_ONLINE); diff --git a/plugins/WhenWasIt/src/WhenWasIt.cpp b/plugins/WhenWasIt/src/WhenWasIt.cpp index 52a0b587b7..cb5da2f666 100644 --- a/plugins/WhenWasIt/src/WhenWasIt.cpp +++ b/plugins/WhenWasIt/src/WhenWasIt.cpp @@ -74,7 +74,7 @@ extern "C" int __declspec(dllexport) Load(void) CMenuItem mi;
mi.position = 10000000;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Birthdays (When Was It)"), mi.position);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Birthdays (When Was It)"), mi.position);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "95D842AE-FCCE-43C9-87E3-C28546B7E00E");
SET_UID(mi, 0x4efbd640, 0xabbd, 0x470e, 0x9a, 0xa, 0x64, 0x76, 0x1a, 0x74, 0xf3, 0x24);
@@ -131,8 +131,8 @@ extern "C" int __declspec(dllexport) Load(void) hotkey.pszService = MS_WWI_CHECK_BIRTHDAYS;
Hotkey_Register(&hotkey);
- SkinAddNewSoundExT(BIRTHDAY_NEAR_SOUND, LPGENT("WhenWasIt"), LPGENT("Birthday near"));
- SkinAddNewSoundExT(BIRTHDAY_TODAY_SOUND, LPGENT("WhenWasIt"), LPGENT("Birthday today"));
+ SkinAddNewSoundExT(BIRTHDAY_NEAR_SOUND, LPGENW("WhenWasIt"), LPGENW("Birthday near"));
+ SkinAddNewSoundExT(BIRTHDAY_TODAY_SOUND, LPGENW("WhenWasIt"), LPGENW("Birthday today"));
Log("%s", "Leaving function " __FUNCTION__);
return 0;
diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index d3658eb3a8..3b269468c9 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -29,23 +29,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define UPCOMING_TIMER_ID 1002
-const TCHAR *szShowAgeMode[] = { LPGENT("Upcoming age"), LPGENT("Current age") };
+const wchar_t *szShowAgeMode[] = { LPGENW("Upcoming age"), LPGENW("Current age") };
const int cShowAgeMode = sizeof(szShowAgeMode) / sizeof(szShowAgeMode[0]);
-const TCHAR *szSaveModule[] = { LPGENT("UserInfo module"), LPGENT("Protocol module"), LPGENT("mBirthday module") };
+const wchar_t *szSaveModule[] = { LPGENW("UserInfo module"), LPGENW("Protocol module"), LPGENW("mBirthday module") };
const int cSaveModule = sizeof(szSaveModule) / sizeof(szSaveModule[0]);
-const TCHAR *szPopupClick[] = { LPGENT("Nothing"), LPGENT("Dismiss"), LPGENT("Message window") };
+const wchar_t *szPopupClick[] = { LPGENW("Nothing"), LPGENW("Dismiss"), LPGENW("Message window") };
const int cPopupClick = sizeof(szPopupClick) / sizeof(szPopupClick[0]);
-const TCHAR *szNotifyFor[] = { LPGENT("All contacts"), LPGENT("All contacts except hidden ones"), LPGENT("All contacts except ignored ones"), LPGENT("All contacts except hidden and ignored ones") };
+const wchar_t *szNotifyFor[] = { LPGENW("All contacts"), LPGENW("All contacts except hidden ones"), LPGENW("All contacts except ignored ones"), LPGENW("All contacts except hidden and ignored ones") };
const int cNotifyFor = sizeof(szNotifyFor) / sizeof(szNotifyFor[0]);
#define MIN_BIRTHDAYS_WIDTH 200
#define MIN_BIRTHDAYS_HEIGHT 200
#include "commctrl.h"
-void CreateToolTip(HWND target, TCHAR* tooltip, LPARAM width)
+void CreateToolTip(HWND target, wchar_t* tooltip, LPARAM width)
{
HWND hwndToolTip = CreateWindow(TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, target, NULL, NULL, NULL);
@@ -121,7 +121,7 @@ SIZE GetControlTextSize(HWND hCtrl) HFONT font = (HFONT)SendMessage(hCtrl, WM_GETFONT, 0, 0);
HFONT oldFont = (HFONT)SelectObject(hDC, font);
const size_t maxSize = 2048;
- TCHAR buffer[maxSize];
+ wchar_t buffer[maxSize];
SIZE size;
GetWindowText(hCtrl, buffer, _countof(buffer));
GetTextExtentPoint32(hDC, buffer, (int)mir_tstrlen(buffer), &size);
@@ -141,17 +141,17 @@ int EnlargeControl(HWND hCtrl, HWND, SIZE oldSize) return 0;
}
-TCHAR *strtrim(TCHAR *str)
+wchar_t *strtrim(wchar_t *str)
{
size_t i = 0;
size_t len = mir_tstrlen(str);
- while ((i < len) && (str[i] == _T(' '))) { i++; }
+ while ((i < len) && (str[i] == ' ')) { i++; }
if (i) {
memmove(str, str + i, len - i + 1);
len -= i;
}
- while ((len > 0) && (str[--len] == _T(' ')))
+ while ((len > 0) && (str[--len] == ' '))
str[len] = 0;
return str;
@@ -190,18 +190,18 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara CreateToolTip(GetDlgItem(hWnd, IDC_POPUP_TIMEOUT), TranslateT("Set popup delay when notifying of upcoming birthdays.\nFormat: default delay [ | delay for birthdays occurring today]"), 400);
- TCHAR buffer[1024];
- _itot(commonData.daysInAdvance, buffer, 10);
+ wchar_t buffer[1024];
+ _itow(commonData.daysInAdvance, buffer, 10);
SetDlgItemText(hWnd, IDC_DAYS_IN_ADVANCE, buffer);
- _itot(commonData.checkInterval, buffer, 10);
+ _itow(commonData.checkInterval, buffer, 10);
SetDlgItemText(hWnd, IDC_CHECK_INTERVAL, buffer);
mir_sntprintf(buffer, L"%d|%d", commonData.popupTimeout, commonData.popupTimeoutToday);
SetDlgItemText(hWnd, IDC_POPUP_TIMEOUT, buffer);
- _itot(commonData.cSoundNearDays, buffer, 10);
+ _itow(commonData.cSoundNearDays, buffer, 10);
SetDlgItemText(hWnd, IDC_SOUND_NEAR_DAYS_EDIT, buffer);
- _itot(commonData.cDlgTimeout, buffer, 10);
+ _itow(commonData.cDlgTimeout, buffer, 10);
SetDlgItemText(hWnd, IDC_DLG_TIMEOUT, buffer);
- _itot(commonData.daysAfter, buffer, 10);
+ _itow(commonData.daysAfter, buffer, 10);
SetDlgItemText(hWnd, IDC_DAYS_AFTER, buffer);
CheckDlgButton(hWnd, IDC_OPENINBACKGROUND, (commonData.bOpenInBackground) ? BST_CHECKED : BST_UNCHECKED);
@@ -304,47 +304,47 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara commonData.bOpenInBackground = IsDlgButtonChecked(hWnd, IDC_OPENINBACKGROUND);
{
const int maxSize = 1024;
- TCHAR buffer[maxSize];
+ wchar_t buffer[maxSize];
GetDlgItemText(hWnd, IDC_DAYS_IN_ADVANCE, buffer, _countof(buffer));
- TCHAR *stop = NULL;
- commonData.daysInAdvance = _tcstol(buffer, &stop, 10);
+ wchar_t *stop = NULL;
+ commonData.daysInAdvance = wcstol(buffer, &stop, 10);
if (*stop) { commonData.daysInAdvance = DAYS_TO_NOTIFY; }
GetDlgItemText(hWnd, IDC_DAYS_AFTER, buffer, _countof(buffer));
- commonData.daysAfter = _tcstol(buffer, &stop, 10);
+ commonData.daysAfter = wcstol(buffer, &stop, 10);
if (*stop) { commonData.daysAfter = DAYS_TO_NOTIFY_AFTER; }
GetDlgItemText(hWnd, IDC_CHECK_INTERVAL, buffer, _countof(buffer));
- commonData.checkInterval = _ttol(buffer);
+ commonData.checkInterval = _wtol(buffer);
if (!commonData.checkInterval) { commonData.checkInterval = CHECK_INTERVAL; }
GetDlgItemText(hWnd, IDC_POPUP_TIMEOUT, buffer, _countof(buffer));
- TCHAR *pos;
- pos = _tcschr(buffer, _T('|'));
+ wchar_t *pos;
+ pos = wcschr(buffer, '|');
if (pos) {
- TCHAR tmp[128];
+ wchar_t tmp[128];
*pos = 0;
mir_tstrcpy(tmp, buffer);
strtrim(tmp);
- commonData.popupTimeout = _ttol(tmp);
+ commonData.popupTimeout = _wtol(tmp);
mir_tstrcpy(tmp, pos + 1);
strtrim(tmp);
- commonData.popupTimeoutToday = _ttol(tmp);
+ commonData.popupTimeoutToday = _wtol(tmp);
}
- else commonData.popupTimeout = commonData.popupTimeoutToday = _ttol(buffer);
+ else commonData.popupTimeout = commonData.popupTimeoutToday = _wtol(buffer);
GetDlgItemText(hWnd, IDC_SOUND_NEAR_DAYS_EDIT, buffer, _countof(buffer));
- //cSoundNearDays = _ttol(buffer);
- commonData.cSoundNearDays = _tcstol(buffer, &stop, 10);
+ //cSoundNearDays = _wtol(buffer);
+ commonData.cSoundNearDays = wcstol(buffer, &stop, 10);
if (*stop) { commonData.cSoundNearDays = BIRTHDAY_NEAR_DEFAULT_DAYS; }
GetDlgItemText(hWnd, IDC_DLG_TIMEOUT, buffer, _countof(buffer));
- commonData.cDlgTimeout = _tcstol(buffer, &stop, 10);
+ commonData.cDlgTimeout = wcstol(buffer, &stop, 10);
if (*stop) { commonData.cDlgTimeout = POPUP_TIMEOUT; }
db_set_b(NULL, ModuleName, "IgnoreSubcontacts", commonData.bIgnoreSubcontacts);
@@ -412,11 +412,11 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l case WM_SHOWWINDOW:
{
- TCHAR *szTooltipText = TranslateT("Please select the module where you want the date of birth to be saved.\r\n\"UserInfo\" is the default location.\r\nUse \"Protocol module\" to make the data visible in User Details.\n\"mBirthday module\" uses the same module as mBirthday plugin.");
- TCHAR *szCurrentModuleTooltip = NULL;
+ wchar_t *szTooltipText = TranslateT("Please select the module where you want the date of birth to be saved.\r\n\"UserInfo\" is the default location.\r\nUse \"Protocol module\" to make the data visible in User Details.\n\"mBirthday module\" uses the same module as mBirthday plugin.");
+ wchar_t *szCurrentModuleTooltip = NULL;
char *szProto = GetContactProto(hContact);
- TCHAR buffer[2048];
+ wchar_t buffer[2048];
mir_sntprintf(buffer, TranslateT("Set birthday for %s:"), pcli->pfnGetContactDisplayName(hContact, 0));
SetWindowText(hWnd, buffer);
@@ -516,7 +516,7 @@ void AddAnchorWindowToDeferList(HDWP &hdWnds, HWND window, RECT *rParent, WINDOW #define NA TranslateT("N/A")
-TCHAR* GetBirthdayModule(int module, MCONTACT)
+wchar_t* GetBirthdayModule(int module, MCONTACT)
{
switch (module) {
case DOB_MBIRTHDAY: return L"mBirthday";
@@ -540,8 +540,8 @@ INT_PTR CALLBACK BirthdaysCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam {
BirthdaysSortParams params = *(BirthdaysSortParams *)myParam;
const int maxSize = 1024;
- TCHAR text1[maxSize];
- TCHAR text2[maxSize];
+ wchar_t text1[maxSize];
+ wchar_t text2[maxSize];
long value1, value2;
ListView_GetItemText(params.hList, (int)lParam1, params.column, text1, _countof(text1));
ListView_GetItemText(params.hList, (int)lParam2, params.column, text2, _countof(text2));
@@ -549,9 +549,9 @@ INT_PTR CALLBACK BirthdaysCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam int res = 0;
if ((params.column == 2) || (params.column == 4)) {
- TCHAR *err1, *err2;
- value1 = _tcstol(text1, &err1, 10);
- value2 = _tcstol(text2, &err2, 10);
+ wchar_t *err1, *err2;
+ value1 = wcstol(text1, &err1, 10);
+ value2 = wcstol(text2, &err2, 10);
if ((err1[0]) || (err2[0]))
res = (err1[0]) ? 1 : -1;
@@ -592,7 +592,7 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll, char *szProto = GetContactProto(hContact);
PROTOACCOUNT *pAcc = Proto_GetAccount(szProto);
- TCHAR *ptszAccName = (pAcc == NULL) ? TranslateT("Unknown") : pAcc->tszAccountName;
+ wchar_t *ptszAccName = (pAcc == NULL) ? TranslateT("Unknown") : pAcc->tszAccountName;
LVITEM item = { 0 };
item.mask = LVIF_TEXT | LVIF_PARAM;
@@ -607,7 +607,7 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll, ListView_SetItemText(hList, entry, 1, pcli->pfnGetContactDisplayName(hContact, 0));
- TCHAR buffer[2048];
+ wchar_t buffer[2048];
if ((dtb <= 366) && (dtb >= 0))
mir_sntprintf(buffer, L"%d", dtb);
else
@@ -693,7 +693,7 @@ static LRESULT CALLBACK BirthdaysListSubclassProc(HWND hWnd, UINT msg, WPARAM wP void SetBirthdaysCount(HWND hWnd)
{
int count = ListView_GetItemCount((GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST)));
- TCHAR title[512];
+ wchar_t title[512];
mir_sntprintf(title, TranslateT("Birthday list (%d)"), count);
SetWindowText(hWnd, title);
}
@@ -879,7 +879,7 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_TIMER:
{
const int MAX_SIZE = 512;
- TCHAR buffer[MAX_SIZE];
+ wchar_t buffer[MAX_SIZE];
timeout--;
mir_sntprintf(buffer, (timeout != 2) ? TranslateT("Closing in %d seconds") : TranslateT("Closing in %d second"), timeout);
SetDlgItemText(hWnd, IDC_CLOSE, buffer);
@@ -913,7 +913,7 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar item.pszText = data->message;
ListView_InsertItem(hList, &item);
- TCHAR buffer[512];
+ wchar_t buffer[512];
mir_sntprintf(buffer, L"%d", data->age);
ListView_SetItemText(hList, index, 1, buffer);
mir_sntprintf(buffer, L"%d", data->dtb);
diff --git a/plugins/WhenWasIt/src/hooked_events.cpp b/plugins/WhenWasIt/src/hooked_events.cpp index 63f54e866f..d263f72196 100644 --- a/plugins/WhenWasIt/src/hooked_events.cpp +++ b/plugins/WhenWasIt/src/hooked_events.cpp @@ -46,8 +46,8 @@ static int OnOptionsInitialise(WPARAM wParam, LPARAM) odp.position = 100000000;
odp.hInstance = hInstance;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_WWI);
- odp.ptszTitle = LPGENT("Birthdays");
- odp.ptszGroup = LPGENT("Contacts");
+ odp.pwszTitle = LPGENW("Birthdays");
+ odp.pwszGroup = LPGENW("Contacts");
odp.groupPosition = 910000000;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = DlgProcOptions;
diff --git a/plugins/WhenWasIt/src/icons.cpp b/plugins/WhenWasIt/src/icons.cpp index 131d97ed06..5526639a3e 100644 --- a/plugins/WhenWasIt/src/icons.cpp +++ b/plugins/WhenWasIt/src/icons.cpp @@ -29,21 +29,21 @@ HANDLE hDTBMore = NULL; HANDLE hWWIExtraIcons = (HANDLE)-1;
-static HANDLE AddIcon(char *name, char *description, TCHAR *tszPath, int iDefaultIdx)
+static HANDLE AddIcon(char *name, char *description, wchar_t *tszPath, int iDefaultIdx)
{
SKINICONDESC sid = { 0 };
sid.flags = SIDF_PATH_TCHAR;
sid.section.a = LPGEN("WhenWasIt");
sid.description.a = description;
sid.pszName = name;
- sid.defaultFile.t = tszPath;
+ sid.defaultFile.w = tszPath;
sid.iDefaultIndex = -iDefaultIdx;
return IcoLib_AddIcon(&sid);
}
int AddIcons()
{
- TCHAR tszPath[MAX_PATH];
+ wchar_t tszPath[MAX_PATH];
GetModuleFileName(hInstance, tszPath, _countof(tszPath));
hCheckMenu = AddIcon("MenuCheck", LPGEN("Check birthdays menu item"), tszPath, IDI_CHECK);
diff --git a/plugins/WhenWasIt/src/notifiers.cpp b/plugins/WhenWasIt/src/notifiers.cpp index 4844dcece1..f7eeb0c150 100644 --- a/plugins/WhenWasIt/src/notifiers.cpp +++ b/plugins/WhenWasIt/src/notifiers.cpp @@ -35,12 +35,12 @@ void PopupNotifyNoBirthdays() FillPopupData(pd, -1);
pd.lchIcon = GetDTBIcon(-1);
- _tcsncpy(pd.lptzContactName, TranslateT("WhenWasIt"), MAX_CONTACTNAME - 1);
- _tcsncpy(pd.lptzText, TranslateT("No upcoming birthdays."), MAX_SECONDLINE - 1);
+ wcsncpy(pd.lptzContactName, TranslateT("WhenWasIt"), MAX_CONTACTNAME - 1);
+ wcsncpy(pd.lptzText, TranslateT("No upcoming birthdays."), MAX_SECONDLINE - 1);
PUAddPopupT(&pd);
}
-TCHAR *BuildDTBText(int dtb, TCHAR *name, TCHAR *text, int size)
+wchar_t *BuildDTBText(int dtb, wchar_t *name, wchar_t *text, int size)
{
if (dtb > 1)
mir_sntprintf(text, size, TranslateT("%s has birthday in %d days."), name, dtb);
@@ -52,7 +52,7 @@ TCHAR *BuildDTBText(int dtb, TCHAR *name, TCHAR *text, int size) return text;
}
-TCHAR *BuildDABText(int dab, TCHAR *name, TCHAR *text, int size)
+wchar_t *BuildDABText(int dab, wchar_t *name, wchar_t *text, int size)
{
if (dab > 1)
mir_sntprintf(text, size, TranslateT("%s had birthday %d days ago."), name, dab);
@@ -69,9 +69,9 @@ int PopupNotifyBirthday(MCONTACT hContact, int dtb, int age) if (commonData.bIgnoreSubcontacts && db_mc_isSub(hContact))
return 0;
- TCHAR *name = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR text[1024];
+ wchar_t text[1024];
BuildDTBText(dtb, name, text, _countof(text));
int gender = GetContactGender(hContact);
@@ -82,12 +82,12 @@ int PopupNotifyBirthday(MCONTACT hContact, int dtb, int age) pd.lchIcon = GetDTBIcon(dtb);
mir_sntprintf(pd.lptzContactName, MAX_CONTACTNAME, TranslateT("Birthday - %s"), name);
- TCHAR *sex;
+ wchar_t *sex;
switch (toupper(gender)) {
- case _T('M'):
+ case 'M':
sex = TranslateT("He");
break;
- case _T('F'):
+ case 'F':
sex = TranslateT("She");
break;
default:
@@ -113,9 +113,9 @@ int PopupNotifyMissedBirthday(MCONTACT hContact, int dab, int age) if (commonData.bIgnoreSubcontacts && db_mc_isSub(hContact))
return 0;
- TCHAR *name = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR text[1024];
+ wchar_t text[1024];
BuildDABText(dab, name, text, _countof(text));
int gender = GetContactGender(hContact);
@@ -126,12 +126,12 @@ int PopupNotifyMissedBirthday(MCONTACT hContact, int dab, int age) pd.lchIcon = GetDTBIcon(dab);
mir_sntprintf(pd.lptzContactName, MAX_CONTACTNAME, TranslateT("Birthday - %s"), name);
- TCHAR *sex;
+ wchar_t *sex;
switch (toupper(gender)) {
- case _T('M'):
+ case 'M':
sex = TranslateT("He");
break;
- case _T('F'):
+ case 'F':
sex = TranslateT("She");
break;
default:
@@ -153,9 +153,9 @@ int PopupNotifyMissedBirthday(MCONTACT hContact, int dab, int age) int DialogNotifyBirthday(MCONTACT hContact, int dtb, int age)
{
- TCHAR *name = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR text[1024];
+ wchar_t text[1024];
BuildDTBText(dtb, name, text, _countof(text));
if (!hUpcomingDlg) {
hUpcomingDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_UPCOMING), NULL, DlgProcUpcoming);
@@ -175,9 +175,9 @@ int DialogNotifyBirthday(MCONTACT hContact, int dtb, int age) int DialogNotifyMissedBirthday(MCONTACT hContact, int dab, int age)
{
- TCHAR *name = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR text[1024];
+ wchar_t text[1024];
BuildDABText(dab, name, text, _countof(text));
if (!hUpcomingDlg) {
hUpcomingDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_UPCOMING), NULL, DlgProcUpcoming);
diff --git a/plugins/WhenWasIt/src/notifiers.h b/plugins/WhenWasIt/src/notifiers.h index 7fbeb682c3..58c9e81dfd 100644 --- a/plugins/WhenWasIt/src/notifiers.h +++ b/plugins/WhenWasIt/src/notifiers.h @@ -31,8 +31,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct TUpcomingBirthday{
MCONTACT hContact;
- TCHAR *name;
- TCHAR *message;
+ wchar_t *name;
+ wchar_t *message;
int dtb;
int age;
};
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp index 8eeaf21b6a..a40f104f13 100644 --- a/plugins/WhenWasIt/src/services.cpp +++ b/plugins/WhenWasIt/src/services.cpp @@ -176,12 +176,12 @@ INT_PTR AddBirthdayService(WPARAM hContact, LPARAM) return ShowWindow(hWnd, SW_SHOW);
}
-void ShowPopupMessage(const TCHAR *title, const TCHAR *message, HANDLE icon)
+void ShowPopupMessage(const wchar_t *title, const wchar_t *message, HANDLE icon)
{
POPUPDATAT pd = { 0 };
pd.lchIcon = IcoLib_GetIconByHandle(icon);
- _tcsncpy_s(pd.lptzContactName, title, _TRUNCATE);
- _tcsncpy_s(pd.lptzText, message, _TRUNCATE);
+ wcsncpy_s(pd.lptzContactName, title, _TRUNCATE);
+ wcsncpy_s(pd.lptzText, message, _TRUNCATE);
pd.colorText = commonData.foreground;
pd.colorBack = commonData.background;
PUAddPopupT(&pd);
@@ -212,12 +212,12 @@ INT_PTR RefreshUserDetailsService(WPARAM, LPARAM) INT_PTR ImportBirthdaysService(WPARAM, LPARAM)
{
- TCHAR fileName[1024] = { 0 };
+ wchar_t fileName[1024] = { 0 };
OPENFILENAME of = { 0 };
of.lStructSize = sizeof(OPENFILENAME);
//of.hInstance = hInstance;
- TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, L"%s (*" _T(BIRTHDAY_EXTENSION) L")%c*" _T(BIRTHDAY_EXTENSION) L"%c", TranslateT("Birthdays files"), 0, 0);
+ wchar_t filter[MAX_PATH];
+ mir_sntprintf(filter, L"%s (*" BIRTHDAY_EXTENSION L")%c*" BIRTHDAY_EXTENSION L"%c", TranslateT("Birthdays files"), 0, 0);
of.lpstrFilter = filter;
of.lpstrFile = fileName;
of.nMaxFile = _countof(fileName);
@@ -225,7 +225,7 @@ INT_PTR ImportBirthdaysService(WPARAM, LPARAM) of.Flags = OFN_FILEMUSTEXIST;
if (GetOpenFileName(&of)) {
- TCHAR buffer[2048];
+ wchar_t buffer[2048];
mir_sntprintf(buffer, TranslateT("Importing birthdays from file: %s"), fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hImportBirthdays);
DoImport(fileName);
@@ -237,22 +237,22 @@ INT_PTR ImportBirthdaysService(WPARAM, LPARAM) INT_PTR ExportBirthdaysService(WPARAM, LPARAM)
{
- TCHAR fileName[1024] = { 0 };
+ wchar_t fileName[1024] = { 0 };
OPENFILENAME of = { 0 };
of.lStructSize = sizeof(OPENFILENAME);
//of.hInstance = hInstance;
- TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, L"%s (*" _T(BIRTHDAY_EXTENSION) L")%c*" _T(BIRTHDAY_EXTENSION) L"%c%s (*.*)%c*.*%c", TranslateT("Birthdays files"), 0, 0, TranslateT("All Files"), 0, 0);
+ wchar_t filter[MAX_PATH];
+ mir_sntprintf(filter, L"%s (*" BIRTHDAY_EXTENSION L")%c*" BIRTHDAY_EXTENSION L"%c%s (*.*)%c*.*%c", TranslateT("Birthdays files"), 0, 0, TranslateT("All Files"), 0, 0);
of.lpstrFilter = filter;
of.lpstrFile = fileName;
of.nMaxFile = _countof(fileName);
of.lpstrTitle = TranslateT("Please select a file to export birthdays to...");
if (GetSaveFileName(&of)) {
- TCHAR buffer[2048];
- TCHAR *fn = _tcsrchr(fileName, _T('\\')) + 1;
- if (!_tcschr(fn, _T('.')))
- mir_tstrcat(fileName, _T(BIRTHDAY_EXTENSION));
+ wchar_t buffer[2048];
+ wchar_t *fn = wcsrchr(fileName, '\\') + 1;
+ if (!wcschr(fn, '.'))
+ mir_tstrcat(fileName, BIRTHDAY_EXTENSION);
mir_sntprintf(buffer, TranslateT("Exporting birthdays to file: %s"), fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hExportBirthdays);
@@ -263,9 +263,9 @@ INT_PTR ExportBirthdaysService(WPARAM, LPARAM) return 0;
}
-int DoImport(TCHAR *fileName)
+int DoImport(wchar_t *fileName)
{
- FILE *fin = _tfopen(fileName, L"rt");
+ FILE *fin = _wfopen(fileName, L"rt");
if (!fin) {
MessageBox(0, TranslateT("Could not open file to import birthdays"), TranslateT("Error"), MB_OK | MB_ICONERROR);
return 1;
@@ -274,32 +274,32 @@ int DoImport(TCHAR *fileName) int mode = commonData.cDefaultModule;
while (!feof(fin)) {
- TCHAR buffer[4096];
- _fgetts(buffer, _countof(buffer), fin);
- if (buffer[0] == _T(COMMENT_CHAR))
+ wchar_t buffer[4096];
+ fgetws(buffer, _countof(buffer), fin);
+ if (buffer[0] == COMMENT_CHAR)
continue;
- TCHAR *delAccount = _tcsstr(buffer, L" : ");
+ wchar_t *delAccount = wcsstr(buffer, L" : ");
if (delAccount) {
int tmp = delAccount[0];
- delAccount[0] = _T('\0');
- TCHAR *delProto = _tcsrchr(buffer, _T('@'));
+ delAccount[0] = '\0';
+ wchar_t *delProto = wcsrchr(buffer, '@');
if (delProto) {
- delProto[0] = _T('\0');
+ delProto[0] = '\0';
- TCHAR *szHandle = buffer;
- TCHAR *szProto = delProto + 1;
+ wchar_t *szHandle = buffer;
+ wchar_t *szProto = delProto + 1;
MCONTACT hContact = GetContactFromID(szHandle, szProto);
if (hContact) {
delProto[0] = tmp;
delAccount[0] = tmp;
int year, month, day;
- _stscanf(delAccount, L" : %02d/%02d/%04d", &day, &month, &year);
+ swscanf(delAccount, L" : %02d/%02d/%04d", &day, &month, &year);
SaveBirthday(hContact, year, month, day, mode);
}
else {
- CMString msg(FORMAT, TranslateT(NOTFOUND_FORMAT), szHandle, szProto);
+ CMString msg(FORMAT, TranslateT("Could not find UID '%s [%S]' in current database, skipping"), szHandle, szProto);
ShowPopupMessage(TranslateT("Warning"), msg, hImportBirthdays);
}
}
@@ -310,26 +310,26 @@ int DoImport(TCHAR *fileName) return 0;
}
-int DoExport(TCHAR *fileName)
+int DoExport(wchar_t *fileName)
{
- FILE *fout = _tfopen(fileName, L"wt");
+ FILE *fout = _wfopen(fileName, L"wt");
if (!fout) {
MessageBox(0, TranslateT("Could not open file to export birthdays"), TranslateT("Error"), MB_OK | MB_ICONERROR);
return 1;
}
- _ftprintf(fout, L"%c%s", _T(COMMENT_CHAR), TranslateT("Please do not edit this file by hand. Use the export function of WhenWasIt plugin.\n"));
- _ftprintf(fout, L"%c%s", _T(COMMENT_CHAR), TranslateT("Warning! Please do not mix Unicode and Ansi exported birthday files. You should use the same version (Ansi/Unicode) of WhenWasIt that was used to export the info.\n"));
- _ftprintf(fout, L"%c%s", _T(COMMENT_CHAR), TranslateT("This file was exported with a Unicode version of WhenWasIt. Please only use a Unicode version of the plugin to import the birthdays.\n"));
+ fwprintf(fout, L"%c%s", COMMENT_CHAR, TranslateT("Please do not edit this file by hand. Use the export function of WhenWasIt plugin.\n"));
+ fwprintf(fout, L"%c%s", COMMENT_CHAR, TranslateT("Warning! Please do not mix Unicode and Ansi exported birthday files. You should use the same version (Ansi/Unicode) of WhenWasIt that was used to export the info.\n"));
+ fwprintf(fout, L"%c%s", COMMENT_CHAR, TranslateT("This file was exported with a Unicode version of WhenWasIt. Please only use a Unicode version of the plugin to import the birthdays.\n"));
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
int year, month, day;
GetContactDOB(hContact, year, month, day);
if (IsDOBValid(year, month, day)) {
char *szProto = GetContactProto(hContact);
- TCHAR *szHandle = GetContactID(hContact, szProto);
+ wchar_t *szHandle = GetContactID(hContact, szProto);
if ((szHandle) && (mir_strlen(szProto) > 0))
- _ftprintf(fout, _T(BIRTHDAYS_EXPORT_FORMAT), szHandle, szProto, day, month, year);
+ fwprintf(fout, L"%s@%S : %02d/%02d/%04d\n", szHandle, szProto, day, month, year);
if (szHandle)
free(szHandle);
diff --git a/plugins/WhenWasIt/src/services.h b/plugins/WhenWasIt/src/services.h index d4c19194a1..25d1c453b8 100644 --- a/plugins/WhenWasIt/src/services.h +++ b/plugins/WhenWasIt/src/services.h @@ -30,11 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define REFRESH_DETAILS_DELAY 3000
-
-#define BIRTHDAY_EXTENSION ".bdaysW"
-#define BIRTHDAYS_EXPORT_FORMAT "%s@%S : %02d/%02d/%04d\n"
-#define NOTFOUND_FORMAT LPGEN("Could not find UID '%s [%S]' in current database, skipping")
-
+#define BIRTHDAY_EXTENSION L".bdaysW"
extern int bShouldCheckBirthdays;
extern int bBirthdayFound;
@@ -45,8 +41,8 @@ int DestroyServices(); int NotifyContactBirthday(MCONTACT hContact, time_t now, int daysInAdvance);
int NotifyMissedContactBirthday(MCONTACT hContact, time_t now, int daysAfter);
-int DoExport(TCHAR *fileName);
-int DoImport(TCHAR *fileName);
+int DoExport(wchar_t *fileName);
+int DoImport(wchar_t *fileName);
INT_PTR CheckBirthdaysService(WPARAM wParam, LPARAM lParam);
INT_PTR ShowListService(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp index 9667b1bc37..6c0c253a12 100644 --- a/plugins/WhenWasIt/src/utils.cpp +++ b/plugins/WhenWasIt/src/utils.cpp @@ -138,22 +138,22 @@ int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, si return GetStringFromDatabase(NULL, ModuleName, szSettingName, szError, szResult, size);
}
-TCHAR* GetContactID(MCONTACT hContact)
+wchar_t* GetContactID(MCONTACT hContact)
{
return GetContactID(hContact, NULL);
}
-TCHAR* GetContactID(MCONTACT hContact, char *szProto)
+wchar_t* GetContactID(MCONTACT hContact, char *szProto)
{
ptrT res(Contact_GetInfo(CNF_UNIQUEID, hContact, szProto));
- return (res) ? _tcsdup(res) : NULL;
+ return (res) ? wcsdup(res) : NULL;
}
-MCONTACT GetContactFromID(TCHAR *szID, char *szProto)
+MCONTACT GetContactFromID(wchar_t *szID, char *szProto)
{
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *m_szProto = GetContactProto(hContact);
- TCHAR *szHandle = GetContactID(hContact, szProto);
+ wchar_t *szHandle = GetContactID(hContact, szProto);
if (szHandle) {
bool found = (!mir_tstrcmpi(szHandle, szID) && !_stricmp(szProto, m_szProto));
free(szHandle);
@@ -164,7 +164,7 @@ MCONTACT GetContactFromID(TCHAR *szID, char *szProto) return NULL;
}
-MCONTACT GetContactFromID(TCHAR *szID, wchar_t *szProto)
+MCONTACT GetContactFromID(wchar_t *szID, wchar_t *szProto)
{
char protocol[1024];
WideCharToMultiByte(CP_ACP, 0, szProto, -1, protocol, sizeof(protocol), NULL, NULL);
diff --git a/plugins/WhenWasIt/src/utils.h b/plugins/WhenWasIt/src/utils.h index a90f9a83f3..b432c623c1 100644 --- a/plugins/WhenWasIt/src/utils.h +++ b/plugins/WhenWasIt/src/utils.h @@ -44,9 +44,9 @@ RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, int size);
-TCHAR* GetContactID(MCONTACT hContact);
-TCHAR* GetContactID(MCONTACT hContact, char *szProto);
-MCONTACT GetContactFromID(TCHAR *szID, char *szProto);
-MCONTACT GetContactFromID(TCHAR *szID, wchar_t *szProto);
+wchar_t* GetContactID(MCONTACT hContact);
+wchar_t* GetContactID(MCONTACT hContact, char *szProto);
+MCONTACT GetContactFromID(wchar_t *szID, char *szProto);
+MCONTACT GetContactFromID(wchar_t *szID, wchar_t *szProto);
#endif
\ No newline at end of file diff --git a/plugins/WhoUsesMyFiles/src/stdafx.h b/plugins/WhoUsesMyFiles/src/stdafx.h index 1369af3336..66c4fc31fa 100644 --- a/plugins/WhoUsesMyFiles/src/stdafx.h +++ b/plugins/WhoUsesMyFiles/src/stdafx.h @@ -70,13 +70,13 @@ struct WUMF_OPTIONS COLORREF ColorText;
COLORREF ColorBack;
- TCHAR LogFile[255];
+ wchar_t LogFile[255];
};
struct Wumf
{
DWORD dwID;
- TCHAR szID[10], szPerm[10];
+ wchar_t szID[10], szPerm[10];
LPTSTR szUser;
LPTSTR szPath;
LPTSTR szComp;
diff --git a/plugins/WhoUsesMyFiles/src/wumf.cpp b/plugins/WhoUsesMyFiles/src/wumf.cpp index 730fbc152f..00508fe262 100644 --- a/plugins/WhoUsesMyFiles/src/wumf.cpp +++ b/plugins/WhoUsesMyFiles/src/wumf.cpp @@ -139,7 +139,7 @@ void LogWumf(PWumf w) if (hLogger == NULL) {
hLogger = mir_createLog("wumf", L"WhoIsUsingMyFiles log file", WumfOptions.LogFile, 0);
if (hLogger == NULL) {
- TCHAR str[256];
+ wchar_t str[256];
mir_sntprintf(str, L"Can't open log file %s", WumfOptions.LogFile);
MessageBox(NULL, str, TranslateT("Error opening file"), MB_OK | MB_ICONSTOP);
WumfOptions.LogToFile = FALSE;
@@ -150,7 +150,7 @@ void LogWumf(PWumf w) SYSTEMTIME time;
GetLocalTime(&time);
- TCHAR lpDateStr[20], lpTimeStr[20];
+ wchar_t lpDateStr[20], lpTimeStr[20];
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &time, NULL, lpDateStr, 20);
GetTimeFormat(LOCALE_USER_DEFAULT, TIME_FORCE24HOURFORMAT | TIME_NOTIMEMARKER, &time, NULL, lpTimeStr, 20);
mir_writeLogT(hLogger, L"%s %s %20s\t%s\r\n", lpDateStr, lpTimeStr, w->szUser, w->szPath);
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index 5d9bfde86d..f39cb61e82 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -28,7 +28,7 @@ void LoadOptions() memset(&WumfOptions, 0, sizeof(WumfOptions));
if (db_get_ts(NULL, MODULENAME, OPT_FILE, &dbv) == 0)
{
- _tcsncpy(WumfOptions.LogFile, dbv.ptszVal, 255);
+ wcsncpy(WumfOptions.LogFile, dbv.ptszVal, 255);
db_free(&dbv);
}
else
@@ -116,7 +116,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA void ShowWumfPopup(PWumf w)
{
- TCHAR text[512], title[512];
+ wchar_t text[512], title[512];
if (!WumfOptions.AlertFolders && (w->dwAttr & FILE_ATTRIBUTE_DIRECTORY)) return;
mir_sntprintf(title, L"%s (%s)", w->szComp, w->szUser);
@@ -222,11 +222,11 @@ static INT_PTR WumfMenuCommand(WPARAM,LPARAM) {
if (WumfOptions.PopupsEnabled == TRUE) {
WumfOptions.PopupsEnabled = FALSE;
- Menu_ModifyItem(hMenuItem, LPGENT("Enable WUMF popups"), LoadIcon(hInst,MAKEINTRESOURCE(IDI_NOPOPUP)));
+ Menu_ModifyItem(hMenuItem, LPGENW("Enable WUMF popups"), LoadIcon(hInst,MAKEINTRESOURCE(IDI_NOPOPUP)));
}
else {
WumfOptions.PopupsEnabled = TRUE;
- Menu_ModifyItem(hMenuItem, LPGENT("Disable WUMF popups"), LoadIcon(hInst,MAKEINTRESOURCE(IDI_POPUP)));
+ Menu_ModifyItem(hMenuItem, LPGENW("Disable WUMF popups"), LoadIcon(hInst,MAKEINTRESOURCE(IDI_POPUP)));
}
db_set_b(NULL, MODULENAME, POPUPS_ENABLED, (BYTE)WumfOptions.PopupsEnabled);
@@ -252,7 +252,7 @@ void DisableDelayOptions(HWND hwndDlg) void ChooseFile(HWND hwndDlg)
{
- TCHAR szFile[MAX_PATH]; szFile[0]=0;
+ wchar_t szFile[MAX_PATH]; szFile[0]=0;
// Initialize OPENFILENAME
OPENFILENAME ofn = {0}; // common dialog box structure
@@ -273,7 +273,7 @@ void ChooseFile(HWND hwndDlg) }
}
else if (CommDlgExtendedError() != 0) {
- TCHAR str[256];
+ wchar_t str[256];
mir_sntprintf(str, TranslateT("Common Dialog Error 0x%lx"), CommDlgExtendedError());
MessageBox(hwndDlg, str, TranslateT("Error"), MB_OK | MB_ICONSTOP);
}
@@ -492,7 +492,7 @@ extern "C" __declspec(dllexport) int Load(void) CMenuItem mi;
SET_UID(mi, 0xcfce6487, 0x907b, 0x4822, 0xb0, 0x49, 0x18, 0x4e, 0x47, 0x17, 0x0, 0x69);
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Popups"), 1999990000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 1999990000);
if (WumfOptions.PopupsEnabled == FALSE) {
mi.name.a = LPGEN("Enable WUMF popups");
mi.hIcolibItem = LoadIcon(hInst,MAKEINTRESOURCE(IDI_NOPOPUP));
diff --git a/plugins/WinterSpeak/src/DialogConfigEngine.cpp b/plugins/WinterSpeak/src/DialogConfigEngine.cpp index 1f0ccbca6e..8914402120 100644 --- a/plugins/WinterSpeak/src/DialogConfigEngine.cpp +++ b/plugins/WinterSpeak/src/DialogConfigEngine.cpp @@ -93,7 +93,7 @@ void DialogConfigEngine::command(HWND window, int control) case IDC_BUTTON_TEST:
if (createTts(window))
{
- m_test_tts->say(TranslateW(L"testing testing 1 2 3"));
+ m_test_tts->say(TranslateT("testing testing 1 2 3"));
}
break;
}
diff --git a/plugins/WinterSpeak/src/EventInformation.cpp b/plugins/WinterSpeak/src/EventInformation.cpp index 3332a7c235..451449f343 100644 --- a/plugins/WinterSpeak/src/EventInformation.cpp +++ b/plugins/WinterSpeak/src/EventInformation.cpp @@ -8,11 +8,11 @@ EventInformation::EventInformation() : m_event_strings(), m_event_info()
{
// insert the event strings into a map for easy access
- m_event_strings[EVENTTYPE_MESSAGE] = TranslateW(L"incoming message from %u");
- m_event_strings[EVENTTYPE_URL] = TranslateW(L"incoming URL from %u");
- m_event_strings[EVENTTYPE_ADDED] = TranslateW(L"you have been added to %u's contact list");
- m_event_strings[EVENTTYPE_AUTHREQUEST] = TranslateW(L"%u requests your authorization");
- m_event_strings[EVENTTYPE_FILE] = TranslateW(L"there is an incoming file from %u");
+ m_event_strings[EVENTTYPE_MESSAGE] = TranslateT("incoming message from %u");
+ m_event_strings[EVENTTYPE_URL] = TranslateT("incoming URL from %u");
+ m_event_strings[EVENTTYPE_ADDED] = TranslateT("you have been added to %u's contact list");
+ m_event_strings[EVENTTYPE_AUTHREQUEST] = TranslateT("%u requests your authorization");
+ m_event_strings[EVENTTYPE_FILE] = TranslateT("there is an incoming file from %u");
memset(&m_event_info, 0, sizeof(m_event_info));
}
@@ -65,7 +65,7 @@ bool EventInformation::isValidEvent(MEVENT event) //------------------------------------------------------------------------------
std::wstring EventInformation::getMessage()
{
- const std::wstring intro = TranslateW(L"%u says");
+ const std::wstring intro = TranslateT("%u says");
return intro + L" " + mir_a2t_cp((char*)m_event_info.pBlob, CP_UTF8);
}
diff --git a/plugins/WinterSpeak/src/UserInformation.cpp b/plugins/WinterSpeak/src/UserInformation.cpp index d39ad691be..63576269e3 100644 --- a/plugins/WinterSpeak/src/UserInformation.cpp +++ b/plugins/WinterSpeak/src/UserInformation.cpp @@ -4,14 +4,14 @@ UserInformation::UserInformation() : m_status_info(), m_status_strings() {
// insert the status strings into a map for easy access
- m_status_strings[ID_STATUS_OFFLINE] = LPGENT("%u is now offline");
- m_status_strings[ID_STATUS_ONLINE] = LPGENT("%u is now online");
- m_status_strings[ID_STATUS_AWAY] = LPGENT("%u is away");
- m_status_strings[ID_STATUS_INVISIBLE] = LPGENT("%u is invisible");
- m_status_strings[ID_STATUS_NA] = LPGENT("%u is not available");
- m_status_strings[ID_STATUS_DND] = LPGENT("%u does not want to be disturbed");
- m_status_strings[ID_STATUS_OCCUPIED] = LPGENT("%u is occupied");
- m_status_strings[ID_STATUS_FREECHAT] = LPGENT("%u is free for chat");
+ m_status_strings[ID_STATUS_OFFLINE] = LPGENW("%u is now offline");
+ m_status_strings[ID_STATUS_ONLINE] = LPGENW("%u is now online");
+ m_status_strings[ID_STATUS_AWAY] = LPGENW("%u is away");
+ m_status_strings[ID_STATUS_INVISIBLE] = LPGENW("%u is invisible");
+ m_status_strings[ID_STATUS_NA] = LPGENW("%u is not available");
+ m_status_strings[ID_STATUS_DND] = LPGENW("%u does not want to be disturbed");
+ m_status_strings[ID_STATUS_OCCUPIED] = LPGENW("%u is occupied");
+ m_status_strings[ID_STATUS_FREECHAT] = LPGENW("%u is free for chat");
}
//------------------------------------------------------------------------------
diff --git a/plugins/WinterSpeak/src/main.cpp b/plugins/WinterSpeak/src/main.cpp index 25852f7b5f..d01560d6f4 100644 --- a/plugins/WinterSpeak/src/main.cpp +++ b/plugins/WinterSpeak/src/main.cpp @@ -71,18 +71,18 @@ int dialogOptionsInitialise(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_hInst;
- odp.ptszGroup = LPGENT("Speak");
+ odp.pwszGroup = LPGENW("Speak");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
if (g_speak_config)
{
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONFIG);
- odp.ptszTitle = LPGENT("Engine/Voice");
+ odp.pwszTitle = LPGENW("Engine/Voice");
odp.pfnDlgProc = DialogConfigEngine::process;
Options_AddPage(wParam, &odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_ACTIVEMODES);
- odp.ptszTitle = LPGENT("Active Modes");
+ odp.pwszTitle = LPGENW("Active Modes");
odp.pfnDlgProc = DialogConfigActive::process;
Options_AddPage(wParam, &odp);
}
@@ -90,7 +90,7 @@ int dialogOptionsInitialise(WPARAM wParam, LPARAM) if (g_speak_announce)
{
odp.pszTemplate = MAKEINTRESOURCEA(IDD_ANNOUNCE);
- odp.ptszTitle = LPGENT("Announce");
+ odp.pwszTitle = LPGENW("Announce");
odp.pfnDlgProc = AnnounceDialog::process;
Options_AddPage(wParam, &odp);
}
diff --git a/plugins/XSoundNotify/src/dialog.cpp b/plugins/XSoundNotify/src/dialog.cpp index 34da7e7d13..5a6bff9772 100644 --- a/plugins/XSoundNotify/src/dialog.cpp +++ b/plugins/XSoundNotify/src/dialog.cpp @@ -28,10 +28,10 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP if ((INT_PTR)szUniqueId != CALLSERVICE_NOTFOUND && szUniqueId != NULL) {
DBVARIANT dbvuid = { 0 };
if (!db_get(hContact, pa->szModuleName, szUniqueId, &dbvuid)) {
- TCHAR uid[MAX_PATH];
+ wchar_t uid[MAX_PATH];
switch (dbvuid.type) {
case DBVT_DWORD:
- _itot(dbvuid.dVal, uid, 10);
+ _itow(dbvuid.dVal, uid, 10);
break;
case DBVT_ASCIIZ:
@@ -43,8 +43,8 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP break;
}
- TCHAR *nick = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR value[100];
+ wchar_t *nick = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t value[100];
mir_sntprintf(value, TranslateT("Custom sound for %s (%s)"), nick, uid);
SetWindowText(hwndDlg, value);
db_free(&dbvuid);
@@ -80,7 +80,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP p = XSN_Users.find((XSN_Data *)&hContact);
if (p != NULL) {
if (mir_tstrcmpi(p->path, L"")) {
- TCHAR shortpath[MAX_PATH];
+ wchar_t shortpath[MAX_PATH];
PathToRelativeT(p->path, shortpath);
db_set_ts(hContact, SETTINGSNAME, SETTINGSKEY, shortpath);
}
@@ -93,12 +93,12 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP case IDC_CONT_BUTTON_CHOOSE_SOUND:
{
- TCHAR FileName[MAX_PATH];
- TCHAR *tszMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
+ wchar_t FileName[MAX_PATH];
+ wchar_t *tszMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
if (GetModuleHandle(L"bass_interface.dll"))
mir_sntprintf(tmp, L"%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c", TranslateT("Sound files"), 0, 0, 0);
else
@@ -119,7 +119,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP if (p == NULL)
XSN_Users.insert(new XSN_Data(hContact, FileName, IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0));
else {
- _tcsncpy(p->path, FileName, _countof(p->path));
+ wcsncpy(p->path, FileName, _countof(p->path));
p->ignore = IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0;
}
EnableWindow(GetDlgItem(hwndDlg, IDC_CONT_BUTTON_TEST_PLAY), TRUE);
@@ -135,14 +135,14 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP if (p == NULL) {
DBVARIANT dbv;
if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR longpath[MAX_PATH] = { 0 };
+ wchar_t longpath[MAX_PATH] = { 0 };
PathToAbsoluteT(dbv.ptszVal, longpath);
SkinPlaySoundFile(longpath);
db_free(&dbv);
}
}
else {
- TCHAR longpath[MAX_PATH] = { 0 };
+ wchar_t longpath[MAX_PATH] = { 0 };
PathToAbsoluteT(p->path, longpath);
SkinPlaySoundFile(longpath);
}
@@ -168,7 +168,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP if (p == NULL) {
DBVARIANT dbv;
if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR longpath[MAX_PATH];
+ wchar_t longpath[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, longpath);
XSN_Users.insert(new XSN_Data(hContact, longpath, IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0));
db_free(&dbv);
diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index 6317a5ecb6..775cfc6ffd 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -59,10 +59,10 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if ((INT_PTR)szUniqueId != CALLSERVICE_NOTFOUND && szUniqueId != NULL) {
DBVARIANT dbvuid = { 0 };
if (!db_get(hContact, pa->szModuleName, szUniqueId, &dbvuid)) {
- TCHAR uid[MAX_PATH];
+ wchar_t uid[MAX_PATH];
switch (dbvuid.type) {
case DBVT_DWORD:
- _itot(dbvuid.dVal, uid, 10);
+ _itow(dbvuid.dVal, uid, 10);
break;
case DBVT_ASCIIZ:
@@ -77,9 +77,9 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l mir_tstrcpy(uid, TranslateT("(Unknown contact)"));
}
- TCHAR *nick = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *nick = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
size_t value_max_len = (mir_tstrlen(uid) + mir_tstrlen(nick) + 4);
- TCHAR *value = (TCHAR *)mir_alloc(sizeof(TCHAR) * value_max_len);
+ wchar_t *value = (wchar_t *)mir_alloc(sizeof(wchar_t) * value_max_len);
mir_sntprintf(value, value_max_len, L"%s (%s)", nick, uid);
SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_ADDSTRING, 0, (LPARAM)value), hContact);
mir_free(value);
@@ -115,12 +115,12 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_OPT_BUTTON_CHOOSE_SOUND:
{
- TCHAR FileName[MAX_PATH];
- TCHAR *tszMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
+ wchar_t FileName[MAX_PATH];
+ wchar_t *tszMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
if (GetModuleHandle(L"bass_interface.dll"))
mir_sntprintf(tmp, L"%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c", TranslateT("Sound files"), 0, 0, 0);
else
@@ -144,7 +144,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l XSN_Users.insert(new XSN_Data(hContact, FileName, IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0));
else
{
- _tcsncpy(p->path, FileName, _countof(p->path));
+ wcsncpy(p->path, FileName, _countof(p->path));
p->ignore = IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0;
}
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_TEST_PLAY), TRUE);
@@ -164,14 +164,14 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (p == NULL) {
DBVARIANT dbv;
if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR longpath[MAX_PATH];
+ wchar_t longpath[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, longpath);
SkinPlaySoundFile(longpath);
db_free(&dbv);
}
}
else {
- TCHAR longpath[MAX_PATH] = { 0 };
+ wchar_t longpath[MAX_PATH] = { 0 };
PathToAbsoluteT(p->path, longpath);
SkinPlaySoundFile(longpath);
}
@@ -205,7 +205,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (p == NULL) {
DBVARIANT dbv;
if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR longpath[MAX_PATH];
+ wchar_t longpath[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, longpath);
XSN_Users.insert(new XSN_Data(hContact, longpath, IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0));
db_free(&dbv);
@@ -225,7 +225,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case PSN_APPLY:
for (int i = 0; i < XSN_Users.getCount(); i++) {
if (mir_tstrcmpi(XSN_Users[i]->path, L"")) {
- TCHAR shortpath[MAX_PATH];
+ wchar_t shortpath[MAX_PATH];
PathToRelativeT(XSN_Users[i]->path, shortpath);
db_set_ts(XSN_Users[i]->hContact, SETTINGSNAME, SETTINGSKEY, shortpath);
}
@@ -244,8 +244,8 @@ INT OptInit(WPARAM wParam, LPARAM) odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.ptszGroup = LPGENT("Sounds");
- odp.ptszTitle = LPGENT("XSound Notify");
+ odp.pwszGroup = LPGENW("Sounds");
+ odp.pwszTitle = LPGENW("XSound Notify");
odp.pfnDlgProc = OptsProc;
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/XSoundNotify/src/stdafx.h b/plugins/XSoundNotify/src/stdafx.h index 6bee45d772..ae497266c6 100644 --- a/plugins/XSoundNotify/src/stdafx.h +++ b/plugins/XSoundNotify/src/stdafx.h @@ -23,13 +23,13 @@ struct XSN_Data
{
MCONTACT hContact;
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
BYTE ignore;
- __forceinline XSN_Data(MCONTACT _aContact, TCHAR *_path, BYTE _ignore) :
+ __forceinline XSN_Data(MCONTACT _aContact, wchar_t *_path, BYTE _ignore) :
hContact(_aContact)
{
- _tcsncpy(path, _path, _countof(path));
+ wcsncpy(path, _path, _countof(path));
ignore = _ignore;
}
};
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index d8ffcb9d97..afb720d85b 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -76,7 +76,7 @@ void InitSelfSounds() char namebuf[128];
mir_snprintf(namebuf, "%s%s", protos[i]->szModuleName, selfSounds[j].szName);
- TCHAR infobuf[256];
+ wchar_t infobuf[256];
mir_sntprintf(infobuf, L"%s [%s]", TranslateT("Self status"), protos[i]->tszAccountName);
SkinAddNewSoundExT(namebuf, infobuf, pcli->pfnGetStatusModeDescription(selfSounds[j].iStatus, 0));
}
@@ -118,7 +118,7 @@ static int ProcessEvent(WPARAM hContact, LPARAM lParam) isIgnoreSound = db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
DBVARIANT dbv;
if (!isIgnoreSound && !db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR PlaySoundPath[MAX_PATH] = { 0 };
+ wchar_t PlaySoundPath[MAX_PATH] = { 0 };
PathToAbsoluteT(dbv.ptszVal, PlaySoundPath);
isOwnSound = 0;
SkinPlaySoundFile(PlaySoundPath);
@@ -144,11 +144,11 @@ static int ProcessChatEvent(WPARAM, LPARAM lParam) ptrT nick(db_get_tsa(hContact, gcd->pszModule, "MyNick"));
if (nick == NULL || gce->ptszText == NULL)
return 0;
- if (_tcsstr(gce->ptszText, nick)) {
+ if (wcsstr(gce->ptszText, nick)) {
isIgnoreSound = db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
DBVARIANT dbv;
if (!isIgnoreSound && !db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR PlaySoundPath[MAX_PATH] = { 0 };
+ wchar_t PlaySoundPath[MAX_PATH] = { 0 };
PathToAbsoluteT(dbv.ptszVal, PlaySoundPath);
isOwnSound = 0;
SkinPlaySoundFile(PlaySoundPath);
@@ -182,7 +182,7 @@ static int OnLoadInit(WPARAM, LPARAM) mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mi.name.t = LPGENT("Custom contact sound");
+ mi.name.w = LPGENW("Custom contact sound");
mi.pszService = "XSoundNotify/ContactMenuCommand";
hChangeSound = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/YAMN/src/account.cpp b/plugins/YAMN/src/account.cpp index 004dc1bd1b..a79c650ce7 100644 --- a/plugins/YAMN/src/account.cpp +++ b/plugins/YAMN/src/account.cpp @@ -162,18 +162,18 @@ void StopSignalFcn(HACCOUNT Which) void CodeDecodeString(char *Dest, BOOL Encrypt) { - TCHAR Code = STARTCODEPSW; + wchar_t Code = STARTCODEPSW; if (Dest == NULL) return; - for (; *Dest != (TCHAR)0; Dest++) + for (; *Dest != (wchar_t)0; Dest++) { if (Encrypt) *Dest = *Dest + Code; else *Dest = *Dest - Code; - Code += (TCHAR)ADDCODEPSW; + Code += (wchar_t)ADDCODEPSW; } } @@ -204,7 +204,7 @@ static DWORD PostFileToMemory(HANDLE File, char **MemFile, char **End) return 0; } -DWORD FileToMemory(TCHAR *FileName, char **MemFile, char **End) +DWORD FileToMemory(wchar_t *FileName, char **MemFile, char **End) { HANDLE hFile = CreateFile(FileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) @@ -214,23 +214,23 @@ DWORD FileToMemory(TCHAR *FileName, char **MemFile, char **End) } #if defined(DEBUG_FILEREAD) || defined(DEBUG_FILEREADMESSAGES) -DWORD ReadStringFromMemory(char **Parser,TCHAR *End,char **StoreTo,TCHAR *DebugString) +DWORD ReadStringFromMemory(char **Parser,wchar_t *End,char **StoreTo,wchar_t *DebugString) { //This is the debug version of ReadStringFromMemory function. This version shows MessageBox where //read string is displayed - TCHAR *Dest,*Finder; + wchar_t *Dest,*Finder; DWORD Size; - TCHAR Debug[65536]; + wchar_t Debug[65536]; Finder=*Parser; - while((*Finder != (TCHAR)0) && (Finder<=End)) Finder++; + while((*Finder != (wchar_t)0) && (Finder<=End)) Finder++; mir_sntprintf(Debug, L"%s: %s,length is %d, remaining %d chars", DebugString, *Parser, Finder-*Parser, End-Finder); MessageBox(NULL,Debug,L"debug",MB_OK); if (Finder>=End) return EACC_FILECOMPATIBILITY; if (Size=Finder-*Parser) { - if (NULL==(Dest=*StoreTo=new TCHAR[Size+1])) + if (NULL==(Dest=*StoreTo=new wchar_t[Size+1])) return EACC_ALLOC; for (;*Parser<=Finder;(*Parser)++,Dest++) *Dest=**Parser; @@ -250,7 +250,7 @@ DWORD ReadStringFromMemory(char **Parser, char *End, char **StoreTo) DWORD Size; Finder = *Parser; - while ((*Finder != (TCHAR)0) && (Finder <= End)) Finder++; + while ((*Finder != (wchar_t)0) && (Finder <= End)) Finder++; if (Finder >= End) return EACC_FILECOMPATIBILITY; if (Size = Finder - *Parser) @@ -269,7 +269,7 @@ DWORD ReadStringFromMemory(char **Parser, char *End, char **StoreTo) } #if defined(DEBUG_FILEREAD) || defined(DEBUG_FILEREADMESSAGES) -DWORD ReadStringFromMemoryW(WCHAR **Parser,TCHAR *End,WCHAR **StoreTo,WCHAR *DebugString) +DWORD ReadStringFromMemoryW(WCHAR **Parser,wchar_t *End,WCHAR **StoreTo,WCHAR *DebugString) { //This is the debug version of ReadStringFromMemoryW function. This version shows MessageBox where //read string is displayed @@ -327,7 +327,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT { DWORD Stat; #ifdef DEBUG_FILEREAD - TCHAR Debug[65536]; + wchar_t Debug[65536]; #endif Which->Flags = *(DWORD *)(*Parser); @@ -393,7 +393,7 @@ DWORD ReadMessagesFromMemory(HACCOUNT Which, char **Parser, char *End) do { Finder = *Parser; - while ((*Finder != (TCHAR)0) && (Finder <= End)) Finder++; + while ((*Finder != (wchar_t)0) && (Finder <= End)) Finder++; if (Finder >= End) return EACC_FILECOMPATIBILITY; if (Size = Finder - *Parser) @@ -485,7 +485,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) { DWORD Stat; #ifdef DEBUG_FILEREAD - TCHAR Debug[65536]; + wchar_t Debug[65536]; #endif //Read name of account @@ -735,7 +735,7 @@ static INT_PTR PerformAccountReading(HYAMNPROTOPLUGIN Plugin, char *MemFile, cha INT_PTR AddAccountsFromFileSvc(WPARAM wParam, LPARAM lParam) { char *MemFile, *End; - DWORD Stat = FileToMemory((TCHAR*)lParam, &MemFile, &End); + DWORD Stat = FileToMemory((wchar_t*)lParam, &MemFile, &End); if (Stat != NO_ERROR) return (INT_PTR)Stat; @@ -846,7 +846,7 @@ static INT_PTR PerformAccountWriting(HYAMNPROTOPLUGIN Plugin, HANDLE File) #ifdef DEBUG_SYNCHRO DebugLog(SynchroFile,"WriteAccountsToFile:ActualAccountSO-read enter\n"); #endif - if ((ActualAccount->Name == NULL) || (*ActualAccount->Name == (TCHAR)0)) + if ((ActualAccount->Name == NULL) || (*ActualAccount->Name == (wchar_t)0)) { #ifdef DEBUG_SYNCHRO DebugLog(SynchroFile,"WriteAccountsToFile:ActualAccountSO-read done\n"); @@ -976,7 +976,7 @@ INT_PTR WriteAccountsToFileSvc(WPARAM wParam, LPARAM lParam) HYAMNPROTOPLUGIN Plugin = (HYAMNPROTOPLUGIN)wParam; mir_cslock lck(csFileWritingCS); - HANDLE hFile = CreateFile((TCHAR*)lParam, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE hFile = CreateFile((wchar_t*)lParam, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) return EACC_SYSTEM; @@ -1226,7 +1226,7 @@ int DeleteAccounts(HYAMNPROTOPLUGIN Plugin) return 1; } -void WINAPI GetStatusFcn(HACCOUNT Which, TCHAR *Value) +void WINAPI GetStatusFcn(HACCOUNT Which, wchar_t *Value) { if (Which == NULL) return; @@ -1235,7 +1235,7 @@ void WINAPI GetStatusFcn(HACCOUNT Which, TCHAR *Value) mir_tstrcpy(Value, Which->Status); } -void WINAPI SetStatusFcn(HACCOUNT Which, TCHAR *Value) +void WINAPI SetStatusFcn(HACCOUNT Which, wchar_t *Value) { if (Which != NULL) { mir_cslock lck(csAccountStatusCS); diff --git a/plugins/YAMN/src/browser/badconnect.cpp b/plugins/YAMN/src/browser/badconnect.cpp index 80816e0704..d6e4fdf2e6 100644 --- a/plugins/YAMN/src/browser/badconnect.cpp +++ b/plugins/YAMN/src/browser/badconnect.cpp @@ -85,7 +85,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg, UINT msg, WPARAM wParam, LP DWORD ErrorCode;
char* TitleStrA;
char *Message1A = NULL;
- TCHAR *Message1W = NULL;
+ wchar_t *Message1W = NULL;
POPUPDATAT BadConnectPopup;
ActualAccount = ((struct BadConnectionParam *)lParam)->account;
@@ -125,7 +125,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg, UINT msg, WPARAM wParam, LP if (ActualAccount->Plugin->Fcn != NULL && ActualAccount->Plugin->Fcn->GetErrorStringWFcnPtr != NULL) {
Message1W = ActualAccount->Plugin->Fcn->GetErrorStringWFcnPtr(ErrorCode);
SetDlgItemText(hDlg, IDC_STATICMSG, Message1W);
- _tcsncpy_s(BadConnectPopup.lptzText, Message1W, _TRUNCATE);
+ wcsncpy_s(BadConnectPopup.lptzText, Message1W, _TRUNCATE);
if (ShowPopup)
PUAddPopupT(&BadConnectPopup);
}
@@ -133,7 +133,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg, UINT msg, WPARAM wParam, LP {
Message1W = ActualAccount->Plugin->Fcn->GetErrorStringWFcnPtr(ErrorCode);
SetDlgItemText(hDlg, IDC_STATICMSG, Message1W);
- _tcsncpy_s(BadConnectPopup.lptzText, Message1W, _TRUNCATE);
+ wcsncpy_s(BadConnectPopup.lptzText, Message1W, _TRUNCATE);
if (ShowPopup)
PUAddPopupT(&BadConnectPopup);
}
@@ -141,7 +141,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg, UINT msg, WPARAM wParam, LP {
Message1W = TranslateT("Unknown error");
SetDlgItemText(hDlg, IDC_STATICMSG, Message1W);
- _tcsncpy_s(BadConnectPopup.lptzText, Message1W, _TRUNCATE);
+ wcsncpy_s(BadConnectPopup.lptzText, Message1W, _TRUNCATE);
if (ShowPopup)
PUAddPopupT(&BadConnectPopup);
}
@@ -185,7 +185,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg, UINT msg, WPARAM wParam, LP }
return 0;
case WM_CHAR:
- switch ((TCHAR)wParam)
+ switch ((wchar_t)wParam)
{
case 27:
case 13:
@@ -257,7 +257,7 @@ void __cdecl BadConnection(void *Param) nid.hIcon = g_LoadIconEx(3);
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
nid.uCallbackMessage = WM_YAMN_NOTIFYICON;
- mir_sntprintf(nid.szTip, L"%S%s", ActualAccount->Name, TranslateT(" - connection error")); + mir_sntprintf(nid.szTip, L"%S%s", ActualAccount->Name, TranslateT(" - connection error"));
Shell_NotifyIcon(NIM_ADD, &nid);
}
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index ccd681a1d5..d768f3e363 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -177,7 +177,7 @@ typedef struct _SAMPLELISTVIEWCOLUMN int nSortType; // sorting type (STRING = 0, NUMERIC, DATE, DATETIME) int nSortOrder; // sorting order (ASCENDING = -1, NONE, DESCENDING) int nPriority; // sort priority (-1 for none, 0, 1, ..., nColumns - 1 maximum) - TCHAR lpszName[128]; // column name + wchar_t lpszName[128]; // column name } SAMPLELISTVIEWCOLUMN; // Compare priority @@ -633,12 +633,12 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D CallService(MS_KBDNOTIFY_STARTBLINK, (WPARAM)MN->Real.PopupNC + MN->Virtual.PopupNC, NULL); if ((nflags & YAMN_ACC_CONT) && (MN->Real.PopupRun + MN->Virtual.PopupRun)) { - TCHAR tszMsg[250]; + wchar_t tszMsg[250]; mir_sntprintf(tszMsg, TranslateT("%s : %d new mail message(s), %d total"), _A2T(ActualAccount->Name), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC); if (!(nflags & YAMN_ACC_CONTNOEVENT)) { - CLISTEVENT evt = {};
- evt.flags = CLEF_TCHAR;
+ CLISTEVENT evt = {}; + evt.flags = CLEF_TCHAR; evt.hContact = ActualAccount->hContact; evt.hIcon = g_LoadIconEx(2); evt.hDbEvent = ActualAccount->hContact; @@ -1268,7 +1268,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR HWND hListView = GetDlgItem(hDlg, IDC_LISTHEADERS); mir_subclassWindow(GetDlgItem(hDlg, IDC_SPLITTER), SplitterSubclassProc); SetWindowLongPtr(hDlg, DWLP_USER, (LONG_PTR)MailParam); - Window_SetIcon_IcoLib(hDlg, g_GetIconHandle(2));
+ Window_SetIcon_IcoLib(hDlg, g_GetIconHandle(2)); ListView_SetUnicodeFormat(hListView, TRUE); ListView_SetExtendedListViewStyle(hListView, LVS_EX_FULLROWSELECT); @@ -1437,11 +1437,11 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR if (From && Subj) mir_sntprintf(title, size, L"%s (%s)", Subj, From); else if (From) - _tcsncpy_s(title, size, From, _TRUNCATE); + wcsncpy_s(title, size, From, _TRUNCATE); else if (Subj) - _tcsncpy_s(title, size, Subj, _TRUNCATE); + wcsncpy_s(title, size, Subj, _TRUNCATE); else - _tcsncpy_s(title, size, L"none", _TRUNCATE); + wcsncpy_s(title, size, L"none", _TRUNCATE); if (Subj) delete[] Subj; if (From) delete[] From; SetWindowTextW(hDlg, title); @@ -1475,7 +1475,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR return (INT_PTR)GetSysColorBrush(COLOR_WINDOW); case WM_DESTROY: - Window_FreeIcon_IcoLib(hDlg);
+ Window_FreeIcon_IcoLib(hDlg); { RECT coord; if (GetWindowRect(hDlg, &coord)) { @@ -1557,7 +1557,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR if (nReturnCmd > 0) { int courRow = 0; size_t sizeNeeded = 0; - TCHAR headname[64] = { 0 }, headvalue[256] = { 0 }; + wchar_t headname[64] = { 0 }, headvalue[256] = { 0 }; for (courRow = 0; courRow < numRows; courRow++) { if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue; ListView_GetItemText(hList, courRow, 0, headname, _countof(headname)); @@ -1568,8 +1568,8 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR } if (sizeNeeded && OpenClipboard(hDlg)) { EmptyClipboard(); - HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, (sizeNeeded + 1)*sizeof(TCHAR)); - TCHAR *buff = (TCHAR*)GlobalLock(hData); + HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, (sizeNeeded + 1)*sizeof(wchar_t)); + wchar_t *buff = (wchar_t*)GlobalLock(hData); int courPos = 0; for (courRow = 0; courRow < numRows; courRow++) { if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue; @@ -1687,7 +1687,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR WindowList_Add(YAMNVar.NewMailAccountWnd, hDlg, (UINT_PTR)ActualAccount); { - TCHAR accstatus[512]; + wchar_t accstatus[512]; GetStatusFcn(ActualAccount, accstatus); SetDlgItemText(hDlg, IDC_STSTATUS, accstatus); } @@ -1706,7 +1706,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR LVCOLUMN ColInfo; HYAMNMAIL Parser; - Window_FreeIcon_IcoLib(hDlg);
+ Window_FreeIcon_IcoLib(hDlg); struct CMailWinUserInfo *mwui = (struct CMailWinUserInfo *)GetWindowLongPtr(hDlg, DWLP_USER); if (NULL == (ActualAccount = GetWindowAccount(hDlg))) @@ -1802,7 +1802,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR if ((HACCOUNT)wParam != ActualAccount) break; - TCHAR accstatus[512]; + wchar_t accstatus[512]; GetStatusFcn(ActualAccount, accstatus); SetDlgItemText(hDlg, IDC_STSTATUS, accstatus); return 1; @@ -2037,7 +2037,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR WriteDoneFcn(ActualAccount->MessagesAccessSO); if (Total) { - TCHAR DeleteMsg[1024]; + wchar_t DeleteMsg[1024]; mir_sntprintf(DeleteMsg, TranslateT("Do you really want to delete %d selected mails?"), Total); if (IDOK == MessageBox(hDlg, DeleteMsg, TranslateT("Delete confirmation"), MB_OKCANCEL | MB_ICONWARNING)) { @@ -2236,7 +2236,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR if (nReturnCmd > 0) { int courRow = 0; size_t sizeNeeded = 0; - TCHAR from[128] = { 0 }, subject[256] = { 0 }, size[16] = { 0 }, date[64] = { 0 }; + wchar_t from[128] = { 0 }, subject[256] = { 0 }, size[16] = { 0 }, date[64] = { 0 }; for (courRow = 0; courRow < numRows; courRow++) { if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue; ListView_GetItemText(hList, courRow, 0, from, _countof(from)); @@ -2247,8 +2247,8 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR } if (sizeNeeded && OpenClipboard(hDlg)) { EmptyClipboard(); - HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, (sizeNeeded + 1)*sizeof(TCHAR)); - TCHAR *buff = (TCHAR *)GlobalLock(hData); + HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, (sizeNeeded + 1)*sizeof(wchar_t)); + wchar_t *buff = (wchar_t *)GlobalLock(hData); int courPos = 0; for (courRow = 0; courRow < numRows; courRow++) { if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue; @@ -2344,7 +2344,7 @@ void __cdecl MailBrowser(void *Param) WndFound = TRUE; if ((hMailBrowser == NULL) && ((MyParam.nflags & YAMN_ACC_MSG) || (MyParam.nflags & YAMN_ACC_ICO) || (MyParam.nnflags & YAMN_ACC_MSG))) { hMailBrowser = CreateDialogParamW(YAMNVar.hInst, MAKEINTRESOURCEW(IDD_DLGVIEWMESSAGES), NULL, DlgProcYAMNMailBrowser, (LPARAM)&MyParam); - Window_SetIcon_IcoLib(hMailBrowser, g_GetIconHandle(2));
+ Window_SetIcon_IcoLib(hMailBrowser, g_GetIconHandle(2)); MoveWindow(hMailBrowser, PosX, PosY, SizeX, SizeY, TRUE); } diff --git a/plugins/YAMN/src/debug.cpp b/plugins/YAMN/src/debug.cpp index 6655ebd3a9..fcf594018d 100644 --- a/plugins/YAMN/src/debug.cpp +++ b/plugins/YAMN/src/debug.cpp @@ -14,21 +14,21 @@ //--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
-TCHAR DebugUserDirectory[MAX_PATH] = L".";
+wchar_t DebugUserDirectory[MAX_PATH] = L".";
CRITICAL_SECTION FileAccessCS;
#ifdef DEBUG_SYNCHRO
-TCHAR DebugSynchroFileName2[]=L"%s\\yamn-debug.synchro.log";
+wchar_t DebugSynchroFileName2[]=L"%s\\yamn-debug.synchro.log";
HANDLE SynchroFile;
#endif
#ifdef DEBUG_COMM
-TCHAR DebugCommFileName2[]=L"%s\\yamn-debug.comm.log";
+wchar_t DebugCommFileName2[]=L"%s\\yamn-debug.comm.log";
HANDLE CommFile;
#endif
#ifdef DEBUG_DECODE
-TCHAR DebugDecodeFileName2[]=L"%s\\yamn-debug.decode.log";
+wchar_t DebugDecodeFileName2[]=L"%s\\yamn-debug.decode.log";
HANDLE DecodeFile;
#endif
@@ -38,7 +38,7 @@ HANDLE DecodeFile; void InitDebug()
{
#if defined (DEBUG_SYNCHRO) || defined (DEBUG_COMM) || defined (DEBUG_DECODE)
- TCHAR DebugFileName[MAX_PATH];
+ wchar_t DebugFileName[MAX_PATH];
#endif
InitializeCriticalSection(&FileAccessCS);
diff --git a/plugins/YAMN/src/debug.h b/plugins/YAMN/src/debug.h index 9581117503..d902d4c8b7 100644 --- a/plugins/YAMN/src/debug.h +++ b/plugins/YAMN/src/debug.h @@ -33,7 +33,7 @@ extern HANDLE DecodeFile; #if defined(DEBUG_FILEREAD) || defined(DEBUG_FILEREADMESSAGES)
DWORD ReadStringFromMemory(char **Parser,char *End,char **StoreTo,char *DebugString);
-DWORD ReadStringFromMemoryW(char **Parser,TCHAR *End,char **StoreTo,TCHAR *DebugString);
+DWORD ReadStringFromMemoryW(char **Parser,wchar_t *End,char **StoreTo,wchar_t *DebugString);
#else
DWORD ReadStringFromMemory(char **Parser,char *End,char **StoreTo);
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index bf60915d95..230ee89486 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -12,11 +12,11 @@ //-------------------------------------------------------------------------------------------------- -TCHAR ProfileName[MAX_PATH]; -TCHAR UserDirectory[MAX_PATH]; +wchar_t ProfileName[MAX_PATH]; +wchar_t UserDirectory[MAX_PATH]; -TCHAR szMirandaDir[MAX_PATH]; -TCHAR szProfileDir[MAX_PATH]; +wchar_t szMirandaDir[MAX_PATH]; +wchar_t szProfileDir[MAX_PATH]; int YAMN_STATUS; @@ -58,10 +58,10 @@ HGENMENU hMenuItemContApp = 0; #define FIXED_TAB_SIZE 100 // default value for fixed width tabs -static void GetProfileDirectory(TCHAR *szPath, int cbPath) +static void GetProfileDirectory(wchar_t *szPath, int cbPath) //This is copied from Miranda's sources. In 0.2.1.0 it is needed, in newer vesions of Miranda use MS_DB_GETPROFILEPATH service { - TCHAR tszOldPath[MAX_PATH]; + wchar_t tszOldPath[MAX_PATH]; CallService(MS_DB_GETPROFILEPATHT, _countof(tszOldPath), (LPARAM)tszOldPath); mir_tstrcat(tszOldPath, L"\\*.book"); @@ -78,7 +78,7 @@ static void GetProfileDirectory(TCHAR *szPath, int cbPath) L"" }; SHFileOperation(&file_op); - _tcsncpy(szPath, ptszNewPath, cbPath); + wcsncpy(szPath, ptszNewPath, cbPath); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -99,13 +99,13 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) ///////////////////////////////////////////////////////////////////////////////////////// #ifdef _DEBUG -static TCHAR unknownCP[1500] = {0}; +static wchar_t unknownCP[1500] = {0}; #endif // The callback function BOOL CALLBACK EnumSystemCodePagesProc(LPTSTR cpStr) { //Convert code page string to number - UINT cp = _ttoi(cpStr); + UINT cp = _wtoi(cpStr); if (!IsValidCodePage(cp)) return TRUE; @@ -206,7 +206,7 @@ void WINAPI g_ReleaseIcon( HICON hIcon ) static void LoadPlugins() { - TCHAR szSearchPath[MAX_PATH]; + wchar_t szSearchPath[MAX_PATH]; mir_sntprintf(szSearchPath, L"%s\\Plugins\\YAMN\\*.dll", szMirandaDir); hDllPlugins = NULL; @@ -216,19 +216,19 @@ static void LoadPlugins() if (hFind != INVALID_HANDLE_VALUE) { do { //rewritten from Miranda sources... Needed because Win32 API has a bug in FindFirstFile, search is done for *.dlllllll... too - TCHAR *dot = _tcsrchr(fd.cFileName, '.'); + wchar_t *dot = wcsrchr(fd.cFileName, '.'); if (dot == NULL ) continue; // we have a dot int len = (int)mir_tstrlen(fd.cFileName); // find the length of the string - TCHAR* end = fd.cFileName+len; // get a pointer to the NULL + wchar_t* end = fd.cFileName+len; // get a pointer to the NULL int safe = (end-dot)-1; // figure out how many chars after the dot are "safe", not including NULL if ((safe != 3) || (mir_tstrcmpi(dot+1, L"dll") != 0)) //not bound, however the "dll" string should mean only 3 chars are compared continue; - TCHAR szPluginPath[MAX_PATH]; + wchar_t szPluginPath[MAX_PATH]; mir_sntprintf(szPluginPath, L"%s\\Plugins\\YAMN\\%s", szMirandaDir, fd.cFileName); HINSTANCE hDll = LoadLibrary(szPluginPath); if (hDll == NULL) @@ -269,7 +269,7 @@ extern "C" int __declspec(dllexport) Load(void) // retrieve the current profile name CallService(MS_DB_GETPROFILENAMET, (WPARAM)_countof(ProfileName), (LPARAM)ProfileName); //not to pass entire array to fcn - TCHAR *fc = _tcsrchr(ProfileName, '.'); + wchar_t *fc = wcsrchr(ProfileName, '.'); if ( fc != NULL ) *fc = 0; // we get the user path where our yamn-account.book.ini is stored from mirandaboot.ini file diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp index d4f06bed62..cd8c3121db 100644 --- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp @@ -61,7 +61,7 @@ void __cdecl DeleteMailsPOP3(void *param); //Function makes readable message about error. It sends it back to YAMN, so YAMN then
//can show it to the message window
-TCHAR* WINAPI GetErrorString(DWORD Code);
+wchar_t* WINAPI GetErrorString(DWORD Code);
//Function deletes string allocated in GetErrorString
void WINAPI DeleteErrorString(LPVOID String);
@@ -130,7 +130,7 @@ YAMN_PROTOREGISTRATION POP3ProtocolRegistration = __AUTHORWEB,
};
-static TCHAR *FileName = NULL;
+static wchar_t *FileName = NULL;
HANDLE RegisterNLClient(const char *name);
@@ -247,7 +247,7 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) //You must first register account, before using this function as YAMN must use CreatePOP3Account function to add new accounts
//But if CreatePOP3Account is not implemented (equals to NULL), YAMN creates account as YAMN's standard HACCOUNT
if (FileName) CallService(MS_YAMN_DELETEFILENAME, (WPARAM)FileName, 0); //shoud not happen (only for secure)
- FileName = (TCHAR *)CallService(MS_YAMN_GETFILENAME, (WPARAM)L"pop3", 0);
+ FileName = (wchar_t *)CallService(MS_YAMN_GETFILENAME, (WPARAM)L"pop3", 0);
switch (CallService(MS_YAMN_READACCOUNTS, (WPARAM)POP3Plugin, (LPARAM)FileName)) {
case EACC_FILEVERSION:
@@ -268,7 +268,7 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) case EACC_SYSTEM:
if (ERROR_FILE_NOT_FOUND != GetLastError())
{
- TCHAR temp[1024] = { 0 };
+ wchar_t temp[1024] = { 0 };
mir_sntprintf(temp, L"%s\n%s", TranslateT("Reading file error. File already in use?"), FileName);
MessageBox(NULL, temp, TranslateT("YAMN (internal POP3) read error"), MB_OK);
CallService(MS_YAMN_DELETEFILENAME, (WPARAM)FileName, 0);
@@ -343,7 +343,7 @@ DWORD WINAPI WritePOP3Accounts() {
DWORD ReturnValue = CallService(MS_YAMN_WRITEACCOUNTS, (WPARAM)POP3Plugin, (LPARAM)FileName);
if (ReturnValue == EACC_SYSTEM) {
- TCHAR temp[1024] = { 0 };
+ wchar_t temp[1024] = { 0 };
mir_sntprintf(temp, L"%s\n%s", TranslateT("Error while copying data to disk occurred. Is file in use?"), FileName);
MessageBox(NULL, temp, TranslateT("POP3 plugin - write file error"), MB_OK);
}
@@ -366,7 +366,7 @@ DWORD WINAPI ReadPOP3Options(HACCOUNT Which, char **Parser, char *End) {
DWORD Ver;
#ifdef DEBUG_FILEREAD
- TCHAR Debug[256];
+ wchar_t Debug[256];
#endif
Ver = *(DWORD *)(*Parser);
(*Parser) += sizeof(DWORD);
@@ -712,7 +712,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) HYAMNMAIL NewMsgsPtr = NULL;
for (NewMsgsPtr = (HYAMNMAIL)NewMails; NewMsgsPtr != NULL; NewMsgsPtr = NewMsgsPtr->Next) {
if (!mir_strcmp(MsgQueuePtr->ID, NewMsgsPtr->ID)) {
- TCHAR accstatus[512];
+ wchar_t accstatus[512];
mir_sntprintf(accstatus, TranslateT("Reading body %s"), NewMsgsPtr->ID);
SetAccountStatus(ActualAccount, accstatus);
DataRX = MyClient->Top(MsgQueuePtr->Number, 100);
@@ -780,7 +780,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) try
{
- TCHAR accstatus[512];
+ wchar_t accstatus[512];
for (i = 0, MsgQueuePtr = NewMails; MsgQueuePtr != NULL; i++)
{
@@ -1500,46 +1500,46 @@ void ExtractList(char *stream, int len, HYAMNMAIL queue) }
}
-TCHAR* WINAPI GetErrorString(DWORD Code)
+wchar_t* WINAPI GetErrorString(DWORD Code)
{
- static TCHAR *POP3Errors[] =
+ static wchar_t *POP3Errors[] =
{
- LPGENT("Memory allocation error."), //memory allocation
- LPGENT("Account is about to be stopped."), //stop account
- LPGENT("Cannot connect to POP3 server."),
- LPGENT("Cannot allocate memory for received data."),
- LPGENT("Cannot login to POP3 server."),
- LPGENT("Bad user or password."),
- LPGENT("Server does not support APOP authorization."),
- LPGENT("Error while executing POP3 command."),
- LPGENT("Error while executing POP3 command."),
- LPGENT("Error while executing POP3 command."),
+ LPGENW("Memory allocation error."), //memory allocation
+ LPGENW("Account is about to be stopped."), //stop account
+ LPGENW("Cannot connect to POP3 server."),
+ LPGENW("Cannot allocate memory for received data."),
+ LPGENW("Cannot login to POP3 server."),
+ LPGENW("Bad user or password."),
+ LPGENW("Server does not support APOP authorization."),
+ LPGENW("Error while executing POP3 command."),
+ LPGENW("Error while executing POP3 command."),
+ LPGENW("Error while executing POP3 command."),
};
- static TCHAR *NetlibErrors[] =
+ static wchar_t *NetlibErrors[] =
{
- LPGENT("Cannot connect to server with NetLib."),
- LPGENT("Cannot send data."),
- LPGENT("Cannot receive data."),
- LPGENT("Cannot allocate memory for received data."),
+ LPGENW("Cannot connect to server with NetLib."),
+ LPGENW("Cannot send data."),
+ LPGENW("Cannot receive data."),
+ LPGENW("Cannot allocate memory for received data."),
};
- static TCHAR *SSLErrors[] =
+ static wchar_t *SSLErrors[] =
{
- LPGENT("OpenSSL not loaded."),
- LPGENT("Windows socket 2.0 init failed."),
- LPGENT("DNS lookup error."),
- LPGENT("Error while creating base socket."),
- LPGENT("Error connecting to server with socket."),
- LPGENT("Error while creating SSL structure."),
- LPGENT("Error connecting socket with SSL."),
- LPGENT("Server rejected connection with SSL."),
- LPGENT("Cannot write SSL data."),
- LPGENT("Cannot read SSL data."),
- LPGENT("Cannot allocate memory for received data."),
+ LPGENW("OpenSSL not loaded."),
+ LPGENW("Windows socket 2.0 init failed."),
+ LPGENW("DNS lookup error."),
+ LPGENW("Error while creating base socket."),
+ LPGENW("Error connecting to server with socket."),
+ LPGENW("Error while creating SSL structure."),
+ LPGENW("Error connecting socket with SSL."),
+ LPGENW("Server rejected connection with SSL."),
+ LPGENW("Cannot write SSL data."),
+ LPGENW("Cannot read SSL data."),
+ LPGENW("Cannot allocate memory for received data."),
};
- TCHAR *ErrorString = new TCHAR[ERRORSTR_MAXLEN];
+ wchar_t *ErrorString = new wchar_t[ERRORSTR_MAXLEN];
POP3_ERRORCODE *ErrorCode = (POP3_ERRORCODE *)(UINT_PTR)Code;
mir_sntprintf(ErrorString, ERRORSTR_MAXLEN, TranslateT("Error %d-%d-%d-%d:"), ErrorCode->AppError, ErrorCode->POP3Error, ErrorCode->NetError, ErrorCode->SystemError);
diff --git a/plugins/YAMN/src/proto/pop3/pop3opt.cpp b/plugins/YAMN/src/proto/pop3/pop3opt.cpp index 20ae0c8eac..4e083211fd 100644 --- a/plugins/YAMN/src/proto/pop3/pop3opt.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3opt.cpp @@ -365,7 +365,7 @@ BOOL DlgShowAccount(HWND hDlg, WPARAM wParam, LPARAM lParam) int i;
if ((DWORD)wParam == M_SHOWACTUAL) {
- TCHAR accstatus[256];
+ wchar_t accstatus[256];
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
#endif
@@ -672,7 +672,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_YAMN_CHANGESTATUS:
if ((HPOP3ACCOUNT)wParam == ActualAccount) {
- TCHAR accstatus[256];
+ wchar_t accstatus[256];
GetAccountStatus(ActualAccount, accstatus);
SetDlgItemText(hDlg, IDC_STSTATUS, accstatus);
return TRUE;
@@ -686,7 +686,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_YAMN_CHANGETIME:
if ((HPOP3ACCOUNT)wParam == ActualAccount) {
- TCHAR Text[256];
+ wchar_t Text[256];
mir_sntprintf(Text, TranslateT("Time left to next check [s]: %d"), (DWORD)lParam);
SetDlgItemText(hDlg, IDC_STTIMELEFT, Text);
}
@@ -829,7 +829,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP case IDC_BTNAPP:
{
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s (*.exe;*.bat;*.cmd;*.com)%c*.exe;*.bat;*.cmd;*.com%c%s (*.*)%c*.*%c",
TranslateT("Executables"), 0, 0, TranslateT("All Files"), 0, 0);
@@ -839,8 +839,8 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP OFNStruct.lpstrFilter = filter;
OFNStruct.nFilterIndex = 1;
OFNStruct.nMaxFile = MAX_PATH;
- OFNStruct.lpstrFile = new TCHAR[MAX_PATH];
- OFNStruct.lpstrFile[0] = (TCHAR)0;
+ OFNStruct.lpstrFile = new wchar_t[MAX_PATH];
+ OFNStruct.lpstrFile[0] = (wchar_t)0;
OFNStruct.lpstrTitle = TranslateT("Select executable used for notification");
OFNStruct.Flags = OFN_FILEMUSTEXIST | OFN_NONETWORKBUTTON | OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR;
if (!GetOpenFileName(&OFNStruct)) {
@@ -1373,7 +1373,7 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
{
- TCHAR Text[MAX_PATH];
+ wchar_t Text[MAX_PATH];
BOOL Translated, CheckPopup, CheckPopupW;
BOOL CheckNPopup, CheckNPopupW, CheckFPopup, CheckFPopupW;
BOOL CheckPopN;
diff --git a/plugins/YAMN/src/protoplugin.cpp b/plugins/YAMN/src/protoplugin.cpp index e2a492d718..25e7a5a42c 100644 --- a/plugins/YAMN/src/protoplugin.cpp +++ b/plugins/YAMN/src/protoplugin.cpp @@ -175,7 +175,7 @@ INT_PTR UnregisterProtoPlugins() INT_PTR GetFileNameSvc(WPARAM wParam,LPARAM)
{
- TCHAR *FileName = new TCHAR[MAX_PATH];
+ wchar_t *FileName = new wchar_t[MAX_PATH];
if (FileName == NULL)
return NULL;
@@ -185,8 +185,8 @@ INT_PTR GetFileNameSvc(WPARAM wParam,LPARAM) INT_PTR DeleteFileNameSvc(WPARAM wParam,LPARAM)
{
- if (( TCHAR* )wParam != NULL)
- delete[] ( TCHAR* ) wParam;
+ if (( wchar_t* )wParam != NULL)
+ delete[] ( wchar_t* ) wParam;
return 0;
}
diff --git a/plugins/YAMN/src/stdafx.h b/plugins/YAMN/src/stdafx.h index 31ec1ca5dd..e932de1d2e 100644 --- a/plugins/YAMN/src/stdafx.h +++ b/plugins/YAMN/src/stdafx.h @@ -76,14 +76,14 @@ int InitAccount(HACCOUNT Which); void DeInitAccount(HACCOUNT Which);
void StopSignalFcn(HACCOUNT Which);
void CodeDecodeString(char *Dest, BOOL Encrypt);
-DWORD FileToMemory(TCHAR *FileName, char **MemFile, char **End);
+DWORD FileToMemory(wchar_t *FileName, char **MemFile, char **End);
#if defined(DEBUG_FILEREAD) || defined(DEBUG_FILEREADMESSAGES)
DWORD ReadStringFromMemory(char **Parser,char *End,char **StoreTo,char *DebugString);
#endif
DWORD ReadStringFromMemory(char **Parser, char *End, char **StoreTo);
DWORD ReadMessagesFromMemory(HACCOUNT Which, char **Parser, char *End);
-DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, TCHAR *End);
+DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, wchar_t *End);
INT_PTR AddAccountsFromFileSvc(WPARAM wParam, LPARAM lParam);
DWORD WriteStringToFile(HANDLE File, char *Source);
@@ -102,8 +102,8 @@ int StopAccounts(HYAMNPROTOPLUGIN Plugin); int WaitForAllAccounts(HYAMNPROTOPLUGIN Plugin, BOOL GetAccountBrowserAccess = FALSE);
int DeleteAccounts(HYAMNPROTOPLUGIN Plugin);
-void WINAPI GetStatusFcn(HACCOUNT Which, TCHAR *Value);
-void WINAPI SetStatusFcn(HACCOUNT Which, TCHAR *Value);
+void WINAPI GetStatusFcn(HACCOUNT Which, wchar_t *Value);
+void WINAPI SetStatusFcn(HACCOUNT Which, wchar_t *Value);
INT_PTR UnregisterProtoPlugins();
INT_PTR RegisterProtocolPluginSvc(WPARAM, LPARAM);
@@ -162,8 +162,8 @@ int PostLoad(WPARAM, LPARAM); //Executed after all plugins loaded YAMN reads int Shutdown(WPARAM, LPARAM); //Executed before Miranda is going to shutdown
int AddTopToolbarIcon(WPARAM, LPARAM); //Executed when TopToolBar plugin loaded Adds bitmap to toolbar
-extern TCHAR UserDirectory[]; //e.g. "F:\WINNT\Profiles\UserXYZ"
-extern TCHAR ProfileName[]; //e.g. "majvan"
+extern wchar_t UserDirectory[]; //e.g. "F:\WINNT\Profiles\UserXYZ"
+extern wchar_t ProfileName[]; //e.g. "majvan"
extern SWMRG *AccountBrowserSO;
extern YAMN_VARIABLES YAMNVar;
extern HANDLE hNewMailHook;
@@ -183,7 +183,7 @@ DWORD WINAPI WaitToReadFcn(PSWMRG SObject); void WINAPI ReadDoneFcn(PSWMRG SObject);
DWORD WINAPI SCIncFcn(PSCOUNTER SCounter);
DWORD WINAPI SCDecFcn(PSCOUNTER SCounter);
-BOOL WINAPI SWMRGInitialize(PSWMRG, TCHAR *);
+BOOL WINAPI SWMRGInitialize(PSWMRG, wchar_t *);
void WINAPI SWMRGDelete(PSWMRG);
DWORD WINAPI SWMRGWaitToWrite(PSWMRG pSWMRG, DWORD dwTimeout);
void WINAPI SWMRGDoneWriting(PSWMRG pSWMRG);
@@ -203,7 +203,7 @@ char *ExtractFromContentType(char *ContentType, char *value); WCHAR *ParseMultipartBody(char *src, char *bond);
//From account.cpp
-void WINAPI GetStatusFcn(HACCOUNT Which, TCHAR *Value);
+void WINAPI GetStatusFcn(HACCOUNT Which, wchar_t *Value);
extern HYAMNPROTOPLUGIN POP3Plugin;
diff --git a/plugins/YAMN/src/synchro.cpp b/plugins/YAMN/src/synchro.cpp index 6b37e151dc..e008fe9db0 100644 --- a/plugins/YAMN/src/synchro.cpp +++ b/plugins/YAMN/src/synchro.cpp @@ -14,7 +14,7 @@ // the structure's address is passed as the first parameter.
// The lpszName parameter is the name of the object. Pass
// NULL if you do not want to share the object.
-BOOL WINAPI SWMRGInitialize(PSWMRG pSWMRG,TCHAR *Name);
+BOOL WINAPI SWMRGInitialize(PSWMRG pSWMRG,wchar_t *Name);
// Deletes the system resources associated with a SWMRG
// structure. The structure must be deleted only when
@@ -98,7 +98,7 @@ void WINAPI SWMRGDelete(PSWMRG pSWMRG) CloseHandle(pSWMRG->hFinishEV);
}
-BOOL WINAPI SWMRGInitialize(PSWMRG pSWMRG,TCHAR *Name)
+BOOL WINAPI SWMRGInitialize(PSWMRG pSWMRG,wchar_t *Name)
{
pSWMRG->hEventNoWriter=NULL;
pSWMRG->hEventNoReaders=NULL;
@@ -109,25 +109,25 @@ BOOL WINAPI SWMRGInitialize(PSWMRG pSWMRG,TCHAR *Name) // no writer threads are writing.
// Initially no reader threads are reading.
if (Name != NULL)
- Name[0]=(TCHAR)'W';
+ Name[0]=(wchar_t)'W';
pSWMRG->hEventNoWriter=CreateEvent(NULL,FALSE,TRUE,Name);
// Creates the manual-reset event that is signalled when
// no reader threads are reading.
// Initially no reader threads are reading.
if (Name != NULL)
- Name[0]=(TCHAR)'R';
+ Name[0]=(wchar_t)'R';
pSWMRG->hEventNoReaders=CreateEvent(NULL,TRUE,TRUE,Name);
// Initializes the variable that indicates the number of
// reader threads that are reading.
// Initially no reader threads are reading.
if (Name != NULL)
- Name[0]=(TCHAR)'C';
+ Name[0]=(wchar_t)'C';
pSWMRG->hSemNumReaders=CreateSemaphore(NULL,0,0x7FFFFFFF,Name);
if (Name != NULL)
- Name[0]=(TCHAR)'F';
+ Name[0]=(wchar_t)'F';
pSWMRG->hFinishEV=CreateEvent(NULL,TRUE,FALSE,Name);
// If a synchronization object could not be created,
diff --git a/plugins/YAPP/src/message_pump.h b/plugins/YAPP/src/message_pump.h index a6fbb1c164..d432706822 100644 --- a/plugins/YAPP/src/message_pump.h +++ b/plugins/YAPP/src/message_pump.h @@ -19,12 +19,12 @@ struct PopupData HICON hIcon;
union {
char *pszTitle;
- TCHAR *ptzTitle;
+ wchar_t *ptzTitle;
wchar_t *pwzTitle;
};
union {
char *pszText;
- TCHAR *ptzText;
+ wchar_t *ptzText;
wchar_t *pwzText;
};
COLORREF colorBack; // if colorBack and colorText are equal, defaults will be used
diff --git a/plugins/YAPP/src/popwin.cpp b/plugins/YAPP/src/popwin.cpp index 3bfa589fb7..7bbdc6ca52 100644 --- a/plugins/YAPP/src/popwin.cpp +++ b/plugins/YAPP/src/popwin.cpp @@ -187,7 +187,7 @@ struct PopupWindowData bool custom_col;
HBRUSH bkBrush, barBrush, underlineBrush;
HPEN bPen;
- TCHAR tbuff[128];
+ wchar_t tbuff[128];
int tb_height, av_height, text_height, time_height, time_width;
int real_av_width, real_av_height;
bool have_av;
@@ -469,7 +469,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (pwd->custom_col) SetTextColor(ps.hdc, pd->colorText);
else SetTextColor(ps.hdc, colFirstLine);
- TCHAR *title = mir_u2t(pd->pwzTitle);
+ wchar_t *title = mir_u2t(pd->pwzTitle);
DrawText(ps.hdc, title, -1, &tr, DT_VCENTER | DT_LEFT | DT_END_ELLIPSIS | DT_SINGLELINE | DT_NOPREFIX);
mir_free(title);
@@ -491,7 +491,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (options.av_layout != PAV_NONE && options.time_layout == PT_WITHAV && pwd->time_height <= pwd->tb_height && !pwd->have_av)
GetClientRect(hwnd, &r);
- TCHAR *text = mir_u2t(pd->pwzText);
+ wchar_t *text = mir_u2t(pd->pwzText);
tr.left = r.left + options.padding + options.text_indent; tr.right = r.right - options.padding; tr.top = tr.bottom + options.padding; tr.bottom = r.bottom - options.padding;
DrawText(ps.hdc, text, -1, &tr, DT_NOPREFIX | DT_WORDBREAK | DT_EXTERNALLEADING | DT_TOP | DT_LEFT | DT_WORD_ELLIPSIS);
mir_free(text);
@@ -560,7 +560,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa return TRUE;
case PUM_SETTEXT:
- replaceStrT(pd->ptzText, (TCHAR*)lParam);
+ replaceStrT(pd->ptzText, (wchar_t*)lParam);
InvalidateRect(hwnd, 0, TRUE);
RepositionWindows();
return TRUE;
@@ -592,7 +592,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa // titlebar height
if (hFontFirstLine) SelectObject(hdc, (HGDIOBJ)hFontFirstLine);
- TCHAR *title = mir_u2t(pd->pwzTitle);
+ wchar_t *title = mir_u2t(pd->pwzTitle);
GetTextExtentPoint32(hdc, title, (int)mir_tstrlen(title), &size);
mir_free(title);
pwd->tb_height = size.cy;
@@ -630,7 +630,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa r.right -= pwd->time_width + options.padding;
if (hFontSecondLine) SelectObject(hdc, (HGDIOBJ)hFontSecondLine);
- TCHAR *text = mir_u2t(pd->pwzText);
+ wchar_t *text = mir_u2t(pd->pwzText);
DrawText(hdc, text, -1, &r, DT_CALCRECT | DT_NOPREFIX | DT_WORDBREAK | DT_EXTERNALLEADING | DT_TOP | DT_LEFT | DT_WORD_ELLIPSIS);
pwd->text_height = r.bottom;
mir_free(text);
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp index c77273cb5b..8b74676a1b 100644 --- a/plugins/YAPP/src/services.cpp +++ b/plugins/YAPP/src/services.cpp @@ -195,11 +195,11 @@ void UpdateMenu() {
bool isEnabled = db_get_b(0, "Popup", "ModuleIsEnabled", 1) == 1;
if (isEnabled) {
- Menu_ModifyItem(hMenuItem, LPGENT("Disable Popups"), IcoLib_GetIcon(ICO_POPUP_ON));
+ Menu_ModifyItem(hMenuItem, LPGENW("Disable Popups"), IcoLib_GetIcon(ICO_POPUP_ON));
Menu_ModifyItem(hMenuRoot, NULL, IcoLib_GetIcon(ICO_POPUP_ON));
}
else {
- Menu_ModifyItem(hMenuItem, LPGENT("Enable Popups"), IcoLib_GetIcon(ICO_POPUP_OFF));
+ Menu_ModifyItem(hMenuItem, LPGENW("Enable Popups"), IcoLib_GetIcon(ICO_POPUP_OFF));
Menu_ModifyItem(hMenuRoot, NULL, IcoLib_GetIcon(ICO_POPUP_OFF));
}
@@ -291,7 +291,7 @@ static INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam) POPUPDATAT pd = {0};
mir_tstrcpy(pd.lptzContactName, lParam == SM_WARNING ? L"Warning" : L"Notification");
pd.lchIcon = LoadIcon(0, lParam == SM_WARNING ? IDI_WARNING : IDI_INFORMATION);
- _tcsncpy(pd.lptzText, _A2T((char *)wParam), MAX_SECONDLINE); pd.lptzText[MAX_SECONDLINE-1] = 0;
+ wcsncpy(pd.lptzText, _A2T((char *)wParam), MAX_SECONDLINE); pd.lptzText[MAX_SECONDLINE-1] = 0;
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&pd, 0);
}
return 0;
diff --git a/plugins/YAPP/src/yapp.cpp b/plugins/YAPP/src/yapp.cpp index 9b64c9803b..06ce6610fd 100644 --- a/plugins/YAPP/src/yapp.cpp +++ b/plugins/YAPP/src/yapp.cpp @@ -94,8 +94,8 @@ static void InitFonts() {
font_id_firstline.cbSize = sizeof(FontIDT);
font_id_firstline.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(font_id_firstline.group, LPGENT("Popups"));
- mir_tstrcpy(font_id_firstline.name, LPGENT("First line"));
+ mir_tstrcpy(font_id_firstline.group, LPGENW("Popups"));
+ mir_tstrcpy(font_id_firstline.name, LPGENW("First line"));
mir_strcpy(font_id_firstline.dbSettingsGroup, MODULE);
mir_strcpy(font_id_firstline.prefix, "FontFirst");
mir_tstrcpy(font_id_firstline.backgroundGroup, L"Popups");
@@ -105,8 +105,8 @@ static void InitFonts() font_id_secondline.cbSize = sizeof(FontIDT);
font_id_secondline.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(font_id_secondline.group, LPGENT("Popups"));
- mir_tstrcpy(font_id_secondline.name, LPGENT("Second line"));
+ mir_tstrcpy(font_id_secondline.group, LPGENW("Popups"));
+ mir_tstrcpy(font_id_secondline.name, LPGENW("Second line"));
mir_strcpy(font_id_secondline.dbSettingsGroup, MODULE);
mir_strcpy(font_id_secondline.prefix, "FontSecond");
mir_tstrcpy(font_id_secondline.backgroundGroup, L"Popups");
@@ -116,8 +116,8 @@ static void InitFonts() font_id_time.cbSize = sizeof(FontIDT);
font_id_time.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(font_id_time.group, LPGENT("Popups"));
- mir_tstrcpy(font_id_time.name, LPGENT("Time"));
+ mir_tstrcpy(font_id_time.group, LPGENW("Popups"));
+ mir_tstrcpy(font_id_time.name, LPGENW("Time"));
mir_strcpy(font_id_time.dbSettingsGroup, MODULE);
mir_strcpy(font_id_time.prefix, "FontTime");
mir_tstrcpy(font_id_time.backgroundGroup, L"Popups");
@@ -126,8 +126,8 @@ static void InitFonts() FontRegisterT(&font_id_time);
colour_id_bg.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colour_id_bg.group, LPGENT("Popups"));
- mir_tstrcpy(colour_id_bg.name, LPGENT("Background"));
+ mir_tstrcpy(colour_id_bg.group, LPGENW("Popups"));
+ mir_tstrcpy(colour_id_bg.name, LPGENW("Background"));
mir_strcpy(colour_id_bg.dbSettingsGroup, MODULE);
mir_strcpy(colour_id_bg.setting, "ColourBg");
colour_id_bg.defcolour = GetSysColor(COLOR_3DSHADOW);
@@ -135,8 +135,8 @@ static void InitFonts() ColourRegisterT(&colour_id_bg);
colour_id_border.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colour_id_border.group, LPGENT("Popups"));
- mir_tstrcpy(colour_id_border.name, LPGENT("Border"));
+ mir_tstrcpy(colour_id_border.group, LPGENW("Popups"));
+ mir_tstrcpy(colour_id_border.name, LPGENW("Border"));
mir_strcpy(colour_id_border.dbSettingsGroup, MODULE);
mir_strcpy(colour_id_border.setting, "ColourBorder");
colour_id_border.defcolour = RGB(0, 0, 0);
@@ -144,8 +144,8 @@ static void InitFonts() ColourRegisterT(&colour_id_border);
colour_id_sidebar.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colour_id_sidebar.group, LPGENT("Popups"));
- mir_tstrcpy(colour_id_sidebar.name, LPGENT("Sidebar"));
+ mir_tstrcpy(colour_id_sidebar.group, LPGENW("Popups"));
+ mir_tstrcpy(colour_id_sidebar.name, LPGENW("Sidebar"));
mir_strcpy(colour_id_sidebar.dbSettingsGroup, MODULE);
mir_strcpy(colour_id_sidebar.setting, "ColourSidebar");
colour_id_sidebar.defcolour = RGB(128, 128, 128);
@@ -153,8 +153,8 @@ static void InitFonts() ColourRegisterT(&colour_id_sidebar);
colour_id_titleunderline.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colour_id_titleunderline.group, LPGENT("Popups"));
- mir_tstrcpy(colour_id_titleunderline.name, LPGENT("Title underline"));
+ mir_tstrcpy(colour_id_titleunderline.group, LPGENW("Popups"));
+ mir_tstrcpy(colour_id_titleunderline.name, LPGENW("Title underline"));
mir_strcpy(colour_id_titleunderline.dbSettingsGroup, MODULE);
mir_strcpy(colour_id_titleunderline.setting, "ColourTitleUnderline");
colour_id_titleunderline.defcolour = GetSysColor(COLOR_3DSHADOW);
@@ -168,7 +168,7 @@ void InitMenuItems(void) {
bool isEnabled = db_get_b(0, "Popup", "ModuleIsEnabled", 1) == 1;
- hMenuRoot = Menu_CreateRoot(MO_MAIN, LPGENT("Popups"), 500010000, IcoLib_GetIcon(isEnabled ? ICO_POPUP_ON : ICO_POPUP_OFF, 0));
+ hMenuRoot = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 500010000, IcoLib_GetIcon(isEnabled ? ICO_POPUP_ON : ICO_POPUP_OFF, 0));
Menu_ConfigureItem(hMenuRoot, MCI_OPT_UID, "043A641A-2767-4C57-AA57-9233D6F9DC54");
CMenuItem mi;
@@ -178,13 +178,13 @@ void InitMenuItems(void) SET_UID(mi, 0x92c386ae, 0x6e81, 0x452d, 0xb5, 0x71, 0x87, 0x46, 0xe9, 0x2, 0x66, 0xe9);
mi.hIcolibItem = IcoLib_GetIcon(ICO_HISTORY, 0);
mi.pszService= MS_POPUP_SHOWHISTORY;
- mi.name.t = LPGENT("Popup History");
+ mi.name.w = LPGENW("Popup History");
hMenuItemHistory = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x4353d44e, 0x177, 0x4843, 0x88, 0x30, 0x25, 0x5d, 0x91, 0xad, 0xdf, 0x3f);
mi.hIcolibItem = IcoLib_GetIcon(isEnabled ? ICO_POPUP_ON : ICO_POPUP_OFF, 0);
mi.pszService = "Popup/EnableDisableMenuCommand";
- mi.name.t = (isEnabled ? LPGENT("Disable Popups") : LPGENT("Enable Popups"));
+ mi.name.w = (isEnabled ? LPGENW("Disable Popups") : LPGENW("Enable Popups"));
hMenuItem = Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/YAPP/src/yapp_history.h b/plugins/YAPP/src/yapp_history.h index c07c32f2ae..ff13d28b34 100644 --- a/plugins/YAPP/src/yapp_history.h +++ b/plugins/YAPP/src/yapp_history.h @@ -39,12 +39,12 @@ struct PopupHistoryData{ union{ char *message; wchar_t *messageW; - TCHAR *messageT; + wchar_t *messageT; }; union{ char *title; wchar_t *titleW; - TCHAR *titleT; + wchar_t *titleT; }; time_t timestamp; }; diff --git a/plugins/YAPP/src/yapp_history_dlg.cpp b/plugins/YAPP/src/yapp_history_dlg.cpp index 67a1fcaa14..535b4a7ee5 100644 --- a/plugins/YAPP/src/yapp_history_dlg.cpp +++ b/plugins/YAPP/src/yapp_history_dlg.cpp @@ -16,7 +16,7 @@ HWND hHistoryWindow = 0; //the history window
PopupHistoryList lstPopupHistory; //defined in main.cpp
-const TCHAR *szHistoryColumns[] = {L"Title", L"Message", L"Timestamp"}; //need to make sure that the string and size vectors have the same number of elements
+const wchar_t *szHistoryColumns[] = {L"Title", L"Message", L"Timestamp"}; //need to make sure that the string and size vectors have the same number of elements
const int cxHistoryColumns[] = {100, 450, 115};
const int cHistoryColumns = sizeof(szHistoryColumns) / sizeof(szHistoryColumns[0]);
@@ -118,59 +118,59 @@ struct SortParams{ static int lastColumn = -1; //last sort column
-int MatchesFilterCS(const TCHAR *filter, const PopupHistoryData *popupItem) //case sensitive
+int MatchesFilterCS(const wchar_t *filter, const PopupHistoryData *popupItem) //case sensitive
{
if (mir_tstrlen(filter) <= 0) { return 1; } //if no filter is set then the popup item matches the filter
int match = 0;
- match = (_tcsstr(popupItem->messageT, filter)) ? 1 : match; //check message part
+ match = (wcsstr(popupItem->messageT, filter)) ? 1 : match; //check message part
if (!match) //check title part of no match has been found
{
- match = (_tcsstr(popupItem->titleT, filter)) ? 1 : match;
+ match = (wcsstr(popupItem->titleT, filter)) ? 1 : match;
}
if (!match) //if no match has been found yet try to match the timestamp
{
- TCHAR buffer[1024];
+ wchar_t buffer[1024];
struct tm *myTime = localtime(&popupItem->timestamp);
- _tcsftime(buffer, 1024, L"%c", myTime);
- match = (_tcsstr(buffer, filter)) ? 1 : match;
+ wcsftime(buffer, 1024, L"%c", myTime);
+ match = (wcsstr(buffer, filter)) ? 1 : match;
}
return match;
}
-__inline void ConvertCase(TCHAR *dest, const TCHAR *source, size_t size)
+__inline void ConvertCase(wchar_t *dest, const wchar_t *source, size_t size)
{
- _tcsncpy(dest, source, size);
- _tcslwr(dest);
+ wcsncpy(dest, source, size);
+ wcslwr(dest);
}
-int MatchesFilterCI(const TCHAR *filterS, const PopupHistoryData *popupItem)
+int MatchesFilterCI(const wchar_t *filterS, const PopupHistoryData *popupItem)
{
if (mir_tstrlen(filterS) <= 0) { return 1; } //if no filter is set then the popup item matches the filter
int match = 0;
const int BUFFER_SIZE = 1024;
- TCHAR buffer[BUFFER_SIZE];
- TCHAR filterI[BUFFER_SIZE];
+ wchar_t buffer[BUFFER_SIZE];
+ wchar_t filterI[BUFFER_SIZE];
ConvertCase(filterI, filterS, BUFFER_SIZE);
ConvertCase(buffer, popupItem->messageT, BUFFER_SIZE); //check message part
- match = (_tcsstr(buffer, filterI)) ? 1 : match;
+ match = (wcsstr(buffer, filterI)) ? 1 : match;
if (!match) // check title part of no match has been found
{
ConvertCase(buffer, popupItem->titleT, BUFFER_SIZE);
- match = (_tcsstr(buffer, filterI)) ? 1 : match;
+ match = (wcsstr(buffer, filterI)) ? 1 : match;
}
if (!match) //if no match has been found yet try to match the timestamp
{
struct tm *myTime = localtime(&popupItem->timestamp);
- _tcsftime(buffer, 1024, L"%c", myTime);
- match = (_tcsstr(buffer, filterI)) ? 1 : match;
+ wcsftime(buffer, 1024, L"%c", myTime);
+ match = (wcsstr(buffer, filterI)) ? 1 : match;
}
return match;
@@ -180,8 +180,8 @@ int CALLBACK PopupsCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam) {
SortParams params = *(SortParams *) myParam;
const int MAX_SIZE = 512;
- TCHAR text1[MAX_SIZE];
- TCHAR text2[MAX_SIZE];
+ wchar_t text1[MAX_SIZE];
+ wchar_t text2[MAX_SIZE];
int res;
ListView_GetItemText(params.hList, (int) lParam1, params.column, text1, _countof(text1));
@@ -323,8 +323,8 @@ void DeleteOldEvents(HWND hWnd, int renderer) }
}
-typedef int (*SIG_MATCHESFILTER)(const TCHAR *filter, const PopupHistoryData *popupItem);
-typedef void (*SIG_ADDEVENTS)(HWND hWnd, int renderer, TCHAR *filter, SIG_MATCHESFILTER MatchesFilter);
+typedef int (*SIG_MATCHESFILTER)(const wchar_t *filter, const PopupHistoryData *popupItem);
+typedef void (*SIG_ADDEVENTS)(HWND hWnd, int renderer, wchar_t *filter, SIG_MATCHESFILTER MatchesFilter);
IEVIEWEVENTDATA *CreateAndFillEventData(PopupHistoryData *popupItem)
{
@@ -345,7 +345,7 @@ IEVIEWEVENTDATA *CreateAndFillEventData(PopupHistoryData *popupItem) return eventData;
}
-void AddEventsCustomControl(HWND hWnd, int renderer, TCHAR *filter, SIG_MATCHESFILTER MatchesFilter)
+void AddEventsCustomControl(HWND hWnd, int renderer, wchar_t *filter, SIG_MATCHESFILTER MatchesFilter)
{
PopupHistoryWindowData *pwData = (PopupHistoryWindowData *) GetWindowLongPtr(hWnd, GWLP_USERDATA);
if (pwData)
@@ -401,10 +401,10 @@ void AddEventsCustomControl(HWND hWnd, int renderer, TCHAR *filter, SIG_MATCHESF }
}
-void AddEventsDefault(HWND hWnd, int, TCHAR *filter, SIG_MATCHESFILTER MatchesFilter)
+void AddEventsDefault(HWND hWnd, int, wchar_t *filter, SIG_MATCHESFILTER MatchesFilter)
{
HWND hHistoryList = GetDlgItem(hWnd, IDC_LST_HISTORY);
- TCHAR buffer[1024];
+ wchar_t buffer[1024];
struct tm *myTime;
LVITEM item = {0};
@@ -423,7 +423,7 @@ void AddEventsDefault(HWND hWnd, int, TCHAR *filter, SIG_MATCHESFILTER MatchesFi ListView_InsertItem(hHistoryList, &item);
ListView_SetItemText(hHistoryList, lIndex, 1, popupItem->messageT);
myTime = localtime(&popupItem->timestamp);
- _tcsftime(buffer, 1024, L"%c", myTime);
+ wcsftime(buffer, 1024, L"%c", myTime);
ListView_SetItemText(hHistoryList, lIndex++, 2, buffer);
}
}
@@ -437,7 +437,7 @@ void RefreshPopupHistory(HWND hWnd, int renderer) SIG_ADDEVENTS AddEvents = (renderer == RENDER_DEFAULT) ? AddEventsDefault : AddEventsCustomControl;
- TCHAR filter[MAX_FILTER_SIZE];
+ wchar_t filter[MAX_FILTER_SIZE];
DeleteOldEvents(hWnd, renderer); //delete events
GetDlgItemText(hWnd, IDC_HISTORY_FILTER, filter, _countof(filter)); //get filter text
@@ -466,9 +466,9 @@ void CopyPopupDataToClipboard(HWND hList, int selection) {
if (OpenClipboard(hList))
{
- TCHAR buffer[2048];
- buffer[0] = _T('\0');
- TCHAR *clipboard;
+ wchar_t buffer[2048];
+ buffer[0] = '\0';
+ wchar_t *clipboard;
int i;
int found = 0;
int count = ListView_GetItemCount(hList);
@@ -491,10 +491,10 @@ void CopyPopupDataToClipboard(HWND hList, int selection) EmptyClipboard();
int len = (int)mir_tstrlen(buffer);
- HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, (len + 2) * sizeof(TCHAR));
- clipboard = (TCHAR *) GlobalLock(hData);
- _tcsncpy(clipboard, buffer, len);
- clipboard[len] = _T('\0');
+ HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, (len + 2) * sizeof(wchar_t));
+ clipboard = (wchar_t *) GlobalLock(hData);
+ wcsncpy(clipboard, buffer, len);
+ clipboard[len] = '\0';
GlobalUnlock(hData);
if (!SetClipboardData(textType, hData))
{
diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp index 96d331ceea..f611fce2f5 100644 --- a/plugins/YARelay/src/main.cpp +++ b/plugins/YARelay/src/main.cpp @@ -26,7 +26,7 @@ HINSTANCE hInst; int hLangpack;
MCONTACT hForwardFrom, hForwardTo;
-TCHAR tszForwardTemplate[MAXTEMPLATESIZE];
+wchar_t tszForwardTemplate[MAXTEMPLATESIZE];
int iSplit, iSplitMaxSize, iSendParts, iMarkRead, iSendAndHistory, iForwardOnStatus;
LIST<MESSAGE_PROC> arMessageProcs(10, HandleKeySortT);
@@ -141,7 +141,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDBEvent) continue;
}
- TCHAR buf[100];
+ wchar_t buf[100];
switch(*++p) {
case 'u':
case 'U':
@@ -153,7 +153,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDBEvent) {
ptrT id(Contact_GetInfo(CNF_UNIQUEID, NULL));
if (id != NULL)
- _tcsncpy_s(buf, id, _TRUNCATE);
+ wcsncpy_s(buf, id, _TRUNCATE);
else
mir_sntprintf(buf, L"%p", hContact);
}
@@ -162,13 +162,13 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDBEvent) case 't':
case 'T':
- _tcsftime(buf, 10, L"%H:%M", tm_time);
+ wcsftime(buf, 10, L"%H:%M", tm_time);
szUtfMsg.append(T2Utf(buf));
break;
case 'd':
case 'D':
- _tcsftime(buf, 12, L"%d/%m/%Y", tm_time);
+ wcsftime(buf, 12, L"%d/%m/%Y", tm_time);
szUtfMsg.append(T2Utf(buf));
break;
@@ -230,12 +230,12 @@ extern "C" int __declspec(dllexport) Load() iForwardOnStatus = db_get_dw(NULL, "yaRelay", "ForwardOnStatus", STATUS_OFFLINE | STATUS_AWAY | STATUS_NA);
- TCHAR *szForwardTemplate = db_get_tsa(NULL, "yaRelay", "ForwardTemplate");
+ wchar_t *szForwardTemplate = db_get_tsa(NULL, "yaRelay", "ForwardTemplate");
if (szForwardTemplate){
- _tcsncpy(tszForwardTemplate, szForwardTemplate, _countof(tszForwardTemplate));
+ wcsncpy(tszForwardTemplate, szForwardTemplate, _countof(tszForwardTemplate));
mir_free(szForwardTemplate);
}
- else _tcsncpy(tszForwardTemplate, L"%u: %m", MAXTEMPLATESIZE-1);
+ else wcsncpy(tszForwardTemplate, L"%u: %m", MAXTEMPLATESIZE-1);
iSplit = db_get_dw(NULL, "yaRelay", "Split", 0);
iSplitMaxSize = db_get_dw(NULL, "yaRelay", "SplitMaxSize", 100);
diff --git a/plugins/YARelay/src/options.cpp b/plugins/YARelay/src/options.cpp index 198905d6e1..66a00bbe04 100644 --- a/plugins/YARelay/src/options.cpp +++ b/plugins/YARelay/src/options.cpp @@ -69,7 +69,7 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, SendDlgItemMessage(hwndDlg, IDC_COMBO_TO, CB_SETCURSEL, (WPARAM)idx, 0);
for (hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- TCHAR *ptszNick = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *ptszNick = pcli->pfnGetContactDisplayName(hContact, 0);
if (ptszNick){
idx = SendDlgItemMessage(hwndDlg, IDC_COMBO_TO, CB_ADDSTRING, 0, (LPARAM)ptszNick);
SendDlgItemMessage(hwndDlg, IDC_COMBO_TO, CB_SETITEMDATA, (WPARAM)idx, hContact);
diff --git a/plugins/YARelay/src/stdafx.h b/plugins/YARelay/src/stdafx.h index 01a6ff2792..eef4c08ce8 100644 --- a/plugins/YARelay/src/stdafx.h +++ b/plugins/YARelay/src/stdafx.h @@ -47,7 +47,7 @@ Features: extern HINSTANCE hInst;
extern MCONTACT hForwardFrom, hForwardTo;
-extern TCHAR tszForwardTemplate[MAXTEMPLATESIZE];
+extern wchar_t tszForwardTemplate[MAXTEMPLATESIZE];
extern int iSplit, iSplitMaxSize, iSendParts, iMarkRead, iSendAndHistory, iForwardOnStatus;
struct MESSAGE_PROC
diff --git a/plugins/YahooGroups/src/hooked_events.cpp b/plugins/YahooGroups/src/hooked_events.cpp index 19efd4ffda..774537e696 100644 --- a/plugins/YahooGroups/src/hooked_events.cpp +++ b/plugins/YahooGroups/src/hooked_events.cpp @@ -55,8 +55,8 @@ int OnOptionsInitialise(WPARAM wParam, LPARAM) odp.position = 100000000;
odp.hInstance = hInstance;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.ptszTitle = LPGENT("Yahoo Groups");
- odp.ptszGroup = LPGENT("Plugins");
+ odp.pwszTitle = LPGENW("Yahoo Groups");
+ odp.pwszGroup = LPGENW("Plugins");
odp.groupPosition = 810000000;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = DlgProcOptions;
diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp index b33d7d888f..57ac86c10c 100644 --- a/plugins/YahooGroups/src/utils.cpp +++ b/plugins/YahooGroups/src/utils.cpp @@ -34,14 +34,14 @@ int Info(char *title, char *format, ...) return MessageBoxA(0, str, title, MB_OK | MB_ICONINFORMATION);
}
-int MyPUShowMessage(TCHAR *lpzText, BYTE kind)
+int MyPUShowMessage(wchar_t *lpzText, BYTE kind)
{
if (ServiceExists(MS_POPUP_SHOWMESSAGE))
{
return PUShowMessageT(lpzText, kind);
}
else{
- TCHAR *title = (kind == SM_NOTIFY) ? TranslateT("Notify") : TranslateT("Warning");
+ wchar_t *title = (kind == SM_NOTIFY) ? TranslateT("Notify") : TranslateT("Warning");
return MessageBox(NULL, lpzText, title, MB_OK | (kind == SM_NOTIFY) ? MB_ICONINFORMATION : MB_ICONEXCLAMATION);
}
@@ -158,10 +158,10 @@ int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, return GetStringFromDatabase(NULL, ModuleName, szSettingName, szError, szResult, count);
}
-TCHAR* GetContactName(MCONTACT hContact, char *szProto)
+wchar_t* GetContactName(MCONTACT hContact, char *szProto)
{
ptrT id(Contact_GetInfo(CNF_DISPLAYUID, hContact, szProto));
- return (id != NULL) ? _tcsdup(id) : NULL;
+ return (id != NULL) ? wcsdup(id) : NULL;
}
void GetContactProtocol(MCONTACT hContact, char *szProto, int size)
@@ -169,7 +169,7 @@ void GetContactProtocol(MCONTACT hContact, char *szProto, int size) GetStringFromDatabase(hContact, "Protocol", "p", NULL, szProto, size);
}
-TCHAR *GetContactID(MCONTACT hContact)
+wchar_t *GetContactID(MCONTACT hContact)
{
char protocol[256];
GetContactProtocol(hContact, protocol, sizeof(protocol));
@@ -177,18 +177,18 @@ TCHAR *GetContactID(MCONTACT hContact) return GetContactID(hContact, protocol);
}
-TCHAR* GetContactID(MCONTACT hContact, char *szProto)
+wchar_t* GetContactID(MCONTACT hContact, char *szProto)
{
ptrT id(Contact_GetInfo(CNF_DISPLAY, hContact, szProto));
- return (id != NULL) ? _tcsdup(id) : NULL;
+ return (id != NULL) ? wcsdup(id) : NULL;
}
-MCONTACT GetContactFromID(TCHAR *szID, char *szProto)
+MCONTACT GetContactFromID(wchar_t *szID, char *szProto)
{
- TCHAR *szHandle;
- TCHAR dispName[1024];
+ wchar_t *szHandle;
+ wchar_t dispName[1024];
char cProtocol[256];
- TCHAR *tmp;
+ wchar_t *tmp;
int found = 0;
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
@@ -196,7 +196,7 @@ MCONTACT GetContactFromID(TCHAR *szID, char *szProto) szHandle = GetContactID(hContact, cProtocol);
tmp = pcli->pfnGetContactDisplayName(hContact, 0);
- _tcsncpy(dispName, tmp, _countof(dispName));
+ wcsncpy(dispName, tmp, _countof(dispName));
if ((szHandle) && ((mir_tstrcmpi(szHandle, szID) == 0) || (mir_tstrcmpi(dispName, szID) == 0)) && ((szProto == NULL) || (_stricmp(szProto, cProtocol) == 0)))
found = 1;
@@ -212,7 +212,7 @@ MCONTACT GetContactFromID(TCHAR *szID, char *szProto) #pragma warning (default: 4312)
#pragma warning (disable: 4312)
-MCONTACT GetContactFromID(TCHAR *szID, wchar_t *szProto)
+MCONTACT GetContactFromID(wchar_t *szID, wchar_t *szProto)
{
char protocol[1024];
WideCharToMultiByte(CP_ACP, 0, szProto, -1, protocol, sizeof(protocol), NULL, NULL);
diff --git a/plugins/YahooGroups/src/utils.h b/plugins/YahooGroups/src/utils.h index 8269e2c61c..fc94116254 100644 --- a/plugins/YahooGroups/src/utils.h +++ b/plugins/YahooGroups/src/utils.h @@ -44,11 +44,11 @@ int GetStringFromDatabase(MCONTACT hContact, char *szModule, char *szSettingName int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, int size);
int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, int count);
-TCHAR *GetContactName(MCONTACT hContact, char *szProto);
-TCHAR *GetContactID(MCONTACT hContact);
-TCHAR *GetContactID(MCONTACT hContact, char *szProto);
-MCONTACT GetContactFromID(TCHAR *szID, char *szProto);
-MCONTACT GetContactFromID(TCHAR *szID, wchar_t *szProto);
+wchar_t *GetContactName(MCONTACT hContact, char *szProto);
+wchar_t *GetContactID(MCONTACT hContact);
+wchar_t *GetContactID(MCONTACT hContact, char *szProto);
+MCONTACT GetContactFromID(wchar_t *szID, char *szProto);
+MCONTACT GetContactFromID(wchar_t *szID, wchar_t *szProto);
void GetContactProtocol(MCONTACT hContact, char *szProto, int size);
int MyPUShowMessage(char *lpzText, BYTE kind);
diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp index eafa43a031..c2e11e5c54 100644 --- a/plugins/ZeroNotification/src/main.cpp +++ b/plugins/ZeroNotification/src/main.cpp @@ -20,7 +20,7 @@ int hLangpack; struct CheckBoxValues_t
{
DWORD style;
- TCHAR *szDescr;
+ wchar_t *szDescr;
};
static const struct CheckBoxValues_t statusValues[] = {
@@ -208,8 +208,8 @@ static int OptionsInitialize(WPARAM wParam, LPARAM) odp.hInstance = hInst;
odp.flags = ODPF_TCHAR;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NOSOUND);
- odp.ptszTitle = LPGENT("Zero Notifications");
- odp.ptszGroup = LPGENT("Plugins");
+ odp.pwszTitle = LPGENW("Zero Notifications");
+ odp.pwszGroup = LPGENW("Plugins");
odp.groupPosition = 100000000;
odp.pfnDlgProc = DlgProcNoSoundOpts;
Options_AddPage(wParam, &odp);
diff --git a/plugins/ZeroNotification/src/stdafx.h b/plugins/ZeroNotification/src/stdafx.h index f881395cb5..bd1e1dc792 100644 --- a/plugins/ZeroNotification/src/stdafx.h +++ b/plugins/ZeroNotification/src/stdafx.h @@ -17,6 +17,6 @@ #define DEFAULT_NOBLINK 0x00000000
#define DEFAULT_NOCLCBLINK 0x00000000
-#define DISABLE_SOUND LPGENT("Disable &Sounds")
-#define ENABLE_SOUND LPGENT("Enable &Sounds")
+#define DISABLE_SOUND LPGENW("Disable &Sounds")
+#define ENABLE_SOUND LPGENW("Enable &Sounds")
diff --git a/plugins/ZeroSwitch/src/stdafx.h b/plugins/ZeroSwitch/src/stdafx.h index f5502963ee..b2583c407e 100644 --- a/plugins/ZeroSwitch/src/stdafx.h +++ b/plugins/ZeroSwitch/src/stdafx.h @@ -6,7 +6,6 @@ #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
-#include <tchar.h>
#include <newpluginapi.h>
#include <m_clist.h>
diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp index e2806a5a0c..41f4f20276 100644 --- a/plugins/helpers/gen_helpers.cpp +++ b/plugins/helpers/gen_helpers.cpp @@ -20,7 +20,7 @@ #include "commonheaders.h"
#include "gen_helpers.h"
-TCHAR *Hlp_GetProtocolName(const char *proto) {
+wchar_t *Hlp_GetProtocolName(const char *proto) {
char protoname[256];
if ((!ProtoServiceExists(proto, PS_GETNAME)) || (CallProtoService(proto, PS_GETNAME, (WPARAM)sizeof(protoname), (LPARAM)protoname)))
@@ -30,27 +30,27 @@ TCHAR *Hlp_GetProtocolName(const char *proto) { }
-TCHAR *Hlp_GetDlgItemText(HWND hwndDlg, int nIDDlgItem) {
+wchar_t *Hlp_GetDlgItemText(HWND hwndDlg, int nIDDlgItem) {
int len = SendDlgItemMessage(hwndDlg, nIDDlgItem, WM_GETTEXTLENGTH, 0, 0);
if (len < 0)
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
- memset(res, 0, ((len + 1) * sizeof(TCHAR)));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
+ memset(res, 0, ((len + 1) * sizeof(wchar_t)));
GetDlgItemText(hwndDlg, nIDDlgItem, res, len + 1);
return res;
}
-TCHAR *Hlp_GetWindowText(HWND hwndDlg)
+wchar_t *Hlp_GetWindowText(HWND hwndDlg)
{
int len = GetWindowTextLength(hwndDlg);
if (len < 0)
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
- memset(res, 0, ((len + 1) * sizeof(TCHAR)));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
+ memset(res, 0, ((len + 1) * sizeof(wchar_t)));
GetWindowText(hwndDlg, res, len + 1);
return res;
@@ -94,11 +94,11 @@ int AddDebugLogMessageA(const char* fmt, ...) return res;
}
-int AddDebugLogMessage(const TCHAR* fmt, ...)
+int AddDebugLogMessage(const wchar_t* fmt, ...)
{
int res;
- TCHAR tszText[MAX_DEBUG], tszFinal[MAX_DEBUG];
+ wchar_t tszText[MAX_DEBUG], tszFinal[MAX_DEBUG];
char *szFinal;
va_list va;
@@ -108,7 +108,7 @@ int AddDebugLogMessage(const TCHAR* fmt, ...) #ifdef MODULENAME
mir_sntprintf(tszFinal, L"%s: %s", MODULENAME, tszText);
#else
- _tcsncpy(tszFinal, tszText, _countof(tszFinal));
+ wcsncpy(tszFinal, tszText, _countof(tszFinal));
#endif
@@ -120,15 +120,15 @@ int AddDebugLogMessage(const TCHAR* fmt, ...) return res;
}
-int ttoi(TCHAR *string)
+int ttoi(wchar_t *string)
{
- return (string == NULL) ? 0 : _ttoi(string);
+ return (string == NULL) ? 0 : _wtoi(string);
}
-TCHAR *itot(int num)
+wchar_t *itot(int num)
{
- TCHAR tRes[32];
+ wchar_t tRes[32];
// check this
- _itot(num, tRes, 10);
+ _itow(num, tRes, 10);
return mir_tstrdup(tRes);
}
diff --git a/plugins/mTextControl/src/FormattedTextDraw.cpp b/plugins/mTextControl/src/FormattedTextDraw.cpp index 8bce9290e3..61bd51534a 100644 --- a/plugins/mTextControl/src/FormattedTextDraw.cpp +++ b/plugins/mTextControl/src/FormattedTextDraw.cpp @@ -120,7 +120,7 @@ HRESULT CFormattedTextDraw::putTextA(char *newVal) cf.cbSize = sizeof(cf);
cf.dwMask = CFM_FACE | CFM_BOLD;
cf.dwEffects = 0;
- _tcsncpy_s(cf.szFaceName, L"MS Shell Dlg", _TRUNCATE);
+ wcsncpy_s(cf.szFaceName, L"MS Shell Dlg", _TRUNCATE);
m_spTextServices->TxSendMessage(EM_SETCHARFORMAT, (WPARAM)(SCF_ALL), (LPARAM)&cf, &lResult);
return S_OK;
@@ -148,7 +148,7 @@ HRESULT CFormattedTextDraw::putTextW(WCHAR *newVal) cf.cbSize = sizeof(cf);
cf.dwMask = CFM_FACE | CFM_BOLD;
cf.dwEffects = 0;
- _tcsncpy_s(cf.szFaceName, L"MS Shell Dlg", _TRUNCATE);
+ wcsncpy_s(cf.szFaceName, L"MS Shell Dlg", _TRUNCATE);
m_spTextServices->TxSendMessage(EM_SETCHARFORMAT, (WPARAM)(SCF_ALL), (LPARAM)&cf, &lResult);
return S_OK;
}
@@ -170,7 +170,7 @@ HRESULT CFormattedTextDraw::Draw(void *hdcDraw, RECT *prc) cf.crTextColor = GetTextColor((HDC)hdcDraw);
cf.bCharSet = lf.lfCharSet;
cf.yHeight = 1440 * abs(lf.lfHeight) / GetDeviceCaps((HDC)hdcDraw, LOGPIXELSY);
- _tcsncpy_s(cf.szFaceName, lf.lfFaceName, _TRUNCATE);
+ wcsncpy_s(cf.szFaceName, lf.lfFaceName, _TRUNCATE);
m_spTextServices->TxSendMessage(EM_SETCHARFORMAT, (WPARAM)(SCF_ALL), (LPARAM)&cf, &lResult);
m_spTextServices->TxDraw(
@@ -211,7 +211,7 @@ HRESULT CFormattedTextDraw::get_NaturalSize(void *hdcDraw, long *Width, long *He cf.crTextColor = GetTextColor((HDC)hdcDraw);
cf.bCharSet = lf.lfCharSet;
cf.yHeight = 1440 * abs(lf.lfHeight) / GetDeviceCaps((HDC)hdcDraw, LOGPIXELSY);
- _tcsncpy_s(cf.szFaceName, lf.lfFaceName, _TRUNCATE);
+ wcsncpy_s(cf.szFaceName, lf.lfFaceName, _TRUNCATE);
if (!m_spTextServices)
return S_FALSE;
@@ -384,7 +384,7 @@ HRESULT CFormattedTextDraw::TxGetScrollBars(DWORD *pdwScrollBar) return S_OK;
}
-HRESULT CFormattedTextDraw::TxGetPasswordChar(TCHAR *)
+HRESULT CFormattedTextDraw::TxGetPasswordChar(wchar_t *)
{
return S_FALSE;
}
diff --git a/plugins/mTextControl/src/FormattedTextDraw.h b/plugins/mTextControl/src/FormattedTextDraw.h index 0eeaa850bb..8f318717e6 100644 --- a/plugins/mTextControl/src/FormattedTextDraw.h +++ b/plugins/mTextControl/src/FormattedTextDraw.h @@ -151,7 +151,7 @@ public: HRESULT TxGetBackStyle(TXTBACKSTYLE *pstyle);
HRESULT TxGetMaxLength(DWORD *plength);
HRESULT TxGetScrollBars(DWORD *pdwScrollBar);
- HRESULT TxGetPasswordChar(TCHAR *pch);
+ HRESULT TxGetPasswordChar(wchar_t *pch);
HRESULT TxGetAcceleratorPos(LONG *pcp);
HRESULT TxGetExtent(LPSIZEL lpExtent);
HRESULT OnTxCharFormatChange(const CHARFORMATW * pcf);
diff --git a/plugins/mTextControl/src/fancy_rtf.cpp b/plugins/mTextControl/src/fancy_rtf.cpp index a210632700..17f5f76dba 100644 --- a/plugins/mTextControl/src/fancy_rtf.cpp +++ b/plugins/mTextControl/src/fancy_rtf.cpp @@ -2,9 +2,9 @@ struct BBCodeInfo
{
- TCHAR *start;
- TCHAR *end;
- bool(*func)(IFormattedTextDraw *ftd, CHARRANGE range, TCHAR *txt, DWORD cookie);
+ wchar_t *start;
+ wchar_t *end;
+ bool(*func)(IFormattedTextDraw *ftd, CHARRANGE range, wchar_t *txt, DWORD cookie);
DWORD cookie;
};
@@ -14,7 +14,7 @@ enum { BBS_IMG1, BBS_IMG2
};
-static bool bbCodeSimpleFunc(IFormattedTextDraw *ftd, CHARRANGE range, TCHAR *, DWORD cookie)
+static bool bbCodeSimpleFunc(IFormattedTextDraw *ftd, CHARRANGE range, wchar_t *, DWORD cookie)
{
CHARFORMAT cf = { 0 };
cf.cbSize = sizeof(cf);
@@ -60,7 +60,7 @@ static bool bbCodeSimpleFunc(IFormattedTextDraw *ftd, CHARRANGE range, TCHAR *, return true;
}
-static bool bbCodeImageFunc(IFormattedTextDraw *ftd, CHARRANGE range, TCHAR *txt, DWORD)
+static bool bbCodeImageFunc(IFormattedTextDraw *ftd, CHARRANGE range, wchar_t *txt, DWORD)
{
ITextServices *ts = ftd->getTextService();
ITextDocument *td = ftd->getTextDocument();
@@ -73,9 +73,9 @@ static bool bbCodeImageFunc(IFormattedTextDraw *ftd, CHARRANGE range, TCHAR *txt td->Freeze(&cnt);
#ifdef _WIN64
- bool res = InsertBitmap(RichEditOle, CacheIconToEmf((HICON)_tstoi64(txt)));
+ bool res = InsertBitmap(RichEditOle, CacheIconToEmf((HICON)_wtoi64(txt)));
#else
- bool res = InsertBitmap(RichEditOle, CacheIconToEmf((HICON)_ttoi(txt)));
+ bool res = InsertBitmap(RichEditOle, CacheIconToEmf((HICON)_wtoi(txt)));
#endif
td->Unfreeze(&cnt);
@@ -115,7 +115,7 @@ void bbCodeParse(IFormattedTextDraw *ftd) for (bool found = true; found;) {
found = false;
CHARRANGE fRange; fRange.cpMin = -1;
- TCHAR *fText = 0;
+ wchar_t *fText = 0;
BBCodeInfo *fBBCode = NULL;
for (int i = 0; i < bbCodeCount; i++) {
@@ -154,7 +154,7 @@ void bbCodeParse(IFormattedTextDraw *ftd) TEXTRANGE trg;
trg.chrg.cpMin = fte.chrg.cpMin;
trg.chrg.cpMax = fte.chrgText.cpMin;
- trg.lpstrText = new TCHAR[trg.chrg.cpMax - trg.chrg.cpMin + 1];
+ trg.lpstrText = new wchar_t[trg.chrg.cpMax - trg.chrg.cpMin + 1];
ts->TxSendMessage(EM_GETTEXTRANGE, 0, (LPARAM)&trg, &lResult);
fText = trg.lpstrText;
}
diff --git a/plugins/mTextControl/src/richeditutils.cpp b/plugins/mTextControl/src/richeditutils.cpp index d94785d475..3f3614dc1b 100644 --- a/plugins/mTextControl/src/richeditutils.cpp +++ b/plugins/mTextControl/src/richeditutils.cpp @@ -76,7 +76,7 @@ public: HRESULT STDMETHODCALLTYPE GetNewStorage(LPSTORAGE * lplpstg)
{
- TCHAR sztName[64];
+ wchar_t sztName[64];
mir_sntprintf(sztName, L"s%u", this->nextStgId);
if (this->pictStg == NULL)
return STG_E_MEDIUMFULL;
diff --git a/plugins/mTextControl/src/stdafx.h b/plugins/mTextControl/src/stdafx.h index e46827e586..3840d89738 100644 --- a/plugins/mTextControl/src/stdafx.h +++ b/plugins/mTextControl/src/stdafx.h @@ -47,8 +47,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "fancy_rtf.h"
#include "textcontrol.h"
-#define MODULNAME "MTextControl" //DB modul for this plugin
-#define MODULTITLE "Text Display"
+#define MODULNAME "MTextControl" // DB module for this plugin
+#define MODULNAMEW L"MTextControl" // DB module for this plugin
+
+#define MODULTITLE "Text Display"
// globals
extern HINSTANCE hInst;
diff --git a/plugins/mTextControl/src/textcontrol.cpp b/plugins/mTextControl/src/textcontrol.cpp index daf7b6ad71..4dad57ec55 100644 --- a/plugins/mTextControl/src/textcontrol.cpp +++ b/plugins/mTextControl/src/textcontrol.cpp @@ -26,7 +26,7 @@ LRESULT MTextControl_OnPaint(HWND hwnd, WPARAM wParam, LPARAM lParam); struct TextControlData
{
HANDLE htu;
- TCHAR *text;
+ wchar_t *text;
HANDLE mtext;
};
@@ -43,7 +43,7 @@ void MTextControl_RegisterClass() wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
wcl.lpszMenuName = NULL;
- wcl.lpszClassName = _T(MODULNAME);
+ wcl.lpszClassName = MODULNAMEW;
wcl.hIconSm = 0;
RegisterClassEx(&wcl);
}
@@ -74,7 +74,7 @@ LRESULT CALLBACK MTextControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (data->mtext) MTI_MTextDestroy(data->mtext);
{
int textLength = GetWindowTextLength(hwnd);
- data->text = new TCHAR[textLength + 1];
+ data->text = new wchar_t[textLength + 1];
GetWindowText(hwnd, data->text, textLength + 1);
data->mtext = MTI_MTextCreateW(data->htu, data->text);
diff --git a/plugins/wbOSD/src/events.cpp b/plugins/wbOSD/src/events.cpp index 58f4d4153e..015e240ff4 100644 --- a/plugins/wbOSD/src/events.cpp +++ b/plugins/wbOSD/src/events.cpp @@ -23,7 +23,7 @@ void showmsgwnd(unsigned int param) CallService(MS_MSG_SENDMESSAGET, (WPARAM)param, 0);
}
-LRESULT ShowOSD(TCHAR *str, int timeout, COLORREF color, MCONTACT user)
+LRESULT ShowOSD(wchar_t *str, int timeout, COLORREF color, MCONTACT user)
{
logmsg("ShowOSD");
@@ -62,7 +62,7 @@ int ProtoAck(WPARAM,LPARAM lparam) if ( ack->result == ACKRESULT_SUCCESS && (LPARAM)ack->hProcess != ack->lParam ) {
DWORD ann = db_get_dw( NULL, THIS_MODULE, "announce", DEFAULT_ANNOUNCE );
if ( ann & ( 1 << ( ack->lParam - ID_STATUS_OFFLINE ))) {
- TCHAR buffer[512];
+ wchar_t buffer[512];
mir_sntprintf(buffer, TranslateT("%s is %s"), pcli->pfnGetContactDisplayName(ack->hContact, 0), pcli->pfnGetStatusModeDescription(ack->lParam, 0));
ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS), ack->hContact);
} } }
@@ -120,7 +120,7 @@ int ContactStatusChanged(WPARAM wParam, LPARAM lParam) )
return 0;
- TCHAR bufferW[512];
+ wchar_t bufferW[512];
mir_sntprintf(bufferW, TranslateT("%s is %s"), pcli->pfnGetContactDisplayName(wParam, 0), pcli->pfnGetStatusModeDescription(newStatus, 0));
ShowOSD(bufferW, 0, db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS), hContact);
return 0;
@@ -150,8 +150,8 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent) logmsg("HookedNewEvent2");
- TCHAR buf[512];
- _tcsncpy(buf, DEFAULT_MESSAGEFORMAT,_countof(buf));
+ wchar_t buf[512];
+ wcsncpy(buf, DEFAULT_MESSAGEFORMAT,_countof(buf));
DBVARIANT dbv;
if(!db_get_ts(NULL,THIS_MODULE,"message_format",&dbv)) {
@@ -160,7 +160,7 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent) }
int i1=-1, i2=-1;
- TCHAR* pbuf = buf;
+ wchar_t* pbuf = buf;
while (*pbuf) {
if (*pbuf=='%') {
if (*(pbuf+1)=='n') {
@@ -181,7 +181,7 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent) pbuf++;
}
- TCHAR *c1 = 0, *c2 = 0;
+ wchar_t *c1 = 0, *c2 = 0;
if ( i1 == 1 )
c1 = mir_tstrdup(pcli->pfnGetContactDisplayName(wParam, 0));
else if ( i1 == 2 )
@@ -192,7 +192,7 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent) else if ( i2 == 2 )
c2 = DbGetEventTextT( &dbe, 0 );
- TCHAR buffer[512];
+ wchar_t buffer[512];
mir_sntprintf(buffer, buf, c1, c2);
ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_msg", DEFAULT_CLRMSG), wParam);
diff --git a/plugins/wbOSD/src/options.cpp b/plugins/wbOSD/src/options.cpp index de0c49a6cc..76af0a3bb1 100644 --- a/plugins/wbOSD/src/options.cpp +++ b/plugins/wbOSD/src/options.cpp @@ -249,7 +249,7 @@ INT_PTR CALLBACK OptDlgProc(HWND hDlg, UINT msg, WPARAM wparam, LPARAM lparam) SendDlgItemMessage(hDlg, IDC_SLIDER1, TBM_SETPOS, TRUE, (LPARAM)ps->alpha);
{
- TCHAR buf[20];
+ wchar_t buf[20];
mir_sntprintf(buf, L"%d %%", ps->alpha * 100 / 255);
SetDlgItemText(hDlg, IDC_ALPHATXT, buf);
}
@@ -265,7 +265,7 @@ INT_PTR CALLBACK OptDlgProc(HWND hDlg, UINT msg, WPARAM wparam, LPARAM lparam) ps = (plgsettings*)GetWindowLongPtr(hDlg, GWLP_USERDATA);
ps->alpha = SendDlgItemMessage(hDlg, IDC_SLIDER1, TBM_GETPOS, 0, 0);
{
- TCHAR buf[20];
+ wchar_t buf[20];
mir_sntprintf(buf, L"%d %%", ps->alpha * 100 / 255);
SetDlgItemText(hDlg, IDC_ALPHATXT, buf);
}
@@ -414,8 +414,8 @@ int OptionsInit(WPARAM wparam, LPARAM) odp.groupPosition = 950000000;
odp.hInstance = hI;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG1);
- odp.ptszGroup = LPGENT("Plugins");
- odp.ptszTitle = LPGENT("OSD");
+ odp.pwszGroup = LPGENW("Plugins");
+ odp.pwszTitle = LPGENW("OSD");
odp.pfnDlgProc = OptDlgProc;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wparam, &odp);
diff --git a/plugins/wbOSD/src/stdafx.h b/plugins/wbOSD/src/stdafx.h index 8e0d3f2248..3c301b30a1 100644 --- a/plugins/wbOSD/src/stdafx.h +++ b/plugins/wbOSD/src/stdafx.h @@ -86,7 +86,7 @@ typedef struct _plgsettings { int align, salign, altShadow, showShadow, a_user, distance, onlyfromlist, showmystatus;
int showMsgWindow;
int messages; //also other events...
- TCHAR msgformat[256];
+ wchar_t msgformat[256];
int winx, winy, winxpos, winypos, alpha, transparent, timeout;
COLORREF clr_msg, clr_status, clr_shadow, bkclr;
DWORD announce, showWhen;
@@ -94,7 +94,7 @@ typedef struct _plgsettings { } plgsettings;
typedef struct _osdmsg {
- TCHAR *text;
+ wchar_t *text;
int timeout; //ms
COLORREF color;
void (*callback)(unsigned int param);
diff --git a/plugins/wbOSD/src/wbOSD.cpp b/plugins/wbOSD/src/wbOSD.cpp index 5159a3b437..bc602ec52c 100644 --- a/plugins/wbOSD/src/wbOSD.cpp +++ b/plugins/wbOSD/src/wbOSD.cpp @@ -9,10 +9,10 @@ Distributed under GNU's GPL 2 or later #include "stdafx.h"
-TCHAR szClassName[] = L"wbOSD";
+wchar_t szClassName[] = L"wbOSD";
const static osdmsg defstr = { L"", 0, RGB(0, 0, 0), 0, 0 };
-int DrawMe(HWND hwnd, TCHAR *string, COLORREF color)
+int DrawMe(HWND hwnd, wchar_t *string, COLORREF color)
{
logmsg("DrawMe");
if (!string) string = L"bullshit";
@@ -161,7 +161,7 @@ LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM logmsg("WindowProcedure::USER+1");
ms = (osdmsg*)mir_alloc(sizeof(osdmsg));
- ms->text = mir_tstrdup((TCHAR *)wParam);
+ ms->text = mir_tstrdup((wchar_t *)wParam);
if (lParam == 0)
lParam = db_get_dw(NULL, THIS_MODULE, "timeout", DEFAULT_TIMEOUT);
ms->timeout = lParam;
|