WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Window Manipulation

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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")
endif
Or 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.

To see an example of each.

  1. Parent owned by another parent.

    Do a FileOpen in WinBatch studio. the OPEN window that pops up is a parent window

  2. 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
File Created: 2001:11:08:12:41:22
Last Updated: 2001:11:08:12:41:22