I attempted it and made it pretty far but I gave up as I didn't have the time.
This is how you would get the iAccessible interface
js code:
hWnd = Interop.Call('user32', 'FindWindowExW', oChatWnd.Handle, 0, 'DirectUIHWND', '');
var IID_IAccessible = Interop.Allocate(16);
with (IID_IAccessible) { WriteDWORD(0, 0x618736E0); WriteWORD(4, 0x3C3D); WriteWORD(6, 0x11CF); SetAt(8, 0x81); SetAt(9, 0xc); SetAt(10, 0x0); SetAt(11, 0xaa); SetAt(12, 0x0); SetAt(13, 0x38); SetAt(14, 0x9b); SetAt(15, 0x71); }
var pAccessible = Interop.Allocate(4);
Interop.Call('oleacc', 'AccessibleObjectFromWindow', hWnd, 0xFFFFFFFC /* OBJID_CLIENT */, IID_IAccessible, pAccessible);
var iAccessible = pAccessible.ReadInterfacePtr( 0 );