From 9d366f1f409d4271a71d68cd8db5e352acd9db9b Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Mon, 4 Feb 2002 18:37:32 +0000 Subject: [PATCH] Added implementation of SetItemW. --- dlls/comctl32/treeview.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 1be989ba008..babbda7355f 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -1987,6 +1987,40 @@ TREEVIEW_GetItemW(TREEVIEW_INFO *infoPtr, LPTVITEMEXA tvItem) return TRUE; } +static LRESULT +TREEVIEW_SetItemW(TREEVIEW_INFO *infoPtr, LPTVITEMEXW tvItem) +{ + TVITEMEXA tvItemA; + INT len; + LRESULT rc; + + tvItemA.mask = tvItem->mask; + tvItemA.hItem = tvItem->hItem; + tvItemA.state = tvItem->state; + tvItemA.stateMask = tvItem->stateMask; + len = WideCharToMultiByte(CP_ACP, 0, tvItem->pszText, -1, + NULL ,0 , NULL,NULL); + if (len) + { + len ++; + tvItemA.pszText = HeapAlloc(GetProcessHeap(),0,len); + len = WideCharToMultiByte(CP_ACP, 0, tvItem->pszText, -1, + tvItemA.pszText ,len , NULL,NULL); + } + else + tvItemA.pszText = NULL; + tvItemA.cchTextMax = tvItem->cchTextMax; + tvItemA.iImage = tvItem->iImage; + tvItemA.iSelectedImage = tvItem->iSelectedImage; + tvItemA.cChildren = tvItem->cChildren; + tvItemA.lParam = tvItem->lParam; + tvItemA.iIntegral = tvItem->iIntegral; + + rc = TREEVIEW_SetItemA(infoPtr,&tvItemA); + HeapFree(GetProcessHeap(),0,tvItemA.pszText); + return rc; +} + static LRESULT TREEVIEW_GetItemState(TREEVIEW_INFO *infoPtr, HTREEITEM wineItem, UINT mask) { @@ -5043,7 +5077,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return TREEVIEW_SetItemA(infoPtr, (LPTVITEMEXA)lParam); case TVM_SETITEMW: - FIXME("Unimplemented msg TVM_SETITEMW\n"); + return TREEVIEW_SetItemW(infoPtr, (LPTVITEMEXW)lParam); return 0; case TVM_SETLINECOLOR: