ng, lParam As Any) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" ( _
    lpvDest As Any, lpvSource As Any, ByVal cbCopy As Long)
Private Const WM_NOTIFY As Long = &amp;H4E
Private Const H_MAX As Long = &amp;HFFFF + 1
Private Type NMHDR
    hwndFrom As Long
    idfrom As Long
    code As Long
End Type
Private Const TVN_FIRST = H_MAX - 400                  '// treeview
Private Const TVN_ITEMEXPANDING As Long = (TVN_FIRST - 5)
Private Const TVE_COLLAPSE As Long = &amp;H1
Private C