Sign in to follow this  
Followers 0
ivan

GetActiveWin

5 posts in this topic

#1 ·  Posted (edited)

It must be the fourth or fifth time I've needed to retreive the pid of the active window, so I wrote a little function that does the job.

The function returns a 2 element array containing the pid and handle of the active window, respectively.

Many of you will probably find it useless, but here it goes

Edit:

Sorry lads, I forgot I had a commented msg box in the script i used to debug

I've just realized there is no such thing as get the pid of the active window, so I'm a bit surprised this subject hasn't been posted before.

GetActiveWin.au3

Edited by ivan

Share this post


Link to post
Share on other sites



The name of the function is differen't than the name in the comments.


FootbaG

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You're totally right. I corrected it in the first post and thanks for your comment.

Oops ! I probably should have told you to keep _WinGetActive or some such... To keep the namespace in-line with the other WinFuctions :"> So instead of GetActiveWin, something like _WinGetActive would "fit" better.

P.S,

I think a while ago someone posted a _WinGetPID function, or something along that line...

Edited by layer

FootbaG

Share this post


Link to post
Share on other sites

Thanks for replying and please forgive me for not doing so promtly (my internet connection got cut off during the week end, so I've some catching up to do). I wrote a few similar functions, but I believe I never posted them as udf, just as code.

I'll ammend the udf and post it again. The good news is that there's quite a bit that can be done on the window handle and process id matching, so there's a hell of a lot of room for improvement on this one. Probably by the time I'm done with it, it won't turn out to be such a bore.

Thanks for your comments.

IVAN.

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