diff options
Diffstat (limited to 'plugins/TopToolBar')
-rw-r--r-- | plugins/TopToolBar/src/toolbar.cpp | 7 | ||||
-rw-r--r-- | plugins/TopToolBar/src/toolbarwnd.cpp | 10 |
2 files changed, 4 insertions, 13 deletions
diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp index a8c037a7ac..ecb7db6de1 100644 --- a/plugins/TopToolBar/src/toolbar.cpp +++ b/plugins/TopToolBar/src/toolbar.cpp @@ -5,7 +5,7 @@ pfnCustomProc g_CustomProc = NULL; LPARAM g_CustomProcParam = 0;
TTBCtrl *g_ctrl = NULL;
-INT_PTR OnEventFire(WPARAM wParam, LPARAM lParam);
+void CALLBACK OnEventFire();
HWND hwndContactList = 0;
@@ -575,9 +575,7 @@ static int OnModulesLoad(WPARAM, LPARAM) ArrangeButtons();
- HANDLE hEvent = CreateEvent(NULL, TRUE, TRUE, NULL);//anonymous event
- if (hEvent != 0)
- CallService(MS_SYSTEM_WAITONHANDLE, (WPARAM)hEvent, (LPARAM)"TTB_ONSTARTUPFIRE");
+ Miranda_WaitOnHandle(OnEventFire);
if (HookEvent(ME_BACKGROUNDCONFIG_CHANGED, OnBGChange)) {
char buf[256];
@@ -662,7 +660,6 @@ int LoadToolbarModule() CreateServiceFunction(TTB_LAUNCHSERVICE, LaunchService);
CreateServiceFunction("TopToolBar/SetCustomProc", TTBSetCustomProc);
- CreateServiceFunction("TTB_ONSTARTUPFIRE", OnEventFire);
buttonWndProc = (WNDPROC)CallService("Button/GetWindowProc", 0, 0);
WNDCLASSEX wc = {0};
diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp index 8962a36af0..f02645e039 100644 --- a/plugins/TopToolBar/src/toolbarwnd.cpp +++ b/plugins/TopToolBar/src/toolbarwnd.cpp @@ -238,14 +238,11 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara /////////////////////////////////////////////////////////////////////////////////////////
-INT_PTR OnEventFire(WPARAM wParam, LPARAM)
+void CALLBACK OnEventFire()
{
- CallService(MS_SYSTEM_REMOVEWAIT, wParam, 0);
- CloseHandle((HANDLE)wParam);
-
HWND parent = pcli->hwndContactList;
if (parent == NULL) // no clist, no buttons
- return -1;
+ return;
WNDCLASS wndclass = {0};
wndclass.lpfnWndProc = TopToolBarProc;
@@ -284,8 +281,6 @@ INT_PTR OnEventFire(WPARAM wParam, LPARAM) // receive buttons
NotifyEventHooks(hTTBModuleLoaded, 0, 0);
-
- return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -309,6 +304,5 @@ int LoadBackgroundOptions() GetClientRect(g_ctrl->hWnd, &rc);
InvalidateRect(g_ctrl->hWnd, &rc, TRUE);
UpdateWindow(g_ctrl->hWnd);
-
return 0;
}
|