summaryrefslogtreecommitdiff
path: root/plugins/BuddyExpectator
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2012-08-21 09:57:07 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2012-08-21 09:57:07 +0000
commit8d717b5da544ff57b7c3325a7379915b1e41b8e1 (patch)
tree9ec752290b8942f7625c687aa40d22f78576d79b /plugins/BuddyExpectator
parente47b2e32698f33ff27fd0ac6383487b54b469234 (diff)
first unicode build of BuddyExpectator
git-svn-id: http://svn.miranda-ng.org/main/trunk@1510 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BuddyExpectator')
-rw-r--r--plugins/BuddyExpectator/BuddyExpectator10.vcxproj2
-rw-r--r--plugins/BuddyExpectator/src/BuddyExpectator.cpp102
-rw-r--r--plugins/BuddyExpectator/src/options.cpp79
3 files changed, 93 insertions, 90 deletions
diff --git a/plugins/BuddyExpectator/BuddyExpectator10.vcxproj b/plugins/BuddyExpectator/BuddyExpectator10.vcxproj
index 2c8a1f138e..12fde2c873 100644
--- a/plugins/BuddyExpectator/BuddyExpectator10.vcxproj
+++ b/plugins/BuddyExpectator/BuddyExpectator10.vcxproj
@@ -38,7 +38,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
index 59f4b5d23e..1f09fbe473 100644
--- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp
+++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
@@ -119,7 +119,7 @@ time_t getLastInputMsg(HANDLE hContact)
* PopUp window procedures
*/
-int CALLBACK HidePopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+LRESULT CALLBACK HidePopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
@@ -189,7 +189,7 @@ int CALLBACK MissYouPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
return DefWindowProc(hWnd, message, wParam, lParam);
}
-int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
@@ -262,7 +262,7 @@ bool isContactGoneFor(HANDLE hContact, int days)
if (daysSinceMessage >= options.iSilencePeriod)
if (!DBGetContactSettingByte(hContact, "CList", "Hidden", 0) && !DBGetContactSettingByte(hContact, MODULE_NAME, "NeverHide", 0))
{
- char szInfo[200];
+ TCHAR szInfo[200];
POPUPDATAT_V2 ppd = {0};
ppd.cbSize = sizeof(POPUPDATAT_V2);
@@ -270,16 +270,16 @@ bool isContactGoneFor(HANDLE hContact, int days)
ppd.lchContact = hContact;
ppd.lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon");
- mir_snprintf(szInfo, 200, Translate("Hiding %s (%s)"), (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0), (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0));
- strncpy(ppd.lpzContactName, szInfo, MAX_CONTACTNAME);
- mir_snprintf(szInfo, 200, Translate("%d days since last message"), daysSinceMessage);
- strncpy(ppd.lpzText, szInfo, MAX_SECONDLINE);
+ mir_sntprintf(szInfo, 200, TranslateT("Hiding %s (%S)"), (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR), (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0));
+ _tcsncpy(ppd.lptzContactName, szInfo, MAX_CONTACTNAME);
+ mir_sntprintf(szInfo, 200, TranslateT("%d days since last message"), daysSinceMessage);
+ _tcsncpy(ppd.lptzText, szInfo, MAX_SECONDLINE);
if (!options.iUsePopupColors)
{
ppd.colorBack = options.iPopUpColorBack;
ppd.colorText = options.iPopUpColorFore;
}
- ppd.PluginWindowProc = (WNDPROC)HidePopupDlgProc;
+ ppd.PluginWindowProc = HidePopupDlgProc;
ppd.PluginData = NULL;
ppd.iSeconds = -1;
@@ -287,7 +287,7 @@ bool isContactGoneFor(HANDLE hContact, int days)
ppd.lpActions = hideactions;
ppd.actionCount = 2;
- CallService(MS_POPUP_ADDPOPUPEX, (WPARAM) &ppd, APF_NEWDATA);
+ CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &ppd, APF_NEWDATA);
SkinPlaySound("buddyExpectatorHide");
}
@@ -296,7 +296,7 @@ bool isContactGoneFor(HANDLE hContact, int days)
return (daysSinceOnline >= days && (daysSinceMessage == -1 || daysSinceMessage >= days));
}
-void ReturnNotify(HANDLE hContact, char *message)
+void ReturnNotify(HANDLE hContact, TCHAR *message)
{
if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 1 || DBGetContactSettingByte(hContact, "CList", "Hidden", 0) == 1)
return;
@@ -311,14 +311,14 @@ void ReturnNotify(HANDLE hContact, char *message)
ppd.lchContact = hContact;
ppd.lchIcon = hIcon;
- strncpy(ppd.lpzContactName, (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0), MAX_CONTACTNAME);
- strncpy(ppd.lpzText, message, MAX_SECONDLINE);
+ _tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR), MAX_CONTACTNAME);
+ _tcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
if (!options.iUsePopupColors)
{
ppd.colorBack = options.iPopUpColorBack;
ppd.colorText = options.iPopUpColorFore;
}
- ppd.PluginWindowProc = (WNDPROC)PopupDlgProc;
+ ppd.PluginWindowProc = PopupDlgProc;
ppd.PluginData = NULL;
ppd.iSeconds = options.iPopUpDelay;
@@ -333,18 +333,19 @@ void ReturnNotify(HANDLE hContact, char *message)
cle.cbSize = sizeof(cle);
cle.hContact = hContact;
cle.hIcon = hIcon;
- cle.pszService = (char *)"BuddyExpectator/actionReturned";
+ cle.pszService = "BuddyExpectator/actionReturned";
+ cle.flags = CLEF_TCHAR;
- char* nick = (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0);
- char tmpMsg[512];
- mir_snprintf(tmpMsg, 512, "%s %s", nick, message);
- cle.pszTooltip = tmpMsg;
+ TCHAR* nick = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR);
+ TCHAR tmpMsg[512];
+ mir_sntprintf(tmpMsg, 512, _T("%s %s"), nick, message);
+ cle.ptszTooltip = tmpMsg;
CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM) &cle);
}
}
-void GoneNotify(HANDLE hContact, char *message)
+void GoneNotify(HANDLE hContact, TCHAR *message)
{
if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 1 || DBGetContactSettingByte(hContact, "CList", "Hidden", 0) == 1)
return;
@@ -357,8 +358,8 @@ void GoneNotify(HANDLE hContact, char *message)
ppd.lchContact = hContact;
ppd.lchIcon = hIcon;
- strncpy(ppd.lpzContactName, (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0), MAX_CONTACTNAME);
- strncpy(ppd.lpzText, message, MAX_SECONDLINE);
+ _tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR), MAX_CONTACTNAME);
+ _tcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
if (!options.iUsePopupColors)
{
ppd.colorBack = options.iPopUpColorBack;
@@ -368,7 +369,7 @@ void GoneNotify(HANDLE hContact, char *message)
ppd.PluginData = NULL;
ppd.iSeconds = options.iPopUpDelay;
- CallService(MS_POPUP_ADDPOPUPEX, (WPARAM) &ppd, 0);
+ PUAddPopUpT(&ppd);
}
if (options.iShowEvent2 > 0)
@@ -593,8 +594,8 @@ int SettingChanged(WPARAM wParam, LPARAM lParam)
ppd.lchContact = hContact;
ppd.lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon");
- strncpy(ppd.lpzContactName, (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0), MAX_CONTACTNAME);
- strncpy(ppd.lpzText, Translate("You awaited this contact!"), MAX_SECONDLINE);
+ _tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR), MAX_CONTACTNAME);
+ _tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
if (!options.iUsePopupColors)
{
ppd.colorBack = options.iPopUpColorBack;
@@ -630,7 +631,7 @@ int SettingChanged(WPARAM wParam, LPARAM lParam)
if (DBGetContactSettingDword(hContact, MODULE_NAME, "LastSeen", (DWORD)-1) == (DWORD)-1 && options.notifyFirstOnline)
{
- ReturnNotify(hContact, Translate("has gone online for the first time."));
+ ReturnNotify(hContact, TranslateT("has gone online for the first time."));
setLastSeen(hContact);
}
@@ -638,13 +639,13 @@ int SettingChanged(WPARAM wParam, LPARAM lParam)
unsigned int AbsencePeriod = DBGetContactSettingDword(hContact, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
if (isContactGoneFor(hContact, AbsencePeriod))
{
- char* message = Translate("has returned after a long absence.");
+ TCHAR* message = TranslateT("has returned after a long absence.");
time_t tmpTime;
- char tmpBuf[251] = {0};
+ TCHAR tmpBuf[251] = {0};
tmpTime = getLastSeen(hContact);
if (tmpTime != -1)
{
- strftime(tmpBuf, 250, Translate("has returned after being absent since %#x"), gmtime(&tmpTime));
+ _tcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
else
@@ -652,7 +653,7 @@ int SettingChanged(WPARAM wParam, LPARAM lParam)
tmpTime = getLastInputMsg(hContact);
if (tmpTime != -1)
{
- strftime(tmpBuf, 250, Translate("has returned after being absent since %#x"), gmtime(&tmpTime));
+ _tcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
}
@@ -681,13 +682,13 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
DBWriteContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 1);
SkinPlaySound("buddyExpectatorStillAbsent");
- char* message = Translate("has not returned after a long absence.");
+ TCHAR* message = TranslateT("has not returned after a long absence.");
time_t tmpTime;
- char tmpBuf[251] = {0};
+ TCHAR tmpBuf[251] = {0};
tmpTime = getLastSeen(hContact);
if (tmpTime != -1)
{
- strftime(tmpBuf, 250, Translate("has not returned after being absent since %#x"), gmtime(&tmpTime));
+ _tcsftime(tmpBuf, 250, TranslateT("has not returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
else
@@ -695,7 +696,7 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
tmpTime = getLastInputMsg(hContact);
if (tmpTime != -1)
{
- strftime(tmpBuf, 250, Translate("has not returned after being absent since %#x"), gmtime(&tmpTime));
+ _tcsftime(tmpBuf, 250, TranslateT("has not returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
}
@@ -725,10 +726,10 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
hEventUserInfoInit = HookEvent(ME_USERINFO_INITIALISE, UserinfoInit);
// add sounds support
- SkinAddNewSoundEx("buddyExpectatorReturn", LPGEN("BuddyExpectator"), LPGEN("Contact returned"));
- SkinAddNewSoundEx("buddyExpectatorStillAbsent", LPGEN("BuddyExpectator"), LPGEN("Contact still absent"));
- SkinAddNewSoundEx("buddyExpectatorMissYou", LPGEN("BuddyExpectator"), LPGEN("Miss you event"));
- SkinAddNewSoundEx("buddyExpectatorHide", LPGEN("BuddyExpectator"), LPGEN("Hide contact event"));
+ SkinAddNewSoundExT("buddyExpectatorReturn", LPGENT("BuddyExpectator"), LPGENT("Contact returned"));
+ SkinAddNewSoundExT("buddyExpectatorStillAbsent", LPGENT("BuddyExpectator"), LPGENT("Contact still absent"));
+ SkinAddNewSoundExT("buddyExpectatorMissYou", LPGENT("BuddyExpectator"), LPGENT("Miss you event"));
+ SkinAddNewSoundExT("buddyExpectatorHide", LPGENT("BuddyExpectator"), LPGENT("Hide contact event"));
timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours
@@ -743,35 +744,36 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
}
TCHAR szFile[MAX_PATH];
- GetModuleFileNameA(hInst, szFile, MAX_PATH);
+ GetModuleFileName(hInst, szFile, MAX_PATH);
// IcoLib support
SKINICONDESC sid = {0};
- sid.pszDefaultFile = szFile;
+ sid.ptszDefaultFile = szFile;
sid.cbSize = sizeof(sid);
- sid.pszSection = "BuddyExpectator";
+ sid.flags = SIDF_ALL_TCHAR;
+ sid.ptszSection = LPGENT("BuddyExpectator");
- sid.pszDescription = "Tray/popup icon";
+ sid.ptszDescription = LPGENT("Tray/popup icon");
sid.pszName = "main_icon";
sid.iDefaultIndex = -IDI_MAINICON;
Skin_AddIcon(&sid);
- sid.pszDescription = "Enabled";
+ sid.ptszDescription = LPGENT("Enabled");
sid.pszName = "enabled_icon";
sid.iDefaultIndex = -IDI_ENABLED;
hEnabledIcon = Skin_AddIcon(&sid);
- sid.pszDescription = "Disabled";
+ sid.ptszDescription = LPGENT("Disabled");
sid.pszName = "disabled_icon";
sid.iDefaultIndex = -IDI_DISABLED;
hDisabledIcon = Skin_AddIcon(&sid);
- sid.pszDescription = "Hide";
+ sid.ptszDescription = LPGENT("Hide");
sid.pszName = "hide_icon";
sid.iDefaultIndex = -IDI_HIDE;
Skin_AddIcon(&sid);
- sid.pszDescription = "NeverHide";
+ sid.ptszDescription = LPGENT("NeverHide");
sid.pszName = "neverhide_icon";
sid.iDefaultIndex = -IDI_NEVERHIDE;
Skin_AddIcon(&sid);
@@ -785,27 +787,27 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
CLISTMENUITEM mi = {0};
mi.cbSize = sizeof(CLISTMENUITEM);
- mi.flags = CMIF_ICONFROMICOLIB;
+ mi.flags = CMIF_ICONFROMICOLIB | CMIF_TCHAR;
mi.icolibItem = hDisabledIcon;
mi.position = 200000;
- mi.pszName = Translate("Enable Miss You");
+ mi.ptszName = LPGENT("Enable Miss You");
mi.pszService = "BuddyExpectator/actionMissYouClick";
hContactMenu = Menu_AddContactMenuItem(&mi);
}
missyouactions[0].cbSize = sizeof(POPUPACTION);
missyouactions[0].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"disabled_icon");
- lstrcpy(missyouactions[0].lpzTitle, Translate("Disable Miss You"));
+ lstrcpyA(missyouactions[0].lpzTitle, LPGEN("Disable Miss You"));
missyouactions[0].wParam = missyouactions[0].lParam = 1;
hideactions[0].cbSize = sizeof(POPUPACTION);
hideactions[0].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"hide_icon");
- lstrcpy(hideactions[0].lpzTitle, Translate("Hide contact"));
+ lstrcpyA(hideactions[0].lpzTitle, LPGEN("Hide contact"));
hideactions[0].wParam = hideactions[0].lParam = 2;
hideactions[1].cbSize = sizeof(POPUPACTION);
hideactions[1].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"neverhide_icon");
- lstrcpy(hideactions[1].lpzTitle, Translate("Never hide this contact"));
+ lstrcpyA(hideactions[1].lpzTitle, LPGEN("Never hide this contact"));
hideactions[1].wParam = hideactions[1].lParam = 3;
return 0;
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp
index 2771c1aa15..e8f9de8e8c 100644
--- a/plugins/BuddyExpectator/src/options.cpp
+++ b/plugins/BuddyExpectator/src/options.cpp
@@ -105,10 +105,10 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
//iAbsencePeriod
SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_RESETCONTENT, 0, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) Translate("days"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) Translate("weeks"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) Translate("months"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) Translate("years"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
if (options.iAbsencePeriod % 365 == 0)
{
SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/365, FALSE);
@@ -132,10 +132,10 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
//iAbsencePeriod2
SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_RESETCONTENT, 0, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) Translate("days"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) Translate("weeks"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) Translate("months"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) Translate("years"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
if (options.iAbsencePeriod2 % 365 == 0)
{
SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/365, FALSE);
@@ -159,10 +159,10 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
//iSilencePeriod
SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_RESETCONTENT, 0, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) Translate("days"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) Translate("weeks"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) Translate("months"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) Translate("years"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
if (options.iSilencePeriod % 365 == 0)
{
SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/365, FALSE);
@@ -197,10 +197,10 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_RESETCONTENT, 0, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) Translate("Do nothing"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) Translate("Delete the contact"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) Translate("Open User Details"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) Translate("Open message window"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Do nothing"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Delete the contact"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Open User Details"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Open message window"));
SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_SETCURSEL, options.action2, 0);
return TRUE;
@@ -346,7 +346,7 @@ static INT_PTR CALLBACK PopUpOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP
case WM_COMMAND:
if (LOWORD(wParam) == IDC_PREVIEW)
{
- POPUPDATAEX ppd;
+ POPUPDATAT ppd;
ZeroMemory(&ppd, sizeof(ppd));
//iPopUpDelay
@@ -361,10 +361,10 @@ static INT_PTR CALLBACK PopUpOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP
}
ppd.lchContact = NULL;
ppd.lchIcon = hIcon;
- strncpy(ppd.lpzContactName, Translate("Contact name"), MAX_CONTACTNAME);
- char szPreviewText[50];
- mir_snprintf(szPreviewText,50,Translate("has returned after being absent since %d days"),rand() % 30);
- strncpy(ppd.lpzText, szPreviewText, MAX_SECONDLINE);
+ _tcsncpy(ppd.lptzContactName, TranslateT("Contact name"), MAX_CONTACTNAME);
+ TCHAR szPreviewText[50];
+ mir_sntprintf(szPreviewText,50,TranslateT("has returned after being absent since %d days"),rand() % 30);
+ _tcsncpy(ppd.lptzText, szPreviewText, MAX_SECONDLINE);
// Get current popups colors options
if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP))
@@ -384,12 +384,12 @@ static INT_PTR CALLBACK PopUpOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP
ppd.PluginData = NULL;
ppd.iSeconds = options.iPopUpDelay;
- CallService(MS_POPUP_ADDPOPUPEX, (WPARAM) &ppd, APF_NO_HISTORY);
+ CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &ppd, APF_NO_HISTORY);
- strncpy(ppd.lpzText, Translate("You awaited this contact!"), MAX_SECONDLINE);
+ _tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
ppd.lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon");;
- CallService(MS_POPUP_ADDPOPUPEX, (WPARAM) &ppd, APF_NO_HISTORY);
+ CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &ppd, APF_NO_HISTORY);
}
else
{
@@ -493,16 +493,16 @@ static int OptionsInit(WPARAM wParam, LPARAM lParam)
ZeroMemory(&odp, sizeof(odp));
odp.cbSize = sizeof(odp);
odp.hInstance = hInst;
- odp.pszGroup = LPGEN("Plugins");
- odp.pszTemplate = MAKEINTRESOURCE(IDD_OPTIONSPANEL);
- odp.pszTitle = LPGEN("Buddy Expectator");
+ odp.ptszGroup = LPGENT("Plugins");
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSPANEL);
+ odp.ptszTitle = LPGENT("Buddy Expectator");
odp.pfnDlgProc = OptionsFrameProc;
- odp.flags = ODPF_BOLDGROUPS;
+ odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR;
Options_AddPage(wParam, &odp);
if (ServiceExists(MS_POPUP_ADDPOPUP)) {
- odp.pszGroup = LPGEN("PopUps");
- odp.pszTemplate = MAKEINTRESOURCE(IDD_POPUPPANEL);
+ odp.ptszGroup = LPGENT("PopUps");
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPPANEL);
odp.pfnDlgProc = PopUpOptionsFrameProc;
Options_AddPage(wParam, &odp);
}
@@ -517,26 +517,26 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar
case WM_INITDIALOG:
{
time_t tmpTime;
- char tmpBuf[51] = {0};
+ TCHAR tmpBuf[51] = {0};
tmpTime = getLastSeen((HANDLE)lparam);
if (tmpTime == -1)
- SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, Translate("not detected"));
+ SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, TranslateT("not detected"));
else
{
/*
int status = DBGetContactSettingWord((HANDLE)lparam, MODULE_NAME, "LastStatus", ID_STATUS_OFFLINE);
char *strptr = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)status, (LPARAM)0);
*/
- strftime(tmpBuf, 50, "%#x", gmtime(&tmpTime));
+ _tcsftime(tmpBuf, 50, _T("%#x"), gmtime(&tmpTime));
SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, tmpBuf);
}
tmpTime = getLastInputMsg((HANDLE)lparam);
if (tmpTime == -1)
- SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, Translate("not found"));
+ SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, TranslateT("not found"));
else
{
- strftime(tmpBuf, 50, "%#x", gmtime(&tmpTime));
+ _tcsftime(tmpBuf, 50, _T("%#x"), gmtime(&tmpTime));
SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, tmpBuf);
}
@@ -547,11 +547,11 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar
if (isContactGoneFor((HANDLE)lparam, options.iAbsencePeriod2))
{
- SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, Translate("This contact has been absent for an extended period of time."));
+ SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, TranslateT("This contact has been absent for an extended period of time."));
}
else
{
- SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, "");
+ SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, _T(""));
}
SendMessage(GetDlgItem(hdlg, IDC_CHECK_MISSYOU), BM_SETCHECK, DBGetContactSettingByte((HANDLE)lparam, MODULE_NAME, "MissYou", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
@@ -604,8 +604,9 @@ int UserinfoInit(WPARAM wparam, LPARAM lparam)
OPTIONSDIALOGPAGE uip = {0};
uip.cbSize = sizeof(uip);
uip.hInstance = hInst;
- uip.pszTemplate = MAKEINTRESOURCE(IDD_USERINFO);
- uip.pszTitle = Translate("Buddy Expectator");
+ uip.pszTemplate = MAKEINTRESOURCEA(IDD_USERINFO);
+ uip.flags = ODPF_TCHAR;
+ uip.ptszTitle = LPGENT("Buddy Expectator");
uip.pfnDlgProc = UserinfoDlgProc;
UserInfo_AddPage(wparam, &uip);