Re: TreeView events
- Posted by euman at bellsouth.net Dec 11, 2001
- 499 views
Hello again Tyler, I thought I would give you alittle more to play with! Here it is, Good luck! global atom txtbuff global function filltvitem(atom Item, atom mask, atom state) poke4(tvitem + tvitem_hItem,Item) poke4(tvitem + tvitem_mask,mask) poke4(tvitem + tvitem_stateMask, state) txtbuff = myalloc(256) poke4(tvitem + tvitem_pszText,txtbuff) poke4(tvitem + tvitem_cchTextMax,256) return txtbuff end function function WndProc(atom hwnd, atom iMsg, atom wParam, atom lParam) elsif iMsg = WM_NOTIFY then id = peek4s(lParam + NMHDR_hwndFrom) if id = TreeView then iMsg = peek4s(lParam + NMHDR_code) if iMsg = TVN_ITEMEXPANDING then hItem = peek4u(lParam + NMTVHDR_itemNew) if peek4s(lParam + NMTVHDR_action) = TVE_EXPAND then itxtbuff = filltvitem(hItem, TVIF_TEXT, 0) item = SendMessage(id, TVM_GETITEM, 0, tvitem) BTW, I do not use Win32lib 'cos it's waayyy too slow for things like this. You really need to have an in-lined method because when a treeview is visible, your program generates WM_NOTIFY messages very often. Euman euman at bellsouth.net