This works thanks to Patchy!
js code:
if (Messenger.MyStatus === STATUS_UNKNOWN) {
Debug.DebuggingWindowVisible = true;
Debug.ClearDebuggingWindow();
var hWnd = Interop.Call('user32', 'FindWindowExW', Messenger.ContactListWndHandle, 0, 'Main Window Class', '');
hWnd = Interop.Call('user32', 'FindWindowExW', hWnd, 0, 'DirectUIHWND', '');
var IID_IAccessible = Interop.Allocate(16);
Interop.Call('ole32', 'IIDFromString', '{618736E0-3C3D-11CF-810C-00AA00389B71}', IID_IAccessible);
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){
Debug.Trace('Child Count: '+iAccessibleChildrenFound.ReadDWORD(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) {
try{
if (iAccessibleChild.accName(0).match ( /E-mail+/)) {
iAccessibleChild.accValue(0) = 'test@test.com';
}
if (iAccessibleChild.accName(0).match ( /Status+/)) {
//Doesn't work not sure why...
//iAccessibleChild.accValue(0) = 'Busy';
}
Debug.Trace(iAccessibleChild.accName(0)+': '+iAccessibleChild.accValue(0));
}catch(e){
//Most likely the password edit box as you cannot access it...
Debug.Trace(e.number + ' /\\ ' + e.description);
}
}
}
}
}
}
}
}