summaryrefslogtreecommitdiff
path: root/plugins/ContactsPlus/src/main.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-06 22:12:20 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-06 22:12:20 +0000
commit9de0202a0b12838d505825413c3cbcce5edabc11 (patch)
tree6f1f707f3e17c19e5cd08745e76c5299f9ba827b /plugins/ContactsPlus/src/main.cpp
parent4e3088029101cc1e9bbc46984910a47bc0530e8f (diff)
cleanup of the unnecessary UnhookEvent() calls
git-svn-id: http://svn.miranda-ng.org/main/trunk@3909 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ContactsPlus/src/main.cpp')
-rw-r--r--plugins/ContactsPlus/src/main.cpp51
1 files changed, 17 insertions, 34 deletions
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp
index 84c42bca68..1bac904867 100644
--- a/plugins/ContactsPlus/src/main.cpp
+++ b/plugins/ContactsPlus/src/main.cpp
@@ -34,15 +34,6 @@ HANDLE ghSendWindowList;
HANDLE ghRecvWindowList;
gAckList gaAckData;
-HANDLE hServiceSend;
-HANDLE hServiceReceive;
-
-HANDLE hHookModulesLoaded = NULL;
-HANDLE hHookDBEventAdded = NULL;
-HANDLE hHookContactDeleted = NULL;
-HANDLE hHookContactSettingChanged = NULL;
-HANDLE hHookPreBuildContactMenu = NULL;
-
HANDLE hContactMenuItem = NULL;
PLUGININFOEX pluginInfo = {
@@ -179,7 +170,7 @@ static int HookModulesLoaded(WPARAM wParam, LPARAM lParam)
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONTACTS));
hContactMenuItem = Menu_AddContactMenuItem(&mi);
- hHookPreBuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, HookPreBuildContactMenu);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU, HookPreBuildContactMenu);
ghSendWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0); // no need to destroy this
ghRecvWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0); // no need to destroy this
@@ -251,33 +242,25 @@ extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfo);
InitCommonControls();
- InitI18N();
-
- //init hooks
- hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, HookModulesLoaded);
- hHookDBEventAdded = HookEvent(ME_DB_EVENT_ADDED, HookDBEventAdded);
- hHookContactDeleted = HookEvent(ME_DB_CONTACT_DELETED, HookContactDeleted);
- hHookContactSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, HookContactSettingChanged);
- //create services
- hServiceSend = CreateServiceFunction(MS_CONTACTS_SEND, ServiceSendCommand);
- hServiceReceive = CreateServiceFunction(MS_CONTACTS_RECEIVE, ServiceReceiveCommand);
- //define event sounds
- SkinAddNewSound("RecvContacts", LPGEN("Incoming Contacts"), "contacts.wav");
- SkinAddNewSound("SentContacts", LPGEN("Outgoing Contacts"), "ocontacts.wav");
+ InitI18N();
- return 0;
+ //init hooks
+ HookEvent(ME_SYSTEM_MODULESLOADED, HookModulesLoaded);
+ HookEvent(ME_DB_EVENT_ADDED, HookDBEventAdded);
+ HookEvent(ME_DB_CONTACT_DELETED, HookContactDeleted);
+ HookEvent(ME_DB_CONTACT_SETTINGCHANGED, HookContactSettingChanged);
+
+ //create services
+ CreateServiceFunction(MS_CONTACTS_SEND, ServiceSendCommand);
+ CreateServiceFunction(MS_CONTACTS_RECEIVE, ServiceReceiveCommand);
+
+ //define event sounds
+ SkinAddNewSound("RecvContacts", LPGEN("Incoming Contacts"), "contacts.wav");
+ SkinAddNewSound("SentContacts", LPGEN("Outgoing Contacts"), "ocontacts.wav");
+ return 0;
}
extern "C" __declspec(dllexport) int Unload(void)
{
- UnhookEvent(hHookModulesLoaded);
- UnhookEvent(hHookDBEventAdded);
- UnhookEvent(hHookContactDeleted);
- UnhookEvent(hHookContactSettingChanged);
- UnhookEvent(hHookPreBuildContactMenu);
-
- DestroyServiceFunction(hServiceSend);
- DestroyServiceFunction(hServiceReceive);
-
- return 0;
+ return 0;
}