Jump to content
Sign in to follow this  

Couple Functions

Recommended Posts

Richard Robertson

ProcessExists is the same as your "GetProcessIDByName".

Share this post

Link to post
Share on other sites

These examples are pretty overdone at this point... but that's beside the fact that you've made mistakes.

1) Process32First already gets the first process in the list. So by calling Process32Next in your loop you're automatically skipping the first process.

2) You should immediately exit the loop if you've found what you're looking for instead of continuing needlessly (second function).

3) Why use strcmp in one and lstrcmp in the other? FYI lstrcmp requires the strings to be NULL terminated prior to use.

4) You are using case sensitive string comparisons. You sure that's what you want?

Edited by wraithdu

Share this post

Link to post
Share on other sites

I don't get it, what's the point in posting these? The publicly available AutoIt source code contains ProcessWait() code and it's quite trivial to modify the existing ProcessExists() code to return the found PID.

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.