Posts: 7
Threads: 1
Joined: Oct 2007
Been useing WinBatch for 10 years now and just ran into QM yesturday and really like what I see.
Question, does the above program generate QM code when youuse it? If so, how to I access it so that I do not have to re-invent the wheel?
Thanks
Robert
Posts: 331
Threads: 60
Joined: May 2006
As far as I know no other program besides QM "generates" QM code.
Posts: 7
Threads: 1
Joined: Oct 2007
John Wrote:As far as I know no other program besides QM "generates" QM code.
John, sorry I should have put the program name in the Message and not the Subject. The program I was reffering to is "
Find Accessible Objects" Program which is located on the toolbar.
Thanks
Robert
Posts: 12,140
Threads: 142
Joined: Dec 2002
Don't know what code generates the above program but probably it is possible to convert its generated code to QM code.
Posts: 7
Threads: 1
Joined: Oct 2007
Gintaras, thanks for your reply. Sorry if you already know this and applogize in advance. The "Find Accessible Objects" program I am reffering to is on the ToolBar in the QM editor.
I've look everywhere for QM or any other code it generates and have had no luck. Also, unless I am missing something there is no option for saveing that code.
Thanks again,
Robert
Posts: 12,140
Threads: 142
Joined: Dec 2002
When you click OK, it inserts code like this
Acc a=acc(........)
in current macro. Then use "Accessible object actions" dialog to do something with a.
Macros are saved automatically or when you click the Save button on the main toolbar.
Posts: 7
Threads: 1
Joined: Oct 2007
Thanks Gintaras, that was very helpful, god I am such a dumb a??. Well that did the trick and placed the code into the editior, but I am now getting a type missmatch error.
What I am trying to do is get all the child objects from a root SysTreeView32 object from the device manager.
Thanks Again for your help!!!!
Robert
:lol:
Posts: 576
Threads: 97
Joined: Aug 2007
post your code here and i might be able to help you.
Posts: 7
Threads: 1
Joined: Oct 2007
Sorry for being such an idiot, I am really haveing problems with QM and its syntax. I've wrote programs over 15K lines long before but for some reason I am not getting QM.
Anyways, what I am trying to do is to get all the childs/controls from the device manager and then finelly store them into a file so I can use later.
The issue I have right now is to concatenate all the child names into 1 tab/LF delimited string or an array.
Acc a=acc("" "OUTLINEITEM" win("Device Manager" "MMCMainFrame") "SysTreeView32" "" 0x1000)
str x z
int i
int cntr=0
for i 0 100
a.Navigate("next");
x=z.insert(a.Name cntr 013)
cntr=cntr+1
mes x
Thanks for your help!
Robert
Posts: 12,140
Threads: 142
Joined: Dec 2002
Acc a=acc("" "OUTLINEITEM" win("Device Manager" "MMCMainFrame") "SysTreeView32" "" 0x1000)
str x
int cntr
for cntr 1 1000000000
,x.addline(a.Name)
,a.Navigate("next"); err break
mes x
Posts: 7
Threads: 1
Joined: Oct 2007
Thanks for the post Gintaras! Sorry about the previous code the I listed, it was my last test before I dropped the email. Anyways, the following code was one that I had got to work but without the LF. So, why wouldn't this code work where as your code was prefect? Also, was the code you had list the best way to accomplish the objective or would there be a better way? If there's a better way just say so and I'll play around with it more.
Acc a=acc("" "OUTLINEITEM" win("Device Manager" "MMCMainFrame") "SysTreeView32" "" 0x1000)
str x
int i
for i 0 100
a.Navigate("next");
x.insert(a.Name)
mes x
Thanks Again!
Robert
Posts: 12,140
Threads: 142
Joined: Dec 2002
;Shows 3 ways to enumerate accessible objects that are direct children of a parent object.
out
Acc a
str s
;1. If children have nonzero elem (see in Find Acc. Obj. -> Properties -> Element), can enumerate using it.
;find parent object
a=acc("" "TOOLBAR" win("QM TOOLBAR" "QM_toolbar") "ToolbarWindow32" "" 0x1000)
;get number of children
int n=a.a.ChildCount
;enumerate by changing a.elem
for a.elem 1 n+1
,s=a.Name
,out s
out "---"
;2. The same can be used without knowing the number of children.
;find parent object
a=acc("" "TOOLBAR" win("QM TOOLBAR" "QM_toolbar") "ToolbarWindow32" "" 0x1000)
;enumerate by changing a.elem until error
for a.elem 1 1000000000
,s=a.Name; err break
,out s
out "---"
;3. If children's elem is 0, have to use Navigate.
;find parent object
a=acc("" "TOOLBAR" win("QM TOOLBAR" "QM_toolbar") "ToolbarWindow32" "" 0x1000)
;get first child (alternatively, acc could find first child instead of parent, and then this statement must not be used)
a.Navigate("first"); err ret
;enumerate by calling Navigate until error
rep
,s=a.Name
,out s
,a.Navigate("next"); err break
out "---"
Posts: 7
Threads: 1
Joined: Oct 2007
Thanks you! you really did not need to paste the code, I was going to try and figure it out but that realy makes things easyier. I will play around with all three and see how it works.
Thanks
Robert