Jump to content
Sign in to follow this  
bluebearr

ProcessClose - errors and polling

Recommended Posts

bluebearr

Hey,

I looked around but really couldn't find an answer to my questions on the ProcessClose function.

First, are there any situations in which ProcessClose will display an error message, or, if it fails, does it always fail silently?

Second, the documentation for this function has this line in it:

The process is polled approximately every 250 milliseconds.

What does this mean? How does polling affect the operation of the function? Does this mean that it takes a minimum of 250 milliseconds to close a process?

Thanks for your help.

BlueBearr


BlueBearrOddly enough, this is what I do for fun.

Share this post


Link to post
Share on other sites
PsaltyDS

Hey,

I looked around but really couldn't find an answer to my questions on the ProcessClose function.

First, are there any situations in which ProcessClose will display an error message, or, if it fails, does it always fail silently?

Second, the documentation for this function has this line in it:

What does this mean? How does polling affect the operation of the function? Does this mean that it takes a minimum of 250 milliseconds to close a process?

Thanks for your help.

BlueBearr

That might be a copy/paste error in the help file. It would apply to ProcessWaitClose(), not ProcessClose().

Try this for testing how long ProcessClose() takes:

$PID = Run("notepad.exe")
WinWait("Untitled - Notepad")
ConsoleWrite("PID = " & $PID)
$iTimer = TimerInit()
If $PID Then ProcessClose($PID)
$iTimer = TimerDiff($iTimer)
ConsoleWrite("Time = " & Round($iTimer, 0) & "ms" & @LF)

^_^


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
bluebearr

It took 2 ms to close notepad, so I guess that the polling doesn't set a minimum time. I also thought that it looked like it got copied from ProcessWaitClose but didn't know if anyone could confirm this.

Bluebearr


BlueBearrOddly enough, this is what I do for fun.

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.