Get tree when it is in window body

How I can get tree when it is in window body?

How I can realise tree.getChecked() when tree is in window body?

I solved this problem

window.getBody() will return the inner content of the window.
And you can always set ID for the tree, and later user $$(id) to get the tree object.