summaryrefslogtreecommitdiff
path: root/plugins/Popup/src/services.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Popup/src/services.cpp')
-rw-r--r--plugins/Popup/src/services.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp
index d545d5ff9e..fab7339724 100644
--- a/plugins/Popup/src/services.cpp
+++ b/plugins/Popup/src/services.cpp
@@ -330,12 +330,13 @@ struct SafeUnhookEventParam
HANDLE hEvent;
};
-static void CALLBACK SafeUnhookEventFunc(ULONG_PTR dwParam)
+static void CALLBACK SafeUnhookEventFunc(void *param)
{
- UnhookEvent(((SafeUnhookEventParam *)dwParam)->hEvent);
- PostMessage(((SafeUnhookEventParam *)dwParam)->hwndPopup, UM_POPUPUNHOOKCOMPLETE, 0,
- (LPARAM)((SafeUnhookEventParam *)dwParam)->hEvent);
- delete (SafeUnhookEventParam *)dwParam;
+ SafeUnhookEventParam *p = (SafeUnhookEventParam*)param;
+
+ UnhookEvent(p->hEvent);
+ PostMessage(p->hwndPopup, UM_POPUPUNHOOKCOMPLETE, 0, (LPARAM)p->hEvent);
+ delete p;
}
INT_PTR Popup_UnhookEventAsync(WPARAM wParam, LPARAM lParam)
@@ -343,7 +344,7 @@ INT_PTR Popup_UnhookEventAsync(WPARAM wParam, LPARAM lParam)
SafeUnhookEventParam *param = new SafeUnhookEventParam;
param->hwndPopup = (HWND)wParam;
param->hEvent = (HANDLE)lParam;
- QueueUserAPC(SafeUnhookEventFunc, hMainThread, (ULONG_PTR)param);
+ CallFunctionAsync(SafeUnhookEventFunc, param);
return 0;
}