Explanation of Child Windows
Keywords: Explanation Child Window WinExistChild
Question:
My boss & myself are having some difficulty in using "if WinExistChild" and the other "Child" commands. It seems we're not understanding what exactly a "Child" window really is.Say for example, if our parent window is called "SMX". When we issue the command,
run("c:\smx\smx.exe","") winwaitexist("SMX/Application/userid",10);parent window if winexist("SMX/Application/userid")==@true then timedelay(5);a delay for the program to settle down. if winexistchild("SMX/Application/userid","SMX/Application")==@true then sendkeyschild("SMX/Application/userid","SMX/Application","{ENTER}") endif winclose("SMX/Application/userid") endifOr another way to look at this help request. What, EXACTLY, is a Child window?Thanks for any help!
Answer:
How to tell if a windows is a parent or child window. The terminology is confusing.You can run a seperate script that will help you see the parent child relationship between the different windows.. Here's a script to help you separate the parent and child windows. This code first of all makes a list of all parent windows, and allows you to choose one. Then it gets the list of all children of that parent for your perusal.
parents=WinItemize() thisone=AskItemList("Choose a Parent Window",parents,@tab,@sorted,@single) children=WinItemChild(thisone) child=AskItemList("Children of %thisone%",children,@tab,@sorted,@single)However here is how I do it.
- Start the main application.
- Adjust size so I can see some of my wallpaper behind the application.
- Now I bring up the window I am wondering about.
- Then I grab the window with the mouse and attempt to move it over the wall paper.
- If I can move the window so that it can cover the wallpaper, then it is a parent window.
- If the window cuts off at the edge of the parent window, then it is a child window.
To see an example of each.
- Parent owned by another parent.
Do a FileOpen in WinBatch studio. the OPEN window that pops up is a parent window
- A child window. Open a few wbt files in WinBatch studio. Select Window Menu Cascade so it arranges them all up nicely.
Then grab one of them with a mouse and try to drag it over the wallpaper. Notice it cuts off at the edge of the main Winbatch Studio window. It is a child window.
Article ID: W15019