WindowsForms10.Window.8.app.0.34f5582_r41_ad1141

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
blue83
Posts: 157
Joined: 11 Apr 2018, 06:38

WindowsForms10.Window.8.app.0.34f5582_r41_ad1141

04 Oct 2018, 01:11

Hi,

Can anyone help me to click on this button in MS Dynamics AX?

Control is not working, yet Acc doesnt have path.

Ok, I can do it with "FindText - Capture screen image" and click, but I want that click to be inside of app? Something like COM in Internet Explorer.

Thnx
Attachments
Capture.PNG
(11.79 KiB) Downloaded 124 times
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: WindowsForms10.Window.8.app.0.34f5582_r41_ad1141

04 Oct 2018, 03:48

interesting. what is this? i never saw it?
Last edited by SL5 on 04 Oct 2018, 05:28, edited 1 time in total.
blue83
Posts: 157
Joined: 11 Apr 2018, 06:38

Re: WindowsForms10.Window.8.app.0.34f5582_r41_ad1141

04 Oct 2018, 04:06

Location of Acc is x370 y86 w127 h22

Other data can be seen from the picture.

If that is helpful?
User avatar
Frosti
Posts: 426
Joined: 27 Oct 2017, 14:30
Contact:

Re: WindowsForms10.Window.8.app.0.34f5582_r41_ad1141

04 Oct 2018, 15:48

Why not get a handle from it? Use it like a normal Win32 Control! Like a control named Edit3.

Code: Select all

ControlGet, Chwnd, hwnd,, WindowsForms10.Window.8.app.0.34f5582_r41_ad1141, A
Hope my code is right and you know what I mean?
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: WindowsForms10.Window.8.app.0.34f5582_r41_ad1141

04 Oct 2018, 15:53

Perhaps consider this, if the control's class changes each time.
Being more generic when using WinActivate and ControlSetText - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 24#p186624
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
Frosti
Posts: 426
Joined: 27 Oct 2017, 14:30
Contact:

Re: WindowsForms10.Window.8.app.0.34f5582_r41_ad1141

05 Oct 2018, 03:14

I've often have to deal with WindowsForms controls. Changing of the classNN name i've never seen, but I've never programmed a WindowsForms App. So it's unknown for me. Try jeeswg's suggestion if mine won't work over the time.
blue83
Posts: 157
Joined: 11 Apr 2018, 06:38

Re: WindowsForms10.Window.8.app.0.34f5582_r41_ad1141

05 Oct 2018, 03:30

Hi Frosti and jeeswg,

Thank you on you effort.

Frosti, I am getting hwnd (like one my first picture), but how to click based on hwnd?

jeeswg can you help me transfer me your code into my request, because ultimate goal is to click on a button.

Thank you
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: WindowsForms10.Window.8.app.0.34f5582_r41_ad1141

05 Oct 2018, 05:13

- My script will only work if there is a control, which the AHK window spy would report.
- Otherwise see JEE_AccGetTextAll, mentioned here:
jeeswg's Acc tutorial (Microsoft Active Accessibility) (MSAA) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=40590
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
Frosti
Posts: 426
Joined: 27 Oct 2017, 14:30
Contact:

Re: WindowsForms10.Window.8.app.0.34f5582_r41_ad1141

05 Oct 2018, 11:25

Oh sorry I leave you with a half solution. There a multiple possible ways. The safest way is to use the ControlClick command. You can use your handle or use only the classNN here.

Code: Select all

;ControlClick , Control-or-Pos, WinTitle, WinText, WhichButton, ClickCount, Options, ExcludeTitle, ExcludeText
;1. 
ControlClick,, ahk_id %Chwnd%
2.
ControlClick, WindowsForms10.Window.8.app.0.34f5582_r41_ad1141, A
There are much options left for this command in my description. For default it's send a left mouseclick.

Or you can use

Code: Select all

Mouseclick
with coordinates or you can send a message via

Code: Select all

SendMessage ; or 

Postmessage
.

I prefer ControlClick or Send/Postmessage because they set

Code: Select all

ErrorLevel
. With checking that you can control the success of your input.
blue83
Posts: 157
Joined: 11 Apr 2018, 06:38

Re: WindowsForms10.Window.8.app.0.34f5582_r41_ad1141

09 Oct 2018, 01:46

Thank you both of you.

This should work and it does in so many times, but in this case is not working.

Code: Select all

ControlClick, WindowsForms10.Window.8.app.0.34f5582_r41_ad1141, ahk_class AxMainFrame
Probably is something in app code, so I will use "FindText - Capture screen image" to resolve this situation.
digidings
Posts: 24
Joined: 22 Jan 2018, 17:04

Re: WindowsForms10.Window.8.app.0.34f5582_r41_ad1141

08 Jun 2021, 02:14

for me in a similar case (toggle a checkbox in a WindowsForms) it's working like this:

Code: Select all

F7:: ; each press should toggle the checkbox
WinFormTitle := "ahk_class AxMainFrame" ; <- insert the right title here
WinFormCtrl := "WindowsForms10.Window.8.app.0.34f5582_r41_ad1141" ; <- insert the right control here
ControlFocus, % WinFormCtrl, % WinFormTitle
Send {Space}
return 

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: morkovka18 and 170 guests