Thanks LJ! Could you guys run this now
js code:
var MAXLEN = 0xff;
var IID_IAccessible = Interop.Allocate(0x10);
Interop.Call('ole32', 'IIDFromString', '{618736E0-3C3D-11CF-810C-00AA00389B71}', IID_IAccessible);
// A chat window will automatically open
>>>Messenger.OpenChat('test@test.com');<<<
function OnEvent_ChatWndCreated (pChatWnd) {
var hWnd = Interop.Call('user32', 'FindWindowExW', pChatWnd.Handle, 0, 'IM Window Class', '');
hWnd = Interop.Call('user32', 'FindWindowExW', hWnd, 0, 'DirectUIHWND', '');
var pAccessibleData = Interop.Allocate(4);
if(Interop.Call('oleacc', 'AccessibleObjectFromWindow', hWnd, 0xFFFFFFFC, IID_IAccessible, pAccessibleData) === 0) {
var iAccessible = pAccessibleData.ReadInterfacePtr(0);
if(iAccessible) {
var iAccessibleChildren = Interop.Allocate(16*iAccessible.accChildCount);
var iAccessibleChildrenFound = Interop.Allocate(4);
if (Interop.Call('oleacc', 'AccessibleChildren', iAccessible, 0, iAccessible.accChildCount, iAccessibleChildren, iAccessibleChildrenFound) === 0){
for (var i=0; i<iAccessibleChildrenFound.ReadDWORD(0); ++i) {
if (iAccessibleChildren.ReadDWORD(i*16) === 0x9) {
var iAccessibleChild = iAccessibleChildren.ReadInterfacePtr(i*16+8);
if (iAccessibleChild) {
Debug.Trace(iAccessibleChild.accName(0)+' : '+iAccessibleChild.accValue(0));
}
}
}
}
}
}
}