diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2013-09-15 09:35:48 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2013-09-15 09:35:48 +0000 |
commit | 8b81f3b1b4c500452db5dd329be403ca6c2cbfba (patch) | |
tree | 830252959bee58306469513468f2b499888d5d0a /protocols | |
parent | 7f44824457f6a4cbb8f79122a0d26b979695665c (diff) |
-translation fixes
-fixed password saving
-code cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@6065 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/MRA/src/Mra.cpp | 33 | ||||
-rw-r--r-- | protocols/MRA/src/Mra.h | 22 | ||||
-rw-r--r-- | protocols/MRA/src/MraAdvancedSearch.cpp | 188 | ||||
-rw-r--r-- | protocols/MRA/src/MraAvatars.cpp | 53 | ||||
-rw-r--r-- | protocols/MRA/src/MraChat.cpp | 16 | ||||
-rw-r--r-- | protocols/MRA/src/MraConstans.h | 8 | ||||
-rw-r--r-- | protocols/MRA/src/MraFilesQueue.cpp | 50 | ||||
-rw-r--r-- | protocols/MRA/src/MraIcons.cpp | 16 | ||||
-rw-r--r-- | protocols/MRA/src/MraMPop.cpp | 6 | ||||
-rw-r--r-- | protocols/MRA/src/MraPopUp.cpp | 32 | ||||
-rw-r--r-- | protocols/MRA/src/MraProto.cpp | 4 | ||||
-rw-r--r-- | protocols/MRA/src/MraRTFMsg.cpp | 6 | ||||
-rw-r--r-- | protocols/MRA/src/MraSelectEMail.cpp | 12 | ||||
-rw-r--r-- | protocols/MRA/src/MraSendCommand.cpp | 8 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_functions.cpp | 107 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_options.cpp | 110 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_proto.cpp | 54 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_svcs.cpp | 32 |
18 files changed, 356 insertions, 401 deletions
diff --git a/protocols/MRA/src/Mra.cpp b/protocols/MRA/src/Mra.cpp index cb410b03f6..d77cbb639f 100644 --- a/protocols/MRA/src/Mra.cpp +++ b/protocols/MRA/src/Mra.cpp @@ -7,11 +7,11 @@ PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX),
PROTOCOL_DISPLAY_NAME_ORIGA,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
- "Mail.ru Agent (MRA) protocol support for Miranda NG.",
- "Rozhuk Ivan",
- "Rozhuk_I@mail.ru",
- "© 2006-2011 Rozhuk Ivan",
- "http://miranda-ng.org/",
+ __DESCRIPTION,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
UNICODE_AWARE,
// {E7C48BAB-8ACE-4CB3-8446-D4B73481F497}
{ 0xe7c48bab, 0x8ace, 0x4cb3, { 0x84, 0x46, 0xd4, 0xb7, 0x34, 0x81, 0xf4, 0x97 } }
@@ -19,8 +19,8 @@ PLUGININFOEX pluginInfoEx = { void IconsLoad();
-int OnModulesLoaded(WPARAM wParam, LPARAM lParam);
-int OnPreShutdown(WPARAM wParam, LPARAM lParam);
+int OnModulesLoaded(WPARAM, LPARAM);
+int OnPreShutdown(WPARAM, LPARAM);
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID Reserved)
{
@@ -79,24 +79,25 @@ extern "C" __declspec(dllexport) int Load(void) IconsLoad();
- size_t dwBuffLen;
- WCHAR szBuff[MAX_FILEPATH];
+ TCHAR szBuff[MAX_FILEPATH];
LPSTR lpszFullFileName = (LPSTR)szBuff;
- LPWSTR lpwszFileName;
// load libs
if (GetModuleFileName(NULL, szBuff, MAX_FILEPATH)) {
+ LPWSTR lpwszFileName;
masMraSettings.dwMirWorkDirPathLen = GetFullPathName(szBuff, MAX_FILEPATH, masMraSettings.szMirWorkDirPath, &lpwszFileName);
if (masMraSettings.dwMirWorkDirPathLen) {
masMraSettings.dwMirWorkDirPathLen -= lstrlenW(lpwszFileName);
masMraSettings.szMirWorkDirPath[masMraSettings.dwMirWorkDirPathLen] = 0;
// load xstatus icons lib
- DWORD dwErrorCode = FindFile(masMraSettings.szMirWorkDirPath, (DWORD)masMraSettings.dwMirWorkDirPathLen, L"xstatus_MRA.dll", -1, szBuff, SIZEOF(szBuff), (DWORD*)&dwBuffLen);
+ size_t dwBuffLen;
+ DWORD dwErrorCode = FindFile(masMraSettings.szMirWorkDirPath, (DWORD)masMraSettings.dwMirWorkDirPathLen, _T("xstatus_MRA.dll"), -1, szBuff, SIZEOF(szBuff), (DWORD*)&dwBuffLen);
if (dwErrorCode == NO_ERROR) {
masMraSettings.hDLLXStatusIcons = LoadLibraryEx(szBuff, NULL, 0);
if (masMraSettings.hDLLXStatusIcons) {
- if ((dwBuffLen = LoadStringW(masMraSettings.hDLLXStatusIcons, IDS_IDENTIFY, szBuff, MAX_FILEPATH)) == 0 || _wcsnicmp(L"# Custom Status Icons #", szBuff, 23)) {
+ dwBuffLen = LoadString(masMraSettings.hDLLXStatusIcons, IDS_IDENTIFY, szBuff, MAX_FILEPATH);
+ if (dwBuffLen == 0 || _tcsnicmp(_T("# Custom Status Icons #"), szBuff, 23)) {
FreeLibrary(masMraSettings.hDLLXStatusIcons);
masMraSettings.hDLLXStatusIcons = NULL;
}
@@ -117,7 +118,7 @@ extern "C" __declspec(dllexport) int Load(void) pd.fnUninit = (pfnUninitProto)mraProtoUninit;
CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
- DebugPrintCRLFW(L"Load - DONE");
+ DebugPrintCRLFW(_T("Load - DONE"));
return 0;
}
@@ -130,18 +131,18 @@ extern "C" __declspec(dllexport) int Unload(void) }
g_Instances.destroy();
- DebugPrintCRLFW(L"Unload - DONE");
+ DebugPrintCRLFW(_T("Unload - DONE"));
return 0;
}
-static int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
+static int OnModulesLoaded(WPARAM, LPARAM)
{
masMraSettings.dwGlobalPluginRunning = TRUE;
return 0;
}
-int OnPreShutdown(WPARAM wParam, LPARAM lParam)
+int OnPreShutdown(WPARAM, LPARAM)
{
masMraSettings.dwGlobalPluginRunning = FALSE;
return 0;
diff --git a/protocols/MRA/src/Mra.h b/protocols/MRA/src/Mra.h index 673d1d29c4..59f10ec036 100644 --- a/protocols/MRA/src/Mra.h +++ b/protocols/MRA/src/Mra.h @@ -235,29 +235,9 @@ CMStringA MraGetSelfVersionString(); #define IsXStatusValid(XStatus) (((XStatus) && (XStatus)<MRA_XSTATUS_COUNT))
-#define SEND_DLG_ITEM_MESSAGEW(hDlg, nIDDlgItem, Msg, wParam, lParam) SendMessageW(GetDlgItem(hDlg, nIDDlgItem), Msg, wParam, lParam)
-#define SEND_DLG_ITEM_MESSAGEA(hDlg, nIDDlgItem, Msg, wParam, lParam) SendMessageA(GetDlgItem(hDlg, nIDDlgItem), Msg, wParam, lParam)
-#define SEND_DLG_ITEM_MESSAGE(hDlg, nIDDlgItem, Msg, wParam, lParam) SendMessage(GetDlgItem(hDlg, nIDDlgItem), Msg, wParam, lParam)
-
-#define IS_DLG_BUTTON_CHECKED(hDlg, nIDDlgItem) SEND_DLG_ITEM_MESSAGE(hDlg, nIDDlgItem, BM_GETCHECK, NULL, NULL)
-#define CHECK_DLG_BUTTON(hDlg, nIDDlgItem, uCheck) SEND_DLG_ITEM_MESSAGE(hDlg, nIDDlgItem, BM_SETCHECK, (WPARAM)uCheck, NULL)
-
-#define SET_DLG_ITEM_TEXTW(hDlg, nIDDlgItem, lpString) SEND_DLG_ITEM_MESSAGEW(hDlg, nIDDlgItem, WM_SETTEXT, 0, (LPARAM)lpString)
-#define SET_DLG_ITEM_TEXTA(hDlg, nIDDlgItem, lpString) SEND_DLG_ITEM_MESSAGEA(hDlg, nIDDlgItem, WM_SETTEXT, 0, (LPARAM)lpString)
-#define SET_DLG_ITEM_TEXT(hDlg, nIDDlgItem, lpString) SEND_DLG_ITEM_MESSAGE(hDlg, nIDDlgItem, WM_SETTEXT, 0, (LPARAM)lpString)
-
-#define GET_DLG_ITEM_TEXTW(hDlg, nIDDlgItem, lpString, nMaxCount) SEND_DLG_ITEM_MESSAGEW(hDlg, nIDDlgItem, WM_GETTEXT, (WPARAM)nMaxCount, (LPARAM)lpString)
-#define GET_DLG_ITEM_TEXTA(hDlg, nIDDlgItem, lpString, nMaxCount) SEND_DLG_ITEM_MESSAGEA(hDlg, nIDDlgItem, WM_GETTEXT, (WPARAM)nMaxCount, (LPARAM)lpString)
-#define GET_DLG_ITEM_TEXT(hDlg, nIDDlgItem, lpString, nMaxCount) SEND_DLG_ITEM_MESSAGE(hDlg, nIDDlgItem, WM_GETTEXT, (WPARAM)nMaxCount, (LPARAM)lpString)
-
-#define GET_DLG_ITEM_TEXT_LENGTH(hDlg, nIDDlgItem) SEND_DLG_ITEM_MESSAGE(hDlg, nIDDlgItem, WM_GETTEXTLENGTH, NULL, NULL)
-#define GET_WINDOW_TEXT_LENGTH(hDlg) SendMessage(hDlg, WM_GETTEXTLENGTH, NULL, NULL)
-
-#define GET_CURRENT_COMBO_DATA(hWndDlg, ControlID) SEND_DLG_ITEM_MESSAGE(hWndDlg, ControlID, CB_GETITEMDATA, SEND_DLG_ITEM_MESSAGE(hWndDlg, ControlID, CB_GETCURSEL, 0, 0), 0)
+#define GET_CURRENT_COMBO_DATA(hWndDlg, ControlID) SendDlgItemMessage(hWndDlg, ControlID, CB_GETITEMDATA, SendDlgItemMessage(hWndDlg, ControlID, CB_GETCURSEL, 0, 0), 0)
#define IsFileExist(FileName) (GetFileAttributes(FileName) != INVALID_FILE_ATTRIBUTES)
-#define IsFileExistA(FileName) (GetFileAttributesA(FileName) != INVALID_FILE_ATTRIBUTES)
-#define IsFileExistW(FileName) (GetFileAttributesW(FileName) != INVALID_FILE_ATTRIBUTES)
#define IsThreadAlive(hThread) (GetThreadPriority(hThread) != THREAD_PRIORITY_ERROR_RETURN)
diff --git a/protocols/MRA/src/MraAdvancedSearch.cpp b/protocols/MRA/src/MraAdvancedSearch.cpp index 43df36e4d9..486f2d3d3f 100644 --- a/protocols/MRA/src/MraAdvancedSearch.cpp +++ b/protocols/MRA/src/MraAdvancedSearch.cpp @@ -14,42 +14,42 @@ struct FieldNames static const FieldNames GenderField[] =
{
- {1, L"Male"},
- {2, L"Female"},
+ {1, LPGENT("Male")},
+ {2, LPGENT("Female")},
{-1, NULL}
};
static const FieldNames MonthField[] =
{
- {1, L"January"},
- {2, L"February"},
- {3, L"March"},
- {4, L"April"},
- {5, L"May"},
- {6, L"June"},
- {7, L"July"},
- {8, L"August"},
- {9, L"September"},
- {10, L"October"},
- {11, L"November"},
- {12, L"December"},
+ {1, LPGENT("January")},
+ {2, LPGENT("February")},
+ {3, LPGENT("March")},
+ {4, LPGENT("April")},
+ {5, LPGENT("May")},
+ {6, LPGENT("June")},
+ {7, LPGENT("July")},
+ {8, LPGENT("August")},
+ {9, LPGENT("September")},
+ {10, LPGENT("October")},
+ {11, LPGENT("November")},
+ {12, LPGENT("December")},
{-1, NULL}
};
static const FieldNames ZodiakField[] =
{
- {1, L"Aries"},
- {2, L"Taurus"},
- {3, L"Gemini"},
- {4, L"Cancer"},
- {5, L"Leo"},
- {6, L"Virgo"},
- {7, L"Libra"},
- {8, L"Scorpio"},
- {9, L"Sagitarius"},
- {10, L"Capricorn"},
- {11, L"Aquarius"},
- {12, L"Pisces"},
+ {1, LPGENT("Aries")},
+ {2, LPGENT("Taurus")},
+ {3, LPGENT("Gemini")},
+ {4, LPGENT("Cancer")},
+ {5, LPGENT("Leo")},
+ {6, LPGENT("Virgo")},
+ {7, LPGENT("Libra")},
+ {8, LPGENT("Scorpio")},
+ {9, LPGENT("Sagitarius")},
+ {10, LPGENT("Capricorn")},
+ {11, LPGENT("Aquarius")},
+ {12, LPGENT("Pisces")},
{-1, NULL}
};
@@ -60,10 +60,8 @@ static const FieldNames ZodiakField[] = void ResetComboBox(HWND hWndCombo)
{
- DWORD dwItem;
-
SendMessage(hWndCombo, CB_RESETCONTENT, 0, 0);
- dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)L"");
+ DWORD dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)_T(""));
SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, 0);
SendMessage(hWndCombo, CB_SETCURSEL, dwItem, 0);
}
@@ -71,13 +69,11 @@ void ResetComboBox(HWND hWndCombo) void InitComboBox(HWND hWndCombo, FieldNames *lpNames)
{
- DWORD dwItem;
-
ResetComboBox(hWndCombo);
for (size_t i = 0;lpNames[i].lpszText;i++)
{
- dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)TranslateW(lpNames[i].lpszText));
+ DWORD dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)TranslateTS(lpNames[i].lpszText));
SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, lpNames[i].dwCode);
}
}
@@ -85,15 +81,13 @@ void InitComboBox(HWND hWndCombo, FieldNames *lpNames) void InitComboBoxNumders(HWND hWndCombo, DWORD dwStart, DWORD dwEnd)
{
- DWORD dwItem;
- WCHAR szBuff[MAX_PATH];
-
ResetComboBox(hWndCombo);
for (DWORD i = dwStart;i <= dwEnd;i++)
{
- mir_sntprintf(szBuff, SIZEOF(szBuff), L"%lu", i);
- dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)szBuff);
+ TCHAR szBuff[MAX_PATH];
+ mir_sntprintf(szBuff, SIZEOF(szBuff), _T("%lu"), i);
+ DWORD dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)szBuff);
SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, i);
}
}
@@ -106,7 +100,6 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg, UINT message, WPARAM wParam switch (message) {
case WM_INITDIALOG:
{
- HWND hWndCombo;
DWORD dwItem;
WCHAR wszBuff[MAX_PATH];
SYSTEMTIME stTime;
@@ -116,7 +109,7 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg, UINT message, WPARAM wParam ppro = (CMraProto*)lParam;
//InitComboBox(GetDlgItem(hWndDlg, IDC_EMAIL_DOMAIN), (FieldNames*)DomainField);
{
- hWndCombo = GetDlgItem(hWndDlg, IDC_EMAIL_DOMAIN);
+ HWND hWndCombo = GetDlgItem(hWndDlg, IDC_EMAIL_DOMAIN);
ResetComboBox(hWndCombo);
for (size_t i = 0;lpcszMailRuDomains[i];i++)
{
@@ -132,7 +125,7 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg, UINT message, WPARAM wParam InitComboBoxNumders(GetDlgItem(hWndDlg, IDC_BIRTHDAY_YEAR), 1900, (DWORD)stTime.wYear);
InitComboBox(GetDlgItem(hWndDlg, IDC_ZODIAK), (FieldNames*)ZodiakField);
- hWndCombo = GetDlgItem(hWndDlg, IDC_COUNTRY);
+ HWND hWndCombo = GetDlgItem(hWndDlg, IDC_COUNTRY);
ResetComboBox(hWndCombo);
for (size_t i = 0;mrapPlaces[i].lpszData;i++)
{
@@ -147,46 +140,46 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg, UINT message, WPARAM wParam ResetComboBox(GetDlgItem(hWndDlg, IDC_CITY));
if ( ppro->getByte("AdvancedSearchRemember", MRA_DEFAULT_SEARCH_REMEMBER)) {
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_GENDER, CB_SETCURSEL, ppro->getWord("AdvancedSearchGender", 0), 0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_FROM, CB_SETCURSEL, ppro->getWord("AdvancedSearchAgeFrom", 0), 0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_TO, CB_SETCURSEL, ppro->getWord("AdvancedSearchAgeTo", 0), 0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_MONTH, CB_SETCURSEL, ppro->getWord("AdvancedSearchBirthDayMonth", 0), 0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_DAY, CB_SETCURSEL, ppro->getWord("AdvancedSearchBirthDayDay", 0), 0);
+ SendDlgItemMessage(hWndDlg, IDC_GENDER, CB_SETCURSEL, ppro->getWord("AdvancedSearchGender", 0), 0);
+ SendDlgItemMessage(hWndDlg, IDC_AGERANGE_FROM, CB_SETCURSEL, ppro->getWord("AdvancedSearchAgeFrom", 0), 0);
+ SendDlgItemMessage(hWndDlg, IDC_AGERANGE_TO, CB_SETCURSEL, ppro->getWord("AdvancedSearchAgeTo", 0), 0);
+ SendDlgItemMessage(hWndDlg, IDC_BIRTHDAY_MONTH, CB_SETCURSEL, ppro->getWord("AdvancedSearchBirthDayMonth", 0), 0);
+ SendDlgItemMessage(hWndDlg, IDC_BIRTHDAY_DAY, CB_SETCURSEL, ppro->getWord("AdvancedSearchBirthDayDay", 0), 0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_ZODIAK, CB_SETCURSEL, ppro->getWord("AdvancedSearchZodiakID", 0), 0);
+ SendDlgItemMessage(hWndDlg, IDC_ZODIAK, CB_SETCURSEL, ppro->getWord("AdvancedSearchZodiakID", 0), 0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_COUNTRY, CB_SETCURSEL, ppro->getWord("AdvancedSearchCountryID", 0), 0);
+ SendDlgItemMessage(hWndDlg, IDC_COUNTRY, CB_SETCURSEL, ppro->getWord("AdvancedSearchCountryID", 0), 0);
SendMessageW(hWndDlg, WM_COMMAND, (WPARAM)MAKELONG(IDC_COUNTRY, CBN_SELCHANGE), (LPARAM)GetDlgItem(hWndDlg, IDC_COUNTRY));
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_STATE, CB_SETCURSEL, ppro->getWord("AdvancedSearchStateID", 0), 0);
- SendMessageW(hWndDlg, WM_COMMAND, (WPARAM)MAKELONG(IDC_STATE, CBN_SELCHANGE), (LPARAM)GetDlgItem(hWndDlg, IDC_STATE));
+ SendDlgItemMessage(hWndDlg, IDC_STATE, CB_SETCURSEL, ppro->getWord("AdvancedSearchStateID", 0), 0);
+ SendMessage(hWndDlg, WM_COMMAND, (WPARAM)MAKELONG(IDC_STATE, CBN_SELCHANGE), (LPARAM)GetDlgItem(hWndDlg, IDC_STATE));
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_CITY, CB_SETCURSEL, ppro->getWord("AdvancedSearchCityID", 0), 0);
+ SendDlgItemMessage(hWndDlg, IDC_CITY, CB_SETCURSEL, ppro->getWord("AdvancedSearchCityID", 0), 0);
- CHECK_DLG_BUTTON(hWndDlg, IDC_ONLINEONLY, ppro->getByte("AdvancedSearchOnlineOnly", FALSE));
- CHECK_DLG_BUTTON(hWndDlg, IDC_CHK_REMEMBER, TRUE);
+ CheckDlgButton(hWndDlg, IDC_ONLINEONLY, ppro->getByte("AdvancedSearchOnlineOnly", FALSE));
+ CheckDlgButton(hWndDlg, IDC_CHK_REMEMBER, TRUE);
}
TranslateDialogDefault(hWndDlg);
}
return TRUE;
case WM_DESTROY:
- ppro->setWord("AdvancedSearchGender", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_GENDER, CB_GETCURSEL, 0, 0));
- ppro->setWord("AdvancedSearchAgeFrom", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_FROM, CB_GETCURSEL, 0, 0));
- ppro->setWord("AdvancedSearchAgeTo", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_TO, CB_GETCURSEL, 0, 0));
- ppro->setWord("AdvancedSearchBirthDayMonth", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_MONTH, CB_GETCURSEL, 0, 0));
- ppro->setWord("AdvancedSearchBirthDayDay", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_DAY, CB_GETCURSEL, 0, 0));
+ ppro->setWord("AdvancedSearchGender", SendDlgItemMessage(hWndDlg, IDC_GENDER, CB_GETCURSEL, 0, 0));
+ ppro->setWord("AdvancedSearchAgeFrom", SendDlgItemMessage(hWndDlg, IDC_AGERANGE_FROM, CB_GETCURSEL, 0, 0));
+ ppro->setWord("AdvancedSearchAgeTo", SendDlgItemMessage(hWndDlg, IDC_AGERANGE_TO, CB_GETCURSEL, 0, 0));
+ ppro->setWord("AdvancedSearchBirthDayMonth", SendDlgItemMessage(hWndDlg, IDC_BIRTHDAY_MONTH, CB_GETCURSEL, 0, 0));
+ ppro->setWord("AdvancedSearchBirthDayDay", SendDlgItemMessage(hWndDlg, IDC_BIRTHDAY_DAY, CB_GETCURSEL, 0, 0));
- ppro->setWord("AdvancedSearchZodiakID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_ZODIAK, CB_GETCURSEL, 0, 0));
+ ppro->setWord("AdvancedSearchZodiakID", SendDlgItemMessage(hWndDlg, IDC_ZODIAK, CB_GETCURSEL, 0, 0));
- ppro->setWord("AdvancedSearchCityID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_CITY, CB_GETCURSEL, 0, 0));
- ppro->setWord("AdvancedSearchStateID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_STATE, CB_GETCURSEL, 0, 0));
- ppro->setWord("AdvancedSearchCountryID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_COUNTRY, CB_GETCURSEL, 0, 0));
+ ppro->setWord("AdvancedSearchCityID", SendDlgItemMessage(hWndDlg, IDC_CITY, CB_GETCURSEL, 0, 0));
+ ppro->setWord("AdvancedSearchStateID", SendDlgItemMessage(hWndDlg, IDC_STATE, CB_GETCURSEL, 0, 0));
+ ppro->setWord("AdvancedSearchCountryID", SendDlgItemMessage(hWndDlg, IDC_COUNTRY, CB_GETCURSEL, 0, 0));
- ppro->setByte("AdvancedSearchOnlineOnly", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ONLINEONLY));
- ppro->setByte("AdvancedSearchRemember", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_REMEMBER));
+ ppro->setByte("AdvancedSearchOnlineOnly", IsDlgButtonChecked(hWndDlg, IDC_ONLINEONLY));
+ ppro->setByte("AdvancedSearchRemember", IsDlgButtonChecked(hWndDlg, IDC_CHK_REMEMBER));
break;
case WM_COMMAND:
@@ -200,10 +193,8 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg, UINT message, WPARAM wParam {
if (LOWORD(wParam) == IDC_AGERANGE_FROM)
{
- DWORD dwAgeFrom, dwAgeTo;
-
- dwAgeFrom = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_AGERANGE_FROM);
- dwAgeTo = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_AGERANGE_TO);
+ DWORD dwAgeFrom = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_AGERANGE_FROM);
+ DWORD dwAgeTo = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_AGERANGE_TO);
if (dwAgeFrom == 0) dwAgeFrom++;
InitComboBoxNumders(GetDlgItem(hWndDlg, IDC_AGERANGE_TO), dwAgeFrom, 100);
SendMessage(GetDlgItem(hWndDlg, IDC_AGERANGE_TO), CB_SETCURSEL, ((dwAgeTo-dwAgeFrom)+1), 0);
@@ -216,14 +207,13 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg, UINT message, WPARAM wParam case IDC_BIRTHDAY_YEAR:
if (HIWORD(wParam) == CBN_SELCHANGE)
{
- DWORD dwAge;
SYSTEMTIME stTime = {0};
stTime.wYear = (WORD)GET_CURRENT_COMBO_DATA(hWndDlg, IDC_BIRTHDAY_YEAR);
stTime.wMonth = (WORD)GET_CURRENT_COMBO_DATA(hWndDlg, IDC_BIRTHDAY_MONTH);
stTime.wDay = (WORD)GET_CURRENT_COMBO_DATA(hWndDlg, IDC_BIRTHDAY_DAY);
- dwAge = GetYears(&stTime);
+ DWORD dwAge = GetYears(&stTime);
SendMessage(GetDlgItem(hWndDlg, IDC_AGERANGE_FROM), CB_SETCURSEL, dwAge, 0);
SendMessage(GetDlgItem(hWndDlg, IDC_AGERANGE_TO), CB_SETCURSEL, dwAge, 0);
SendMessage(GetDlgItem(hWndDlg, IDC_ZODIAK), CB_SETCURSEL, 0, 0);
@@ -232,22 +222,19 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg, UINT message, WPARAM wParam case IDC_ZODIAK:
if (HIWORD(wParam) == CBN_SELCHANGE)
{
- SendMessage(GetDlgItem(hWndDlg, IDC_BIRTHDAY_DAY), CB_SETCURSEL, 0, 0);
- SendMessage(GetDlgItem(hWndDlg, IDC_BIRTHDAY_MONTH), CB_SETCURSEL, 0, 0);
- //SendMessage(GetDlgItem(hWndDlg, IDC_BIRTHDAY_YEAR), CB_SETCURSEL, 0, 0);
+ SendDlgItemMessage(hWndDlg, IDC_BIRTHDAY_DAY, CB_SETCURSEL, 0, 0);
+ SendDlgItemMessage(hWndDlg, IDC_BIRTHDAY_MONTH, CB_SETCURSEL, 0, 0);
+ //SendDlgItemMessage(hWndDlg, IDC_BIRTHDAY_YEAR, CB_SETCURSEL, 0, 0);
}
break;
case IDC_COUNTRY:
if (HIWORD(wParam) == CBN_SELCHANGE)
{
- HWND hWndCombo;
- DWORD dwItem, dwCountryID;
-
- dwCountryID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COUNTRY);
- hWndCombo = GetDlgItem(hWndDlg, IDC_STATE);
+ DWORD dwCountryID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COUNTRY);
+ HWND hWndCombo = GetDlgItem(hWndDlg, IDC_STATE);
SendMessage(hWndCombo, CB_RESETCONTENT, 0, 0);
ResetComboBox(GetDlgItem(hWndDlg, IDC_CITY));
- dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)L"");
+ DWORD dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)_T(""));
SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, 0);
SendMessage(hWndCombo, CB_SETCURSEL, dwItem, 0);
@@ -264,14 +251,11 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg, UINT message, WPARAM wParam case IDC_STATE:
if (HIWORD(wParam) == CBN_SELCHANGE)
{
- HWND hWndCombo;
- DWORD dwItem, dwCountryID, dwStateID;
-
- dwCountryID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COUNTRY);
- dwStateID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_STATE);
- hWndCombo = GetDlgItem(hWndDlg, IDC_CITY);
+ DWORD dwCountryID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COUNTRY);
+ DWORD dwStateID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_STATE);
+ HWND hWndCombo = GetDlgItem(hWndDlg, IDC_CITY);
SendMessage(hWndCombo, CB_RESETCONTENT, 0, 0);
- dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)L"");
+ DWORD dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)_T(""));
SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, 0);
SendMessage(hWndCombo, CB_SETCURSEL, dwItem, 0);
@@ -298,55 +282,53 @@ return FALSE; HWND CMraProto::SearchAdvanced(HWND hWndDlg)
{
DWORD dwRequestFlags = 0;
- CHAR szUser[MAX_PATH], szDomain[MAX_PATH];
- WCHAR wszNickName[MAX_PATH], wszFirstName[MAX_PATH], wszLastName[MAX_PATH];
- size_t dwUserSize, dwDomainSize, dwNickNameSize, dwFirstNameSize, dwLastNameSize;
- DWORD dwSex, dwDate1, dwDate2, dwCityID, dwZodiak, dwBirthdayMonth, dwBirthdayDay, dwCountryID, dwOnline;
+ char szUser[MAX_PATH], szDomain[MAX_PATH];
+ TCHAR wszNickName[MAX_PATH], wszFirstName[MAX_PATH], wszLastName[MAX_PATH];
- dwUserSize = GET_DLG_ITEM_TEXTA(hWndDlg, IDC_EMAIL_USER, szUser, SIZEOF(szUser));
- dwDomainSize = GET_DLG_ITEM_TEXTA(hWndDlg, IDC_EMAIL_DOMAIN, szDomain, SIZEOF(szDomain));
+ size_t dwUserSize = GetDlgItemTextA(hWndDlg, IDC_EMAIL_USER, szUser, SIZEOF(szUser));
+ size_t dwDomainSize = GetDlgItemTextA(hWndDlg, IDC_EMAIL_DOMAIN, szDomain, SIZEOF(szDomain));
if (dwUserSize && dwDomainSize)
{
SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_USER);
SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_DOMAIN);
}
- dwNickNameSize = GET_DLG_ITEM_TEXT(hWndDlg, IDC_NICK, wszNickName, SIZEOF(wszNickName));
+ size_t dwNickNameSize = GetDlgItemText(hWndDlg, IDC_NICK, wszNickName, SIZEOF(wszNickName));
if (dwNickNameSize) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_NICKNAME);
- dwFirstNameSize = GET_DLG_ITEM_TEXT(hWndDlg, IDC_FIRSTNAME, wszFirstName, SIZEOF(wszFirstName));
+ size_t dwFirstNameSize = GetDlgItemText(hWndDlg, IDC_FIRSTNAME, wszFirstName, SIZEOF(wszFirstName));
if (dwFirstNameSize) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME);
- dwLastNameSize = GET_DLG_ITEM_TEXT(hWndDlg, IDC_LASTNAME, wszLastName, SIZEOF(wszLastName));
+ size_t dwLastNameSize = GetDlgItemText(hWndDlg, IDC_LASTNAME, wszLastName, SIZEOF(wszLastName));
if (dwLastNameSize) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_LASTNAME);
- dwSex = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_GENDER);
+ DWORD dwSex = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_GENDER);
if (dwSex) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_SEX);
- dwDate1 = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_AGERANGE_FROM);
+ DWORD dwDate1 = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_AGERANGE_FROM);
if (dwDate1) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_DATE1);
- dwDate2 = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_AGERANGE_TO);
+ DWORD dwDate2 = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_AGERANGE_TO);
if (dwDate2) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_DATE2);
- dwCityID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_CITY);
+ DWORD dwCityID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_CITY);
if (dwCityID == 0) dwCityID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_STATE);
if (dwCityID) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_CITY_ID);
- dwZodiak = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_ZODIAK);
+ DWORD dwZodiak = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_ZODIAK);
if (dwZodiak) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_ZODIAC);
- dwBirthdayMonth = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_BIRTHDAY_MONTH);
+ DWORD dwBirthdayMonth = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_BIRTHDAY_MONTH);
if (dwBirthdayMonth) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH);
- dwBirthdayDay = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_BIRTHDAY_DAY);
+ DWORD dwBirthdayDay = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_BIRTHDAY_DAY);
if (dwBirthdayMonth) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY);
- dwCountryID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COUNTRY);
+ DWORD dwCountryID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COUNTRY);
if (dwCountryID) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID);
- dwOnline = IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ONLINEONLY);
+ DWORD dwOnline = IsDlgButtonChecked(hWndDlg, IDC_ONLINEONLY);
if (dwOnline) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_ONLINE);
return (HWND)MraWPRequestW(NULL, ACKTYPE_SEARCH, dwRequestFlags, szUser, szDomain, wszNickName, wszFirstName, wszLastName, dwSex, dwDate1, dwDate2, dwCityID, dwZodiak, dwBirthdayMonth, dwBirthdayDay, dwCountryID, dwOnline);
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index 371415862f..e5d12e6735 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -65,7 +65,7 @@ DWORD CMraProto::MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle) DWORD dwRetErrorCode = FifoMTInitialize(pmraaqAvatarsQueue, 0);
if (dwRetErrorCode == NO_ERROR) {
- CHAR szBuffer[MAX_PATH];
+ char szBuffer[MAX_PATH];
mir_snprintf(szBuffer, SIZEOF(szBuffer), "%s %s", m_szModuleName, Translate("Avatars' plugin connections"));
NETLIBUSER nlu = {0};
@@ -250,7 +250,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) break;
default:
- mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateW(L"Avatars: server return HTTP code: %lu"), dwResultCode);
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateT("Avatars: server return HTTP code: %lu"), dwResultCode);
ShowFormattedErrorMessage(szErrorText, NO_ERROR);
break;
}
@@ -311,7 +311,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) }
else {
dwErrorCode = GetLastError();
- mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateW(L"Avatars: cant open file %s, error"), wszFileName);
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateT("Avatars: cant open file %s, error"), wszFileName);
ShowFormattedErrorMessage(szErrorText, dwErrorCode);
}
}
@@ -467,10 +467,10 @@ bool CMraProto::MraAvatarsGetContactTime(HANDLE hContact, LPSTR lpszValueName, S if (mraGetStringA(hContact, lpszValueName, szBuff))
if (InternetTimeGetTime(szBuff, itAvatarLastModifiedTimeLocal) == NO_ERROR) {
memmove(pstTime, &itAvatarLastModifiedTimeLocal.stTime, sizeof(SYSTEMTIME));
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
@@ -503,15 +503,15 @@ DWORD CMraProto::MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HANDLE hConta MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = (MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
- WCHAR wszBase[MAX_PATH];
+ TCHAR tszBase[MAX_PATH];
if (pmraaqAvatarsQueue->hAvatarsPath == NULL)
// default path
- mir_snwprintf(wszBase, SIZEOF(wszBase), _T("%s\\%s\\"), (TCHAR*)VARST( _T("%miranda_avatarcache%")), m_tszUserName);
+ mir_sntprintf(tszBase, MAX_PATH, _T("%s\\%s\\"), VARST( _T("%miranda_avatarcache%")), m_tszUserName);
else {
- FoldersGetCustomPathW(pmraaqAvatarsQueue->hAvatarsPath, wszBase, SIZEOF(wszBase), _T(""));
- wcscat(wszBase, L"\\");
+ FoldersGetCustomPathT(pmraaqAvatarsQueue->hAvatarsPath, tszBase, MAX_PATH, _T(""));
+ _tcsncat(tszBase, _T("\\"), MAX_PATH);
}
- res = wszBase;
+ res = tszBase;
// some path in buff and free space for file name is avaible
CreateDirectoryTreeT(res);
@@ -622,30 +622,30 @@ INT_PTR CALLBACK MraAvatarsQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wPara SetWindowLongPtr(hWndDlg, GWLP_USERDATA, lParam);
ppro = (CMraProto*)lParam;
{
- CHECK_DLG_BUTTON(hWndDlg, IDC_ENABLE, db_get_b(NULL, MRA_AVT_SECT_NAME, "Enable", MRA_AVT_DEFAULT_ENABLE));
+ CheckDlgButton(hWndDlg, IDC_ENABLE, db_get_b(NULL, MRA_AVT_SECT_NAME, "Enable", MRA_AVT_DEFAULT_ENABLE));
CMStringW szServer;
if (DB_GetStringW(NULL, MRA_AVT_SECT_NAME, "Server", szServer))
- SET_DLG_ITEM_TEXT(hWndDlg, IDC_SERVER, szServer.c_str());
+ SetDlgItemText(hWndDlg, IDC_SERVER, szServer.c_str());
else
- SET_DLG_ITEM_TEXTA(hWndDlg, IDC_SERVER, MRA_AVT_DEFAULT_SERVER);
+ SetDlgItemTextA(hWndDlg, IDC_SERVER, MRA_AVT_DEFAULT_SERVER);
SetDlgItemInt(hWndDlg, IDC_SERVERPORT, db_get_dw(NULL, MRA_AVT_SECT_NAME, "ServerPort", MRA_AVT_DEFAULT_SERVER_PORT), FALSE);
- CHECK_DLG_BUTTON(hWndDlg, IDC_USE_KEEPALIVE_CONN, db_get_b(NULL, MRA_AVT_SECT_NAME, "UseKeepAliveConn", MRA_AVT_DEFAULT_USE_KEEPALIVE_CONN));
+ CheckDlgButton(hWndDlg, IDC_USE_KEEPALIVE_CONN, db_get_b(NULL, MRA_AVT_SECT_NAME, "UseKeepAliveConn", MRA_AVT_DEFAULT_USE_KEEPALIVE_CONN));
SetDlgItemInt(hWndDlg, IDC_UPD_CHECK_INTERVAL, db_get_dw(NULL, MRA_AVT_SECT_NAME, "CheckInterval", MRA_AVT_DEFAULT_CHK_INTERVAL), FALSE);
- CHECK_DLG_BUTTON(hWndDlg, IDC_RETURN_ABC_PATH, db_get_b(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", MRA_AVT_DEFAULT_RET_ABC_PATH));
- CHECK_DLG_BUTTON(hWndDlg, IDC_DELETE_AVT_ON_CONTACT_DELETE, db_get_b(NULL, MRA_AVT_SECT_NAME, "DeleteAvtOnContactDelete", MRA_DELETE_AVT_ON_CONTACT_DELETE));
+ CheckDlgButton(hWndDlg, IDC_RETURN_ABC_PATH, db_get_b(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", MRA_AVT_DEFAULT_RET_ABC_PATH));
+ CheckDlgButton(hWndDlg, IDC_DELETE_AVT_ON_CONTACT_DELETE, db_get_b(NULL, MRA_AVT_SECT_NAME, "DeleteAvtOnContactDelete", MRA_DELETE_AVT_ON_CONTACT_DELETE));
- EnableControlsArray(hWndDlg, (WORD*)&wMraAvatarsControlsList, SIZEOF(wMraAvatarsControlsList), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ENABLE));
+ EnableControlsArray(hWndDlg, (WORD*)&wMraAvatarsControlsList, SIZEOF(wMraAvatarsControlsList), IsDlgButtonChecked(hWndDlg, IDC_ENABLE));
}
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDC_ENABLE)
- EnableControlsArray(hWndDlg, (WORD*)&wMraAvatarsControlsList, SIZEOF(wMraAvatarsControlsList), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ENABLE));
+ EnableControlsArray(hWndDlg, (WORD*)&wMraAvatarsControlsList, SIZEOF(wMraAvatarsControlsList), IsDlgButtonChecked(hWndDlg, IDC_ENABLE));
if (LOWORD(wParam) == IDC_BUTTON_DEFAULT) {
- SET_DLG_ITEM_TEXTA(hWndDlg, IDC_SERVER, MRA_AVT_DEFAULT_SERVER);
+ SetDlgItemTextA(hWndDlg, IDC_SERVER, MRA_AVT_DEFAULT_SERVER);
SetDlgItemInt(hWndDlg, IDC_SERVERPORT, MRA_AVT_DEFAULT_SERVER_PORT, FALSE);
}
@@ -657,17 +657,16 @@ INT_PTR CALLBACK MraAvatarsQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wPara switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
{
- WCHAR szServer[MAX_PATH];
-
- db_set_b(NULL, MRA_AVT_SECT_NAME, "Enable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ENABLE));
- db_set_b(NULL, MRA_AVT_SECT_NAME, "DeleteAvtOnContactDelete", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_DELETE_AVT_ON_CONTACT_DELETE));
- db_set_b(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RETURN_ABC_PATH));
+ db_set_b(NULL, MRA_AVT_SECT_NAME, "Enable", IsDlgButtonChecked(hWndDlg, IDC_ENABLE));
+ db_set_b(NULL, MRA_AVT_SECT_NAME, "DeleteAvtOnContactDelete", IsDlgButtonChecked(hWndDlg, IDC_DELETE_AVT_ON_CONTACT_DELETE));
+ db_set_b(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", IsDlgButtonChecked(hWndDlg, IDC_RETURN_ABC_PATH));
db_set_dw(NULL, MRA_AVT_SECT_NAME, "CheckInterval", GetDlgItemInt(hWndDlg, IDC_UPD_CHECK_INTERVAL, NULL, FALSE));
- db_set_b(NULL, MRA_AVT_SECT_NAME, "UseKeepAliveConn", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_USE_KEEPALIVE_CONN));
+ db_set_b(NULL, MRA_AVT_SECT_NAME, "UseKeepAliveConn", IsDlgButtonChecked(hWndDlg, IDC_USE_KEEPALIVE_CONN));
db_set_dw(NULL, MRA_AVT_SECT_NAME, "ServerPort", GetDlgItemInt(hWndDlg, IDC_SERVERPORT, NULL, FALSE));
- GET_DLG_ITEM_TEXT(hWndDlg, IDC_SERVER, szServer, SIZEOF(szServer));
- db_set_ws(NULL, MRA_AVT_SECT_NAME, "Server", szServer);
+ TCHAR szServer[MAX_PATH];
+ GetDlgItemText(hWndDlg, IDC_SERVER, szServer, SIZEOF(szServer));
+ db_set_ts(NULL, MRA_AVT_SECT_NAME, "Server", szServer);
}
return TRUE;
}
diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp index c7e8e2c209..11541b3d20 100644 --- a/protocols/MRA/src/MraChat.cpp +++ b/protocols/MRA/src/MraChat.cpp @@ -9,7 +9,7 @@ static LPWSTR lpwszStatuses[] = { L"Owners", L"Inviter", L"Visitors" }; void CMraProto::MraChatDllError()
{
- MessageBoxW(NULL, TranslateW(L"CHAT plugin is required for conferences. Install it before chatting"), m_tszUserName, (MB_OK|MB_ICONWARNING));
+ MessageBox(NULL, TranslateT("CHAT plugin is required for conferences. Install it before chatting"), m_tszUserName, (MB_OK|MB_ICONWARNING));
}
bool CMraProto::MraChatRegister()
@@ -43,8 +43,8 @@ INT_PTR CMraProto::MraChatSessionNew(HANDLE hContact) gcw.pszModule = m_szModuleName;
gcw.ptszName = GetContactNameW(hContact);
gcw.ptszID = wszEMail;
- gcw.ptszStatusbarText = L"status bar";
- gcw.dwFlags = GC_UNICODE;
+ gcw.ptszStatusbarText = _T("status bar");
+ gcw.dwFlags = GC_TCHAR;
gcw.dwItemData = (DWORD)hContact;
if ( !CallServiceSync(MS_GC_NEWSESSION, NULL, (LPARAM)&gcw)) {
GCDEST gcd = {0};
@@ -58,7 +58,7 @@ INT_PTR CMraProto::MraChatSessionNew(HANDLE hContact) gce.pDest = &gcd;
gce.dwFlags = GC_UNICODE;
for (int i = 0; i < SIZEOF(lpwszStatuses); i++) {
- gce.ptszStatus = TranslateW(lpwszStatuses[i]);
+ gce.ptszStatus = TranslateTS(lpwszStatuses[i]);
CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
}
@@ -72,7 +72,7 @@ INT_PTR CMraProto::MraChatSessionNew(HANDLE hContact) DWORD opcode = MULTICHAT_GET_MEMBERS;
CMStringA szEmail;
mraGetStringA(hContact, "e-mail", szEmail);
- MraMessage(FALSE, NULL, 0, MESSAGE_FLAG_MULTICHAT, szEmail, L"", (LPBYTE)&opcode, sizeof(opcode));
+ MraMessage(FALSE, NULL, 0, MESSAGE_FLAG_MULTICHAT, szEmail, _T(""), (LPBYTE)&opcode, sizeof(opcode));
return 0;
}
}
@@ -155,7 +155,7 @@ INT_PTR CMraProto::MraChatSessionInvite(HANDLE hContactChatSession, const CMStri return 1;
CMStringW wszBuff;
- wszBuff.Format(L"[%s]: %s", _A2T(lpszEMailInMultiChat.c_str()), TranslateW(L"invite sender"));
+ wszBuff.Format(L"[%s]: %s", _A2T(lpszEMailInMultiChat.c_str()), TranslateT("invite sender"));
return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, wszBuff, 0, dwTime);
}
@@ -165,14 +165,14 @@ INT_PTR CMraProto::MraChatSessionMembersAdd(HANDLE hContactChatSession, const CM return 1;
CMStringW wszBuff;
- wszBuff.Format(L"[%s]: %s", _A2T(lpszEMailInMultiChat), TranslateW(L"invite new members"));
+ wszBuff.Format(L"[%s]: %s", _A2T(lpszEMailInMultiChat), TranslateT("invite new members"));
return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, NULL, wszBuff, 0, dwTime);
}
INT_PTR CMraProto::MraChatSessionJoinUser(HANDLE hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
{
if (hContactChatSession)
- return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_JOIN, GCEF_ADDTOLOG, lpszEMailInMultiChat, lpwszStatuses[MRA_CHAT_STATUS_VISITOR], L"", 0, dwTime);
+ return MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_JOIN, GCEF_ADDTOLOG, lpszEMailInMultiChat, lpwszStatuses[MRA_CHAT_STATUS_VISITOR], _T(""), 0, dwTime);
return 1;
}
diff --git a/protocols/MRA/src/MraConstans.h b/protocols/MRA/src/MraConstans.h index 00c6bb6f0f..562e847c37 100644 --- a/protocols/MRA/src/MraConstans.h +++ b/protocols/MRA/src/MraConstans.h @@ -81,7 +81,7 @@ static const LPSTR lpcszMailRuDomains[] = #define MRA_EDIT_PROFILE_URL "http://win.mail.ru/cgi-bin/userinfo?mra=1"
#define MRA_CHAT_URL "http://chat.mail.ru"
#define MRA_ZHUKI_URL "http://zhuki.mail.ru"
-#define MRA_SEARCH_URL "http://go.mail.ru"
+#define MRA_SEARCH_URL _T("http://go.mail.ru")
// used spesialy! added: /domain/user
#define MRA_BLOGS_URL "http://blogs.mail.ru"
@@ -91,8 +91,8 @@ static const LPSTR lpcszMailRuDomains[] = #define MRA_WORLD_URL "http://my.mail.ru"
// without auth
-#define MRA_REGISTER_URL "http://win.mail.ru/cgi-bin/signup"
-#define MRA_FORGOT_PASSWORD_URL "http://win.mail.ru/cgi-bin/passremind"
+#define MRA_REGISTER_URL _T("http://win.mail.ru/cgi-bin/signup")
+#define MRA_FORGOT_PASSWORD_URL _T("http://win.mail.ru/cgi-bin/passremind")
// wParam = (WPARAM)hContact
@@ -169,7 +169,7 @@ static const LPSTR lpcszMailRuDomains[] = #define MRA_DEFAULT_SLOW_SEND TRUE
#define MRA_DEFAULT_CVT_SMILES_TO_TAGS TRUE
#define MRA_DEFAULT_MIRVER_RAW FALSE // hidden option
-#define MRA_DEFAULT_AUTH_MESSAGE LPGENT("Please authorize me")
+#define MRA_DEFAULT_AUTH_MESSAGE LPGEN("Please authorize me")
#define MRA_DEFAULT_RTF_RECEIVE_ENABLE FALSE
#define MRA_DEFAULT_RTF_SEND_ENABLE TRUE
diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp index 3eddf3dd21..da0c5e435c 100644 --- a/protocols/MRA/src/MraFilesQueue.cpp +++ b/protocols/MRA/src/MraFilesQueue.cpp @@ -68,7 +68,7 @@ static WORD wMraFilesControlsList[] = { void MraFilesQueueDlgEnableDirectConsControls(HWND hWndDlg, BOOL bEnabled)
{
EnableControlsArray(hWndDlg, (WORD*)&wMraFilesControlsList, SIZEOF(wMraFilesControlsList), bEnabled);
- EnableWindow(GetDlgItem(hWndDlg, IDC_FILE_SEND_EXTRA_ADDRESS), (bEnabled && IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS)));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_FILE_SEND_EXTRA_ADDRESS), (bEnabled && IsDlgButtonChecked(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS)));
}
INT_PTR CALLBACK MraFilesQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -81,31 +81,31 @@ INT_PTR CALLBACK MraFilesQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, SetWindowLongPtr(hWndDlg, GWLP_USERDATA, lParam);
ppro = (CMraProto*)lParam;
{
- CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN, ppro->getByte("FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN));
- CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE, ppro->getByte("FileSendNoOutConnOnRcv", MRA_DEF_FS_NO_OUT_CONN_ON_RCV));
- CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONSEND, ppro->getByte("FileSendNoOutConnOnSend", MRA_DEF_FS_NO_OUT_CONN_ON_SEND));
- CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_IGNORYADDITIONALPORTS, ppro->getByte("FileSendIgnoryAdditionalPorts", MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS));
- CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_HIDE_MY_ADDRESSES, ppro->getByte("FileSendHideMyAddresses", MRA_DEF_FS_HIDE_MY_ADDRESSES));
- CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS, ppro->getByte("FileSendAddExtraAddresses", MRA_DEF_FS_ADD_EXTRA_ADDRESSES));
+ CheckDlgButton(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN, ppro->getByte("FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN));
+ CheckDlgButton(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE, ppro->getByte("FileSendNoOutConnOnRcv", MRA_DEF_FS_NO_OUT_CONN_ON_RCV));
+ CheckDlgButton(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONSEND, ppro->getByte("FileSendNoOutConnOnSend", MRA_DEF_FS_NO_OUT_CONN_ON_SEND));
+ CheckDlgButton(hWndDlg, IDC_FILE_SEND_IGNORYADDITIONALPORTS, ppro->getByte("FileSendIgnoryAdditionalPorts", MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS));
+ CheckDlgButton(hWndDlg, IDC_FILE_SEND_HIDE_MY_ADDRESSES, ppro->getByte("FileSendHideMyAddresses", MRA_DEF_FS_HIDE_MY_ADDRESSES));
+ CheckDlgButton(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS, ppro->getByte("FileSendAddExtraAddresses", MRA_DEF_FS_ADD_EXTRA_ADDRESSES));
CMStringW szBuff;
if (ppro->mraGetStringW(NULL, "FileSendExtraAddresses", szBuff))
- SET_DLG_ITEM_TEXT(hWndDlg, IDC_FILE_SEND_EXTRA_ADDRESS, szBuff.c_str());
+ SetDlgItemText(hWndDlg, IDC_FILE_SEND_EXTRA_ADDRESS, szBuff.c_str());
- CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS, ppro->getByte("FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS));
+ CheckDlgButton(hWndDlg, IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS, ppro->getByte("FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS));
SetDlgItemInt(hWndDlg, IDC_FILE_SEND_BLOCK_SIZE, ppro->getDword("FileSendBlockSize", MRA_DEFAULT_FILE_SEND_BLOCK_SIZE), FALSE);
- MraFilesQueueDlgEnableDirectConsControls(hWndDlg, IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN));
+ MraFilesQueueDlgEnableDirectConsControls(hWndDlg, IsDlgButtonChecked(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN));
}
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDC_FILE_SEND_ENABLE_DIRECT_CONN)
- MraFilesQueueDlgEnableDirectConsControls(hWndDlg, IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN));
+ MraFilesQueueDlgEnableDirectConsControls(hWndDlg, IsDlgButtonChecked(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN));
if (LOWORD(wParam) == IDC_FILE_SEND_ADD_EXTRA_ADDRESS)
- EnableWindow(GetDlgItem(hWndDlg, IDC_FILE_SEND_EXTRA_ADDRESS), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_FILE_SEND_EXTRA_ADDRESS), IsDlgButtonChecked(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS));
if ((LOWORD(wParam) == IDC_FILE_SEND_EXTRA_ADDRESS || LOWORD(wParam) == IDC_FILE_SEND_BLOCK_SIZE) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return FALSE;
SendMessage(GetParent(hWndDlg), PSM_CHANGED, 0, 0);
@@ -117,16 +117,16 @@ INT_PTR CALLBACK MraFilesQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, {
WCHAR szBuff[MAX_PATH];
- ppro->setByte("FileSendEnableDirectConn", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN));
- ppro->setByte("FileSendNoOutConnOnRcv", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE));
- ppro->setByte("FileSendNoOutConnOnSend", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONSEND));
- ppro->setByte("FileSendIgnoryAdditionalPorts", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_IGNORYADDITIONALPORTS));
- ppro->setByte("FileSendHideMyAddresses", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_HIDE_MY_ADDRESSES));
- ppro->setByte("FileSendAddExtraAddresses", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS));
- GET_DLG_ITEM_TEXT(hWndDlg, IDC_FILE_SEND_EXTRA_ADDRESS, szBuff, SIZEOF(szBuff));
+ ppro->setByte("FileSendEnableDirectConn", IsDlgButtonChecked(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN));
+ ppro->setByte("FileSendNoOutConnOnRcv", IsDlgButtonChecked(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE));
+ ppro->setByte("FileSendNoOutConnOnSend", IsDlgButtonChecked(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONSEND));
+ ppro->setByte("FileSendIgnoryAdditionalPorts", IsDlgButtonChecked(hWndDlg, IDC_FILE_SEND_IGNORYADDITIONALPORTS));
+ ppro->setByte("FileSendHideMyAddresses", IsDlgButtonChecked(hWndDlg, IDC_FILE_SEND_HIDE_MY_ADDRESSES));
+ ppro->setByte("FileSendAddExtraAddresses", IsDlgButtonChecked(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS));
+ GetDlgItemText(hWndDlg, IDC_FILE_SEND_EXTRA_ADDRESS, szBuff, SIZEOF(szBuff));
ppro->mraSetStringW(NULL, "FileSendExtraAddresses", szBuff);
ppro->setDword("FileSendBlockSize", (DWORD)GetDlgItemInt(hWndDlg, IDC_FILE_SEND_BLOCK_SIZE, NULL, FALSE));
- ppro->setByte("FileSendEnableMRIMProxyCons", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS));
+ ppro->setByte("FileSendEnableMRIMProxyCons", IsDlgButtonChecked(hWndDlg, IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS));
}
return TRUE;
}
@@ -887,7 +887,7 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) }// end while
}else {// err allocating file disk space
dwRetErrorCode = GetLastError();
- mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateW(L"Receive files: cant allocate disk space for file, size %lu bytes, error"), dat->pmfqfFiles[i].dwSize);
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateT("Receive files: cant allocate disk space for file, size %lu bytes, error"), dat->pmfqfFiles[i].dwSize);
ShowFormattedErrorMessage(szErrorText, dwRetErrorCode);
}
CloseHandle(hFile);
@@ -900,14 +900,14 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) }
}else {// err on open file
dwRetErrorCode = GetLastError();
- mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateW(L"Receive files: cant open file %s, error"), wszFileName);
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateT("Receive files: cant open file %s, error"), wszFileName);
ShowFormattedErrorMessage(szErrorText, dwRetErrorCode);
bFailed = TRUE;
break;
}
}else {// err on send request for file
dwRetErrorCode = GetLastError();
- mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateW(L"Receive files: request for file %s not sended, error"), dat->pmfqfFiles[i].lpwszName);
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateT("Receive files: request for file %s not sended, error"), dat->pmfqfFiles[i].lpwszName);
ShowFormattedErrorMessage(szErrorText, NO_ERROR);
bFailed = TRUE;
break;
@@ -1131,14 +1131,14 @@ void CMraProto::MraFilesQueueSendThreadProc(LPVOID lpParameter) }
else {// err on open file
dwRetErrorCode = GetLastError();
- mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateW(L"Send files: cant open file %s, error"), dat->pmfqfFiles[j].lpwszName);
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateT("Send files: cant open file %s, error"), dat->pmfqfFiles[j].lpwszName);
ShowFormattedErrorMessage(szErrorText, dwRetErrorCode);
bFailed = TRUE;
break;
}
}
else {
- mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateW(L"Send files: requested file: %S - not found in send files list."), (((LPSTR)btBuff)+sizeof(MRA_FT_GET_FILE)));
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateT("Send files: requested file: %S - not found in send files list."), (((LPSTR)btBuff)+sizeof(MRA_FT_GET_FILE)));
ShowFormattedErrorMessage(szErrorText, NO_ERROR);
bFailed = TRUE;
break;
diff --git a/protocols/MRA/src/MraIcons.cpp b/protocols/MRA/src/MraIcons.cpp index 9cf3233c60..9917c681e5 100644 --- a/protocols/MRA/src/MraIcons.cpp +++ b/protocols/MRA/src/MraIcons.cpp @@ -50,7 +50,7 @@ static void AddIcoLibItems(LPWSTR lptszSubSectionName, GUI_DISPLAY_ITEM *pgdiIte {
TCHAR tszSection[MAX_PATH], tszPath[MAX_FILEPATH];
GetModuleFileName(masMraSettings.hInstance, tszPath, SIZEOF(tszPath));
- mir_sntprintf(tszSection, SIZEOF(tszSection), L"Protocols/MRA/%s", lptszSubSectionName);
+ mir_sntprintf(tszSection, SIZEOF(tszSection), _T("Protocols/MRA/%s"), lptszSubSectionName);
SKINICONDESC sid = { sizeof(sid) };
sid.ptszSection = tszSection;
@@ -101,17 +101,17 @@ void IconsLoad() void InitXStatusIcons()
{
- WCHAR wszPath[MAX_FILEPATH];
+ TCHAR tszPath[MAX_FILEPATH];
if (masMraSettings.hDLLXStatusIcons)
- GetModuleFileName(masMraSettings.hDLLXStatusIcons, wszPath, SIZEOF(wszPath));
+ GetModuleFileName(masMraSettings.hDLLXStatusIcons, tszPath, SIZEOF(tszPath));
else
- bzero(wszPath, sizeof(wszPath));
+ bzero(tszPath, sizeof(tszPath));
SKINICONDESC sid = { sizeof(sid) };
- sid.pwszSection = L"Protocols/MRA/"LPGENT("Custom Status");
- sid.pwszDefaultFile = wszPath;
+ sid.ptszSection = LPGENT("Protocols")_T("/")LPGENT("MRA")_T("/")LPGENT("Custom Status");
+ sid.ptszDefaultFile = tszPath;
sid.cx = sid.cy = 16;
- sid.flags = SIDF_ALL_UNICODE;
+ sid.flags = SIDF_ALL_TCHAR;
hXStatusAdvancedStatusIcons[0] = NULL;
for (int i = 1; i < MRA_XSTATUS_COUNT+1; i++) {
@@ -120,7 +120,7 @@ void InitXStatusIcons() sid.pszName = szBuff;
int iCurIndex = i+IDI_XSTATUS1-1;
- sid.pwszDescription = lpcszXStatusNameDef[i];
+ sid.ptszDescription = lpcszXStatusNameDef[i];
sid.iDefaultIndex = -iCurIndex;
hXStatusAdvancedStatusIcons[i] = Skin_AddIcon(&sid);
diff --git a/protocols/MRA/src/MraMPop.cpp b/protocols/MRA/src/MraMPop.cpp index ca40b233e9..d2e5506f6d 100644 --- a/protocols/MRA/src/MraMPop.cpp +++ b/protocols/MRA/src/MraMPop.cpp @@ -129,7 +129,8 @@ DWORD CMraProto::MraMPopSessionQueueStart(HANDLE hMPopSessionQueue) szEmail.MakeLower();
szUrl.Format(MRA_MPOP_AUTH_URL, szEmail, pmpsqMPopSessionQueue->lpszMPOPKey, pmpsqi->lpszUrl);
CallService(MS_UTILS_OPENURL, TRUE, (LPARAM)szUrl.c_str());
- DebugPrint(L"Opening URL: ");DebugPrintCRLFA(szUrl);
+ DebugPrint(_T("Opening URL: "));
+ DebugPrintCRLFA(szUrl);
}
mir_free(pmpsqi);
}
@@ -153,7 +154,8 @@ DWORD MraMPopSessionQueueSetNewMPopKey(HANDLE hMPopSessionQueue, const CMStringA memmove(pmpsqMPopSessionQueue->lpszMPOPKey, szKey, szKey.GetLength());
(*(pmpsqMPopSessionQueue->lpszMPOPKey + szKey.GetLength())) = 0;
- DebugPrint(L"New MPOP session key: ");DebugPrintCRLFA(pmpsqMPopSessionQueue->lpszMPOPKey);
+ DebugPrint(_T("New MPOP session key: "));
+ DebugPrintCRLFA(pmpsqMPopSessionQueue->lpszMPOPKey);
return NO_ERROR;
}
diff --git a/protocols/MRA/src/MraPopUp.cpp b/protocols/MRA/src/MraPopUp.cpp index 896b06f7ee..f33269fd33 100644 --- a/protocols/MRA/src/MraPopUp.cpp +++ b/protocols/MRA/src/MraPopUp.cpp @@ -28,7 +28,7 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR SendMessage(hWndCombo, CB_RESETCONTENT, 0, 0);
for (size_t i = 0; i < POPUPS_TYPES_COUNT; i++) {
- DWORD dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)TranslateW(lpcwszPopupsTypes[i]));
+ DWORD dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)TranslateTS(lpcwszPopupsTypes[i]));
SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, i);
}
SendMessage(hWndCombo, CB_SETCURSEL, 0, 0);
@@ -45,19 +45,19 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR DWORD dwType = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COMBO_POPUP_TYPE);
bEnabled = GetBit(ppro->getDword("PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType);
- CHECK_DLG_BUTTON(hWndDlg, IDC_CHK_ENABLE, bEnabled);
+ CheckDlgButton(hWndDlg, IDC_CHK_ENABLE, bEnabled);
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
bUseWinColors = ppro->getByte(szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS);
- CHECK_DLG_BUTTON(hWndDlg, IDC_CHK_USE_WIN_COLORS, bUseWinColors);
+ CheckDlgButton(hWndDlg, IDC_CHK_USE_WIN_COLORS, bUseWinColors);
EnableWindow(GetDlgItem(hWndDlg, IDC_CHK_USE_WIN_COLORS), bEnabled);
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(szBuff, MRA_DEFAULT_POPUP_COLOR_BACK));
+ SendDlgItemMessage(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(szBuff, MRA_DEFAULT_POPUP_COLOR_BACK));
EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_BACKCOLOR), (bEnabled && bUseWinColors == FALSE));
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT));
+ SendDlgItemMessage(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT));
EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_TEXTCOLOR), (bEnabled && bUseWinColors == FALSE));
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
@@ -69,7 +69,7 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR case IDC_PREVIEW:
{
for (size_t i = 0; i < POPUPS_TYPES_COUNT; i++) {
- ppro->MraPopupShowFromAgentW(i, 0, TranslateW(lpcwszPopupsTypes[i]));
+ ppro->MraPopupShowFromAgentW(i, 0, TranslateTS(lpcwszPopupsTypes[i]));
}
}
break;
@@ -77,8 +77,8 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR case IDC_CHK_ENABLE:
case IDC_CHK_USE_WIN_COLORS:
{
- BOOL bEnabled = IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_ENABLE);
- BOOL bUseWinColors = IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_USE_WIN_COLORS);
+ BOOL bEnabled = IsDlgButtonChecked(hWndDlg, IDC_CHK_ENABLE);
+ BOOL bUseWinColors = IsDlgButtonChecked(hWndDlg, IDC_CHK_USE_WIN_COLORS);
EnableWindow(GetDlgItem(hWndDlg, IDC_CHK_USE_WIN_COLORS), bEnabled);
EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_BACKCOLOR), (bEnabled && bUseWinColors == FALSE));
@@ -99,7 +99,7 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR char szBuff[MAX_PATH];
DWORD dwType = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COMBO_POPUP_TYPE);
DWORD dwPopupsEventFilter = ppro->getDword("PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER);
- if (IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_ENABLE))
+ if (IsDlgButtonChecked(hWndDlg, IDC_CHK_ENABLE))
dwPopupsEventFilter |= (1<<dwType);
else
dwPopupsEventFilter &= ~(1<<dwType);
@@ -107,13 +107,13 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR ppro->setDword("PopupsEventFilter", dwPopupsEventFilter);
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
- ppro->setByte(szBuff, IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_USE_WIN_COLORS));
+ ppro->setByte(szBuff, IsDlgButtonChecked(hWndDlg, IDC_CHK_USE_WIN_COLORS));
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
- ppro->setDword(szBuff, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_GETCOLOUR, 0, 0));
+ ppro->setDword(szBuff, SendDlgItemMessage(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_GETCOLOUR, 0, 0));
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
- ppro->setDword(szBuff, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_GETCOLOUR, 0, 0));
+ ppro->setDword(szBuff, SendDlgItemMessage(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_GETCOLOUR, 0, 0));
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
ppro->setDword(szBuff, GetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, NULL, FALSE));
@@ -234,7 +234,7 @@ void CMraProto::MraPopupShowW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWS if ( ServiceExists(MS_POPUP_ADDPOPUPW)) {
BOOL bUseWinColors;
char szBuff[MAX_PATH];
- POPUPDATAW *ppd = (POPUPDATAW*)mir_calloc(sizeof(POPUPDATAW));
+ POPUPDATAT *ppd = (POPUPDATAT*)mir_calloc(sizeof(POPUPDATAT));
//if ( ServiceExists(MS_POPUP2_SHOW) == FALSE)// yapp used
if (dwType == MRA_POPUP_TYPE_EMAIL_STATUS && hWndEMailPopupStatus) {
@@ -274,10 +274,10 @@ void CMraProto::MraPopupShowW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWS ppd->lchContact = hContact;
if (lpszTitle)
- lstrcpynW(ppd->lpwzContactName, lpszTitle, SIZEOF(ppd->lpwzContactName));
+ lstrcpyn(ppd->lptzContactName, lpszTitle, MAX_CONTACTNAME);
if (lpszMessage)
- lstrcpynW(ppd->lpwzText, lpszMessage, SIZEOF(ppd->lpwzText));
- ppd->PluginWindowProc = (WNDPROC)MraPopupDlgProc;
+ lstrcpyn(ppd->lptzText, lpszMessage, MAX_SECONDLINE);
+ ppd->PluginWindowProc = MraPopupDlgProc;
ppd->PluginData = dat;
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index 9e1a5b104c..3988618950 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -547,7 +547,7 @@ int CMraProto::SetStatus(int iNewStatus) case ID_STATUS_DND:
case ID_STATUS_FREECHAT:
case ID_STATUS_INVISIBLE:
- MraSendNewStatus(m_iDesiredStatus, m_iXStatus, L"", L"");
+ MraSendNewStatus(m_iDesiredStatus, m_iXStatus, _T(""), _T(""));
case ID_STATUS_CONNECTING:
// предотвращаем переход в любой статус (кроме offline) из статуса connecting, если он не вызван самим плагином
if (dwOldStatusMode == ID_STATUS_CONNECTING && iNewStatus != m_iDesiredStatus)
@@ -600,7 +600,7 @@ int CMraProto::SetAwayMsg(int m_iStatus, const TCHAR* msg) // не отправляем новый статусный текст для хстатусов, для хстатусов только эвей сообщения
if (dwStatus != ID_STATUS_ONLINE || IsXStatusValid(dwXStatus) == FALSE) {
dwStatusDescSize = min(dwStatusDescSize, STATUS_DESC_MAX);
- MraSendNewStatus(dwStatus, dwXStatus, L"", msg);
+ MraSendNewStatus(dwStatus, dwXStatus, _T(""), msg);
}
return 0;
}
diff --git a/protocols/MRA/src/MraRTFMsg.cpp b/protocols/MRA/src/MraRTFMsg.cpp index 94c845fa6f..bb19c55578 100644 --- a/protocols/MRA/src/MraRTFMsg.cpp +++ b/protocols/MRA/src/MraRTFMsg.cpp @@ -100,9 +100,9 @@ DWORD MraTextToRTFData(LPSTR lpszMessage, size_t dwMessageSize, LPSTR lpszMessag bool MraIsMessageFlashAnimation(const CMStringW &lpwszMessage)
{
- int iStart = lpwszMessage.Find(L"<SMILE>id = flas");
+ int iStart = lpwszMessage.Find(_T("<SMILE>id = flas"));
if (iStart != -1)
- if (lpwszMessage.Find(L"'</SMILE>", iStart) != -1)
+ if (lpwszMessage.Find(_T("'</SMILE>"), iStart) != -1)
return true;
return false;
@@ -210,7 +210,7 @@ DWORD CMraProto::MraConvertToRTFW(const CMStringW &wszMessage, CMStringA &szMess HDC hDC = GetDC(NULL);// kegl
lf.lfCharSet = MRA_DEFAULT_RTF_FONT_CHARSET;
lf.lfHeight = -MulDiv(MRA_DEFAULT_RTF_FONT_SIZE, GetDeviceCaps(hDC, LOGPIXELSY), 72);
- lstrcpynW(lf.lfFaceName, MRA_DEFAULT_RTF_FONT_NAME, LF_FACESIZE);
+ lstrcpyn(lf.lfFaceName, MRA_DEFAULT_RTF_FONT_NAME, LF_FACESIZE);
ReleaseDC(NULL, hDC);
}
dwFontSize = ((-lf.lfHeight)+(((-lf.lfHeight)+4)/8));
diff --git a/protocols/MRA/src/MraSelectEMail.cpp b/protocols/MRA/src/MraSelectEMail.cpp index f05e009b70..3978c57a8b 100644 --- a/protocols/MRA/src/MraSelectEMail.cpp +++ b/protocols/MRA/src/MraSelectEMail.cpp @@ -27,7 +27,8 @@ void AddContactEMailToListParam(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszModule if (bMRAOnly == FALSE || IsEMailMR(szEmail)) {
WCHAR wszBuff[MAX_EMAIL_LEN];
MultiByteToWideChar(MRA_CODE_PAGE, 0, szEmail, -1, wszBuff, SIZEOF(wszBuff));
- if (SendMessage(hWndList, LB_FINDSTRING, -1, (LPARAM)wszBuff) == LB_ERR) SendMessage(hWndList, LB_ADDSTRING, 0, (LPARAM)wszBuff);
+ if (SendMessage(hWndList, LB_FINDSTRING, -1, (LPARAM)wszBuff) == LB_ERR)
+ SendMessage(hWndList, LB_ADDSTRING, 0, (LPARAM)wszBuff);
}
}
else if (i > EMAILS_MIN_COUNT)
@@ -44,12 +45,10 @@ INT_PTR CALLBACK MraSelectEMailDlgProc(HWND hWndDlg, UINT message, WPARAM wParam TranslateDialogDefault(hWndDlg);
dat = (MraSelectEMailDlgData*)lParam;
{
- HWND hWndList;
BOOL bMRAOnly;
- LPSTR lpszProto;
SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
- hWndList = GetDlgItem(hWndDlg, IDC_LIST_EMAILS);
+ HWND hWndList = GetDlgItem(hWndDlg, IDC_LIST_EMAILS);
switch (dat->dwType) {
case MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD:
@@ -64,10 +63,7 @@ INT_PTR CALLBACK MraSelectEMailDlgProc(HWND hWndDlg, UINT message, WPARAM wParam break;
}
- if (dat->hContact)
- lpszProto = GetContactProto(dat->hContact);
- else
- lpszProto = dat->ppro->m_szModuleName;
+ LPSTR lpszProto = dat->hContact ? GetContactProto(dat->hContact) : dat->ppro->m_szModuleName;
AddContactEMailToListParam(dat->hContact, bMRAOnly, lpszProto, "e-mail", hWndList);
AddContactEMailToListParam(dat->hContact, bMRAOnly, "UserInfo", "e-mail", hWndList);
diff --git a/protocols/MRA/src/MraSendCommand.cpp b/protocols/MRA/src/MraSendCommand.cpp index a4a6ae092e..7932399dcf 100644 --- a/protocols/MRA/src/MraSendCommand.cpp +++ b/protocols/MRA/src/MraSendCommand.cpp @@ -87,7 +87,7 @@ DWORD CMraProto::MraMessage(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, if (dwFlags & MESSAGE_FLAG_AUTHORIZE) {
OutBuffer buf;
buf.SetUL(2);
- buf.SetLPSW(L"");//***deb possible nick here
+ buf.SetLPSW(_T(""));//***deb possible nick here
buf.SetLPSW(lpwszMessage);
lpszMessageConverted = mir_base64_encode(buf.Data(), buf.Len());
dwMessageConvertedSize = strlen(lpszMessageConverted);
@@ -203,8 +203,8 @@ DWORD CMraProto::MraAddContact(HANDLE hContact, DWORD dwContactFlag, DWORD dwGro // pack auth message
OutBuffer buf2;
buf2.SetUL(2);
- buf2.SetLPSW(L"");//***deb possible nick here
- buf2.SetLPSW((wszAuthMessage == NULL) ? L"" : *wszAuthMessage);
+ buf2.SetLPSW(_T(""));//***deb possible nick here
+ buf2.SetLPSW((wszAuthMessage == NULL) ? _T("") : *wszAuthMessage);
buf.SetLPS(CMStringA( ptrA( mir_base64_encode(buf2.Data(), buf2.Len()))));
buf.SetUL(0);
@@ -393,7 +393,7 @@ HANDLE CMraProto::MraWPRequestByEMail(HANDLE hContact, DWORD dwAckType, CMString DWORD dwRequestFlags = 0;
SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_USER);
SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_DOMAIN);
- return MraWPRequestW(hContact, dwAckType, dwRequestFlags, szUser, szDomain, L"", L"", L"", 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ return MraWPRequestW(hContact, dwAckType, dwRequestFlags, szUser, szDomain, _T(""), _T(""), _T(""), 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
// Отправка файлов
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 6550e5b915..2f2bbeb346 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -640,18 +640,18 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & if (m_dwEmailMessagesUnread) {
CMStringA szEmail;
HANDLE hContact = NULL;
- WCHAR szMailBoxStatus[MAX_SECONDLINE];
+ TCHAR szMailBoxStatus[MAX_SECONDLINE];
- mir_sntprintf(szMailBoxStatus, SIZEOF(szMailBoxStatus), TranslateW(L"Unread mail is available: %lu/%lu messages"), m_dwEmailMessagesUnread, dwEmailMessagesTotal);
+ mir_sntprintf(szMailBoxStatus, SIZEOF(szMailBoxStatus), TranslateT("Unread mail is available: %lu/%lu messages"), m_dwEmailMessagesUnread, dwEmailMessagesTotal);
if ( !pszFrom.IsEmpty() || !pszSubject.IsEmpty()) {
CMStringA szFrom, szSubject;
if ( GetEMailFromString(szFrom, szEmail))
hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL);
- mir_sntprintf(szStatusText, SIZEOF(szStatusText), TranslateW(L"From: %S\r\nSubject: %S\r\n%s"), pszFrom.c_str(), szSubject.c_str(), szMailBoxStatus);
+ mir_sntprintf(szStatusText, SIZEOF(szStatusText), TranslateT("From: %S\r\nSubject: %S\r\n%s"), pszFrom.c_str(), szSubject.c_str(), szMailBoxStatus);
}
- else lstrcpynW(szStatusText, szMailBoxStatus, SIZEOF(szStatusText));
+ else lstrcpyn(szStatusText, szMailBoxStatus, SIZEOF(szStatusText));
if (bTrayIconNewMailNotify) {
char szServiceFunction[MAX_PATH], *pszServiceFunctionName;
@@ -691,7 +691,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & PUDeletePopup(hWndEMailPopupStatus);
hWndEMailPopupStatus = NULL;
}else {
- mir_sntprintf(szStatusText, SIZEOF(szStatusText), TranslateW(L"No unread mail is available\r\nTotal messages: %lu"), dwEmailMessagesTotal);
+ mir_sntprintf(szStatusText, SIZEOF(szStatusText), TranslateT("No unread mail is available\r\nTotal messages: %lu"), dwEmailMessagesTotal);
MraPopupShowFromAgentW(MRA_POPUP_TYPE_EMAIL_STATUS, (MRA_POPUP_ALLOW_ENTER), szStatusText);
}
}
@@ -868,15 +868,15 @@ bool CMraProto::GetContactFirstEMail(HANDLE hContact, BOOL bMRAOnly, CMStringA & void CMraProto::ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode)
{
- WCHAR szErrorText[2048], szErrDescription[1024];
+ TCHAR szErrorText[2048], szErrDescription[1024];
size_t dwErrDescriptionSize;
if (dwErrorCode == NO_ERROR)
- mir_sntprintf(szErrorText, SIZEOF(szErrorText), L"%s", TranslateW(lpwszErrText));
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), _T("%s"), TranslateTS(lpwszErrText));
else {
dwErrDescriptionSize = (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErrorCode, 0, szErrDescription, (SIZEOF(szErrDescription)-sizeof(WCHAR)), NULL)-2);
szErrDescription[dwErrDescriptionSize] = 0;
- mir_sntprintf(szErrorText, SIZEOF(szErrorText), L"%s %lu: %s", TranslateW(lpwszErrText), dwErrorCode, szErrDescription);
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), _T("%s %lu: %s"), TranslateTS(lpwszErrText), dwErrorCode, szErrDescription);
}
MraPopupShowFromAgentW(MRA_POPUP_TYPE_ERROR, 0, szErrorText);
}
@@ -988,22 +988,22 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP mir_subclassWindow( GetDlgItem(hWndDlg, IDC_XMSG), MessageEditSubclassProc);
SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_XTITLE, EM_LIMITTEXT, STATUS_TITLE_MAX, 0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_XMSG, EM_LIMITTEXT, STATUS_DESC_MAX, 0);
+ SendDlgItemMessage(hWndDlg, IDC_XTITLE, EM_LIMITTEXT, STATUS_TITLE_MAX, 0);
+ SendDlgItemMessage(hWndDlg, IDC_XMSG, EM_LIMITTEXT, STATUS_DESC_MAX, 0);
SendMessage(hWndDlg, WM_SETICON, ICON_BIG, (LPARAM)dat->hDlgIcon);
- SendMessage(hWndDlg, WM_SETTEXT, 0, (LPARAM)TranslateW(lpcszXStatusNameDef[dat->dwXStatus]));
+ SetWindowText(hWndDlg,TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]));
mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldName", dat->dwXStatus);
if (dat->ppro->mraGetStringW(NULL, szValueName, szBuff))
- SET_DLG_ITEM_TEXT(hWndDlg, IDC_XTITLE, szBuff.c_str()); // custom xstatus name
+ SetDlgItemText(hWndDlg, IDC_XTITLE, szBuff.c_str()); // custom xstatus name
else // default xstatus name
- SET_DLG_ITEM_TEXT(hWndDlg, IDC_XTITLE, TranslateW(lpcszXStatusNameDef[dat->dwXStatus]));
+ SetDlgItemText(hWndDlg, IDC_XTITLE, TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]));
mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldMsg", dat->dwXStatus);
if (dat->ppro->mraGetStringW(NULL, szValueName, szBuff))
- SET_DLG_ITEM_TEXT(hWndDlg, IDC_XMSG, szBuff.c_str()); // custom xstatus description
+ SetDlgItemText(hWndDlg, IDC_XMSG, szBuff.c_str()); // custom xstatus description
else // default xstatus description
- SET_DLG_ITEM_TEXT(hWndDlg, IDC_XMSG, L"");
+ SetDlgItemText(hWndDlg, IDC_XMSG, _T(""));
SendMessage(hWndDlg, WM_TIMER, 0, 0);
SetTimer(hWndDlg, 1, 1000, 0);
@@ -1013,10 +1013,9 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP case WM_TIMER:
if (dat->dwCountdown != -1) {
- WCHAR szBuff[MAX_PATH];
- mir_sntprintf(szBuff, SIZEOF(szBuff), L"%s %ld", TranslateW(L"Closing in"), dat->dwCountdown);
- SET_DLG_ITEM_TEXT(hWndDlg, IDOK, szBuff);
- dat->dwCountdown--;
+ TCHAR szBuff[MAX_PATH];
+ mir_sntprintf(szBuff, SIZEOF(szBuff), TranslateT("Closing in %ld"), dat->dwCountdown--);
+ SetDlgItemText(hWndDlg, IDOK, szBuff);
break;
}
@@ -1032,38 +1031,36 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP case IDC_XTITLE:
case IDC_XMSG:
KillTimer(hWndDlg, 1);
- SET_DLG_ITEM_TEXTW(hWndDlg, IDOK, TranslateW(L"OK"));
+ SetDlgItemText(hWndDlg, IDOK, TranslateT("OK"));
break;
}
break;
case WM_DESTROY:
if (dat) { // set our xStatus
- char szValueName[MAX_PATH];
- HWND hWndEdit;
- WCHAR szBuff[STATUS_TITLE_MAX+STATUS_DESC_MAX];
- WNDPROC OldMessageEditProc;
-
- SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (LONG_PTR)0);
+ SetWindowLongPtr(hWndDlg, GWLP_USERDATA, 0);
- hWndEdit = GetDlgItem(hWndDlg, IDC_XTITLE);
- OldMessageEditProc = (WNDPROC)GetWindowLongPtr(hWndEdit, GWLP_USERDATA);
+ HWND hWndEdit = GetDlgItem(hWndDlg, IDC_XTITLE);
+ WNDPROC OldMessageEditProc = (WNDPROC)GetWindowLongPtr(hWndEdit, GWLP_USERDATA);
SetWindowLongPtr(hWndEdit, GWLP_WNDPROC, (LONG_PTR)OldMessageEditProc);
- SetWindowLongPtr(hWndEdit, GWLP_USERDATA, (LONG_PTR)0);
+ SetWindowLongPtr(hWndEdit, GWLP_USERDATA, 0);
hWndEdit = GetDlgItem(hWndDlg, IDC_XMSG);
OldMessageEditProc = (WNDPROC)GetWindowLongPtr(hWndEdit, GWLP_USERDATA);
SetWindowLongPtr(hWndEdit, GWLP_WNDPROC, (LONG_PTR)OldMessageEditProc);
- SetWindowLongPtr(hWndEdit, GWLP_USERDATA, (LONG_PTR)0);
+ SetWindowLongPtr(hWndEdit, GWLP_USERDATA, 0);
- DWORD dwBuffSize = GET_DLG_ITEM_TEXT(hWndDlg, IDC_XMSG, szBuff, (STATUS_DESC_MAX+1));
+ TCHAR szBuff[STATUS_TITLE_MAX+STATUS_DESC_MAX];
+ DWORD dwBuffSize = GetDlgItemText(hWndDlg, IDC_XMSG, szBuff, STATUS_DESC_MAX+1);
+
+ char szValueName[MAX_PATH];
mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldMsg", dat->dwXStatus);
dat->ppro->mraSetStringExW(NULL, szValueName, szBuff);
dat->ppro->mraSetStringExW(NULL, DBSETTING_XSTATUSMSG, szBuff);
- dwBuffSize = GET_DLG_ITEM_TEXT(hWndDlg, IDC_XTITLE, szBuff, (STATUS_TITLE_MAX+1));
+ dwBuffSize = GetDlgItemText(hWndDlg, IDC_XTITLE, szBuff, (STATUS_TITLE_MAX+1));
if (dwBuffSize == 0) { // user delete all text
- lstrcpynW(szBuff, TranslateW(lpcszXStatusNameDef[dat->dwXStatus]), (STATUS_TITLE_MAX+1));
+ lstrcpyn(szBuff, TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]), (STATUS_TITLE_MAX+1));
dwBuffSize = lstrlenW(szBuff);
}
mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%dName", dat->dwXStatus);
@@ -1124,23 +1121,23 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w // blog status message
CMStringW szBuff;
if (dat->ppro->mraGetStringW(dat->hContact, DBSETTING_BLOGSTATUS, szBuff))
- SET_DLG_ITEM_TEXT(hWndDlg, IDC_USER_BLOG_STATUS_MSG, szBuff.c_str());
+ SetDlgItemText(hWndDlg, IDC_USER_BLOG_STATUS_MSG, szBuff.c_str());
// reply to some user blog
if (dat->hContact) {
- szBuff.Format( TranslateW(L"Reply to %s blog status"), GetContactNameW(dat->hContact));
- SendMessage(hWndDlg, WM_SETTEXT, 0, (LPARAM)szBuff.c_str());
+ szBuff.Format( TranslateT("Reply to %s blog status"), GetContactNameW(dat->hContact));
+ SetWindowText(hWndDlg,szBuff.c_str());
}
- else SendMessage(hWndDlg, WM_SETTEXT, 0, (LPARAM)TranslateW(L"Set my blog status"));
+ else SetWindowText(hWndDlg, TranslateT("Set my blog status"));
DWORD dwTime = dat->ppro->getDword(dat->hContact, DBSETTING_BLOGSTATUSTIME, 0);
if (dwTime && MakeLocalSystemTimeFromTime32(dwTime, &stBlogStatusTime))
- szBuff.Format(L"%s: %04ld.%02ld.%02ld %02ld:%02ld", TranslateW(L"Writed"),
+ szBuff.Format(_T("%s: %04ld.%02ld.%02ld %02ld:%02ld"), TranslateT("Writed"),
stBlogStatusTime.wYear, stBlogStatusTime.wMonth, stBlogStatusTime.wDay, stBlogStatusTime.wHour, stBlogStatusTime.wMinute);
else
szBuff.Empty();
- SET_DLG_ITEM_TEXT(hWndDlg, IDC_STATIC_WRITED_TIME, szBuff.c_str());
+ SetDlgItemText(hWndDlg, IDC_STATIC_WRITED_TIME, szBuff.c_str());
EnableWindow(GetDlgItem(hWndDlg, IDC_CHK_NOTIFY), (dat->hContact == NULL));
iRet = TRUE;
}
@@ -1155,11 +1152,10 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w case IDOK:
{
DWORD dwFlags;
- WCHAR szBuff[MICBLOG_STATUS_MAX];
- size_t dwBuffSize;
DWORDLONG dwBlogStatusID;
- dwBuffSize = GET_DLG_ITEM_TEXT(hWndDlg, IDC_MSG_TO_SEND, szBuff, SIZEOF(szBuff));
+ TCHAR szBuff[MICBLOG_STATUS_MAX];
+ size_t dwBuffSize = GetDlgItemText(hWndDlg, IDC_MSG_TO_SEND, szBuff, SIZEOF(szBuff));
if (dat->hContact) {
dwFlags = (MRIM_BLOG_STATUS_REPLY|MRIM_BLOG_STATUS_NOTIFY);
@@ -1171,7 +1167,7 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w }
else {
dwFlags = MRIM_BLOG_STATUS_UPDATE;
- if (IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_NOTIFY)) dwFlags |= MRIM_BLOG_STATUS_NOTIFY;
+ if (IsDlgButtonChecked(hWndDlg, IDC_CHK_NOTIFY)) dwFlags |= MRIM_BLOG_STATUS_NOTIFY;
dwBlogStatusID = 0;
}
dat->ppro->MraChangeUserBlogStatus(dwFlags, szBuff, dwBlogStatusID);
@@ -1182,12 +1178,12 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w case IDC_MSG_TO_SEND:
if (HIWORD(wParam) == EN_CHANGE) {
- WCHAR wszBuff[MAX_PATH];
- size_t dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MSG_TO_SEND);
+ TCHAR tszBuff[MAX_PATH];
+ size_t dwMessageSize = GetWindowTextLength(GetDlgItem(hWndDlg, IDC_MSG_TO_SEND));
EnableWindow(GetDlgItem(hWndDlg, IDOK), dwMessageSize);
- mir_sntprintf(wszBuff, SIZEOF(wszBuff), L"%d/%d", dwMessageSize, MICBLOG_STATUS_MAX);
- SET_DLG_ITEM_TEXTW(hWndDlg, IDC_STATIC_CHARS_COUNTER, wszBuff);
+ mir_sntprintf(tszBuff, SIZEOF(tszBuff), _T("%d/%d"), dwMessageSize, MICBLOG_STATUS_MAX);
+ SetDlgItemText(hWndDlg, IDC_STATIC_CHARS_COUNTER, tszBuff);
}
break;
}
@@ -1195,13 +1191,10 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w case WM_DESTROY:
if (dat) {
- HWND hWndEdit;
- WNDPROC OldMessageEditProc;
-
SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (LONG_PTR)0);
- hWndEdit = GetDlgItem(hWndDlg, IDC_MSG_TO_SEND);
- OldMessageEditProc = (WNDPROC)GetWindowLongPtr(hWndEdit, GWLP_USERDATA);
+ HWND hWndEdit = GetDlgItem(hWndDlg, IDC_MSG_TO_SEND);
+ WNDPROC OldMessageEditProc = (WNDPROC)GetWindowLongPtr(hWndEdit, GWLP_USERDATA);
SetWindowLongPtr(hWndEdit, GWLP_WNDPROC, (LONG_PTR)OldMessageEditProc);
SetWindowLongPtr(hWndEdit, GWLP_USERDATA, (LONG_PTR)0);
mir_free(dat);
@@ -1252,7 +1245,7 @@ DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD DWORD dwRetErrorCode;
if (lpszFolder && dwFolderLen && lpszFileName && dwFileNameLen) {
- WCHAR szPath[32768];
+ TCHAR szPath[32768];
DWORD dwPathLen, dwRecDeepAllocated, dwRecDeepCurPos, dwFilePathLen;
RECURSION_DATA_STACK_ITEM *prdsiItems;
@@ -1270,7 +1263,7 @@ DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD dwPathLen++;
}
szPath[dwPathLen] = 0;
- lstrcatW(szPath, L"*.*");
+ lstrcat(szPath, _T("*.*"));
prdsiItems[dwRecDeepCurPos].dwFileNameLen = 0;
prdsiItems[dwRecDeepCurPos].hFind = FindFirstFileEx(szPath, FindExInfoStandard, &prdsiItems[dwRecDeepCurPos].w32fdFindFileData, FindExSearchNameMatch, NULL, 0);
@@ -1281,11 +1274,11 @@ DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD while (dwRetErrorCode == ERROR_FILE_NOT_FOUND && FindNextFile(prdsiItems[dwRecDeepCurPos].hFind, &prdsiItems[dwRecDeepCurPos].w32fdFindFileData)) {
if (prdsiItems[dwRecDeepCurPos].w32fdFindFileData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {// folder
- if (CompareString( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, -1, L".", 1) != CSTR_EQUAL)
- if (CompareString( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, -1, L"..", 2) != CSTR_EQUAL) {
+ if (CompareString( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, -1, _T("."), 1) != CSTR_EQUAL)
+ if (CompareString( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, -1, _T(".."), 2) != CSTR_EQUAL) {
prdsiItems[dwRecDeepCurPos].dwFileNameLen = (lstrlenW(prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName)+1);
memmove((szPath+dwPathLen), prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, (prdsiItems[dwRecDeepCurPos].dwFileNameLen*sizeof(WCHAR)));
- lstrcatW(szPath, L"\\*.*");
+ lstrcat(szPath, _T("\\*.*"));
dwPathLen += prdsiItems[dwRecDeepCurPos].dwFileNameLen;
dwRecDeepCurPos++;
diff --git a/protocols/MRA/src/Mra_options.cpp b/protocols/MRA/src/Mra_options.cpp index 2c0e46a329..0bc32f4516 100644 --- a/protocols/MRA/src/Mra_options.cpp +++ b/protocols/MRA/src/Mra_options.cpp @@ -12,19 +12,19 @@ INT_PTR CALLBACK DlgProcOptsAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARA ppro = (CMraProto*)lParam;
if ( ppro->mraGetStringW(NULL, "e-mail", szBuff))
- SET_DLG_ITEM_TEXTW(hWndDlg, IDC_LOGIN, szBuff.c_str());
+ SetDlgItemText(hWndDlg, IDC_LOGIN, szBuff.c_str());
- SET_DLG_ITEM_TEXTW(hWndDlg, IDC_PASSWORD, (LPWSTR)L"");
+ SetDlgItemText(hWndDlg, IDC_PASSWORD, _T(""));
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_NEW_ACCOUNT_LINK:
- CallService(MS_UTILS_OPENURL, TRUE, (LPARAM)MRA_REGISTER_URL);
+ CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW | OUF_TCHAR, (LPARAM) MRA_REGISTER_URL);
return TRUE;
case IDC_LOOKUPLINK:
- CallService(MS_UTILS_OPENURL, TRUE, (LPARAM)MRA_FORGOT_PASSWORD_URL);
+ CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW | OUF_TCHAR, (LPARAM) MRA_FORGOT_PASSWORD_URL);
return TRUE;
}
if ((LOWORD(wParam) == IDC_LOGIN || LOWORD(wParam) == IDC_PASSWORD) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
@@ -36,13 +36,14 @@ INT_PTR CALLBACK DlgProcOptsAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARA case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- WCHAR szBuff[MAX_EMAIL_LEN];
- GET_DLG_ITEM_TEXT(hWndDlg, IDC_LOGIN, szBuff, SIZEOF(szBuff));
- ppro->setWString(NULL, "e-mail", szBuff);
-
- if (GET_DLG_ITEM_TEXTA(hWndDlg, IDC_PASSWORD, (LPSTR)szBuff, SIZEOF(szBuff))) {
- ppro->SetPassDB((LPSTR)szBuff);
- SecureZeroMemory(szBuff, sizeof(szBuff));
+ TCHAR szBuff[MAX_EMAIL_LEN];
+ GetDlgItemText(hWndDlg, IDC_LOGIN, szBuff, SIZEOF(szBuff));
+ ppro->setTString(NULL, "e-mail", szBuff);
+
+ char szPass[MAX_EMAIL_LEN];
+ if (GetDlgItemTextA(hWndDlg, IDC_PASSWORD, szPass, SIZEOF(szPass))) {
+ ppro->SetPassDB(szPass);
+ SecureZeroMemory(szPass, SIZEOF(szPass));
}
return TRUE;
}
@@ -63,15 +64,15 @@ INT_PTR CALLBACK DlgProcAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lP ppro = (CMraProto*)lParam;
if ( ppro->mraGetStringW(NULL, "e-mail", szBuff))
- SET_DLG_ITEM_TEXTW(hWndDlg, IDC_LOGIN, szBuff.c_str());
+ SetDlgItemText(hWndDlg, IDC_LOGIN, szBuff.c_str());
- SET_DLG_ITEM_TEXTW(hWndDlg, IDC_PASSWORD, (LPWSTR)L"");
+ SetDlgItemText(hWndDlg, IDC_PASSWORD, _T(""));
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_NEW_ACCOUNT_LINK:
- CallService(MS_UTILS_OPENURL, TRUE, (LPARAM)MRA_REGISTER_URL);
+ CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW | OUF_TCHAR, (LPARAM)MRA_REGISTER_URL);
return TRUE;
}
if ( HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus())
@@ -88,13 +89,14 @@ INT_PTR CALLBACK DlgProcAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- WCHAR szBuff[MAX_EMAIL_LEN];
- GET_DLG_ITEM_TEXT(hWndDlg, IDC_LOGIN, szBuff, SIZEOF(szBuff));
+ TCHAR szBuff[MAX_EMAIL_LEN];
+ GetDlgItemText(hWndDlg, IDC_LOGIN, szBuff, SIZEOF(szBuff));
ppro->mraSetStringW(NULL, "e-mail", szBuff);
- if (GET_DLG_ITEM_TEXTA(hWndDlg, IDC_PASSWORD, (LPSTR)szBuff, SIZEOF(szBuff))) {
- ppro->SetPassDB((LPSTR)szBuff);
- SecureZeroMemory(szBuff, sizeof(szBuff));
+ char szPass[MAX_EMAIL_LEN];
+ if (GetDlgItemTextA(hWndDlg, IDC_PASSWORD, szPass, SIZEOF(szPass))) {
+ ppro->SetPassDB(szPass);
+ SecureZeroMemory(szBuff, SIZEOF(szPass));
}
return TRUE;
}
@@ -115,47 +117,47 @@ INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, L ppro = (CMraProto*)lParam;
if (ppro->mraGetStringW(NULL, "Server", szBuff))
- SET_DLG_ITEM_TEXT(hWndDlg, IDC_SERVER, szBuff.c_str());
+ SetDlgItemText(hWndDlg, IDC_SERVER, szBuff.c_str());
else
- SET_DLG_ITEM_TEXTA(hWndDlg, IDC_SERVER, MRA_DEFAULT_SERVER);
+ SetDlgItemTextA(hWndDlg, IDC_SERVER, MRA_DEFAULT_SERVER);
SetDlgItemInt(hWndDlg, IDC_SERVERPORT, ppro->getWord("ServerPort", MRA_DEFAULT_SERVER_PORT), FALSE);
// if set SSL proxy, setting will ignored
- //CHECK_DLG_BUTTON(hWndDlg, IDC_KEEPALIVE, getByte("keepalive", 0));
- CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_ADD_CONTACTS_TO_SERVER, ppro->getByte("AutoAddContactsToServer", MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER));
- CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_REQ_ON_LOGON, ppro->getByte("AutoAuthRequestOnLogon", MRA_DEFAULT_AUTO_AUTH_REQ_ON_LOGON));
- CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_GRAND_IN_CLIST, ppro->getByte("AutoAuthGrandUsersInCList", MRA_DEFAULT_AUTO_AUTH_GRAND_IN_CLIST));
- CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS, ppro->getByte("AutoAuthGrandNewUsers", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS));
+ //CheckDlgButton(hWndDlg, IDC_KEEPALIVE, getByte("keepalive", 0));
+ CheckDlgButton(hWndDlg, IDC_AUTO_ADD_CONTACTS_TO_SERVER, ppro->getByte("AutoAddContactsToServer", MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER));
+ CheckDlgButton(hWndDlg, IDC_AUTO_AUTH_REQ_ON_LOGON, ppro->getByte("AutoAuthRequestOnLogon", MRA_DEFAULT_AUTO_AUTH_REQ_ON_LOGON));
+ CheckDlgButton(hWndDlg, IDC_AUTO_AUTH_GRAND_IN_CLIST, ppro->getByte("AutoAuthGrandUsersInCList", MRA_DEFAULT_AUTO_AUTH_GRAND_IN_CLIST));
+ CheckDlgButton(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS, ppro->getByte("AutoAuthGrandNewUsers", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS));
- CHECK_DLG_BUTTON(hWndDlg, IDC_SLOWSEND, ppro->getByte("SlowSend", MRA_DEFAULT_SLOW_SEND));
- CHECK_DLG_BUTTON(hWndDlg, IDC_INCREMENTAL_NEW_MAIL_NOTIFY, ppro->getByte("IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY));
- CHECK_DLG_BUTTON(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY, ppro->getByte("TrayIconNewMailNotify", MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY));
- CHECK_DLG_BUTTON(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX, ppro->getByte("TrayIconNewMailClkToInbox", MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX));
+ CheckDlgButton(hWndDlg, IDC_SLOWSEND, ppro->getByte("SlowSend", MRA_DEFAULT_SLOW_SEND));
+ CheckDlgButton(hWndDlg, IDC_INCREMENTAL_NEW_MAIL_NOTIFY, ppro->getByte("IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY));
+ CheckDlgButton(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY, ppro->getByte("TrayIconNewMailNotify", MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY));
+ CheckDlgButton(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX, ppro->getByte("TrayIconNewMailClkToInbox", MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX));
EnableWindow(GetDlgItem(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX), ppro->getByte("TrayIconNewMailNotify", MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY));
- CHECK_DLG_BUTTON(hWndDlg, IDC_RTF_RECEIVE_ENABLE, ppro->getByte("RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE));
+ CheckDlgButton(hWndDlg, IDC_RTF_RECEIVE_ENABLE, ppro->getByte("RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE));
- CHECK_DLG_BUTTON(hWndDlg, IDC_RTF_SEND_ENABLE, ppro->getByte("RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE));
+ CheckDlgButton(hWndDlg, IDC_RTF_SEND_ENABLE, ppro->getByte("RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE));
EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_SEND_SMART), ppro->getByte("RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE));
EnableWindow(GetDlgItem(hWndDlg, IDC_BUTTON_FONT), ppro->getByte("RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE));
EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_BGCOLOUR), ppro->getByte("RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE));
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_RTF_BGCOLOUR, CPM_SETCOLOUR, 0, ppro->getDword("RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR));
+ SendDlgItemMessage(hWndDlg, IDC_RTF_BGCOLOUR, CPM_SETCOLOUR, 0, ppro->getDword("RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR));
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_BUTTON_DEFAULT:
- SET_DLG_ITEM_TEXTA(hWndDlg, IDC_SERVER, MRA_DEFAULT_SERVER);
+ SetDlgItemTextA(hWndDlg, IDC_SERVER, MRA_DEFAULT_SERVER);
SetDlgItemInt(hWndDlg, IDC_SERVERPORT, MRA_DEFAULT_SERVER_PORT, FALSE);
break;
case IDC_TRAYICON_NEW_MAIL_NOTIFY:
- EnableWindow(GetDlgItem(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX), IsDlgButtonChecked(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY));
break;
case IDC_RTF_SEND_ENABLE:
- EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_SEND_SMART), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RTF_SEND_ENABLE));
- EnableWindow(GetDlgItem(hWndDlg, IDC_BUTTON_FONT), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RTF_SEND_ENABLE));
- EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_BGCOLOUR), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RTF_SEND_ENABLE));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_SEND_SMART), IsDlgButtonChecked(hWndDlg, IDC_RTF_SEND_ENABLE));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_BUTTON_FONT), IsDlgButtonChecked(hWndDlg, IDC_RTF_SEND_ENABLE));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_BGCOLOUR), IsDlgButtonChecked(hWndDlg, IDC_RTF_SEND_ENABLE));
break;
case IDC_BUTTON_FONT:
{
@@ -170,7 +172,7 @@ INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, L HDC hDC = GetDC(NULL);// kegl
lf.lfCharSet = MRA_DEFAULT_RTF_FONT_CHARSET;
lf.lfHeight = -MulDiv(MRA_DEFAULT_RTF_FONT_SIZE, GetDeviceCaps(hDC, LOGPIXELSY), 72);
- lstrcpynW(lf.lfFaceName, MRA_DEFAULT_RTF_FONT_NAME, LF_FACESIZE);
+ lstrcpyn(lf.lfFaceName, MRA_DEFAULT_RTF_FONT_NAME, LF_FACESIZE);
ReleaseDC(NULL, hDC);
}
@@ -188,23 +190,23 @@ INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, L case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- WCHAR szBuff[MAX_PATH];
- GET_DLG_ITEM_TEXT(hWndDlg, IDC_SERVER, szBuff, SIZEOF(szBuff));
+ TCHAR szBuff[MAX_PATH];
+ GetDlgItemText(hWndDlg, IDC_SERVER, szBuff, SIZEOF(szBuff));
ppro->mraSetStringW(NULL, "Server", szBuff);
ppro->setWord("ServerPort", (WORD)GetDlgItemInt(hWndDlg, IDC_SERVERPORT, NULL, FALSE));
- ppro->setByte("AutoAddContactsToServer", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_ADD_CONTACTS_TO_SERVER));
- ppro->setByte("AutoAuthRequestOnLogon", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_REQ_ON_LOGON));
- ppro->setByte("AutoAuthGrandUsersInCList", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_IN_CLIST));
- ppro->setByte("AutoAuthGrandNewUsers", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS));
-
- ppro->setByte("SlowSend", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_SLOWSEND));
- ppro->setByte("IncrementalNewMailNotify", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_INCREMENTAL_NEW_MAIL_NOTIFY));
- ppro->setByte("TrayIconNewMailNotify", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY));
- ppro->setByte("TrayIconNewMailClkToInbox", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX));
-
- ppro->setByte("RTFReceiveEnable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RTF_RECEIVE_ENABLE));
- ppro->setByte("RTFSendEnable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RTF_SEND_ENABLE));
- ppro->setDword("RTFBackgroundColour", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_RTF_BGCOLOUR, CPM_GETCOLOUR, 0, 0));
+ ppro->setByte("AutoAddContactsToServer", IsDlgButtonChecked(hWndDlg, IDC_AUTO_ADD_CONTACTS_TO_SERVER));
+ ppro->setByte("AutoAuthRequestOnLogon", IsDlgButtonChecked(hWndDlg, IDC_AUTO_AUTH_REQ_ON_LOGON));
+ ppro->setByte("AutoAuthGrandUsersInCList", IsDlgButtonChecked(hWndDlg, IDC_AUTO_AUTH_GRAND_IN_CLIST));
+ ppro->setByte("AutoAuthGrandNewUsers", IsDlgButtonChecked(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS));
+
+ ppro->setByte("SlowSend", IsDlgButtonChecked(hWndDlg, IDC_SLOWSEND));
+ ppro->setByte("IncrementalNewMailNotify", IsDlgButtonChecked(hWndDlg, IDC_INCREMENTAL_NEW_MAIL_NOTIFY));
+ ppro->setByte("TrayIconNewMailNotify", IsDlgButtonChecked(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY));
+ ppro->setByte("TrayIconNewMailClkToInbox", IsDlgButtonChecked(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX));
+
+ ppro->setByte("RTFReceiveEnable", IsDlgButtonChecked(hWndDlg, IDC_RTF_RECEIVE_ENABLE));
+ ppro->setByte("RTFSendEnable", IsDlgButtonChecked(hWndDlg, IDC_RTF_SEND_ENABLE));
+ ppro->setDword("RTFBackgroundColour", SendDlgItemMessage(hWndDlg, IDC_RTF_BGCOLOUR, CPM_GETCOLOUR, 0, 0));
return TRUE;
}
break;
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index 39a6f8ca4c..2511666fd1 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -27,9 +27,9 @@ DWORD CMraProto::StartConnect() else {
MraThreadClean();
if (szEmail.GetLength() <= 5)
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_WARNING, 0, TranslateW(L"Please, setup e-mail in options"));
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_WARNING, 0, TranslateT("Please, setup e-mail in options"));
else
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_WARNING, 0, TranslateW(L"Please, setup password in options"));
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_WARNING, 0, TranslateT("Please, setup password in options"));
}
}
@@ -385,7 +385,7 @@ bool CMraProto::CmdHelloAck(BinBuffer &buf) if ( IsXStatusValid(dwXStatusMir)) {// xstatuses
mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldName", dwXStatusMir);
if ( !mraGetStringW(NULL, szValueName, wszStatusTitle))
- wszStatusTitle = TranslateW(lpcszXStatusNameDef[dwXStatusMir]);
+ wszStatusTitle = TranslateTS(lpcszXStatusNameDef[dwXStatusMir]);
mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldMsg", dwXStatusMir);
mraGetStringW(NULL, szValueName, wszStatusDesc);
@@ -424,7 +424,7 @@ bool CMraProto::CmdLoginRejected(BinBuffer &buf) ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
CMStringA reason; buf >> reason;
- MraPopupShowW(NULL, MRA_POPUP_TYPE_ERROR, 0, TranslateW(L"Logon error: invalid login/password"), _A2T(reason.c_str()));
+ MraPopupShowW(NULL, MRA_POPUP_TYPE_ERROR, 0, TranslateT("Logon error: invalid login/password"), _A2T(reason.c_str()));
return false;
}
@@ -484,7 +484,7 @@ bool CMraProto::CmdMessageStatus(ULONG seq, BinBuffer &buf) }
// not found in queue
else if (dwTemp != MESSAGE_DELIVERED)
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, TranslateW(L"MRIM_CS_MESSAGE_STATUS: not found in queue"));
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, TranslateT("MRIM_CS_MESSAGE_STATUS: not found in queue"));
return true;
}
@@ -582,9 +582,9 @@ bool CMraProto::CmdOfflineMessageAck(BinBuffer &buf) if (dwTemp == NO_ERROR || dwTemp == ERROR_ACCESS_DENIED)
MraOfflineMessageDel(dwMsgUIDL);
else
- ShowFormattedErrorMessage(L"Offline message processing error, message will not deleted from server", NO_ERROR);
+ ShowFormattedErrorMessage(_T("Offline message processing error, message will not deleted from server"), NO_ERROR);
}
- else ShowFormattedErrorMessage(L"Offline message processing error, message will not deleted from server", NO_ERROR);
+ else ShowFormattedErrorMessage(_T("Offline message processing error, message will not deleted from server"), NO_ERROR);
return true;
}
@@ -601,7 +601,7 @@ bool CMraProto::CmdAuthAck(BinBuffer &buf) MraUpdateContactInfo(hContact);
if (IsEMailChatAgent(szEmail) == FALSE) {
- CMStringA szBuff = CreateBlobFromContact(hContact, L"");
+ CMStringA szBuff = CreateBlobFromContact(hContact, _T(""));
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = m_szModuleName;
@@ -632,7 +632,7 @@ bool CMraProto::CmdPopSession(BinBuffer &buf) MraMPopSessionQueueStart(hMPopSessionQueue);
}
else { //error
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_WARNING, 0, TranslateW(L"Server error: cant get MPOP key for web authorize"));
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_WARNING, 0, TranslateT("Server error: cant get MPOP key for web authorize"));
MraMPopSessionQueueFlush(hMPopSessionQueue);
}
return true;
@@ -693,7 +693,7 @@ bool CMraProto::CmdFileTransferAck(BinBuffer &buf) break;
default:// ## unknown error
TCHAR szBuff[1024];
- mir_sntprintf(szBuff, SIZEOF(szBuff), TranslateW(L"MRIM_CS_FILE_TRANSFER_ACK: unknown error, code: %lu"), dwAckType);
+ mir_sntprintf(szBuff, SIZEOF(szBuff), TranslateT("MRIM_CS_FILE_TRANSFER_ACK: unknown error, code: %lu"), dwAckType);
ShowFormattedErrorMessage(szBuff, NO_ERROR);
break;
}
@@ -733,7 +733,7 @@ bool CMraProto::CmdUserStatus(BinBuffer &buf) if (dwTemp == ID_STATUS_OFFLINE) { // was/now invisible
CMStringW szEmail, szBuff;
mraGetStringW(hContact, "e-mail", szEmail);
- szBuff.Format(L"%s <%s> - %s", GetContactNameW(hContact), szEmail, TranslateW(L"invisible status changed"));
+ szBuff.Format(L"%s <%s> - %s", GetContactNameW(hContact), szEmail, TranslateT("invisible status changed"));
MraPopupShowFromContactW(hContact, MRA_POPUP_TYPE_INFORMATION, 0, szBuff);
MraSetContactStatus(hContact, ID_STATUS_INVISIBLE);
@@ -763,33 +763,33 @@ bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf) }
break;
case CONTACT_OPER_ERROR:// ## переданные данные были некорректны
- ShowFormattedErrorMessage(L"Data been sent are invalid", NO_ERROR);
+ ShowFormattedErrorMessage(_T("Data been sent are invalid"), NO_ERROR);
break;
case CONTACT_OPER_INTERR:// ## при обработке запроса произошла внутренняя ошибка
- ShowFormattedErrorMessage(L"Internal server error", NO_ERROR);
+ ShowFormattedErrorMessage(_T("Internal server error"), NO_ERROR);
break;
case CONTACT_OPER_NO_SUCH_USER:// ## добавляемого пользователя не существует в системе
SetContactBasicInfoW(hContact, 0, SCBIF_SERVER_FLAG, 0, 0, 0, -1, 0, 0, 0, 0);
- ShowFormattedErrorMessage(L"User does not registred", NO_ERROR);
+ ShowFormattedErrorMessage(_T("User does not registred"), NO_ERROR);
break;
case CONTACT_OPER_INVALID_INFO:// ## некорректное имя пользователя
- ShowFormattedErrorMessage(L"Invalid user name", NO_ERROR);
+ ShowFormattedErrorMessage(_T("Invalid user name"), NO_ERROR);
break;
case CONTACT_OPER_USER_EXISTS:// ## пользователь уже есть в контакт-листе
- ShowFormattedErrorMessage(L"User allready added", NO_ERROR);
+ ShowFormattedErrorMessage(_T("User allready added"), NO_ERROR);
break;
case CONTACT_OPER_GROUP_LIMIT:// ## превышено максимально допустимое количество групп (20)
- ShowFormattedErrorMessage(L"Group limit is 20", NO_ERROR);
+ ShowFormattedErrorMessage(_T("Group limit is 20"), NO_ERROR);
break;
default:// ## unknown error
TCHAR szBuff[1024];
- mir_sntprintf(szBuff, SIZEOF(szBuff), TranslateW(L"MRIM_CS_*_CONTACT_ACK: unknown server error, code: %lu"), dwTemp);
+ mir_sntprintf(szBuff, SIZEOF(szBuff), TranslateT("MRIM_CS_*_CONTACT_ACK: unknown server error, code: %lu"), dwTemp);
MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff);
break;
}
MraSendQueueFree(hSendQueueHandle, seq);
}
- else MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, TranslateW(L"MRIM_CS_*_CONTACT_ACK: not found in queue"));
+ else MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, TranslateT("MRIM_CS_*_CONTACT_ACK: not found in queue"));
return true;
}
@@ -797,7 +797,7 @@ bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf) {
DWORD dwAckType, dwFlags; HANDLE hContact; LPBYTE pData; size_t dataLen;
if ( MraSendQueueFind(hSendQueueHandle, seq, &dwFlags, &hContact, &dwAckType, &pData, &dataLen)) {
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, TranslateW(L"MRIM_ANKETA_INFO: not found in queue"));
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, TranslateT("MRIM_ANKETA_INFO: not found in queue"));
return true;
}
@@ -985,7 +985,7 @@ bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf) }
}
else if (dwAckType == ACKTYPE_SEARCH) {
- WCHAR szNick[MAX_EMAIL_LEN] = {0},
+ TCHAR szNick[MAX_EMAIL_LEN] = {0},
szFirstName[MAX_EMAIL_LEN] = {0},
szLastName[MAX_EMAIL_LEN] = {0},
szEmail[MAX_EMAIL_LEN] = {0};
@@ -1090,8 +1090,8 @@ bool CMraProto::CmdGame(BinBuffer &buf) case GAME_MESSAGES_NUMBER:
break;
default:
- WCHAR szBuff[1024];
- mir_sntprintf(szBuff, SIZEOF(szBuff), TranslateW(L"MRIM_CS_GAME: unknown internal game message code: %lu"), dwGameMsg);
+ TCHAR szBuff[1024];
+ mir_sntprintf(szBuff, SIZEOF(szBuff), TranslateT("MRIM_CS_GAME: unknown internal game message code: %lu"), dwGameMsg);
MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff);
break;
}
@@ -1375,7 +1375,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) CMStringW wszAuthMessage, wszNick;
if (mraGetStringW(NULL, "AuthMessage", wszAuthMessage) == FALSE) // def auth message
- wszAuthMessage = TranslateW(MRA_DEFAULT_AUTH_MESSAGE);
+ wszAuthMessage = TranslateT(MRA_DEFAULT_AUTH_MESSAGE);
for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (GetContactBasicInfoW(hContact, &dwID, NULL, NULL, NULL, NULL, &szEmail, NULL, NULL) == NO_ERROR)
@@ -1419,7 +1419,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) ShowFormattedErrorMessage(L"MRIM_CS_CONTACT_LIST2: internal server error", NO_ERROR);
else {
TCHAR szBuff[1024];
- mir_sntprintf(szBuff, SIZEOF(szBuff), TranslateW(L"MRIM_CS_CONTACT_LIST2: unknown server error, code: %lu"), dwTemp);
+ mir_sntprintf(szBuff, SIZEOF(szBuff), TranslateT("MRIM_CS_CONTACT_LIST2: unknown server error, code: %lu"), dwTemp);
MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff);
}
}
@@ -1599,7 +1599,7 @@ bool CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader) mir_free(pByte);
MraSendQueueFree(hSendQueueHandle, pmaHeader->seq);
}
- else MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, TranslateW(L"MRIM_CS_SMS_ACK: not found in queue"));
+ else MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, TranslateT("MRIM_CS_SMS_ACK: not found in queue"));
break;
case MRIM_CS_PROXY_HELLO:
@@ -1880,7 +1880,7 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA & }
if (dwFlags & MESSAGE_FLAG_SYSTEM)
- MraPopupShowW(hContact, MRA_POPUP_TYPE_INFORMATION, 0, TranslateW(L"Mail.ru System notify"), (LPWSTR)pre.szMessage);
+ MraPopupShowW(hContact, MRA_POPUP_TYPE_INFORMATION, 0, TranslateT("Mail.ru System notify"), (LPWSTR)pre.szMessage);
}
}
}
diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp index 19c94f67bf..aa7144a00c 100644 --- a/protocols/MRA/src/Mra_svcs.cpp +++ b/protocols/MRA/src/Mra_svcs.cpp @@ -207,13 +207,13 @@ INT_PTR CMraProto::MraZhuki(WPARAM wParam, LPARAM lParam) INT_PTR CMraProto::MraWebSearch(WPARAM wParam, LPARAM lParam)
{
- CallService(MS_UTILS_OPENURL, TRUE, (LPARAM)MRA_SEARCH_URL);
+ CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW | OUF_TCHAR, (LPARAM)MRA_SEARCH_URL);
return 0;
}
INT_PTR CMraProto::MraUpdateAllUsersInfo(WPARAM wParam, LPARAM lParam)
{
- if ( MessageBox(NULL, TranslateT("Are you sure?"), TranslateW(MRA_UPD_ALL_USERS_INFO_STR), MB_YESNO | MB_ICONQUESTION) == IDYES ) {
+ if ( MessageBox(NULL, TranslateT("Are you sure?"), TranslateTS(MRA_UPD_ALL_USERS_INFO_STR), MB_YESNO | MB_ICONQUESTION) == IDYES ) {
for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
CMStringA szEmail;
if ( mraGetStringA(hContact, "e-mail", szEmail))
@@ -225,7 +225,7 @@ INT_PTR CMraProto::MraUpdateAllUsersInfo(WPARAM wParam, LPARAM lParam) INT_PTR CMraProto::MraCheckUpdatesUsersAvt(WPARAM wParam, LPARAM lParam)
{
- if ( MessageBox(NULL, TranslateT("Are you sure?"), TranslateW(MRA_CHK_USERS_AVATARS_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
+ if ( MessageBox(NULL, TranslateT("Are you sure?"), TranslateTS(MRA_CHK_USERS_AVATARS_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
CMStringA szEmail;
if (mraGetStringA(hContact, "e-mail", szEmail))
@@ -238,7 +238,7 @@ INT_PTR CMraProto::MraCheckUpdatesUsersAvt(WPARAM wParam, LPARAM lParam) INT_PTR CMraProto::MraRequestAuthForAll(WPARAM wParam, LPARAM lParam)
{
- if ( MessageBox(NULL, TranslateT("Are you sure?"), TranslateW(MRA_REQ_AUTH_FOR_ALL_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
+ if ( MessageBox(NULL, TranslateT("Are you sure?"), TranslateTS(MRA_REQ_AUTH_FOR_ALL_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
DWORD dwContactSeverFlags;
if (GetContactBasicInfoW(hContact, NULL, NULL, NULL, &dwContactSeverFlags, NULL, NULL, NULL, NULL) == NO_ERROR)
@@ -257,7 +257,7 @@ INT_PTR CMraProto::MraRequestAuthorization(WPARAM wParam, LPARAM lParam) CMStringW wszAuthMessage;
if ( !mraGetStringW(NULL, "AuthMessage", wszAuthMessage))
- wszAuthMessage = TranslateW(MRA_DEFAULT_AUTH_MESSAGE);
+ wszAuthMessage = TranslateT(MRA_DEFAULT_AUTH_MESSAGE);
if ( !wszAuthMessage.IsEmpty()) {
CMStringA szEmail;
@@ -491,7 +491,7 @@ int CMraProto::MraDbSettingChanged(WPARAM wParam, LPARAM lParam) if (cws->value.type == DBVT_DELETED || (cws->value.type == DBVT_BYTE && cws->value.bVal == 0)) {
CMStringW wszAuthMessage;
if ( !mraGetStringW(NULL, "AuthMessage", wszAuthMessage))
- wszAuthMessage = TranslateW(MRA_DEFAULT_AUTH_MESSAGE);
+ wszAuthMessage = TranslateT(MRA_DEFAULT_AUTH_MESSAGE);
db_unset(hContact, "CList", "Hidden");
@@ -602,8 +602,8 @@ int CMraProto::MraRebuildStatusMenu(WPARAM wParam, LPARAM lParam) strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
pszServiceFunctionName = szServiceFunction + strlen(m_szModuleName);
- WCHAR szItem[MAX_PATH+64];
- mir_sntprintf(szItem, SIZEOF(szItem), L"%s Custom Status", m_tszUserName);
+ TCHAR szItem[MAX_PATH+64];
+ mir_sntprintf(szItem, SIZEOF(szItem), _T("%s Custom Status"), m_tszUserName);
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 2000060000;
@@ -641,7 +641,7 @@ INT_PTR CMraProto::MraSetListeningTo(WPARAM wParam, LPARAM lParam) if (pliInfo == NULL || pliInfo->cbSize != sizeof(LISTENINGTOINFO))
{
- MraChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC, L"", 0);
+ MraChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC, _T(""), 0);
delSetting(DBSETTING_BLOGSTATUSMUSIC);
}
else if (pliInfo->dwFlags & LTI_UNICODE) {
@@ -650,7 +650,7 @@ INT_PTR CMraProto::MraSetListeningTo(WPARAM wParam, LPARAM lParam) if ( ServiceExists(MS_LISTENINGTO_GETPARSEDTEXT))
wszListeningTo = ptrT((LPWSTR)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%track%. %title% - %artist% - %player%", (LPARAM)pliInfo));
else
- wszListeningTo.Format(L"%s. %s - %s - %s", pliInfo->ptszTrack?pliInfo->ptszTrack:L"", pliInfo->ptszTitle?pliInfo->ptszTitle:L"", pliInfo->ptszArtist?pliInfo->ptszArtist:L"", pliInfo->ptszPlayer?pliInfo->ptszPlayer:L"");
+ wszListeningTo.Format(L"%s. %s - %s - %s", pliInfo->ptszTrack?pliInfo->ptszTrack:_T(""), pliInfo->ptszTitle?pliInfo->ptszTitle:_T(""), pliInfo->ptszArtist?pliInfo->ptszArtist:_T(""), pliInfo->ptszPlayer?pliInfo->ptszPlayer:_T(""));
mraSetStringExW(NULL, DBSETTING_BLOGSTATUSMUSIC, wszListeningTo);
MraChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC, wszListeningTo, 0);
@@ -666,7 +666,7 @@ int CMraProto::MraMusicChanged(WPARAM wParam, LPARAM lParam) // stopped
if (1 == lParam) {
delSetting(DBSETTING_BLOGSTATUSMUSIC);
- MraChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC, L"", 0);
+ MraChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC, _T(""), 0);
}
break;
@@ -675,7 +675,7 @@ int CMraProto::MraMusicChanged(WPARAM wParam, LPARAM lParam) SONGINFO *psiSongInfo;
if (WAT_RES_OK == CallService(MS_WAT_GETMUSICINFO, WAT_INF_UNICODE, (LPARAM)&psiSongInfo)) {
CMStringW wszMusic;
- wszMusic.Format(L"%ld. %s - %s - %s", psiSongInfo->track, psiSongInfo->artist, psiSongInfo->title, psiSongInfo->player);
+ wszMusic.Format(_T("%ld. %s - %s - %s"), psiSongInfo->track, psiSongInfo->artist, psiSongInfo->title, psiSongInfo->player);
mraSetStringExW(NULL, DBSETTING_BLOGSTATUSMUSIC, wszMusic);
MraChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC, wszMusic, 0);
}
@@ -714,7 +714,7 @@ DWORD CMraProto::MraSetXStatusInternal(DWORD dwXStatus) DWORD dwOldStatusMode = InterlockedExchange((volatile LONG*)&m_iXStatus, dwXStatus);
setByte(DBSETTING_XSTATUSID, (BYTE)dwXStatus);
- MraSendNewStatus(m_iStatus, dwXStatus, L"", L"");
+ MraSendNewStatus(m_iStatus, dwXStatus, _T(""), _T(""));
return dwOldStatusMode;
}
@@ -804,9 +804,9 @@ INT_PTR CMraProto::MraGetXStatusEx(WPARAM wParam, LPARAM lParam) return 1;
if (pData->flags & CSSF_UNICODE)
- lstrcpynW(pData->pwszName, lpcszXStatusNameDef[dwXStatus], (STATUS_TITLE_MAX+1));
+ lstrcpyn(pData->ptszName, lpcszXStatusNameDef[dwXStatus], (STATUS_TITLE_MAX+1));
else {
- size_t dwStatusTitleSize = lstrlenW( lpcszXStatusNameDef[dwXStatus] );
+ size_t dwStatusTitleSize = lstrlen( lpcszXStatusNameDef[dwXStatus] );
if (dwStatusTitleSize>STATUS_TITLE_MAX) dwStatusTitleSize = STATUS_TITLE_MAX;
WideCharToMultiByte(MRA_CODE_PAGE, 0, lpcszXStatusNameDef[dwXStatus], (DWORD)dwStatusTitleSize, pData->pszName, MAX_PATH, NULL, NULL );
@@ -868,7 +868,7 @@ DWORD CMraProto::MraSendNewStatus(DWORD dwStatusMir, DWORD dwXStatusMir, const C mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldName", dwXStatusMir);
// custom xstatus name
if ( !mraGetStringW(NULL, szValueName, wszStatusTitle))
- wszStatusTitle = TranslateW(lpcszXStatusNameDef[dwXStatusMir]);
+ wszStatusTitle = TranslateTS(lpcszXStatusNameDef[dwXStatusMir]);
}
else wszStatusTitle = pwszStatusTitle;
|