diff options
author | George Hazan <george.hazan@gmail.com> | 2016-02-19 11:22:10 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-02-19 11:22:10 +0000 |
commit | a886e1caf3d3d563b43aaa230144b3e8f40a3d4e (patch) | |
tree | 112e365c41b67aebe5543d3cc0f333bb35998976 /plugins/YAPP/src | |
parent | 0a434b502ca329afd6a7afd0dc474238e146ccd5 (diff) |
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@16307 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/YAPP/src')
-rw-r--r-- | plugins/YAPP/src/notify.h | 1 | ||||
-rw-r--r-- | plugins/YAPP/src/notify_imp.cpp | 40 | ||||
-rw-r--r-- | plugins/YAPP/src/yapp.cpp | 2 |
3 files changed, 10 insertions, 33 deletions
diff --git a/plugins/YAPP/src/notify.h b/plugins/YAPP/src/notify.h index 7f39eb6d65..62cbb53e81 100644 --- a/plugins/YAPP/src/notify.h +++ b/plugins/YAPP/src/notify.h @@ -2,6 +2,5 @@ #define _NOTIFY_IMP_INC
void InitNotify();
-void DeinitNotify();
#endif
diff --git a/plugins/YAPP/src/notify_imp.cpp b/plugins/YAPP/src/notify_imp.cpp index a1b020dd18..748e73dfc8 100644 --- a/plugins/YAPP/src/notify_imp.cpp +++ b/plugins/YAPP/src/notify_imp.cpp @@ -1,7 +1,5 @@ #include "stdafx.h"
-HANDLE hhkShow=0, hhkUpdate=0, hhkRemove=0;
-
//struct
int Popup2Show(WPARAM, LPARAM lParam)
@@ -106,42 +104,24 @@ int NotifyOptionsInitialize(WPARAM wParam, LPARAM) return 0;
}
-HANDLE hEventNotifyOptInit, hEventNotifyModulesLoaded;
-HANDLE hAvChangeEvent;
-
int NotifyModulesLoaded(WPARAM, LPARAM)
{
- hEventNotifyOptInit = HookEvent(ME_NOTIFY_OPT_INITIALISE, NotifyOptionsInitialize);
- hAvChangeEvent = HookEvent(ME_AV_AVATARCHANGED, AvatarChanged);
+ HookEvent(ME_NOTIFY_OPT_INITIALISE, NotifyOptionsInitialize);
+ HookEvent(ME_AV_AVATARCHANGED, AvatarChanged);
return 0;
}
-HANDLE hServicesNotify[4];
void InitNotify()
{
- hhkShow = HookEvent(ME_NOTIFY_SHOW, Popup2Show);
- hhkUpdate = HookEvent(ME_NOTIFY_UPDATE, Popup2Update);
- hhkRemove = HookEvent(ME_NOTIFY_REMOVE, Popup2Remove);
-
- hServicesNotify[0] = CreateServiceFunction("Popup2/DefaultActions", svcPopup2DefaultActions);
-
- hServicesNotify[1] = CreateServiceFunction(MS_POPUP2_SHOW, svcPopup2Show);
- hServicesNotify[2] = CreateServiceFunction(MS_POPUP2_UPDATE, svcPopup2Update);
- hServicesNotify[3] = CreateServiceFunction(MS_POPUP2_REMOVE, svcPopup2Remove);
+ HookEvent(ME_NOTIFY_SHOW, Popup2Show);
+ HookEvent(ME_NOTIFY_UPDATE, Popup2Update);
+ HookEvent(ME_NOTIFY_REMOVE, Popup2Remove);
- hEventNotifyModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, NotifyModulesLoaded);
-}
-
-void DeinitNotify()
-{
- UnhookEvent(hhkShow);
- UnhookEvent(hhkUpdate);
- UnhookEvent(hhkRemove);
+ CreateServiceFunction("Popup2/DefaultActions", svcPopup2DefaultActions);
- UnhookEvent(hAvChangeEvent);
- UnhookEvent(hEventNotifyOptInit);
- UnhookEvent(hEventNotifyModulesLoaded);
+ CreateServiceFunction(MS_POPUP2_SHOW, svcPopup2Show);
+ CreateServiceFunction(MS_POPUP2_UPDATE, svcPopup2Update);
+ CreateServiceFunction(MS_POPUP2_REMOVE, svcPopup2Remove);
- for (int i = 0; i < 4; i++)
- DestroyServiceFunction(hServicesNotify[i]);
+ HookEvent(ME_SYSTEM_MODULESLOADED, NotifyModulesLoaded);
}
diff --git a/plugins/YAPP/src/yapp.cpp b/plugins/YAPP/src/yapp.cpp index 8dd71bb01b..3068d68baa 100644 --- a/plugins/YAPP/src/yapp.cpp +++ b/plugins/YAPP/src/yapp.cpp @@ -210,7 +210,6 @@ int PreShutdown(WPARAM, LPARAM) {
bShutdown = true;
DeinitMessagePump();
- DeinitNotify();
return 0;
}
@@ -233,7 +232,6 @@ extern "C" int __declspec(dllexport) Load(void) extern "C" int __declspec(dllexport) Unload()
{
- DeinitNotify();
DeleteObject(hFontFirstLine);
DeleteObject(hFontSecondLine);
DeleteObject(hFontTime);
|