Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: parent and child windows
What am I missing? Please help.
The big test is this:
Size the main parent window to take up only some of the screen. Now make a window you are interested in appear.
Can you grab the new window with the mouse and move it OFF the parent? If you can move it off the parent, it is also a parent window. If it stays inside the parent and is unable to move outside, it is a child.
However here is another test.
Do a FileOpen in WinBatch studio. the OPEN window that pops up is a parent window
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.
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)Or, if you continue to have problems with Sendkeys or SendkeysChild not working, it might be because you are not specifying the correct window title, or the window title might have additional spaces in the name, that are not apparent to the naked eye.
Here's a modified version of the parent child script to work with that shows the window title length, and substitutes question marks for spaces, so you can really see what's going on...
parents=WinItemize() thisone=AskItemList("Choose a Parent Window",parents,@tab,@sorted,@single) psize=strlen(thisone) xxx=strreplace(thisone," ","?") Message("Parent window size=%psize%",xxx) children=WinItemChild(thisone) child=AskItemList("Children of %thisone%",children,@tab,@sorted,@single) csize=strlen(child) xxx=strreplace(child," ","?") Message("Child window size=%csize%",xxx)
One of our users also provided the following modified code to allow the Parent-Child Finder Script to run alongside the program, so that you can "single-step" through your program and use this program to tell you the Parent and Child names along the way.
: CODE STARTS HERE while AskYesNo("Wincheck","Check another Window?") allwins=Winitemize() mywind=AskItemList("Windows",allwins,@tab,@unsorted,@single) children=WinItemChild(mywind) a=strreplace(children, @tab, @crlf) message(mywind, a) endwhile : CODE ENDS HEREWhen writing install code, you could have up 3 windows, the script above, the installing program itself and Notepad; then run through the install, get the names of the Windows and write the program "on the fly". Unless you get a syntax error, this works consistently with most Windows programs.
Article ID: W13364
Filename: Figure out parent and child windows.txt
File Created: 2001:05:24:13:29:14
Last Updated: 2001:05:24:13:29:14