compareElements method
Compares two UI Automation elements to determine whether they represent the same underlying UI element.
Throws a WindowsException on failure.
To learn more, see learn.microsoft.com/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomation-compareelements.
Implementation
bool compareElements(IUIAutomationElement? el1, IUIAutomationElement? el2) {
final areSame = adaptiveCalloc<Int32>();
final hr$ = HRESULT(
_CompareElementsFn(
ptr,
el1?.ptr ?? nullptr,
el2?.ptr ?? nullptr,
areSame,
),
);
if (hr$.isError) {
free(areSame);
throw WindowsException(hr$);
}
final result$ = areSame.value;
free(areSame);
return result$ != FALSE;
}