Click or drag to resize
Ranorex

HostGetApplicationForm Method (Int32, Duration)

Gets the main Form of a process.

Namespace:  Ranorex
Assembly:  Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntax
public Form GetApplicationForm(
	int processId,
	Duration timeout
)

Parameters

processId
Type: SystemInt32
The ID of the process to get the main Form from.
timeout
Type: RanorexDuration
The time to keep searching for a Form instance belonging to the process.

Return Value

Type: Form
A Form belonging to the specified process ID.
Exceptions
ExceptionCondition
ElementNotFoundExceptionIf no Form belonging to the specified process ID is found within the timeout.
Remarks
If more Form instances are found for the process ID, the last Form found is returned (to avoid popups).
See Also