Re: TreeView events

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu