In the onLeftMouseDown( ) event for a treeview object, use the getItemByPos( ) method as follows:

function TREEVIEW1_onLeftMouseDown(flags, col, row)

  oItem = THIS.getItemByPos( col, row )

  if type('oItem') = 'O' // oItem contains an object referencel

    // do something with the item

  endif