summaryrefslogtreecommitdiff
path: root/plugins/WhenWasIt
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-05-15 10:38:20 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-05-15 10:38:20 +0000
commit48540940b6c28bb4378abfeb500ec45a625b37b6 (patch)
tree2ef294c0763e802f91d868bdef4229b6868527de /plugins/WhenWasIt
parent5c350913f011e119127baeb32a6aedeb4f0d33bc (diff)
initial commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@2 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/WhenWasIt')
-rw-r--r--plugins/WhenWasIt/WhenWasIt.html12
-rw-r--r--plugins/WhenWasIt/WhenWasIt.sln35
-rw-r--r--plugins/WhenWasIt/WhenWasIt/WhenWasIt.cpp145
-rw-r--r--plugins/WhenWasIt/WhenWasIt/WhenWasIt.rc282
-rw-r--r--plugins/WhenWasIt/WhenWasIt/WhenWasIt.vcproj872
-rw-r--r--plugins/WhenWasIt/WhenWasIt/WhenWasIt_10.vcxproj327
-rw-r--r--plugins/WhenWasIt/WhenWasIt/WhenWasIt_10.vcxproj.filters158
-rw-r--r--plugins/WhenWasIt/WhenWasIt/WhenWasIt_8.vcproj546
-rw-r--r--plugins/WhenWasIt/WhenWasIt/WhenWasIt_9.vcproj877
-rw-r--r--plugins/WhenWasIt/WhenWasIt/birthdays.cpp169
-rw-r--r--plugins/WhenWasIt/WhenWasIt/birthdays.h70
-rw-r--r--plugins/WhenWasIt/WhenWasIt/commonheaders.h121
-rw-r--r--plugins/WhenWasIt/WhenWasIt/date_utils.cpp282
-rw-r--r--plugins/WhenWasIt/WhenWasIt/date_utils.h52
-rw-r--r--plugins/WhenWasIt/WhenWasIt/dlg_handlers.cpp1297
-rw-r--r--plugins/WhenWasIt/WhenWasIt/dlg_handlers.h47
-rw-r--r--plugins/WhenWasIt/WhenWasIt/events.cpp37
-rw-r--r--plugins/WhenWasIt/WhenWasIt/events.h33
-rw-r--r--plugins/WhenWasIt/WhenWasIt/hooked_events.cpp419
-rw-r--r--plugins/WhenWasIt/WhenWasIt/hooked_events.h50
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons.cpp223
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons.h53
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/00.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/add.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/check.bmpbin0 -> 726 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/check.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/dlg.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/dtb0.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/dtb1.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/dtb2.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/dtb3.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/dtb4.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/dtb5.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/dtb6.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/dtb7.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/dtb8.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/dtb9.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/dtbX.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/export.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/import.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/list.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/icons/refresh.icobin0 -> 2038 bytes
-rw-r--r--plugins/WhenWasIt/WhenWasIt/notifiers.cpp342
-rw-r--r--plugins/WhenWasIt/WhenWasIt/notifiers.h65
-rw-r--r--plugins/WhenWasIt/WhenWasIt/resource.h81
-rw-r--r--plugins/WhenWasIt/WhenWasIt/sdk/m_extraicons.h182
-rw-r--r--plugins/WhenWasIt/WhenWasIt/sdk/m_metacontacts.h162
-rw-r--r--plugins/WhenWasIt/WhenWasIt/sdk/m_popup.h424
-rw-r--r--plugins/WhenWasIt/WhenWasIt/sdk/m_toptoolbar.h125
-rw-r--r--plugins/WhenWasIt/WhenWasIt/sdk/m_updater.h146
-rw-r--r--plugins/WhenWasIt/WhenWasIt/services.cpp423
-rw-r--r--plugins/WhenWasIt/WhenWasIt/services.h64
-rw-r--r--plugins/WhenWasIt/WhenWasIt/utils.cpp392
-rw-r--r--plugins/WhenWasIt/WhenWasIt/utils.h55
-rw-r--r--plugins/WhenWasIt/WhenWasIt/version.h53
-rw-r--r--plugins/WhenWasIt/WhenWasIt/version.rc100
-rw-r--r--plugins/WhenWasIt/docs/WhenWasIt_readme.txt326
-rw-r--r--plugins/WhenWasIt/files_release.txt1
-rw-r--r--plugins/WhenWasIt/files_releasew.txt1
-rw-r--r--plugins/WhenWasIt/files_releasewx64.txt1
-rw-r--r--plugins/WhenWasIt/files_source.txt5
-rw-r--r--plugins/WhenWasIt/pack source.bat8
-rw-r--r--plugins/WhenWasIt/pack symbols.bat9
-rw-r--r--plugins/WhenWasIt/pack unicode x64.bat11
-rw-r--r--plugins/WhenWasIt/pack unicode.bat11
-rw-r--r--plugins/WhenWasIt/pack.bat10
-rw-r--r--plugins/WhenWasIt/symbols_exclude.txt1
67 files changed, 9105 insertions, 0 deletions
diff --git a/plugins/WhenWasIt/WhenWasIt.html b/plugins/WhenWasIt/WhenWasIt.html
new file mode 100644
index 0000000000..3d5ac8852c
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt.html
@@ -0,0 +1,12 @@
+<html>
+ <head></head>
+ <body>
+ <center>
+ <h1>WhenWasIt Test Page</h1>
+
+ <p>WhenWasIt version 0.3.3.4</p>
+ <p><a href="WhenWasIt.zip">WhenWasIt.zip</a></p>
+ <p><a href="WhenWasIt unicode.zip">WhenWasIt unicode.zip</a></p>
+ </center>
+ </body>
+</html>
diff --git a/plugins/WhenWasIt/WhenWasIt.sln b/plugins/WhenWasIt/WhenWasIt.sln
new file mode 100644
index 0000000000..cfb4d2a255
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt.sln
@@ -0,0 +1,35 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WhenWasIt", "WhenWasIt\WhenWasIt.vcproj", "{63E05ECA-0A63-479E-86BD-2CAF53869BDA}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug Unicode|Win32 = Debug Unicode|Win32
+ Debug Unicode|x64 = Debug Unicode|x64
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release Unicode|Win32 = Release Unicode|Win32
+ Release Unicode|x64 = Release Unicode|x64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {63E05ECA-0A63-479E-86BD-2CAF53869BDA}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32
+ {63E05ECA-0A63-479E-86BD-2CAF53869BDA}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32
+ {63E05ECA-0A63-479E-86BD-2CAF53869BDA}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64
+ {63E05ECA-0A63-479E-86BD-2CAF53869BDA}.Debug Unicode|x64.Build.0 = Debug Unicode|x64
+ {63E05ECA-0A63-479E-86BD-2CAF53869BDA}.Debug|Win32.ActiveCfg = Debug|x64
+ {63E05ECA-0A63-479E-86BD-2CAF53869BDA}.Debug|x64.ActiveCfg = Debug|x64
+ {63E05ECA-0A63-479E-86BD-2CAF53869BDA}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32
+ {63E05ECA-0A63-479E-86BD-2CAF53869BDA}.Release Unicode|Win32.Build.0 = Release Unicode|Win32
+ {63E05ECA-0A63-479E-86BD-2CAF53869BDA}.Release Unicode|x64.ActiveCfg = Release Unicode|x64
+ {63E05ECA-0A63-479E-86BD-2CAF53869BDA}.Release Unicode|x64.Build.0 = Release Unicode|x64
+ {63E05ECA-0A63-479E-86BD-2CAF53869BDA}.Release|Win32.ActiveCfg = Release|Win32
+ {63E05ECA-0A63-479E-86BD-2CAF53869BDA}.Release|Win32.Build.0 = Release|Win32
+ {63E05ECA-0A63-479E-86BD-2CAF53869BDA}.Release|x64.ActiveCfg = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/plugins/WhenWasIt/WhenWasIt/WhenWasIt.cpp b/plugins/WhenWasIt/WhenWasIt/WhenWasIt.cpp
new file mode 100644
index 0000000000..3c956d7e56
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/WhenWasIt.cpp
@@ -0,0 +1,145 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "commonheaders.h"
+
+char ModuleName[] = "WhenWasIt";
+HINSTANCE hInstance;
+HWND hBirthdaysDlg = NULL;
+HWND hUpcomingDlg = NULL;
+extern HANDLE hAddBirthdayWndsList = NULL;
+struct MM_INTERFACE mmi;
+int hLangpack;
+
+CommonData commonData = {0};
+
+PLUGINLINK *pluginLink;
+
+PLUGININFOEX pluginInfo = {
+ sizeof(PLUGININFOEX),
+ __PLUGIN_DISPLAY_NAME,
+ VERSION,
+ __DESC,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE,
+ 0,
+#ifdef _UNICODE
+ {0x2ff96c84, 0xb0b5, 0x470e, {0xbb, 0xf9, 0x90, 0x7b, 0x9f, 0x3f, 0x5d, 0x2f}} //{2ff96c84-b0b5-470e-bbf9-907b9f3f5d2f}
+#else
+ {0x2f369a01, 0x211a, 0x4f13, {0xbe, 0x3c, 0xbf, 0x4f, 0x8c, 0x62, 0xca, 0xce}} //{2f369a01-211a-4f13-be3c-bf4f8c62cace}
+#endif
+}; //not used
+
+OLD_MIRANDAPLUGININFO_SUPPORT;
+
+extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
+{
+// Log("%s", "Entering function " __FUNCTION__);
+// Log("%s", "Leaving function " __FUNCTION__);
+ return &pluginInfo;
+}
+
+static const MUUID interfaces[] = {MIID_BIRTHDAYNOTIFY, MIID_LAST};
+
+extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces()
+{
+ return interfaces;
+}
+
+#include <commctrl.h>
+
+extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+{
+ Log("%s", "Entering function " __FUNCTION__);
+ pluginLink = link;
+ mir_getMMI(&mmi);
+ mir_getLP(&pluginInfo);
+
+ INITCOMMONCONTROLSEX icex;
+
+ icex.dwSize = sizeof(icex);
+ icex.dwICC = ICC_DATE_CLASSES;
+
+ InitCommonControlsEx(&icex);
+
+ Log("%s", "Initialising miranda memory functions");
+
+ LoadIcons();
+ //hBirthdaysDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_BIRTHDAYS), NULL, DlgProcBirthdays);
+ Log("%s", "Creating service functions ...");
+ InitServices();
+
+ //Log("%s", "Creating events ...");
+ //CreateEvents();
+
+ Log("%s", "Hooking events ...");
+ HookEvents();
+
+ hAddBirthdayWndsList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+
+ Log("%s", "Leaving function " __FUNCTION__);
+
+ return 0;
+}
+
+extern "C" int __declspec(dllexport) Unload()
+{
+ Log("%s", "Entering function " __FUNCTION__);
+
+ if (hBirthdaysDlg)
+ {
+ SendMessage(hBirthdaysDlg, WM_CLOSE, 0, 0);
+ }
+
+ if (hUpcomingDlg)
+ {
+ SendMessage(hUpcomingDlg, WM_CLOSE, 0, 0);
+ }
+
+ WindowList_Broadcast(hAddBirthdayWndsList, WM_CLOSE, 0, 0);
+
+ Log("%s", "Killing timers ...");
+ KillTimers();
+
+ Log("%s", "Unhooking events ...");
+ UnhookEvents();
+
+ Log("%s", "Destroying service functions ...");
+ DestroyServices();
+
+
+ Log("%s", "Leaving function " __FUNCTION__);
+
+ return 0;
+}
+
+bool WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+{
+ hInstance = hinstDLL;
+ if (fdwReason == DLL_PROCESS_ATTACH)
+ {
+ DisableThreadLibraryCalls(hinstDLL);
+ }
+
+ return TRUE;
+}
diff --git a/plugins/WhenWasIt/WhenWasIt/WhenWasIt.rc b/plugins/WhenWasIt/WhenWasIt/WhenWasIt.rc
new file mode 100644
index 0000000000..afe6a7cb4a
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/WhenWasIt.rc
@@ -0,0 +1,282 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_OPT_WWI DIALOGEX 0, 0, 275, 240
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "`"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ GROUPBOX "Notify of birthdays using:",IDC_STATIC,4,3,267,161
+ GROUPBOX " ",IDC_POPUPS_STATIC,12,36,255,72
+ CONTROL "Popups",IDC_USE_POPUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,36,36,8
+ LTEXT "Popup timeout:",IDC_STATIC,18,47,93,8
+ EDITTEXT IDC_POPUP_TIMEOUT,112,43,34,14,ES_AUTOHSCROLL
+ PUSHBUTTON "Preview",IDC_PREVIEW,179,43,32,14
+ CONTROL "Custom1",IDC_BACKGROUND,"ColourPicker",WS_TABSTOP,241,43,23,14
+ CONTROL "Custom1",IDC_FOREGROUND,"ColourPicker",WS_TABSTOP,215,43,23,14
+ CONTROL "Don't show popups for subcontacts",IDC_IGNORE_SUBCONTACTS,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,59,245,10
+ CONTROL "Show popup when no birthdays are near",IDC_NOBIRTHDAYS_POPUP,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,71,246,10
+ GROUPBOX "Popup mouse click",IDC_STATIC,15,80,248,25
+ LTEXT "Left",IDC_STATIC,18,92,42,8
+ COMBOBOX IDC_LEFT_CLICK,61,90,69,43,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Right",IDC_STATIC,145,92,43,8
+ COMBOBOX IDC_RIGHT_CLICK,191,89,69,46,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ GROUPBOX " ",IDC_CLIST_STATIC,12,109,255,29
+ CONTROL "Contact list icon",IDC_USE_CLISTICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,109,64,8
+ LTEXT "Use slot",IDC_STATIC,18,123,45,8
+ COMBOBOX IDC_ADVANCED_ICON,64,120,107,79,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "to draw icon.",IDC_STATIC,178,123,86,8
+ GROUPBOX "Sounds",IDC_STATIC,12,138,255,24
+ LTEXT "Play sounds when there are",IDC_STATIC,18,148,92,8
+ EDITTEXT IDC_SOUND_NEAR_DAYS_EDIT,111,145,19,14,ES_AUTOHSCROLL
+ LTEXT "days or less to birthday.",IDC_STATIC,136,148,128,8
+ LTEXT "Start notifying ",IDC_STATIC,12,167,52,8
+ EDITTEXT IDC_DAYS_IN_ADVANCE,65,165,15,14,ES_AUTOHSCROLL
+ LTEXT "days in advance and",IDC_STATIC,83,167,91,8
+ LTEXT "Check every",IDC_STATIC,12,183,52,8
+ EDITTEXT IDC_CHECK_INTERVAL,65,180,15,14,ES_AUTOHSCROLL
+ LTEXT "hours.",IDC_STATIC,83,183,74,8
+ CONTROL "Only notify once per day.",IDC_ONCE_PER_DAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,182,112,10
+ LTEXT "By default use",IDC_STATIC,12,198,47,8
+ COMBOBOX IDC_DEFAULT_MODULE,61,196,81,48,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "to save birthday data.",IDC_STATIC,145,198,126,8
+ LTEXT "Show",IDC_STATIC,12,212,47,8
+ COMBOBOX IDC_AGE_COMBOBOX,61,210,81,48,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "in birthday list window",IDC_STATIC,146,212,125,8
+ GROUPBOX " ",IDC_DIALOG_STATIC,12,11,255,24
+ CONTROL "Dialog",IDC_USE_DIALOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,11,32,8
+ LTEXT "Timeout:",IDC_STATIC,18,21,56,8
+ EDITTEXT IDC_DLG_TIMEOUT,77,18,16,14,ES_AUTOHSCROLL
+ LTEXT "seconds.",IDC_STATIC,97,21,58,8
+ LTEXT "Notify for",IDC_STATIC,12,227,86,8
+ COMBOBOX IDC_NOTIFYFOR,97,225,174,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ EDITTEXT IDC_DAYS_AFTER,173,165,15,14,ES_AUTOHSCROLL
+ LTEXT "afterwards",IDC_STATIC,191,167,80,8
+ CONTROL "In background",IDC_OPENINBACKGROUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,157,20,106,10
+END
+
+IDD_BIRTHDAYS DIALOGEX 0, 0, 374, 241
+STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
+CAPTION "Birthday list"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "Close",IDC_CLOSE,320,223,50,14
+ CONTROL "",IDC_BIRTHDAYS_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,3,4,367,214
+ CONTROL "Show all contacts",IDC_SHOW_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,226,178,10
+END
+
+IDD_ADD_BIRTHDAY DIALOGEX 0, 0, 150, 44
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Set birthday:"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,96,26,50,14
+ CONTROL "",IDC_DATE,"SysDateTimePick32",DTS_RIGHTALIGN | DTS_SHOWNONE | DTS_LONGDATEFORMAT | WS_TABSTOP,4,7,142,15
+ COMBOBOX IDC_COMPATIBILITY,4,27,86,46,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+END
+
+IDD_ADD_ANNIVERSARY DIALOGEX 0, 0, 243, 73
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Manage anniversaries"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ LTEXT "Title:",IDC_STATIC,6,6,47,8
+ COMBOBOX IDC_TITLE,59,4,178,72,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Description:",IDC_STATIC,6,22,46,8
+ EDITTEXT IDC_DESCRIPTION,59,19,178,14,ES_AUTOHSCROLL
+ LTEXT "Date:",IDC_STATIC,6,40,50,8
+ CONTROL "",IDC_ANNIVERSARY,"SysDateTimePick32",DTS_RIGHTALIGN | DTS_LONGDATEFORMAT | WS_TABSTOP,59,36,178,15
+ PUSHBUTTON "Save",IDC_SAVE,187,55,50,14
+ PUSHBUTTON "Delete",IDC_DELETE,135,55,50,14
+END
+
+IDD_UPCOMING DIALOGEX 0, 0, 231, 144
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Upcoming birthdays"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "Close",IDC_CLOSE,49,126,132,14
+ CONTROL "",IDC_UPCOMING_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,4,4,223,119
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_OPT_WWI, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 271
+ VERTGUIDE, 12
+ VERTGUIDE, 18
+ VERTGUIDE, 271
+ TOPMARGIN, 3
+ BOTTOMMARGIN, 237
+ HORZGUIDE, 220
+ HORZGUIDE, 222
+ HORZGUIDE, 235
+ END
+
+ IDD_BIRTHDAYS, DIALOG
+ BEGIN
+ LEFTMARGIN, 3
+ RIGHTMARGIN, 370
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 237
+ HORZGUIDE, 236
+ END
+
+ IDD_ADD_BIRTHDAY, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 146
+ TOPMARGIN, 3
+ BOTTOMMARGIN, 40
+ HORZGUIDE, 7
+ HORZGUIDE, 39
+ END
+
+ IDD_ADD_ANNIVERSARY, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 239
+ VERTGUIDE, 6
+ VERTGUIDE, 237
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 69
+ END
+
+ IDD_UPCOMING, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 227
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 140
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_BIRTHDAYS_DLG ICON "icons\\dlg.ico"
+IDI_CHECK ICON "icons\\check.ico"
+IDI_LIST ICON "icons\\list.ico"
+IDI_DTB1 ICON "icons\\dtb1.ico"
+IDI_DTB9 ICON "icons\\dtb9.ico"
+IDI_DTB2 ICON "icons\\dtb2.ico"
+IDI_DTB3 ICON "icons\\dtb3.ico"
+IDI_DTB4 ICON "icons\\dtb4.ico"
+IDI_DTB5 ICON "icons\\dtb5.ico"
+IDI_DTB6 ICON "icons\\dtb6.ico"
+IDI_DTB7 ICON "icons\\dtb7.ico"
+IDI_DTB8 ICON "icons\\dtb8.ico"
+IDI_DTB0 ICON "icons\\dtb0.ico"
+IDI_DTBMORE ICON "icons\\dtbX.ico"
+IDI_ADD ICON "icons\\add.ico"
+IDI_REFRESH_USERDETAILS ICON "icons\\refresh.ico"
+IDI_IMPORT_BIRTHDAYS ICON "icons\\import.ico"
+IDI_EXPORT_BIRTHDAYS ICON "icons\\export.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDB_TTB_CHECK BITMAP "icons\\check.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog Info
+//
+
+IDD_ADD_BIRTHDAY DLGINIT
+BEGIN
+ IDC_COMPATIBILITY, 0x403, 16, 0
+0x7250, 0x746f, 0x636f, 0x6c6f, 0x6d20, 0x646f, 0x6c75, 0x0065,
+ IDC_COMPATIBILITY, 0x403, 19, 0
+0x7355, 0x7265, 0x6544, 0x6174, 0x6c69, 0x2073, 0x6f6d, 0x7564, 0x656c,
+"\000"
+ IDC_COMPATIBILITY, 0x403, 17, 0
+0x426d, 0x7269, 0x6874, 0x6164, 0x2079, 0x6f6d, 0x7564, 0x656c, "\000"
+ 0
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/plugins/WhenWasIt/WhenWasIt/WhenWasIt.vcproj b/plugins/WhenWasIt/WhenWasIt/WhenWasIt.vcproj
new file mode 100644
index 0000000000..4cae1b08b7
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/WhenWasIt.vcproj
@@ -0,0 +1,872 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="WhenWasIt"
+ ProjectGUID="{63E05ECA-0A63-479E-86BD-2CAF53869BDA}"
+ RootNamespace="WhenWasIt"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include/"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ BaseAddress="0x2F400000"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include/"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN64;_DEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ BaseAddress="0x2F400000"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ FavorSizeOrSpeed="2"
+ AdditionalIncludeDirectories="../../../include/"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ BaseAddress="0x2F400000"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/x64/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/x64/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ FavorSizeOrSpeed="2"
+ AdditionalIncludeDirectories="../../../include/"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN64;NDEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ BaseAddress="0x2F400000"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Unicode|Win32"
+ OutputDirectory="..\..\..\..\cvs\test miranda\plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include/"
+ PreprocessorDefinitions="_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ BaseAddress="0x2F400000"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Unicode|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include/"
+ PreprocessorDefinitions="_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_DEPRECATE;WIN64;_DEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ BaseAddress="0x2F400000"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Unicode|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ FavorSizeOrSpeed="2"
+ AdditionalIncludeDirectories="../../../include/"
+ PreprocessorDefinitions="_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ OutputFile="$(OutDir)\$(ProjectName).dll"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ BaseAddress="0x2F400000"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Unicode|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/x64/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/x64/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ FavorSizeOrSpeed="2"
+ AdditionalIncludeDirectories="../../../include/"
+ PreprocessorDefinitions="_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_DEPRECATE;WIN64;NDEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ OutputFile="$(OutDir)\$(ProjectName).dll"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ BaseAddress="0x2F400000"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\birthdays.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\date_utils.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\dlg_handlers.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\events.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\hooked_events.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\icons.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\notifiers.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\services.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\utils.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\WhenWasIt.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\birthdays.h"
+ >
+ </File>
+ <File
+ RelativePath=".\commonheaders.h"
+ >
+ </File>
+ <File
+ RelativePath=".\date_utils.h"
+ >
+ </File>
+ <File
+ RelativePath=".\dlg_handlers.h"
+ >
+ </File>
+ <File
+ RelativePath=".\events.h"
+ >
+ </File>
+ <File
+ RelativePath=".\hooked_events.h"
+ >
+ </File>
+ <File
+ RelativePath=".\icons.h"
+ >
+ </File>
+ <File
+ RelativePath=".\notifiers.h"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.h"
+ >
+ </File>
+ <File
+ RelativePath=".\services.h"
+ >
+ </File>
+ <File
+ RelativePath=".\utils.h"
+ >
+ </File>
+ <File
+ RelativePath=".\version.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath=".\icons\add.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\birthday.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\check.bmp"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\check.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dlg.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb0.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb1.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb2.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb3.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb4.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb5.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb6.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb7.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb8.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb9.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtbX.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\export.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\import.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\list.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\refresh.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\version.rc"
+ >
+ </File>
+ <File
+ RelativePath=".\WhenWasIt.rc"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\docs\WhenWasIt_readme.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/plugins/WhenWasIt/WhenWasIt/WhenWasIt_10.vcxproj b/plugins/WhenWasIt/WhenWasIt/WhenWasIt_10.vcxproj
new file mode 100644
index 0000000000..8b6b52d2f9
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/WhenWasIt_10.vcxproj
@@ -0,0 +1,327 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug Unicode|Win32">
+ <Configuration>Debug Unicode</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug Unicode|x64">
+ <Configuration>Debug Unicode</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release Unicode|Win32">
+ <Configuration>Release Unicode</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release Unicode|x64">
+ <Configuration>Release Unicode</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>WhenWasIt</ProjectName>
+ <ProjectGuid>{63E05ECA-0A63-479E-86BD-2CAF53869BDA}</ProjectGuid>
+ <RootNamespace>WhenWasIt</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>NotSet</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</IgnoreImportLibrary>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</IgnoreImportLibrary>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">$(SolutionDir)$(Configuration)/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">true</IgnoreImportLibrary>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">$(SolutionDir)$(Configuration)/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">true</IgnoreImportLibrary>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">$(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">$(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">$(SolutionDir)$(Configuration)64/Plugins\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64/Plugins\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">$(SolutionDir)$(Configuration)64/Plugins\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64/Plugins\</OutDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>_USE_32BIT_TIME_T;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <AdditionalIncludeDirectories>../../../include/</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <BaseAddress>0x2F400000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PreprocessorDefinitions>_USE_32BIT_TIME_T;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <AdditionalIncludeDirectories>../../../include/</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <BaseAddress>0x2F400000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>_CRT_NON_CONFORMING_SWPRINTFS;_USE_32BIT_TIME_T;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <AdditionalIncludeDirectories>../../../include/</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <BaseAddress>0x2F400000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>_CRT_NON_CONFORMING_SWPRINTFS;_USE_32BIT_TIME_T;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <AdditionalIncludeDirectories>../../../include/</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <BaseAddress>0x2F400000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../../include/</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../../include/</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../../include/</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../../include/</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="birthdays.cpp" />
+ <ClCompile Include="date_utils.cpp" />
+ <ClCompile Include="dlg_handlers.cpp" />
+ <ClCompile Include="events.cpp" />
+ <ClCompile Include="hooked_events.cpp" />
+ <ClCompile Include="icons.cpp" />
+ <ClCompile Include="notifiers.cpp" />
+ <ClCompile Include="services.cpp" />
+ <ClCompile Include="utils.cpp" />
+ <ClCompile Include="WhenWasIt.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="birthdays.h" />
+ <ClInclude Include="commonheaders.h" />
+ <ClInclude Include="date_utils.h" />
+ <ClInclude Include="dlg_handlers.h" />
+ <ClInclude Include="events.h" />
+ <ClInclude Include="hooked_events.h" />
+ <ClInclude Include="icons.h" />
+ <ClInclude Include="notifiers.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="services.h" />
+ <ClInclude Include="utils.h" />
+ <ClInclude Include="version.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="icons\add.ico" />
+ <None Include="icons\birthday.ico" />
+ <None Include="icons\check.bmp" />
+ <None Include="icons\check.ico" />
+ <None Include="icons\dlg.ico" />
+ <None Include="icons\dtb0.ico" />
+ <None Include="icons\dtb1.ico" />
+ <None Include="icons\dtb2.ico" />
+ <None Include="icons\dtb3.ico" />
+ <None Include="icons\dtb4.ico" />
+ <None Include="icons\dtb5.ico" />
+ <None Include="icons\dtb6.ico" />
+ <None Include="icons\dtb7.ico" />
+ <None Include="icons\dtb8.ico" />
+ <None Include="icons\dtb9.ico" />
+ <None Include="icons\dtbX.ico" />
+ <None Include="icons\export.ico" />
+ <None Include="icons\import.ico" />
+ <None Include="icons\list.ico" />
+ <None Include="icons\refresh.ico" />
+ <None Include="..\docs\WhenWasIt_readme.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="version.rc" />
+ <ResourceCompile Include="WhenWasIt.rc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/WhenWasIt_10.vcxproj.filters b/plugins/WhenWasIt/WhenWasIt/WhenWasIt_10.vcxproj.filters
new file mode 100644
index 0000000000..882e249432
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/WhenWasIt_10.vcxproj.filters
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="birthdays.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="date_utils.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dlg_handlers.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="events.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="hooked_events.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="icons.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="notifiers.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="services.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="utils.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="WhenWasIt.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="birthdays.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="commonheaders.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="date_utils.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="dlg_handlers.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="events.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hooked_events.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="icons.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="notifiers.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="services.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="utils.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="version.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="icons\add.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\birthday.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\check.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\check.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\dlg.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\dtb0.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\dtb1.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\dtb2.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\dtb3.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\dtb4.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\dtb5.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\dtb6.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\dtb7.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\dtb8.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\dtb9.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\dtbX.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\export.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\import.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\list.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="icons\refresh.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\docs\WhenWasIt_readme.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="version.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ <ResourceCompile Include="WhenWasIt.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/WhenWasIt_8.vcproj b/plugins/WhenWasIt/WhenWasIt/WhenWasIt_8.vcproj
new file mode 100644
index 0000000000..333afcd918
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/WhenWasIt_8.vcproj
@@ -0,0 +1,546 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="WhenWasIt"
+ ProjectGUID="{63E05ECA-0A63-479E-86BD-2CAF53869BDA}"
+ RootNamespace="WhenWasIt"
+ Keyword="Win32Proj"
+ SccProjectName=""
+ SccLocalPath=""
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="..\..\..\..\cvs\test miranda\Plugins"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="_USE_32BIT_TIME_T;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ BaseAddress="0x2F400000"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="0"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ FavorSizeOrSpeed="2"
+ PreprocessorDefinitions="_USE_32BIT_TIME_T;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ BaseAddress="0x2F400000"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Unicode|Win32"
+ OutputDirectory="..\..\..\..\cvs\test miranda\Plugins"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="_CRT_NON_CONFORMING_SWPRINTFS;_USE_32BIT_TIME_T;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ BaseAddress="0x2F400000"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Unicode|Win32"
+ OutputDirectory="$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ FavorSizeOrSpeed="2"
+ PreprocessorDefinitions="_CRT_NON_CONFORMING_SWPRINTFS;_USE_32BIT_TIME_T;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ OutputFile="$(OutDir)\$(ProjectName).dll"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ BaseAddress="0x2F400000"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\birthdays.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\date_utils.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\dlg_handlers.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\events.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\hooked_events.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\icons.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\mirandaMem.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\notifiers.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\services.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\utils.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\WhenWasIt.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\birthdays.h"
+ >
+ </File>
+ <File
+ RelativePath=".\commonheaders.h"
+ >
+ </File>
+ <File
+ RelativePath=".\date_utils.h"
+ >
+ </File>
+ <File
+ RelativePath=".\dlg_handlers.h"
+ >
+ </File>
+ <File
+ RelativePath=".\events.h"
+ >
+ </File>
+ <File
+ RelativePath=".\hooked_events.h"
+ >
+ </File>
+ <File
+ RelativePath=".\icons.h"
+ >
+ </File>
+ <File
+ RelativePath=".\mirandaMem.h"
+ >
+ </File>
+ <File
+ RelativePath=".\notifiers.h"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.h"
+ >
+ </File>
+ <File
+ RelativePath=".\services.h"
+ >
+ </File>
+ <File
+ RelativePath=".\utils.h"
+ >
+ </File>
+ <File
+ RelativePath=".\version.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath=".\icons\add.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\birthday.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\check.bmp"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\check.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dlg.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb0.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb1.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb2.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb3.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb4.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb5.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb6.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb7.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb8.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb9.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtbX.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\export.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\import.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\list.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\refresh.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\version.rc"
+ >
+ </File>
+ <File
+ RelativePath=".\WhenWasIt.rc"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\docs\WhenWasIt_readme.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/plugins/WhenWasIt/WhenWasIt/WhenWasIt_9.vcproj b/plugins/WhenWasIt/WhenWasIt/WhenWasIt_9.vcproj
new file mode 100644
index 0000000000..0f09f35b29
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/WhenWasIt_9.vcproj
@@ -0,0 +1,877 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="WhenWasIt"
+ ProjectGUID="{63E05ECA-0A63-479E-86BD-2CAF53869BDA}"
+ RootNamespace="WhenWasIt"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include"
+ PreprocessorDefinitions="_USE_32BIT_TIME_T;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="comctl32.lib"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ BaseAddress="0x2F400000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)64/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)64/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include"
+ PreprocessorDefinitions="_USE_32BIT_TIME_T;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="comctl32.lib"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ BaseAddress="0x2F400000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ CharacterSet="0"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ InlineFunctionExpansion="1"
+ FavorSizeOrSpeed="2"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="../../../include"
+ PreprocessorDefinitions="_USE_32BIT_TIME_T;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="comctl32.lib"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="0"
+ LinkTimeCodeGeneration="1"
+ BaseAddress="0x2F400000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)64/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)64/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ CharacterSet="0"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ InlineFunctionExpansion="1"
+ FavorSizeOrSpeed="2"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="../../../include"
+ PreprocessorDefinitions="_USE_32BIT_TIME_T;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="comctl32.lib"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="0"
+ LinkTimeCodeGeneration="1"
+ BaseAddress="0x2F400000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Unicode|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include"
+ PreprocessorDefinitions="_CRT_NON_CONFORMING_SWPRINTFS;_USE_32BIT_TIME_T;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="comctl32.lib"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ BaseAddress="0x2F400000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Unicode|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)64/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)64/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include"
+ PreprocessorDefinitions="_CRT_NON_CONFORMING_SWPRINTFS;_USE_32BIT_TIME_T;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="comctl32.lib"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ BaseAddress="0x2F400000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Unicode|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ InlineFunctionExpansion="1"
+ FavorSizeOrSpeed="2"
+ AdditionalIncludeDirectories="../../../include"
+ PreprocessorDefinitions="_CRT_NON_CONFORMING_SWPRINTFS;_USE_32BIT_TIME_T;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="comctl32.lib"
+ OutputFile="$(OutDir)\$(ProjectName).dll"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ BaseAddress="0x2F400000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Unicode|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)64/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)64/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ InlineFunctionExpansion="1"
+ FavorSizeOrSpeed="2"
+ AdditionalIncludeDirectories="../../../include"
+ PreprocessorDefinitions="_CRT_NON_CONFORMING_SWPRINTFS;_USE_32BIT_TIME_T;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;WHENWASIT_EXPORTS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="comctl32.lib"
+ OutputFile="$(OutDir)\$(ProjectName).dll"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ BaseAddress="0x2F400000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\birthdays.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\date_utils.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\dlg_handlers.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\events.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\hooked_events.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\icons.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\notifiers.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\services.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\utils.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\WhenWasIt.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\birthdays.h"
+ >
+ </File>
+ <File
+ RelativePath=".\commonheaders.h"
+ >
+ </File>
+ <File
+ RelativePath=".\date_utils.h"
+ >
+ </File>
+ <File
+ RelativePath=".\dlg_handlers.h"
+ >
+ </File>
+ <File
+ RelativePath=".\events.h"
+ >
+ </File>
+ <File
+ RelativePath=".\hooked_events.h"
+ >
+ </File>
+ <File
+ RelativePath=".\icons.h"
+ >
+ </File>
+ <File
+ RelativePath=".\notifiers.h"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.h"
+ >
+ </File>
+ <File
+ RelativePath=".\services.h"
+ >
+ </File>
+ <File
+ RelativePath=".\utils.h"
+ >
+ </File>
+ <File
+ RelativePath=".\version.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath=".\icons\add.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\birthday.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\check.bmp"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\check.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dlg.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb0.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb1.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb2.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb3.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb4.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb5.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb6.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb7.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb8.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtb9.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\dtbX.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\export.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\import.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\list.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\refresh.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\version.rc"
+ >
+ </File>
+ <File
+ RelativePath=".\WhenWasIt.rc"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\docs\WhenWasIt_readme.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/plugins/WhenWasIt/WhenWasIt/birthdays.cpp b/plugins/WhenWasIt/WhenWasIt/birthdays.cpp
new file mode 100644
index 0000000000..357936a866
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/birthdays.cpp
@@ -0,0 +1,169 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "birthdays.h"
+
+CBirthdays &birthdays = CBirthdays();
+
+CBirthdays::CBirthdays(int initialSize)
+{
+ int count = 0;
+ int size = 0;
+ birthdays = NULL;
+ advancedIcon = CLIST_ICON;
+
+ Realloc(initialSize);
+}
+
+CBirthdays::~CBirthdays()
+{
+ Destroy();
+}
+
+void CBirthdays::Destroy()
+{
+ if (birthdays)
+ {
+ Clear();
+ free(birthdays);
+ birthdays = NULL;
+ }
+}
+
+void CBirthdays::Clear()
+{
+ int i;
+ for (i = 0; i < Count(); i++)
+ {
+ ClearItem(i);
+ }
+ count = 0;
+}
+
+void CBirthdays::ClearItem(int index)
+{
+ free(birthdays[index]);
+ birthdays[index] = NULL;
+}
+
+int CBirthdays::Count() const
+{
+ return count;
+}
+
+int CBirthdays::Size() const
+{
+ return size;
+}
+
+void CBirthdays::EnsureCapacity()
+{
+ if (count >= size)
+ {
+ Realloc(size / 2);
+ }
+}
+
+void CBirthdays::Realloc(int increaseCapacity)
+{
+ size += increaseCapacity;
+ birthdays = (PBirthdayContact *) realloc(birthdays, size * sizeof(PBirthdayContact));
+}
+
+int CBirthdays::Add(HANDLE hContact, HANDLE hClistIcon)
+{
+ if (!Contains(hContact))
+ {
+ EnsureCapacity();
+ TBirthdayContact *item = (TBirthdayContact *) malloc(sizeof(TBirthdayContact));
+ item->hContact = hContact;
+ item->hClistIcon = hClistIcon;
+ birthdays[count++] = item;
+ return 0;
+ }
+ return -1;
+}
+
+int CBirthdays::Remove(int index)
+{
+ if ((index >= 0) && (index < count))
+ {
+ int i;
+ for (i = index + 1; i < count; i++)
+ {
+ birthdays[i - 1] = birthdays[i];
+ }
+ ClearItem(count--);
+ return 0;
+ }
+ return -1;
+}
+
+int CBirthdays::Remove(HANDLE hContact)
+{
+ int index = Index(hContact);
+ return Remove(index);
+}
+
+int CBirthdays::Contains(HANDLE hContact) const
+{
+ int i;
+ for (i = 0; i < count; i++)
+ {
+ if (birthdays[i]->hContact == hContact)
+ {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+int CBirthdays::Index(HANDLE hContact) const
+{
+ int i;
+ for (i = 0; i < count; i++)
+ {
+ if (birthdays[i]->hContact == hContact)
+ {
+ return i;
+ }
+ }
+ return -1;
+}
+
+void CBirthdays::SetAdvancedIconIndex(int advIcon)
+{
+ advancedIcon = advIcon;
+}
+
+int CBirthdays::GetAdvancedIconIndex() const
+{
+ return advancedIcon;
+}
+
+HANDLE CBirthdays::GetClistIcon(HANDLE hContact) const
+{
+ int index = Index(hContact);
+ if ((index >= 0) && (index < count))
+ {
+ return birthdays[index]->hClistIcon;
+ }
+ return (HANDLE) -1;
+} \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/birthdays.h b/plugins/WhenWasIt/WhenWasIt/birthdays.h
new file mode 100644
index 0000000000..b20dd88554
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/birthdays.h
@@ -0,0 +1,70 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_WWI_BIRTHDAYS_H
+#define M_WWI_BIRTHDAYS_H
+
+#include "commonheaders.h"
+
+struct TBirthdayContact{
+ HANDLE hContact;
+ HANDLE hClistIcon;
+};
+
+typedef TBirthdayContact *PBirthdayContact;
+
+class CBirthdays
+{
+ protected:
+ int count;
+ int size;
+ PBirthdayContact *birthdays;
+ int advancedIcon;
+
+ void Realloc(int increaseCapacity);
+ void EnsureCapacity();
+
+ void ClearItem(int index);
+
+ public:
+ CBirthdays(int initialSize = 10);
+ ~CBirthdays();
+
+ int Add(HANDLE hContact, HANDLE hClistIcon);
+ int Remove(int index);
+ int Remove(HANDLE hContact);
+ void Clear();
+ void Destroy();
+
+ int Index(HANDLE hContact) const;
+ int Contains(HANDLE hContact) const;
+
+ void SetAdvancedIconIndex(int advIcon);
+ int GetAdvancedIconIndex() const;
+
+ HANDLE GetClistIcon(HANDLE hContact) const;
+
+ int Count() const;
+ int Size() const;
+};
+
+extern CBirthdays &birthdays;
+
+#endif //M_WWI_BIRTHDAYS_H
diff --git a/plugins/WhenWasIt/WhenWasIt/commonheaders.h b/plugins/WhenWasIt/WhenWasIt/commonheaders.h
new file mode 100644
index 0000000000..3526a6a80d
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/commonheaders.h
@@ -0,0 +1,121 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006-2011 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_WWI_COMMONHEADERS_H
+#define M_WWI_COMMONHEADERS_H
+
+#define MIRANDA_VER 0x0900
+#define MIRANDA_CUSTOM_LP
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <windows.h>
+#include <time.h>
+#include <math.h>
+
+#include "resource.h"
+#include "version.h"
+
+#include "utils.h"
+#include "date_utils.h"
+#include "services.h"
+//#include "events.h"
+#include "hooked_events.h"
+#include "icons.h"
+#include "notifiers.h"
+//#include "birthdays.h"
+#include "win2k.h"
+#include "newpluginapi.h"
+#include "m_database.h"
+#include "m_system.h"
+#include "m_skin.h"
+#include "m_options.h"
+#include "m_clist.h"
+#include "m_langpack.h"
+#include "m_history.h"
+#include "m_contacts.h"
+#include "m_popup.h"
+//#include "m_popupw.h"
+#include "m_fontservice.h"
+#include "m_utils.h"
+#include "m_icolib.h"
+#include "m_cluiframes.h"
+#include "m_clui.h"
+#include "m_protosvc.h"
+#include "m_hotkeys.h"
+#include "sdk/m_toptoolbar.h"
+#include "sdk/m_metacontacts.h"
+#include "m_message.h"
+#include "sdk/m_updater.h"
+#include "sdk/m_extraicons.h"
+
+extern char ModuleName[];
+extern HINSTANCE hInstance;
+extern HWND hBirthdaysDlg;
+extern HWND hUpcomingDlg;
+extern HANDLE hAddBirthdayWndsList;
+
+#define OLD_MIRANDAPLUGININFO_SUPPORT PLUGININFO oldPluginInfo = { \
+ sizeof(PLUGININFO), \
+ pluginInfo.shortName, \
+ pluginInfo.version, \
+ pluginInfo.description, \
+ pluginInfo.author, \
+ pluginInfo.authorEmail, \
+ pluginInfo.copyright, \
+ pluginInfo.homepage, \
+ pluginInfo.flags, \
+ pluginInfo.replacesDefaultModule \
+}; \
+\
+extern "C" __declspec(dllexport) PLUGININFO *MirandaPluginInfo(DWORD mirandaVersion) \
+{ \
+ return &oldPluginInfo; \
+}
+
+struct CommonData{
+ DWORD foreground;
+ DWORD background;
+ int checkInterval;
+ int daysInAdvance;
+ int popupTimeout;
+ int popupTimeoutToday;
+ int clistIcon;
+ int bUsePopups;
+ int bUseClistIcon;
+ int bUseDialog;
+ int bIgnoreSubcontacts;
+ int cShowAgeMode;
+ int bNoBirthdaysPopup;
+ int cSoundNearDays;
+ int cDefaultModule;
+ int lPopupClick;
+ int rPopupClick;
+ int bOncePerDay;
+ int cDlgTimeout;
+ int notifyFor;
+ int daysAfter;
+ int bOpenInBackground;
+};
+
+extern CommonData commonData;
+
+#endif //M_WWI_COMMONHEADERS_H \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/date_utils.cpp b/plugins/WhenWasIt/WhenWasIt/date_utils.cpp
new file mode 100644
index 0000000000..e4c8195890
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/date_utils.cpp
@@ -0,0 +1,282 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "date_utils.h"
+
+time_t Today()
+{
+ time_t now = time(NULL);
+ struct tm* date = localtime(&now);
+ date->tm_hour = date->tm_min = date->tm_sec = 0;
+ return mktime(date);
+}
+
+int IsDOBValid(int year, int month, int day)
+{
+ return ((year != 0) && (month != 0) && (day != 0));
+}
+
+int GetContactDOB(HANDLE hContact, int &year, int &month, int &day)
+{
+ int res = DOB_USERINFO;
+
+ //TCHAR *contact = GetContactName(hContact, NULL);
+ year = DBGetContactSettingWord(hContact, "UserInfo", "DOBy", 0);
+ month = DBGetContactSettingByte(hContact, "UserInfo", "DOBm", 0);
+ day = DBGetContactSettingByte(hContact, "UserInfo", "DOBd", 0);
+
+ if (!IsDOBValid(year, month, day))
+ {
+ res = DOB_MBIRTHDAY;
+ year = DBGetContactSettingWord(hContact, "mBirthday", "BirthYear", 0);
+ month = DBGetContactSettingByte(hContact, "mBirthday", "BirthMonth", 0);
+ day = DBGetContactSettingByte(hContact, "mBirthday", "BirthDay", 0);
+ }
+
+ if (!IsDOBValid(year, month, day))
+ {
+ res = DOB_PROTOCOL;
+ char protocol[512];
+ GetContactProtocol(hContact, protocol, sizeof(protocol));
+ year = DBGetContactSettingWord(hContact, protocol, "BirthYear", 0);
+ month = DBGetContactSettingByte(hContact, protocol, "BirthMonth", 0);
+ day = DBGetContactSettingByte(hContact, protocol, "BirthDay", 0);
+ }
+
+ if (!IsDOBValid(year, month, day))
+ {
+ res = DOB_BIRTHDAYREMINDER;
+ year = DBGetContactSettingWord(hContact, "BirthDay", "BirthYear", 0);
+ month = DBGetContactSettingByte(hContact, "BirthDay", "BirthMonth", 0);
+ day = DBGetContactSettingByte(hContact, "BirthDay", "BirthDay", 0);
+ }
+
+ if (!IsDOBValid(year, month, day))
+ {
+ res = DOB_MICQBIRTHDAY;
+ year = DBGetContactSettingDword(hContact, "micqBirthday", "BirthYear", 0);
+ month = DBGetContactSettingDword(hContact, "micqBirthday", "BirthMonth", 0);
+ day = DBGetContactSettingDword(hContact, "micqBirthday", "BirthDay", 0);
+ }
+
+ if (!IsDOBValid(year, month, day))
+ {
+ res = DOB_UNKNOWN;
+ }
+ //free(contact);
+ return res;
+}
+
+int GetContactAge(HANDLE hContact)
+{
+ int year, month, day;
+ time_t tNow;
+ time(&tNow);
+ struct tm *now = localtime(&tNow);
+ GetContactDOB(hContact, year, month, day);
+ return (now->tm_year + 1900) - year;
+}
+
+char GetContactGender(HANDLE hContact)
+{
+ char gender = DBGetContactSettingByte(hContact, "UserInfo", "Gender", 'U');
+ if (gender == 'U')
+ {
+ char protocol[512];
+ GetContactProtocol(hContact, protocol, sizeof(protocol));
+
+ gender = DBGetContactSettingByte(hContact, protocol, "Gender", 'U');
+ }
+ return gender;
+}
+
+int IsLeapYear(int year)
+{
+ int yes = ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0)));
+ return yes;
+}
+
+unsigned int GetDaysDifference(time_t time1, time_t time2)
+{
+ errno = 0;
+ double diff = difftime(time1, time2);
+ if (errno == 0)
+ {
+ diff = diff / (60 * 60 * 24);
+ int days = (int) floor(diff);
+ if (days < 0)
+ {
+ struct tm *date = gmtime(&time1);
+ int leap = 0;
+ if ((date->tm_mon > 2) && (IsLeapYear(date->tm_year))) //if month > feb and it's a leap year
+ {
+ leap = 1;
+ }
+ days = 365 + days + leap;
+ }
+ return days;
+ }
+ return 0x7fffffff;
+}
+
+int GetDaysDifferenceAfter(time_t time1, time_t time2)
+{
+ errno = 0;
+ double diff = difftime(time1, time2);
+ if (errno == 0)
+ {
+ diff = diff / (60 * 60 * 24);
+ int days = (int) floor(diff);
+ if (days > 0)
+ {
+ return -1;
+ }
+
+ return -days;
+ }
+
+ return -1;
+}
+
+unsigned int DaysToBirthday(time_t now, int ctYear, int ctMonth, int ctDay)
+{
+ if (IsDOBValid(ctYear, ctMonth, ctDay))
+ {
+ struct tm ct = {0};
+ struct tm *tmp = gmtime(&now);
+ ct.tm_year = tmp->tm_year;
+ ct.tm_mon = ctMonth - 1;
+ ct.tm_mday = ctDay;
+ time_t ctBirthday = mktime(&ct);
+ return GetDaysDifference(ctBirthday, now);
+ }
+ return -1;
+}
+
+int DaysAfterBirthday(time_t now, int ctYear, int ctMonth, int ctDay)
+{
+ if (IsDOBValid(ctYear, ctMonth, ctDay))
+ {
+ struct tm ct = {0};
+ struct tm *tmp = gmtime(&now);
+ ct.tm_year = tmp->tm_year;
+ ct.tm_mon = ctMonth - 1;
+ ct.tm_mday = ctDay;
+ time_t ctBirthday = mktime(&ct);
+
+ return GetDaysDifferenceAfter(ctBirthday, now);
+ }
+
+ return -1;
+}
+
+
+void FillProtocol(char *&sYear, char *&sMonth, char *&sDay)
+{
+ sYear = "BirthYear";
+ sMonth = "BirthMonth";
+ sDay = "BirthDay";
+}
+
+void FillmBirthday(char *&module, char *&sYear, char *&sMonth, char *&sDay)
+{
+ module = "mBirthday";
+ sYear = "BirthYear";
+ sMonth = "BirthMonth";
+ sDay = "BirthDay";
+}
+
+void FillStandard(char *&module, char *&sYear, char *&sMonth, char *&sDay)
+{
+ module = "UserInfo";
+ sYear = "DOBy";
+ sMonth = "DOBm";
+ sDay = "DOBd";
+}
+
+int SaveBirthday(HANDLE hContact, int year, int month, int day, int mode)
+{
+ char *sModule, *sdModule, *sd2Module; //s* = keep, sd* = delete, sd2* = delete
+ char *sYear, *sdYear, *sd2Year;
+ char *sMonth, *sdMonth, *sd2Month;
+ char *sDay, *sdDay, *sd2Day;
+ char protocol[256];
+ GetContactProtocol(hContact, protocol, sizeof(protocol));
+
+ switch (mode)
+ {
+ case SAVE_MODE_MBIRTHDAY:
+ {
+ FillmBirthday(sModule, sYear, sMonth, sDay);
+ FillStandard(sdModule, sdYear, sdMonth, sdDay);
+ sd2Module = protocol;
+ FillProtocol(sd2Year, sd2Month, sd2Day);
+
+ break;
+ }
+
+ case SAVE_MODE_PROTOCOL:
+ {
+ sModule = protocol;
+ FillProtocol(sYear, sMonth, sDay);
+
+ FillmBirthday(sd2Module, sd2Year, sd2Month, sd2Day);
+ FillStandard(sdModule, sdYear, sdMonth, sdDay);
+
+ break;
+ }
+
+ case SAVE_MODE_STANDARD:
+ default:
+ {
+ FillStandard(sModule, sYear, sMonth, sDay);
+ FillmBirthday(sdModule, sdYear, sdMonth, sdDay);
+ sd2Module = protocol;
+ FillProtocol(sd2Year, sd2Month, sd2Day);
+ break;
+ }
+ }
+
+ if (mode == SAVE_MODE_DELETEALL)
+ {
+ DBDeleteContactSetting(hContact, sModule, sYear);
+ DBDeleteContactSetting(hContact, sModule, sMonth);
+ DBDeleteContactSetting(hContact, sModule, sDay);
+ }
+ else{
+ DBWriteContactSettingWord(hContact, sModule, sYear, year);
+ DBWriteContactSettingByte(hContact, sModule, sMonth, month);
+ DBWriteContactSettingByte(hContact, sModule, sDay, day);
+ }
+
+ DBDeleteContactSetting(hContact, sdModule, sdYear);
+ DBDeleteContactSetting(hContact, sdModule, sdMonth);
+ DBDeleteContactSetting(hContact, sdModule, sdDay);
+
+ DBDeleteContactSetting(hContact, sd2Module, sd2Year);
+ DBDeleteContactSetting(hContact, sd2Module, sd2Month);
+ DBDeleteContactSetting(hContact, sd2Module, sd2Day);
+
+ DBDeleteContactSetting(hContact, "BirthDay", "BirthYear");
+ DBDeleteContactSetting(hContact, "BirthDay", "BirthMonth");
+ DBDeleteContactSetting(hContact, "BirthDay", "BirthDay");
+
+ return 0;
+} \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/date_utils.h b/plugins/WhenWasIt/WhenWasIt/date_utils.h
new file mode 100644
index 0000000000..624fceb155
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/date_utils.h
@@ -0,0 +1,52 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef H_WWI_DATE_UTILS_H
+#define H_WWI_DATE_UTILS_H
+
+#include "commonheaders.h"
+#include "errno.h"
+
+#define SAVE_MODE_STANDARD 0
+#define SAVE_MODE_PROTOCOL 1
+#define SAVE_MODE_MBIRTHDAY 2
+
+#define DOB_UNKNOWN 100
+#define DOB_USERINFO 101
+#define DOB_MBIRTHDAY 102
+#define DOB_PROTOCOL 103
+#define DOB_BIRTHDAYREMINDER 104
+#define DOB_MICQBIRTHDAY 105
+
+#define SAVE_MODE_DELETEALL 100
+
+time_t Today();
+int IsLeapYear(int year);
+int IsDOBValid(int year, int month, int day);
+
+unsigned int DaysToBirthday(time_t now, int ctYear, int ctMonth, int ctDay);
+int DaysAfterBirthday(time_t now, int ctYear, int ctMonth, int ctDay);
+int GetContactAge(HANDLE hContact);
+int GetContactDOB(HANDLE hContact, int &year, int &month, int &day);
+char GetContactGender(HANDLE hContact);
+
+int SaveBirthday(HANDLE hContact, int year, int month, int day, int mode);
+
+#endif //H_WWI_DATE_UTILS_H \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/dlg_handlers.cpp b/plugins/WhenWasIt/WhenWasIt/dlg_handlers.cpp
new file mode 100644
index 0000000000..7e907264bd
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/dlg_handlers.cpp
@@ -0,0 +1,1297 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "dlg_handlers.h"
+
+#define COLOR_USERINFO RGB(138, 190, 160)
+#define COLOR_MBIRTHDAY RGB(222, 222, 88)
+#define COLOR_BIRTHDAYREMINDER RGB(200, 120, 240)
+#define COLOR_PROTOCOL RGB(255, 153, 153)
+#define COLOR_MICQBIRTHDAY RGB(88, 88, 240)
+
+#define UPCOMING_TIMER_ID 1002
+
+static WNDPROC OldBirthdaysListProc = NULL;
+
+const TCHAR *szAdvancedIcons[] = {_T("RES0"), _T("Email"), _T("Web"), _T("SMS"), _T("Advanced 1"), _T("Advanced 2"), _T("Advanced 3"), _T("Client"), _T("Advanced 4"), _T("Protocol"), _T("RES2/VisMode")};
+const int cAdvancedIcons = sizeof(szAdvancedIcons) / sizeof(szAdvancedIcons[0]); //don't forget to modify icons.cpp
+
+const TCHAR *szShowAgeMode[] = {_T("Upcoming age"), _T("Current age")};
+const int cShowAgeMode = sizeof(szShowAgeMode) / sizeof(szShowAgeMode[0]);
+
+const TCHAR *szSaveModule[] = {_T("UserInfo module"), _T("Protocol module"), _T("mBirthday module")};
+const int cSaveModule = sizeof(szSaveModule) / sizeof(szSaveModule[0]);
+
+const TCHAR *szPopupClick[] = {_T("Nothing"), _T("Dismiss"), _T("Message window")};
+const int cPopupClick = sizeof(szPopupClick) / sizeof(szPopupClick[0]);
+
+const TCHAR *szNotifyFor[] = {_T("All contacts"), _T("All contacts except hidden ones"), _T("All contacts except ignored ones"), _T("All contacts except hidden and ignored ones")};
+const int cNotifyFor = sizeof(szNotifyFor) / sizeof(szNotifyFor[0]);
+
+#define MIN_BIRTHDAYS_WIDTH 200
+#define MIN_BIRTHDAYS_HEIGHT 200
+
+#include "commctrl.h"
+void CreateToolTip(HWND target, TCHAR* tooltip, LPARAM width)
+{
+ HWND hwndToolTip;
+
+ hwndToolTip = CreateWindow(TOOLTIPS_CLASS, NULL,
+ WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,
+ CW_USEDEFAULT, CW_USEDEFAULT,
+ CW_USEDEFAULT, CW_USEDEFAULT,
+ target,
+ NULL,
+ NULL,
+ NULL);
+ if (hwndToolTip)
+ {
+ TOOLINFO ti = {0};
+ ti.cbSize = sizeof(ti);
+ ti.uFlags = TTF_TRANSPARENT | TTF_SUBCLASS;
+ ti.hwnd = target;
+ ti.uId = 0;
+ ti.hinst = NULL;
+ ti.lpszText = tooltip;
+ GetClientRect(target, &ti.rect);
+ SendMessage(hwndToolTip, TTM_ADDTOOL, 0, (LPARAM) &ti );
+ SendMessage(hwndToolTip, TTM_SETMAXTIPWIDTH, 0, width);
+ SendMessage(hwndToolTip, TTM_SETDELAYTIME, TTDT_AUTOPOP, 20000);
+ }
+}
+
+int EnablePopupsGroup(HWND hWnd, int enable)
+{
+ EnableWindow(GetDlgItem(hWnd, IDC_POPUPS_STATIC), enable);
+ EnableWindow(GetDlgItem(hWnd, IDC_POPUP_TIMEOUT), enable);
+ EnableWindow(GetDlgItem(hWnd, IDC_FOREGROUND), enable);
+ EnableWindow(GetDlgItem(hWnd, IDC_BACKGROUND), enable);
+ EnableWindow(GetDlgItem(hWnd, IDC_NOBIRTHDAYS_POPUP), enable);
+ EnableWindow(GetDlgItem(hWnd, IDC_IGNORE_SUBCONTACTS), (ServiceExists(MS_MC_GETMETACONTACT)) ? enable : FALSE);
+ EnableWindow(GetDlgItem(hWnd, IDC_PREVIEW), enable);
+ EnableWindow(GetDlgItem(hWnd, IDC_LEFT_CLICK), enable);
+ EnableWindow(GetDlgItem(hWnd, IDC_RIGHT_CLICK), enable);
+
+ return enable;
+}
+
+int EnableClistGroup(HWND hWnd, int enable)
+{
+ EnableWindow(GetDlgItem(hWnd, IDC_CLIST_STATIC), enable);
+ EnableWindow(GetDlgItem(hWnd, IDC_ADVANCED_ICON), enable);
+ return enable;
+}
+
+int EnableDialogGroup(HWND hWnd, int enable)
+{
+ EnableWindow(GetDlgItem(hWnd, IDC_DLG_TIMEOUT), enable);
+ EnableWindow(GetDlgItem(hWnd, IDC_OPENINBACKGROUND), enable);
+
+ return enable;
+}
+
+int AddInfoToComboBoxes(HWND hWnd)
+{
+ int i;
+ TCHAR *buffer;
+ for (i = 0; i < cAdvancedIcons; i++)
+ {
+ buffer = TranslateTS(szAdvancedIcons[i]);
+ SendMessage(GetDlgItem(hWnd, IDC_ADVANCED_ICON), CB_ADDSTRING, 0, (LPARAM) buffer);
+ }
+
+ for (i = 0; i < cShowAgeMode; i++)
+ {
+ SendMessage(GetDlgItem(hWnd, IDC_AGE_COMBOBOX), CB_ADDSTRING, 0, (LPARAM) TranslateTS(szShowAgeMode[i]));
+ }
+
+ for (i = 0; i < cSaveModule; i++)
+ {
+ SendMessage(GetDlgItem(hWnd, IDC_DEFAULT_MODULE), CB_ADDSTRING, 0, (LPARAM) TranslateTS(szSaveModule[i]));
+ }
+
+ for (i = 0; i < cPopupClick; i++)
+ {
+ SendMessage(GetDlgItem(hWnd, IDC_LEFT_CLICK), CB_ADDSTRING, 0, (LPARAM) TranslateTS(szPopupClick[i]));
+ SendMessage(GetDlgItem(hWnd, IDC_RIGHT_CLICK), CB_ADDSTRING, 0, (LPARAM) TranslateTS(szPopupClick[i]));
+ }
+
+ for (i = 0; i < cNotifyFor; i++)
+ {
+ SendMessage(GetDlgItem(hWnd, IDC_NOTIFYFOR), CB_ADDSTRING, 0, (LPARAM) TranslateTS(szNotifyFor[i]));
+ }
+
+ return i;
+}
+
+SIZE GetControlTextSize(HWND hCtrl)
+{
+ HDC hDC = GetDC(hCtrl);
+ HFONT font = (HFONT) SendMessage(hCtrl, WM_GETFONT, 0, 0);
+ HFONT oldFont = (HFONT) SelectObject(hDC, font);
+ const size_t maxSize = 2048;
+ TCHAR buffer[maxSize];
+ SIZE size;
+ GetWindowText(hCtrl, buffer, maxSize);
+ GetTextExtentPoint32(hDC, buffer, (int) _tcslen(buffer), &size);
+ SelectObject(hDC, oldFont);
+ ReleaseDC(hCtrl, hDC);
+ return size;
+}
+
+int EnlargeControl(HWND hCtrl, HWND hGroup, SIZE oldSize)
+{
+ SIZE size = GetControlTextSize(hCtrl);
+ int offset = 0;
+ RECT rect;
+ GetWindowRect(hCtrl, &rect);
+ offset = (rect.right - rect.left) - oldSize.cx;
+ SetWindowPos(hCtrl, HWND_TOP, 0, 0, size.cx + offset, oldSize.cy, SWP_NOMOVE);
+ SetWindowPos(hCtrl, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
+ //RedrawWindow(hCtrl, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_ERASENOW);
+
+ return 0;
+}
+
+TCHAR *strtrim(TCHAR *str)
+{
+ size_t i = 0;
+ size_t len = _tcslen(str);
+ while ((i < len) && (str[i] == _T(' '))) { i++; }
+ if (i)
+ {
+ memmove(str, str + i, len - i + 1);
+ len -= i;
+ }
+
+ while ((len > 0) && (str[--len] == _T(' '))) { str[len] = 0; }
+
+ return str;
+}
+
+INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ static int bInitializing = 0;
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ 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));
+
+ 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);
+
+ AddInfoToComboBoxes(hWnd);
+
+ SendMessage(GetDlgItem(hWnd, IDC_FOREGROUND), CPM_SETDEFAULTCOLOUR, 0, FOREGROUND_COLOR);
+ SendMessage(GetDlgItem(hWnd, IDC_BACKGROUND), CPM_SETDEFAULTCOLOUR, 0, BACKGROUND_COLOR);
+
+ SendMessage(GetDlgItem(hWnd, IDC_FOREGROUND), CPM_SETCOLOUR, 0, commonData.foreground);
+ SendMessage(GetDlgItem(hWnd, IDC_BACKGROUND), CPM_SETCOLOUR, 0, commonData.background);
+
+ SendMessage(GetDlgItem(hWnd, IDC_ADVANCED_ICON), CB_SETCURSEL, commonData.clistIcon, 0);
+ SendMessage(GetDlgItem(hWnd, IDC_DEFAULT_MODULE), CB_SETCURSEL, commonData.cDefaultModule, 0);
+ SendMessage(GetDlgItem(hWnd, IDC_LEFT_CLICK), CB_SETCURSEL, commonData.lPopupClick, 0);
+ SendMessage(GetDlgItem(hWnd, IDC_RIGHT_CLICK), CB_SETCURSEL, commonData.rPopupClick, 0);
+ SendMessage(GetDlgItem(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 occuring today]"), 400);
+
+ TCHAR buffer[1024];
+ _itot(commonData.daysInAdvance, buffer, 10);
+ SetWindowText(GetDlgItem(hWnd, IDC_DAYS_IN_ADVANCE), buffer);
+ _itot(commonData.checkInterval, buffer, 10);
+ SetWindowText(GetDlgItem(hWnd, IDC_CHECK_INTERVAL), buffer);
+ _sntprintf(buffer, 1024, _T("%d|%d"), commonData.popupTimeout, commonData.popupTimeoutToday);
+ SetWindowText(GetDlgItem(hWnd, IDC_POPUP_TIMEOUT), buffer);
+ _itot(commonData.cSoundNearDays, buffer, 10);
+ SetWindowText(GetDlgItem(hWnd, IDC_SOUND_NEAR_DAYS_EDIT), buffer);
+ _itot(commonData.cDlgTimeout, buffer, 10);
+ SetWindowText(GetDlgItem(hWnd, IDC_DLG_TIMEOUT), buffer);
+ _itot(commonData.daysAfter, buffer, 10);
+ SetWindowText(GetDlgItem(hWnd, IDC_DAYS_AFTER), buffer);
+
+ CheckDlgButton(hWnd, IDC_OPENINBACKGROUND, (commonData.bOpenInBackground) ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hWnd, IDC_NOBIRTHDAYS_POPUP, (commonData.bNoBirthdaysPopup) ? BST_CHECKED : BST_UNCHECKED);
+ //CheckDlgButton(hWnd, IDC_SHOW_CURRENT_AGE, (bShowCurrentAge) ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(GetDlgItem(hWnd, IDC_AGE_COMBOBOX), CB_SETCURSEL, commonData.cShowAgeMode, 0);
+
+ 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_USE_DIALOG, (commonData.bUseDialog) ? BST_CHECKED : BST_UNCHECKED);
+ EnableDialogGroup(hWnd, commonData.bUseDialog);
+
+ if (ServiceExists(MS_POPUP_ADDPOPUPEX))
+ {
+ 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_CLIST_EXTRA_SET_ICON) && (!ServiceExists(MS_EXTRAICON_REGISTER)))
+ {
+ CheckDlgButton(hWnd, IDC_USE_CLISTICON, commonData.bUseClistIcon ? BST_CHECKED : BST_UNCHECKED);
+ EnableClistGroup(hWnd, commonData.bUseClistIcon);
+ }
+ else{
+ 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))
+ {
+ case IDC_CHECK_INTERVAL:
+ case IDC_POPUP_TIMEOUT:
+ case IDC_DAYS_IN_ADVANCE:
+ case IDC_DLG_TIMEOUT:
+ case IDC_SOUND_NEAR_DAYS_EDIT:
+ case IDC_DAYS_AFTER:
+ {
+ if ((HIWORD(wParam) == EN_CHANGE) && (!bInitializing))// || (HIWORD(wParam) == CBN_SELENDOK))
+ {
+ SendMessage(GetParent(hWnd), PSM_CHANGED, 0, 0);
+ }
+
+ break;
+ }
+
+ case IDC_USE_POPUPS:
+ case IDC_USE_CLISTICON:
+ case IDC_USE_DIALOG:
+ {
+ EnablePopupsGroup(hWnd, IsDlgButtonChecked(hWnd, IDC_USE_POPUPS));
+ EnableClistGroup(hWnd, IsDlgButtonChecked(hWnd, IDC_USE_CLISTICON));
+ EnableDialogGroup(hWnd, IsDlgButtonChecked(hWnd, IDC_USE_DIALOG));
+ RedrawWindow(GetDlgItem(hWnd, IDC_USE_POPUPS), NULL, NULL, RDW_ERASE | RDW_INVALIDATE);
+ RedrawWindow(GetDlgItem(hWnd, IDC_USE_CLISTICON), NULL, NULL, RDW_ERASE | RDW_INVALIDATE);
+ RedrawWindow(GetDlgItem(hWnd, IDC_USE_DIALOG), NULL, NULL, RDW_ERASE | RDW_INVALIDATE);
+ }//fallthrough
+
+ case IDC_FOREGROUND:
+ case IDC_BACKGROUND:
+ case IDC_ADVANCED_ICON:
+ case IDC_IGNORE_SUBCONTACTS:
+ case IDC_AGE_COMBOBOX:
+ case IDC_NOBIRTHDAYS_POPUP:
+ case IDC_DEFAULT_MODULE:
+ case IDC_LEFT_CLICK:
+ case IDC_RIGHT_CLICK:
+ case IDC_ONCE_PER_DAY:
+ case IDC_NOTIFYFOR:
+ {
+ SendMessage(GetParent(hWnd), PSM_CHANGED, 0, 0);
+ EnableWindow(GetDlgItem(hWnd, IDC_CHECK_INTERVAL), !IsDlgButtonChecked(hWnd, IDC_ONCE_PER_DAY));
+
+ break;
+ }
+
+ case IDC_PREVIEW:
+ {
+ HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ int dtb, age;
+ dtb = rand() % 11; //0..10
+ age = rand() % 50 + 1; //1..50
+ PopupNotifyBirthday(hContact, dtb, age);
+
+ break;
+ }
+ }
+ break;
+ }
+ case WM_NOTIFY:
+ {
+ switch(((LPNMHDR)lParam)->idFrom)
+ {
+ case 0:
+ {
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case PSN_APPLY:
+ {
+ commonData.foreground = SendMessage(GetDlgItem(hWnd, IDC_FOREGROUND), CPM_GETCOLOUR, 0, 0);
+ commonData.background = SendMessage(GetDlgItem(hWnd, IDC_BACKGROUND), CPM_GETCOLOUR, 0, 0);
+ commonData.popupTimeout = POPUP_TIMEOUT;
+ commonData.popupTimeoutToday = POPUP_TIMEOUT;
+ commonData.clistIcon = SendMessage(GetDlgItem(hWnd, IDC_ADVANCED_ICON), CB_GETCURSEL, 0, 0);
+ int oldClistIcon = DBGetContactSettingByte(NULL, ModuleName, "AdvancedIcon", -1);
+ commonData.bUsePopups = IsDlgButtonChecked(hWnd, IDC_USE_POPUPS);
+ commonData.bUseClistIcon = IsDlgButtonChecked(hWnd, IDC_USE_CLISTICON);
+ commonData.bUseDialog = IsDlgButtonChecked(hWnd, IDC_USE_DIALOG);
+ commonData.bIgnoreSubcontacts = IsDlgButtonChecked(hWnd, IDC_IGNORE_SUBCONTACTS);
+ commonData.bNoBirthdaysPopup = IsDlgButtonChecked(hWnd, IDC_NOBIRTHDAYS_POPUP);
+ commonData.cShowAgeMode = SendMessage(GetDlgItem(hWnd, IDC_AGE_COMBOBOX), CB_GETCURSEL, 0, 0);
+ commonData.cDefaultModule = SendMessage(GetDlgItem(hWnd, IDC_DEFAULT_MODULE), CB_GETCURSEL, 0, 0);
+ commonData.lPopupClick = SendMessage(GetDlgItem(hWnd, IDC_LEFT_CLICK), CB_GETCURSEL, 0, 0);
+ commonData.rPopupClick = SendMessage(GetDlgItem(hWnd, IDC_RIGHT_CLICK), CB_GETCURSEL, 0, 0);
+ commonData.bOncePerDay = IsDlgButtonChecked(hWnd, IDC_ONCE_PER_DAY);
+ commonData.notifyFor = SendMessage(GetDlgItem(hWnd, IDC_NOTIFYFOR), CB_GETCURSEL, 0, 0);
+ commonData.bOpenInBackground = IsDlgButtonChecked(hWnd, IDC_OPENINBACKGROUND);
+
+ const int maxSize = 1024;
+ TCHAR buffer[maxSize];
+
+ GetWindowText(GetDlgItem(hWnd, IDC_DAYS_IN_ADVANCE), buffer, maxSize);
+ TCHAR *stop = NULL;
+ commonData.daysInAdvance = _tcstol(buffer, &stop, 10);
+
+ if (*stop) { commonData.daysInAdvance = DAYS_TO_NOTIFY; }
+
+ GetWindowText(GetDlgItem(hWnd, IDC_DAYS_AFTER), buffer, maxSize);
+ commonData.daysAfter = _tcstol(buffer, &stop, 10);
+
+ if (*stop) { commonData.daysAfter = DAYS_TO_NOTIFY_AFTER; }
+
+ GetWindowText(GetDlgItem(hWnd, IDC_CHECK_INTERVAL), buffer, maxSize);
+ commonData.checkInterval = _ttol(buffer);
+ if (!commonData.checkInterval) { commonData.checkInterval = CHECK_INTERVAL; }
+
+ GetWindowText(GetDlgItem(hWnd, IDC_POPUP_TIMEOUT), buffer, maxSize);
+ TCHAR *pos;
+ pos = _tcschr(buffer, _T('|'));
+ if (pos)
+ {
+ TCHAR tmp[128];
+ *pos = 0;
+ _tcscpy(tmp, buffer);
+ strtrim(tmp);
+ commonData.popupTimeout = _ttol(tmp);
+
+ _tcscpy(tmp, pos + 1);
+ strtrim(tmp);
+ commonData.popupTimeoutToday = _ttol(tmp);
+
+ }
+ else{
+ commonData.popupTimeout = commonData.popupTimeoutToday = _ttol(buffer);
+ }
+
+ GetWindowText(GetDlgItem(hWnd, IDC_SOUND_NEAR_DAYS_EDIT), buffer, maxSize);
+ //cSoundNearDays = _ttol(buffer);
+ commonData.cSoundNearDays = _tcstol(buffer, &stop, 10);
+ if (*stop) { commonData.cSoundNearDays = BIRTHDAY_NEAR_DEFAULT_DAYS; }
+
+ GetWindowText(GetDlgItem(hWnd, IDC_DLG_TIMEOUT), buffer, maxSize);
+ commonData.cDlgTimeout = _tcstol(buffer, &stop, 10);
+ if (*stop) { commonData.cDlgTimeout = POPUP_TIMEOUT; }
+
+ DBWriteContactSettingByte(NULL, ModuleName, "IgnoreSubcontacts", commonData.bIgnoreSubcontacts);
+ DBWriteContactSettingByte(NULL, ModuleName, "UsePopups", commonData.bUsePopups);
+ DBWriteContactSettingByte(NULL, ModuleName, "UseClistIcon", commonData.bUseClistIcon);
+ DBWriteContactSettingByte(NULL, ModuleName, "UseDialog", commonData.bUseDialog);
+ DBWriteContactSettingByte(NULL, ModuleName, "AdvancedIcon", commonData.clistIcon);
+ DBWriteContactSettingWord(NULL, ModuleName, "CheckInterval", commonData.checkInterval);
+ DBWriteContactSettingWord(NULL, ModuleName, "DaysInAdvance", commonData.daysInAdvance);
+ DBWriteContactSettingWord(NULL, ModuleName, "DaysAfter", commonData.daysAfter);
+ DBWriteContactSettingWord(NULL, ModuleName, "PopupTimeout", commonData.popupTimeout);
+ DBWriteContactSettingWord(NULL, ModuleName, "PopupTimeoutToday", commonData.popupTimeoutToday);
+
+ DBWriteContactSettingByte(NULL, ModuleName, "ShowCurrentAge", commonData.cShowAgeMode);
+ DBWriteContactSettingByte(NULL, ModuleName, "NoBirthdaysPopup", commonData.bNoBirthdaysPopup);
+
+ DBWriteContactSettingByte(NULL, ModuleName, "OpenInBackground", commonData.bOpenInBackground);
+
+ DBWriteContactSettingByte(NULL, ModuleName, "SoundNearDays", commonData.cSoundNearDays);
+
+ DBWriteContactSettingByte(NULL, ModuleName, "DefaultModule", commonData.cDefaultModule);
+
+ DBWriteContactSettingByte(NULL, ModuleName, "PopupLeftClick", commonData.lPopupClick);
+ DBWriteContactSettingByte(NULL, ModuleName, "PopupRightClick", commonData.rPopupClick);
+
+ DBWriteContactSettingDword(NULL, ModuleName, "Foreground", commonData.foreground);
+ DBWriteContactSettingDword(NULL, ModuleName, "Background", commonData.background);
+
+ DBWriteContactSettingByte(NULL, ModuleName, "OncePerDay", commonData.bOncePerDay);
+
+ DBWriteContactSettingWord(NULL, ModuleName, "DlgTimeout", commonData.cDlgTimeout);
+
+ DBWriteContactSettingByte(NULL, ModuleName, "NotifyFor", commonData.notifyFor);
+
+ RefreshAllContactListIcons(oldClistIcon);
+
+ UpdateTimers(); //interval might get changed
+ break;
+ }
+ }
+ break;
+ }
+ }
+ break;
+ }
+ }
+ return 0;
+}
+
+
+
+
+
+INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault(hWnd);
+
+ SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM) hiAddBirthdayContact);
+ int i;
+ for (i = 0; i < cSaveModule; i++)
+ {
+ SendMessage(GetDlgItem(hWnd, IDC_COMPATIBILITY), CB_ADDSTRING, 0, (LPARAM) TranslateTS(szSaveModule[i]));
+ }
+ i = commonData.cDefaultModule; //DBGetContactSettingByte(NULL, ModuleName, "DefaultModule", 0);
+ SendMessage(GetDlgItem(hWnd, IDC_COMPATIBILITY), CB_SETCURSEL, i, 0);
+
+ break;
+ }
+
+ case WM_SHOWWINDOW:
+ {
+ int year, month, day;
+ 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;
+ HANDLE hContact = (HANDLE) GetWindowLongPtr(hWnd, GWLP_USERDATA);
+ const int maxSize = 2048;
+ TCHAR buffer[maxSize];
+ char protocol[256];
+ GetContactProtocol(hContact, protocol, sizeof(protocol));
+
+ TCHAR *name = GetContactName(hContact, protocol);
+ _stprintf(buffer, TranslateT("Set birthday for %s:"), name);
+ free(name);
+ SetWindowText(hWnd, buffer);
+ HWND hDate = GetDlgItem(hWnd, IDC_DATE);
+ 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);
+ }
+ switch (loc)
+ {
+ case DOB_MBIRTHDAY:
+ {
+ DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_MBIRTHDAY);
+ szCurrentModuleTooltip = _T("mBirthday");
+
+ break;
+ }
+
+ case DOB_PROTOCOL:
+ {
+ DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_PROTOCOL);
+#ifdef _UNICODE
+ _stprintf(buffer, TranslateT("%S protocol"), protocol);
+#else
+ _stprintf(buffer, TranslateT("%s protocol"), protocol);
+#endif
+
+ szCurrentModuleTooltip = buffer;
+
+ break;
+ }
+
+ case DOB_BIRTHDAYREMINDER:
+ {
+ DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_BIRTHDAYREMINDER);
+ szCurrentModuleTooltip = _T("Birthday Reminder");
+
+ break;
+ }
+
+ case DOB_USERINFO:
+ {
+ DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_USERINFO);
+ szCurrentModuleTooltip = _T("UserInfo");
+
+ break;
+ }
+
+ case DOB_MICQBIRTHDAY:
+ {
+ DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_MICQBIRTHDAY);
+ szCurrentModuleTooltip = _T("mICQBirthday");
+
+ break;
+ }
+
+ default:
+ {
+ szCurrentModuleTooltip = NULL;
+
+ break;
+ }
+ }
+ //CreateToolTip(GetDlgItem(hWnd, IDC_COMPATIBILITY), hWnd, szTooltipText);
+ CreateToolTip(GetDlgItem(hWnd, IDC_COMPATIBILITY), szTooltipText, 500);
+ if (szCurrentModuleTooltip)
+ {
+ CreateToolTip(hDate, szCurrentModuleTooltip, 400);
+ }
+
+ break;
+ }
+
+ case WM_DESTROY:
+ {
+ HANDLE hContact = (HANDLE) GetWindowLongPtr(hWnd, GWLP_USERDATA);
+ OnExtraImageApply((WPARAM) hContact, NULL); //the birthday might be changed, refresh icon.
+ WindowList_Remove(hAddBirthdayWndsList, hWnd);
+
+ break;
+ }
+
+ case WM_CLOSE:
+ {
+ DestroyWindow(hWnd);
+
+ break;
+ }
+
+ case WM_COMMAND:
+ {
+ switch (LOWORD(wParam))
+ {
+ case IDOK:
+ {
+ SYSTEMTIME st;
+ HANDLE hContact = (HANDLE) GetWindowLongPtr(hWnd, GWLP_USERDATA);
+ HWND hDate = GetDlgItem(hWnd, IDC_DATE);
+ if (DateTime_GetSystemtime(hDate, &st) == GDT_VALID)
+ {
+ int mode = SendMessage(GetDlgItem(hWnd, IDC_COMPATIBILITY), CB_GETCURSEL, 0, 0); //SAVE modes in date_utils.h are synced
+ SaveBirthday(hContact, st.wYear, st.wMonth, st.wDay, mode);
+ }
+ else{
+ SaveBirthday(hContact, 0, 0, 0, SAVE_MODE_DELETEALL);
+ }
+ if (hBirthdaysDlg != NULL)
+ {
+ SendMessage(hBirthdaysDlg, WWIM_UPDATE_BIRTHDAY, (WPARAM) hContact, NULL);
+ }
+
+ SendMessage(hWnd, WM_CLOSE, 0, 0);
+
+ break;
+ }
+ }
+
+ break;
+ }
+
+ }
+
+ return FALSE;
+}
+
+void AddAnchorWindowToDeferList(HDWP &hdWnds, HWND window, RECT *rParent, WINDOWPOS *wndPos, int anchors)
+{
+ RECT rChild = AnchorCalcPos(window, rParent, wndPos, anchors);
+ hdWnds = DeferWindowPos(hdWnds, window, HWND_NOTOPMOST, rChild.left, rChild.top, rChild.right - rChild.left, rChild.bottom - rChild.top, SWP_NOZORDER);
+}
+
+
+#define NA TranslateT("N/A")
+
+TCHAR *GetBirthdayModule(int module, HANDLE hContact, TCHAR *birthdayModule, int size)
+{
+ switch (module)
+ {
+ case DOB_MBIRTHDAY:
+ {
+ _tcsncpy(birthdayModule, _T("mBirthday"), size);
+
+ break;
+ }
+
+ case DOB_PROTOCOL:
+ {
+ char protocol[512];
+ GetContactProtocol(hContact, protocol, sizeof(protocol));
+#ifdef _UNICODE
+ _sntprintf(birthdayModule, size, TranslateT("%S protocol"), protocol);
+#else
+ _sntprintf(birthdayModule, size, TranslateT("%s protocol"), protocol);
+#endif
+
+ break;
+ }
+
+ case DOB_BIRTHDAYREMINDER:
+ {
+ _tcsncpy(birthdayModule, _T("Birthday Reminder"), size);
+
+ break;
+ }
+
+ case DOB_USERINFO:
+ {
+ _tcsncpy(birthdayModule, _T("UserInfo"), size);
+
+ break;
+ }
+
+ case DOB_MICQBIRTHDAY:
+ {
+ _tcsncpy(birthdayModule, _T("mICQBirthday"), size);
+
+ break;
+ }
+
+ default:
+ {
+ _tcsncpy(birthdayModule, NA, size);
+
+ break;
+ }
+ }
+ return birthdayModule;
+}
+
+static int lastColumn = -1;
+
+struct BirthdaysSortParams{
+ HWND hList;
+ int column;
+};
+
+INT_PTR CALLBACK BirthdaysCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam)
+{
+ BirthdaysSortParams params = *(BirthdaysSortParams *) myParam;
+ const int maxSize = 1024;
+ TCHAR text1[maxSize];
+ TCHAR text2[maxSize];
+ long value1, value2;
+ ListView_GetItemText(params.hList, (int) lParam1, params.column, text1, maxSize);
+ ListView_GetItemText(params.hList, (int) lParam2, params.column, text2, maxSize);
+
+ int res = 0;
+
+ if ((params.column == 2) || (params.column == 4))
+ {
+ TCHAR *err1, *err2;
+ value1 = _tcstol(text1, &err1, 10);
+ value2 = _tcstol(text2, &err2, 10);
+
+ if ((err1[0]) || (err2[0]))
+ {
+ res = (err1[0]) ? 1 : -1;
+ }
+ else{
+ if (value1 < value2)
+ {
+ res = -1;
+ }
+ else{
+ if (value1 == value2)
+ {
+ res = 0;
+ }
+ else{
+ res = 1;
+ }
+ }
+ }
+ }
+ else{
+ res = _tcsicmp(text1, text2);
+ }
+ res = (params.column == lastColumn) ? -res : res;
+ return res;
+}
+
+//only updates the birthday part of the list view entry. Won't update the protocol and the contact name (those shouldn't change anyway :) )
+int UpdateBirthdayEntry(HWND hList, HANDLE hContact, int entry, int bShowAll, int bShowCurrentAge, int bAdd)
+{
+ const int maxSize = 2048;
+ TCHAR buffer[maxSize];
+
+ int age;
+ int dtb;
+ int year, month, day;
+ TCHAR *name;
+ int module;
+ char protocol[512];
+ LVITEM item = {0};
+
+ int currentYear;
+ int currentMonth;
+ int currentDay;
+
+ int res = entry;
+
+ if (bShowCurrentAge)
+ {
+ time_t now = Today();
+ struct tm *today = gmtime(&now);
+ currentDay = today->tm_mday + 1;
+ currentMonth = today->tm_mon + 1;
+ currentYear = today->tm_year;
+ }
+
+ item.mask = LVIF_TEXT | LVIF_PARAM;
+ item.iItem = entry;
+
+ module = GetContactDOB(hContact, year, month, day);
+ if ((bShowAll) || (IsDOBValid(year, month, day)))
+ {
+ lastColumn = -1; //list isn't sorted anymore
+ dtb = DaysToBirthday(Today(), year, month, day);
+ age = GetContactAge(hContact);
+ if (bShowCurrentAge)
+ {
+ if ((month > currentMonth) || ((month == currentMonth) && (day > currentDay))) //birthday still to come
+ {
+ age--;
+ }
+ }
+
+ item.lParam = (LPARAM) hContact;
+
+ GetContactProtocol(hContact, protocol, sizeof(protocol));
+#ifdef _UNICODE
+ MultiByteToWideChar(CP_ACP, MB_USEGLYPHCHARS, protocol, -1, buffer, maxSize);
+#else
+ strcpy(buffer, protocol);
+#endif
+ item.pszText = buffer;
+
+ if (bAdd)
+ {
+ ListView_InsertItem(hList, &item);
+ }
+ else{
+ ListView_SetItemText(hList, entry, 0, buffer);
+ }
+
+ name = GetContactName(hContact, protocol);
+ ListView_SetItemText(hList, entry, 1, name);
+ free(name);
+
+ if ((dtb <= 366) && (dtb >= 0))
+ {
+ _stprintf(buffer, _T("%d"), dtb);
+ }
+ else{
+ _stprintf(buffer, NA);
+ }
+ ListView_SetItemText(hList, entry, 2, buffer);
+ if ((year != 0) && (month != 0) && (day != 0))
+ {
+ _stprintf(buffer, _T("%04d-%02d-%02d"), year, month, day);
+ }
+ else{
+ _stprintf(buffer, NA);
+ }
+ ListView_SetItemText(hList, entry, 3, buffer);
+
+ if (age < 400) //hopefully noone lives longer than this :)
+ {
+ _stprintf(buffer, _T("%d"), age);
+ }
+ else{
+ _stprintf(buffer, NA);
+ }
+ ListView_SetItemText(hList, entry, 4, buffer);
+
+ GetBirthdayModule(module, hContact, buffer, maxSize);
+ ListView_SetItemText(hList, entry, 5, buffer);
+
+ res++;
+ }
+ else{
+ if ((!bShowAll) && (!bAdd))
+ {
+ ListView_DeleteItem(hList, entry);
+ }
+ }
+ return res;
+}
+
+INT_PTR CALLBACK BirthdaysListSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg)
+ {
+ case WM_KEYUP:
+ {
+ if (wParam == VK_ESCAPE)
+ {
+ SendMessage(GetParent(hWnd), WM_CLOSE, 0, 0);
+ }
+ break;
+ }
+ case WM_SYSKEYDOWN:
+ {
+ if (wParam == 'X')
+ {
+ SendMessage(GetParent(hWnd), WM_CLOSE, 0, 0);
+ }
+ break;
+ }
+ case WM_LBUTTONDBLCLK:
+ {
+ int i;
+ int count = ListView_GetItemCount(hWnd);
+ HANDLE hContact;
+ LVITEM item = {0};
+// char buffer[1024];
+// item.pszText = buffer;
+// item.cchTextMax = sizeof(buffer);
+ item.mask = LVIF_PARAM;
+ for (i = 0; i < count; i++)
+ {
+ if (ListView_GetItemState(hWnd, i, LVIS_SELECTED))
+ {//TODO
+ item.iItem = i;
+ ListView_GetItem(hWnd, &item);
+ hContact = (HANDLE) item.lParam;
+ CallService(MS_WWI_ADD_BIRTHDAY, (WPARAM) hContact, 0);
+ }
+ }
+ break;
+ }
+ }
+ return CallWindowProc(OldBirthdaysListProc, hWnd, msg, wParam, lParam);
+}
+
+void SetBirthdaysCount(HWND hWnd)
+{
+ int count = ListView_GetItemCount((GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST)));
+ TCHAR title[512];
+ _stprintf(title, TranslateT("Birthday list (%d)"), count);
+ SetWindowText(hWnd, title);
+}
+
+int LoadBirthdays(HWND hWnd, int bShowAll)
+{
+ HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HWND hList = GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST);
+ //int bShowCurrentAge = DBGetContactSettingByte(NULL, ModuleName, "ShowCurrentAge", 0);
+
+ ListView_DeleteAllItems(hList);
+
+ int count = 0;
+ while (hContact)
+ {
+ count = UpdateBirthdayEntry(hList, hContact, count, bShowAll, commonData.cShowAgeMode, 1);
+
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ }
+ SetBirthdaysCount(hWnd);
+
+ return 0;
+}
+
+INT_PTR CALLBACK DlgProcBirthdays(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault(hWnd);
+ SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM) hiListMenu);
+ HWND hList = GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST);
+
+ ListView_SetExtendedListViewStyleEx(hList, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);
+
+ OldBirthdaysListProc = (WNDPROC) SetWindowLongPtr(hList, GWLP_WNDPROC, (LONG_PTR) BirthdaysListSubclassProc);
+
+ LVCOLUMN col;
+ col.mask = LVCF_TEXT | LVCF_WIDTH;
+ col.pszText = TranslateT("Protocol");
+ col.cx = 80;
+ ListView_InsertColumn(hList, 0, &col);
+ col.pszText = TranslateT("Contact");
+ col.cx = 180;
+ ListView_InsertColumn(hList, 1, &col);
+ col.pszText = TranslateT("DTB");
+ col.cx = 50;
+ ListView_InsertColumn(hList, 2, &col);
+ col.pszText = TranslateT("Birthday");
+ col.cx = 80;
+ ListView_InsertColumn(hList, 3, &col);
+ col.pszText = TranslateT("Age");
+ col.cx = 50;
+ ListView_InsertColumn(hList, 4, &col);
+ col.pszText = TranslateT("Module");
+ col.cx = 110;
+ ListView_InsertColumn(hList, 5, &col);
+
+ LoadBirthdays(hWnd, 0);
+ int column = DBGetContactSettingByte(NULL, ModuleName, "SortColumn", 0);
+
+ BirthdaysSortParams params = {0};
+ params.hList = GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST);
+ params.column = column;
+ ListView_SortItemsEx(params.hList, BirthdaysCompare, (LPARAM) &params);
+
+ Utils_RestoreWindowPosition(hWnd,NULL,ModuleName,"BirthdayList");
+
+ return TRUE;
+ break;
+ }
+
+ case WM_DESTROY:
+ {
+ hBirthdaysDlg = NULL;
+ Utils_SaveWindowPosition(hWnd,NULL,ModuleName,"BirthdayList");
+ lastColumn = -1;
+
+ break;
+ }
+
+ case WM_CLOSE:
+ {
+ DestroyWindow(hWnd);
+
+ break;
+ }
+
+ case WWIM_UPDATE_BIRTHDAY:
+ {//wParam = hContact
+ HWND hList = GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST);
+ HANDLE hContact = (HANDLE) wParam;
+ int i;
+ int count = ListView_GetItemCount(hList);
+ //int bShowCurrentAge = DBGetContactSettingByte(NULL, ModuleName, "ShowCurrentAge", 0);
+ LVITEM item = {0};
+ int found = 0;
+
+ item.mask = LVIF_PARAM;
+ for (i = 0; (i < count) && (!found); i++)
+ {
+ item.iItem = i;
+ ListView_GetItem(hList, &item);
+ if (hContact == (HANDLE) item.lParam)
+ {
+ UpdateBirthdayEntry(hList, hContact, i, IsDlgButtonChecked(hWnd, IDC_SHOW_ALL), commonData.cShowAgeMode, 0);
+ found = 1;
+ }
+ }
+ if (!found)
+ {
+ UpdateBirthdayEntry(hList, hContact, count, IsDlgButtonChecked(hWnd, IDC_SHOW_ALL), commonData.cShowAgeMode, 1);
+ }
+
+ SetBirthdaysCount(hWnd);
+
+ break;
+ }
+
+ case WM_WINDOWPOSCHANGING:
+ {
+ 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->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);
+
+ EndDeferWindowPos(hdWnds);
+
+ break;
+ }
+
+ case WM_COMMAND:
+ {
+ switch (LOWORD(wParam))
+ {
+ case IDC_CLOSE:
+ {
+ SendMessage(hWnd, WM_CLOSE, 0, 0);
+
+ break;
+ }
+ case IDC_SHOW_ALL:
+ {
+ LoadBirthdays(hWnd, IsDlgButtonChecked(hWnd, IDC_SHOW_ALL));
+
+ break;
+ }
+ }
+ break;
+ }
+
+ case WM_NOTIFY:
+ {
+ switch (((LPNMHDR) lParam)->idFrom)
+ {
+ case IDC_BIRTHDAYS_LIST:
+ {
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case LVN_COLUMNCLICK:
+ {
+ LPNMLISTVIEW lv = (LPNMLISTVIEW) lParam;
+ int column = lv->iSubItem;
+ DBWriteContactSettingByte(NULL, ModuleName, "SortColumn", column);
+ BirthdaysSortParams params = {0};
+ params.hList = GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST);
+ params.column = column;
+ ListView_SortItemsEx(params.hList, BirthdaysCompare, (LPARAM) &params);
+ lastColumn = (params.column == lastColumn) ? -1 : params.column;
+
+ break;
+ }
+ }
+
+ break;
+ }
+ }
+
+ break;
+ }
+ }
+ return 0;
+}
+
+
+INT_PTR CALLBACK UpcomingCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam)
+{
+ HWND hList = GetDlgItem(hUpcomingDlg, IDC_UPCOMING_LIST);
+ LVITEM item = {0};
+ item.iItem = (int) lParam1;
+ item.mask = LVIF_PARAM;
+ ListView_GetItem(hList, &item);
+ int dtb1 = item.lParam;
+
+ item.iItem = (int) lParam2;
+ ListView_GetItem(hList, &item);
+ int dtb2 = item.lParam;
+
+ if (dtb1 != dtb2)
+ {
+ return (dtb1 > dtb2) ? 1 : -1;
+ }
+
+ return 0;
+}
+
+INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ static int timeout;
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ timeout = commonData.cDlgTimeout;
+ TranslateDialogDefault(hWnd);
+ SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM) hiListMenu);
+ HWND hList = GetDlgItem(hWnd, IDC_UPCOMING_LIST);
+
+ 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 = 60;
+ ListView_InsertColumn(hList, 1, &col);
+
+ if (timeout > 0)
+ {
+ SetTimer(hWnd, UPCOMING_TIMER_ID, 1000, NULL);
+ }
+
+ return TRUE;
+ break;
+ }
+
+ case WM_TIMER:
+ {
+ const int MAX_SIZE = 512;
+ TCHAR buffer[MAX_SIZE];
+ _stprintf(buffer, (timeout != 2) ? TranslateT("Closing in %d seconds") : TranslateT("Closing in %d second"), --timeout);
+ SetWindowText(GetDlgItem(hWnd, IDC_CLOSE), buffer);
+
+ if (timeout <= 0)
+ {
+ SendMessage(hWnd, WM_CLOSE, 0, 0);
+ }
+
+ break;
+ }
+
+ case WM_CLOSE:
+ {
+ DestroyWindow(hWnd);
+
+ break;
+ }
+
+ case WM_DESTROY:
+ {
+ hUpcomingDlg = NULL;
+ KillTimer(hWnd, UPCOMING_TIMER_ID);
+
+ break;
+ }
+
+ case WWIM_ADD_UPCOMING_BIRTHDAY:
+ {
+ PUpcomingBirthday data = (PUpcomingBirthday) wParam;
+
+ HWND hList = GetDlgItem(hWnd, IDC_UPCOMING_LIST);
+ LVITEM item = {0};
+ int index = ListView_GetItemCount(hList);
+ item.iItem = index;
+ item.mask = LVIF_PARAM | LVIF_TEXT;
+ //item.lParam = (LPARAM) data->hContact;
+ item.lParam = (LPARAM) data->dtb;
+ item.pszText = data->message;
+ ListView_InsertItem(hList, &item);
+
+ TCHAR buffer[512];
+ mir_sntprintf(buffer, 512, _T("%d"), data->age);
+ ListView_SetItemText(hList, index, 1, buffer);
+
+ ListView_SortItemsEx(hList, UpcomingCompare, NULL);
+
+ break;
+ }
+
+ case WM_COMMAND:
+ {
+ switch (LOWORD(wParam))
+ {
+ case IDC_CLOSE:
+ {
+ SendMessage(hWnd, WM_CLOSE, 0, 0);
+
+ break;
+ }
+ }
+
+ break;
+ }
+ }
+
+ return 0;
+}
+
+DWORD WINAPI OpenMessageWindowThread(void *data)
+{
+ HANDLE hContact = (HANDLE) data;
+ CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM) hContact, 0);
+ CallServiceSync("SRMsg/LaunchMessageWindow", (WPARAM) hContact, 0);
+
+ return 0;
+}
+
+int HandlePopupClick(HWND hWnd, int action)
+{
+ switch (action)
+ {
+ case 2: //OPEN MESSAGE WINDOW
+ {
+ HANDLE hContact = (HANDLE) PUGetContact(hWnd);
+ if (hContact)
+ {
+ DWORD threadID;
+ HANDLE thread = CreateThread(NULL, NULL, OpenMessageWindowThread, hContact, 0, &threadID);
+ }
+
+ }//fallthrough
+
+ case 1: //DISMISS
+ {
+ PUDeletePopUp(hWnd);
+
+ break;
+ }
+
+ case 0: //NOTHING
+ default:
+ {
+
+ break;
+ }
+
+ }
+
+ return 0;
+}
+
+INT_PTR CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg)
+ {
+ case WM_COMMAND:
+ {
+ switch (HIWORD(wParam))
+ {
+ case STN_CLICKED:
+ {
+ HandlePopupClick(hWnd, commonData.lPopupClick);
+
+ break;
+ }
+ }
+ break;
+ }
+
+ case WM_CONTEXTMENU:
+ {
+ HandlePopupClick(hWnd, commonData.rPopupClick);
+
+ break;
+ }
+ }
+
+ return DefWindowProc(hWnd, msg, wParam, lParam);
+} \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/dlg_handlers.h b/plugins/WhenWasIt/WhenWasIt/dlg_handlers.h
new file mode 100644
index 0000000000..c335ad026e
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/dlg_handlers.h
@@ -0,0 +1,47 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_WWI_DIALOG_HANDLERS_H
+#define M_WWI_DIALOG_HANDLERS_H
+
+#include "commonheaders.h"
+
+#define FOREGROUND_COLOR RGB(0, 64, 128)
+#define BACKGROUND_COLOR RGB(255, 255, 255)
+
+#define POPUP_TIMEOUT 30
+
+#define CHECK_INTERVAL 12
+
+#define DAYS_TO_NOTIFY 9
+#define DAYS_TO_NOTIFY_AFTER 0
+
+#define CLIST_ICON 4
+
+#define WWIM_UPDATE_BIRTHDAY (WM_USER + 101)
+#define WWIM_ADD_UPCOMING_BIRTHDAY (WM_USER + 102)
+
+INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcBirthdays(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
+
+#endif //M_WWI_DIALOG_HANDLERS_H \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/events.cpp b/plugins/WhenWasIt/WhenWasIt/events.cpp
new file mode 100644
index 0000000000..d9b9eab75e
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/events.cpp
@@ -0,0 +1,37 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "events.h"
+
+HANDLE heContactSendMessage;
+
+int CreateEvents()
+{
+ heContactSendMessage = CreateHookableEvent(ME_WWI_SENDMESSAGE);
+
+ return 0;
+}
+
+int DestroyEvents()
+{
+ DestroyHookableEvent(heContactSendMessage);
+
+ return 0;
+} \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/events.h b/plugins/WhenWasIt/WhenWasIt/events.h
new file mode 100644
index 0000000000..7944673fbf
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/events.h
@@ -0,0 +1,33 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_WWI_EVENTS_H
+#define M_WWI_EVENTS_H
+
+#include "commonheaders.h"
+
+#define ME_WWI_SENDMESSAGE "WWI/ContactSendMessage"
+
+extern HANDLE heContactSendMessage;
+
+int CreateEvents();
+int DestroyEvents();
+
+#endif //M_WWI_EVENTS_H \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/hooked_events.cpp b/plugins/WhenWasIt/WhenWasIt/hooked_events.cpp
new file mode 100644
index 0000000000..4c23bc2bf4
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/hooked_events.cpp
@@ -0,0 +1,419 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006-2011 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "hooked_events.h"
+
+#define DATE_CHANGE_CHECK_INTERVAL 20
+
+#define EXCLUDE_HIDDEN 1
+#define EXCLUDE_IGNORED 2
+
+#define HOST "http://eblis.tla.ro/projects"
+
+#ifdef _UNICODE
+ #define WHENWASIT_DATA "WhenWasIt%20unicode"
+#else
+ #define WHENWASIT_DATA "WhenWasIt"
+#endif
+
+#if defined(WIN64) || defined(_WIN64)
+#define WHENWASIT_VERSION_URL HOST "/miranda/WhenWasIt/updater/x64/WhenWasIt.html"
+#define WHENWASIT_UPDATE_URL HOST "/miranda/WhenWasIt/updater/x64/" WHENWASIT_DATA ".zip"
+#else
+#define WHENWASIT_VERSION_URL HOST "/miranda/WhenWasIt/updater/WhenWasIt.html"
+#define WHENWASIT_UPDATE_URL HOST "/miranda/WhenWasIt/updater/" WHENWASIT_DATA ".zip"
+#endif
+#define WHENWASIT_VERSION_PREFIX "WhenWasIt version "
+
+HANDLE hModulesLoaded;
+HANDLE hOptionsInitialize;
+HANDLE hIconsChanged;
+HANDLE hExtraIconListRebuild;
+HANDLE hExtraImageApply;
+HANDLE hContactSettingChanged;
+HANDLE hTopToolBarModuleLoaded;
+//HANDLE hContactSendMessage;
+
+HANDLE hmCheckBirthdays = NULL;
+HANDLE hmBirthdayList = NULL;
+HANDLE hmRefreshDetails = NULL;
+HANDLE hmAddChangeBirthday = NULL;
+HANDLE hmImportBirthdays = NULL;
+HANDLE hmExportBirthdays = NULL;
+
+UINT_PTR hCheckTimer = NULL;
+UINT_PTR hDateChangeTimer = NULL;
+
+int currentDay;
+
+int HookEvents()
+{
+ Log("%s", "Entering function " __FUNCTION__);
+ hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+ hOptionsInitialize = HookEvent(ME_OPT_INITIALISE, OnOptionsInitialise);
+ Log("%s", "Leaving function " __FUNCTION__);
+
+ return 0;
+}
+
+int UnhookEvents()
+{
+ Log("%s", "Entering function " __FUNCTION__);
+ UnhookEvent(hModulesLoaded);
+ UnhookEvent(hOptionsInitialize);
+ UnhookEvent(hIconsChanged);
+ UnhookEvent(hExtraIconListRebuild);
+ UnhookEvent(hExtraImageApply);
+ UnhookEvent(hContactSettingChanged);
+ UnhookEvent(hTopToolBarModuleLoaded);
+ //UnhookEvent(hContactSendMessage);
+
+ KillTimers();
+
+ Log("%s", "Leaving function " __FUNCTION__);
+
+ return 0;
+}
+
+int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
+{
+ hIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged);
+ hExtraIconListRebuild = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, OnExtraIconListRebuild);
+ hExtraImageApply = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnExtraImageApply);
+ hContactSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged);
+ hTopToolBarModuleLoaded = HookEvent(ME_TTB_MODULELOADED, OnTopToolBarModuleLoaded);
+ //hContactSendMessage = HookEvent(ME_WWI_SENDMESSAGE, OnContactSendMessage);
+
+ SkinAddNewSoundEx(BIRTHDAY_NEAR_SOUND, "WhenWasIt", "Birthday near");
+ SkinAddNewSoundEx(BIRTHDAY_TODAY_SOUND, "WhenWasIt", "Birthday today");
+
+ RebuildAdvIconList();
+
+ char buffer[1024];
+ Update update = {0};
+ update.cbSize = sizeof(Update);
+ update.szComponentName = __PLUGIN_DISPLAY_NAME;
+ update.pbVersion = (BYTE *) CreateVersionString(VERSION, buffer);
+ update.cpbVersion = (int) strlen((char *) update.pbVersion);
+ update.szUpdateURL = UPDATER_AUTOREGISTER;
+ update.szBetaVersionURL = WHENWASIT_VERSION_URL;
+ update.szBetaUpdateURL = WHENWASIT_UPDATE_URL;
+ update.pbBetaVersionPrefix = (BYTE *) WHENWASIT_VERSION_PREFIX;
+ update.cpbBetaVersionPrefix = (int) strlen(WHENWASIT_VERSION_PREFIX);
+ CallService(MS_UPDATE_REGISTER, 0, (LPARAM) &update);
+
+ UpdateTimers();
+ CLISTMENUITEM cl = {0};
+ cl.cbSize = sizeof(CLISTMENUITEM);
+ cl.hIcon = hiCheckMenu;
+ cl.position = 10000000;
+ cl.pszService = MS_WWI_CHECK_BIRTHDAYS;
+ cl.pszName = "Check for birthdays";
+ cl.pszPopupName = "Birthdays (When Was It)";
+ hmCheckBirthdays = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &cl);
+
+ cl.pszService = MS_WWI_LIST_SHOW;
+ cl.pszName = "Birthday list";
+ cl.hIcon = hiListMenu;
+ hmBirthdayList = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &cl);
+
+ cl.pszService = MS_WWI_REFRESH_USERDETAILS;
+ cl.position = 10100000;
+ cl.pszName = "Refresh user details";
+ cl.hIcon = hiRefreshUserDetails;
+ hmRefreshDetails = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &cl);
+
+ cl.pszService = MS_WWI_IMPORT_BIRTHDAYS;
+ cl.position = 10200000;
+ cl.pszName = "Import birthdays";
+ cl.hIcon = hiImportBirthdays;
+ hmImportBirthdays = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &cl);
+
+ cl.pszService = MS_WWI_EXPORT_BIRTHDAYS;
+ cl.pszName = "Export birthdays";
+ cl.hIcon = hiExportBirthdays;
+ hmExportBirthdays = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &cl);
+
+ cl.pszService = MS_WWI_ADD_BIRTHDAY;
+ cl.position = 10000000;
+ cl.hIcon = hiAddBirthdayContact;
+ cl.pszName = "Add/change user &birthday";
+ hmAddChangeBirthday = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) &cl);
+
+ if(ServiceExists(MS_HOTKEY_REGISTER))
+ {
+ HOTKEYDESC hotkey = {0};
+ hotkey.cbSize = sizeof(hotkey);
+ hotkey.dwFlags = HKD_TCHAR;
+ hotkey.ptszSection = LPGENT("Birthdays");
+
+ hotkey.pszName = "wwi_birthday_list";
+ hotkey.ptszDescription = LPGENT("Birthday list");
+ hotkey.pszService = MS_WWI_LIST_SHOW;
+ CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&hotkey);
+
+ hotkey.pszName = "wwi_check_birthdays";
+ hotkey.ptszDescription = LPGENT("Check for birthdays");
+ hotkey.pszService = MS_WWI_CHECK_BIRTHDAYS;
+ CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&hotkey);
+ }
+
+ return 0;
+}
+
+int OnTopToolBarModuleLoaded(WPARAM wParam, LPARAM lParam)
+{
+ TTBButton ttb = {0};
+ ttb.cbSize = sizeof(TTBButton);
+ ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
+ ttb.pszServiceDown = MS_WWI_CHECK_BIRTHDAYS;
+ HBITMAP bitmap = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TTB_CHECK));
+ ttb.hbBitmapUp = (HBITMAP) bitmap;
+ ttb.hbBitmapDown = (HBITMAP) bitmap;
+ ttb.name = Translate("Check for birthdays");
+ CallService(MS_TTB_ADDBUTTON, (WPARAM) &ttb, 0);
+ //DeleteObject(icon);
+
+ return 0;
+}
+
+int OnOptionsInitialise(WPARAM wParam, LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp = {0};
+
+ odp.cbSize = sizeof(odp);
+ odp.position = 100000000;
+ odp.hInstance = hInstance;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_WWI);
+ odp.ptszTitle = _T("When Was It");
+ odp.ptszGroup = _T("Plugins");
+ odp.groupPosition = 910000000;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.pfnDlgProc = DlgProcOptions;
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
+
+ return 0;
+}
+
+void UpdateMenuItems()
+{
+ CLISTMENUITEM cl = {0};
+ cl.cbSize = sizeof(CLISTMENUITEM);
+ cl.flags = CMIM_ICON;
+ cl.hIcon = hiCheckMenu;
+ int res = CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hmCheckBirthdays, (LPARAM) &cl);
+
+ cl.hIcon = hiListMenu;
+ res = CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hmBirthdayList, (LPARAM) &cl);
+
+ cl.hIcon = hiRefreshUserDetails;
+ res = CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hmRefreshDetails, (LPARAM) &cl);
+
+ cl.hIcon = hiAddBirthdayContact;
+ res = CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hmAddChangeBirthday, (LPARAM) &cl);
+
+ cl.hIcon = hiImportBirthdays;
+ res = CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hmImportBirthdays, (LPARAM) &cl);
+
+ cl.hIcon = hiExportBirthdays;
+ res = CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hmExportBirthdays, (LPARAM) &cl);
+}
+
+int OnIconsChanged(WPARAM wParam, LPARAM lParam)
+{
+ GetIcons();
+ UpdateMenuItems();
+
+ return 0;
+}
+
+int OnContactSettingChanged(WPARAM wParam, LPARAM lParam)
+{
+ DBCONTACTWRITESETTING *dw = (DBCONTACTWRITESETTING *) lParam;
+ //static HANDLE oldContact = NULL;
+ DBVARIANT dv = dw->value;
+ if ((strcmp(dw->szModule, DUMMY_MODULE) == 0) && (strcmp(dw->szSetting, DUMMY_SETTING) == 0))
+ {
+ OnExtraImageApply(wParam, 0);
+ }
+ //oldContact = (HANDLE) wParam;
+
+ return 0;
+}
+
+int OnExtraIconListRebuild(WPARAM wParam, LPARAM lParam)
+{
+ RebuildAdvIconList();
+
+ return 0;
+}
+
+int OnExtraImageApply(WPARAM wParam, LPARAM lParam)
+{
+ HANDLE hContact = (HANDLE) wParam;
+ if ((hContact))
+ {
+ int count = CallService(MS_DB_CONTACT_GETCOUNT, 0, 0);
+ //int daysInAdvance = DBGetContactSettingWord(NULL, ModuleName, "DaysInAdvance", DAYS_TO_NOTIFY);
+ //int popupTimeout = DBGetContactSettingWord(NULL, ModuleName, "PopupTimeout", POPUP_TIMEOUT);
+ //DWORD foreground = DBGetContactSettingDword(NULL, ModuleName, "Foreground", FOREGROUND_COLOR);
+ //DWORD background = DBGetContactSettingDword(NULL, ModuleName, "Background", BACKGROUND_COLOR);
+ //int bUsePopups = DBGetContactSettingByte(NULL, ModuleName, "UsePopups", TRUE);
+ //int bUseClistIcon = DBGetContactSettingByte(NULL, ModuleName, "UseClistIcon", TRUE);
+ //int bUseDialog = DBGetContactSettingByte(NULL, ModuleName, "UseDialog", TRUE);
+ //int clistIcon = DBGetContactSettingByte(NULL, ModuleName, "AdvancedIcon", CLIST_ICON);
+ //int notifyFor = DBGetContactSettingByte(NULL, ModuleName, "NotifyFor", 0);
+ int hidden = DBGetContactSettingByte(hContact, "CList", "Hidden", 0);
+ int ignored = DBGetContactSettingDword(hContact, "Ignore", "Mask1", 0);
+ ignored = ((ignored & 0x3f) != 0) ? 1 : 0;
+ int ok = 1;
+ if (commonData.notifyFor & EXCLUDE_HIDDEN)
+ {
+ ok &= (hidden == 0);
+ }
+ if (commonData.notifyFor & EXCLUDE_IGNORED)
+ {
+ ok &= (ignored == 0);
+ }
+
+ int dtb;
+ int dab;
+ int caps = ServiceExists(MS_CLIST_EXTRA_ADD_ICON); // CallService(MS_CLUI_GETCAPS, 0, 0);
+
+ time_t today = Today();
+
+ if ((ok) && (((dtb = NotifyContactBirthday(hContact, today, commonData.daysInAdvance)) >= 0) || ((dab = NotifyMissedContactBirthday(hContact, today, commonData.daysAfter)) > 0)))
+ {
+ int age = GetContactAge(hContact);
+ DBWriteContactSettingByte(hContact, "UserInfo", "Age", age);
+
+ if ((bShouldCheckBirthdays) && (commonData.bUsePopups))
+ {
+ if (dtb >= 0)
+ {
+ bBirthdayFound = 1; //only set it if we're called from our CheckBirthdays service
+ PopupNotifyBirthday(hContact, dtb, age);
+ }
+ else if (dab > 0)
+ {
+ PopupNotifyMissedBirthday(hContact, dab, age);
+ }
+ }
+
+ if (bShouldCheckBirthdays)
+ {
+ if (dtb >= 0)
+ {
+ SoundNotifyBirthday(dtb);
+ }
+ }
+
+ if ((bShouldCheckBirthdays) && (commonData.bUseDialog))
+ {
+ if (dtb >= 0)
+ {
+ DialogNotifyBirthday(hContact, dtb, age);
+ }
+ else if (dab > 0)
+ {
+ DialogNotifyMissedBirthday(hContact, dab, age);
+ }
+ }
+
+ if ((caps > 0) && (commonData.bUseClistIcon)) //TODO
+ {
+ if (dtb >= 0)
+ {
+ ClistIconNotifyBirthday(hContact, dtb, commonData.clistIcon);
+ }
+ }
+ }
+ else{
+ if (caps > 0) //TODO
+ { //clear the icon
+ ClearClistIcon(hContact, commonData.clistIcon);
+ }
+ }
+ }
+
+ return 0;
+}
+
+int UpdateTimers()
+{
+ if (hCheckTimer)
+ {
+ KillTimer(NULL, hCheckTimer);
+ hCheckTimer = NULL;
+ }
+ long interval;
+ interval = DBGetContactSettingDword(NULL, ModuleName, "Interval", CHECK_INTERVAL);
+ interval *= 1000 * 60 * 60; //go from miliseconds to hours
+ hCheckTimer = SetTimer(NULL, 0, interval, (TIMERPROC) OnCheckTimer);
+ if (!hDateChangeTimer)
+ {
+ hDateChangeTimer = SetTimer(NULL, 0, 1000 * DATE_CHANGE_CHECK_INTERVAL, (TIMERPROC) OnDateChangeTimer);
+ }
+
+ return 0;
+}
+
+int KillTimers()
+{
+ Log("%s", "Entering function " __FUNCTION__);
+ if (hCheckTimer)
+ {
+ KillTimer(NULL, hCheckTimer);
+ hCheckTimer = NULL;
+ }
+ if (hDateChangeTimer)
+ {
+ KillTimer(NULL, hDateChangeTimer);
+ hDateChangeTimer = NULL;
+ }
+ Log("%s", "Leaving function " __FUNCTION__);
+
+ return 0;
+}
+
+VOID CALLBACK OnCheckTimer(HWND hWnd, UINT msg, UINT_PTR idEvent, DWORD dwTime)
+{
+ Log("%s", "Entering function " __FUNCTION__);
+ CheckBirthdaysService(0, 1);
+ Log("%s", "Leaving function " __FUNCTION__);
+}
+
+VOID CALLBACK OnDateChangeTimer(HWND hWnd, UINT msg, UINT_PTR idEvent, DWORD dwTime)
+{
+ SYSTEMTIME now;
+ //Log("%s", "Entering function " __FUNCTION__);
+ GetLocalTime(&now);
+ if (currentDay != now.wDay)
+ {
+ CheckBirthdaysService(0, 1);
+ }
+ //else{
+ // RefreshAllContactListIcons();
+ //}
+ currentDay = now.wDay;
+
+ //Log("%s", "Leaving function " __FUNCTION__);
+}
+
diff --git a/plugins/WhenWasIt/WhenWasIt/hooked_events.h b/plugins/WhenWasIt/WhenWasIt/hooked_events.h
new file mode 100644
index 0000000000..8db02414ff
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/hooked_events.h
@@ -0,0 +1,50 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_WWI_HOOKED_EVENTS_H
+#define M_WWI_HOOKED_EVENTS_H
+
+#include "commonheaders.h"
+#include "dlg_handlers.h"
+
+extern HANDLE hModulesLoaded;
+extern HANDLE hOptionsInitialise;
+
+extern UINT_PTR hCheckTimer;
+extern UINT_PTR hDateChangeTimer;
+
+int HookEvents();
+int UnhookEvents();
+
+int OnModulesLoaded(WPARAM wParam, LPARAM lParam);
+int OnTopToolBarModuleLoaded(WPARAM wParam, LPARAM lParam);
+int OnOptionsInitialise(WPARAM wParam, LPARAM lParam);
+int OnIconsChanged(WPARAM wParam, LPARAM lParam);
+int OnExtraIconListRebuild(WPARAM wParam, LPARAM lParam);
+int OnExtraImageApply(WPARAM wParam, LPARAM lParam);
+int OnContactSettingChanged(WPARAM wParam, LPARAM lParam);
+
+int UpdateTimers();
+int KillTimers();
+
+VOID CALLBACK OnCheckTimer(HWND hWnd, UINT msg, UINT_PTR idEvent, DWORD dwTime);
+VOID CALLBACK OnDateChangeTimer(HWND hWnd, UINT msg, UINT_PTR idEvent, DWORD dwTime);
+
+#endif \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/icons.cpp b/plugins/WhenWasIt/WhenWasIt/icons.cpp
new file mode 100644
index 0000000000..a366f9bf2c
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons.cpp
@@ -0,0 +1,223 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "icons.h"
+
+//HICON hiDlg = NULL;
+HICON hiMainMenu = NULL;
+HICON hiCheckMenu = NULL;
+HICON hiListMenu = NULL;
+HICON hiAddBirthdayContact = NULL;
+HICON hiRefreshUserDetails = NULL;
+
+HICON hiImportBirthdays = NULL;
+HICON hiExportBirthdays = NULL;
+
+const int cDTB = 10;
+HICON hiDTB[cDTB] = {NULL};
+HICON hiDTBMore = NULL;
+
+HANDLE hClistImages[cDTB + 1];
+
+HANDLE hWWIExtraIcons = (HANDLE) -1;
+
+#define GET_DTB_ICON(index) (hiDTB[index] = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_DTB ## index)))
+
+int LoadIcons()
+{
+ //hiDlgIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_BIRTHDAYS_DLG));
+ hiCheckMenu = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_CHECK));
+ hiListMenu = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_LIST));
+ hiAddBirthdayContact = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ADD));
+ hiRefreshUserDetails = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_REFRESH_USERDETAILS));
+
+ hiImportBirthdays = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_IMPORT_BIRTHDAYS));
+ hiExportBirthdays = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_EXPORT_BIRTHDAYS));
+
+ GET_DTB_ICON(0);
+ GET_DTB_ICON(1);
+ GET_DTB_ICON(2);
+ GET_DTB_ICON(3);
+ GET_DTB_ICON(4);
+ GET_DTB_ICON(5);
+ GET_DTB_ICON(6);
+ GET_DTB_ICON(7);
+ GET_DTB_ICON(8);
+ GET_DTB_ICON(9);
+ hiDTBMore = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_DTBMORE));
+
+ AddIcons();
+ GetIcons();
+
+ if (ServiceExists(MS_EXTRAICON_REGISTER))
+ {
+ hWWIExtraIcons = ExtraIcon_Register("WhenWasIt", Translate("WhenWasIt birthday reminder"), "MenuCheck", OnExtraIconListRebuild, OnExtraImageApply);
+ }
+
+ return 0;
+}
+
+int AddIcon(HICON icon, char *name, char *description)
+{
+ SKINICONDESC sid = {0};
+ sid.cbSize = sizeof(SKINICONDESC);
+ sid.pszSection = "WhenWasIt";
+ sid.cx = sid.cy = 16;
+ sid.pszDescription = description;
+ sid.pszName = name;
+ sid.hDefaultIcon = icon;
+
+ return CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid);
+}
+
+int AddIcons()
+{
+ if (ServiceExists(MS_SKIN2_ADDICON)) //if icolib is installed
+ {
+// AddIcon(hiDlgIcon, "Dlg", "Popup and dialog ");
+ AddIcon(hiCheckMenu, "MenuCheck", "Check birthdays menu item");
+ AddIcon(hiListMenu, "MenuList", "List birthdays menu item");
+ AddIcon(hiAddBirthdayContact, "AddBirthday", "Add/change birthday");
+ AddIcon(hiRefreshUserDetails, "RefreshUserDetails", "Refresh user details");
+
+ AddIcon(hiImportBirthdays, "ImportBirthdays", "Import birthdays");
+ AddIcon(hiExportBirthdays, "ExportBirthdays", "Export birthdays");
+
+ int i;
+ char name[1024];
+ char description[1024];
+ AddIcon(hiDTB[0], "DTB0", "Birthday today");
+ AddIcon(hiDTB[1], "DTB1", "1 day to birthday");
+ for (i = 2; i < cDTB; i++)
+ {
+ sprintf(name, "DTB%d", i);
+ sprintf(description, "%d days to birthday", i);
+ AddIcon(hiDTB[i], name, description);
+ }
+ sprintf(description, "More than %d days to birthday", cDTB - 1);
+ AddIcon(hiDTBMore, "DTBMore", description);
+ }
+ return 0;
+}
+
+HICON GetIcon(char *name)
+{
+ return (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM) name);
+}
+
+void FreeIcon(HICON &icon)
+{
+ DestroyIcon(icon);
+ icon = NULL;
+}
+
+void FreeIcons()
+{
+ static int bFreed = 0;
+ if (!bFreed)
+ {
+// FreeIcon(hiDlg);
+ FreeIcon(hiCheckMenu);
+ FreeIcon(hiListMenu);
+ FreeIcon(hiAddBirthdayContact);
+ FreeIcon(hiRefreshUserDetails);
+
+ FreeIcon(hiImportBirthdays);
+ FreeIcon(hiExportBirthdays);
+
+ int i;
+ for (i = 0; i < cDTB; i++)
+ {
+ FreeIcon(hiDTB[i]);
+ }
+ FreeIcon(hiDTBMore);
+ }
+ bFreed = 1; //only free them once (ours).
+}
+
+int GetIcons()
+{
+ if (ServiceExists(MS_SKIN2_GETICON))
+ {
+ //FreeIcons();
+// hiDlgIcon = Get("Dlg");
+ hiCheckMenu = GetIcon("MenuCheck");
+ hiListMenu = GetIcon("MenuList");
+ hiAddBirthdayContact = GetIcon("AddBirthday");
+ hiRefreshUserDetails = GetIcon("RefreshUserDetails");
+
+ hiImportBirthdays = GetIcon("ImportBirthdays");
+ hiExportBirthdays = GetIcon("ExportBirthdays");
+
+ int i;
+ char buffer[1024];
+ for (i = 0; i < cDTB; i++)
+ {
+ sprintf(buffer, "DTB%d", i);
+ hiDTB[i] = GetIcon(buffer);
+ }
+ hiDTBMore = GetIcon("DTBMore");
+ }
+ return 0;
+}
+
+HICON GetDTBIcon(int dtb)
+{
+ if ((dtb >= cDTB) || (dtb < 0))
+ {
+ return hiDTBMore;
+ }
+ return hiDTB[dtb];
+}
+
+HICON GetDABIcon(int dab)
+{
+ return GetDTBIcon(dab);
+}
+
+HANDLE GetClistIcon(int dtb)
+{
+ if (dtb >= cDTB)
+ {
+ return hClistImages[cDTB];
+ }
+ return hClistImages[dtb];
+}
+
+HANDLE RebuildCListIcon(HICON icon)
+{
+ INT_PTR tmp = CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM) icon, 0);
+ if (tmp != CALLSERVICE_NOTFOUND)
+ {
+ return (HANDLE) tmp;
+ }
+ return (HANDLE) -1;
+}
+
+int RebuildAdvIconList()
+{
+ int i;
+ for (i = 0; i < cDTB; i++)
+ {
+ hClistImages[i] = RebuildCListIcon(hiDTB[i]);
+ }
+ hClistImages[cDTB] = RebuildCListIcon(hiDTBMore);
+ return 0;
+}
diff --git a/plugins/WhenWasIt/WhenWasIt/icons.h b/plugins/WhenWasIt/WhenWasIt/icons.h
new file mode 100644
index 0000000000..42095b51f7
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons.h
@@ -0,0 +1,53 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_WWI_ICONS_H
+#define M_WWI_ICONS_H
+
+#include "commonheaders.h"
+
+//extern HICON hiDlg;
+extern HICON hiMainMenu;
+extern HICON hiCheckMenu;
+extern HICON hiListMenu;
+extern HICON hiAddBirthdayContact;
+extern HICON hiRefreshUserDetails;
+
+extern HICON hiImportBirthdays;
+extern HICON hiExportBirthdays;
+
+extern HICON hiDTB[];
+extern HICON hiDTBMore;
+
+extern HANDLE hClistImages[];
+
+extern HANDLE hWWIExtraIcons;
+
+int LoadIcons();
+int AddIcons();
+int GetIcons();
+
+int RebuildAdvIconList();
+
+HICON GetDTBIcon(int dtb);
+HICON GetDABIcon(int dtb);
+HANDLE GetClistIcon(int dtb);
+
+#endif //M_WWI_ICONS_H \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/00.ico b/plugins/WhenWasIt/WhenWasIt/icons/00.ico
new file mode 100644
index 0000000000..db6ad259de
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/00.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/add.ico b/plugins/WhenWasIt/WhenWasIt/icons/add.ico
new file mode 100644
index 0000000000..503f5809f3
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/add.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/check.bmp b/plugins/WhenWasIt/WhenWasIt/icons/check.bmp
new file mode 100644
index 0000000000..cf430c8c6d
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/check.bmp
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/check.ico b/plugins/WhenWasIt/WhenWasIt/icons/check.ico
new file mode 100644
index 0000000000..6e66db6fe9
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/check.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/dlg.ico b/plugins/WhenWasIt/WhenWasIt/icons/dlg.ico
new file mode 100644
index 0000000000..68e4d3a004
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/dlg.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/dtb0.ico b/plugins/WhenWasIt/WhenWasIt/icons/dtb0.ico
new file mode 100644
index 0000000000..037c31c939
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/dtb0.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/dtb1.ico b/plugins/WhenWasIt/WhenWasIt/icons/dtb1.ico
new file mode 100644
index 0000000000..4840bbee3e
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/dtb1.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/dtb2.ico b/plugins/WhenWasIt/WhenWasIt/icons/dtb2.ico
new file mode 100644
index 0000000000..54e5fc14a3
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/dtb2.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/dtb3.ico b/plugins/WhenWasIt/WhenWasIt/icons/dtb3.ico
new file mode 100644
index 0000000000..479913ded6
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/dtb3.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/dtb4.ico b/plugins/WhenWasIt/WhenWasIt/icons/dtb4.ico
new file mode 100644
index 0000000000..f8825f5f30
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/dtb4.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/dtb5.ico b/plugins/WhenWasIt/WhenWasIt/icons/dtb5.ico
new file mode 100644
index 0000000000..beac5bac42
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/dtb5.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/dtb6.ico b/plugins/WhenWasIt/WhenWasIt/icons/dtb6.ico
new file mode 100644
index 0000000000..efb04a9f6e
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/dtb6.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/dtb7.ico b/plugins/WhenWasIt/WhenWasIt/icons/dtb7.ico
new file mode 100644
index 0000000000..87ca751736
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/dtb7.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/dtb8.ico b/plugins/WhenWasIt/WhenWasIt/icons/dtb8.ico
new file mode 100644
index 0000000000..e166704921
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/dtb8.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/dtb9.ico b/plugins/WhenWasIt/WhenWasIt/icons/dtb9.ico
new file mode 100644
index 0000000000..d7307d5527
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/dtb9.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/dtbX.ico b/plugins/WhenWasIt/WhenWasIt/icons/dtbX.ico
new file mode 100644
index 0000000000..7c0f421183
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/dtbX.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/export.ico b/plugins/WhenWasIt/WhenWasIt/icons/export.ico
new file mode 100644
index 0000000000..8a80733ef4
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/export.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/import.ico b/plugins/WhenWasIt/WhenWasIt/icons/import.ico
new file mode 100644
index 0000000000..2e2904416d
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/import.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/list.ico b/plugins/WhenWasIt/WhenWasIt/icons/list.ico
new file mode 100644
index 0000000000..00c219c6eb
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/list.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/icons/refresh.ico b/plugins/WhenWasIt/WhenWasIt/icons/refresh.ico
new file mode 100644
index 0000000000..db6ad259de
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/icons/refresh.ico
Binary files differ
diff --git a/plugins/WhenWasIt/WhenWasIt/notifiers.cpp b/plugins/WhenWasIt/WhenWasIt/notifiers.cpp
new file mode 100644
index 0000000000..654dbbbe53
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/notifiers.cpp
@@ -0,0 +1,342 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "notifiers.h"
+
+void FillPopupData(POPUPDATAT &pd, int dtb)
+{
+ //DWORD foreground = DBGetContactSettingDword(NULL, ModuleName, "Foreground", FOREGROUND_COLOR);
+ //DWORD background = DBGetContactSettingDword(NULL, ModuleName, "Background", BACKGROUND_COLOR);
+ int popupTimeout = (dtb == 0) ? commonData.popupTimeoutToday : commonData.popupTimeout;
+
+ pd.colorBack = commonData.background;
+ pd.colorText = commonData.foreground;
+ pd.iSeconds = popupTimeout;
+}
+
+int PopupNotifyNoBirthdays()
+{
+ POPUPDATAT pd = {0};
+ FillPopupData(pd, -1);
+ pd.lchIcon = GetDTBIcon(-1);
+
+ _tcscpy(pd.lptzContactName, TranslateT("WhenWasIt"));
+ _tcscpy(pd.lptzText, TranslateT("No upcoming birthdays."));
+
+
+ return PUAddPopUpT(&pd);
+}
+
+TCHAR *BuildDTBText(int dtb, TCHAR *name, TCHAR *text, int size)
+{
+ if (dtb > 1)
+ {
+ mir_sntprintf(text, size, TranslateT("%s has birthday in %d days."), name, dtb);
+ }
+ else{
+ if (dtb == 1)
+ {
+ mir_sntprintf(text, size, TranslateT("%s has birthday tomorrow."), name);
+ }
+ else{
+ mir_sntprintf(text, size, TranslateT("%s has birthday today."), name);
+ }
+ }
+
+ return text;
+}
+
+TCHAR *BuildDABText(int dab, TCHAR *name, TCHAR *text, int size)
+{
+ if (dab > 1)
+ {
+ mir_sntprintf(text, size, TranslateT("%s had birthday %d days ago."), name, dab);
+ }
+ else{
+ if (dab == 1)
+ {
+ mir_sntprintf(text, size, TranslateT("%s had birthday yesterday."), name);
+ }
+ else{
+ mir_sntprintf(text, size, TranslateT("%s has birthday today (Should not happen, please report)."), name);
+ }
+ }
+
+ return text;
+}
+
+int PopupNotifyBirthday(HANDLE hContact, int dtb, int age)
+{
+ TCHAR *name = GetContactName(hContact, NULL);
+ const int MAX_SIZE = 1024;
+ TCHAR text[MAX_SIZE];
+ //int bIgnoreSubcontacts = DBGetContactSettingByte(NULL, ModuleName, "IgnoreSubcontacts", FALSE);
+ if (commonData.bIgnoreSubcontacts)
+ {
+ HANDLE hMetacontact = (HANDLE) CallService(MS_MC_GETMETACONTACT, (WPARAM) hContact, 0);
+ if ((hMetacontact) && (hMetacontact != hContact)) //not main metacontact
+ {
+ return 0;
+ }
+ }
+ BuildDTBText(dtb, name, text, MAX_SIZE);
+ int gender = GetContactGender(hContact);
+
+ POPUPDATAT pd = {0};
+ FillPopupData(pd, dtb);
+ pd.lchContact = hContact;
+ pd.PluginWindowProc = (WNDPROC) DlgProcPopup;
+ //pd.PluginData = (void *) hContact;
+ //pd.colorBack = background;
+ //pd.colorText = foreground;
+ //pd.iSeconds = popupTimeout;
+ pd.lchIcon = GetDTBIcon(dtb);
+
+ //strcpy(pd.lpzContactName, text);
+ _stprintf(pd.lptzContactName, TranslateT("Birthday - %s"), name);
+ TCHAR *sex;
+ switch (toupper(gender))
+ {
+ case _T('M'):
+ {
+ sex = TranslateT("He");
+ break;
+ }
+ case _T('F'):
+ {
+ sex = TranslateT("She");
+ break;
+ }
+ default:
+ {
+ sex = TranslateT("He/She");
+ break;
+ }
+ }
+ if (dtb > 0)
+ {
+ _stprintf(pd.lptzText, TranslateT("%s\n%s will be %d years old."), text, sex, age);
+ }
+ else{
+ _stprintf(pd.lptzText, TranslateT("%s\n%s just turned %d."), text, sex, age);
+ }
+
+ PUAddPopUpT(&pd);
+ free(name);
+
+ return 0;
+}
+
+int PopupNotifyMissedBirthday(HANDLE hContact, int dab, int age)
+{
+ TCHAR *name = GetContactName(hContact, NULL);
+ const int MAX_SIZE = 1024;
+ TCHAR text[MAX_SIZE];
+ //int bIgnoreSubcontacts = DBGetContactSettingByte(NULL, ModuleName, "IgnoreSubcontacts", FALSE);
+ if (commonData.bIgnoreSubcontacts)
+ {
+ HANDLE hMetacontact = (HANDLE) CallService(MS_MC_GETMETACONTACT, (WPARAM) hContact, 0);
+ if ((hMetacontact) && (hMetacontact != hContact)) //not main metacontact
+ {
+ return 0;
+ }
+ }
+ BuildDABText(dab, name, text, MAX_SIZE);
+ int gender = GetContactGender(hContact);
+
+ POPUPDATAT pd = {0};
+ FillPopupData(pd, dab);
+ pd.lchContact = hContact;
+ pd.PluginWindowProc = (WNDPROC) DlgProcPopup;
+ //pd.PluginData = (void *) hContact;
+ //pd.colorBack = background;
+ //pd.colorText = foreground;
+ //pd.iSeconds = popupTimeout;
+ pd.lchIcon = GetDABIcon(dab);
+
+ //strcpy(pd.lpzContactName, text);
+ _stprintf(pd.lptzContactName, TranslateT("Birthday - %s"), name);
+ TCHAR *sex;
+ switch (toupper(gender))
+ {
+ case _T('M'):
+ {
+ sex = TranslateT("He");
+ break;
+ }
+ case _T('F'):
+ {
+ sex = TranslateT("She");
+ break;
+ }
+ default:
+ {
+ sex = TranslateT("He/She");
+ break;
+ }
+ }
+ if (dab > 0)
+ {
+ _stprintf(pd.lptzText, TranslateT("%s\n%s just turned %d."), text, sex, age);
+ }
+ else{
+ _stprintf(pd.lptzText, TranslateT("%s\n%s just turned %d."), text, sex, age);
+ }
+
+ PUAddPopUpT(&pd);
+ free(name);
+
+ return 0;
+}
+
+int ClistIconNotifyBirthday(HANDLE hContact, int dtb, int advancedIcon)
+{
+ if (ServiceExists(MS_EXTRAICON_SET_ICON))
+ {
+ ExtraIcon_SetIcon(hWWIExtraIcons, hContact, GetClistIcon(dtb));
+ }
+ else {
+ IconExtraColumn iec = {0};
+ iec.cbSize = sizeof(IconExtraColumn);
+ iec.ColumnType = advancedIcon;
+ iec.hImage = GetClistIcon(dtb);
+ CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) hContact, (LPARAM) &iec);
+ }
+
+ return 0;
+}
+
+int DialogNotifyBirthday(HANDLE hContact, int dtb, int age)
+{
+ TCHAR *name = GetContactName(hContact, NULL);
+ const int MAX_SIZE = 1024;
+ TCHAR text[MAX_SIZE];
+
+ BuildDTBText(dtb, name, text, MAX_SIZE);
+ if (!hUpcomingDlg)
+ {
+ hUpcomingDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_UPCOMING), NULL, DlgProcUpcoming);
+ ShowWindow(hUpcomingDlg, commonData.bOpenInBackground ? SW_SHOWNOACTIVATE : SW_SHOW);
+ }
+
+ TUpcomingBirthday data = {0};
+ data.name = name;
+ data.message = text;
+ data.dtb = dtb;
+ data.hContact = hContact;
+ data.age = age;
+
+ SendMessage(hUpcomingDlg, WWIM_ADD_UPCOMING_BIRTHDAY, (WPARAM) &data, NULL);
+
+ free(name);
+
+ return 0;
+}
+
+int DialogNotifyMissedBirthday(HANDLE hContact, int dab, int age)
+{
+ TCHAR *name = GetContactName(hContact, NULL);
+ const int MAX_SIZE = 1024;
+ TCHAR text[MAX_SIZE];
+
+ BuildDABText(dab, name, text, MAX_SIZE);
+ if (!hUpcomingDlg)
+ {
+ hUpcomingDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_UPCOMING), NULL, DlgProcUpcoming);
+ ShowWindow(hUpcomingDlg, commonData.bOpenInBackground ? SW_SHOWNOACTIVATE : SW_SHOW);
+ }
+
+ TUpcomingBirthday data = {0};
+ data.name = name;
+ data.message = text;
+ data.dtb = -dab;
+ data.hContact = hContact;
+ data.age = age;
+
+ SendMessage(hUpcomingDlg, WWIM_ADD_UPCOMING_BIRTHDAY, (WPARAM) &data, NULL);
+
+ free(name);
+
+ return 0;
+}
+
+int SoundNotifyBirthday(int dtb)
+{
+ //int daysToPlay = DBGetContactSettingByte(NULL, ModuleName, "SoundNearDays", BIRTHDAY_NEAR_DEFAULT_DAYS);
+ if (dtb == 0)
+ {
+ SkinPlaySound(BIRTHDAY_TODAY_SOUND);
+ }
+ else{
+ if (dtb <= commonData.cSoundNearDays)
+ {
+ SkinPlaySound(BIRTHDAY_NEAR_SOUND);
+ }
+ }
+
+ return 0;
+}
+
+int ClearClistIcon(HANDLE hContact, int advancedIcon)
+{
+ if (ServiceExists(MS_EXTRAICON_SET_ICON))
+ {
+ return ExtraIcon_SetIcon(hWWIExtraIcons, hContact, (HANDLE) -1);
+ }
+ else {
+ IconExtraColumn iec = {0};
+ iec.cbSize = sizeof(IconExtraColumn);
+ iec.ColumnType = advancedIcon;
+ iec.hImage = (HANDLE) -1;
+
+ return CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) hContact, (LPARAM) &iec);
+ }
+}
+
+int RefreshContactListIcons(HANDLE hContact)
+{
+ //if (DBGetContactSettingWord(hContact, DUMMY_MODULE, DUMMY_SETTING, 0) != 0)
+ // {
+ // DBDeleteContactSetting(hContact, DUMMY_MODULE, DUMMY_SETTING);
+ // }
+ // else{
+ // DBWriteContactSettingWord(hContact, DUMMY_MODULE, DUMMY_SETTING, 101);
+ // }
+ OnExtraImageApply((WPARAM) hContact, 0);
+
+ return 0;
+}
+
+//if oldClistIcon != -1 it will remove the old location of the clist extra icon
+//called with oldClistIcon != -1 from dlg_handlers whtn the extra icon slot changes.
+int RefreshAllContactListIcons(int oldClistIcon)
+{
+ HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ while (hContact != NULL)
+ {
+ if (oldClistIcon != -1)
+ {
+ ClearClistIcon(hContact, oldClistIcon);
+ }
+ RefreshContactListIcons(hContact); //will change bBirthdayFound if needed
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ }
+ return 0;
+} \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/notifiers.h b/plugins/WhenWasIt/WhenWasIt/notifiers.h
new file mode 100644
index 0000000000..22ddb96c8d
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/notifiers.h
@@ -0,0 +1,65 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_WWI_NOTIFIERS_H
+#define M_WWI_NOTIFIERS_H
+
+#include "commonheaders.h"
+
+#ifdef _UNICODE
+#define POPUPDATAT POPUPDATAW
+#define PUAddPopUpT PUAddPopUpW
+#else
+#define POPUPDATAT POPUPDATAEX
+#define PUAddPopUpT PUAddPopUpEx
+#endif
+
+#define BIRTHDAY_TODAY_SOUND "WWIBirthdayToday"
+#define BIRTHDAY_NEAR_SOUND "WWIBirthdayNear"
+
+#define BIRTHDAY_NEAR_DEFAULT_DAYS 3
+
+#define DUMMY_MODULE ModuleName
+#define DUMMY_SETTING "refreshIconsDummyVal"
+
+struct TUpcomingBirthday{
+ HANDLE hContact;
+ TCHAR *name;
+ TCHAR *message;
+ int dtb;
+ int age;
+};
+
+typedef TUpcomingBirthday *PUpcomingBirthday;
+
+int PopupNotifyNoBirthdays();
+int PopupNotifyBirthday(HANDLE hContact, int dtb, int age);
+int PopupNotifyMissedBirthday(HANDLE hContact, int dab, int age);
+int ClistIconNotifyBirthday(HANDLE hContact, int dtb, int advancedIcon);
+int DialogNotifyBirthday(HANDLE hContact, int dtb, int age);
+int DialogNotifyMissedBirthday(HANDLE hContact, int dab, int age);
+int SoundNotifyBirthday(int dtb);
+
+int ClearClistIcon(HANDLE hContact, int advancedIcon);
+
+int RefreshContactListIcons(HANDLE hContact);
+int RefreshAllContactListIcons(int oldClistIcon = -1);
+
+#endif //M_WWI_NOTIFIERS_H \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/resource.h b/plugins/WhenWasIt/WhenWasIt/resource.h
new file mode 100644
index 0000000000..d04aaf378f
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/resource.h
@@ -0,0 +1,81 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by WhenWasIt.rc
+//
+#define IDD_OPT_WWI 101
+#define IDI_BIRTHDAYS 102
+#define IDI_BIRTHDAYS_DLG 102
+#define IDD_BIRTHDAYS 104
+#define IDI_CHECK 106
+#define IDI_LIST 107
+#define IDI_DTB1 108
+#define IDI_DTB9 109
+#define IDI_DTB2 110
+#define IDI_DTB3 111
+#define IDI_DTB4 112
+#define IDI_DTB5 113
+#define IDI_DTB6 114
+#define IDI_DTB7 115
+#define IDI_DTB8 116
+#define IDI_DTB0 117
+#define IDI_DTBMORE 118
+#define IDD_ADD_BIRTHDAY 119
+#define IDI_ICON1 120
+#define IDI_ADD 120
+#define IDB_TTB_CHECK 122
+#define IDI_REFRESH_USERDETAILS 123
+#define IDI_IMPORT 125
+#define IDI_IMPORT_BIRTHDAYS 125
+#define IDI_EXPORT_BIRTHDAYS 126
+#define IDD_ADD_ANNIVERSARY 127
+#define IDD_UPCOMING 128
+#define IDC_USE_POPUPS 1002
+#define IDC_USE_CLISTICON 1003
+#define IDC_USE_DIALOG 1004
+#define IDC_DAYS_IN_ADVANCE 1005
+#define IDC_ADVANCED_ICON 1008
+#define IDC_CHECK_INTERVAL 1009
+#define IDC_POPUP_TIMEOUT 1010
+#define IDC_POPUPS_STATIC 1011
+#define IDC_CLIST_STATIC 1012
+#define IDC_BACKGROUND 1014
+#define IDC_FOREGROUND 1015
+#define IDC_CLOSE 1015
+#define IDC_BIRTHDAYS_LIST 1016
+#define IDC_SHOW_ALL 1017
+#define IDC_DATE 1020
+#define IDC_MBIRTHDAY_COMPATIBILITY 1021
+#define IDC_IGNORE_SUBCONTACTS 1023
+#define IDC_AGE_COMBOBOX 1025
+#define IDC_NOBIRTHDAYS_POPUP 1026
+#define IDC_COMPATIBILITY 1027
+#define IDC_SOUND_NEAR_DAYS_EDIT 1028
+#define IDC_DEFAULT_MODULE 1029
+#define IDC_PREVIEW 1030
+#define IDC_LEFT_CLICK 1031
+#define IDC_RIGHT_CLICK 1032
+#define IDC_ONCE_PER_DAY 1033
+#define IDC_TITLE 1036
+#define IDC_DESCRIPTION 1037
+#define IDC_DELETE 1038
+#define IDC_SAVE 1039
+#define IDC_ANNIVERSARY 1040
+#define IDC_EDIT1 1042
+#define IDC_DLG_TIMEOUT 1042
+#define IDC_UPCOMING_LIST 1043
+#define IDC_DIALOG_STATIC 1044
+#define IDC_NOTIFYFOR 1045
+#define IDC_DAYS_AFTER 1046
+#define IDC_NOFOCUS 1047
+#define IDC_OPENINBACKGROUND 1047
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 129
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1048
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/plugins/WhenWasIt/WhenWasIt/sdk/m_extraicons.h b/plugins/WhenWasIt/WhenWasIt/sdk/m_extraicons.h
new file mode 100644
index 0000000000..1f94a3660d
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/sdk/m_extraicons.h
@@ -0,0 +1,182 @@
+/*
+ Copyright (C) 2009 Ricardo Pescuma Domenecci
+
+ This is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this file; see the file license.txt. If
+ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __M_EXTRAICONS_H__
+#define __M_EXTRAICONS_H__
+
+
+/*
+
+There is 2 ways of registering with Extra Icons service:
+
+1. Using callbacks
+ This works similar to clist API. When you register you provide 2 callbacks, one to rebuild the icons
+and one to apply the icons for a contact.
+ In the RebuildIcons callback, all icons that will be used have to be registered calling
+MS_CLIST_EXTRA_ADD_ICON service. The value returned by this service has to be stored and used in the
+apply icons.
+ The ApplyIcons callback will be called for all the needed contacts. Inside it, you must call
+MS_EXTRAICON_SET_ICON to set the icon for the contact, sending the value returned by MS_CLIST_EXTRA_ADD_ICON
+as the hImage.
+
+2. Using icolib
+ In this case no callback is needed and the plugin just need to call MS_EXTRAICON_SET_ICON passing the
+icolib name in icoName when needed. If your plugin can have extra icons on startup, remember to do a loop
+over all contacts to set the initial icon.
+
+
+To register a new extra icon, you have to call MS_EXTRAICON_REGISTER passing the needed atributes.
+
+*/
+
+#define MIID_EXTRAICONSSERVICE { 0x62d80749, 0xf169, 0x4592, { 0xb4, 0x4d, 0x3d, 0xd6, 0xde, 0x9d, 0x50, 0xc5 } }
+
+
+#define EXTRAICON_TYPE_CALLBACK 0 // Similar to old clist callbacks, it fires 2 notifications
+#define EXTRAICON_TYPE_ICOLIB 1 // This extra icon will use only icons registered with icolib. No callbacks
+ // needed. Just call MS_EXTRAICON_SET_ICON passing the name of the extraicon to set one.
+
+
+typedef struct {
+ int cbSize;
+ int type; // One of EXTRAICON_TYPE_*
+ const char *name; // Internal name. More than one plugin can register extra icons with the same name
+ // if both have the same type. In this case, both will be handled as one.
+ // If the types are different the second one will be denied.
+ const char *description; // [Translated by plugin] Description to be used in GUI
+ const char *descIcon; // [Optional] Name of an icon registered with icolib to be used in GUI.
+
+ // If type == EXTRAICON_TYPE_CALLBACK this two must be set
+
+ // Callback to add icons to clist, calling MS_CLIST_EXTRA_ADD_ICON
+ // wParam=lParam=0
+ MIRANDAHOOK RebuildIcons;
+
+ // Callback to set the icon to clist, calling MS_CLIST_EXTRA_SET_ICON or MS_EXTRAICON_SET_ICON
+ // wParam = HANDLE hContact
+ // lParam = 0
+ MIRANDAHOOK ApplyIcon;
+
+ // Other optional callbacks
+
+ // [Optional] Callback called when extra icon was clicked
+ // wParam = HANDLE hContact
+ // lParam = int slot
+ // param = onClickParam
+ MIRANDAHOOKPARAM OnClick;
+
+ LPARAM onClickParam;
+
+} EXTRAICON_INFO;
+
+
+// Register an extra icon
+// wParam = (EXTRAICON_INFO *) Extra icon info
+// lParam = 0
+// Return: (HANDLE) id of extra icon on success, 0 on error
+#define MS_EXTRAICON_REGISTER "ExtraIcon/Register"
+
+
+typedef struct {
+ int cbSize;
+ HANDLE hExtraIcon; // Value returned by MS_EXTRAICON_REGISTER
+ HANDLE hContact; // Contact to set the extra icon
+ union { // The icon to be set. This depends on the type of the extra icon:
+ HANDLE hImage; // Value returned by MS_CLIST_EXTRA_ADD_ICON (if EXTRAICON_TYPE_CALLBACK)
+ const char *icoName; // Name of the icon registered with icolib (if EXTRAICON_TYPE_ICOLIB)
+ };
+} EXTRAICON;
+
+// Set an extra icon icon
+// wParam = (EXTRAICON *) Extra icon
+// Return: 0 on success
+#define MS_EXTRAICON_SET_ICON "ExtraIcon/SetIcon"
+
+
+
+#ifndef _NO_WRAPPERS
+#ifdef __cplusplus
+
+static HANDLE ExtraIcon_Register(const char *name, const char *description, const char *descIcon,
+ MIRANDAHOOK RebuildIcons,
+ MIRANDAHOOK ApplyIcon,
+ MIRANDAHOOKPARAM OnClick = NULL, LPARAM onClickParam = 0)
+{
+ if (!ServiceExists(MS_EXTRAICON_REGISTER))
+ return NULL;
+
+ EXTRAICON_INFO ei = {0};
+ ei.cbSize = sizeof(ei);
+ ei.type = EXTRAICON_TYPE_CALLBACK;
+ ei.name = name;
+ ei.description = description;
+ ei.descIcon = descIcon;
+ ei.RebuildIcons = RebuildIcons;
+ ei.ApplyIcon = ApplyIcon;
+ ei.OnClick = OnClick;
+ ei.onClickParam = onClickParam;
+
+ return (HANDLE) CallService(MS_EXTRAICON_REGISTER, (WPARAM) &ei, 0);
+}
+
+static HANDLE ExtraIcon_Register(const char *name, const char *description, const char *descIcon = NULL,
+ MIRANDAHOOKPARAM OnClick = NULL, LPARAM onClickParam = 0)
+{
+ if (!ServiceExists(MS_EXTRAICON_REGISTER))
+ return NULL;
+
+ EXTRAICON_INFO ei = {0};
+ ei.cbSize = sizeof(ei);
+ ei.type = EXTRAICON_TYPE_ICOLIB;
+ ei.name = name;
+ ei.description = description;
+ ei.descIcon = descIcon;
+ ei.OnClick = OnClick;
+ ei.onClickParam = onClickParam;
+
+ return (HANDLE) CallService(MS_EXTRAICON_REGISTER, (WPARAM) &ei, 0);
+}
+
+static int ExtraIcon_SetIcon(HANDLE hExtraIcon, HANDLE hContact, HANDLE hImage)
+{
+ EXTRAICON ei = {0};
+ ei.cbSize = sizeof(ei);
+ ei.hExtraIcon = hExtraIcon;
+ ei.hContact = hContact;
+ ei.hImage = hImage;
+
+ return CallService(MS_EXTRAICON_SET_ICON, (WPARAM) &ei, 0);
+}
+
+static int ExtraIcon_SetIcon(HANDLE hExtraIcon, HANDLE hContact, const char *icoName)
+{
+ EXTRAICON ei = {0};
+ ei.cbSize = sizeof(ei);
+ ei.hExtraIcon = hExtraIcon;
+ ei.hContact = hContact;
+ ei.icoName = icoName;
+
+ return CallService(MS_EXTRAICON_SET_ICON, (WPARAM) &ei, 0);
+}
+
+#endif
+#endif
+
+
+#endif // __M_EXTRAICONS_H__ \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/sdk/m_metacontacts.h b/plugins/WhenWasIt/WhenWasIt/sdk/m_metacontacts.h
new file mode 100644
index 0000000000..1da12b97fa
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/sdk/m_metacontacts.h
@@ -0,0 +1,162 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright © 2004 Universite Louis PASTEUR, STRASBOURG.
+Copyright © 2004 Scott Ellis (www.scottellis.com.au mail@scottellis.com.au)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_METACONTACTS_H__
+#define M_METACONTACTS_H__ 1
+
+//get the handle for a contact's parent metacontact
+//wParam=(HANDLE)hSubContact
+//lParam=0
+//returns a handle to the parent metacontact, or null if this contact is not a subcontact
+#define MS_MC_GETMETACONTACT "MetaContacts/GetMeta"
+
+//gets the handle for the default contact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a handle to the default contact, or null on failure
+#define MS_MC_GETDEFAULTCONTACT "MetaContacts/GetDefault"
+
+//gets the contact number for the default contact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a DWORD contact number, or -1 on failure
+#define MS_MC_GETDEFAULTCONTACTNUM "MetaContacts/GetDefaultNum"
+
+//gets the handle for the 'most online' contact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a handle to the 'most online' contact
+#define MS_MC_GETMOSTONLINECONTACT "MetaContacts/GetMostOnline"
+
+//gets the number of subcontacts for a metacontact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a DWORD representing the number of subcontacts for the given metacontact
+#define MS_MC_GETNUMCONTACTS "MetaContacts/GetNumContacts"
+
+//gets the handle of a subcontact, using the subcontact's number
+//wParam=(HANDLE)hMetaContact
+//lParam=(DWORD)contact number
+//returns a handle to the specified subcontact
+#define MS_MC_GETSUBCONTACT "MetaContacts/GetSubContact"
+
+//sets the default contact, using the subcontact's contact number
+//wParam=(HANDLE)hMetaContact
+//lParam=(DWORD)contact number
+//returns 0 on success
+#define MS_MC_SETDEFAULTCONTACTNUM "MetaContacts/SetDefault"
+
+//sets the default contact, using the subcontact's handle
+//wParam=(HANDLE)hMetaContact
+//lParam=(HANDLE)hSubcontact
+//returns 0 on success
+#define MS_MC_SETDEFAULTCONTACT "MetaContacts/SetDefaultByHandle"
+
+//forces the metacontact to send using a specific subcontact, using the subcontact's contact number
+//wParam=(HANDLE)hMetaContact
+//lParam=(DWORD)contact number
+//returns 0 on success
+#define MS_MC_FORCESENDCONTACTNUM "MetaContacts/ForceSendContact"
+
+//forces the metacontact to send using a specific subcontact, using the subcontact's handle
+//wParam=(HANDLE)hMetaContact
+//lParam=(HANDLE)hSubcontact
+//returns 0 on success (will fail if 'force default' is in effect)
+#define MS_MC_FORCESENDCONTACT "MetaContacts/ForceSendContactByHandle"
+
+//'unforces' the metacontact to send using a specific subcontact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns 0 on success (will fail if 'force default' is in effect)
+#define MS_MC_UNFORCESENDCONTACT "MetaContacts/UnforceSendContact"
+
+//'forces' or 'unforces' (i.e. toggles) the metacontact to send using it's default contact
+// overrides (and clears) 'force send' above, and will even force use of offline contacts
+// will send ME_MC_FORCESEND or ME_MC_UNFORCESEND event
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns 1(true) or 0(false) representing new state of 'force default'
+#define MS_MC_FORCEDEFAULT "MetaContacts/ForceSendDefault"
+
+// method to get state of 'force' for a metacontact
+// wParam=(HANDLE)hMetaContact
+// lParam= (DWORD)&contact_number or NULL
+//
+// if lparam supplied, the contact_number of the contatct 'in force' will be copied to the address it points to,
+// or if none is in force, the value (DWORD)-1 will be copied
+// (v0.8.0.8+ returns 1 if 'force default' is true with *lParam == default contact number, else returns 0 with *lParam as above)
+#define MS_MC_GETFORCESTATE "MetaContacts/GetForceState"
+
+// fired when a metacontact's default contact changes (fired upon creation of metacontact also, when default is initially set)
+// wParam=(HANDLE)hMetaContact
+// lParam=(HANDLE)hDefaultContact
+#define ME_MC_DEFAULTTCHANGED "MetaContacts/DefaultChanged"
+
+// fired when a metacontact's subcontacts change (fired upon creation of metacontact, when contacts are added or removed, and when
+// contacts are reordered) - a signal to re-read metacontact data
+// wParam=(HANDLE)hMetaContact
+// lParam=0
+#define ME_MC_SUBCONTACTSCHANGED "MetaContacts/SubcontactsChanged"
+
+// fired when a metacontact is forced to send using a specific subcontact
+// wParam=(HANDLE)hMetaContact
+// lParam=(HANDLE)hForceContact
+#define ME_MC_FORCESEND "MetaContacts/ForceSend"
+
+// fired when a metacontact is 'unforced' to send using a specific subcontact
+// wParam=(HANDLE)hMetaContact
+// lParam=0
+#define ME_MC_UNFORCESEND "MetaContacts/UnforceSend"
+
+// method to get protocol name - used to be sure you're dealing with a "real" metacontacts plugin :)
+// wParam=lParam=0
+#define MS_MC_GETPROTOCOLNAME "MetaContacts/GetProtoName"
+
+
+// added 0.9.5.0 (22/3/05)
+// wParam=(HANDLE)hContact
+// lParam=0
+// convert a given contact into a metacontact
+#define MS_MC_CONVERTTOMETA "MetaContacts/ConvertToMetacontact"
+
+// added 0.9.5.0 (22/3/05)
+// wParam=(HANDLE)hContact
+// lParam=(HANDLE)hMeta
+// add an existing contact to a metacontact
+#define MS_MC_ADDTOMETA "MetaContacts/AddToMetacontact"
+
+// added 0.9.5.0 (22/3/05)
+// wParam=0
+// lParam=(HANDLE)hContact
+// remove a contact from a metacontact
+#define MS_MC_REMOVEFROMMETA "MetaContacts/RemoveFromMetacontact"
+
+
+// added 0.9.13.2 (6/10/05)
+// wParam=(BOOL)disable
+// lParam=0
+// enable/disable the 'hidden group hack' - for clists that support subcontact hiding using 'IsSubcontact' setting
+// should be called once in the clist 'onmodulesloaded' event handler (which, since it's loaded after the db, will be called
+// before the metacontact onmodulesloaded handler where the subcontact hiding is usually done)
+#define MS_MC_DISABLEHIDDENGROUP "MetaContacts/DisableHiddenGroup"
+
+#endif
diff --git a/plugins/WhenWasIt/WhenWasIt/sdk/m_popup.h b/plugins/WhenWasIt/WhenWasIt/sdk/m_popup.h
new file mode 100644
index 0000000000..419f2bd396
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/sdk/m_popup.h
@@ -0,0 +1,424 @@
+/*
+===============================================================================
+ PopUp plugin
+Plugin Name: PopUp
+Plugin authors: Luca Santarelli aka hrk (hrk@users.sourceforge.net)
+ Victor Pavlychko aka zazoo (nullbie@gmail.com)
+===============================================================================
+The purpose of this plugin is to give developers a common "platform/interface"
+to show PopUps. It is born from the source code of NewStatusNotify, another
+plugin I've made.
+
+Remember that users *must* have this plugin enabled, or they won't get any
+popup. Write this in the requirements, do whatever you wish ;-)... but tell
+them!
+===============================================================================
+*/
+
+#ifndef M_POPUP_H
+#define M_POPUP_H
+
+/*
+NOTE! Since Popup 1.0.1.2 there is a main meun group called "PopUps" where I
+have put a "Enable/Disable" item. You can add your own "enable/disable" items
+by adding these lines before you call MS_CLIST_ADDMAINMENUITEM:
+mi.pszPopUpName = Translate("PopUps");
+mi.position = 0; //You don't need it and it's better if you put it to zero.
+*/
+
+#define MAX_CONTACTNAME 2048
+#define MAX_SECONDLINE 2048
+
+// This is the basic data you'll need to fill and pass to the service function.
+typedef struct
+{
+ HANDLE lchContact; // Handle to the contact, can be NULL (main contact).
+ HICON lchIcon; // Handle to a icon to be shown. Cannot be NULL.
+ union
+ {
+ char lptzContactName[MAX_CONTACTNAME]; // This is the contact name or the first line in the plugin. Cannot be NULL.
+ char lpzContactName[MAX_CONTACTNAME];
+ };
+ union
+ {
+ char lptzText[MAX_SECONDLINE]; // This is the second line text. Users can choose to hide it. Cannot be NULL.
+ char lpzText[MAX_SECONDLINE];
+ };
+ COLORREF colorBack; // COLORREF to be used for the background. Can be NULL, default will be used.
+ COLORREF colorText; // COLORREF to be used for the text. Can be NULL, default will be used.
+ WNDPROC PluginWindowProc; // Read below. Can be NULL; default will be used.
+ void * PluginData; // Read below. Can be NULL.
+} POPUPDATA, * LPPOPUPDATA;
+
+// Extended popup data
+typedef struct
+{
+ HANDLE lchContact;
+ HICON lchIcon;
+ union
+ {
+ char lptzContactName[MAX_CONTACTNAME];
+ char lpzContactName[MAX_CONTACTNAME];
+ };
+ union
+ {
+ char lptzText[MAX_SECONDLINE];
+ char lpzText[MAX_SECONDLINE];
+ };
+ COLORREF colorBack;
+ COLORREF colorText;
+ WNDPROC PluginWindowProc;
+ void * PluginData;
+ int iSeconds; // Custom delay time in seconds. -1 means "forever", 0 means "default time".
+ char cZero[16]; // Some unused bytes which may come useful in the future.
+} POPUPDATAEX, *LPPOPUPDATAEX;
+
+// Unicode version of POPUPDATAEX
+typedef struct
+{
+ HANDLE lchContact;
+ HICON lchIcon;
+ union
+ {
+ WCHAR lptzContactName[MAX_CONTACTNAME];
+ WCHAR lpwzContactName[MAX_CONTACTNAME];
+ };
+ union
+ {
+ WCHAR lptzText[MAX_SECONDLINE];
+ WCHAR lpwzText[MAX_SECONDLINE];
+ };
+ COLORREF colorBack;
+ COLORREF colorText;
+ WNDPROC PluginWindowProc;
+ void * PluginData;
+ int iSeconds;
+ char cZero[16];
+} POPUPDATAW, *LPPOPUPDATAW;
+
+#if defined(_UNICODE) || defined(UNICODE)
+ typedef POPUPDATAW POPUPDATAT;
+ typedef LPPOPUPDATAW LPPOPUPDATAT;
+#else
+ typedef POPUPDATAEX POPUPDATAT;
+ typedef LPPOPUPDATAEX LPPOPUPDATAT;
+#endif
+
+/* PopUp/AddPopup
+Creates, adds and shows a popup, given a (valid) POPUPDATA structure pointer.
+
+wParam = (WPARAM)(*POPUPDATA)PopUpDataAddress
+lParam = 0
+
+Returns: > 0 on success, 0 if creation went bad, -1 if the PopUpData contained unacceptable values.
+NOTE: it returns -1 if the PopUpData was not valid, if there were already too many popups, if the module was disabled.
+Otherwise, it can return anything else...
+
+Popup Plus 2.0.4.0+
+You may pass additional creation flags via lParam:
+ APF_RETURN_HWND ....... function returns handle to newly created popup window (however this calls are a bit slower)
+ APF_CUSTOM_POPUP ...... new popup is created in hidden state and doesn't obey to popup queue rules.
+ you may control it via UM_* messages and custom window procedure
+*/
+#define APF_RETURN_HWND 0x1
+#define APF_CUSTOM_POPUP 0x2
+
+#define MS_POPUP_ADDPOPUP "PopUp/AddPopUp"
+static INT_PTR __inline PUAddPopUp(POPUPDATA* ppdp) {
+ return CallService(MS_POPUP_ADDPOPUP, (WPARAM)ppdp,0);
+}
+
+#define MS_POPUP_ADDPOPUPEX "PopUp/AddPopUpEx"
+static INT_PTR __inline PUAddPopUpEx(POPUPDATAEX* ppdp) {
+ return CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)ppdp,0);
+}
+
+#define MS_POPUP_ADDPOPUPW "PopUp/AddPopUpW"
+static INT_PTR __inline PUAddPopUpW(POPUPDATAW* ppdp) {
+ return CallService(MS_POPUP_ADDPOPUPW, (WPARAM)ppdp,0);
+}
+
+#if defined(_UNICODE) || defined(UNICODE)
+ #define MS_POPUP_ADDPOPUPT MS_POPUP_ADDPOPUPW
+ #define PUAddPopUpT PUAddPopUpW
+#else
+ #define MS_POPUP_ADDPOPUPT MS_POPUP_ADDPOPUPEX
+ #define PUAddPopUpT PUAddPopUpEx
+#endif
+
+
+/* PopUp/GetContact
+Returns the handle to the contact associated to the specified PopUpWindow.
+
+wParam = (WPARAM)(HWND)hPopUpWindow
+lParam = 0;
+
+Returns: the HANDLE of the contact. Can return NULL, meaning it's the main contact. -1 means failure.
+*/
+#define MS_POPUP_GETCONTACT "PopUp/GetContact"
+static HANDLE __inline PUGetContact(HWND hPopUpWindow) {
+ return (HANDLE)CallService(MS_POPUP_GETCONTACT, (WPARAM)hPopUpWindow,0);
+}
+
+/* PopUp/GetPluginData
+Returns custom plugin date associated with popup
+
+wParam = (WPARAM)(HWND)hPopUpWindow
+lParam = (LPARAM)(PLUGINDATA*)PluginDataAddress;
+
+Returns: the address of the PLUGINDATA structure. Can return NULL, meaning nothing was given. -1 means failure.
+
+IMPORTANT NOTE: it doesn't seem to work if you do:
+CallService(..., (LPARAM)aPointerToAStruct);
+and then use that struct.
+Do this, instead:
+aPointerToStruct = CallService(..., (LPARAM)aPointerToAStruct);
+and it will work. Just look at the example I've written above (PopUpDlgProc).
+
+*/
+#define MS_POPUP_GETPLUGINDATA "PopUp/GetPluginData"
+static void __inline * PUGetPluginData(HWND hPopUpWindow) {
+ long * uselessPointer = NULL;
+ return (void*)CallService(MS_POPUP_GETPLUGINDATA,(WPARAM)hPopUpWindow,(LPARAM)uselessPointer);
+}
+
+/* PopUp/IsSecondLineShown
+Checks if second line is enable
+
+wParam = 0
+lParam = 0
+
+Returns: 0 if the user has chosen not to have the second line, 1 if he choose to have the second line.
+*/
+#define MS_POPUP_ISSECONDLINESHOWN "PopUp/IsSecondLineShown"
+static BOOL __inline PUIsSecondLineShown() {
+ return (BOOL)CallService(MS_POPUP_ISSECONDLINESHOWN,0,0);
+}
+
+/* PopUp/Query
+
+Requests an action or an answer from PopUp module.
+
+wParam = (WPARAM)wpQuery
+
+returns 0 on success, -1 on error, 1 on stupid calls ;-)
+*/
+
+#define PUQS_ENABLEPOPUPS 1 // returns 0 if state was changed, 1 if state wasn't changed
+#define PUQS_DISABLEPOPUPS 2 // " "
+#define PUQS_GETSTATUS 3 //Returns 1 (TRUE) if popups are enabled, 0 (FALSE) if popups are disabled.
+
+#define MS_POPUP_QUERY "PopUp/Query"
+
+/* UM_FREEPLUGINDATA
+Process this message if you have allocated your own memory. (i.e.: POPUPDATA.PluginData != NULL)
+
+wParam = 0
+lParam = 0
+*/
+#define UM_FREEPLUGINDATA (WM_USER + 0x0200)
+
+/* UM_DESTROYPOPUP
+Send this message when you want to destroy the popup, or use the function below.
+
+wParam = 0
+lParam = 0
+*/
+#define UM_DESTROYPOPUP (WM_USER + 0x0201)
+static int __inline PUDeletePopUp(HWND hWndPopUp) {
+ return (int)SendMessage(hWndPopUp, UM_DESTROYPOPUP,0,0);
+}
+
+/* UM_INITPOPUP
+This message is sent to the PopUp when its creation has been finished, so POPUPDATA (and thus your PluginData) is reachable.
+Catch it if you needed to catch WM_CREATE or WM_INITDIALOG, which you'll never ever get in your entire popup-life.
+Return value: if you process this message, return 0. If you don't process it, return 0. Do whatever you like ;-)
+
+wParam = (WPARAM)(HWND)hPopUpWindow (this is useless, you get message inside your popup window)
+lParam = 0
+*/
+#define UM_INITPOPUP (WM_USER + 0x0202)
+
+/* PopUp/Changetext
+Changes the text displayed in the second line of the popup.
+
+wParam = (WPARAM)(HWND)hPopUpWindow
+lParam = (LPARAM)(char*)lpzNewText
+
+returns: > 0 for success, -1 for failure, 0 if the failure is due to second line not being shown. (but you could call
+PUIsSecondLineShown() before changing the text...)
+*/
+#define MS_POPUP_CHANGETEXT "PopUp/Changetext"
+static int __inline PUChangeText(HWND hWndPopUp, LPCTSTR lpzNewText) {
+ return (int)CallService(MS_POPUP_CHANGETEXT, (WPARAM)hWndPopUp, (LPARAM)lpzNewText);
+}
+
+#define MS_POPUP_CHANGETEXTW "PopUp/ChangetextW"
+static int __inline PUChangeTextW(HWND hWndPopUp, LPCWSTR lpwzNewText) {
+ return (int)CallService(MS_POPUP_CHANGETEXTW, (WPARAM)hWndPopUp, (LPARAM)lpwzNewText);
+}
+
+#if defined(_UNICODE) || defined(UNICODE)
+ #define MS_POPUP_CHANGETEXTT MS_POPUP_CHANGETEXTW
+ #define PUChangeTextT PUChangeTextW
+#else
+ #define MS_POPUP_CHANGETEXTT MS_POPUP_CHANGETEXT
+ #define PUChangeTextT PUChangeText
+#endif
+
+/* PopUp/Change
+Changes the entire popup
+
+wParam = (WPARAM)(HWND)hPopUpWindow
+lParam = (LPARAM)(POPUPDATAEX*)newData
+*/
+#define MS_POPUP_CHANGE "PopUp/Change"
+static int __inline PUChange(HWND hWndPopUp, POPUPDATAEX *newData) {
+ return (int)CallService(MS_POPUP_CHANGE, (WPARAM)hWndPopUp, (LPARAM)newData);
+}
+
+#define MS_POPUP_CHANGEW "PopUp/ChangeW"
+static int __inline PUChangeW(HWND hWndPopUp, POPUPDATAW *newData) {
+ return (int)CallService(MS_POPUP_CHANGE, (WPARAM)hWndPopUp, (LPARAM)newData);
+}
+
+#if defined(_UNICODE) || defined(UNICODE)
+ #define MS_POPUP_CHANGET MS_POPUP_CHANGEW
+ #define PUChangeT PUChangeW
+#else
+ #define MS_POPUP_CHANGET MS_POPUP_CHANGE
+ #define PUChangeT PUChange
+#endif
+
+/* UM_CHANGEPOPUP
+This message is triggered by Change/ChangeText services. You also may post it directly :)
+
+wParam = Modification type
+lParam = value of type defined by wParam
+*/
+
+#define CPT_TEXT 1 // lParam = (char *)text
+#define CPT_TEXTW 2 // lParam = (WCHAR *)text
+#define CPT_TITLE 3 // lParam = (char *)title
+#define CPT_TITLEW 4 // lParam = (WCHAR *)title
+#define CPT_DATA 5 // lParam = (POPUPDATA *)data
+#define CPT_DATAEX 6 // lParam = (POPUPDATAEX *)data
+#define CPT_DATAW 7 // lParam = (POPUPDATAW *)data
+
+#define UM_CHANGEPOPUP (WM_USER + 0x0203)
+
+#if defined(_UNICODE) || defined(UNICODE)
+ #define CPT_TEXTT CPT_TEXTW
+ #define CPT_TITLET CPT_TITLEW
+ #define CPT_DATAT CPT_DATAW
+#else
+ #define CPT_TEXTT CPT_TEXT
+ #define CPT_TITLET CPT_TITLE
+ #define CPT_DATAT CPT_DATA
+#endif
+
+/* PopUp/ShowMessage
+This is mainly for developers.
+Shows a warning message in a PopUp. It's useful if you need a "MessageBox" like function, but you don't want a modal
+window (which will interfere with a DialogProcedure. MessageBox steals focus and control, this one not.
+
+wParam = (char *)lpzMessage
+lParam = 0;
+
+Returns: 0 if the popup was shown, -1 in case of failure.
+*/
+#define SM_WARNING 0x01 //Triangle icon.
+#define SM_NOTIFY 0x02 //Exclamation mark icon.
+#define MS_POPUP_SHOWMESSAGE "PopUp/ShowMessage"
+#define MS_POPUP_SHOWMESSAGEW "PopUp/ShowMessageW"
+
+static int __inline PUShowMessage(char *lpzText, BYTE kind) {
+ return (int)CallService(MS_POPUP_SHOWMESSAGE, (WPARAM)lpzText,(LPARAM)kind);
+}
+
+static int __inline PUShowMessageW(wchar_t *lpwzText, BYTE kind) {
+ return (int)CallService(MS_POPUP_SHOWMESSAGEW, (WPARAM)lpwzText,(LPARAM)kind);
+}
+
+#ifdef _UNICODE
+#define PUShowMessageT PUShowMessageW
+#else
+#define PUShowMessageT PUShowMessage
+#endif
+
+//------------- Class API ----------------//
+
+typedef struct {
+ int cbSize;
+ int flags;
+ char *pszName;
+ union {
+ char *pszDescription;
+ wchar_t *pwszDescription;
+ TCHAR *ptszDescription;
+ };
+
+ HICON hIcon;
+
+ COLORREF colorBack;
+ COLORREF colorText;
+
+ WNDPROC PluginWindowProc;
+
+ int iSeconds;
+} POPUPCLASS;
+
+#define PCF_UNICODE 0x0001
+
+#ifdef _UNICODE
+#define PCF_TCHAR PCF_UNICODE
+#else
+#define PCF_TCHAR 0
+#endif
+
+// wParam = 0
+// lParam = (POPUPCLASS *)&pc
+#define MS_POPUP_REGISTERCLASS "PopUp/RegisterClass"
+
+typedef struct {
+ int cbSize;
+ char *pszClassName;
+ union {
+ const char *pszTitle;
+ const wchar_t *pwszTitle;
+ const TCHAR *ptszTitle;
+ };
+ union {
+ const char *pszText;
+ const wchar_t *pwszText;
+ const TCHAR *ptszText;
+ };
+ void *PluginData;
+ HANDLE hContact;
+} POPUPDATACLASS;
+
+// wParam = 0
+// lParam = (POPUPDATACLASS *)&pdc
+#define MS_POPUP_ADDPOPUPCLASS "PopUp/AddPopupClass"
+
+static INT_PTR __inline ShowClassPopup(char *name, char *title, char *text) {
+ POPUPDATACLASS d = {sizeof(d), name};
+ d.pszTitle = title;
+ d.pszText = text;
+ return CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&d);
+}
+
+static INT_PTR __inline ShowClassPopupW(char *name, wchar_t *title, wchar_t *text) {
+ POPUPDATACLASS d = {sizeof(d), name};
+ d.pwszTitle = title;
+ d.pwszText = text;
+ return CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&d);
+}
+
+#ifdef _UNICODE
+#define ShowClassPopupT ShowClassPopupW
+#else
+#define ShowClassPopupT ShowClassPopup
+#endif
+
+#endif // __m_popup_h__
diff --git a/plugins/WhenWasIt/WhenWasIt/sdk/m_toptoolbar.h b/plugins/WhenWasIt/WhenWasIt/sdk/m_toptoolbar.h
new file mode 100644
index 0000000000..5628f68de8
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/sdk/m_toptoolbar.h
@@ -0,0 +1,125 @@
+
+#ifndef M_TOPTOOLBAR_H
+#define M_TOPTOOLBAR_H
+
+//button flags
+#define TTBBF_DISABLED 1
+#define TTBBF_VISIBLE 2
+#define TTBBF_PUSHED 4
+#define TTBBF_SHOWTOOLTIP 8
+#define TTBBF_DRAWBORDER 16//draw border for bitmap,bitmap must be WxH 16x12
+#define TTBBF_ISSEPARATOR 32
+
+//for internal launch buttons
+#define TTBBF_ISLBUTTON 64
+
+typedef struct {
+ int cbSize;
+ HBITMAP hbBitmapUp;
+ HBITMAP hbBitmapDown;
+ char *pszServiceUp;
+ char *pszServiceDown;
+ DWORD dwFlags;
+ LPARAM lParamUp;
+ WPARAM wParamUp;
+ LPARAM lParamDown;
+ WPARAM wParamDown;
+ char *name;
+
+} TTBButton, * lpTTBButton;
+
+typedef struct {
+ int cbSize;
+ HBITMAP hbBitmapUp;
+ HBITMAP hbBitmapDown;
+ char *pszServiceUp;
+ char *pszServiceDown;
+ DWORD dwFlags;
+ LPARAM lParamUp;
+ WPARAM wParamUp;
+ LPARAM lParamDown;
+ WPARAM wParamDown;
+ char *name;
+ HICON hIconUp,hIconDn;
+ char *tooltipUp;
+ char *tooltipDn;
+
+} TTBButtonV2, * lpTTBButtonV2;
+
+//=== EVENTS ===
+/*
+toptoolbar/moduleloaded event
+wParam = lParam = 0
+Called when the toolbar services are available
+
+!!!Warning you may work with TTB services only in this event or later.
+
+*/
+#define ME_TTB_MODULELOADED "TopToolBar/ModuleLoaded"
+
+
+
+//=== SERVICES ===
+/*
+toptoolbar/addbutton service
+wparam = (TTBButton*)lpTTBButton
+lparam = 0
+returns: hTTBButton - handle of added button on success, -1 on failure.
+*/
+#define MS_TTB_ADDBUTTON "TopToolBar/AddButton"
+
+/*
+toptoolbar/removebutton service
+wparam = (HANDLE)hTTButton
+lparam = 0
+returns: 0 on success, -1 on failure.
+*/
+#define MS_TTB_REMOVEBUTTON "TopToolBar/RemoveButton"
+
+/*
+toptoolbar/setstate service
+wparam = (HANDLE)hTTButton
+lparam = (LPARAM) state
+returns: 0 on success, -1 on failure.
+*/
+#define TTBST_PUSHED 1
+#define TTBST_RELEASED 2
+
+#define MS_TTB_SETBUTTONSTATE "TopToolBar/SetState"
+
+/*
+toptoolbar/getstate service
+wparam = (HANDLE)hTTButton
+lparam = 0
+returns: state on success, -1 on failure.
+*/
+#define MS_TTB_GETBUTTONSTATE "TopToolBar/GetState"
+
+/*
+toptoolbar/getoptions service
+(HIWORD)wparam = (HANDLE)hTTButton
+(LOWORD)wparam = TTBO_FLAG
+lparam = 0,or lparam=lpTTBButton if flag=TTBO_ALLDATA
+returns: value on success, -1 on failure.
+*/
+#define TTBO_FLAGS 0 //get/set all flags
+#define TTBO_POS 1 //position
+#define TTBO_WIDTH 2 //not impemented
+#define TTBO_HEIGHT 3 //not impemented
+#define TTBO_TIPNAME 4 //tool tip name
+#define TTBO_ALLDATA 5 //change all data via lparam=lpTTBButton
+
+
+#define MS_TTB_GETBUTTONOPTIONS "TopToolBar/GetOptions"
+
+/*
+toptoolbar/setoptions service
+(HIWORD)wparam = (HANDLE)hTTButton
+(LOWORD)wparam = TTBO_FLAG
+lparam = value
+returns: 1 on success, -1 on failure.
+*/
+#define MS_TTB_SETBUTTONOPTIONS "TopToolBar/SetOptions"
+
+
+#endif \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/sdk/m_updater.h b/plugins/WhenWasIt/WhenWasIt/sdk/m_updater.h
new file mode 100644
index 0000000000..371b7437a0
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/sdk/m_updater.h
@@ -0,0 +1,146 @@
+#ifndef _M_UPDATER_H
+#define _M_UPDATER_H
+
+// NOTES:
+// - For langpack updates, include a string of the following format in the langpack text file:
+// ";FLID: <file listing name> <version>"
+// version must be four numbers seperated by '.', in the range 0-255 inclusive
+// - Updater will disable plugins that are downloaded but were not active prior to the update (this is so that, if an archive contains e.g. ansi and
+// unicode versions, the correct plugin will be the only one active after the new version is installed)...so if you add a support plugin, you may need
+// to install an ini file to make the plugin activate when miranda restarts after the update
+// - Updater will replace all dlls that have the same internal shortName as a downloaded update dll (this is so that msn1.dll and msn2.dll, for example,
+// will both be updated) - so if you have a unicode and a non-unicode version of a plugin in your archive, you should make the internal names different (which will break automatic
+// updates from the file listing if there is only one file listing entry for both versions, unless you use the 'MS_UPDATE_REGISTER' service below)
+// - Updater will install all files in the root of the archive into the plugins folder, except for langpack files that contain the FLID string which go into the root folder (same
+// folder as miranda32.exe)...all folders in the archive will also be copied to miranda's root folder, and their contents transferred into the new folders. The only exception is a
+// special folder called 'root_files' - if there is a folder by that name in the archive, it's contents will also be copied into miranda's root folder - this is intended to be used
+// to install additional dlls etc that a plugin may require)
+
+// if you set Update.szUpdateURL to the following value when registering, as well as setting your beta site and version data,
+// Updater will ignore szVersionURL and pbVersionPrefix, and attempt to find the file listing URL's from the backend XML data.
+// for this to work, the plugin name in pluginInfo.shortName must match the file listing exactly (except for case)
+#define UPDATER_AUTOREGISTER "UpdaterAUTOREGISTER"
+// Updater will also use the backend xml data if you provide URL's that reference the miranda file listing for updates (so you can use that method
+// if e.g. your plugin shortName does not match the file listing) - it will grab the file listing id from the end of these URLs
+
+typedef struct Update_tag {
+ int cbSize;
+ char *szComponentName; // component name as it will appear in the UI (will be translated before displaying)
+
+ char *szVersionURL; // URL where the current version can be found (NULL to disable)
+ BYTE *pbVersionPrefix; // bytes occuring in VersionURL before the version, used to locate the version information within the URL data
+ // (note that this URL could point at a binary file - dunno why, but it could :)
+ int cpbVersionPrefix; // number of bytes pointed to by pbVersionPrefix
+ char *szUpdateURL; // URL where dll/zip is located
+ // set to UPDATER_AUTOREGISTER if you want Updater to find the file listing URLs (ensure plugin shortName matches file listing!)
+
+ char *szBetaVersionURL; // URL where the beta version can be found (NULL to disable betas)
+ BYTE *pbBetaVersionPrefix; // bytes occuring in VersionURL before the version, used to locate the version information within the URL data
+ int cpbBetaVersionPrefix; // number of bytes pointed to by pbVersionPrefix
+ char *szBetaUpdateURL; // URL where dll/zip is located
+
+ BYTE *pbVersion; // bytes of current version, used for comparison with those in VersionURL
+ int cpbVersion; // number of bytes pointed to by pbVersion
+
+ char *szBetaChangelogURL; // url for displaying changelog for beta versions
+} Update;
+
+// register a comonent with Updater
+//
+// wparam = 0
+// lparam = (LPARAM)&Update
+#define MS_UPDATE_REGISTER "Update/Register"
+
+// utility functions to create a version string from a DWORD or from pluginInfo
+// point buf at a buffer at least 16 chars wide - but note the version string returned may be shorter
+//
+__inline static char *CreateVersionString(DWORD version, char *buf) {
+ mir_snprintf(buf, 16, "%d.%d.%d.%d", (version >> 24) & 0xFF, (version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF);
+ return buf;
+}
+
+__inline static char *CreateVersionStringPlugin(PLUGININFO *pluginInfo, char *buf) {
+ return CreateVersionString(pluginInfo->version, buf);
+}
+
+
+// register the 'easy' way - use this method if you have no beta URL and the plugin is on the miranda file listing
+// NOTE: the plugin version string on the file listing must be the string version of the version in pluginInfo (i.e. 0.0.0.1,
+// four numbers between 0 and 255 inclusivem, so no letters, brackets, etc.)
+//
+// wParam = (int)fileID - this is the file ID from the file listing (i.e. the number at the end of the download link)
+// lParam = (PLUGININFO*)&pluginInfo
+#define MS_UPDATE_REGISTERFL "Update/RegisterFL"
+
+// this function can be used to 'unregister' components - useful for plugins that register non-plugin/langpack components and
+// may need to change those components on the fly
+// lParam = (char *)szComponentName
+#define MS_UPDATE_UNREGISTER "Update/Unregister"
+
+// this event is fired when the startup process is complete, but NOT if a restart is imminent
+// it is designed for status managment plugins to use as a trigger for beggining their own startup process
+// wParam = lParam = 0 (unused)
+// (added in version 0.1.6.0)
+#define ME_UPDATE_STARTUPDONE "Update/StartupDone"
+
+// this service can be used to enable/disable Updater's global status control
+// it can be called from the StartupDone event handler
+// wParam = (BOOL)enable
+// lParam = 0
+// (added in version 0.1.6.0)
+#define MS_UPDATE_ENABLESTATUSCONTROL "Update/EnableStatusControl"
+
+// An description of usage of the above service and event:
+// Say you are a status control plugin that normally sets protocol or global statuses in your ModulesLoaded event handler.
+// In order to make yourself 'Updater compatible', you would move the status control code from ModulesLoaded to another function,
+// say DoStartup. Then, in ModulesLoaded you would check for the existence of the MS_UPDATE_ENABLESTATUSCONTROL service.
+// If it does not exist, call DoStartup. If it does exist, hook the ME_UPDATE_STARTUPDONE event and call DoStartup from there. You may
+// also wish to call MS_UPDATE_ENABLESTATUSCONTROL with wParam == FALSE at this time, to disable Updater's own status control feature.
+
+// this service can be used to determine whether updates are possible for a component with the given name
+// wParam = 0
+// lParam = (char *)szComponentName
+// returns TRUE if updates are supported, FALSE otherwise
+#define MS_UPDATE_ISUPDATESUPPORTED "Update/IsUpdateSupported"
+
+#endif
+
+
+/////////////// Usage Example ///////////////
+
+#ifdef EXAMPLE_CODE
+
+// you need to #include "m_updater.h" and HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded) in your Load function...
+
+int OnModulesLoaded(WPARAM wParam, LPARAM lParam) {
+
+ Update update = {0}; // for c you'd use memset or ZeroMemory...
+ char szVersion[16];
+
+ update.cbSize = sizeof(Update);
+
+ update.szComponentName = pluginInfo.shortName;
+ update.pbVersion = (BYTE *)CreateVersionString(&pluginInfo, szVersion);
+ update.cpbVersion = strlen((char *)update.pbVersion);
+
+ // these are the three lines that matter - the archive, the page containing the version string, and the text (or data)
+ // before the version that we use to locate it on the page
+ // (note that if the update URL and the version URL point to standard file listing entries, the backend xml
+ // data will be used to check for updates rather than the actual web page - this is not true for beta urls)
+ update.szUpdateURL = "http://scottellis.com.au:81/test/updater.zip";
+ update.szVersionURL = "http://scottellis.com.au:81/test/updater_test.html";
+ update.pbVersionPrefix = (BYTE *)"Updater version ";
+
+ update.cpbVersionPrefix = strlen((char *)update.pbVersionPrefix);
+
+ // do the same for the beta versions of the above struct members if you wish to allow beta updates from another URL
+
+ CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
+
+ // Alternatively, to register a plugin with e.g. file ID 2254 on the file listing...
+ // CallService(MS_UPDATE_REGISTERFL, (WPARAM)2254, (LPARAM)&pluginInfo);
+
+ return 0;
+}
+
+#endif
diff --git a/plugins/WhenWasIt/WhenWasIt/services.cpp b/plugins/WhenWasIt/WhenWasIt/services.cpp
new file mode 100644
index 0000000000..303866bffa
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/services.cpp
@@ -0,0 +1,423 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "services.h"
+
+#define COMMENT_CHAR '#'
+
+HANDLE hsCheckBirthdays;
+HANDLE hsShowList;
+HANDLE hsAddBirthday;
+HANDLE hsRefreshUserDetails;
+HANDLE hsImportBirthdays;
+HANDLE hsExportBirthdays;
+
+int bShouldCheckBirthdays = 0;
+int bBirthdayFound = 0;
+
+int InitServices()
+{
+ Log("%s", "Entering function " __FUNCTION__);
+
+ commonData.foreground = DBGetContactSettingDword(NULL, ModuleName, "Foreground", FOREGROUND_COLOR);
+ commonData.background = DBGetContactSettingDword(NULL, ModuleName, "Background", BACKGROUND_COLOR);
+ commonData.checkInterval = DBGetContactSettingWord(NULL, ModuleName, "CheckInterval", CHECK_INTERVAL);
+ commonData.daysInAdvance = DBGetContactSettingWord(NULL, ModuleName, "DaysInAdvance", DAYS_TO_NOTIFY);
+ commonData.daysAfter = DBGetContactSettingWord(NULL, ModuleName, "DaysAfter", DAYS_TO_NOTIFY_AFTER);
+ commonData.popupTimeout = DBGetContactSettingWord(NULL, ModuleName, "PopupTimeout", POPUP_TIMEOUT);
+ commonData.popupTimeoutToday = DBGetContactSettingWord(NULL, ModuleName, "PopupTimeoutToday", commonData.popupTimeout);
+ commonData.bUsePopups = DBGetContactSettingByte(NULL, ModuleName, "UsePopups", TRUE);
+ commonData.bUseClistIcon = DBGetContactSettingByte(NULL, ModuleName, "UseClistIcon", TRUE);
+ commonData.bUseDialog = DBGetContactSettingByte(NULL, ModuleName, "UseDialog", TRUE);
+ commonData.clistIcon= DBGetContactSettingByte(NULL, ModuleName, "AdvancedIcon", CLIST_ICON);
+ commonData.bIgnoreSubcontacts = DBGetContactSettingByte(NULL, ModuleName, "IgnoreSubcontacts", FALSE);
+ commonData.cShowAgeMode = DBGetContactSettingByte(NULL, ModuleName, "ShowCurrentAge", FALSE);
+ commonData.bNoBirthdaysPopup = DBGetContactSettingByte(NULL, ModuleName, "NoBirthdaysPopup", FALSE);
+ commonData.bOpenInBackground = DBGetContactSettingByte(NULL, ModuleName, "OpenInBackground", FALSE);
+ commonData.cSoundNearDays = DBGetContactSettingByte(NULL, ModuleName, "SoundNearDays", BIRTHDAY_NEAR_DEFAULT_DAYS);
+ commonData.cDefaultModule = DBGetContactSettingByte(NULL, ModuleName, "DefaultModule", 0);
+ commonData.lPopupClick = DBGetContactSettingByte(NULL, ModuleName, "PopupLeftClick", 2);
+ commonData.rPopupClick = DBGetContactSettingByte(NULL, ModuleName, "PopupRightClick", 1);
+ commonData.bOncePerDay = DBGetContactSettingByte(NULL, ModuleName, "OncePerDay", 0);
+ commonData.cDlgTimeout = DBGetContactSettingWord(NULL, ModuleName, "DlgTimeout", POPUP_TIMEOUT);
+ commonData.notifyFor = DBGetContactSettingByte(NULL, ModuleName, "NotifyFor", 0);
+
+ hsCheckBirthdays = CreateServiceFunction(MS_WWI_CHECK_BIRTHDAYS, CheckBirthdaysService);
+ hsShowList = CreateServiceFunction(MS_WWI_LIST_SHOW, ShowListService);
+ hsAddBirthday = CreateServiceFunction(MS_WWI_ADD_BIRTHDAY, AddBirthdayService);
+ hsRefreshUserDetails = CreateServiceFunction(MS_WWI_REFRESH_USERDETAILS, RefreshUserDetailsService);
+ hsImportBirthdays = CreateServiceFunction(MS_WWI_IMPORT_BIRTHDAYS, ImportBirthdaysService);
+ hsExportBirthdays = CreateServiceFunction(MS_WWI_EXPORT_BIRTHDAYS, ExportBirthdaysService);
+
+ Log("%s", "Leaving function " __FUNCTION__);
+ return 0;
+}
+
+int DestroyServices()
+{
+ Log("%s", "Entering function " __FUNCTION__);
+
+ DestroyServiceFunction(hsCheckBirthdays);
+ DestroyServiceFunction(hsShowList);
+ DestroyServiceFunction(hsAddBirthday);
+ DestroyServiceFunction(hsRefreshUserDetails);
+ DestroyServiceFunction(hsImportBirthdays);
+ DestroyServiceFunction(hsExportBirthdays);
+
+ Log("%s", "Leaving function " __FUNCTION__);
+ return 0;
+}
+
+/*
+returns -1 if notify is not necesarry
+returns daysToBirthday if it should notify
+*/
+int NotifyContactBirthday(HANDLE hContact, time_t now, int daysInAdvance)
+{
+ int year, month, day;
+ GetContactDOB(hContact, year, month, day);
+ int daysToBirthday = DaysToBirthday(now, year, month, day);
+ if (daysInAdvance >= daysToBirthday)
+ {
+ return daysToBirthday;
+ }
+ return -1;
+}
+
+// returns -1 if notify is not necessary
+// returns daysAfterBirthday if it should notify
+int NotifyMissedContactBirthday(HANDLE hContact, time_t now, int daysAfter)
+{
+ if (daysAfter > 0)
+ {
+ int year, month, day;
+ GetContactDOB(hContact, year, month, day);
+ int daysAfterBirthday = DaysAfterBirthday(now, year, month, day);
+ if ((daysAfterBirthday >= 0) && (daysAfter >= daysAfterBirthday))
+ {
+ return daysAfterBirthday;
+ }
+ }
+
+ return -1;
+}
+
+//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)
+{
+ bBirthdayFound = 0; //no birthdays have been found in the given interval
+ //int bNoBirthdaysPopup = DBGetContactSettingByte(NULL, ModuleName, "NoBirthdaysPopup", FALSE);
+
+ SYSTEMTIME today;
+ GetLocalTime(&today);
+
+ DWORD lastChecked = DBGetContactSettingDword(NULL, ModuleName, "LastChecked", 0); //get last checked date
+ int lcDay = LOBYTE(LOWORD(lastChecked));
+ int lcMonth = HIBYTE(LOWORD(lastChecked));
+ int lcYear = HIWORD(lastChecked);
+
+ int daysAfter = DaysAfterBirthday(Today(), lcYear, lcMonth, lcDay); //get difference between last checked date and today
+ int savedDaysAfter = 0;
+
+ savedDaysAfter = commonData.daysAfter; //save value
+
+ if ((daysAfter > commonData.daysAfter) && (commonData.daysAfter > 0))//check for passed birthdays
+ {
+ commonData.daysAfter = daysAfter; //bigger values of the two
+ }
+
+ if ((lParam) && (commonData.bOncePerDay)) //if force check then we don't take OncePerDay into account
+ {
+ if ((lcDay == today.wDay) && (lcMonth == today.wMonth) && (lcYear == today.wYear))
+ {
+ return 0; //already checked today
+ }
+ }
+
+ bShouldCheckBirthdays = 1;
+ RefreshAllContactListIcons();
+ if ((!bBirthdayFound) && (commonData.bNoBirthdaysPopup))
+ {
+ PopupNotifyNoBirthdays();
+ }
+ bShouldCheckBirthdays = 0;
+
+ commonData.daysAfter = savedDaysAfter; //restore previous value
+
+ if (lParam) //if not forced - i.e. timer check
+ {
+ DBWriteContactSettingDword(NULL, ModuleName, "LastChecked", MAKELONG(MAKEWORD(today.wDay, today.wMonth), today.wYear)); //write the value in DB so we don't check again today
+ }
+
+ return 0;
+}
+
+INT_PTR ShowListService(WPARAM wParam, LPARAM lParam)
+{
+ if (!hBirthdaysDlg)
+ {
+ hBirthdaysDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_BIRTHDAYS), NULL, DlgProcBirthdays);
+ }
+ ShowWindow(hBirthdaysDlg, SW_SHOW);
+ return 0;
+}
+
+INT_PTR AddBirthdayService(WPARAM wParam, LPARAM lParam)
+{
+ HWND hWnd = WindowList_Find(hAddBirthdayWndsList, (HANDLE) wParam);
+ if (!hWnd)
+ {
+ hWnd = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_ADD_BIRTHDAY), NULL, DlgProcAddBirthday);
+ if (hWnd == NULL)
+ {
+ TCHAR buffer[1024];
+ _stprintf(buffer, _T("Error #%d while trying to create add birthday dialog"), GetLastError());
+ MessageBox(0, buffer, _T("Error"), MB_OK);
+ }
+ WindowList_Add(hAddBirthdayWndsList, hWnd, (HANDLE) wParam);
+ SetWindowLongPtr(hWnd, GWLP_USERDATA, wParam);
+ }
+ return ShowWindow(hWnd, SW_SHOW);
+}
+
+void ShowPopupMessage(TCHAR *title, TCHAR *message, HICON icon)
+{
+ POPUPDATAT pd = {0};
+ pd.lchIcon = icon;
+ _tcscpy(pd.lptzContactName, title);
+ _tcscpy(pd.lptzText, message);
+ pd.colorText = commonData.foreground;
+ pd.colorBack = commonData.background;
+
+ PUAddPopUpT(&pd);
+}
+
+DWORD WINAPI RefreshUserDetailsWorkerThread(LPVOID param)
+{
+ //MessageBox(0, "Inside worker thread", "Info", MB_OK);
+ //POPUPDATA pd = {0};
+ //pd.lchIcon = hiRefreshUserDetails;
+ //strcpy(pd.lpzContactName, Translate("WhenWasIt"));
+ //strcpy(pd.lpzText, Translate("Starting to refresh user details"));
+ //PUAddPopUp(&pd);
+ ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Starting to refresh user details"), hiRefreshUserDetails);
+ int delay = DBGetContactSettingWord(NULL, ModuleName, "UpdateDelay", REFRESH_DETAILS_DELAY);
+ HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ int res;
+ while (hContact != NULL)
+ {
+ res = CallContactService(hContact, PSS_GETINFO, 0, 0);
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ if (hContact)
+ {
+ Sleep(delay); //sleep for a few seconds between requests
+ }
+ }
+ //strcpy(pd.lpzText, Translate("Done refreshing user details"));
+ //PUAddPopUp(&pd);
+ ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done refreshing user details"), hiRefreshUserDetails);
+ //MessageBox(0, "Leaving worker thread", "Info", MB_OK);
+ return 0;
+}
+
+INT_PTR RefreshUserDetailsService(WPARAM wParam, LPARAM lParam)
+{
+ DWORD threadID;
+ //MessageBox(0, "Before CreateThread()", "Info", MB_OK);
+ HANDLE result = CreateThread(NULL, 0, RefreshUserDetailsWorkerThread, NULL, 0, &threadID);
+ //MessageBox(0, "After CreateThread()", "Info", MB_OK);
+ if (!result)
+ {
+ TCHAR buffer[1024];
+ _stprintf(buffer, _T("Could not create worker thread. Error#%d - threadID %d"), GetLastError(), threadID);
+ MessageBox(0, buffer, _T("Error"), MB_OK | MB_ICONERROR);
+ }
+ if ((result != NULL) && (result != INVALID_HANDLE_VALUE))
+ {
+ CloseHandle(result);
+ }
+
+ return 0;
+}
+
+INT_PTR ImportBirthdaysService(WPARAM wParam, LPARAM lParam)
+{
+ TCHAR fileName[1024] = {0};
+ OPENFILENAME of = {0};
+ of.lStructSize = sizeof(OPENFILENAME);
+ //of.hInstance = hInstance;
+ TCHAR filter[MAX_PATH];
+ mir_sntprintf(filter, SIZEOF(filter), _T("%s (*") _T(BIRTHDAY_EXTENSION) _T(")%c*") _T(BIRTHDAY_EXTENSION) _T("%c"), TranslateT("Birthdays files"), 0, 0);
+ of.lpstrFilter = filter;
+ of.lpstrFile = fileName;
+ of.nMaxFile = 1024;
+ of.lpstrTitle = TranslateT("Please select a file to import birthdays from ...");
+ of.Flags = OFN_FILEMUSTEXIST;
+
+ if (GetOpenFileName(&of))
+ {
+ TCHAR buffer[2048];
+ mir_sntprintf(buffer, SIZEOF(buffer), TranslateT("Importing birthdays from file: %s"), fileName);
+ ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hiImportBirthdays);
+ DoImport(fileName);
+ ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done importing birthdays"), hiImportBirthdays);
+ }
+
+ return 0;
+}
+
+INT_PTR ExportBirthdaysService(WPARAM wParam, LPARAM lParam)
+{
+ TCHAR fileName[1024]= {0};
+ OPENFILENAME of = {0};
+ of.lStructSize = sizeof(OPENFILENAME);
+ //of.hInstance = hInstance;
+ TCHAR filter[MAX_PATH];
+ mir_sntprintf(filter, SIZEOF(filter), _T("%s (*") _T(BIRTHDAY_EXTENSION) _T(")%c*") _T(BIRTHDAY_EXTENSION) _T("%c%s (*.*)%c*.*%c"), TranslateT("Birthdays files"), 0, 0, TranslateT("All Files"), 0, 0);
+ of.lpstrFilter = filter;
+ of.lpstrFile = fileName;
+ of.nMaxFile = 1024;
+ of.lpstrTitle = TranslateT("Please select a file to export birthdays to ...");
+ //of.Flags = OFN_ENABLESIZING | OFN_EXPLORER;
+
+ if (GetSaveFileName(&of))
+ {
+ TCHAR buffer[2048];
+ TCHAR *fn = _tcsrchr(fileName, _T('\\')) + 1;
+ if (!_tcschr(fn, _T('.')))
+ {
+ _tcscat(fileName, _T(BIRTHDAY_EXTENSION));
+ }
+ _stprintf(buffer, TranslateT("Exporting birthdays to file: %s"), fileName);
+ ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hiExportBirthdays);
+ DoExport(fileName);
+ ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done exporting birthdays"), hiExportBirthdays);
+ }
+
+ return 0;
+}
+
+int DoImport(TCHAR *fileName)
+{
+ FILE *fin = _tfopen(fileName, _T("rt"));
+ if (!fin)
+ {
+ MessageBox(0, _T("Could not open file to import birthdays"), _T("Error"), MB_OK | MB_ICONERROR);
+ return 1;
+ }
+
+ HANDLE hContact;
+ int year, month, day;
+ TCHAR *szHandle;
+ TCHAR *szProto;
+ const int maxSize = 4096;
+ TCHAR buffer[maxSize];
+ int tmp, tmp2;
+ int mode = commonData.cDefaultModule; //DBGetContactSettingByte(NULL, ModuleName, "DefaultModule", 0);
+ TCHAR *delAccount, *delProto;
+
+ while (!feof(fin))
+ {
+ _fgetts(buffer, maxSize, fin);
+ if (buffer[0] == _T(COMMENT_CHAR))
+ {
+ continue;
+ }
+
+ delAccount = _tcsstr(buffer, _T(" : "));
+ if (delAccount)
+ {
+ tmp = delAccount[0];
+ delAccount[0] = _T('\0');
+ delProto = _tcsrchr(buffer, _T('@'));
+ if (delProto)
+ {
+ tmp2 = delProto[0];
+ delProto[0] = _T('\0');
+
+ szHandle = buffer;
+ szProto = delProto + 1;
+ hContact = GetContactFromID(szHandle, szProto);
+ if (hContact)
+ {
+ delProto[0] = tmp;
+ delAccount[0] = tmp;
+ _stscanf(delAccount, _T(" : %02d/%02d/%04d"), &day, &month, &year);
+ SaveBirthday(hContact, year, month, day, mode);
+ }
+ else{
+ TCHAR tmp[2048];
+ _stprintf(tmp, TranslateT(NOTFOUND_FORMAT), szHandle, szProto);
+ ShowPopupMessage(TranslateT("Warning"), tmp, hiImportBirthdays);
+ }
+ }
+ }
+ }
+
+ fclose(fin);
+
+ return 0;
+}
+
+int DoExport(TCHAR *fileName)
+{
+ FILE *fout = _tfopen(fileName, _T("wt"));
+ if (!fout)
+ {
+ MessageBox(0, _T("Could not open file to export birthdays"), _T("Error"), MB_OK | MB_ICONERROR);
+ return 1;
+ }
+ _ftprintf(fout, _T("%c%s"), _T(COMMENT_CHAR), _T("Please do not edit this file by hand. Use the export function of WhenWasIt plugin.\n"));
+ _ftprintf(fout, _T("%c%s"), _T(COMMENT_CHAR), _T("Warning! Please do not mix Unicode and Ansi exported birthday files. You should use the same version (Ansi/Unicode) of WhenWasIt that was used to export the info.\n"));
+#ifdef _UNICODE
+ _ftprintf(fout, _T("%c%s"), _T(COMMENT_CHAR), _T("This file was exported with a Unicode version of WhenWasIt. Please only use a Unicode version of the plugin to import the birthdays.\n"));
+#else
+ _ftprintf(fout, _T("%c%s"), _T(COMMENT_CHAR), _T("This file was exported with an Ansi version of WhenWasIt. Please only use an Ansi version of the plugin to import the birthdays.\n"));
+#endif
+ HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ int year, month, day;
+ TCHAR *szHandle;
+ char szProto[256];
+
+ while (hContact)
+ {
+ GetContactDOB(hContact, year, month, day);
+ if (IsDOBValid(year, month, day))
+ {
+ szProto[0] = '\0';
+ GetContactProtocol(hContact, szProto, sizeof(szProto));
+ szHandle = GetContactID(hContact, szProto);
+
+ if ((szHandle) && (strlen(szProto) > 0))
+ {
+ _ftprintf(fout, _T(BIRTHDAYS_EXPORT_FORMAT), szHandle, szProto, day, month, year);
+ }
+
+ if (szHandle) free(szHandle);
+ }
+
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ }
+
+ fclose(fout);
+
+ return 0;
+} \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/services.h b/plugins/WhenWasIt/WhenWasIt/services.h
new file mode 100644
index 0000000000..39f49abde6
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/services.h
@@ -0,0 +1,64 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_WWI_SERVICES_H
+#define M_WWI_SERVICES_H
+
+#define MS_WWI_CHECK_BIRTHDAYS "WhenWasIt/Birthdays/Check"
+#define MS_WWI_LIST_SHOW "WhenWasIt/List/Show"
+#define MS_WWI_ADD_BIRTHDAY "WhenWasIt/Birthdays/Add"
+#define MS_WWI_REFRESH_USERDETAILS "WhenWasIt/Birthdays/RefreshDetails"
+#define MS_WWI_IMPORT_BIRTHDAYS "WhenWasIt/Birthdays/Import"
+#define MS_WWI_EXPORT_BIRTHDAYS "WhenWasIt/Birthdays/Export"
+
+#define REFRESH_DETAILS_DELAY 3000
+
+#ifdef _UNICODE
+#define BIRTHDAY_EXTENSION ".bdaysW"
+#define BIRTHDAYS_EXPORT_FORMAT "%s@%S : %02d/%02d/%04d\n"
+#define NOTFOUND_FORMAT "Could not find UID '%s [%S]' in current database, skipping"
+#else
+#define BIRTHDAY_EXTENSION ".bdays"
+#define BIRTHDAYS_EXPORT_FORMAT "%s@%s : %02d/%02d/%04d\n"
+#define NOTFOUND_FORMAT "Could not find UID '%s [%s]' in current database, skipping"
+#endif
+
+#include "commonheaders.h"
+
+extern int bShouldCheckBirthdays;
+extern int bBirthdayFound;
+
+int InitServices();
+int DestroyServices();
+
+int NotifyContactBirthday(HANDLE hContact, time_t now, int daysInAdvance);
+int NotifyMissedContactBirthday(HANDLE hContact, time_t now, int daysAfter);
+
+int DoExport(TCHAR *fileName);
+int DoImport(TCHAR *fileName);
+
+INT_PTR CheckBirthdaysService(WPARAM wParam, LPARAM lParam);
+INT_PTR ShowListService(WPARAM wParam, LPARAM lParam);
+INT_PTR AddBirthdayService(WPARAM wParam, LPARAM lParam);
+INT_PTR RefreshUserDetailsService(WPARAM wParam, LPARAM lParam);
+INT_PTR ImportBirthdaysService(WPARAM wParam, LPARAM lParam);
+INT_PTR ExportBirthdaysService(WPARAM wParam, LPARAM lParam);
+
+#endif //M_EXCHANGE_SERVICES_H \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/utils.cpp b/plugins/WhenWasIt/WhenWasIt/utils.cpp
new file mode 100644
index 0000000000..36759393f0
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/utils.cpp
@@ -0,0 +1,392 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "utils.h"
+
+int LogInit()
+{
+#ifdef _DEBUG
+ FILE *fout = fopen(LOG_FILE, "wt");
+ fclose(fout);
+#endif
+ return 0;
+}
+
+int Log(char *format, ...)
+{
+#ifdef _DEBUG
+ char str[4096];
+ va_list vararg;
+ int tBytes;
+ FILE *fout = fopen(LOG_FILE, "at");
+ if (!fout)
+ {
+// MessageBox(0, "can't open file", NULL, MB_OK);
+ return -1;
+ }
+ time_t tNow = time(NULL);
+ struct tm *now = localtime(&tNow);
+ strftime(str, sizeof(str), "%d %b %Y @ %H:%M:%S: ", now);
+ fputs(str, fout);
+ va_start(vararg, format);
+
+ tBytes = _vsnprintf(str, sizeof(str), format, vararg);
+ if (tBytes > 0)
+ {
+ str[tBytes] = 0;
+ }
+
+ va_end(vararg);
+ if (str[strlen(str) - 1] != '\n')
+ {
+ strcat(str, "\n");
+ }
+ fputs(str, fout);
+ fclose(fout);
+#endif
+ return 0;
+}
+
+int Info(char *title, char *format, ...)
+{
+ char str[4096];
+ va_list vararg;
+ int tBytes;
+ va_start(vararg, format);
+ tBytes = _vsnprintf(str, sizeof(str), format, vararg);
+ if (tBytes > 0)
+ {
+ str[tBytes] = 0;
+ }
+ va_end(vararg);
+ return MessageBoxA(0, str, title, MB_OK | MB_ICONINFORMATION);
+}
+
+#define HEX_SIZE 8
+
+char *BinToHex(int size, PBYTE data)
+{
+ char *szresult = NULL;
+ char buffer[32] = {0}; //should be more than enough
+ int maxSize = size * 2 + HEX_SIZE + 1;
+ szresult = (char *) new char[ maxSize ];
+ memset(szresult, 0, maxSize);
+ sprintf(buffer, "%0*X", HEX_SIZE, size);
+ strcpy(szresult, buffer);
+ int i;
+ for (i = 0; i < size; i++)
+ {
+ sprintf(buffer, "%02X", data[i]);
+ strcpy(szresult + (HEX_SIZE + i * 2), buffer);
+ }
+ return szresult;
+}
+
+void HexToBin(char *inData, ULONG &size, LPBYTE &outData)
+{
+ char buffer[32] = {0};
+ strcpy(buffer, "0x");
+ strncpy(buffer + 2, inData, HEX_SIZE);
+ sscanf(buffer, "%x", &size);
+ outData = (unsigned char*)new char[size*2];
+ UINT i;
+ //size = i;
+ char *tmp = inData + HEX_SIZE;
+ buffer[4] = '\0'; //mark the end of the string
+ for (i = 0; i < size; i++)
+ {
+ strncpy(buffer + 2, &tmp[i * 2], 2);
+ sscanf(buffer, "%x", &outData[i]);
+ }
+ i = size;
+}
+
+int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName, char *szError, char *szResult, size_t size)
+{
+ DBVARIANT dbv = {0};
+ int res = 1;
+ size_t len;
+ dbv.type = DBVT_ASCIIZ;
+ if (DBGetContactSetting(hContact, szModule, szSettingName, &dbv) == 0)
+ {
+ res = 0;
+ size_t tmp = strlen(dbv.pszVal);
+ len = (tmp < size - 1) ? tmp : size - 1;
+ strncpy(szResult, dbv.pszVal, len);
+ szResult[len] = '\0';
+ mir_free(dbv.pszVal);
+ }
+ else{
+ res = 1;
+ if (szError)
+ {
+ size_t tmp = strlen(szError);
+ len = (tmp < size - 1) ? tmp : size - 1;
+ strncpy(szResult, szError, len);
+ szResult[len] = '\0';
+ }
+ else{
+ szResult[0] = '\0';
+ }
+ }
+ return res;
+}
+
+int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, size_t size)
+{
+ return GetStringFromDatabase(NULL, ModuleName, szSettingName, szError, szResult, size);
+}
+
+
+#pragma warning (disable: 4312)
+TCHAR *GetContactName(HANDLE hContact, char *szProto)
+{
+ CONTACTINFO ctInfo;
+ int ret;
+ char proto[200];
+
+ ZeroMemory((void *) &ctInfo, sizeof(ctInfo));
+ ctInfo.cbSize = sizeof(ctInfo);
+ if (szProto)
+ {
+ ctInfo.szProto = szProto;
+ }
+ else{
+ GetContactProtocol(hContact, proto, sizeof(proto));
+ ctInfo.szProto = proto;
+ }
+ ctInfo.dwFlag = CNF_DISPLAY;
+#ifdef _UNICODE
+ ctInfo.dwFlag += CNF_UNICODE;
+#endif
+ ctInfo.hContact = hContact;
+ //_debug_message("retrieving contact name for %d", hContact);
+ ret = CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) &ctInfo);
+ //_debug_message(" contact name %s", ctInfo.pszVal);
+ TCHAR *buffer;
+ if (!ret)
+ {
+ buffer = _tcsdup(ctInfo.pszVal);
+ }
+ mir_free(ctInfo.pszVal);
+ if (ret)
+ {
+ return NULL;
+ }
+
+ return buffer;
+}
+#pragma warning (default: 4312)
+
+#pragma warning (disable: 4312)
+void GetContactProtocol(HANDLE hContact, char *szProto, int size)
+{
+ GetStringFromDatabase(hContact, "Protocol", "p", NULL, szProto, size);
+}
+#pragma warning (default: 4312)
+
+#pragma warning (disable: 4312)
+TCHAR *GetContactID(HANDLE hContact)
+{
+ char protocol[256];
+ GetContactProtocol(hContact, protocol, sizeof(protocol));
+
+ return GetContactID(hContact, protocol);
+}
+
+TCHAR *GetContactID(HANDLE hContact, char *szProto)
+{
+ CONTACTINFO ctInfo;
+ int ret;
+
+ ZeroMemory((void *) &ctInfo, sizeof(ctInfo));
+ ctInfo.cbSize = sizeof(ctInfo);
+ ctInfo.szProto = szProto;
+ ctInfo.dwFlag = CNF_UNIQUEID;
+#ifdef _UNICODE
+ ctInfo.dwFlag |= CNF_UNICODE;
+#endif
+ ctInfo.hContact = hContact;
+ ret = CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) &ctInfo);
+ TCHAR *buffer;
+ if (!ret)
+ {
+ TCHAR tmp[16];
+ switch (ctInfo.type)
+ {
+ case CNFT_BYTE:
+ {
+ _stprintf(tmp, _T("%d"), ctInfo.bVal);
+ buffer = _tcsdup(tmp);
+
+ break;
+ }
+
+ case CNFT_WORD:
+ {
+ _stprintf(tmp, _T("%d"), ctInfo.wVal);
+ buffer = _tcsdup(tmp);
+
+ break;
+ }
+
+ case CNFT_DWORD:
+ {
+ _stprintf(tmp, _T("%ld"), ctInfo.dVal);
+ buffer = _tcsdup(tmp);
+
+ break;
+ }
+
+ case CNFT_ASCIIZ:
+ default:
+ {
+ buffer = _tcsdup(ctInfo.pszVal);
+
+ break;
+ }
+ }
+
+
+ }
+ mir_free(ctInfo.pszVal);
+ if (!ret)
+ {
+ return buffer;
+ }
+ else{
+ return NULL;
+ }
+}
+#pragma warning (default: 4312)
+
+#pragma warning (disable: 4312)
+HANDLE GetContactFromID(TCHAR *szID, char *szProto)
+{
+ HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ TCHAR *szHandle;
+ char cProtocol[256];
+
+ int found = 0;
+ while (hContact)
+ {
+ GetContactProtocol(hContact, cProtocol, sizeof(cProtocol));
+ szHandle = GetContactID(hContact, cProtocol);
+ if ((szHandle) && (_tcsicmp(szHandle, szID) == 0) && (_stricmp(szProto, cProtocol) == 0))
+ {
+ found = 1;
+ }
+ if (szHandle) free(szHandle);
+
+ if (found)
+ {
+ break;
+ }
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ }
+ return hContact;
+}
+#pragma warning (default: 4312)
+
+#pragma warning (disable: 4312)
+HANDLE GetContactFromID(TCHAR *szID, wchar_t *szProto)
+{
+ char protocol[1024];
+ WideCharToMultiByte(CP_ACP, 0, szProto, -1, protocol, sizeof(protocol), NULL, NULL);
+ return GetContactFromID(szID, protocol);
+}
+#pragma warning (default: 4312)
+
+void ScreenToClient(HWND hWnd, LPRECT rect)
+{
+ POINT pt;
+ int cx = rect->right - rect->left;
+ int cy = rect->bottom - rect->top;
+ pt.x = rect->left;
+ pt.y = rect->top;
+ ScreenToClient(hWnd, &pt);
+ rect->left = pt.x;
+ rect->top = pt.y;
+ rect->right = pt.x + cx;
+ rect->bottom = pt.y + cy;
+}
+
+void AnchorMoveWindow(HWND window, const WINDOWPOS *parentPos, int anchors)
+{
+ RECT rParent;
+ RECT rChild;
+
+ if (parentPos->flags & SWP_NOSIZE)
+ {
+ return;
+ }
+ GetWindowRect(parentPos->hwnd, &rParent);
+ rChild = AnchorCalcPos(window, &rParent, parentPos, anchors);
+ MoveWindow(window, rChild.left, rChild.top, rChild.right - rChild.left, rChild.bottom - rChild.top, FALSE);
+}
+
+RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, int anchors)
+{
+ RECT rChild;
+ RECT rTmp;
+
+ GetWindowRect(window, &rChild);
+ ScreenToClient(parentPos->hwnd, &rChild);
+
+ int cx = rParent->right - rParent->left;
+ int cy = rParent->bottom - rParent->top;
+ if ((cx == parentPos->cx) && (cy == parentPos->cy))
+ {
+ return rChild;
+ }
+ if (parentPos->flags & SWP_NOSIZE)
+ {
+ return rChild;
+ }
+
+ rTmp.left = parentPos->x - rParent->left;
+ rTmp.right = (parentPos->x + parentPos->cx) - rParent->right;
+ rTmp.bottom = (parentPos->y + parentPos->cy) - rParent->bottom;
+ rTmp.top = parentPos->y - rParent->top;
+
+ cx = (rTmp.left) ? -rTmp.left : rTmp.right;
+ cy = (rTmp.top) ? -rTmp.top : rTmp.bottom;
+
+ rChild.right += cx;
+ rChild.bottom += cy;
+ //expanded the window accordingly, now we need to enforce the anchors
+ if ((anchors & ANCHOR_LEFT) && (!(anchors & ANCHOR_RIGHT)))
+ {
+ rChild.right -= cx;
+ }
+ if ((anchors & ANCHOR_TOP) && (!(anchors & ANCHOR_BOTTOM)))
+ {
+ rChild.bottom -= cy;
+ }
+ if ((anchors & ANCHOR_RIGHT) && (!(anchors & ANCHOR_LEFT)))
+ {
+ rChild.left += cx;
+ }
+ if ((anchors & ANCHOR_BOTTOM) && (!(anchors & ANCHOR_TOP)))
+ {
+ rChild.top += cy;
+ }
+ return rChild;
+} \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/utils.h b/plugins/WhenWasIt/WhenWasIt/utils.h
new file mode 100644
index 0000000000..0528c0440f
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/utils.h
@@ -0,0 +1,55 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_WWI_UTILS_H
+#define M_WWI_UTILS_H
+
+#include <stdarg.h>
+#include "commonheaders.h"
+
+#define LOG_FILE "wwi.log"
+
+#define ANCHOR_LEFT 0x000001
+#define ANCHOR_RIGHT 0x000002
+#define ANCHOR_TOP 0x000004
+#define ANCHOR_BOTTOM 0x000008
+#define ANCHOR_ALL ANCHOR_LEFT | ANCHOR_RIGHT | ANCHOR_TOP | ANCHOR_BOTTOM
+
+int LogInit();
+int Log(char *format, ...);
+int Info(char *title, char *format, ...);
+
+char *BinToHex(int size, PBYTE data);
+void HexToBin(char *inData, ULONG &size, PBYTE &outData);
+
+void ScreenToClient(HWND hWnd, LPRECT rect);
+void AnchorMoveWindow(HWND window, const WINDOWPOS *parentPos, int anchors);
+RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, int anchors);
+
+int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, int size);
+
+TCHAR *GetContactName(HANDLE hContact, char *szProto);
+TCHAR *GetContactID(HANDLE hContact);
+TCHAR *GetContactID(HANDLE hContact, char *szProto);
+HANDLE GetContactFromID(TCHAR *szID, char *szProto);
+HANDLE GetContactFromID(TCHAR *szID, wchar_t *szProto);
+void GetContactProtocol(HANDLE hContact, char *szProto, int size);
+
+#endif \ No newline at end of file
diff --git a/plugins/WhenWasIt/WhenWasIt/version.h b/plugins/WhenWasIt/WhenWasIt/version.h
new file mode 100644
index 0000000000..022bb80385
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/version.h
@@ -0,0 +1,53 @@
+/*
+WhenWasIt (birthday reminder) plugin for Miranda IM
+
+Copyright © 2006-2011 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_WWI_VERSION_H
+#define M_WWI_VERSION_H
+
+#define __MAJOR_VERSION 0
+#define __MINOR_VERSION 3
+#define __RELEASE_NUM 3
+#define __BUILD_NUM 4
+
+#define VERSION PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM)
+
+#define __PLUGINVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
+#define __PLUGINVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
+#define __STRINGIFY_(x) #x
+#define __STRINGIFY(x) __STRINGIFY_(x)
+#define __VERSION_STRING __STRINGIFY(__PLUGINVERSION_STRING_DOTS)
+
+#define __DESC "Notifies you of upcoming birthdays."
+#define __AUTHOR "Cristian Libotean"
+#define __AUTHOREMAIL "eblis102@yahoo.com"
+#define __COPYRIGHT "© 2006-2011 Cristian Libotean"
+#define __AUTHORWEB "http://www.miranda-im.org/"
+
+#ifdef _UNICODE
+#if defined(WIN64) || defined(_WIN64)
+ #define __PLUGIN_DISPLAY_NAME "WhenWasIt birthday reminder (Unicode) (x64)"
+#else
+ #define __PLUGIN_DISPLAY_NAME "WhenWasIt birthday reminder (Unicode)"
+#endif
+#else
+ #define __PLUGIN_DISPLAY_NAME "WhenWasIt birthday reminder"
+#endif
+
+#endif //M_WWI_VERSION_H
diff --git a/plugins/WhenWasIt/WhenWasIt/version.rc b/plugins/WhenWasIt/WhenWasIt/version.rc
new file mode 100644
index 0000000000..0f8fea03fc
--- /dev/null
+++ b/plugins/WhenWasIt/WhenWasIt/version.rc
@@ -0,0 +1,100 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+#include "version.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource1.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION __PLUGINVERSION_STRING
+ PRODUCTVERSION __PLUGINVERSION_STRING
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Author", __AUTHOR
+ VALUE "FileDescription", __DESC
+ VALUE "FileVersion", __VERSION_STRING
+ VALUE "InternalName", __PLUGIN_DISPLAY_NAME
+ VALUE "LegalCopyright", __COPYRIGHT
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/plugins/WhenWasIt/docs/WhenWasIt_readme.txt b/plugins/WhenWasIt/docs/WhenWasIt_readme.txt
new file mode 100644
index 0000000000..3f8114e27b
--- /dev/null
+++ b/plugins/WhenWasIt/docs/WhenWasIt_readme.txt
@@ -0,0 +1,326 @@
+WhenWasIt birthday reminder plugin v.0.3.3.4
+Copyright © 2006-2011 Cristian Libotean
+Thanks go to Angeli-Ka for the icons.
+
+This plugin notifies you of upcoming birthdays using different notification methods.
+It can show a popup of the contact with the upcoming birthday and can also add a clist extra icon.
+
+You can also set a contacts birthday using the contact menu item. Checking "mBirthday compatibility" will force
+the plugin to store it's birthday settings in the same place as mBirthday plugin. When the change dialog first appears
+it will be checked if a birthday was found in the database (and the date will be set accordingly). If no birthday is found the
+date time control will be unchecked. To delete a birthday that's currently in the database open up the Add/change
+window, uncheck the date time control and click Ok.
+
+!!! Clicking the Ok button when the date time control is unchecked will delete any birthdays from the database (if any).
+To close the dialog without saving the changes use the close button (X).
+
+Changes:
+
++ : new feature
+* : changed
+! : bufgix
+- : feature removed or disabled because of pending bugs
+
+version 0.3.3.4 - 2011/09/22
+ + Patch from Tobias Weimer - addded ability to save and restore window position
+
+version 0.3.3.3 - 2011/09/05
+ + Patch from Tobias Weimer - added hotkey support
+
+version 0.3.3.2 - 2011/08/23
+ * Do not notify about missed birthdays if notify after is set to 0 days even if Miranda hasn't been started for a long time (longer than the interval)
+
+version 0.3.3.1 - 2011/08/23
+ + made x64 version updater aware
+
+version 0.3.3.0 - 2011/08/22
+ * Patch from Kirill Volinsky - use mir_free() helper function instead of calling the services manually.
+ * Changed the way header files are included.
+
+version 0.3.2.9 - 2011/05/16
+ * Patch from Kirill Volinsky - TranslateT() is not needed when initializing dialogs.
+
+version 0.3.2.8 - 2011/04/14
+ * Patch from Kirill Volinsky - TranslateT() is not needed when initializing dialogs.
+ ! Fixed version number.
+
+version 0.3.2.7 - 2011/03/29
+ * Patch from Kirill Volinsky - use mir_sntprintf in ImportBirthdaysService()
+
+version 0.3.2.6 - 2011/03/29
+ * Patch from Kirill Volinsky - filter translation in open file dialog
+
+version 0.3.2.5 - 2010/05/19
+ ! Fix for extra icons dissapearing with Clist Modern and ExtraIcons plugin when changing options
+
+version 0.3.2.4 - 2010/04/13
+ * Version bumb due to Addons site failure
+
+version 0.3.2.3 - 2010/04/13
+ ! Open dialog in background enabled only if Dialog notification is checked.
+
+version 0.3.2.2 - 2010/04/12
+ * More work with resource files :)
+
+version 0.3.2.1 - 2010/04/12
+ * Enlarged options window
+
+version 0.3.2.0 - 2010/04/12
+ + Added mICQBirthday support
+
+version 0.3.1.1 - 2009/12/17
+ ! Do not translate Main Menu items, let the core translate them.
+
+version 0.3.1.0 - 2009/11/16
+ * Extra icons name changes
+ + Support for ExtraIcons service plugin
+ + Added option to open upcoming birthdays list in background
+ + x64 support (not tested !!)
+
+version 0.3.0.4 - 2008/11/12
+ ! Fix bug reported by George, related to erroneous DTB reporting due to errno not being reset.
+
+version 0.3.0.3 - 2008/04/14
+ ! Fix notifying missed birthdays from a long time ago
+
+version 0.3.0.2 - 2008/03/31
+ + Added options to get notified about missed birthdays
+
+version 0.3.0.1 - 2008/01/24
+ * Changed beta versions server.
+
+version 0.3.0.0 - 2007/11/15
+ + Added option not to show notifications for hidden or ignored contacts
+ * Refactoring - WhenWasIt should be a lot less demading on the database
+
+version 0.2.2.3 - 2007/05/09
+ ! Close the upcoming birthdays dialog on miranda exit.
+
+version 0.2.2.2 - 2007/05/08
+ ! Fixed options dialog issues.
+
+version 0.2.2.1 - 2007/05/08
+ * Changed text for timeout dialog.
+ + Sort dialog entries by DTB.
+ ! Timeout would only initiate the first time the dialog was shown.
+
+version 0.2.2.0 - 2007/05/07
+ + Added dialog notification option.
+
+version 0.2.1.2 - 2007/04/16
+ * Allow days in advance to be set to 0 (only notifies of birthdays happening on that day).
+
+version 0.2.1.1 - 2007/04/04
+ * Message window will be opened in a separate thread.
+
+version 0.2.1.0 - 2007/03/07
+ + Added UUID ( {2ff96c84-b0b5-470e-bbf9-907b9f3f5d2f} Unicode, {2f369a01-211a-4f13-be3c-bf4f8c62cace} Ansi )
+ + Added BIRTHDAYNOTIFY interface.
+
+version 0.2.0.11 - 2007/02/12
+ + Added Unicode flag.
+
+version 0.2.0.10 - 2007/01/31
+ * Changed beta URL.
+
+version 0.2.0.9 - 2007/01/26
+ + Added custom popup delay for birthdays that occur today
+
+version 0.2.0.8 - 2007/01/07
+ + New version resource file.
+ ! Close thread handle.
+ * Use new m_popup.h header.
+
+version 0.2.0.7 - 2006/11/26
+ + Added dll version info.
+ * Changed controls tab order
+ ! Disable left and right popup click actions if popups notification is disabled.
+
+version 0.2.0.6 - 2006/10/30
+ * Increased the delay between update requests to 3 seconds
+ + Configurable delay between update requests using a "hidden" variable called "UpdateDelay" created in WhenWasIt module.
+
+version 0.2.0.5 - 2006/10/02
+ ! Close birthday list window on exit.
+ * Use window list in m_utils.h for add/change birthday windows.
+
+version 0.2.0.4 - 2006/09/25
+ + Rebased dll (0x2F400000)
+ * Use big icons.
+ ! Kill timers on exit.
+ * Updater support (beta versions).
+
+version 0.2.0.3 - 2006/09/05
+ * Always use ANSI strings for menu items.
+
+version 0.2.0.2 - 2006/08/24
+ ! Refresh clist icons when settings get changed.
+ * Use WhenWasIt popup colors for notification popups.
+ * Use unicode text for the menu items.
+
+version 0.2.0.1 - 2006/08/17
+ + Birthday list window automatically refreshes when a birthday is changed.
+ + Added shortcut key 'b' to add/change birthday menu item.
+
+version 0.2.0.0 - 2006/08/13
+ ! Text inside comboboxes is now translateable.
+ + Group checkboxes in options dialog will now resize to correct size depending on translation string.
+ * Running dbtool on the profile won't produce so many empty settings messages.
+ + Birthday list window now shows the module where birthday info was found.
+ + Unicode version. Translation strings should be created with care, %s %S behave differently depending if build is ANSI or UNICODE - DO NOT MIX !!!
+ Warning! Please do not mix Unicode and Ansi exported birthday files. You should use the same version (Ansi/Unicode) of WhenWasIt that was used to export the info.
+
+version 0.1.2.2 - 2006/08/04
+ + Option to only check once a day
+
+version 0.1.2.1 - 2006/08/03
+ + Added tooltip to add/change birthday dialog to show the current location of the birthday in the database.
+ * Color coded add/change birthday dialog - yellow - mBirthday, red - Protocol module, purple - Birthday Notifier, green - UserInfo.
+ * Minor cosmetic changes in options dialog.
+ * Also use contact protocol when exporting/importing - you cannot import old .bdays files, you need to use the new export method.
+ * Compare contact IDs without regard to case.
+ You cannot import/export birthdays for contacts that don't have their protocol module loaded!
+
+version 0.1.2.0 - 2006/07/25
+ + Added option to customize left and right mouse click actions on popups.
+ + Added import/export birthdays features. Export will *NOT* export info for contacts that don't have their protocol plugin loaded. Imported birthdays will be stored in the default module selected in options.
+ + Added contacts count in birthday list window.
+ * Changed icons so the number on the ballons is easier to see (thanks Angeli-Ka).
+
+version 0.1.1.3 - 2006/07/04
+ ! Users that have birthday today were shown last.
+ * Case insensitive comparison in birthday list.
+
+version 0.1.1.2 - 2006/07/03
+ * Use CallServiceSync() ... thanks Imme.
+ * Disable popups notifications if no popups plugin is loaded.
+ * Changed default colors.
+
+version 0.1.1.1 - 2006/07/03
+ * Left clicking the popup shouldn't crash anymore (using an event to call the send message service in the main thread).
+ * No need to restart miranda for the menu icons to change.
+
+version 0.1.1.0 - 2006/07/01
+ + Added option to set the default module where the plugin will save birthday info.
+ + Added birthday near and birthday today sound.
+ + Added popup preview button - age and days to birthday are generated randomly :).
+ ! Destroying add/change birthday window over and over again (stack overflow on win 98).
+
+version 0.1.0.2 - 2006/06/30
+ *Ooops, fogot create the release build.
+
+version 0.1.0.1 - 2006/06/30
+ + Added option to save birthday info in the protocol module. This ensures that User Details module can read the date of birth correctly.
+ There are now 3 options on where to save the date of birth. Default location is "UserInfo module"; if you want to have mBirthday compatibility
+ you should select "mBirthday module" and if you want the default User Details miranda module to be able to read the date of birth you should select "Protocol module".
+ The value in the protocol module will be overwritten if you select "Protocol module" from the dropdown list.
+ + Added tooltip in the Add birthday window explaining what the combo box entries mean.
+ + Right clicking the popup dismissed it, left clicking will open the message window.
+
+version 0.1.0.0 - 2006/06/27
+ + Made show popups when no birthdays are near optional.
+ + Added service to refresh user details on all contacts. Will go through all contacts in your list (regardless of protocol) and update their user details, one every 2 seconds (to avoid flooding).
+
+version 0.0.0.9 - 2006/06/26
+ + Added popup if no birthdays are near.
+
+version 0.0.0.8 - 2006/06/25:
+ + Added Birthday reminder compatibility (Birthday reminder color inside add/change birthday dialog is pink).
+
+version 0.0.0.7 - 2006/06/22:
+ + Option to show upcoming age (age the contact will have on 31 dec) or current age (the age of the contact today).
+
+version 0.0.0.6 - 2006/06/17:
+ * Added custom text for contacts that have birthday today.
+
+version 0.0.0.5 - 2006/06/14:
+ ! Use user's local time to compute age and DTB, not GMT time.
+ * Removed unnecessary icon. Now the add birthdaw dialog uses the add birthday icon, and the birthday list dialog uses birthday list icon.
+ + Option to not show popups for subcontacts of metacontact.
+ + Fix for windows 2000 and date time control.
+
+version 0.0.0.4 - 2006/06/13:
+ + Added sound notification.
+ + Added descending sort.
+ * When sorting by DTB or Age show N/A last.
+ ! Ooops, age calculation was good before.
+ * Messagebox with error when add birthday dialog can't be created.
+ ! Fixed annoying popups appearing everytime icons were changed.
+
+version 0.0.0.3 - 2006/06/12:
+ + Color coded background in Add/change birthday dialog. Red means the value is stored in the protocol module (won't be
+ overwritten, a new entry in either UserInfo or mBirthday module will be created instead). Pink means the value is stored
+ in mBirthday module and will be overwritten if you select "mBirthday compatibility" (otherwise it will be moved to module UserInfo).
+ Normal color (gray) means it was found in UserInfo module - clicking "mBirthday compatibility" will move it to mBirthday module.
+ + Added TopToolBar button.
+ * Show contact name in Add/change birthday dialog.
+ + Remember birthday list position.
+ + Double clicking a contact in the birthday list will open the add birthday dialog.
+ + Remember sort column.
+ * Added a bit more room for translations.
+ ! Fixed age calculation.
+ * Check for birthdays on miranda start (~20 seconds delay).
+
+version 0.0.0.2 - 2006/06/11:
+ + Support for contacts that have their birthday in the protocol module.
+ ! Fixed some possible clist_modern issues.
+
+version 0.0.0.1 - 2006/06/10:
+ First release ...
+
+
+Translation string - last update v0.2.0.1:
+Please be careful when translating these as there are a lot of escape characters in them, don't forget to add those and don't change the order :)
+[%s has birthday in %d days.]
+[%s has birthday tomorrow.]
+[%s has birthday today.]
+[Birthday - %s]
+[He]
+[She]
+[He/She]
+[%s\n%s will be %d years old.]
+[%s\n%s just turned %d.]
+[Protocol]
+[Contact]
+[DTB]
+[Birthday]
+[Age]
+[Set birthday for %s:]
+[N/A]
+[WhenWasIt]
+[No upcoming birthdays.]
+[Starting to refresh user details]
+[Done refreshing user details]
+[Add/change user &birthday]
+[Birthdays (When Was It)]
+[Check for birthdays]
+[Birthday list]
+[Refresh user details]
+[Import birthdays]
+[Export birthdays]
+[Please select a file to import birthdays from ...]
+[Please select a file to export birthdays to ...]
+[Exporting birthdays to file: %s]
+[Done exporting birthdays]
+[Importing birthdays from file: %s]
+[Done importing birthdays]
+[Could not find UID '%s [%s]' in current database, skipping] - ANSI version - please don't mix
+[Could not find UID '%s [%S]' in current database, skipping] - UNICODE version - please don't mix
+[%s protocol] - ANSI version - please don't mix
+[%S protocol] - UNICODE version - please don't mix
+[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.]
+[Birthday list (%d)]
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
diff --git a/plugins/WhenWasIt/files_release.txt b/plugins/WhenWasIt/files_release.txt
new file mode 100644
index 0000000000..063ca0c2a0
--- /dev/null
+++ b/plugins/WhenWasIt/files_release.txt
@@ -0,0 +1 @@
+Release\plugins\WhenWasIt.dll \ No newline at end of file
diff --git a/plugins/WhenWasIt/files_releasew.txt b/plugins/WhenWasIt/files_releasew.txt
new file mode 100644
index 0000000000..5770cdd6d0
--- /dev/null
+++ b/plugins/WhenWasIt/files_releasew.txt
@@ -0,0 +1 @@
+Release Unicode\plugins\WhenWasIt.dll
diff --git a/plugins/WhenWasIt/files_releasewx64.txt b/plugins/WhenWasIt/files_releasewx64.txt
new file mode 100644
index 0000000000..bea4718d90
--- /dev/null
+++ b/plugins/WhenWasIt/files_releasewx64.txt
@@ -0,0 +1 @@
+Release Unicode\x64\plugins\WhenWasIt.dll
diff --git a/plugins/WhenWasIt/files_source.txt b/plugins/WhenWasIt/files_source.txt
new file mode 100644
index 0000000000..edf239f270
--- /dev/null
+++ b/plugins/WhenWasIt/files_source.txt
@@ -0,0 +1,5 @@
+WhenWasIt\*.*
+WhenWasIt\sdk\*.*
+WhenWasIt\icons\*.*
+docs\*.*
+*.*
diff --git a/plugins/WhenWasIt/pack source.bat b/plugins/WhenWasIt/pack source.bat
new file mode 100644
index 0000000000..ca481a3784
--- /dev/null
+++ b/plugins/WhenWasIt/pack source.bat
@@ -0,0 +1,8 @@
+for /F "tokens=6-10* delims=. " %%i in (docs\WhenWasIt_readme.txt) do (call :Pack %%i %%j %%k %%l; exit)
+
+:Pack
+d:\usr\PowerArchiver\pacl\pacomp.exe -p -a -c2 "WhenWasIt src %1.%2.%3.%4.zip" @files_source.txt -x*.zip -x*.ncb -x*.user -x*.sdf
+exit
+
+error:
+echo "Error packing WhenWasIt"
diff --git a/plugins/WhenWasIt/pack symbols.bat b/plugins/WhenWasIt/pack symbols.bat
new file mode 100644
index 0000000000..d0e1e31294
--- /dev/null
+++ b/plugins/WhenWasIt/pack symbols.bat
@@ -0,0 +1,9 @@
+
+if NOT EXIST "symbols\%1 - %3%4" (
+ mkdir "symbols\%1 - %3%4"
+)
+xcopy WhenWasIt\win32\%2\*.pdb "symbols\%1 - %3%4\win32\*" /EXCLUDE:symbols_exclude.txt /Y
+xcopy WhenWasIt\x64\%2\*.pdb "symbols\%1 - %3%4\x64\*" /EXCLUDE:symbols_exclude.txt /Y
+
+d:\usr\PowerArchiver\pacl\pacomp.exe -p -a -r -c2 "symbols - %1.zip" "symbols\*.*"
+rmdir "symbols\" /Q /S \ No newline at end of file
diff --git a/plugins/WhenWasIt/pack unicode x64.bat b/plugins/WhenWasIt/pack unicode x64.bat
new file mode 100644
index 0000000000..8a5d510322
--- /dev/null
+++ b/plugins/WhenWasIt/pack unicode x64.bat
@@ -0,0 +1,11 @@
+copy folders\m_folders.h docs /y
+for /F "tokens=6-10* delims=. " %%i in (docs\WhenWasIt_readme.txt) do (call :Pack %%i %%j %%k %%l; exit)
+
+:Pack
+d:\usr\PowerArchiver\pacl\pacomp.exe -a -c2 "WhenWasIt %1.%2.%3.%4 x64 unicode.zip" @files_releasewx64.txt
+d:\usr\PowerArchiver\pacl\pacomp.exe -p -a -c2 "WhenWasIt %1.%2.%3.%4 x64 unicode.zip" docs\*.* *.caca
+call "pack symbols.bat" WhenWasIt "Release Unicode" %1.%2.%3.%4 unicode
+exit
+
+error:
+echo "Error packing WhenWasIt"
diff --git a/plugins/WhenWasIt/pack unicode.bat b/plugins/WhenWasIt/pack unicode.bat
new file mode 100644
index 0000000000..2bb0f32333
--- /dev/null
+++ b/plugins/WhenWasIt/pack unicode.bat
@@ -0,0 +1,11 @@
+copy folders\m_folders.h docs /y
+for /F "tokens=6-10* delims=. " %%i in (docs\WhenWasIt_readme.txt) do (call :Pack %%i %%j %%k %%l; exit)
+
+:Pack
+d:\usr\PowerArchiver\pacl\pacomp.exe -a -c2 "WhenWasIt %1.%2.%3.%4 x32 unicode.zip" @files_releasew.txt
+d:\usr\PowerArchiver\pacl\pacomp.exe -p -a -c2 "WhenWasIt %1.%2.%3.%4 x32 unicode.zip" docs\*.* *.caca
+call "pack symbols.bat" WhenWasIt "Release Unicode" %1.%2.%3.%4 unicode
+exit
+
+error:
+echo "Error packing WhenWasIt"
diff --git a/plugins/WhenWasIt/pack.bat b/plugins/WhenWasIt/pack.bat
new file mode 100644
index 0000000000..9cf47f0473
--- /dev/null
+++ b/plugins/WhenWasIt/pack.bat
@@ -0,0 +1,10 @@
+for /F "tokens=6-10* delims=. " %%i in (docs\WhenWasIt_readme.txt) do (call :Pack %%i %%j %%k %%l; exit)
+
+:Pack
+d:\usr\PowerArchiver\pacl\pacomp.exe -a -c2 "WhenWasIt %1.%2.%3.%4 x32.zip" @files_release.txt
+d:\usr\PowerArchiver\pacl\pacomp.exe -p -a -c2 "WhenWasIt %1.%2.%3.%4 x32.zip" docs\*.* *.caca
+call "pack symbols.bat" WhenWasIt Release %1.%2.%3.%4
+exit
+
+error:
+echo "Error packing WhenWasIt"
diff --git a/plugins/WhenWasIt/symbols_exclude.txt b/plugins/WhenWasIt/symbols_exclude.txt
new file mode 100644
index 0000000000..361cf2448b
--- /dev/null
+++ b/plugins/WhenWasIt/symbols_exclude.txt
@@ -0,0 +1 @@
+vc80.pdb \ No newline at end of file