Jump to content

How to winactive from multiple common exe processes


Recommended Posts

Hi All!

My problem:

I have multiple processes of the same process name from different file paths that I want to loop through with WinActivate.

What would be the best way to either run through the processes with that process name, record their PID to an array, and then WinActivate with each process ID recorded?

Or can you obtain the process ID when you know the file path of a process?

Open to ideas and suggestions!

Thanks

Link to comment
Share on other sites

I did, but I have 8 instances of the same file name.

MAYBE I could rename each instance to a different name, and then track that. eg program1.exe, program2.exe etc

For the moment, I used mouse click to activate each program from the task bar and record its window handle

Func SelectWin()
Opt("mousecoordmode", 1)
dim $term[$noTerminal]
For $i = 0 to ubound($term)-1
    MouseClick("left", $firsttermX+ (($i) * $gapX),$firsttermY )
    sleep(1000)
    $term[$i] = WinWait($t)
    WinMove($t,"",1,1,1285,1000)
    ;msgbox(0,"",$term[$i])
Next
Opt("mousecoordmode", 0)
EndFunc

 

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...