Index: toolbar.c =================================================================== --- toolbar.c (revision 42933) +++ toolbar.c (working copy) @@ -5194,7 +5194,7 @@ static LRESULT -TOOLBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs) +TOOLBAR_Create (HWND hwnd, LPARAM lParam) { TOOLBAR_INFO *infoPtr = (TOOLBAR_INFO *)GetWindowLongPtrW(hwnd, 0); DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE); @@ -5202,7 +5202,38 @@ TRACE("hwnd = %p\n", hwnd); + /* initialize info structure */ + infoPtr->nButtonWidth = 23; + infoPtr->nButtonHeight = 22; + infoPtr->nBitmapHeight = 16; + infoPtr->nBitmapWidth = 16; + + infoPtr->nMaxTextRows = 1; + infoPtr->cxMin = -1; + infoPtr->cxMax = -1; + infoPtr->nNumBitmaps = 0; + infoPtr->nNumStrings = 0; + + infoPtr->bCaptured = FALSE; + infoPtr->nButtonDown = -1; + infoPtr->nButtonDrag = -1; + infoPtr->nOldHit = -1; + infoPtr->nHotItem = -1; + infoPtr->hwndNotify = ((LPCREATESTRUCTW)lParam)->hwndParent; + infoPtr->dwDTFlags = (dwStyle & TBSTYLE_LIST) ? DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_END_ELLIPSIS: DT_CENTER | DT_END_ELLIPSIS; + infoPtr->bAnchor = FALSE; /* no anchor highlighting */ + infoPtr->bDragOutSent = FALSE; + infoPtr->iVersion = 0; + infoPtr->hwndSelf = hwnd; + infoPtr->bDoRedraw = TRUE; + infoPtr->clrBtnHighlight = CLR_DEFAULT; + infoPtr->clrBtnShadow = CLR_DEFAULT; + infoPtr->szPadding.cx = DEFPAD_CX; + infoPtr->szPadding.cy = DEFPAD_CY; + infoPtr->iListGap = DEFLISTGAP; + infoPtr->iTopMargin = default_top_margin(infoPtr); infoPtr->dwStyle = dwStyle; + infoPtr->tbim.iButton = -1; GetClientRect(hwnd, &infoPtr->client_rect); infoPtr->bUnicode = infoPtr->hwndNotify && (NFR_UNICODE == SendMessageW(hwnd, WM_NOTIFYFORMAT, (WPARAM)hwnd, (LPARAM)NF_REQUERY)); @@ -5933,9 +5964,10 @@ static LRESULT -TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, const CREATESTRUCTW *lpcs) +TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam) { TOOLBAR_INFO *infoPtr; + LPCREATESTRUCTA cs = (LPCREATESTRUCTA)lParam; DWORD styleadd = 0; /* allocate memory for info structure */ @@ -5947,39 +5979,6 @@ infoPtr->nRows = 1; infoPtr->nWidth = 0; - /* initialize info structure */ - infoPtr->nButtonWidth = 23; - infoPtr->nButtonHeight = 22; - infoPtr->nBitmapHeight = 16; - infoPtr->nBitmapWidth = 16; - - infoPtr->nMaxTextRows = 1; - infoPtr->cxMin = -1; - infoPtr->cxMax = -1; - infoPtr->nNumBitmaps = 0; - infoPtr->nNumStrings = 0; - - infoPtr->bCaptured = FALSE; - infoPtr->nButtonDown = -1; - infoPtr->nButtonDrag = -1; - infoPtr->nOldHit = -1; - infoPtr->nHotItem = -1; - infoPtr->hwndNotify = lpcs->hwndParent; - infoPtr->dwDTFlags = (lpcs->style & TBSTYLE_LIST) ? DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_END_ELLIPSIS: DT_CENTER | DT_END_ELLIPSIS; - infoPtr->bAnchor = FALSE; /* no anchor highlighting */ - infoPtr->bDragOutSent = FALSE; - infoPtr->iVersion = 0; - infoPtr->hwndSelf = hwnd; - infoPtr->bDoRedraw = TRUE; - infoPtr->clrBtnHighlight = CLR_DEFAULT; - infoPtr->clrBtnShadow = CLR_DEFAULT; - infoPtr->szPadding.cx = DEFPAD_CX; - infoPtr->szPadding.cy = DEFPAD_CY; - infoPtr->iListGap = DEFLISTGAP; - infoPtr->iTopMargin = default_top_margin(infoPtr); - infoPtr->dwStyle = lpcs->style; - infoPtr->tbim.iButton = -1; - /* fix instance handle, if the toolbar was created by CreateToolbarEx() */ if (!GetWindowLongPtrW (hwnd, GWLP_HINSTANCE)) { HINSTANCE hInst = (HINSTANCE)GetWindowLongPtrW (GetParent (hwnd), GWLP_HINSTANCE); @@ -6032,14 +6031,14 @@ * */ if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) - && !(lpcs->style & TBSTYLE_TRANSPARENT)) + && !(cs->style & TBSTYLE_TRANSPARENT)) styleadd |= TBSTYLE_TRANSPARENT; - if (!(lpcs->style & (CCS_TOP | CCS_NOMOVEY))) { + if (!(cs->style & (CCS_TOP | CCS_NOMOVEY))) { styleadd |= CCS_TOP; /* default to top */ - SetWindowLongW (hwnd, GWL_STYLE, lpcs->style | styleadd); + SetWindowLongW (hwnd, GWL_STYLE, cs->style | styleadd); } - return DefWindowProcW (hwnd, WM_NCCREATE, wParam, (LPARAM)lpcs); + return DefWindowProcW (hwnd, WM_NCCREATE, wParam, lParam); } @@ -6763,7 +6762,7 @@ /* case WM_CHAR: */ case WM_CREATE: - return TOOLBAR_Create (hwnd, (CREATESTRUCTW*)lParam); + return TOOLBAR_Create (hwnd, lParam); case WM_DESTROY: return TOOLBAR_Destroy (infoPtr); @@ -6810,7 +6809,7 @@ return TOOLBAR_NCCalcSize (hwnd, wParam, lParam); case WM_NCCREATE: - return TOOLBAR_NCCreate (hwnd, wParam, (CREATESTRUCTW*)lParam); + return TOOLBAR_NCCreate (hwnd, wParam, lParam); case WM_NCPAINT: return TOOLBAR_NCPaint (hwnd, wParam, lParam);