diff options
Diffstat (limited to 'plugins/WebView/src')
| -rw-r--r-- | plugins/WebView/src/main.cpp | 30 | ||||
| -rw-r--r-- | plugins/WebView/src/stdafx.h | 1 | ||||
| -rw-r--r-- | plugins/WebView/src/webview.cpp | 12 | ||||
| -rw-r--r-- | plugins/WebView/src/webview.h | 7 | ||||
| -rw-r--r-- | plugins/WebView/src/webview_alerts.cpp | 34 | ||||
| -rw-r--r-- | plugins/WebView/src/webview_datawnd.cpp | 10 | ||||
| -rw-r--r-- | plugins/WebView/src/webview_getdata.cpp | 10 | ||||
| -rw-r--r-- | plugins/WebView/src/webview_opts.cpp | 80 | ||||
| -rw-r--r-- | plugins/WebView/src/webview_services.cpp | 92 | 
9 files changed, 138 insertions, 138 deletions
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);  | 
