Jump to content

Do something to multiple windows


rrand
 Share

Recommended Posts

Hello! Thanks for AutoIt, a really wonderful program.

I'm sorry if this has been asked before. I couldn't find it and this is the first time in a month that I've got stumped.

I have an unknown number of windows running, and their names change. For the sake of this example I'll just use Notepad as an example, even if it doesn't work the same way I use it.

Let's say I have five Notepad windows open, and the name of the document is first in the Title and it is always followed by " - Notepad" like "Some Text - Notepad". Let's say I want to do something to all of these windows.

I tried getting a list of processes with ProcessList and then I can get the PIDs of all these notepad.exe's that are running. But how do I search the Title when I only have a PID? I didn't see any function that allowed you to search the title from a PID.

So then I thought about using the window functions, but they only search and find the first window that matches. I need to loop through and do something to all the windows. How can I do that?

Thanks in advance.

Link to comment
Share on other sites

Sorry I forgot to mention what might be important. What I want to do is close these windows, but there is a program running that auto restarts them after they are closed. So I can't simply Stop the first window and then search again because it will come back. I have to keep a list of these windows in memory and then do something to them one at a time.

Thanks.

Link to comment
Share on other sites

Larry,

That is an excellent idea and is really thinking outside the box! Thank you.

Now if I can only get that Window Rename function to work. The only other time I tried it was when I was trying to rename a DOS window and it wouldn't change.

Ron

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...