 | HostCloseApplication Method (Int32, Duration) |
Closes an application with the specified process ID by trying to close its main window.
Namespace:
Ranorex
Assembly:
Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntaxpublic bool CloseApplication(
int processId,
Duration gracePeriod
)
Public Function CloseApplication (
processId As Integer,
gracePeriod As Duration
) As Boolean
Parameters
- processId
- Type: SystemInt32
The process ID of the application to close. - gracePeriod
- Type: RanorexDuration
A grace period before the process is killed (does not apply to mobile apps).
Return Value
Type:
BooleanReturns
true if the application has closed within the grace period, otherwise
false.
Implements
IHostCloseApplication(Int32, Duration)
Exceptions| Exception | Condition |
|---|
| ArgumentOutOfRangeException | If gracePeriod is negative. |
RemarksSetting the grace period to zero causes the application's process not to be killed.
See Also