Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clearing Acc variables
#1
I have a macro that creates a continuously running smart dialog. At the end the process started by a command button, it resets my str variables using the xxx.all command. Is there a similar method for clearing Acc variables?
#2
Acc a
...
a.a=0

If you use local variables, they are automatically cleared when the function returns. Local variables are those declared like Acc a, not like Acc- a etc. Dialog procedure is called and returns each time you click the button.
#3
Thank you for responding so quickly! Can you tell me what the .a option is? I was able to set it to zero. However, the object this refers to is a SysListView32 list. The .elem parameter (which is the part I'm actually interested in) did not change when I changed the .a setting.

Also, while on the the SysListView32 topic, I am working with an application that has several (7) SysListView32 lists in it, each within its own child window. I am trying to search for a particular item using:
Code:
Copy      Help
p=acc("" "LISTITEM" win("Application Name" "" "" 0x1) "SysListView32" winName 0x1414)
where winName is a str variable containing a string that will be in the description of the element I'm looking for. My problem is that I can't seem to force it to search a particular list. I have been trying to use the act command to activate the window just prior to running this code to see if that will point it in the right direction, but it hasn't worked so far.

Also on the SysListView32 line...double clicking in different columns within the same row has different effects (one column opens a drop down list and another will open a related window). Is there a way to specify which column an action such as left-click or dbl-click will be performed within a row once it has been identified?

Sorry to combine all of these items in this one post....each should probably be its own thread. Thanks in advance for any help you can provide.
#4
Acc variable consists of two variabes.
a is of type IAccessible. When you assign 0, the associated memory is freed.
elem is of type int and therefore does not need to be cleared, although you can also a.elem=0.

acc finds first control of type SysListView32 and then searches for the accessible object in it. If these controls have different ids, you can specify id in class string, eg "id=1045 "SysListView32". Or you can at first find the control using some other function and use its handle instead of window:

int hlv=child(... win("Application Name" "" "" 0x1)) ;;or id(...)
p=acc("" "LISTITEM" hlv "SysListView32" winName 0x1414)
#5
Thanks for the ideas. I'll try them. Any ideas on the clicking in different columns issue?
#6
Code:
Copy      Help
int isubitem=2 ;;for example
int hlv=child(1 "" "SysListView32" win("" "ExploreWClass")) ;;Windows Explorer, details view
Acc a=acc("qm.exe" "LISTITEM" hlv "" "" 0x1001)

RECT* r=share
r.top=isubitem
r.left=0
def LVM_GETSUBITEMRECT 0x00001038
if(!SendMessage(hlv LVM_GETSUBITEMRECT a.elem-1 share(hlv))) ret
;coordinates are in hlv client
mou r.left+5 r.top+5 hlv 1
#7
That helps, thanks.


Forum Jump:


Users browsing this thread: 1 Guest(s)