Implemented TREEVIEW_InsertItemW.

This commit is contained in:
Francois Boisvert 1999-07-24 12:14:51 +00:00 committed by Alexandre Julliard
parent b0dd717da2
commit 56c36e3dc7
3 changed files with 55 additions and 7 deletions

View File

@ -1870,7 +1870,55 @@ TREEVIEW_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
return (LRESULT) iItem; return (LRESULT) iItem;
} }
static LRESULT
TREEVIEW_InsertItemW(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TVINSERTSTRUCTW *tvisW;
TVINSERTSTRUCTA tvisA;
LRESULT lRes;
tvisW = (LPTVINSERTSTRUCTW)lParam;
tvisA.hParent = tvisW->hParent;
tvisA.hInsertAfter = tvisW->hInsertAfter;
tvisA.DUMMYUNIONNAME.item.mask = tvisW->DUMMYUNIONNAME.item.mask;
tvisA.DUMMYUNIONNAME.item.hItem = tvisW->DUMMYUNIONNAME.item.hItem;
tvisA.DUMMYUNIONNAME.item.state = tvisW->DUMMYUNIONNAME.item.state;
tvisA.DUMMYUNIONNAME.item.stateMask = tvisW->DUMMYUNIONNAME.item.stateMask;
tvisA.DUMMYUNIONNAME.item.cchTextMax = tvisW->DUMMYUNIONNAME.item.cchTextMax;
if(tvisW->DUMMYUNIONNAME.item.pszText)
{
if (tvisW->DUMMYUNIONNAME.item.pszText!=LPSTR_TEXTCALLBACKW)
{
int len = lstrlenW (tvisW->DUMMYUNIONNAME.item.pszText)+1;
tvisA.DUMMYUNIONNAME.item.pszText = COMCTL32_Alloc (len);
lstrcpyWtoA (tvisA.DUMMYUNIONNAME.item.pszText,
tvisW->DUMMYUNIONNAME.item.pszText );
}
else
{
tvisA.DUMMYUNIONNAME.item.pszText = LPSTR_TEXTCALLBACKA;
tvisA.DUMMYUNIONNAME.item.cchTextMax = 0;
}
}
tvisA.DUMMYUNIONNAME.item.iImage = tvisW->DUMMYUNIONNAME.item.iImage;
tvisA.DUMMYUNIONNAME.item.iSelectedImage = tvisW->DUMMYUNIONNAME.item.iSelectedImage;
tvisA.DUMMYUNIONNAME.item.cChildren = tvisW->DUMMYUNIONNAME.item.cChildren;
tvisA.DUMMYUNIONNAME.item.lParam = tvisW->DUMMYUNIONNAME.item.lParam;
lRes = TREEVIEW_InsertItemA(hwnd,wParam,(LPARAM)&tvisA);
if (tvisA.DUMMYUNIONNAME.item.pszText!=LPSTR_TEXTCALLBACKA)
{
COMCTL32_Free(tvisA.DUMMYUNIONNAME.item.pszText);
}
return lRes;
}
@ -3458,8 +3506,7 @@ TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TREEVIEW_InsertItemA (hwnd, wParam, lParam); return TREEVIEW_InsertItemA (hwnd, wParam, lParam);
case TVM_INSERTITEMW: case TVM_INSERTITEMW:
FIXME("Unimplemented msg TVM_INSERTITEM32W\n"); return TREEVIEW_InsertItemW(hwnd,wParam,lParam);;
return 0;
case TVM_DELETEITEM: case TVM_DELETEITEM:
return TREEVIEW_DeleteItem (hwnd, wParam, lParam); return TREEVIEW_DeleteItem (hwnd, wParam, lParam);
@ -3716,3 +3763,5 @@ TREEVIEW_Unregister (void)
UnregisterClassA (WC_TREEVIEWA, (HINSTANCE)NULL); UnregisterClassA (WC_TREEVIEWA, (HINSTANCE)NULL);
} }

View File

@ -150,7 +150,7 @@ static void FillTreeView(IShellFolder * lpsf, LPITEMIDLIST pidl, HTREEITEM hPar
tvins.hInsertAfter = hPrev; tvins.hInsertAfter = hPrev;
tvins.hParent = hParent; tvins.hParent = hParent;
hPrev = (HTREEITEM)TreeView_InsertItemA (hwndTreeView, &tvins); hPrev = (HTREEITEM)TreeView_InsertItemW (hwndTreeView, &tvins);
} }
} }

View File

@ -1994,13 +1994,12 @@ typedef struct tagNMTVGETINFOTIPW
#define TreeView_InsertItemA(hwnd, phdi) \ #define TreeView_InsertItemA(hwnd, phdi) \
(INT)SendMessageA((hwnd), TVM_INSERTITEMA, 0, \ (INT)SendMessageA((hwnd), TVM_INSERTITEMA, 0, \
(LPARAM)(LPTVINSERTSTRUCTA)(phdi)) (LPARAM)(LPTVINSERTSTRUCTA)(phdi))
#define TreeView_InsertItemW(hwnd,phdi) \
(INT)SendMessageW((hwnd), TVM_INSERTITEMW, 0, \
(LPARAM)(LPTVINSERTSTRUCTW)(phdi))
#define TreeView_DeleteItem(hwnd, hItem) \ #define TreeView_DeleteItem(hwnd, hItem) \
(BOOL)SendMessageA((hwnd), TVM_DELETEITEM, 0, (LPARAM)(HTREEITEM)(hItem)) (BOOL)SendMessageA((hwnd), TVM_DELETEITEM, 0, (LPARAM)(HTREEITEM)(hItem))
#define TreeView_DeleteAllItems(hwnd) \ #define TreeView_DeleteAllItems(hwnd) \