Skip to content

An AI Agent that interacts with Windows OS at GUI level.

Python
2.4 KB
Raw Blame

UiaDisconnectAllProviders

Original Documentation

UiaDisconnectAllProviders function (uiautomationcoreapi.h)

Releases all Microsoft UI Automation resources that are held by all providers associated with the calling process.

Syntax

HRESULT UiaDisconnectAllProviders();

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

A provider application should use this function to release UI Automation resources before shutting down.

This function cannot be called in response to a call to the SendMessage function. An application cannot make outbound Component Object Model (COM) calls in response to a call to SendMessage, and releasing a provider is typically an outbound COM call. The UiaDisconnectAllProviders function returns RPC_E_CANTCALLOUT_ININPUTSYNCCALL if the function is called in response to a SendMessage call. You can use the InSendMessageEx function to determine whether a particular message is being handled in response to a SendMessage call.

An application that calls UiaDisconnectAllProviders should not respond to a re-entrant WM_GETOBJECT message by returning a pointer to the provider that it is trying to disconnect. If the application tries to disconnect a provider, but then calls the UiaReturnRawElementProvider function with that same provider during the disconnect attempt, the provider might not be fully disconnected.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps
Minimum supported server Windows Server 2012 [desktop apps
Target Platform Windows
Header uiautomationcoreapi.h
Library Uiautomationcore.lib
DLL Uiautomationcore.dll

See also

Functions for Providers

UiaDisconnectProvider