This System.Runtime.InteropServices.COMException
comes from acquiring an instance of a (COM wrapper) UIAutomationClient.IAccessible and then calling accLocation on the object:
Interop.AccessibleObjectFromEvent( hWnd, idObject, idChild, out var accessible, out var accessibleChild );
int x = 0, y = 0, w = 0, h = 0;
accessible?.accLocation( out x, out y, out w, out h, child );
Some objects that come in on the WinEvents hook I'm listening to don't have some of the properties in the interface. I'm handling the exception...and that gets me down the road, but I would like to "discover" that the property isn't in the object rather than getting a noisy exception.
User contributions licensed under CC BY-SA 3.0