summaryrefslogtreecommitdiff
path: root/plugins/FavContacts
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-21 23:24:02 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-21 23:24:02 +0000
commitef0abe4f9f67eeff4007f4839ba08a503472c74c (patch)
tree6b3e4e878aabab3c1b0995d62fab9257772cd39e /plugins/FavContacts
parentc5427646b03c73c179a31505671a9ad785709eb3 (diff)
- new typed helper, WindowList_Create, to create a window list
- new service, WindowList_Destroy, to destroy a window list - internal windowlist.cpp implementation rewritten to LIST<> git-svn-id: http://svn.miranda-ng.org/main/trunk@7823 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FavContacts')
-rw-r--r--plugins/FavContacts/src/main.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp
index 9339b613ae..5bb306246c 100644
--- a/plugins/FavContacts/src/main.cpp
+++ b/plugins/FavContacts/src/main.cpp
@@ -74,6 +74,9 @@ TCHAR g_filter[1024] = {0};
Options g_Options = {0};
+static HANDLE hDialogsList = NULL;
+static HANDLE hContactToActivate = NULL;
+
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
g_hInst = hinstDLL;
@@ -318,9 +321,12 @@ extern "C" __declspec(dllexport) int Load(void)
extern "C" __declspec(dllexport) int Unload(void)
{
+ WindowList_Destroy(hDialogsList);
+
if (g_hwndMenuHost) DestroyWindow(g_hwndMenuHost);
if (g_Options.hfntName) DeleteObject(g_Options.hfntName);
if (g_Options.hfntSecond) DeleteObject(g_Options.hfntSecond);
+
delete g_contactCache;
return 0;
}
@@ -884,9 +890,6 @@ INT_PTR svcShowMenuCentered(WPARAM wParam, LPARAM lParam)
return 0;
}
-static HANDLE hDialogsList = NULL;
-static HANDLE hContactToActivate = NULL;
-
INT_PTR svcOpenContact(WPARAM wParam, LPARAM lParam)
{
hContactToActivate = (HANDLE)wParam;
@@ -900,7 +903,7 @@ int ProcessSrmmEvent( WPARAM wParam, LPARAM lParam )
if (event->uType == MSG_WINDOW_EVT_OPEN) {
if ( !hDialogsList )
- hDialogsList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hDialogsList = WindowList_Create();
WindowList_Add(hDialogsList, event->hwndWindow, event->hContact);
BYTE fav = db_get_b(event->hContact, "FavContacts", "IsFavourite", 0);