FWIW, below is what I get on XP for Word Menu bar and its 13 children. Showing 
only self (child 0) and child 1 because all of the other children look exactly 
the same as child 1. Below that are self (child 0) and child 1 of wordpad 
OBJID_MENU's six children. At the bottom is the script function that produced 
the output. All are property-gets except one function (functions do not work 
period and property gets are very spotty, and no facility to translate the role 
or state).

Get_Accessible_Object of WinWord OBJID_MENU: c_3000
================
Children of Main WinWord menu C_3000
----------------
child 0
----------------
 Name: Menu Bar // com_type: com_status: OK
 Handle via function:  // com_type: com_status: ERRORS: com.method: Can't 
interrogate object  (sys code 80020006: "Unknown name.")
 (sys code 80020006: "Unknown name.")
 Handle via property:  // com_type: com_status: ERROR: com.method: Invoke 
failed  (sys code 80020009: "Exception occurred.")
 Value:  // com_type: com_status: ERROR: com.method: Invoke failed  (sys code 
80020009: "Exception occurred.")
 State: 262144 // com_type: com_status: OK
 Default Action:  // com_type: com_status: ERROR: com.method: Invoke failed  
(sys code 80020009: "Exception occurred.")
 Description: Menu Bar // com_type: com_status: OK
 Role: 2 // com_type: com_status: OK
 Help: Menu Bar // com_type: com_status: OK
 HelpTopic:  // com_type: com_status: ERROR: com.method: Invoke failed  (sys 
code 80020009: "Exception occurred.")
----------------
child 1
----------------
 Name:  // com_type: com_status: ERROR: com.method: Invoke failed  (sys code 
80020009: "Exception occurred.")
 Handle via function:  // com_type: com_status: ERRORS: com.method: Can't 
interrogate object  (sys code 80020006: "Unknown name.")
 (sys code 80020006: "Unknown name.")
 Handle via property: c_3001 // com_type:IAccessible com_status: OK
 Value:  // com_type:IAccessible com_status: ERROR: com.method: Invoke failed  
(sys code 80020009: "Exception occurred.")
 State:  // com_type:IAccessible com_status: ERROR: com.method: Invoke failed  
(sys code 80020009: "Exception occurred.")
 Default Action:  // com_type:IAccessible com_status: ERROR: com.method: Invoke 
failed  (sys code 80020009: "Exception occurred.")
 Description:  // com_type:IAccessible com_status: ERROR: com.method: Invoke 
failed  (sys code 80020009: "Exception occurred.")
 Role:  // com_type:IAccessible com_status: ERROR: com.method: Invoke failed  
(sys code 80020009: "Exception occurred.")
 Help:  // com_type:IAccessible com_status: ERROR: com.method: Invoke failed  
(sys code 80020009: "Exception occurred.")
 HelpTopic:  // com_type:IAccessible com_status: ERROR: com.method: Invoke 
failed  (sys code 80020009: "Exception occurred.")

*******************************************************
wordpad output:

Get_Accessible_Object of WordPad OBJID_MENU: c_3000
================
Children of Main WordPad menu C_3000
----------------
child 0
----------------
 Name: Application // com_type: com_status: OK
 Handle via function:  // com_type: com_status: ERRORS: com.method: Can't 
interrogate object  (sys code 80020006: "Unknown name.")
 (sys code 80020006: "Unknown name.")
 Handle via property:  // com_type: com_status: ERROR: com.method: Invoke 
failed  (sys code 80020009: "Exception occurred.")
 Value:  // com_type: com_status: OK
 State: 0 // com_type: com_status: OK
 Default Action:  // com_type: com_status: ERROR: com.method: Invoke failed  
(sys code 80020009: "Exception occurred.")
 Description: Contains commands to manipulate the current view or document // 
com_type: com_status: OK
 Role: 2 // com_type: com_status: OK
 Help:  // com_type: com_status: OK
 HelpTopic: 0 // com_type: com_status: OK
----------------
child 1
----------------
 Name: File // com_type: com_status: OK
 Handle via function:  // com_type: com_status: ERRORS: com.method: Can't 
interrogate object  (sys code 80020006: "Unknown name.")
 (sys code 80020006: "Unknown name.")
 Handle via property: c_3001 // com_type:IAccessible com_status: OK
 Value:  // com_type: com_status: OK
 State: 1073741824 // com_type: com_status: OK
 Default Action:  // com_type: com_status: ERROR: com.method: Invoke failed  
(sys code 80020009: "Exception occurred.")
 Description:  // com_type: com_status: OK
 Role: 12 // com_type: com_status: OK
 Help:  // com_type: com_status: OK
 HelpTopic: 0 // com_type: com_status: OK

***

function producing above output:

Function showChildren(sDesc, hao)
local com_status, com_type
com.error_dialog_off()
win.debug("================")
 win.debug("Children of "++sDesc++" "++hao)
if (hao.accChildCount < 1)
  win.debug("NO CHILDREN, SELF ONLY")
for (local i = 0; i < hao.accChildCount+1; i++)
 win.debug("----------------")
 win.debug("child " ++ ( i))
 win.debug("----------------")
 win.debug(" Name: " ++ hao.accName(i), "// com_type:"++com_type++" com_status: 
"++com_status)
 ;iaccessible functions don't work
 win.debug(" Handle via function: "++hao.get_accChild(i),"// 
com_type:"++com_type++" com_status: "++com_status)
 ;for accChild property, i is ok, but plugin pukes unless a handle gets returned
 win.debug(" Handle via property: "++hao.accChild(i),"// 
com_type:"++com_type++" com_status: "++com_status)
 win.debug(" Value: "++ hao.accValue(i), "// com_type:"++com_type++" 
com_status: "++com_status)
 win.debug(" State: "++hao.accState(i), "// com_type:"++com_type++" com_status: 
"++com_status)
 win.debug(" Default Action: "++hao.accDefaultAction(i), "// 
com_type:"++com_type++" com_status: "++com_status)
 win.debug(" Description: "++hao.accDescription(i), "// com_type:"++com_type++" 
com_status: "++com_status)
 win.debug(" Role: "++hao.accRole(i), "// com_type:"++com_type++" com_status: 
"++com_status)
 win.debug(" Help: "++hao.accHelp(i), "// com_type:"++com_type++" com_status: 
"++com_status)
 win.debug(" HelpTopic: "++hao.accHelpTopic(i), "// com_type:"++com_type++" 
com_status: "++com_status)
endfor

win.debug("================")
com.error_dialog_on()
quit


Reply via email to