My C++ program needs to run something from a script and take over control of the resulting window. I know how to use XQueryTree() to get a list of children from the root window, but can't find anything on how to interpret these. In what order will the child windows be given and how can I navigate them to find a specific one? Or would it be easier to run the scripts directly inside a window I created earlier?