 | UtilRestartWithUiAccess Method |
Restarts the current executable with UI access privileges. Those privileges are
required to access Windows apps.
Namespace:
Ranorex.Core
Assembly:
Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntaxpublic static int RestartWithUiAccess()
Public Shared Function RestartWithUiAccess As Integer
Return Value
Type:
Int32The exit code returned by the current executable.
RemarksIf the current process does not have UI access privileges, you can call this
method to restart the current executable with UI privileges. The executable will be
restarted using the Ranorex.UiaLauncher which thereby provides the required privileges
to e.g. access Windows apps.
ExamplesThe following code checks for the privileges to access Windows apps
and restarts the executable in order to get those privileges:
if (Ranorex.Core.Util.IsRestartRequiredForWinAppAccess)
return Ranorex.Core.Util.RestartWithUiAccess();
See Also