summaryrefslogtreecommitdiff
path: root/plugins/Non-IM Contact/src
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2013-09-21 20:39:17 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2013-09-21 20:39:17 +0000
commit4d970faf406c59e807a9ffd4d7a51f1aaad6636a (patch)
treedbc0f6ff815fa7c357ce0df22cf84417794d3c80 /plugins/Non-IM Contact/src
parent52824c91bac6d6cc0f04e242b07d9031477b6362 (diff)
translation fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@6171 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Non-IM Contact/src')
-rw-r--r--plugins/Non-IM Contact/src/contactinfo.cpp51
-rw-r--r--plugins/Non-IM Contact/src/dialog.cpp36
-rw-r--r--plugins/Non-IM Contact/src/files.cpp46
-rw-r--r--plugins/Non-IM Contact/src/http.cpp13
4 files changed, 76 insertions, 70 deletions
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp
index c55ea4f159..abb04ea98b 100644
--- a/plugins/Non-IM Contact/src/contactinfo.cpp
+++ b/plugins/Non-IM Contact/src/contactinfo.cpp
@@ -112,35 +112,42 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
switch(msg) {
case WM_INITDIALOG:
{
- int i;
- char string[512];
HANDLE hContact = (HANDLE)((PROPSHEETPAGE*)lParam)->lParam;
TranslateDialogDefault(hwnd);
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LPARAM)(HANDLE)hContact);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LPARAM)hContact);
if (!hContact)
break;
/* link*/
- if (db_get_static(hContact, MODNAME, "ProgramString", string))
- SetDlgItemTextA(hwnd, IDC_LINK, string);
+ DBVARIANT dbv;
+ if (!db_get_ts(hContact, MODNAME, "ProgramString", &dbv))
+ {
+ SetDlgItemText(hwnd, IDC_LINK, dbv.ptszVal);
+ db_free(&dbv);
+ }
- if (db_get_static(hContact, MODNAME, "ProgramParamsString", string))
- SetDlgItemTextA(hwnd, IDC_PARAMS, string);
+ if (!db_get_ts(hContact, MODNAME, "ProgramParamsString", &dbv))
+ {
+ SetDlgItemText(hwnd, IDC_PARAMS, dbv.ptszVal);
+ db_free(&dbv);
+ }
/* group*/
TCHAR *szGroup;
- for (i=1; (szGroup = pcli->pfnGetGroupName(i, NULL)) != NULL; i++)
- SendMessage(GetDlgItem(hwnd, IDC_GROUP), CB_INSERTSTRING,0, LPARAM(szGroup));
+ for (int i=1; (szGroup = pcli->pfnGetGroupName(i, NULL)) != NULL; i++)
+ SendDlgItemMessage(hwnd, IDC_GROUP, CB_INSERTSTRING,0, LPARAM(szGroup));
- DBVARIANT dbv;
- if (!db_get(hContact, "CList", "Group", &dbv))
- SetDlgItemTextA(hwnd, IDC_GROUP, dbv.pszVal);
+ if (!db_get_ts(hContact, "CList", "Group", &dbv))
+ {
+ SetDlgItemText(hwnd, IDC_GROUP, dbv.ptszVal);
+ db_free(&dbv);
+ }
/* icons */
CheckRadioButton(hwnd, 40072, 40080, db_get_w(hContact, MODNAME, "Icon", ID_STATUS_ONLINE));
SetWindowLongPtr(GetDlgItem(hwnd, CHK_ONLINE), GWLP_USERDATA, (LONG)LoadSkinnedProtoIcon(MODNAME, ID_STATUS_ONLINE));
g_PrevBtnWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwnd, CHK_ONLINE), GWLP_WNDPROC, (LPARAM)ButtWndProc);
- for (i = ID_STATUS_ONLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
+ for (int i = ID_STATUS_ONLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
SetWindowLongPtr(GetDlgItem(hwnd, i), GWLP_USERDATA, (LPARAM)LoadSkinnedProtoIcon(MODNAME, i));
SetWindowLongPtr(GetDlgItem(hwnd, i), GWLP_WNDPROC, (LPARAM)ButtWndProc);
}
@@ -150,12 +157,13 @@ 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,1);
EnableWindow(GetDlgItem(hwnd, IDC_TIMER), 1);
- SetDlgItemTextA(hwnd, IDC_TIMER, _itoa(db_get_w(hContact, MODNAME ,"Timer", 15), string, 10));
+ TCHAR string[512];
+ SetDlgItemText(hwnd, IDC_TIMER, _itot(db_get_w(hContact, MODNAME ,"Timer", 15), string, 10));
if (!db_get_w(NULL, MODNAME ,"Timer", 1))
- SetDlgItemTextA(hwnd,IDC_TIMER_INTERVAL_MSG, "Non-IM Contact protocol timer is Disabled");
+ SetDlgItemText(hwnd,IDC_TIMER_INTERVAL_MSG, TranslateT("Non-IM Contact protocol timer is Disabled"));
else {
- mir_snprintf(string, sizeof(string), "Timer intervals... Non-IM Contact Protocol timer is %d seconds",db_get_w(NULL, MODNAME ,"Timer", 1));
- SetDlgItemTextA(hwnd,IDC_TIMER_INTERVAL_MSG, string);
+ mir_sntprintf(string, SIZEOF(string), TranslateT("Timer intervals... Non-IM Contact Protocol timer is %d seconds"),db_get_w(NULL, MODNAME ,"Timer", 1));
+ SetDlgItemText(hwnd,IDC_TIMER_INTERVAL_MSG, string);
}
}
/* always visible */
@@ -253,9 +261,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))) {
- char text[512];
- GetDlgItemTextA(hwnd,IDC_TIMER,text,sizeof(text));
- db_set_w(hContact, MODNAME, "Timer", (WORD)atoi(text));
+ TCHAR text[512];
+ GetDlgItemText(hwnd,IDC_TIMER,text,SIZEOF(text));
+ db_set_w(hContact, MODNAME, "Timer", (WORD)_ttoi(text));
}
else db_set_w(hContact, MODNAME, "Timer", 15);
}
@@ -446,7 +454,6 @@ INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
void ExportContact(HANDLE hContact)
{
- FILE* file;
char szFileName[MAX_PATH];
char DBVar[1024];
int tmp;
@@ -456,7 +463,7 @@ void ExportContact(HANDLE hContact)
// if (tmp = MessageBox(0, "Do you want to overwrite the contents of the file?\r\n\r\nPressing No will append this contact to the end of the file.",modFullname, MB_YESNO) == IDYES)
// file = fopen(szFileName, "w");
// else
- file = fopen(szFileName, "a");
+ FILE *file = fopen(szFileName, "a");
if (file)
{
if (db_get_static(hContact, MODNAME, "Name", DBVar))
diff --git a/plugins/Non-IM Contact/src/dialog.cpp b/plugins/Non-IM Contact/src/dialog.cpp
index 8afb13b879..34a0e7dd4e 100644
--- a/plugins/Non-IM Contact/src/dialog.cpp
+++ b/plugins/Non-IM Contact/src/dialog.cpp
@@ -1,18 +1,18 @@
#include "commonheaders.h"
-#define NIM_HELP_TEXT LPGEN("String replacing variables....\r\nThe following are all the valid variables that can be used. Refer to the readme for a proper explanation.\r\n\r\n\
+#define NIM_HELP_TEXT TranslateT("String replacing variables....\r\nThe following are all the valid variables that can be used. Refer to the readme for a proper explanation.\r\n\r\n\
file(X)\t\t<- specifies the file to read from. MUST be followed by either start() or end() or wholeline()\r\n\
-filename(X)\t<- copyies the filename of file X.\r\n\
+filename(X)\t<- copies the filename of file X.\r\n\
start(...)\t\t<- specifies where to start copying from.\r\n\
end(...)\t\t<- specifies where to stop copying.\r\n\
wholeline(line(...))\t<- specifies a whole line to copy\r\n\r\n\
start() and end() explained\r\n.........................\r\n\
-MUST start with line() followed by a number or a string inside \" marks, OR csv(seperatorX) variable. The number specifies which character in the line to start/end copying. The string specifies a string in the line to start/end copying.\r\n\r\n\
+MUST start with line() followed by a number or a string inside \" marks, OR csv(separatorX) variable. The number specifies which character in the line to start/end copying. The string specifies a string in the line to start/end copying.\r\n\r\n\
csv(seperatorX) explained...\r\nSeperator is either \"tab\" or \"space\" or any SINGLE character. X is the Xth seperator to pass before copying, (or to stop before).\r\n\r\n\
Lastly the line(...) variable...\r\n\
Inside the brackets must be either a number (to specify the line number), or a string inside \" marks (to use the line with that string), or lastline(X). The X in lastline is the Xth line above the last line. i.e lastline(1) will use the 2nd last line of the file. If searching for a line with \"some words\" you may put a + or - X after the closing ) i.e line(\"some words\")+3 to go 3 lines after the line with \"some words\".\r\n\r\n\
-Some Expamples...\r\n\
-filename(0) <- will display the filename of the 0th file\r\nfile(0)wholeline(line(0))) <- will display the whole first line of the 0th file\r\nfile(0)wholeline(line(\"hello\")-1))) <- the wholeline above the first occurance of \"hello\" in the file\r\nfile(0)start(line(lastline(1))csv(tab2))end(line(lastline())csv(tab4))) <- starts at the 2nd last line of the file, from the 2nd tab variable, untill the 4th tab variable in the last line (in the 0th file)\r\nfile(0)start(line(\"hello\")+1\"zzzz\")end(line(6)17)) <- starts from the first occurance of zzzz in the line after the first occurance of hello, untill the 17th character in the 6th line (starting from line 0) of the 0th file.\r\n")
+Some Examples...\r\n\
+filename(0) <- will display the filename of the 0th file\r\nfile(0)wholeline(line(0))) <- will display the whole first line of the 0th file\r\nfile(0)wholeline(line(\"hello\")-1))) <- the wholeline above the first occurance of \"hello\" in the file\r\nfile(0)start(line(lastline(1))csv(tab2))end(line(lastline())csv(tab4))) <- starts at the 2nd last line of the file, from the 2nd tab variable, until the 4th tab variable in the last line (in the 0th file)\r\nfile(0)start(line(\"hello\")+1\"zzzz\")end(line(6)17)) <- starts from the first occurance of zzzz in the line after the first occurance of hello, untill the 17th character in the 6th line (starting from line 0) of the 0th file.\r\n")
INT_PTR CALLBACK DlgProcNimcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -20,13 +20,13 @@ INT_PTR CALLBACK DlgProcNimcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
switch(msg) {
case WM_INITDIALOG:
{
- char tmp[5];
+ TCHAR tmp[5];
TranslateDialogDefault(hwnd);
CheckDlgButton(hwnd, IDC_AWAYISNOTONLINE, db_get_b(NULL, MODNAME, "AwayAsStatus", 0));
if (db_get_w(NULL, MODNAME, "Timer", 1))
{
EnableWindow(GetDlgItem(hwnd,IDC_TIMER_INT),1);
- SetDlgItemTextA(hwnd, IDC_TIMER_INT, _itoa(db_get_w(NULL, MODNAME, "Timer", 1),tmp,10));
+ SetDlgItemText(hwnd, IDC_TIMER_INT, _itot(db_get_w(NULL, MODNAME, "Timer", 1),tmp,10));
EnableWindow(GetDlgItem(hwnd,IDC_TIMER_TEXT),1);
}
else
@@ -52,7 +52,7 @@ INT_PTR CALLBACK DlgProcNimcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
EnableWindow(GetDlgItem(hwnd,IDC_TIMER_TEXT),1);
EnableWindow(GetDlgItem(hwnd,IDC_TIMER_INT),1);
if (!GetWindowTextLength(GetDlgItem(hwnd, IDC_TIMER_INT)))
- SetDlgItemTextA(hwnd, IDC_TIMER_INT,"1");
+ SetDlgItemText(hwnd, IDC_TIMER_INT,_T("1"));
}
break;
@@ -65,11 +65,11 @@ INT_PTR CALLBACK DlgProcNimcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- char tmp[5];
+ TCHAR tmp[5];
db_set_b(NULL, MODNAME, "AwayAsStatus", (BYTE)IsDlgButtonChecked(hwnd, IDC_AWAYISNOTONLINE));
if (!IsDlgButtonChecked(hwnd, IDC_DISABLETIMER) && GetWindowTextLength(GetDlgItem(hwnd, IDC_TIMER_INT))) {
- GetDlgItemTextA(hwnd, IDC_TIMER_INT, tmp, 4);
- db_set_w(NULL, MODNAME, "Timer",(WORD)atoi(tmp));
+ GetDlgItemText(hwnd, IDC_TIMER_INT, tmp, 4);
+ db_set_w(NULL, MODNAME, "Timer",(WORD)_ttoi(tmp));
}
else db_set_w(NULL, MODNAME, "Timer",0);
return TRUE;
@@ -105,7 +105,7 @@ INT_PTR CALLBACK HelpWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
{
switch(msg) {
case WM_INITDIALOG:
- SetDlgItemTextA(hwnd, IDC_HELPTEXT, NIM_HELP_TEXT);
+ SetDlgItemText(hwnd, IDC_HELPTEXT, NIM_HELP_TEXT);
TranslateDialogDefault(hwnd);
return TRUE;
@@ -251,7 +251,7 @@ void DoPropertySheet(HANDLE hContact, HINSTANCE hInst)
psp[0].pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_INFO);
psp[0].pszIcon = NULL;
psp[0].pfnDlgProc = DlgProcContactInfo;
- psp[0].pszTitle = "Contacts Display Info";
+ psp[0].pszTitle = Translate("Contacts Display Info");
psp[0].lParam = (LPARAM)hContact;
psp[0].pfnCallback = NULL;
@@ -262,7 +262,7 @@ void DoPropertySheet(HANDLE hContact, HINSTANCE hInst)
psp[1].pszTemplate = MAKEINTRESOURCEA(IDD_OTHER_STUFF);
psp[1].pszIcon = NULL;
psp[1].pfnDlgProc = DlgProcOtherStuff;
- psp[1].pszTitle = "Link and CList Settings";
+ psp[1].pszTitle = Translate("Link and CList Settings");
psp[1].lParam = (LPARAM)hContact;
psp[1].pfnCallback = NULL;
@@ -273,7 +273,7 @@ void DoPropertySheet(HANDLE hContact, HINSTANCE hInst)
psp[2].pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_COPYEXPORT);
psp[2].pszIcon = NULL;
psp[2].pfnDlgProc = DlgProcCopy;
- psp[2].pszTitle = "Copy Contact";
+ psp[2].pszTitle = Translate("Copy Contact");
psp[2].lParam = (LPARAM)hContact;
psp[2].pfnCallback = NULL;
@@ -284,7 +284,7 @@ void DoPropertySheet(HANDLE hContact, HINSTANCE hInst)
psp[3].pszTemplate = MAKEINTRESOURCEA(IDD_ADD_FILE);
psp[3].pszIcon = NULL;
psp[3].pfnDlgProc = DlgProcFiles;
- psp[3].pszTitle = "Files";
+ psp[3].pszTitle = Translate("Files");
psp[3].lParam = 0;
psp[3].pfnCallback = NULL;
@@ -294,7 +294,7 @@ void DoPropertySheet(HANDLE hContact, HINSTANCE hInst)
psh.hInstance = hInst;
psh.pszIcon = MAKEINTRESOURCEA(IDI_MAIN);
db_get_static(hContact, MODNAME, "Nick", nick);
- mir_snprintf(title, SIZEOF(title), "Edit Non-IM Contact \"%s\"", nick);
+ mir_snprintf(title, SIZEOF(title), Translate("Edit Non-IM Contact \"%s\""), nick);
psh.pszCaption = title;
psh.nPages = SIZEOF(psp);
psh.ppsp = (LPCPROPSHEETPAGEA)&psp;
@@ -310,7 +310,7 @@ INT_PTR addContact(WPARAM wParam,LPARAM lParam)
HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)MODNAME);
CallService(MS_IGNORE_IGNORE, (WPARAM)hContact, IGNOREEVENT_USERONLINE);
- db_set_s(hContact, MODNAME, "Nick", Translate("New Non-IM Contact"));
+ db_set_ts(hContact, MODNAME, "Nick", TranslateT("New Non-IM Contact"));
DoPropertySheet(hContact, hInst);
if (!db_get_static(hContact, MODNAME, "Name", tmp))
CallService(MS_DB_CONTACT_DELETE,(WPARAM)hContact,0);
diff --git a/plugins/Non-IM Contact/src/files.cpp b/plugins/Non-IM Contact/src/files.cpp
index fc3174e7ad..70db1be310 100644
--- a/plugins/Non-IM Contact/src/files.cpp
+++ b/plugins/Non-IM Contact/src/files.cpp
@@ -7,7 +7,7 @@ INT_PTR exportContacts(WPARAM wParam,LPARAM lParam)
return 0;
FILE* file;
- if (MessageBoxA(0, "Do you want to overwrite the contents of the file?\r\n\r\nPressing No will append these contacts to the end of the file.",modFullname, MB_YESNO) == IDYES)
+ if (MessageBox(0, TranslateT("Do you want to overwrite the contents of the file?\r\n\r\nPressing No will append these contacts to the end of the file."),_T(modFullname), MB_YESNO) == IDYES)
file = fopen(fn, "w");
else
file = fopen(fn, "a");
@@ -107,7 +107,7 @@ void readFile(HWND hwnd)
int lineNumber, fileLength=0, width=0;
char temp[MAX_STRING_LENGTH], szFileName[512], temp1[MAX_STRING_LENGTH], fn[8];
FILE* filen;
- int fileNumber = SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_GETCURSEL, 0,0);
+ int fileNumber = SendDlgItemMessage(hwnd, IDC_FILE_LIST,CB_GETCURSEL, 0,0);
mir_snprintf(fn, SIZEOF(fn), "fn%d", fileNumber);
if (!db_get_static(NULL, MODNAME, fn, szFileName)) {
msg(Translate("File couldn't be opened"),fn);
@@ -123,7 +123,7 @@ void readFile(HWND hwnd)
return;
}
lineNumber = 0;
- SendMessage(GetDlgItem(hwnd, IDC_FILE_CONTENTS),LB_RESETCONTENT, 0,0);
+ SendDlgItemMessage(hwnd, IDC_FILE_CONTENTS,LB_RESETCONTENT, 0,0);
while (lineNumber < (MAXLINES) && (fgets(temp, MAX_STRING_LENGTH, filen)))
{
if (temp[0] == '\t') temp[0] = ' ';
@@ -133,11 +133,11 @@ void readFile(HWND hwnd)
temp[strlen(temp)-1]='\0';
else temp[strlen(temp)]='\0';
mir_snprintf(temp1, SIZEOF(temp1), Translate("line(%-3d) = | %s"), lineNumber, temp);
- SendMessageA(GetDlgItem(hwnd, IDC_FILE_CONTENTS),LB_ADDSTRING,0,(LPARAM)(char*)temp1);
+ SendDlgItemMessageA(hwnd, IDC_FILE_CONTENTS,LB_ADDSTRING,0,(LPARAM)temp1);
lineNumber++;
fileLength++;
- if ((unsigned int)SendMessage(GetDlgItem(hwnd, IDC_FILE_CONTENTS),LB_GETHORIZONTALEXTENT,0,0) <= (strlen(temp1)*db_get_b(NULL, MODNAME, "WidthMultiplier", 5)))
- SendMessage(GetDlgItem(hwnd, IDC_FILE_CONTENTS),LB_SETHORIZONTALEXTENT,(strlen(temp1)*db_get_b(NULL, MODNAME, "WidthMultiplier", 5)),0);
+ if ((unsigned int)SendDlgItemMessage(hwnd, IDC_FILE_CONTENTS,LB_GETHORIZONTALEXTENT,0,0) <= (strlen(temp1)*db_get_b(NULL, MODNAME, "WidthMultiplier", 5)))
+ SendDlgItemMessage(hwnd, IDC_FILE_CONTENTS,LB_SETHORIZONTALEXTENT,(strlen(temp1)*db_get_b(NULL, MODNAME, "WidthMultiplier", 5)),0);
}
fclose(filen);
@@ -153,9 +153,9 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
char fn[MAX_PATH], string[MAX_STRING_LENGTH], tmp[MAX_STRING_LENGTH];
reloadFiles(GetDlgItem(hwnd, IDC_FILE_LIST));
- int i = SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_GETCURSEL, 0 ,0);
+ int i = SendDlgItemMessage(hwnd, IDC_FILE_LIST,CB_GETCURSEL, 0 ,0);
mir_snprintf(fn, SIZEOF(fn), "fn%d", i);
- SendMessage(GetDlgItem(hwnd, IDC_FILE_CONTENTS),LB_RESETCONTENT, 0,0);
+ SendDlgItemMessage(hwnd, IDC_FILE_CONTENTS,LB_RESETCONTENT, 0,0);
if (db_get_static(NULL, MODNAME, fn, string) )
{
if ( (!strncmp("http://", string, strlen("http://"))) || (!strncmp("https://", string, strlen("https://"))) )
@@ -230,8 +230,8 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
db_set_s(NULL, MODNAME, fn, file);
index = SendMessageA(GetDlgItem(hwnd, IDC_FILE_LIST),CB_ADDSTRING,0,(LPARAM)(char*)file);
- SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_SETITEMDATA,index,(LPARAM)(int)i);
- SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_SETCURSEL, index ,0);
+ SendDlgItemMessage(hwnd, IDC_FILE_LIST,CB_SETITEMDATA,index,(LPARAM)(int)i);
+ SendDlgItemMessage(hwnd, IDC_FILE_LIST,CB_SETCURSEL, index ,0);
SetDlgItemTextA(hwnd, IDC_FN, _itoa(i, fn, 10));
mir_snprintf(fn, SIZEOF(fn), "fn%d", index);
readFile(hwnd);
@@ -241,18 +241,18 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
break;
case IDC_DEL_FILE:
{
- int index = SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_GETCURSEL, 0,0),i= (int)SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_GETITEMDATA, index,0);
+ int index = SendDlgItemMessage(hwnd, IDC_FILE_LIST,CB_GETCURSEL, 0,0),i= (int)SendDlgItemMessage(hwnd, IDC_FILE_LIST,CB_GETITEMDATA, index,0);
char fn[6], fn1[4], tmp[256];
- int count = SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_GETCOUNT, 0,0) -1;
+ int count = SendDlgItemMessage(hwnd, IDC_FILE_LIST,CB_GETCOUNT, 0,0) -1;
if (index == count)
{
mir_snprintf(fn, SIZEOF(fn), "fn%d", index);
db_unset(NULL, MODNAME, fn);
- SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_DELETESTRING, index ,0);
+ SendDlgItemMessage(hwnd, IDC_FILE_LIST,CB_DELETESTRING, index ,0);
SendMessage(hwnd, WM_RELOADWINDOW, 0,0);
if (!index) {
- SetDlgItemTextA(hwnd, IDC_FN,"");
- SetDlgItemTextA(hwnd, IDC_FILE_CONTENTS,"");
+ SetDlgItemText(hwnd, IDC_FN,_T(""));
+ SetDlgItemText(hwnd, IDC_FILE_CONTENTS,_T(""));
}
}
@@ -267,7 +267,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
mir_snprintf(fn, SIZEOF(fn), "fn%d", --i);
db_unset(NULL, MODNAME, fn);
- SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_DELETESTRING, index ,0);
+ SendDlgItemMessage(hwnd, IDC_FILE_LIST,CB_DELETESTRING, index ,0);
SendMessage(hwnd, WM_RELOADWINDOW, 0,0);
}
@@ -278,7 +278,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case IDC_FILE_LIST:
if (HIWORD(wParam) == CBN_SELCHANGE )
{
- int index = SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_GETCURSEL, 0,0);
+ int index = SendDlgItemMessage(hwnd, IDC_FILE_LIST,CB_GETCURSEL, 0,0);
char fn[6], tmp[MAX_PATH];
SetDlgItemTextA(hwnd, IDC_FN, _itoa(index, fn, 10));
mir_snprintf(fn, SIZEOF(fn), "fn%d", index);
@@ -291,8 +291,8 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
else
{
- SetDlgItemTextA(hwnd,IDC_URL, "");
- SetDlgItemTextA(hwnd, IDC_WWW_TIMER,"");
+ SetDlgItemText(hwnd,IDC_URL, _T(""));
+ SetDlgItemText(hwnd, IDC_WWW_TIMER,_T(""));
}
readFile(hwnd);
}
@@ -309,14 +309,14 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- int i = SendMessage(GetDlgItem(hwnd, IDC_FILE_LIST),CB_GETCURSEL, 0 ,0);
+ int i = SendDlgItemMessage(hwnd, IDC_FILE_LIST,CB_GETCURSEL, 0 ,0);
int timer;
char fn[MAX_PATH], string[1000];
mir_snprintf(fn, SIZEOF(fn), "fn%d", i);
if (GetWindowTextLength(GetDlgItem(hwnd,IDC_WWW_TIMER))) {
- char text[5];
- GetDlgItemTextA(hwnd,IDC_WWW_TIMER,text,sizeof(text));
- timer = atoi(text);
+ TCHAR text[5];
+ GetDlgItemText(hwnd,IDC_WWW_TIMER,text,SIZEOF(text));
+ timer = _ttoi(text);
}
else timer = 60;
diff --git a/plugins/Non-IM Contact/src/http.cpp b/plugins/Non-IM Contact/src/http.cpp
index f4b8b006d8..5c300de80e 100644
--- a/plugins/Non-IM Contact/src/http.cpp
+++ b/plugins/Non-IM Contact/src/http.cpp
@@ -31,9 +31,9 @@ HANDLE hNetlibUser;
// szUrl = URL of the webpage to be retrieved
// 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)
+int InternetDownloadFile (char *szUrl)
{
- NETLIBHTTPREQUEST nlhr={0}, *nlhrReply;
+ NETLIBHTTPREQUEST nlhr={0};
// initialize the netlib request
nlhr.cbSize=sizeof(nlhr);
@@ -48,11 +48,11 @@ int InternetDownloadFile (CHAR *szUrl)
nlhr.headers[nlhr.headersCount-1].szValue="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
// download the page
- nlhrReply=(NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION,(WPARAM)hNetlibUser,(LPARAM)&nlhr);
+ NETLIBHTTPREQUEST *nlhrReply=(NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION,(WPARAM)hNetlibUser,(LPARAM)&nlhr);
if (nlhrReply) {
// return error code if the recieved code is neither 200 OK or 302 Moved
if (nlhrReply->resultCode != 200 && nlhrReply->resultCode != 302)
- return (int)nlhrReply->resultCode;
+ return nlhrReply->resultCode;
// if the recieved code is 200 OK
else if (nlhrReply->resultCode == 200)
{
@@ -92,12 +92,11 @@ int InternetDownloadFile (CHAR *szUrl)
//============ NETLIB INITIALIZATION ============
-// initialize netlib support from weather protocol
void NetlibInit() {
NETLIBUSER nlu={0};
nlu.cbSize=sizeof(nlu);
- nlu.flags=NUF_OUTGOING|NUF_HTTPCONNS|NUF_NOHTTPSOPTION;
+ nlu.flags=NUF_OUTGOING|NUF_HTTPCONNS|NUF_NOHTTPSOPTION|NUF_TCHAR;
nlu.szSettingsModule= MODNAME;
- nlu.szDescriptiveName= Translate("Non-IM Contacts");
+ nlu.ptszDescriptiveName= TranslateT("Non-IM Contacts");
hNetlibUser=(HANDLE)CallService(MS_NETLIB_REGISTERUSER,0,(LPARAM)&nlu);
}