|  Could someone do me a favor and run this | 
| Author: | 
Message: | 
matty 
Scripting Guru 
     
  
 
Posts: 8327 Reputation: 109 
40 /   /   
Joined: Dec 2002
 
Status: Away
 
 | 
O.P.  Could someone do me a favor and run this
I just need the debug results from when a Chat Window is opened. Thanks 
If it crashes I am sorry  
js code: var MAXLEN = 0xff; 
var oChatWnd = {}; 
var IID_IAccessible = Interop.Allocate(0x10); 
Interop.Call('ole32', 'IIDFromString', '{618736E0-3C3D-11CF-810C-00AA00389B71}', IID_IAccessible); 
 
 
function OnEvent_ChatWndCreated (pChatWnd) { 
    // Find the DirectUIHWND window 
    EnumChildWindows(pChatWnd.Handle); 
     
     
    var pAccessibleData = Interop.Allocate(4); 
    if(Interop.Call('oleacc', 'AccessibleObjectFromWindow', oChatWnd[pChatWnd.Handle], 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)); 
                        } 
                    } 
                } 
            } 
        } 
    } 
} 
 
function EnumChildWindows(hWnd) { 
    oChatWnd[hWnd] = 0; 
    Interop.Call('user32', 'EnumChildWindows', hWnd, Interop.GetCallbackPtr('EnumChildProc'), 0); 
} 
 
function EnumChildProc(hWnd, lParam) { 
    var GA_PARENT = 0x1; 
    var lpClassName = Interop.Allocate(MAXLEN); 
    Interop.Call('user32', 'GetClassNameW', hWnd, lpClassName, MAXLEN); 
    if (lpClassName.ReadString(0) === 'DirectUIHWND') { 
        oChatWnd[Interop.Call('user32', 'GetAncestor', hWnd, GA_PARENT)] = hWnd; 
        return false; 
    } 
    return true; 
}
   
 This post was edited on 08-24-2010 at 03:12 PM by matty.
 |   
 | 
| 08-24-2010 03:12 PM | 
 | 
  | 
Chrissy 
Senior Member 
    
  
  
 
Posts: 850 Reputation: 5 
30 /   /   
Joined: Nov 2009 
 | 
 RE: Could someone do me a favor and run this
I ran it,  
quote: Script is starting 
Script is now loaded and ready 
Function called: OnEvent_ChatWndCreated 
   
 This post was edited on 08-24-2010 at 03:20 PM by Chrissy.
 |   
 | 
| 08-24-2010 03:19 PM | 
 | 
  | 
matty 
Scripting Guru 
     
  
 
Posts: 8327 Reputation: 109 
40 /   /   
Joined: Dec 2002
 
Status: Away
 
 | 
| 
O.P.  RE: Could someone do me a favor and run this
 Did you open a Chat Window? 
 |   
 | 
| 08-24-2010 03:19 PM | 
 | 
  | 
Eljay 
Elite Member 
     
  
  
:O
  
Posts: 2945 Reputation: 77 
– /   / – 
Joined: May 2004 
 | 
 RE: Could someone do me a favor and run this
It displays nothing at all   
quote: Script is starting 
Script is now loaded and ready 
Function called: OnEvent_ChatWndCreated
   
 |   
 | 
| 08-24-2010 03:20 PM | 
 | 
  | 
Chrissy 
Senior Member 
    
  
  
 
Posts: 850 Reputation: 5 
30 /   /   
Joined: Nov 2009 
 | 
 RE: Could someone do me a favor and run this
quote: Originally posted by matty 
Did you open a Chat Window?
  Yeah, sorry it was this 
 quote: Script is starting 
Script is now loaded and ready 
Function called: OnEvent_ChatWndCreated 
  
edit: yeah, same as above.   
 This post was edited on 08-24-2010 at 03:21 PM by Chrissy.
 |   
 | 
| 08-24-2010 03:21 PM | 
 | 
  | 
matty 
Scripting Guru 
     
  
 
Posts: 8327 Reputation: 109 
40 /   /   
Joined: Dec 2002
 
Status: Away
 
 | 
| 
O.P.  RE: Could someone do me a favor and run this
 Could either of you tell me what the chat window class is called? I assume the child window is the DirectUIHWND. 
 This post was edited on 08-24-2010 at 03:23 PM by matty.
 |   
 | 
| 08-24-2010 03:23 PM | 
 | 
  | 
Chrissy 
Senior Member 
    
  
  
 
Posts: 850 Reputation: 5 
30 /   /   
Joined: Nov 2009 
 | 
 RE: Could someone do me a favor and run this
quote: Originally posted by matty 
Could either of you tell me what the chat window class is called? I assume the child window is the DirectUIHWND.
  If you tell me how I'll easy tell you   .   
 |   
 | 
| 08-24-2010 03:28 PM | 
 | 
  | 
Eljay 
Elite Member 
     
  
  
:O
  
Posts: 2945 Reputation: 77 
– /   / – 
Joined: May 2004 
 | 
 RE: Could someone do me a favor and run this
quote: Originally posted by matty 
Could either of you tell me what the chat window class is called? I assume the child window is the DirectUIHWND.
  
![[Image: attachment.php?pid=999663]](http://shoutbox.menthix.net/attachment.php?pid=999663)  
 
  Attachment: imwindow.gif (13.18 KB) 
This file has been downloaded 561 time(s). 
 |   
 | 
| 08-24-2010 03:29 PM | 
 | 
  | 
matty 
Scripting Guru 
     
  
 
Posts: 8327 Reputation: 109 
40 /   /   
Joined: Dec 2002
 
Status: Away
 
 | 
O.P.  RE: Could someone do me a favor and run this
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)); 
                        } 
                    } 
                } 
            } 
        } 
    } 
}
   
 |   
 | 
| 08-24-2010 03:34 PM | 
 | 
  | 
Chrissy 
Senior Member 
    
  
  
 
Posts: 850 Reputation: 5 
30 /   /   
Joined: Nov 2009 
 | 
 RE: RE: Could someone do me a favor and run this
quote: Script is starting 
Script is now loaded and ready 
Function called: OnEvent_Initialize 
Function called: OnEvent_Uninitialize 
Script has been stopped 
Script is starting 
Script is now loaded and ready
   
 |   
 | 
| 08-24-2010 03:36 PM | 
 | 
  | 
| 
Pages: (2): 
« First
  
 [ 1 ]
 2
 
»
 
Last »
 | 
| 
 |