Click or drag to resize
Ranorex

HostGetApplicationForm Method (Process)

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(
	Process process
)

Parameters

process
Type: System.DiagnosticsProcess
The process to get the main Form from.

Return Value

Type: Form
A Form belonging to the specified Process.
Exceptions
ExceptionCondition
ArgumentNullExceptionIf process is null.
RanorexExceptionIf getting the process Id from process fails.
ElementNotFoundExceptionIf no Form belonging to the specified process is found within the DefaultSearchTimeout.
Remarks
If more Form instances are found for the process, the last Form found is returned (to avoid popups).
See Also