Try using CallWindowProc, to call the original window process instead of calling it directly. Also, remember to give all your windows unique (within the parent window) identifiers.
Code:
#define IDC_MYTOOLBAR 100
LRESULT CALLBACK ToolbarProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WNDPROC wp = (WNDPROC)GetWindowLong(hWnd, GWL_USERDATA);
return CallWindowProc(wp, hWnd, uMsg, wParam, lParam);
}
(...)
WNDPROC wp;
g_hwndToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL,
WS_CHILD|WS_VISIBLE|CCS_NODIVIDER |CCS_NORESIZE|TBSTYLE_TOOLTIPS |TBSTYLE_WRAPABLE,
64, -2, 640, 24, hwnd, (HMENU)IDC_MYTOOLBAR, g_hInstance, NULL);
wp = (WNDPROC)SetWindowLong(g_hwndToolbar, GWL_WNDPROC, (LONG)ToolbarProc);
SetWindowLong(g_hwndToolbar, GWL_USERDATA, (LONG)wp);
(...)
(Or Get/SetWindowLongPtr for 64-bit compatability)