Sign in to follow this  
Followers 0
Saeljfkklhen

WinActivate via PID?

7 posts in this topic

Hiya! I just stumbled across this language and it caught my eye. I'm new to it so bear with me ;)

Is there any way to preform a function along the lines of "WinActivate", like possibly a "ProcessActivate" function that works off of the Process ID instead of the name of the process? My problem is the (my first really) script i'm trying to iron out will have multiple instances of the same executable, and also separate executables with no discernable differences (None that I could find with the AutoIt Window tool...) So I was wondering, is it possible to refer to a process by its ID? I found "_ProcessGetName" but it seems to me as if that wouldn't help after the fact.

Also, is there any way to determine when a program would be ready to accept input? As in, "WinWaitActive" almost works, yet on good occasion there is a period of "lag" that i'm unable to predict in length. The only workaround I have found is to just add an extra "Sleep" for 10 seconds or so...

So I know I might be asking alot here, but could someone help me out? Please? :lmao:

Share this post


Link to post
Share on other sites



Hiya! I just stumbled across this language and it caught my eye. I'm new to it so bear with me ;)

Is there any way to preform a function along the lines of "WinActivate", like possibly a "ProcessActivate" function that works off of the Process ID instead of the name of the process? My problem is the (my first really) script i'm trying to iron out will have multiple instances of the same executable, and also separate executables with no discernable differences (None that I could find with the AutoIt Window tool...) So I was wondering, is it possible to refer to a process by its ID? I found "_ProcessGetName" but it seems to me as if that wouldn't help after the fact.

Also, is there any way to determine when a program would be ready to accept input? As in, "WinWaitActive" almost works, yet on good occasion there is a period of "lag" that i'm unable to predict in length. The only workaround I have found is to just add an extra "Sleep" for 10 seconds or so...

So I know I might be asking alot here, but could someone help me out? Please? :evil:

In fact PID cannot select the right windows. You have to use WinGetHandle of the appropriate windows corresponding to your process and just use it in your Win... functions. :lmao:

Share this post


Link to post
Share on other sites

since one process can have multiple windows, it is not possible to choose a window just by giving the PID ;)


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

http://www.autoitscript.com/fileman/users/Helge/udfs/_ProcessGetHWnd.au3 is a UDF I made once for issues like this. It can return HWnds for

all of the process' windows or it can return a single one. You can also specify a title

to match.

Share this post


Link to post
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
Sign in to follow this  
Followers 0