summaryrefslogtreecommitdiff
path: root/plugins/WhenWasIt/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/WhenWasIt/src')
-rw-r--r--plugins/WhenWasIt/src/WhenWasIt.cpp4
-rw-r--r--plugins/WhenWasIt/src/birthdays.cpp2
-rw-r--r--plugins/WhenWasIt/src/birthdays.h2
-rw-r--r--plugins/WhenWasIt/src/date_utils.cpp2
-rw-r--r--plugins/WhenWasIt/src/dlg_handlers.cpp457
-rw-r--r--plugins/WhenWasIt/src/hooked_events.cpp10
-rw-r--r--plugins/WhenWasIt/src/services.cpp23
7 files changed, 247 insertions, 253 deletions
diff --git a/plugins/WhenWasIt/src/WhenWasIt.cpp b/plugins/WhenWasIt/src/WhenWasIt.cpp
index bb900196e6..a03cdba625 100644
--- a/plugins/WhenWasIt/src/WhenWasIt.cpp
+++ b/plugins/WhenWasIt/src/WhenWasIt.cpp
@@ -45,7 +45,7 @@ PLUGININFOEX pluginInfo = {
{ 0x2ff96c84, 0xb0b5, 0x470e, { 0xbb, 0xf9, 0x90, 0x7b, 0x9f, 0x3f, 0x5d, 0x2f } }
};
-extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
@@ -154,7 +154,7 @@ extern "C" int __declspec(dllexport) Unload()
return 0;
}
-bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInstance = hinstDLL;
return TRUE;
diff --git a/plugins/WhenWasIt/src/birthdays.cpp b/plugins/WhenWasIt/src/birthdays.cpp
index 78e128130c..7f4a93ed3e 100644
--- a/plugins/WhenWasIt/src/birthdays.cpp
+++ b/plugins/WhenWasIt/src/birthdays.cpp
@@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-CBirthdays &birthdays = CBirthdays();
+CBirthdays birthdays;
CBirthdays::CBirthdays(int initialSize)
{
diff --git a/plugins/WhenWasIt/src/birthdays.h b/plugins/WhenWasIt/src/birthdays.h
index c1f8085fd6..10fdfa45fa 100644
--- a/plugins/WhenWasIt/src/birthdays.h
+++ b/plugins/WhenWasIt/src/birthdays.h
@@ -63,6 +63,6 @@ public:
int Size() const;
};
-extern CBirthdays &birthdays;
+extern CBirthdays birthdays;
#endif //M_WWI_BIRTHDAYS_H
diff --git a/plugins/WhenWasIt/src/date_utils.cpp b/plugins/WhenWasIt/src/date_utils.cpp
index cb2f47ebe2..d69a9b0dc3 100644
--- a/plugins/WhenWasIt/src/date_utils.cpp
+++ b/plugins/WhenWasIt/src/date_utils.cpp
@@ -28,7 +28,7 @@ time_t Today()
return mktime(date);
}
-bool IsDOBValid(int year, int month, int day)
+bool IsDOBValid(int, int month, int day)
{
return (month != 0 && day != 0);
}
diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp
index 9e1209d1a1..1083287cc2 100644
--- a/plugins/WhenWasIt/src/dlg_handlers.cpp
+++ b/plugins/WhenWasIt/src/dlg_handlers.cpp
@@ -130,7 +130,7 @@ SIZE GetControlTextSize(HWND hCtrl)
return size;
}
-int EnlargeControl(HWND hCtrl, HWND hGroup, SIZE oldSize)
+int EnlargeControl(HWND hCtrl, HWND, SIZE oldSize)
{
SIZE size = GetControlTextSize(hCtrl);
RECT rect;
@@ -162,76 +162,76 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
static int bInitializing = 0;
switch (msg) {
case WM_INITDIALOG:
- {
- bInitializing = 1;
+ {
+ bInitializing = 1;
- SIZE oldPopupsSize = GetControlTextSize(GetDlgItem(hWnd, IDC_USE_POPUPS));
- SIZE oldClistIconSize = GetControlTextSize(GetDlgItem(hWnd, IDC_USE_CLISTICON));
- SIZE oldDialogSize = GetControlTextSize(GetDlgItem(hWnd, IDC_USE_DIALOG));
+ SIZE oldPopupsSize = GetControlTextSize(GetDlgItem(hWnd, IDC_USE_POPUPS));
+ SIZE oldClistIconSize = GetControlTextSize(GetDlgItem(hWnd, IDC_USE_CLISTICON));
+ SIZE oldDialogSize = GetControlTextSize(GetDlgItem(hWnd, IDC_USE_DIALOG));
- TranslateDialogDefault(hWnd);
+ TranslateDialogDefault(hWnd);
- EnlargeControl(GetDlgItem(hWnd, IDC_USE_POPUPS), GetDlgItem(hWnd, IDC_POPUPS_STATIC), oldPopupsSize);
- EnlargeControl(GetDlgItem(hWnd, IDC_USE_CLISTICON), GetDlgItem(hWnd, IDC_CLIST_STATIC), oldClistIconSize);
- EnlargeControl(GetDlgItem(hWnd, IDC_USE_DIALOG), GetDlgItem(hWnd, IDC_DIALOG_STATIC), oldDialogSize);
+ EnlargeControl(GetDlgItem(hWnd, IDC_USE_POPUPS), GetDlgItem(hWnd, IDC_POPUPS_STATIC), oldPopupsSize);
+ EnlargeControl(GetDlgItem(hWnd, IDC_USE_CLISTICON), GetDlgItem(hWnd, IDC_CLIST_STATIC), oldClistIconSize);
+ EnlargeControl(GetDlgItem(hWnd, IDC_USE_DIALOG), GetDlgItem(hWnd, IDC_DIALOG_STATIC), oldDialogSize);
- AddInfoToComboBoxes(hWnd);
+ AddInfoToComboBoxes(hWnd);
- SendDlgItemMessage(hWnd, IDC_FOREGROUND, CPM_SETDEFAULTCOLOUR, 0, FOREGROUND_COLOR);
- SendDlgItemMessage(hWnd, IDC_BACKGROUND, CPM_SETDEFAULTCOLOUR, 0, BACKGROUND_COLOR);
+ SendDlgItemMessage(hWnd, IDC_FOREGROUND, CPM_SETDEFAULTCOLOUR, 0, FOREGROUND_COLOR);
+ SendDlgItemMessage(hWnd, IDC_BACKGROUND, CPM_SETDEFAULTCOLOUR, 0, BACKGROUND_COLOR);
- SendDlgItemMessage(hWnd, IDC_FOREGROUND, CPM_SETCOLOUR, 0, commonData.foreground);
- SendDlgItemMessage(hWnd, IDC_BACKGROUND, CPM_SETCOLOUR, 0, commonData.background);
+ SendDlgItemMessage(hWnd, IDC_FOREGROUND, CPM_SETCOLOUR, 0, commonData.foreground);
+ SendDlgItemMessage(hWnd, IDC_BACKGROUND, CPM_SETCOLOUR, 0, commonData.background);
- SendDlgItemMessage(hWnd, IDC_DEFAULT_MODULE, CB_SETCURSEL, commonData.cDefaultModule, 0);
- SendDlgItemMessage(hWnd, IDC_LEFT_CLICK, CB_SETCURSEL, commonData.lPopupClick, 0);
- SendDlgItemMessage(hWnd, IDC_RIGHT_CLICK, CB_SETCURSEL, commonData.rPopupClick, 0);
- SendDlgItemMessage(hWnd, IDC_NOTIFYFOR, CB_SETCURSEL, commonData.notifyFor, 0);
+ SendDlgItemMessage(hWnd, IDC_DEFAULT_MODULE, CB_SETCURSEL, commonData.cDefaultModule, 0);
+ SendDlgItemMessage(hWnd, IDC_LEFT_CLICK, CB_SETCURSEL, commonData.lPopupClick, 0);
+ SendDlgItemMessage(hWnd, IDC_RIGHT_CLICK, CB_SETCURSEL, commonData.rPopupClick, 0);
+ SendDlgItemMessage(hWnd, IDC_NOTIFYFOR, CB_SETCURSEL, commonData.notifyFor, 0);
- CreateToolTip(GetDlgItem(hWnd, IDC_POPUP_TIMEOUT), TranslateT("Set popup delay when notifying of upcoming birthdays.\nFormat: default delay [ | delay for birthdays occurring today]"), 400);
+ CreateToolTip(GetDlgItem(hWnd, IDC_POPUP_TIMEOUT), TranslateT("Set popup delay when notifying of upcoming birthdays.\nFormat: default delay [ | delay for birthdays occurring today]"), 400);
- TCHAR buffer[1024];
- _itot(commonData.daysInAdvance, buffer, 10);
- SetDlgItemText(hWnd, IDC_DAYS_IN_ADVANCE, buffer);
- _itot(commonData.checkInterval, buffer, 10);
- SetDlgItemText(hWnd, IDC_CHECK_INTERVAL, buffer);
- mir_sntprintf(buffer, _countof(buffer), _T("%d|%d"), commonData.popupTimeout, commonData.popupTimeoutToday);
- SetDlgItemText(hWnd, IDC_POPUP_TIMEOUT, buffer);
- _itot(commonData.cSoundNearDays, buffer, 10);
- SetDlgItemText(hWnd, IDC_SOUND_NEAR_DAYS_EDIT, buffer);
- _itot(commonData.cDlgTimeout, buffer, 10);
- SetDlgItemText(hWnd, IDC_DLG_TIMEOUT, buffer);
- _itot(commonData.daysAfter, buffer, 10);
- SetDlgItemText(hWnd, IDC_DAYS_AFTER, buffer);
+ TCHAR buffer[1024];
+ _itot(commonData.daysInAdvance, buffer, 10);
+ SetDlgItemText(hWnd, IDC_DAYS_IN_ADVANCE, buffer);
+ _itot(commonData.checkInterval, buffer, 10);
+ SetDlgItemText(hWnd, IDC_CHECK_INTERVAL, buffer);
+ mir_sntprintf(buffer, _countof(buffer), _T("%d|%d"), commonData.popupTimeout, commonData.popupTimeoutToday);
+ SetDlgItemText(hWnd, IDC_POPUP_TIMEOUT, buffer);
+ _itot(commonData.cSoundNearDays, buffer, 10);
+ SetDlgItemText(hWnd, IDC_SOUND_NEAR_DAYS_EDIT, buffer);
+ _itot(commonData.cDlgTimeout, buffer, 10);
+ SetDlgItemText(hWnd, IDC_DLG_TIMEOUT, buffer);
+ _itot(commonData.daysAfter, buffer, 10);
+ SetDlgItemText(hWnd, IDC_DAYS_AFTER, buffer);
- CheckDlgButton(hWnd, IDC_OPENINBACKGROUND, (commonData.bOpenInBackground) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_OPENINBACKGROUND, (commonData.bOpenInBackground) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_NOBIRTHDAYS_POPUP, (commonData.bNoBirthdaysPopup) ? BST_CHECKED : BST_UNCHECKED);
- SendDlgItemMessage(hWnd, IDC_AGE_COMBOBOX, CB_SETCURSEL, commonData.cShowAgeMode, 0);
+ CheckDlgButton(hWnd, IDC_NOBIRTHDAYS_POPUP, (commonData.bNoBirthdaysPopup) ? BST_CHECKED : BST_UNCHECKED);
+ SendDlgItemMessage(hWnd, IDC_AGE_COMBOBOX, CB_SETCURSEL, commonData.cShowAgeMode, 0);
- CheckDlgButton(hWnd, IDC_IGNORE_SUBCONTACTS, (commonData.bIgnoreSubcontacts) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_IGNORE_SUBCONTACTS, (commonData.bIgnoreSubcontacts) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_ONCE_PER_DAY, (commonData.bOncePerDay) ? BST_CHECKED : BST_UNCHECKED);
- EnableWindow(GetDlgItem(hWnd, IDC_CHECK_INTERVAL), !commonData.bOncePerDay);
+ CheckDlgButton(hWnd, IDC_ONCE_PER_DAY, (commonData.bOncePerDay) ? BST_CHECKED : BST_UNCHECKED);
+ EnableWindow(GetDlgItem(hWnd, IDC_CHECK_INTERVAL), !commonData.bOncePerDay);
- CheckDlgButton(hWnd, IDC_USE_DIALOG, (commonData.bUseDialog) ? BST_CHECKED : BST_UNCHECKED);
- EnableDialogGroup(hWnd, commonData.bUseDialog);
+ CheckDlgButton(hWnd, IDC_USE_DIALOG, (commonData.bUseDialog) ? BST_CHECKED : BST_UNCHECKED);
+ EnableDialogGroup(hWnd, commonData.bUseDialog);
- if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- CheckDlgButton(hWnd, IDC_USE_POPUPS, commonData.bUsePopups ? BST_CHECKED : BST_UNCHECKED);
- EnablePopupsGroup(hWnd, commonData.bUsePopups);
- }
- else {
- EnableWindow(GetDlgItem(hWnd, IDC_USE_POPUPS), FALSE);
- EnablePopupsGroup(hWnd, FALSE);
- }
+ if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
+ CheckDlgButton(hWnd, IDC_USE_POPUPS, commonData.bUsePopups ? BST_CHECKED : BST_UNCHECKED);
+ EnablePopupsGroup(hWnd, commonData.bUsePopups);
+ }
+ else {
+ EnableWindow(GetDlgItem(hWnd, IDC_USE_POPUPS), FALSE);
+ EnablePopupsGroup(hWnd, FALSE);
+ }
- CheckDlgButton(hWnd, IDC_USE_CLISTICON, BST_CHECKED);
- EnableWindow(GetDlgItem(hWnd, IDC_USE_CLISTICON), FALSE);
- EnableClistGroup(hWnd, FALSE);
- }
- bInitializing = 0;
- return TRUE;
+ CheckDlgButton(hWnd, IDC_USE_CLISTICON, BST_CHECKED);
+ EnableWindow(GetDlgItem(hWnd, IDC_USE_CLISTICON), FALSE);
+ EnableClistGroup(hWnd, FALSE);
+ }
+ bInitializing = 0;
+ return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
@@ -272,13 +272,13 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
break;
case IDC_PREVIEW:
- {
- MCONTACT hContact = db_find_first();
- int dtb = rand() % 11; //0..10
- int age = rand() % 50 + 1; //1..50
- PopupNotifyBirthday(hContact, dtb, age);
- break;
- }
+ {
+ MCONTACT hContact = db_find_first();
+ int dtb = rand() % 11; //0..10
+ int age = rand() % 50 + 1; //1..50
+ PopupNotifyBirthday(hContact, dtb, age);
+ break;
+ }
}
break;
@@ -413,65 +413,65 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
break;
case WM_SHOWWINDOW:
- {
- TCHAR *szTooltipText = TranslateT("Please select the module where you want the date of birth to be saved.\r\n\"UserInfo\" is the default location.\r\nUse \"Protocol module\" to make the data visible in User Details.\n\"mBirthday module\" uses the same module as mBirthday plugin.");
- TCHAR *szCurrentModuleTooltip = NULL;
- char *szProto = GetContactProto(hContact);
+ {
+ TCHAR *szTooltipText = TranslateT("Please select the module where you want the date of birth to be saved.\r\n\"UserInfo\" is the default location.\r\nUse \"Protocol module\" to make the data visible in User Details.\n\"mBirthday module\" uses the same module as mBirthday plugin.");
+ TCHAR *szCurrentModuleTooltip = NULL;
+ char *szProto = GetContactProto(hContact);
- TCHAR buffer[2048];
- mir_sntprintf(buffer, _countof(buffer), TranslateT("Set birthday for %s:"), pcli->pfnGetContactDisplayName(hContact, 0));
- SetWindowText(hWnd, buffer);
-
- HWND hDate = GetDlgItem(hWnd, IDC_DATE);
-
- int year, month, day;
- int loc = GetContactDOB(hContact, year, month, day);
- if (IsDOBValid(year, month, day)) {
- SYSTEMTIME st = { 0 };
- st.wDay = day;
- st.wMonth = month;
- st.wYear = year;
- DateTime_SetSystemtime(hDate, GDT_VALID, &st);
- }
- else DateTime_SetSystemtime(hDate, GDT_NONE, NULL);
+ TCHAR buffer[2048];
+ mir_sntprintf(buffer, _countof(buffer), TranslateT("Set birthday for %s:"), pcli->pfnGetContactDisplayName(hContact, 0));
+ SetWindowText(hWnd, buffer);
- switch (loc) {
- case DOB_MBIRTHDAY:
- DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_MBIRTHDAY);
- szCurrentModuleTooltip = _T("mBirthday");
- break;
+ HWND hDate = GetDlgItem(hWnd, IDC_DATE);
- case DOB_PROTOCOL:
- DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_PROTOCOL);
- mir_sntprintf(buffer, _countof(buffer), TranslateT("%S protocol"), szProto);
- szCurrentModuleTooltip = buffer;
- break;
+ int year, month, day;
+ int loc = GetContactDOB(hContact, year, month, day);
+ if (IsDOBValid(year, month, day)) {
+ SYSTEMTIME st = { 0 };
+ st.wDay = day;
+ st.wMonth = month;
+ st.wYear = year;
+ DateTime_SetSystemtime(hDate, GDT_VALID, &st);
+ }
+ else DateTime_SetSystemtime(hDate, GDT_NONE, NULL);
- case DOB_BIRTHDAYREMINDER:
- DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_BIRTHDAYREMINDER);
- szCurrentModuleTooltip = _T("Birthday Reminder");
- break;
+ switch (loc) {
+ case DOB_MBIRTHDAY:
+ DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_MBIRTHDAY);
+ szCurrentModuleTooltip = _T("mBirthday");
+ break;
- case DOB_USERINFO:
- DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_USERINFO);
- szCurrentModuleTooltip = _T("UserInfo");
- break;
+ case DOB_PROTOCOL:
+ DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_PROTOCOL);
+ mir_sntprintf(buffer, _countof(buffer), TranslateT("%S protocol"), szProto);
+ szCurrentModuleTooltip = buffer;
+ break;
- case DOB_MICQBIRTHDAY:
- DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_MICQBIRTHDAY);
- szCurrentModuleTooltip = _T("mICQBirthday");
- break;
+ case DOB_BIRTHDAYREMINDER:
+ DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_BIRTHDAYREMINDER);
+ szCurrentModuleTooltip = _T("Birthday Reminder");
+ break;
- default:
- szCurrentModuleTooltip = NULL;
- break;
- }
+ case DOB_USERINFO:
+ DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_USERINFO);
+ szCurrentModuleTooltip = _T("UserInfo");
+ break;
- CreateToolTip(GetDlgItem(hWnd, IDC_COMPATIBILITY), szTooltipText, 500);
- if (szCurrentModuleTooltip)
- CreateToolTip(hDate, szCurrentModuleTooltip, 400);
- }
- break;
+ case DOB_MICQBIRTHDAY:
+ DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_MICQBIRTHDAY);
+ szCurrentModuleTooltip = _T("mICQBirthday");
+ break;
+
+ default:
+ szCurrentModuleTooltip = NULL;
+ break;
+ }
+
+ CreateToolTip(GetDlgItem(hWnd, IDC_COMPATIBILITY), szTooltipText, 500);
+ if (szCurrentModuleTooltip)
+ CreateToolTip(hDate, szCurrentModuleTooltip, 400);
+ }
+ break;
case WM_DESTROY:
RefreshContactListIcons(hContact); //the birthday might be changed, refresh icon.
@@ -518,7 +518,7 @@ void AddAnchorWindowToDeferList(HDWP &hdWnds, HWND window, RECT *rParent, WINDOW
#define NA TranslateT("N/A")
-TCHAR *GetBirthdayModule(int module, MCONTACT hContact)
+TCHAR* GetBirthdayModule(int module, MCONTACT)
{
switch (module) {
case DOB_MBIRTHDAY: return _T("mBirthday");
@@ -532,7 +532,8 @@ TCHAR *GetBirthdayModule(int module, MCONTACT hContact)
static int lastColumn = -1;
-struct BirthdaysSortParams{
+struct BirthdaysSortParams
+{
HWND hList;
int column;
};
@@ -587,7 +588,7 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll,
int dtb = DaysToBirthday(Today(), year, month, day);
int age = GetContactAge(hContact);
if (bShowCurrentAge)
- if ((month > currentMonth) || ((month == currentMonth) && (day > currentDay))) //birthday still to come
+ if (month > currentMonth || (month == currentMonth) && (day > currentDay)) // birthday still to come
age--;
char *szProto = GetContactProto(hContact);
@@ -762,42 +763,42 @@ INT_PTR CALLBACK DlgProcBirthdays(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
break;
case WWIM_UPDATE_BIRTHDAY:
- {
- MCONTACT hContact = wParam;
- HWND hList = GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST);
- LVFINDINFO fi = { 0 };
-
- fi.flags = LVFI_PARAM;
- fi.lParam = (LPARAM)hContact;
- int idx = ListView_FindItem(hList, -1, &fi);
- if (-1 == idx)
- UpdateBirthdayEntry(hList, hContact, ListView_GetItemCount(hList), IsDlgButtonChecked(hWnd, IDC_SHOW_ALL), commonData.cShowAgeMode, 1);
- else
- UpdateBirthdayEntry(hList, hContact, idx, IsDlgButtonChecked(hWnd, IDC_SHOW_ALL), commonData.cShowAgeMode, 0);
- SetBirthdaysCount(hWnd);
- }
- break;
+ {
+ MCONTACT hContact = wParam;
+ HWND hList = GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST);
+ LVFINDINFO fi = { 0 };
+
+ fi.flags = LVFI_PARAM;
+ fi.lParam = (LPARAM)hContact;
+ int idx = ListView_FindItem(hList, -1, &fi);
+ if (-1 == idx)
+ UpdateBirthdayEntry(hList, hContact, ListView_GetItemCount(hList), IsDlgButtonChecked(hWnd, IDC_SHOW_ALL), commonData.cShowAgeMode, 1);
+ else
+ UpdateBirthdayEntry(hList, hContact, idx, IsDlgButtonChecked(hWnd, IDC_SHOW_ALL), commonData.cShowAgeMode, 0);
+ SetBirthdaysCount(hWnd);
+ }
+ break;
case WM_WINDOWPOSCHANGING:
- {
- HDWP hdWnds = BeginDeferWindowPos(2);
- RECT rParent;
- WINDOWPOS *wndPos = (WINDOWPOS *)lParam;
- GetWindowRect(hWnd, &rParent);
+ {
+ HDWP hdWnds = BeginDeferWindowPos(2);
+ RECT rParent;
+ WINDOWPOS *wndPos = (WINDOWPOS *)lParam;
+ GetWindowRect(hWnd, &rParent);
- if (wndPos->cx < MIN_BIRTHDAYS_WIDTH)
- wndPos->cx = MIN_BIRTHDAYS_WIDTH;
+ if (wndPos->cx < MIN_BIRTHDAYS_WIDTH)
+ wndPos->cx = MIN_BIRTHDAYS_WIDTH;
- if (wndPos->cy < MIN_BIRTHDAYS_HEIGHT)
- wndPos->cy = MIN_BIRTHDAYS_HEIGHT;
+ if (wndPos->cy < MIN_BIRTHDAYS_HEIGHT)
+ wndPos->cy = MIN_BIRTHDAYS_HEIGHT;
- AddAnchorWindowToDeferList(hdWnds, GetDlgItem(hWnd, IDC_CLOSE), &rParent, wndPos, ANCHOR_RIGHT | ANCHOR_BOTTOM);
- AddAnchorWindowToDeferList(hdWnds, GetDlgItem(hWnd, IDC_SHOW_ALL), &rParent, wndPos, ANCHOR_LEFT | ANCHOR_BOTTOM);
- AddAnchorWindowToDeferList(hdWnds, GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST), &rParent, wndPos, ANCHOR_ALL);
+ AddAnchorWindowToDeferList(hdWnds, GetDlgItem(hWnd, IDC_CLOSE), &rParent, wndPos, ANCHOR_RIGHT | ANCHOR_BOTTOM);
+ AddAnchorWindowToDeferList(hdWnds, GetDlgItem(hWnd, IDC_SHOW_ALL), &rParent, wndPos, ANCHOR_LEFT | ANCHOR_BOTTOM);
+ AddAnchorWindowToDeferList(hdWnds, GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST), &rParent, wndPos, ANCHOR_ALL);
- EndDeferWindowPos(hdWnds);
- }
- break;
+ EndDeferWindowPos(hdWnds);
+ }
+ break;
case WM_COMMAND:
switch (LOWORD(wParam)) {
@@ -847,84 +848,84 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
switch (msg) {
case WM_INITDIALOG:
- {
TranslateDialogDefault(hWnd);
- timeout = commonData.cDlgTimeout;
- SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIconByHandle(hListMenu));
- HWND hList = GetDlgItem(hWnd, IDC_UPCOMING_LIST);
-
- mir_subclassWindow(hList, BirthdaysListSubclassProc);
- ListView_SetExtendedListViewStyleEx(hList, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);
-
- LVCOLUMN col;
- col.mask = LVCF_TEXT | LVCF_WIDTH;
- col.pszText = TranslateT("Contact");
- col.cx = 300;
- ListView_InsertColumn(hList, 0, &col);
- col.pszText = TranslateT("Age");
- col.cx = 45;
- ListView_InsertColumn(hList, 1, &col);
- col.pszText = TranslateT("DTB");
- col.cx = 45;
- ListView_InsertColumn(hList, 2, &col);
-
- ListView_SetColumnWidth(hList, 0, LVSCW_AUTOSIZE);
-
- if (timeout > 0)
- SetTimer(hWnd, UPCOMING_TIMER_ID, 1000, NULL);
- Utils_RestoreWindowPosition(hWnd, NULL, ModuleName, "BirthdayListUpcoming");
- }
- return TRUE;
+ {
+ timeout = commonData.cDlgTimeout;
+ SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIconByHandle(hListMenu));
+ HWND hList = GetDlgItem(hWnd, IDC_UPCOMING_LIST);
+
+ mir_subclassWindow(hList, BirthdaysListSubclassProc);
+ ListView_SetExtendedListViewStyleEx(hList, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);
+
+ LVCOLUMN col;
+ col.mask = LVCF_TEXT | LVCF_WIDTH;
+ col.pszText = TranslateT("Contact");
+ col.cx = 300;
+ ListView_InsertColumn(hList, 0, &col);
+ col.pszText = TranslateT("Age");
+ col.cx = 45;
+ ListView_InsertColumn(hList, 1, &col);
+ col.pszText = TranslateT("DTB");
+ col.cx = 45;
+ ListView_InsertColumn(hList, 2, &col);
+
+ ListView_SetColumnWidth(hList, 0, LVSCW_AUTOSIZE);
+
+ if (timeout > 0)
+ SetTimer(hWnd, UPCOMING_TIMER_ID, 1000, NULL);
+ Utils_RestoreWindowPosition(hWnd, NULL, ModuleName, "BirthdayListUpcoming");
+ }
+ return TRUE;
case WM_TIMER:
- {
- const int MAX_SIZE = 512;
- TCHAR buffer[MAX_SIZE];
- timeout--;
- mir_sntprintf(buffer, _countof(buffer), (timeout != 2) ? TranslateT("Closing in %d seconds") : TranslateT("Closing in %d second"), timeout);
- SetDlgItemText(hWnd, IDC_CLOSE, buffer);
-
- if (timeout <= 0)
- SendMessage(hWnd, WM_CLOSE, 0, 0);
- }
- break;
+ {
+ const int MAX_SIZE = 512;
+ TCHAR buffer[MAX_SIZE];
+ timeout--;
+ mir_sntprintf(buffer, _countof(buffer), (timeout != 2) ? TranslateT("Closing in %d seconds") : TranslateT("Closing in %d second"), timeout);
+ SetDlgItemText(hWnd, IDC_CLOSE, buffer);
+
+ if (timeout <= 0)
+ SendMessage(hWnd, WM_CLOSE, 0, 0);
+ }
+ break;
case WM_CLOSE:
DestroyWindow(hWnd);
break;
case WWIM_ADD_UPCOMING_BIRTHDAY:
- {
- PUpcomingBirthday data = (PUpcomingBirthday)wParam;
+ {
+ PUpcomingBirthday data = (PUpcomingBirthday)wParam;
+
+ HWND hList = GetDlgItem(hWnd, IDC_UPCOMING_LIST);
+ LVITEM item = { 0 };
+ LVFINDINFO fi = { 0 };
+
+ fi.flags = LVFI_PARAM;
+ fi.lParam = (LPARAM)data->hContact;
+ if (-1 != ListView_FindItem(hList, -1, &fi))
+ return 0; /* Allready in list. */
+
+ int index = ListView_GetItemCount(hList);
+ item.iItem = index;
+ item.mask = LVIF_PARAM | LVIF_TEXT;
+ item.lParam = (LPARAM)data->hContact;
+ item.pszText = data->message;
+ ListView_InsertItem(hList, &item);
- HWND hList = GetDlgItem(hWnd, IDC_UPCOMING_LIST);
- LVITEM item = { 0 };
- LVFINDINFO fi = { 0 };
-
- fi.flags = LVFI_PARAM;
- fi.lParam = (LPARAM)data->hContact;
- if (-1 != ListView_FindItem(hList, -1, &fi))
- return 0; /* Allready in list. */
-
- int index = ListView_GetItemCount(hList);
- item.iItem = index;
- item.mask = LVIF_PARAM | LVIF_TEXT;
- item.lParam = (LPARAM)data->hContact;
- item.pszText = data->message;
- ListView_InsertItem(hList, &item);
-
- TCHAR buffer[512];
- mir_sntprintf(buffer, _countof(buffer), _T("%d"), data->age);
- ListView_SetItemText(hList, index, 1, buffer);
- mir_sntprintf(buffer, _countof(buffer), _T("%d"), data->dtb);
- ListView_SetItemText(hList, index, 2, buffer);
-
- BirthdaysSortParams params = { 0 };
- params.hList = hList;
- params.column = 2;
- ListView_SortItemsEx(hList, BirthdaysCompare, (LPARAM)&params);
- }
- break;
+ TCHAR buffer[512];
+ mir_sntprintf(buffer, _countof(buffer), _T("%d"), data->age);
+ ListView_SetItemText(hList, index, 1, buffer);
+ mir_sntprintf(buffer, _countof(buffer), _T("%d"), data->dtb);
+ ListView_SetItemText(hList, index, 2, buffer);
+
+ BirthdaysSortParams params = { 0 };
+ params.hList = hList;
+ params.column = 2;
+ ListView_SortItemsEx(hList, BirthdaysCompare, (LPARAM)&params);
+ }
+ break;
case WM_COMMAND:
switch (LOWORD(wParam)) {
@@ -942,20 +943,20 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
break;
case WM_SIZE:
- {
- int cx, cy;
- RECT rcWin;
- HWND hList = GetDlgItem(hWnd, IDC_UPCOMING_LIST);
- GetWindowRect(hWnd, &rcWin);
-
- cx = rcWin.right - rcWin.left;
- cy = rcWin.bottom - rcWin.top;
- SetWindowPos(hList, NULL, 0, 0, (cx - 30), (cy - 80), (SWP_NOZORDER | SWP_NOMOVE));
- ListView_SetColumnWidth(hList, 0, (cx - 150));
- SetWindowPos(GetDlgItem(hWnd, IDC_CLOSE), NULL, ((cx / 2) - 95), (cy - 67), 0, 0, SWP_NOSIZE);
- RedrawWindow(hWnd, NULL, NULL, (RDW_FRAME | RDW_INVALIDATE));
- }
- break;
+ {
+ HWND hList = GetDlgItem(hWnd, IDC_UPCOMING_LIST);
+
+ RECT rcWin;
+ GetWindowRect(hWnd, &rcWin);
+
+ int cx = rcWin.right - rcWin.left;
+ int cy = rcWin.bottom - rcWin.top;
+ SetWindowPos(hList, NULL, 0, 0, (cx - 30), (cy - 80), (SWP_NOZORDER | SWP_NOMOVE));
+ ListView_SetColumnWidth(hList, 0, (cx - 150));
+ SetWindowPos(GetDlgItem(hWnd, IDC_CLOSE), NULL, ((cx / 2) - 95), (cy - 67), 0, 0, SWP_NOSIZE);
+ RedrawWindow(hWnd, NULL, NULL, (RDW_FRAME | RDW_INVALIDATE));
+ }
+ break;
case WM_DESTROY:
hUpcomingDlg = NULL;
diff --git a/plugins/WhenWasIt/src/hooked_events.cpp b/plugins/WhenWasIt/src/hooked_events.cpp
index 83d2904a90..c00b8c629e 100644
--- a/plugins/WhenWasIt/src/hooked_events.cpp
+++ b/plugins/WhenWasIt/src/hooked_events.cpp
@@ -24,8 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define EXCLUDE_HIDDEN 1
#define EXCLUDE_IGNORED 2
-static UINT_PTR hCheckTimer = NULL;
-static UINT_PTR hDateChangeTimer = NULL;
+UINT_PTR hCheckTimer = NULL;
+UINT_PTR hDateChangeTimer = NULL;
static int currentDay = 0;
@@ -58,7 +58,6 @@ static int OnOptionsInitialise(WPARAM wParam, LPARAM)
static int OnContactSettingChanged(WPARAM hContact, LPARAM lParam)
{
DBCONTACTWRITESETTING *dw = (DBCONTACTWRITESETTING *)lParam;
- DBVARIANT dv = dw->value;
if ((mir_strcmp(dw->szModule, DUMMY_MODULE) == 0) && (mir_strcmp(dw->szSetting, DUMMY_SETTING) == 0))
RefreshContactListIcons(hContact);
@@ -94,7 +93,6 @@ int RefreshContactListIcons(MCONTACT hContact)
if (hContact == 0)
return 0;
- int count = CallService(MS_DB_CONTACT_GETCOUNT, 0, 0);
int hidden = db_get_b(hContact, "CList", "Hidden", 0);
int ignored = db_get_dw(hContact, "Ignore", "Mask1", 0);
ignored = ((ignored & 0x3f) != 0) ? 1 : 0;
@@ -165,12 +163,12 @@ int KillTimers()
return 0;
}
-VOID CALLBACK OnCheckTimer(HWND hWnd, UINT msg, UINT_PTR idEvent, DWORD dwTime)
+VOID CALLBACK OnCheckTimer(HWND, UINT, UINT_PTR, DWORD)
{
CheckBirthdaysService(0, 1);
}
-VOID CALLBACK OnDateChangeTimer(HWND hWnd, UINT msg, UINT_PTR idEvent, DWORD dwTime)
+VOID CALLBACK OnDateChangeTimer(HWND, UINT, UINT_PTR, DWORD)
{
SYSTEMTIME now;
GetLocalTime(&now);
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp
index f38ba2acd6..ecfe1bbfbe 100644
--- a/plugins/WhenWasIt/src/services.cpp
+++ b/plugins/WhenWasIt/src/services.cpp
@@ -119,7 +119,7 @@ int NotifyMissedContactBirthday(MCONTACT hContact, time_t now, int daysAfter)
//the timer functions call this service with lParam = 1
//lParam = 0 - force check, lParam - 1 do not force it.
-INT_PTR CheckBirthdaysService(WPARAM wParam, LPARAM lParam)
+INT_PTR CheckBirthdaysService(WPARAM, LPARAM lParam)
{
bBirthdayFound = 0; //no birthdays have been found in the given interval
@@ -158,7 +158,7 @@ INT_PTR CheckBirthdaysService(WPARAM wParam, LPARAM lParam)
return 0;
}
-INT_PTR ShowListService(WPARAM wParam, LPARAM lParam)
+INT_PTR ShowListService(WPARAM, LPARAM)
{
if (!hBirthdaysDlg)
hBirthdaysDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_BIRTHDAYS), NULL, DlgProcBirthdays);
@@ -167,11 +167,11 @@ INT_PTR ShowListService(WPARAM wParam, LPARAM lParam)
return 0;
}
-INT_PTR AddBirthdayService(WPARAM hContact, LPARAM lParam)
+INT_PTR AddBirthdayService(WPARAM hContact, LPARAM)
{
HWND hWnd = WindowList_Find(hAddBirthdayWndsList, hContact);
if (!hWnd)
- hWnd = CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_ADD_BIRTHDAY), NULL, DlgProcAddBirthday, (LPARAM)hContact);
+ hWnd = CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_ADD_BIRTHDAY), NULL, DlgProcAddBirthday, hContact);
return ShowWindow(hWnd, SW_SHOW);
}
@@ -187,7 +187,7 @@ void ShowPopupMessage(TCHAR *title, TCHAR *message, HANDLE icon)
PUAddPopupT(&pd);
}
-void __cdecl RefreshUserDetailsWorkerThread(void *param)
+void __cdecl RefreshUserDetailsWorkerThread(void*)
{
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Starting to refresh user details"), hRefreshUserDetails);
int delay = db_get_w(NULL, ModuleName, "UpdateDelay", REFRESH_DETAILS_DELAY);
@@ -203,17 +203,13 @@ void __cdecl RefreshUserDetailsWorkerThread(void *param)
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done refreshing user details"), hRefreshUserDetails);
}
-INT_PTR RefreshUserDetailsService(WPARAM wParam, LPARAM lParam)
+INT_PTR RefreshUserDetailsService(WPARAM, LPARAM)
{
- HANDLE result = mir_forkthread(RefreshUserDetailsWorkerThread, 0);
-
- if ((result != NULL) && (result != INVALID_HANDLE_VALUE))
- CloseHandle(result);
-
+ mir_forkthread(RefreshUserDetailsWorkerThread, 0);
return 0;
}
-INT_PTR ImportBirthdaysService(WPARAM wParam, LPARAM lParam)
+INT_PTR ImportBirthdaysService(WPARAM, LPARAM)
{
TCHAR fileName[1024] = { 0 };
OPENFILENAME of = { 0 };
@@ -238,7 +234,7 @@ INT_PTR ImportBirthdaysService(WPARAM wParam, LPARAM lParam)
return 0;
}
-INT_PTR ExportBirthdaysService(WPARAM wParam, LPARAM lParam)
+INT_PTR ExportBirthdaysService(WPARAM, LPARAM)
{
TCHAR fileName[1024] = { 0 };
OPENFILENAME of = { 0 };
@@ -288,7 +284,6 @@ int DoImport(TCHAR *fileName)
delAccount[0] = _T('\0');
TCHAR *delProto = _tcsrchr(buffer, _T('@'));
if (delProto) {
- int tmp2 = delProto[0];
delProto[0] = _T('\0');
TCHAR *szHandle = buffer;