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.

How to Process depending upon which Window Shows Up

Keywords:  multiple windows  

Question:

I was wondering what the best way is of checking for the existence of multiple windows? I'm trying to write a program to check for several possible results, each of which has a slightly different window, and was wondering how to do this within a loop that checks for ANY window and then checks to see WHICH window showed up and then act on the results.

Answer:

Assuming that you want to wait for one of several windows to show up before proceeding.
mywin=0
while mywin==0
   TimeDelay(1)
   if WinExist("Apples") then mywin=1
   if WinExist("Pears") then mywin=2
   if WinExist("Grapefruit") then mywin=3
endwhile
then you work with the mywin variable...
Article ID:   W13374
Filename:   Process depending upon Multiple Windows.txt
File Created: 1999:04:15:16:53:36
Last Updated: 1999:04:15:16:53:36