Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Acc object get tabindex on right click SysTabControl32
#1
Using Acc a.FromMouse
Is it possible to get the tab index from a QM SysTabControl32-control using Acc objects?

I have an application where duplicate tabnames could occur. I can enforce to not use duplicate tabnames but I was wondering if it was possible getting the tab index number when you have an situation where there are duplicate tabnames.

[test 1] [test 2] [test 3] [test 1]

User clicks the last tab "test 1" in a QM SysTabControl32, and then retrieve '3'.

I have this and could use it to compare "s" with the results of "aSel" but the user could have duplicate tabnames.
So the below code is not sufficient.

Macro Macro5
Code:
Copy      Help
int i
;; TABNAME FROM MOUSE POS
Acc a.FromMouse
str s=a.Name
out F"Tab name from mouse position: {s}"
;
;; ALL TABNAMES
int w1=win("RLaunch" "#32770")
Acc a2.Find(w1 "PAGETABLIST" "" "class=SysTabControl32[]id=6" 0x1004)
ARRAY(Acc) ac1
a2.GetChildObjects(ac1)
for i 0 ac1.len
,Acc& r1=ac1[i]
,str name1=r1.Name
,out name1

I couldn't get "Acc.ObjectFocused" to work.
If it's not possible I will just enforce unique tabnames.

Forgot to mention, it is used in a QM dialog where the user RIGHT clicks a tab, I then render a menu on mouse XY.
Problem is that there is no way to get the tab index number when right clicking:
https://msdn.microsoft.com/en-us/librar ... 47(v=vs.85).aspx
Tried TCM_GETCURFOCUS but does not work.
That's why I went this route.
#2
a.elem is 1-based tab index.
#3
Wow!
YES!
This works!!!
Thank you!!!


Forum Jump:


Users browsing this thread: 1 Guest(s)