dramaking Posted August 16, 2010 Posted August 16, 2010 I have two objects that I will use with OpenProcess throughout my application and I was wondering would it be a good idea to use CloseHandle before using OpenProcess on the second object. Also, is opening multiple processes at the same time considered a bad programming habit?
JohnOne Posted August 16, 2010 Posted August 16, 2010 If you could link to "OpenProcess" and "CloseHandle" you may better get advice. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
dramaking Posted August 16, 2010 Author Posted August 16, 2010 Here they are:OpenProcessCloseHandleThanks
JohnOne Posted August 16, 2010 Posted August 16, 2010 I see, I was thinking they were Autoit functions/UDFs. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Moderators SmOke_N Posted August 16, 2010 Moderators Posted August 16, 2010 Depends on if it's the same exact call to the same exact process. If it's the same call, may just need to keep it open during the script maybe as a global and then close the handle before you exit. If they are two different types of open ( eg. PROCESS_DUP_HANDLE and the other is like PROCESS_QUERY_INFORMATION ) or they are two different but constant executables that the pid doesn't change to, then you could possibly keep both handles open during the duration of your script and close them at the end of it. Both of the above options would allow you to only call the OpenProcess() one time each exe. But, sadly, we have no way on giving you proper advice without seeing how you're actually using it in your code. My suggestions are purely hypothetical to your interpreted hypothetical situation. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
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