Scene Hierarchy Order logic?

I am trying to make an Editor Tool that helps with accessing and managing Objects in the Hierarchy window.

Since the Hierarchy window does not seem to be accessible. I Started by using FindObjectsOfType to get an unsorted list of objects.

Its clear that the Hierarchy window Initially sort the list by Alphabetical order.
But for objects that have equal name i cant figure out the logic of ordering!

Ive try a few methods including InstanceID But no luck. !-(

Any ideas for the logic of ordering? Or Any other alternative methods to access the scenes Game objects Hierarchy?

Thanks In Advance!

You can access the hierarchy window by first giving it focus, and then going EditorWindow.focusedWindow see here. For the logic, see there. I think If two strings are the same, they just get sorted one after the other.