From a1c684f50ed38ef5200c9b8f7537da7fd33a2e22 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 10 Jul 2012 20:50:42 +0000 Subject: almost destroyed all toolbar-related perversions git-svn-id: http://svn.miranda-ng.org/main/trunk@895 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TopToolBar/toolbar.cpp | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'plugins/TopToolBar') diff --git a/plugins/TopToolBar/toolbar.cpp b/plugins/TopToolBar/toolbar.cpp index 45add6f4f7..02338c69b7 100644 --- a/plugins/TopToolBar/toolbar.cpp +++ b/plugins/TopToolBar/toolbar.cpp @@ -649,24 +649,6 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara switch(msg) { case WM_CREATE: g_ctrl->hWnd = hwnd; - - // if we're working in skinned clist, receive the standard buttons & customizations - if (g_CustomProc && g_ctrl->hWnd) - g_CustomProc(TTB_WINDOW_HANDLE, g_ctrl->hWnd, g_CustomProcParam); - { - CLISTFrame Frame = { 0 }; - Frame.cbSize = sizeof(Frame); - Frame.tname = _T("Toolbar"); - Frame.hWnd = hwnd; - Frame.align = alTop; - Frame.Flags = F_VISIBLE | F_NOBORDER | F_LOCKED | F_TCHAR | F_NO_SUBCONTAINER; - Frame.height = 18; - g_ctrl->hFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0); - } - - // receive all buttons - NotifyEventHooks(hTTBInitButtons, 0, 0); - NotifyEventHooks(hTTBModuleLoaded, 0, 0); return FALSE; case WM_MOVE: @@ -762,11 +744,31 @@ static INT_PTR OnEventFire(WPARAM wParam, LPARAM lParam) RegisterClass(&wndclass); g_ctrl->pButtonList = (SortedList*)&Buttons; - g_ctrl->hWnd = CreateWindow(pluginname, pluginname, + g_ctrl->hWnd = CreateWindow(pluginname, _T("Toolbar"), WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0, 0, 0, 0, parent, NULL, hInst, NULL); SetWindowLongPtr(g_ctrl->hWnd, 0, (LPARAM)g_ctrl); + // if we're working in skinned clist, receive the standard buttons & customizations + if (g_CustomProc && g_ctrl->hWnd) + g_CustomProc(TTB_WINDOW_HANDLE, g_ctrl->hWnd, g_CustomProcParam); + + // if there's no customized frames, create our own + if (g_ctrl->hFrame == NULL) { + CLISTFrame Frame = { 0 }; + Frame.cbSize = sizeof(Frame); + Frame.tname = _T("Toolbar"); + Frame.hWnd = g_ctrl->hWnd; + Frame.align = alTop; + Frame.Flags = F_VISIBLE | F_NOBORDER | F_LOCKED | F_TCHAR; + Frame.height = 18; + g_ctrl->hFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0); + } + + // receive all buttons + NotifyEventHooks(hTTBInitButtons, 0, 0); + NotifyEventHooks(hTTBModuleLoaded, 0, 0); + ttbOptionsChanged(); bEventFired = true; -- cgit v1.2.3