Announcement

Collapse
No announcement yet.

A Question about Treeview Macros

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • LRantanen
    Guest replied
    Came back because I forgot to say that following modification makes Treeview_DeleteAllItems macro to work

    Code:
    FUNCTION TreeView_DeleteAllItems (BYVAL hWnd AS DWORD) AS LONG
        LOCAL dwItem AS DWORD
        dwItem = %TVI_ROOT
        FUNCTION = SendMessage(hWnd, %TVM_DELETEITEM, 0, dwItem)
    END FUNCTION
    But still, could somebody explain me why?

    Lasse Rantanen
    [email protected]

    ------------------

    Leave a comment:


  • LRantanen
    Guest started a topic A Question about Treeview Macros

    A Question about Treeview Macros

    Hello, it's me and the Treeview again.

    In COMMCTRL.INC following two macros are defined

    Code:
    %TVI_ROOT         = &HFFFF0000???
    
    FUNCTION TreeView_DeleteItem (BYVAL hWnd AS DWORD, BYVAL hitem AS DWORD) AS LONG
        FUNCTION = SendMessage(hWnd, %TVM_DELETEITEM, 0, hitem)
    END FUNCTION
    
    FUNCTION TreeView_DeleteAllItems (BYVAL hWnd AS DWORD) AS LONG
        FUNCTION = SendMessage(hWnd, %TVM_DELETEITEM, 0, %TVI_ROOT)
    END FUNCTION
    Now I don't understand why following happens.

    If I make following call
    Code:
        TreeView_DeleteItem hWndTreeView, %TVI_ROOT
    treeview gets cleared, but not if I call
    Code:
        TreeView_DeleteAllItems hWndTreeView
    The way I read the macro definitions makes me think that in both cases I finally make equal call to SendMessage. Why different result? Just curious, not real problem.

    Lasse Rantanen
    [email protected]
Working...
X