Jump to content

ProcessClose - errors and polling


Recommended Posts

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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.
Link to comment
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
 Share

  • Recently Browsing   0 members

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