summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_hooks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Skype/src/skype_hooks.cpp')
-rw-r--r--protocols/Skype/src/skype_hooks.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/protocols/Skype/src/skype_hooks.cpp b/protocols/Skype/src/skype_hooks.cpp
index 07ad8d2dc9..42155750c9 100644
--- a/protocols/Skype/src/skype_hooks.cpp
+++ b/protocols/Skype/src/skype_hooks.cpp
@@ -11,29 +11,28 @@ void CSkypeProto::InitHookList()
void CSkypeProto::UninitHookList()
{
for (int i = 0; i < CSkypeProto::hookList.getCount(); i++)
- {
::UnhookEvent(CSkypeProto::hookList[i]);
- }
+}
+
+HANDLE CSkypeProto::HookEvent(const char* szEvent, SkypeEventFunc handler)
+{
+ HANDLE hook = ::HookEventObj(szEvent, (MIRANDAHOOKOBJ)*( void**)&handler, this);
+ this->instanceHookList.insert(hook);
+ return hook;
}
void CSkypeProto::InitInstanceHookList()
{
- this->instanceHookList.insert(
- this->HookEvent(ME_OPT_INITIALISE, &CSkypeProto::OnOptionsInit));
- this->instanceHookList.insert(
- this->HookEvent(ME_USERINFO_INITIALISE, &CSkypeProto::OnUserInfoInit));
+ this->HookEvent(ME_OPT_INITIALISE, &CSkypeProto::OnOptionsInit);
+ this->HookEvent(ME_USERINFO_INITIALISE, &CSkypeProto::OnUserInfoInit);
- this->instanceHookList.insert(
- this->HookEvent(ME_MSG_PRECREATEEVENT, &CSkypeProto::OnMessagePreCreate));
+ this->HookEvent(ME_MSG_PRECREATEEVENT, &CSkypeProto::OnMessagePreCreate);
- this->instanceHookList.insert(
- this->HookEvent(ME_MSG_BUTTONPRESSED, &CSkypeProto::OnTabSRMMButtonPressed));
+ this->HookEvent(ME_MSG_BUTTONPRESSED, &CSkypeProto::OnTabSRMMButtonPressed);
}
void CSkypeProto::UninitInstanceHookList()
{
for (int i = 0; i < this->instanceHookList.getCount(); i++)
- {
::UnhookEvent(this->instanceHookList[i]);
- }
} \ No newline at end of file