If I use Active Window Info (Window Spy) to look at a field, it's ClassNN shows:
HwndWrapper[Trebuchet.App.exe;Cherwell 1;5be27849-1217-4b27-ae1f-0652209e09b2]1
How would I use ControlFocus to move the text cursor to it?
It's easy with one that lists this as its ClassNN:
WindowsForms10.EDIT.app.0.17e61ce_r12_ad11
Any thoughts? Thank you in advance!
HwndWrapper and ControlFocus
Re: HwndWrapper and ControlFocus
Hi, ryjames, this looks like something to do with Cherwell Service Management installation, might that be right?I think what you need is this:
First, ControlGet
If that's some kind of child my feeble attempt may be worthless, and I likely missed a comma, I have no way to test this at the moment. Also take a look here:
Lexikos's posts.
(Especially regarding 'WinGet ControlList', and the example below that.)
Anyway, once you get the Hwnd, then:
Hope I'm not giving you a bum steer, which considering I've got no way to test this is possible (maybe even likely). I think you're close anyway.
Regards,
burque505
First, ControlGet
So, maybe, unless that's a child, something like this;Retrieves the window handle (HWND) of the specified control.
Code: Select all
ControlGet, TrebuchetWindowHwnd, Hwnd, , HwndWrapper[Trebuchet.App.exe;Cherwell 1;5be27849-1217-4b27-ae1f-0652209e09b2]1, TheTitleWhateverItIs
Lexikos's posts.
(Especially regarding 'WinGet ControlList', and the example below that.)
Anyway, once you get the Hwnd, then:
Code: Select all
ControlFocus, ,TrebuchetWindowHwnd
Regards,
burque505
Re: HwndWrapper and ControlFocus
Thank you for the suggestion! I tried it out and it doesn't find it still.
As an experiment, I tried:
This also did not work
I'm not sure what the trick is.
Thank you again for the suggestion!
Also, I did try printing out a complete control list and it shows up the same for that control as it does from the spy.
One other weird thing is that if I search for the coordinates of the control with a loop, it finds 2 results. One is the same hwndwrapper string as above, but the other one looks like the kind that works starting with WindowsForms10.Window... etc.
But even if I try to send focus to that, it does not work.
If it didn't work so well for other fields, I wouldn't be so stuck on making this work! haha
Any suggestions are welcome!
As an experiment, I tried:
Code: Select all
ControlGetFocus, CurrentControl, Cherwell
Control, EditPaste, %SendWhat%, %CurrentControl%, Cherwell
I'm not sure what the trick is.
Thank you again for the suggestion!
Also, I did try printing out a complete control list and it shows up the same for that control as it does from the spy.
One other weird thing is that if I search for the coordinates of the control with a loop, it finds 2 results. One is the same hwndwrapper string as above, but the other one looks like the kind that works starting with WindowsForms10.Window... etc.
But even if I try to send focus to that, it does not work.
If it didn't work so well for other fields, I wouldn't be so stuck on making this work! haha
Any suggestions are welcome!