diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c index 0abbed8a41a..50edfa4b2be 100644 --- a/dlls/comctl32/header.c +++ b/dlls/comctl32/header.c @@ -130,7 +130,7 @@ HEADER_DrawItem (WND *wndPtr, HDC32 hdc, INT32 iItem, BOOL32 bHotTrack) GetObject32A (phdi->hbm, sizeof(BITMAP32), (LPVOID)&bmp); textRect = r; - DrawText32A(hdc, phdi->pszText, lstrlen32A(phdi->pszText), + DrawText32W (hdc, phdi->pszText, lstrlen32W (phdi->pszText), &textRect, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_CALCRECT); tx = textRect.right - textRect.left; ry = r.bottom - r.top; @@ -182,7 +182,7 @@ HEADER_DrawItem (WND *wndPtr, HDC32 hdc, INT32 iItem, BOOL32 bHotTrack) r.left += 3; r.right -= 3; SetTextColor32 (hdc, bHotTrack ? COLOR_HIGHLIGHT : COLOR_BTNTEXT); - DrawText32A(hdc, phdi->pszText, lstrlen32A(phdi->pszText), + DrawText32W (hdc, phdi->pszText, lstrlen32W (phdi->pszText), &r, uTextJustify|DT_VCENTER|DT_SINGLELINE); if (oldBkMode != TRANSPARENT) SetBkMode32(hdc, oldBkMode); @@ -591,8 +591,8 @@ HEADER_GetItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) phdi->lParam = lpItem->lParam; if (phdi->mask & HDI_TEXT) { - if (lpItem->pszText != LPSTR_TEXTCALLBACK32A) - lstrcpyn32A (phdi->pszText, lpItem->pszText, phdi->cchTextMax); + if (lpItem->pszText != LPSTR_TEXTCALLBACK32W) + lstrcpynWtoA (phdi->pszText, lpItem->pszText, phdi->cchTextMax); else phdi->pszText = LPSTR_TEXTCALLBACK32A; } @@ -608,11 +608,58 @@ HEADER_GetItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) static LRESULT +HEADER_GetItem32W (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) +{ + HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr); + HDITEM32W *phdi = (HDITEM32W*)lParam; + INT32 nItem = (INT32)wParam; + HEADER_ITEM *lpItem; + + if (!phdi) + return FALSE; + if ((nItem < 0) || (nItem >= (INT32)infoPtr->uNumItem)) + return FALSE; + + TRACE (header, "[nItem=%d]\n", nItem); + + if (phdi->mask == 0) + return TRUE; + + lpItem = (HEADER_ITEM*)&infoPtr->items[nItem]; + if (phdi->mask & HDI_BITMAP) + phdi->hbm = lpItem->hbm; + + if (phdi->mask & HDI_FORMAT) + phdi->fmt = lpItem->fmt; + + if (phdi->mask & HDI_WIDTH) + phdi->cxy = lpItem->cxy; + + if (phdi->mask & HDI_LPARAM) + phdi->lParam = lpItem->lParam; + + if (phdi->mask & HDI_TEXT) { + if (lpItem->pszText != LPSTR_TEXTCALLBACK32W) + lstrcpyn32W (phdi->pszText, lpItem->pszText, phdi->cchTextMax); + else + phdi->pszText = LPSTR_TEXTCALLBACK32W; + } + + if (phdi->mask & HDI_IMAGE) + phdi->iImage = lpItem->iImage; + + if (phdi->mask & HDI_ORDER) + phdi->iOrder = lpItem->iOrder; + + return TRUE; +} + + +__inline__ static LRESULT HEADER_GetItemCount (WND *wndPtr) { HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr); - - return (infoPtr->uNumItem); + return infoPtr->uNumItem; } @@ -635,6 +682,17 @@ HEADER_GetItemRect (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) } +// << HEADER_GetOrderArray >> + + +__inline__ static LRESULT +HEADER_GetUnicodeFormat (WND *wndPtr) +{ + HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr); + return infoPtr->bUnicode; +} + + static LRESULT HEADER_HitTest (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) { @@ -695,11 +753,95 @@ HEADER_InsertItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) if (phdi->mask & HDI_TEXT) { if (phdi->pszText != LPSTR_TEXTCALLBACK32A) { len = lstrlen32A (phdi->pszText); - lpItem->pszText = COMCTL32_Alloc (len+1); - lstrcpy32A (lpItem->pszText, phdi->pszText); + lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR)); + lstrcpyAtoW (lpItem->pszText, phdi->pszText); } else - lpItem->pszText = LPSTR_TEXTCALLBACK32A; + lpItem->pszText = LPSTR_TEXTCALLBACK32W; + } + + if (phdi->mask & HDI_FORMAT) + lpItem->fmt = phdi->fmt; + + if (lpItem->fmt == 0) + lpItem->fmt = HDF_LEFT; + + if (phdi->mask & HDI_BITMAP) + lpItem->hbm = phdi->hbm; + + if (phdi->mask & HDI_LPARAM) + lpItem->lParam = phdi->lParam; + + if (phdi->mask & HDI_IMAGE) + lpItem->iImage = phdi->iImage; + + if (phdi->mask & HDI_ORDER) + lpItem->iOrder = phdi->iOrder; + + HEADER_SetItemBounds (wndPtr); + + hdc = GetDC32 (wndPtr->hwndSelf); + HEADER_Refresh (wndPtr, hdc); + ReleaseDC32 (wndPtr->hwndSelf, hdc); + + return nItem; +} + + +static LRESULT +HEADER_InsertItem32W (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) +{ + HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr); + HDITEM32W *phdi = (HDITEM32W*)lParam; + INT32 nItem = (INT32)wParam; + HEADER_ITEM *lpItem; + HDC32 hdc; + INT32 len; + + if ((phdi == NULL) || (nItem < 0)) + return -1; + + if (nItem > infoPtr->uNumItem) + nItem = infoPtr->uNumItem; + + if (infoPtr->uNumItem == 0) { + infoPtr->items = COMCTL32_Alloc (sizeof (HEADER_ITEM)); + infoPtr->uNumItem++; + } + else { + HEADER_ITEM *oldItems = infoPtr->items; + + infoPtr->uNumItem++; + infoPtr->items = COMCTL32_Alloc (sizeof (HEADER_ITEM) * infoPtr->uNumItem); + /* pre insert copy */ + if (nItem > 0) { + memcpy (&infoPtr->items[0], &oldItems[0], + nItem * sizeof(HEADER_ITEM)); + } + + /* post insert copy */ + if (nItem < infoPtr->uNumItem - 1) { + memcpy (&infoPtr->items[nItem+1], &oldItems[nItem], + (infoPtr->uNumItem - nItem) * sizeof(HEADER_ITEM)); + } + + COMCTL32_Free (oldItems); + } + + lpItem = (HEADER_ITEM*)&infoPtr->items[nItem]; + lpItem->bDown = FALSE; + + if (phdi->mask & HDI_WIDTH) + lpItem->cxy = phdi->cxy; + + if (phdi->mask & HDI_TEXT) { + if (phdi->pszText != LPSTR_TEXTCALLBACK32W) { + len = lstrlen32W (phdi->pszText); + lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR)); + lstrcpy32W (lpItem->pszText, phdi->pszText); + } + else + lpItem->pszText = LPSTR_TEXTCALLBACK32W; } if (phdi->mask & HDI_FORMAT) @@ -809,14 +951,18 @@ HEADER_SetItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) if (phdi->mask & HDI_TEXT) { if (phdi->pszText != LPSTR_TEXTCALLBACK32A) { - INT32 len = lstrlen32A (phdi->pszText); - if (lpItem->pszText) + if (lpItem->pszText) { COMCTL32_Free (lpItem->pszText); - lpItem->pszText = COMCTL32_Alloc (len+1); - lstrcpy32A (lpItem->pszText, phdi->pszText); + lpItem->pszText = NULL; + } + if (phdi->pszText) { + INT32 len = lstrlen32A (phdi->pszText); + lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR)); + lstrcpyAtoW (lpItem->pszText, phdi->pszText); + } } else - lpItem->pszText = LPSTR_TEXTCALLBACK32A; + lpItem->pszText = LPSTR_TEXTCALLBACK32W; } if (phdi->mask & HDI_WIDTH) @@ -839,6 +985,86 @@ HEADER_SetItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) } +static LRESULT +HEADER_SetItem32W (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) +{ + HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr); + HDITEM32W *phdi = (HDITEM32W*)lParam; + INT32 nItem = (INT32)wParam; + HEADER_ITEM *lpItem; + HDC32 hdc; + + if (phdi == NULL) + return FALSE; + if ((nItem < 0) || (nItem >= (INT32)infoPtr->uNumItem)) + return FALSE; + + TRACE (header, "[nItem=%d]\n", nItem); + + if (HEADER_SendHeaderNotify (wndPtr, HDN_ITEMCHANGING32A, nItem)) + return FALSE; + + lpItem = (HEADER_ITEM*)&infoPtr->items[nItem]; + if (phdi->mask & HDI_BITMAP) + lpItem->hbm = phdi->hbm; + + if (phdi->mask & HDI_FORMAT) + lpItem->fmt = phdi->fmt; + + if (phdi->mask & HDI_LPARAM) + lpItem->lParam = phdi->lParam; + + if (phdi->mask & HDI_TEXT) { + if (phdi->pszText != LPSTR_TEXTCALLBACK32W) { + if (lpItem->pszText) { + COMCTL32_Free (lpItem->pszText); + lpItem->pszText = NULL; + } + if (phdi->pszText) { + INT32 len = lstrlen32W (phdi->pszText); + lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR)); + lstrcpy32W (lpItem->pszText, phdi->pszText); + } + } + else + lpItem->pszText = LPSTR_TEXTCALLBACK32W; + } + + if (phdi->mask & HDI_WIDTH) + lpItem->cxy = phdi->cxy; + + if (phdi->mask & HDI_IMAGE) + lpItem->iImage = phdi->iImage; + + if (phdi->mask & HDI_ORDER) + lpItem->iOrder = phdi->iOrder; + + HEADER_SendHeaderNotify (wndPtr, HDN_ITEMCHANGED32A, nItem); + + HEADER_SetItemBounds (wndPtr); + hdc = GetDC32 (wndPtr->hwndSelf); + HEADER_Refresh (wndPtr, hdc); + ReleaseDC32 (wndPtr->hwndSelf, hdc); + + return TRUE; +} + + +// << HEADER_SetOrderArray >> + + +__inline__ static LRESULT +HEADER_SetUnicodeFormat (WND *wndPtr, WPARAM32 wParam) +{ + HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr); + BOOL32 bTemp = infoPtr->bUnicode; + + infoPtr->bUnicode = (BOOL32)wParam; + + return bTemp; +} + + static LRESULT HEADER_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) { @@ -862,6 +1088,7 @@ HEADER_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) infoPtr->iMoveItem = 0; infoPtr->himl = 0; infoPtr->iHotItem = -1; + infoPtr->bUnicode = IsWindowUnicode (wndPtr->hwndSelf); hdc = GetDC32 (0); hOldFont = SelectObject32 (hdc, GetStockObject32 (SYSTEM_FONT)); @@ -884,7 +1111,7 @@ HEADER_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) if (infoPtr->items) { lpItem = (HEADER_ITEM*)infoPtr->items; for (nItem = 0; nItem < infoPtr->uNumItem; nItem++, lpItem++) { - if ((lpItem->pszText) && (lpItem->pszText != LPSTR_TEXTCALLBACK32A)) + if ((lpItem->pszText) && (lpItem->pszText != LPSTR_TEXTCALLBACK32W)) COMCTL32_Free (lpItem->pszText); } COMCTL32_Free (infoPtr->items); @@ -1214,7 +1441,8 @@ HEADER_WindowProc (HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam) case HDM_GETITEM32A: return HEADER_GetItem32A (wndPtr, wParam, lParam); -// case HDM_GETITEM32W: + case HDM_GETITEM32W: + return HEADER_GetItem32W (wndPtr, wParam, lParam); case HDM_GETITEMCOUNT: return HEADER_GetItemCount (wndPtr); @@ -1223,7 +1451,9 @@ HEADER_WindowProc (HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam) return HEADER_GetItemRect (wndPtr, wParam, lParam); // case HDM_GETORDERARRAY: -// case HDM_GETUNICODEFORMAT: + + case HDM_GETUNICODEFORMAT: + return HEADER_GetUnicodeFormat (wndPtr); case HDM_HITTEST: return HEADER_HitTest (wndPtr, wParam, lParam); @@ -1231,7 +1461,8 @@ HEADER_WindowProc (HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam) case HDM_INSERTITEM32A: return HEADER_InsertItem32A (wndPtr, wParam, lParam); -// case HDM_INSERTITEM32W: + case HDM_INSERTITEM32W: + return HEADER_InsertItem32W (wndPtr, wParam, lParam); case HDM_LAYOUT: return HEADER_Layout (wndPtr, wParam, lParam); @@ -1242,9 +1473,13 @@ HEADER_WindowProc (HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam) case HDM_SETITEM32A: return HEADER_SetItem32A (wndPtr, wParam, lParam); -// case HDM_SETITEM32W: + case HDM_SETITEM32W: + return HEADER_SetItem32W (wndPtr, wParam, lParam); + // case HDM_SETORDERARRAY: -// case HDM_SETUNICODEFORMAT: + + case HDM_SETUNICODEFORMAT: + return HEADER_SetUnicodeFormat (wndPtr, wParam); case WM_CREATE: @@ -1274,6 +1509,8 @@ HEADER_WindowProc (HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam) case WM_MOUSEMOVE: return HEADER_MouseMove (wndPtr, wParam, lParam); +// case WM_NOTIFYFORMAT: + case WM_PAINT: return HEADER_Paint (wndPtr, wParam); diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c index 489b817fa55..2efee9dbfd1 100644 --- a/dlls/comctl32/status.c +++ b/dlls/comctl32/status.c @@ -20,7 +20,7 @@ /* * Fixme/Todo * 1) Don't hard code bar to bottom of window, allow CCS_TOP also. - + 2) Tooltip support (almost done). + * 2) Tooltip support (almost done). */ #define _MAX(a,b) (((a)>(b))?(a):(b)) @@ -95,19 +95,19 @@ STATUSBAR_DrawPart (HDC32 hdc, STATUSWINDOWPART *part) /* now draw text */ if (part->text) { int oldbkmode = SetBkMode32(hdc, TRANSPARENT); - LPSTR p = (LPSTR)part->text; + LPWSTR p = (LPWSTR)part->text; UINT32 align = DT_LEFT; - if (*p == '\t') { + if (*p == L'\t') { p++; align = DT_CENTER; - if (*p == '\t') { + if (*p == L'\t') { p++; align = DT_RIGHT; } } r.left += 3; - DrawText32A(hdc, p, lstrlen32A(p), &r, align|DT_VCENTER|DT_SINGLELINE); + DrawText32W (hdc, p, lstrlen32W (p), &r, align|DT_VCENTER|DT_SINGLELINE); if (oldbkmode != TRANSPARENT) SetBkMode32(hdc, oldbkmode); } @@ -332,16 +332,16 @@ STATUSBAR_GetParts (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) static LRESULT STATUSBAR_GetRect (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) { - STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr); + STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr); int part_num; LPRECT32 rect; part_num = ((INT32) wParam) & 0x00ff; rect = (LPRECT32) lParam; - if (self->simple) - *rect = self->part0.bound; + if (infoPtr->simple) + *rect = infoPtr->part0.bound; else - *rect = self->parts[part_num].bound; + *rect = infoPtr->parts[part_num].bound; return TRUE; } @@ -351,50 +351,70 @@ STATUSBAR_GetText32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) { STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr); STATUSWINDOWPART *part; - int part_num; + INT32 nPart; LRESULT result; - LPSTR out_text; - part_num = ((INT32) wParam) & 0x00ff; - out_text = (LPSTR) lParam; + nPart = ((INT32) wParam) & 0x00ff; if (self->simple) part = &self->part0; else - part = &self->parts[part_num]; + part = &self->parts[nPart]; if (part->style == SBT_OWNERDRAW) - result = (LRESULT) part->text; + result = (LRESULT)part->text; else { - result = part->text ? lstrlen32A(part->text) : 0; + result = part->text ? lstrlen32W (part->text) : 0; result |= (part->style << 16); - if (out_text) { - lstrcpy32A(out_text, part->text); - } + if (lParam) + lstrcpyWtoA ((LPSTR)lParam, part->text); } return result; } -// << STATUSBAR_GetText32W >> - - static LRESULT -STATUSBAR_GetTextLength32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) +STATUSBAR_GetText32W (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) { STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr); STATUSWINDOWPART *part; - int part_num; - DWORD result; - - part_num = ((INT32) wParam) & 0x00ff; + INT32 nPart; + LRESULT result; + nPart = ((INT32)wParam) & 0x00ff; if (self->simple) part = &self->part0; else - part = &self->parts[part_num]; + part = &self->parts[nPart]; + + if (part->style == SBT_OWNERDRAW) + result = (LRESULT)part->text; + else { + result = part->text ? lstrlen32W (part->text) : 0; + result |= (part->style << 16); + if (lParam) + lstrcpy32W ((LPWSTR)lParam, part->text); + } + return result; +} + + +static LRESULT +STATUSBAR_GetTextLength (WND *wndPtr, WPARAM32 wParam) +{ + STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr); + STATUSWINDOWPART *part; + INT32 part_num; + DWORD result; + + part_num = ((INT32) wParam) & 0x00ff; + + if (infoPtr->simple) + part = &infoPtr->part0; + else + part = &infoPtr->parts[part_num]; if (part->text) - result = lstrlen32A(part->text); + result = lstrlen32W(part->text); else result = 0; @@ -403,9 +423,6 @@ STATUSBAR_GetTextLength32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) } -// << STATUSBAR_GetTextLength32W >> - - static LRESULT STATUSBAR_GetTipText32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) { @@ -413,7 +430,6 @@ STATUSBAR_GetTipText32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) if (infoPtr->hwndToolTip) { TTTOOLINFO32A ti; - ti.cbSize = sizeof(TTTOOLINFO32A); ti.hwnd = wndPtr->hwndSelf; ti.uId = LOWORD(wParam); @@ -427,16 +443,39 @@ STATUSBAR_GetTipText32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) } -// << STATUSBAR_GetTipText32W >> -// << STATUSBAR_GetUnicodeFormat >> +static LRESULT +STATUSBAR_GetTipText32W (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) +{ + STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr); + + if (infoPtr->hwndToolTip) { + TTTOOLINFO32W ti; + ti.cbSize = sizeof(TTTOOLINFO32W); + ti.hwnd = wndPtr->hwndSelf; + ti.uId = LOWORD(wParam); + SendMessage32W (infoPtr->hwndToolTip, TTM_GETTEXT32W, 0, (LPARAM)&ti); + + if (ti.lpszText) + lstrcpyn32W ((LPWSTR)lParam, ti.lpszText, HIWORD(wParam)); + } + + return 0; +} + + +__inline__ static LRESULT +STATUSBAR_GetUnicodeFormat (WND *wndPtr) +{ + STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr); + return infoPtr->bUnicode; +} __inline__ static LRESULT STATUSBAR_IsSimple (WND *wndPtr) { - STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr); - - return self->simple; + STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr); + return infoPtr->simple; } @@ -464,7 +503,8 @@ STATUSBAR_SetIcon (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) INT32 nPart = (INT32)wParam & 0x00ff; HDC32 hdc; - if ((nPart < -1) || (nPart >= self->numParts)) return FALSE; + if ((nPart < -1) || (nPart >= self->numParts)) + return FALSE; hdc = GetDC32 (wndPtr->hwndSelf); if (nPart == -1) { @@ -512,9 +552,9 @@ static LRESULT STATUSBAR_SetParts (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) { STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr); + STATUSWINDOWPART *tmp; HDC32 hdc; LPINT32 parts; - STATUSWINDOWPART * tmp; int i; int oldNumParts; @@ -569,7 +609,7 @@ STATUSBAR_SetParts (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) for (i = nTipCount - 1; i >= self->numParts; i--) { - TRACE (statusbar, "delete tool %d\n", i); + FIXME (statusbar, "delete tool %d\n", i); } } @@ -607,7 +647,7 @@ STATUSBAR_SetText32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) if (!part) return FALSE; part->style = style; if (style == SBT_OWNERDRAW) { - part->text = text; + part->text = (LPWSTR)text; } else { /* duplicate string */ @@ -615,8 +655,8 @@ STATUSBAR_SetText32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) COMCTL32_Free (part->text); part->text = 0; if (text && (len = lstrlen32A(text))) { - part->text = COMCTL32_Alloc (len+1); - lstrcpy32A(part->text, text); + part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR)); + lstrcpyAtoW (part->text, text); } } @@ -628,23 +668,61 @@ STATUSBAR_SetText32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) } -// << STATUSBAR_SetText32W >> +static LRESULT +STATUSBAR_SetText32W (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) +{ + STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr); + STATUSWINDOWPART *part; + INT32 part_num, style, len; + LPWSTR text; + HDC32 hdc; + + text = (LPWSTR) lParam; + part_num = ((INT32) wParam) & 0x00ff; + style = ((INT32) wParam) & 0xff00; + + if ((self->simple) || (self->parts==NULL) || (part_num==255)) + part = &self->part0; + else + part = &self->parts[part_num]; + if (!part) return FALSE; + part->style = style; + if (style == SBT_OWNERDRAW) { + part->text = text; + } + else { + /* duplicate string */ + if (part->text) + COMCTL32_Free (part->text); + part->text = 0; + if (text && (len = lstrlen32W(text))) { + part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR)); + lstrcpy32W(part->text, text); + } + } + + hdc = GetDC32 (wndPtr->hwndSelf); + STATUSBAR_RefreshPart (wndPtr, part, hdc); + ReleaseDC32 (wndPtr->hwndSelf, hdc); + + return TRUE; +} static LRESULT STATUSBAR_SetTipText32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) { - STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr); - TTTOOLINFO32A ti; + STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr); TRACE (statusbar, "part %d: \"%s\"\n", (INT32)wParam, (LPSTR)lParam); - if (self->hwndToolTip) { + if (infoPtr->hwndToolTip) { + TTTOOLINFO32A ti; ti.cbSize = sizeof(TTTOOLINFO32A); ti.hwnd = wndPtr->hwndSelf; ti.uId = (INT32)wParam; ti.hinst = 0; ti.lpszText = (LPSTR)lParam; - SendMessage32A (self->hwndToolTip, TTM_UPDATETIPTEXT32A, + SendMessage32A (infoPtr->hwndToolTip, TTM_UPDATETIPTEXT32A, 0, (LPARAM)&ti); } @@ -652,20 +730,48 @@ STATUSBAR_SetTipText32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) } -// << STATUSBAR_SetTipText32W >> -// << STATUSBAR_SetUnicodeFormat >> +static LRESULT +STATUSBAR_SetTipText32W (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) +{ + STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr); + + TRACE (statusbar, "part %d: \"%s\"\n", (INT32)wParam, (LPSTR)lParam); + if (infoPtr->hwndToolTip) { + TTTOOLINFO32W ti; + ti.cbSize = sizeof(TTTOOLINFO32W); + ti.hwnd = wndPtr->hwndSelf; + ti.uId = (INT32)wParam; + ti.hinst = 0; + ti.lpszText = (LPWSTR)lParam; + SendMessage32W (infoPtr->hwndToolTip, TTM_UPDATETIPTEXT32W, + 0, (LPARAM)&ti); + } + + return 0; +} + + +__inline__ static LRESULT +STATUSBAR_SetUnicodeFormat (WND *wndPtr, WPARAM32 wParam) +{ + STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr); + BOOL32 bTemp = infoPtr->bUnicode; + + TRACE (statusbar, "(0x%x)\n", (BOOL32)wParam); + infoPtr->bUnicode = (BOOL32)wParam; + + return bTemp; +} static LRESULT STATUSBAR_Simple (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) { - STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr); - BOOL32 simple; + STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr); HDC32 hdc; NMHDR nmhdr; - simple = (BOOL32) wParam; - self->simple = simple; + infoPtr->simple = (BOOL32)wParam; /* send notification */ nmhdr.hwndFrom = wndPtr->hwndSelf; @@ -685,7 +791,7 @@ STATUSBAR_Simple (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) static LRESULT STATUSBAR_WMCreate (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) { - LPCREATESTRUCT32A lpCreate = (LPCREATESTRUCT32A) lParam; + LPCREATESTRUCT32A lpCreate = (LPCREATESTRUCT32A)lParam; NONCLIENTMETRICS32A nclm; RECT32 rect; int width, len; @@ -721,9 +827,18 @@ STATUSBAR_WMCreate (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) self->parts[0].style = 0; self->parts[0].hIcon = 0; - if ((len = lstrlen32A (lpCreate->lpszName))) { - self->parts[0].text = COMCTL32_Alloc (len + 1); - lstrcpy32A (self->parts[0].text, lpCreate->lpszName); + if (IsWindowUnicode (wndPtr->hwndSelf)) { + self->bUnicode = TRUE; + if ((len = lstrlen32W ((LPCWSTR)lpCreate->lpszName))) { + self->parts[0].text = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR)); + lstrcpy32W (self->parts[0].text, (LPCWSTR)lpCreate->lpszName); + } + } + else { + if ((len = lstrlen32A ((LPCSTR)lpCreate->lpszName))) { + self->parts[0].text = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR)); + lstrcpyAtoW (self->parts[0].text, (LPCSTR)lpCreate->lpszName); + } } if ((hdc = GetDC32 (0))) { @@ -800,49 +915,39 @@ STATUSBAR_WMDestroy (WND *wndPtr) static __inline__ LRESULT STATUSBAR_WMGetFont (WND *wndPtr) { - STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr); - - return self->hFont; + STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr); + return infoPtr->hFont; } static LRESULT STATUSBAR_WMGetText (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) { - STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr); + STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr); INT32 len; - if (!(self->parts[0].text)) + if (!(infoPtr->parts[0].text)) return 0; - len = lstrlen32A (self->parts[0].text); + len = lstrlen32W (infoPtr->parts[0].text); if (wParam > len) { - lstrcpy32A ((LPSTR)lParam, self->parts[0].text); - return len; + if (infoPtr->bUnicode) + lstrcpy32W ((LPWSTR)lParam, infoPtr->parts[0].text); + else + lstrcpyWtoA ((LPSTR)lParam, infoPtr->parts[0].text); + return len; } - else - return -1; -} - -static LRESULT -STATUSBAR_WMGetTextLength (WND *wndPtr) -{ - STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr); - - if (!(self->parts[0].text)) - return 0; - - return (lstrlen32A (self->parts[0].text)); + return -1; } __inline__ static LRESULT STATUSBAR_WMMouseMove (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) { - STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr); + STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr); - if (self->hwndToolTip) - STATUSBAR_RelayEvent (self->hwndToolTip, wndPtr->hwndSelf, + if (infoPtr->hwndToolTip) + STATUSBAR_RelayEvent (infoPtr->hwndToolTip, wndPtr->hwndSelf, WM_MOUSEMOVE, wParam, lParam); return 0; } @@ -908,9 +1013,9 @@ STATUSBAR_WMPaint (WND *wndPtr, WPARAM32 wParam) static LRESULT STATUSBAR_WMSetFont (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) { - STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr); + STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr); - self->hFont = (HFONT32)wParam; + infoPtr->hFont = (HFONT32)wParam; if (LOWORD(lParam) == TRUE) { HDC32 hdc = GetDC32 (wndPtr->hwndSelf); STATUSBAR_Refresh (wndPtr, hdc); @@ -924,22 +1029,30 @@ STATUSBAR_WMSetFont (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) static LRESULT STATUSBAR_WMSetText (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) { - STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr); + STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr); STATUSWINDOWPART *part; int len; HDC32 hdc; - if (self->numParts == 0) + if (infoPtr->numParts == 0) return FALSE; - part = &self->parts[0]; + part = &infoPtr->parts[0]; /* duplicate string */ if (part->text) COMCTL32_Free (part->text); part->text = 0; - if (lParam && (len = lstrlen32A((LPCSTR)lParam))) { - part->text = COMCTL32_Alloc (len+1); - lstrcpy32A (part->text, (LPCSTR)lParam); + if (infoPtr->bUnicode) { + if (lParam && (len = lstrlen32W((LPCWSTR)lParam))) { + part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR)); + lstrcpy32W (part->text, (LPCWSTR)lParam); + } + } + else { + if (lParam && (len = lstrlen32A((LPCSTR)lParam))) { + part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR)); + lstrcpyAtoW (part->text, (LPCSTR)lParam); + } } hdc = GetDC32 (wndPtr->hwndSelf); @@ -953,10 +1066,10 @@ STATUSBAR_WMSetText (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) static LRESULT STATUSBAR_WMSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) { - STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr); - INT32 width, x, y, flags; - RECT32 parent_rect; - HWND32 parent; + STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr); + INT32 width, x, y, flags; + RECT32 parent_rect; + HWND32 parent; /* Need to resize width to match parent */ flags = (INT32) wParam; @@ -971,10 +1084,10 @@ STATUSBAR_WMSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) GetClientRect32 (parent, &parent_rect); width = parent_rect.right - parent_rect.left; x = parent_rect.left; - y = parent_rect.bottom - self->height; + y = parent_rect.bottom - infoPtr->height; MoveWindow32 (wndPtr->hwndSelf, parent_rect.left, - parent_rect.bottom - self->height, - width, self->height, TRUE); + parent_rect.bottom - infoPtr->height, + width, infoPtr->height, TRUE); STATUSBAR_SetPartBounds (wndPtr); } return 0; @@ -1017,18 +1130,21 @@ StatusWindowProc (HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam) case SB_GETTEXT32A: return STATUSBAR_GetText32A (wndPtr, wParam, lParam); -// case SB_GETTEXT32W: + case SB_GETTEXT32W: + return STATUSBAR_GetText32W (wndPtr, wParam, lParam); case SB_GETTEXTLENGTH32A: - return STATUSBAR_GetTextLength32A (wndPtr, wParam, lParam); - -// case SB_GETTEXTLENGHT32W: + case SB_GETTEXTLENGTH32W: + return STATUSBAR_GetTextLength (wndPtr, wParam); case SB_GETTIPTEXT32A: return STATUSBAR_GetTipText32A (wndPtr, wParam, lParam); -// case SB_GETTIPTEXT32W: -// case SB_GETUNICODEFORMAT: + case SB_GETTIPTEXT32W: + return STATUSBAR_GetTipText32W (wndPtr, wParam, lParam); + + case SB_GETUNICODEFORMAT: + return STATUSBAR_GetUnicodeFormat (wndPtr); case SB_ISSIMPLE: return STATUSBAR_IsSimple (wndPtr); @@ -1048,13 +1164,17 @@ StatusWindowProc (HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam) case SB_SETTEXT32A: return STATUSBAR_SetText32A (wndPtr, wParam, lParam); -// case SB_SETTEXT32W: + case SB_SETTEXT32W: + return STATUSBAR_SetText32W (wndPtr, wParam, lParam); case SB_SETTIPTEXT32A: return STATUSBAR_SetTipText32A (wndPtr, wParam, lParam); -// case SB_SETTIPTEXT32W: -// case SB_SETUNICODEFORMAT: + case SB_SETTIPTEXT32W: + return STATUSBAR_SetTipText32W (wndPtr, wParam, lParam); + + case SB_SETUNICODEFORMAT: + return STATUSBAR_SetUnicodeFormat (wndPtr, wParam); case SB_SIMPLE: return STATUSBAR_Simple (wndPtr, wParam, lParam); @@ -1073,7 +1193,7 @@ StatusWindowProc (HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam) return STATUSBAR_WMGetText (wndPtr, wParam, lParam); case WM_GETTEXTLENGTH: - return STATUSBAR_WMGetTextLength (wndPtr); + return STATUSBAR_GetTextLength (wndPtr, 0); case WM_LBUTTONDBLCLK: return STATUSBAR_SendNotify (wndPtr, NM_DBLCLK); diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index f9a248b5f4e..00335450750 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -83,21 +83,21 @@ TOOLBAR_DrawString (TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, if (!(nState & TBSTATE_ENABLED)) { clrOld = SetTextColor32 (hdc, GetSysColor32 (COLOR_3DHILIGHT)); OffsetRect32 (&rcText, 1, 1); - DrawText32A (hdc, infoPtr->strings[btnPtr->iString], -1, + DrawText32W (hdc, infoPtr->strings[btnPtr->iString], -1, &rcText, infoPtr->dwDTFlags); SetTextColor32 (hdc, GetSysColor32 (COLOR_3DSHADOW)); OffsetRect32 (&rcText, -1, -1); - DrawText32A (hdc, infoPtr->strings[btnPtr->iString], -1, + DrawText32W (hdc, infoPtr->strings[btnPtr->iString], -1, &rcText, infoPtr->dwDTFlags); } else if (nState & TBSTATE_INDETERMINATE) { clrOld = SetTextColor32 (hdc, GetSysColor32 (COLOR_3DSHADOW)); - DrawText32A (hdc, infoPtr->strings[btnPtr->iString], -1, + DrawText32W (hdc, infoPtr->strings[btnPtr->iString], -1, &rcText, infoPtr->dwDTFlags); } else { clrOld = SetTextColor32 (hdc, GetSysColor32 (COLOR_BTNTEXT)); - DrawText32A (hdc, infoPtr->strings[btnPtr->iString], -1, + DrawText32W (hdc, infoPtr->strings[btnPtr->iString], -1, &rcText, infoPtr->dwDTFlags); } @@ -292,8 +292,8 @@ TOOLBAR_CalcStrings (WND *wndPtr, LPSIZE32 lpSize) if (!(btnPtr->fsState & TBSTATE_HIDDEN) && (btnPtr->iString > -1) && (btnPtr->iString < infoPtr->nNumStrings)) { - LPSTR lpText = infoPtr->strings[btnPtr->iString]; - GetTextExtentPoint32A (hdc, lpText, lstrlen32A(lpText), &sz); + LPWSTR lpText = infoPtr->strings[btnPtr->iString]; + GetTextExtentPoint32W (hdc, lpText, lstrlen32W (lpText), &sz); if (sz.cx > lpSize->cx) lpSize->cx = sz.cx; if (sz.cy > lpSize->cy) @@ -753,27 +753,28 @@ TOOLBAR_AddString32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) nIndex = infoPtr->nNumStrings; if (infoPtr->nNumStrings == 0) { infoPtr->strings = - COMCTL32_Alloc (sizeof(char *)); + COMCTL32_Alloc (sizeof(LPWSTR)); } else { - char **oldStrings = infoPtr->strings; + LPWSTR *oldStrings = infoPtr->strings; infoPtr->strings = - COMCTL32_Alloc (sizeof(char *) * (infoPtr->nNumStrings + 1)); + COMCTL32_Alloc (sizeof(LPWSTR) * (infoPtr->nNumStrings + 1)); memcpy (&infoPtr->strings[0], &oldStrings[0], - sizeof(char *) * infoPtr->nNumStrings); + sizeof(LPWSTR) * infoPtr->nNumStrings); COMCTL32_Free (oldStrings); } infoPtr->strings[infoPtr->nNumStrings] = - COMCTL32_Alloc (sizeof(char)*(len+1)); - lstrcpy32A (infoPtr->strings[infoPtr->nNumStrings], szString); + COMCTL32_Alloc (sizeof(WCHAR)*(len+1)); + lstrcpyAtoW (infoPtr->strings[infoPtr->nNumStrings], szString); infoPtr->nNumStrings++; } else { - char *p = (char*)lParam; + LPSTR p = (LPSTR)lParam; INT32 len; - if (p == NULL) return -1; + if (p == NULL) + return -1; TRACE (toolbar, "adding string(s) from array!\n"); nIndex = infoPtr->nNumStrings; while (*p) { @@ -782,20 +783,20 @@ TOOLBAR_AddString32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) if (infoPtr->nNumStrings == 0) { infoPtr->strings = - COMCTL32_Alloc (sizeof(char *)); + COMCTL32_Alloc (sizeof(LPWSTR)); } else { - char **oldStrings = infoPtr->strings; + LPWSTR *oldStrings = infoPtr->strings; infoPtr->strings = - COMCTL32_Alloc (sizeof(char *) * (infoPtr->nNumStrings + 1)); + COMCTL32_Alloc (sizeof(LPWSTR) * (infoPtr->nNumStrings + 1)); memcpy (&infoPtr->strings[0], &oldStrings[0], - sizeof(char *) * infoPtr->nNumStrings); + sizeof(LPWSTR) * infoPtr->nNumStrings); COMCTL32_Free (oldStrings); } infoPtr->strings[infoPtr->nNumStrings] = - COMCTL32_Alloc (sizeof(char)*(len+1)); - lstrcpy32A (infoPtr->strings[infoPtr->nNumStrings], p); + COMCTL32_Alloc (sizeof(WCHAR)*(len+1)); + lstrcpyAtoW (infoPtr->strings[infoPtr->nNumStrings], p); infoPtr->nNumStrings++; p += (len+1); @@ -806,7 +807,76 @@ TOOLBAR_AddString32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) } -// << TOOLBAR_AddString32W >> +static LRESULT +TOOLBAR_AddString32W (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) +{ + TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr); + INT32 nIndex; + + if ((wParam) && (HIWORD(lParam) == 0)) { + WCHAR szString[256]; + INT32 len; + TRACE (toolbar, "adding string from resource!\n"); + + len = LoadString32W ((HINSTANCE32)wParam, (UINT32)lParam, + szString, 256); + + TRACE (toolbar, "len=%d \"%s\"\n", len, debugstr_w(szString)); + nIndex = infoPtr->nNumStrings; + if (infoPtr->nNumStrings == 0) { + infoPtr->strings = + COMCTL32_Alloc (sizeof(LPWSTR)); + } + else { + LPWSTR *oldStrings = infoPtr->strings; + infoPtr->strings = + COMCTL32_Alloc (sizeof(LPWSTR) * (infoPtr->nNumStrings + 1)); + memcpy (&infoPtr->strings[0], &oldStrings[0], + sizeof(LPWSTR) * infoPtr->nNumStrings); + COMCTL32_Free (oldStrings); + } + + infoPtr->strings[infoPtr->nNumStrings] = + COMCTL32_Alloc (sizeof(WCHAR)*(len+1)); + lstrcpy32W (infoPtr->strings[infoPtr->nNumStrings], szString); + infoPtr->nNumStrings++; + } + else { + LPWSTR p = (LPWSTR)lParam; + INT32 len; + + if (p == NULL) + return -1; + TRACE (toolbar, "adding string(s) from array!\n"); + nIndex = infoPtr->nNumStrings; + while (*p) { + len = lstrlen32W (p); + TRACE (toolbar, "len=%d \"%s\"\n", len, debugstr_w(p)); + + if (infoPtr->nNumStrings == 0) { + infoPtr->strings = + COMCTL32_Alloc (sizeof(LPWSTR)); + } + else { + LPWSTR *oldStrings = infoPtr->strings; + infoPtr->strings = + COMCTL32_Alloc (sizeof(LPWSTR) * (infoPtr->nNumStrings + 1)); + memcpy (&infoPtr->strings[0], &oldStrings[0], + sizeof(LPWSTR) * infoPtr->nNumStrings); + COMCTL32_Free (oldStrings); + } + + infoPtr->strings[infoPtr->nNumStrings] = + COMCTL32_Alloc (sizeof(WCHAR)*(len+1)); + lstrcpy32W (infoPtr->strings[infoPtr->nNumStrings], p); + infoPtr->nNumStrings++; + + p += (len+1); + } + } + + return nIndex; +} static LRESULT @@ -2055,7 +2125,7 @@ TOOLBAR_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) infoPtr->cxMax = -1; infoPtr->bCaptured = FALSE; - infoPtr->bUnicode = FALSE; + infoPtr->bUnicode = IsWindowUnicode (wndPtr->hwndSelf); infoPtr->nButtonDown = -1; infoPtr->nOldHit = -1; @@ -2555,7 +2625,8 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam) case TB_ADDSTRING32A: return TOOLBAR_AddString32A (wndPtr, wParam, lParam); -// case TB_ADDSTRING32W: + case TB_ADDSTRING32W: + return TOOLBAR_AddString32W (wndPtr, wParam, lParam); case TB_AUTOSIZE: return TOOLBAR_AutoSize (wndPtr, wParam, lParam); diff --git a/include/commctrl.h b/include/commctrl.h index 2e6c31c1715..3de344a23e6 100644 --- a/include/commctrl.h +++ b/include/commctrl.h @@ -119,56 +119,57 @@ typedef struct tagNMTOOLTIPSCREATED /* StatusWindow */ -#define STATUSCLASSNAME16 "msctls_statusbar" -#define STATUSCLASSNAME32A "msctls_statusbar32" -#define STATUSCLASSNAME32W L"msctls_statusbar32" -#define STATUSCLASSNAME WINELIB_NAME_AW(STATUSCLASSNAME) +#define STATUSCLASSNAME16 "msctls_statusbar" +#define STATUSCLASSNAME32A "msctls_statusbar32" +#define STATUSCLASSNAME32W L"msctls_statusbar32" +#define STATUSCLASSNAME WINELIB_NAME_AW(STATUSCLASSNAME) -#define SBT_NOBORDERS 0x0100 -#define SBT_POPOUT 0x0200 -#define SBT_RTLREADING 0x0400 /* not supported */ -#define SBT_TOOLTIPS 0x0800 -#define SBT_OWNERDRAW 0x1000 +#define SBT_NOBORDERS 0x0100 +#define SBT_POPOUT 0x0200 +#define SBT_RTLREADING 0x0400 /* not supported */ +#define SBT_TOOLTIPS 0x0800 +#define SBT_OWNERDRAW 0x1000 -#define SBARS_SIZEGRIP 0x0100 +#define SBARS_SIZEGRIP 0x0100 -#define SB_SETTEXT32A (WM_USER+1) -#define SB_SETTEXT32W (WM_USER+11) -#define SB_SETTEXT WINELIB_NAME_AW(SB_SETTEXT) -#define SB_GETTEXT32A (WM_USER+2) -#define SB_GETTEXT32W (WM_USER+13) -#define SB_GETTEXT WINELIB_NAME_AW(SB_GETTEXT) -#define SB_GETTEXTLENGTH32A (WM_USER+3) -#define SB_GETTEXTLENGTH32W (WM_USER+12) -#define SB_GETTEXTLENGTH WINELIB_NAME_AW(SB_GETTEXTLENGTH) +#define SB_SETTEXT32A (WM_USER+1) +#define SB_SETTEXT32W (WM_USER+11) +#define SB_SETTEXT WINELIB_NAME_AW(SB_SETTEXT) +#define SB_GETTEXT32A (WM_USER+2) +#define SB_GETTEXT32W (WM_USER+13) +#define SB_GETTEXT WINELIB_NAME_AW(SB_GETTEXT) +#define SB_GETTEXTLENGTH32A (WM_USER+3) +#define SB_GETTEXTLENGTH32W (WM_USER+12) +#define SB_GETTEXTLENGTH WINELIB_NAME_AW(SB_GETTEXTLENGTH) +#define SB_SETPARTS (WM_USER+4) +#define SB_GETPARTS (WM_USER+6) +#define SB_GETBORDERS (WM_USER+7) +#define SB_SETMINHEIGHT (WM_USER+8) +#define SB_SIMPLE (WM_USER+9) +#define SB_GETRECT (WM_USER+10) +#define SB_ISSIMPLE (WM_USER+14) +#define SB_SETICON (WM_USER+15) +#define SB_SETTIPTEXT32A (WM_USER+16) +#define SB_SETTIPTEXT32W (WM_USER+17) +#define SB_SETTIPTEXT WINELIB_NAME_AW(SB_SETTIPTEXT) +#define SB_GETTIPTEXT32A (WM_USER+18) +#define SB_GETTIPTEXT32W (WM_USER+19) +#define SB_GETTIPTEXT WINELIB_NAME_AW(SB_GETTIPTEXT) +#define SB_GETICON (WM_USER+20) +#define SB_SETBKCOLOR CCM_SETBKCOLOR /* lParam = bkColor */ +#define SB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define SB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT -#define SB_SETPARTS (WM_USER+4) -#define SB_GETPARTS (WM_USER+6) -#define SB_GETBORDERS (WM_USER+7) -#define SB_SETMINHEIGHT (WM_USER+8) -#define SB_SIMPLE (WM_USER+9) -#define SB_GETRECT (WM_USER+10) -#define SB_ISSIMPLE (WM_USER+14) -#define SB_SETICON (WM_USER+15) -#define SB_SETTIPTEXT32A (WM_USER+16) -#define SB_SETTIPTEXT32W (WM_USER+17) -#define SB_SETTIPTEXT WINELIB_NAME_AW(SB_SETTIPTEXT) -#define SB_GETTIPTEXT32A (WM_USER+18) -#define SB_GETTIPTEXT32W (WM_USER+19) -#define SB_GETTIPTEXT WINELIB_NAME_AW(SB_GETTIPTEXT) -#define SB_GETICON (WM_USER+20) -#define SB_SETBKCOLOR CCM_SETBKCOLOR /* lParam = bkColor */ - -#define SBN_FIRST (0U-880U) -#define SBN_LAST (0U-899U) -#define SBN_SIMPLEMODECHANGE (SBN_FIRST-0) +#define SBN_FIRST (0U-880U) +#define SBN_LAST (0U-899U) +#define SBN_SIMPLEMODECHANGE (SBN_FIRST-0) HWND32 WINAPI CreateStatusWindow32A (INT32, LPCSTR, HWND32, UINT32); HWND32 WINAPI CreateStatusWindow32W (INT32, LPCWSTR, HWND32, UINT32); -#define CreateStatusWindow WINELIB_NAME_AW(CreateStatusWindow) +#define CreateStatusWindow WINELIB_NAME_AW(CreateStatusWindow) VOID WINAPI DrawStatusText32A (HDC32, LPRECT32, LPCSTR, UINT32); VOID WINAPI DrawStatusText32W (HDC32, LPRECT32, LPCWSTR, UINT32); -#define DrawStatusText WINELIB_NAME_AW(DrawStatusText) +#define DrawStatusText WINELIB_NAME_AW(DrawStatusText) VOID WINAPI MenuHelp (UINT32, WPARAM32, LPARAM, HMENU32, HINSTANCE32, HWND32, LPUINT32); @@ -1160,11 +1161,11 @@ typedef struct tagNMTTDISPINFOW #define RB_SETPALETTE (WM_USER+37) #define RB_GETPALETTE (WM_USER+38) #define RB_MOVEBAND (WM_USER+39) -#define RB_GETDROPTARGET CCS_GETDROPTARGET -#define RB_SETCOLORSCHEME CCS_SETCOLORSCHEME -#define RB_GETCOLORSCHEME CCS_GETCOLORSCHEME -#define RB_SETUNICODEFORMAT CCS_SETUNICODEFORMAT -#define RB_GETUNICODEFORMAT CCS_GETUNICODEFORMAT +#define RB_GETDROPTARGET CCM_GETDROPTARGET +#define RB_SETCOLORSCHEME CCM_SETCOLORSCHEME +#define RB_GETCOLORSCHEME CCM_GETCOLORSCHEME +#define RB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define RB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT #define RBN_FIRST (0U-831U) #define RBN_LAST (0U-859U) @@ -1218,7 +1219,7 @@ typedef struct tagREBARBANDINFOW UINT32 fStyle; COLORREF clrFore; COLORREF clrBack; - LPSTR lpText; + LPWSTR lpText; UINT32 cch; INT32 iImage; HWND32 hwndChild; @@ -1248,7 +1249,7 @@ typedef REBARBANDINFO32W const *LPCREBARBANDINFO32W; typedef struct tagNMREBARCHILDSIZE { NMHDR hdr; - UINT32 iBand; + UINT32 uBand; UINT32 wID; RECT32 rcChild; RECT32 rcBand; @@ -2443,6 +2444,10 @@ LPVOID WINAPI DSA_GetItemPtr (const HDSA, INT32); INT32 WINAPI DSA_InsertItem (const HDSA, INT32, LPVOID); BOOL32 WINAPI DSA_SetItem (const HDSA, INT32, LPVOID); +typedef INT32 (CALLBACK *DSAENUMPROC)(LPVOID, DWORD); +VOID WINAPI DSA_EnumCallback (const HDSA, DSAENUMPROC, LPARAM); +BOOL32 WINAPI DSA_DestroyCallback (const HDSA, DSAENUMPROC, LPARAM); + /* Dynamic Pointer Array */ @@ -2476,6 +2481,15 @@ BOOL32 WINAPI DPA_Sort (const HDPA, PFNDPACOMPARE, LPARAM); INT32 WINAPI DPA_Search (const HDPA, LPVOID, INT32, PFNDPACOMPARE, LPARAM, UINT32); +#define DPAM_SORT 0x0001 + +BOOL32 WINAPI DPA_Merge (const HDPA, const HDPA, DWORD, PFNDPACOMPARE, LPVOID, LPARAM); + +typedef INT32 (CALLBACK *DPAENUMPROC)(LPVOID, DWORD); +VOID WINAPI DPA_EnumCallback (const HDPA, DPAENUMPROC, LPARAM); +BOOL32 WINAPI DPA_DestroyCallback (const HDPA, DPAENUMPROC, LPARAM); + + #define DPA_GetPtrCount(hdpa) (*(INT32*)(hdpa)) #define DPA_GetPtrPtr(hdpa) (*((LPVOID**)((BYTE*)(hdpa)+sizeof(INT32)))) #define DPA_FastGetPtr(hdpa,i) (DPA_GetPtrPtr(hdpa)[i]) diff --git a/include/header.h b/include/header.h index 9194fa757b5..df6e0e5e40c 100644 --- a/include/header.h +++ b/include/header.h @@ -12,7 +12,7 @@ typedef struct { INT32 cxy; HBITMAP32 hbm; - LPSTR pszText; + LPWSTR pszText; INT32 fmt; LPARAM lParam; INT32 iImage; @@ -34,6 +34,7 @@ typedef struct BOOL32 bCaptured; /* Is the mouse captured? */ BOOL32 bPressed; /* Is a header item pressed (down)? */ BOOL32 bTracking; /* Is in tracking mode? */ + BOOL32 bUnicode; /* Unicode flag */ INT32 iMoveItem; /* index of tracked item. (Tracking mode) */ INT32 xTrackOffset; /* distance between the right side of the tracked item and the cursor */ INT32 xOldTrack; /* track offset (see above) after the last WM_MOUSEMOVE */ diff --git a/include/listview.h b/include/listview.h index ea5ff90f586..b140b8006a6 100644 --- a/include/listview.h +++ b/include/listview.h @@ -35,6 +35,7 @@ typedef struct tagLISTVIEW_INFO RECT32 rcList; /* "client" area of the list (without header) */ BOOL32 bFocus; + DWORD dwExStyle; /* extended listview style */ HDPA hdpaItems; } LISTVIEW_INFO; diff --git a/include/ole2.h b/include/ole2.h index ee876291464..dc604c4fcee 100644 --- a/include/ole2.h +++ b/include/ole2.h @@ -8,7 +8,7 @@ /* to be implemented */ typedef LPVOID LPMESSAGEFILTER; typedef LPVOID LPDROPTARGET; -typedef LPVOID LPMONIKER; +typedef struct tagMONIKER *LPMONIKER, IMoniker; #define S_OK 0 #define S_FALSE 1 diff --git a/include/rebar.h b/include/rebar.h index 52ba2d7c0a7..d5033be2192 100644 --- a/include/rebar.h +++ b/include/rebar.h @@ -34,7 +34,7 @@ typedef struct tagREBAR_BAND RECT32 rcCapText; /* calculated caption text rectangle */ RECT32 rcChild; /* calculated child rectangle */ - LPSTR lpText; + LPWSTR lpText; HWND32 hwndPrevParent; } REBAR_BAND; @@ -51,6 +51,7 @@ typedef struct tagREBAR_INFO SIZE32 calcSize; /* calculated rebar size */ BOOL32 bAutoResize; /* auto resize deadlock flag */ + BOOL32 bUnicode; /* Unicode flag */ HCURSOR32 hcurArrow; /* handle to the arrow cursor */ HCURSOR32 hcurHorz; /* handle to the EW cursor */ HCURSOR32 hcurVert; /* handle to the NS cursor */ diff --git a/include/status.h b/include/status.h index 6f4718df380..ec44579dfb8 100644 --- a/include/status.h +++ b/include/status.h @@ -12,7 +12,7 @@ typedef struct INT32 x; INT32 style; RECT32 bound; - LPSTR text; + LPWSTR text; HICON32 hIcon; } STATUSWINDOWPART; @@ -25,8 +25,9 @@ typedef struct HWND32 hwndToolTip; HFONT32 hFont; HFONT32 hDefaultFont; - COLORREF clrBk; /* background color */ - STATUSWINDOWPART part0; /* simple window */ + COLORREF clrBk; /* background color */ + BOOL32 bUnicode; /* unicode flag */ + STATUSWINDOWPART part0; /* simple window */ STATUSWINDOWPART *parts; } STATUSWINDOWINFO; diff --git a/include/toolbar.h b/include/toolbar.h index 55686d75468..55a4274c310 100644 --- a/include/toolbar.h +++ b/include/toolbar.h @@ -60,7 +60,7 @@ typedef struct tagTOOLBAR_INFO RECT32 rcBound; /* bounding rectangle */ TBUTTON_INFO *buttons; /* pointer to button array */ - CHAR **strings; + LPWSTR *strings; /* pointer to string array */ } TOOLBAR_INFO; diff --git a/include/tooltips.h b/include/tooltips.h index 34d1d2757c2..22e7bb5dff9 100644 --- a/include/tooltips.h +++ b/include/tooltips.h @@ -18,19 +18,19 @@ typedef struct tagTT_SUBCLASS_INFO typedef struct tagTTTOOL_INFO { - UINT32 uFlags; - HWND32 hwnd; - UINT32 uId; - RECT32 rect; + UINT32 uFlags; + HWND32 hwnd; + UINT32 uId; + RECT32 rect; HINSTANCE32 hinst; - LPSTR lpszText; - LPARAM lParam; + LPWSTR lpszText; + LPARAM lParam; } TTTOOL_INFO; typedef struct tagTOOLTIPS_INFO { - CHAR szTipText[INFOTIPSIZE]; + WCHAR szTipText[INFOTIPSIZE]; BOOL32 bActive; BOOL32 bTrackActive; UINT32 uNumTools;