Print Page | Close Window

Automating CommandBar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=17137
Printed Date: 27 November 2024 at 9:10am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Automating CommandBar
Posted By: shuypens
Subject: Automating CommandBar
Date Posted: 20 August 2010 at 3:58am
I've already read a few post about not been able to automate CodeJock Commandbar with Quicktest Pro.
Quicktest Pro recognizes the commandbar as a Winobject, but does not recognize the menu items on the bar.
 
I need to be able to check if a menu item is enabled or disabled.
 
Is it possible to acces the commandbar object via Extern.declare.
 
Example with user32.dll
Extern.Declare micHwnd, "FindWindow", "user32.dll", "FindWindowA", micString, micString
 
Thanks.


-------------
Product: Xtreme SuitePro version 9.81
Platform: Windows XP (32bit) - SP 3
Language: Progress Edge



Replies:
Posted By: shuypens
Date Posted: 30 August 2010 at 9:13am
file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - [ - "oleacc.dll")]

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - internal file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - - extern - Int32 hwnd, - ref - In, - MarshalAs( - ref file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -  

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - [ - "oleacc.dll")]

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - public file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - - extern - IAccessible paccContainer, - int cChildren, [ - object[] rgvarChildren, - int pcObtained);

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -  

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - //hWnd is handle of the MenuBar in QTP you can retrieve this with the GetROProperty

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - //MenuPath is the path in the menu with “;” as delimiter. Example: View;Toolbars;Standard

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -
file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - public file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - - Int32 hWnd, file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - {

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - IAccessible file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - accObj;

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - IAccessible file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - accChild;

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -  

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - accObj = GetAccessibleMenu(hWnd);

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -  

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - object file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - [] objChildren = - object[accObj.accChildCount];

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - GetAccessibleChildren(0, accObj.accChildCount, objChildren, accObj);

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - accChild = ( file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - ClickPath(accChild, MenuPath, 0);

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - }


file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - public file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - - Int32 hWnd, file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - {

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - IAccessible file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - accObj;

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - IAccessible file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - accChild;

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -  

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - accObj = GetAccessibleMenu(hWnd);

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -  

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - object file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - [] objChildren = - object[accObj.accChildCount];

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - GetAccessibleChildren(0, accObj.accChildCount, objChildren, accObj);

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - accChild = ( file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - ClickPath(accChild, MenuPath, 0);

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - }

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -  

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - private file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - - IAccessible accChild, - int intArr)

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - {

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - IAccessible file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - accChild2;

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - string file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - [] words = strPath.Split( file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - int file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - b = intArr;

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -  

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - object file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - [] objChildren = - object[accChild.accChildCount];

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - GetAccessibleChildren(0, accChild.accChildCount, objChildren, accChild);

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - //if accessible object is a MenuPopup

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - if file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - (accChild.get_accRole(0).ToString() == )

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - {

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - accChild = ( file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - objChildren = - object[accChild.accChildCount];

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - GetAccessibleChildren(0, accChild.accChildCount, objChildren, accChild);

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -             file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - }

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - for file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - ( file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -             file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - {

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - accChild2 = ( file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - if file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - (accChild2.get_accName(0).ToString() == words)

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - {

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - accChild2.accDoDefaultAction(0); file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - b = b + 1;

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - if file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - (b > words.GetUpperBound(0)) file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - ClickPath(accChild2, strPath, b);

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -             }

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -             file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - }

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - }

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -


file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - private file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - - IAccessible GetAccessibleMenu( file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - {

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - Guid file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - guid = - Guid();

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - object file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - accObj = file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -  

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - int file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - retVal = AccessibleObjectFromWindow(hWnd, 0, - ref accObj);

file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - return file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - ( file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml - } file:///C:%5CDOCUME%7E1%5CDRIVER%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml -




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net