Posts: 1,027
Threads: 245
Joined: Jul 2022
Hi,
Using the following code, I can get the text of the SyntaxEditor control, but the ID of the control is dynamically changing
I have tried other methods, but they have no effect. Is there a more effective method?
Thanks in advance for any suggestions and help
david
int w=wait(6 WV win("LINQPad 7" "*.Window.*"))
Acc a.Find(w "CLIENT" "" "class=WindowsForms10.Window.8.app.0.245fb7_r3_ad1[]id=7276110" 0x1004 6)
str name=a.Name
out name
Posts: 12,061
Threads: 140
Joined: Dec 2002
05-20-2023, 01:22 PM
(This post was last modified: 05-20-2023, 01:32 PM by Gintaras.)
Its direct parent has wfName.
Macro
Macro3168
int w=win("LINQPad 7" "*.Window.*")
int c=child("" "WindowsForms10.Window.8.app.0.2aeb54d_r3_ad1" w 0x0 "wfName=panEditor")
c=GetWindow(c GW_CHILD)
To discover it I used LibreAutomate. Its "Find window" tool is better. LA code would be
var w = wnd.find(1, "LINQPad 7");
var c = w.Child(1, "***wfName panEditor", "*.Window.*");
c = c.Get.FirstChild;
Posts: 1,027
Threads: 245
Joined: Jul 2022
05-20-2023, 10:12 PM
(This post was last modified: 05-21-2023, 05:05 AM by Davider.)
Still not getting control handle
Where can I find
wfName ?
Posts: 12,061
Threads: 140
Joined: Dec 2002
In LA "Find window" tool the control with wfName is one line above the selected control in the tree.
Posts: 1,027
Threads: 245
Joined: Jul 2022
It's a bit strange
In QM and LA, Unable to find
wfName when code is not saved(After the tab text, there is a *)
Posts: 12,061
Threads: 140
Joined: Dec 2002
05-21-2023, 05:14 AM
(This post was last modified: 05-21-2023, 05:17 AM by Gintaras.)
My Linqpad version is 7.6.6. The LA "Find window" tool shows "***wfName panEditor" property of the direct parent control, regardless of saved or not.
Posts: 1,027
Threads: 245
Joined: Jul 2022
same ver7.6.6
my system: windows7 x64 .Net4.8+.Net6
It seems that the problem is random
Posts: 12,061
Threads: 140
Joined: Dec 2002
You don't select the parent control in the tree.
Posts: 1,027
Threads: 245
Joined: Jul 2022
05-21-2023, 06:41 AM
(This post was last modified: 05-21-2023, 06:42 AM by Davider.)
Thanks for your help
After finding it, the following code still has no results
QM: prompt: handle not found
LA: output is empty
Macro
Macro5
int w=win("LINQPad 7" "*.Window.*")
int c=child("" "WindowsForms10.Window.8.app.0.2aeb54d_r3_ad1" w 0x0 "wfName=panEditor")
c=GetWindow(c GW_CHILD)
_s.getwintext(c)
out _s
var w = wnd.find(1, "LINQPad 7");
var c = w.Child(1, "***wfName panEditor", "*.Window.*");
c = c.Get.FirstChild;
print.it(c.ControlText);
Posts: 12,061
Threads: 140
Joined: Dec 2002
05-21-2023, 07:03 AM
(This post was last modified: 05-21-2023, 07:14 AM by Gintaras.)
LA
print.it(c.NameElm);
QM
Acc a1.FromWindow( c )
_s=a1.Name
Posts: 12,061
Threads: 140
Joined: Dec 2002
05-21-2023, 07:17 AM
(This post was last modified: 05-21-2023, 07:18 AM by Gintaras.)
If not found in QM, may the class name is different on computers.
int c=child("" "*.Window.*" w 0x0 "wfName=panEditor")
Posts: 1,027
Threads: 245
Joined: Jul 2022
05-21-2023, 10:15 AM
(This post was last modified: 05-21-2023, 10:21 AM by Davider.)
thank you so much!
Macro
Macro5
int w=win("LINQPad 7" "*.Window.*")
;int c=child("" "WindowsForms10.Window.8.app.0.2aeb54d_r3_ad1" w 0x0 "wfName=panEditor") ;;NO
int c=child("" "*.Window.*" w 0x0 "wfName=panEditor") ;;OK
c=GetWindow(c GW_CHILD)
;_s.getwintext(c); out _s ;;NO
Acc a1.FromWindow(c); out a1.Name ;;OK
When I type the letter n, the AT list shows that the last item is selected, but the Name... is not selected