From 423be683866fd8e305457eb725d8cdbe1f297fbd Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 Feb 2019 12:43:20 +0300 Subject: popup code cleaning (cause we have no tchar.h) --- plugins/UserInfoEx/src/dlg_msgbox.cpp | 10 +++++----- plugins/UserInfoEx/src/psp_options.cpp | 14 +++++++------- plugins/UserInfoEx/src/svc_refreshci.cpp | 14 +++++++------- plugins/UserInfoEx/src/svc_reminder.cpp | 12 ++++++------ 4 files changed, 25 insertions(+), 25 deletions(-) (limited to 'plugins/UserInfoEx') diff --git a/plugins/UserInfoEx/src/dlg_msgbox.cpp b/plugins/UserInfoEx/src/dlg_msgbox.cpp index 98a74c248a..05583dbdf8 100644 --- a/plugins/UserInfoEx/src/dlg_msgbox.cpp +++ b/plugins/UserInfoEx/src/dlg_msgbox.cpp @@ -490,13 +490,13 @@ static INT_PTR CALLBACK MsgBoxPop(HWND hDlg, UINT uMsg, WPARAM, LPARAM lParam) MoveWindow(hDlg, -10, -10, 0, 0, FALSE); LPMSGPOPUPDATA pmpd = (LPMSGPOPUPDATA)mir_alloc(sizeof(MSGPOPUPDATA)); if (pmpd) { - POPUPDATAT_V2 pd = { 0 }; + POPUPDATAW_V2 pd = { 0 }; pd.cbSize = sizeof(pd); pd.lchContact = NULL; //(HANDLE)wParam; // icon pd.lchIcon = MsgLoadIcon(pMsgBox); - mir_wstrncpy(pd.lptzContactName, pMsgBox->ptszTitle, _countof(pd.lptzContactName)); - mir_wstrncpy(pd.lptzText, pMsgBox->ptszMsg, _countof(pd.lptzText)); + mir_wstrncpy(pd.lpwzContactName, pMsgBox->ptszTitle, _countof(pd.lpwzContactName)); + mir_wstrncpy(pd.lpwzText, pMsgBox->ptszMsg, _countof(pd.lpwzText)); // CALLBAC Proc pd.PluginWindowProc = PopupProc; @@ -567,7 +567,7 @@ static INT_PTR CALLBACK MsgBoxPop(HWND hDlg, UINT uMsg, WPARAM, LPARAM lParam) } // create popup - CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&pd, APF_NEWDATA); + CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&pd, APF_NEWDATA); if (MB_TYPE(pMsgBox->uType) == MB_OK) EndDialog(hDlg, IDOK); } @@ -642,7 +642,7 @@ INT_PTR MsgBoxService(WPARAM, LPARAM lParam) if (PtrIsValid(pMsgBox) && pMsgBox->cbSize == sizeof(MSGBOX)) { // Shall the MessageBox displayed as popup? if (!(pMsgBox->uType & (MB_INFOBAR | MB_NOPOPUP)) // message box can be a popup? - && ServiceExists(MS_POPUP_ADDPOPUPT) // popups exist? + && ServiceExists(MS_POPUP_ADDPOPUPW) // popups exist? && myGlobals.PopupActionsExist == 1 // popup support ext stuct? && (db_get_dw(0, "Popup", "Actions", 0) & 1) // popup++ actions on? && g_plugin.getByte(SET_POPUPMSGBOX, DEFVAL_POPUPMSGBOX)) // user likes popups? diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index cd8ed8fb48..7888950cc6 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -886,12 +886,12 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR switch (LOWORD(wParam)) { case BTN_PREVIEW: { - POPUPDATAT ppd = { 0 }; + POPUPDATAW ppd = { 0 }; ppd.iSeconds = (int)g_plugin.getByte(SET_POPUP_DELAY, 0); - mir_wstrncpy(ppd.lptzText, TranslateT("This is the reminder message"), MAX_SECONDLINE); + mir_wstrncpy(ppd.lpwzText, TranslateT("This is the reminder message"), MAX_SECONDLINE); // Birthday - mir_wstrncpy(ppd.lptzContactName, TranslateT("Birthday"), _countof(ppd.lptzContactName)); + mir_wstrncpy(ppd.lpwzContactName, TranslateT("Birthday"), _countof(ppd.lpwzContactName)); ppd.lchIcon = IcoLib_GetIcon(ICO_RMD_DTB0); if (IsDlgButtonChecked(hDlg, CHECK_OPT_POPUP_WINCLR)) { ppd.colorBack = GetSysColor(COLOR_BTNFACE); @@ -901,10 +901,10 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR ppd.colorBack = SendDlgItemMessage(hDlg, CLR_BBACK, CPM_GETCOLOUR, 0, 0); ppd.colorText = SendDlgItemMessage(hDlg, CLR_BTEXT, CPM_GETCOLOUR, 0, 0); } - PUAddPopupT(&ppd); + PUAddPopupW(&ppd); // Anniversary - mir_wstrncpy(ppd.lptzContactName, TranslateT("Anniversary"), _countof(ppd.lptzContactName)); + mir_wstrncpy(ppd.lpwzContactName, TranslateT("Anniversary"), _countof(ppd.lpwzContactName)); ppd.lchIcon = IcoLib_GetIcon(ICO_RMD_DTAX); if (IsDlgButtonChecked(hDlg, CHECK_OPT_POPUP_WINCLR)) { ppd.colorBack = GetSysColor(COLOR_BTNFACE); @@ -918,7 +918,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR ppd.colorBack = SendDlgItemMessage(hDlg, CLR_ABACK, CPM_GETCOLOUR, 0, 0); ppd.colorText = SendDlgItemMessage(hDlg, CLR_ATEXT, CPM_GETCOLOUR, 0, 0); } - PUAddPopupT(&ppd); + PUAddPopupW(&ppd); } break; @@ -1068,7 +1068,7 @@ int OnInitOptions(WPARAM wParam, LPARAM) g_plugin.addOptions(wParam, &odp); // Popups page - if (ServiceExists(MS_POPUP_ADDPOPUPT)) { + if (ServiceExists(MS_POPUP_ADDPOPUPW)) { odp.szTitle.a = MODULELONGNAME; odp.szGroup.a = LPGEN("Popups"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUP); diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index 6f07273138..6ad7be5009 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -332,7 +332,7 @@ class CPopupUpdProgress : public CUpdProgress if (pb) { mir_wstrcpy(pb, _szText); - SendMessage(_hWnd, UM_CHANGEPOPUP, CPT_TITLET, (LPARAM)pb); + SendMessage(_hWnd, UM_CHANGEPOPUP, CPT_TITLEW, (LPARAM)pb); } } } @@ -393,7 +393,7 @@ public: **/ virtual HWND Create(LPCTSTR szTitle, PUpdCallback pFnCallBack) { - POPUPDATAT_V2 pd = { 0 }; + POPUPDATAW_V2 pd = { 0 }; pd.cbSize = sizeof(pd); pd.lchIcon = IcoLib_GetIcon(ICO_BTN_UPDATE); pd.iSeconds = -1; @@ -404,12 +404,12 @@ public: // dummy text _szText = mir_wstrdup(szTitle); - mir_wstrcpy(pd.lptzContactName, _szText); + mir_wstrcpy(pd.lpwzContactName, _szText); - mir_wstrcpy(pd.lptzText, L" "); + mir_wstrcpy(pd.lpwzText, L" "); _pFnCallBack = pFnCallBack; - _hWnd = (HWND)CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&pd, APF_RETURN_HWND | APF_NEWDATA); + _hWnd = (HWND)CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&pd, APF_RETURN_HWND | APF_NEWDATA); return _hWnd; } @@ -443,7 +443,7 @@ public: **/ virtual void SetText(LPCTSTR szText) { - SendMessage(_hWnd, UM_CHANGEPOPUP, CPT_TEXTT, (LPARAM)mir_wstrdup(szText)); + SendMessage(_hWnd, UM_CHANGEPOPUP, CPT_TEXTW, (LPARAM)mir_wstrdup(szText)); } }; @@ -635,7 +635,7 @@ public: iWait += 5000; if (Size() && !_pProgress) { - if (ServiceExists(MS_POPUP_CHANGETEXTT) && g_plugin.getByte("PopupProgress", FALSE)) { + if (ServiceExists(MS_POPUP_CHANGETEXTW) && g_plugin.getByte("PopupProgress", FALSE)) { _pProgress = new CPopupUpdProgress(this); } else { diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 005c1e711c..4f5677e4d6 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -249,17 +249,17 @@ static int NotifyWithPopup(MCONTACT hContact, CEvent::EType eventType, int DaysT if (!gRemindOpts.bPopups) return 1; - POPUPDATAT ppd = { 0 }; + POPUPDATAW ppd = { 0 }; ppd.PluginWindowProc = PopupWindowProc; ppd.iSeconds = (int)g_plugin.getByte(SET_POPUP_DELAY, 0); if (hContact) { ppd.lchContact = hContact; - mir_snwprintf(ppd.lptzContactName, L"%s - %s", TranslateW(pszDesc), Clist_GetContactDisplayName(hContact)); + mir_snwprintf(ppd.lpwzContactName, L"%s - %s", TranslateW(pszDesc), Clist_GetContactDisplayName(hContact)); } - else mir_wstrncpy(ppd.lptzContactName, TranslateT("Reminder"), _countof(ppd.lptzContactName)); + else mir_wstrncpy(ppd.lpwzContactName, TranslateT("Reminder"), _countof(ppd.lpwzContactName)); - mir_wstrncpy(ppd.lptzText, pszMsg, MAX_SECONDLINE); + mir_wstrncpy(ppd.lpwzText, pszMsg, MAX_SECONDLINE); ppd.lchIcon = GetAnnivIcon(CEvent(eventType, DaysToAnniv)); @@ -291,7 +291,7 @@ static int NotifyWithPopup(MCONTACT hContact, CEvent::EType eventType, int DaysT break; } } - return PUAddPopupT(&ppd); + return PUAddPopupW(&ppd); } /** @@ -830,7 +830,7 @@ void SvcReminderEnable(BYTE bEnable) gRemindOpts.bCListExtraIcon = g_plugin.getByte(SET_REMIND_EXTRAICON, 1); gRemindOpts.bCheckVisibleOnly = g_plugin.getByte(SET_REMIND_CHECKVISIBLE, DEFVAL_REMIND_CHECKVISIBLE); gRemindOpts.bFlashCList = g_plugin.getByte(SET_REMIND_FLASHICON, FALSE); - gRemindOpts.bPopups = ServiceExists(MS_POPUP_ADDPOPUPT) && g_plugin.getByte(SET_POPUP_ENABLED, DEFVAL_POPUP_ENABLED); + gRemindOpts.bPopups = ServiceExists(MS_POPUP_ADDPOPUPW) && g_plugin.getByte(SET_POPUP_ENABLED, DEFVAL_POPUP_ENABLED); // init the timer UpdateTimer(TRUE); -- cgit v1.2.3