Generator Posted March 28, 2007 Share Posted March 28, 2007 (edited) Hi everyone What I want to do is, make sure the process don't run twice itself, so I am wondering how should I do that or is there a way to check a process itself PID so I can set up an if statement for it. Also, is there a way to check process PID by it's process name? But I have 2 process that have the same name. Example: ;For the first question(This is the first process) ;If process exist(Itself) Then ;Exit ;end if ;But where should I put that code and I think I should get its PID for it ;For the second question(This is the second process) ;This is an other process that checks if the first process exist ;While 1 ;If Process exist(the first process) Then ;do nothing ;Else ;Run("The first program") ;End If ;WEnd ;But since the first process have the same name as 1 of the Windows Process, so I am wondering if there is anyway I can send messenge between programs or find PID by it's name? Thanks for helping. Generator Edit:Fixed some error Edited March 28, 2007 by Generator Link to comment Share on other sites More sharing options...
SadBunny Posted March 28, 2007 Share Posted March 28, 2007 (edited) Incredibly unimaginably useful:http://www.autoitscript.com/forum/index.ph...amp;hl=compinfoEverything you asked for should be possible using the Func _ComputerGetProcesses(ByRef $aProcessInfo)(... and looping through the array finding any processnames that match your processname, and comparing @autoItPid to the 26th element of the process info for the found process in the array (26th element = the PID of that process))/edit: sentence was fooked up. Now less so. Edited March 28, 2007 by SadBunny Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now