Jump to content

Recommended Posts

Posted (edited)

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
Posted

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.

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
  • Recently Browsing   0 members

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