AccViewer crashing, Acc.ahk failing (invoke items, retrieve text, IE/Explorer/VLC) Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
User avatar
jeeswg
Posts: 5956
Joined: 19 Dec 2016, 01:58
Location: UK

AccViewer crashing, Acc.ahk failing (invoke items, retrieve text, IE/Explorer/VLC)

04 Jan 2017, 15:30

[EDIT: all the problems have now been resolved and the solutions described in the posts below]

I have had problems on some windows where AccViewer
has initial success but later crashes:
- Explorer windows (Windows 7) attempt to navigate menu and trigger
'Edit, Invert Selection'.
- AutoHotkey Help (AutoHotkey.chm opens with HTML Help, hh.exe),
attempt to retrieve text from the treeview (Contents tab).

I have had problems on some windows where AccViewer
is successful, but I have problems retrieving the information via Acc.ahk:
- Internet Explorer, close the notification bar (e.g. bar that
appears when you left-click on Download AutoHotkey Installer
at https://autohotkey.com/download/).
- VLC, retrieve timestamp.

Btw can AccViewer retrieve all the column text from a standard SysListView32 listview control.
accDescription retrieves columns other than the main column,
but in an untidy way (it includes the listview headers, and does not use line breaks).

Btw also, are there other techniques that AutoHotkey can use to retrieve information from windows other than:
ControlGet, AU3_Spy, AccViewer, iWB2 Learner.
Last edited by jeeswg on 23 Jan 2017, 02:59, edited 1 time in total.
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
jeeswg
Posts: 5956
Joined: 19 Dec 2016, 01:58
Location: UK

Re: AccViewer crashing, Acc.ahk failing (invoke items, retrieve text, IE/Explorer/VLC)

22 Jan 2017, 12:58

Although Acc seems to crash while exploring the Windows 7 Explorer menu bar.
I have now achieved what I wanted, which is basically invoking the 'Edit, Invert Selection' buttons instead of pressing 'alt+e, i'.
Unfortunately it turns out sending 'alt+e, i' is simpler and faster.
Using COM and Document.SelectedItems is also slow.
I still hope for a more direct method.

Code: Select all

GroupAdd, vGroupFolder, ahk_class CabinetWClass
GroupAdd, vGroupFolder, ahk_class ExploreWClass

#IfWinActive, ahk_group vGroupFolder
w:: ;click Edit, click Invert Selection (tested on Windows 7)
SendInput !ei
return

q:: ;click Edit, click Invert Selection (tested on Windows 7)
DetectHiddenWindows, Off
WinGet, hWnd, ID, A
oAcc := Acc_Get("Object", "4.3.3.2", 0, "ahk_id " hWnd)
oAcc.accDoDefaultAction(0)

WinWait, ahk_class #32768
WinGet, hWnd, ID, ahk_class #32768
oAcc := Acc_Get("Object", "1", 0, "ahk_id " hWnd)
oAcc.accDoDefaultAction(13)
return
#IfWinActive
===============

AccViewer does not seem to work on the AutoHotkey Help treeview,
I don't know why.
AccViewer works on the Media Player Classic treeview for example.
UISpy.exe was able to work with the AutoHotkey Help treeview.
Regarding listviews, I'm not sure if Acc.ahk can retrieve all the fields from a listview,
or just the first column, but UISpy.exe can retrieve all the columns.

I have managed to get SendMessage etc to work with the AutoHotkey Help treeview.
See JEE_TreeviewItemGetText at:
GUI COMMANDS: COMPLETE RETHINK - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 3&p=122036

Btw AutoHotkey can already get the text from external listviews e.g.
ControlGet, vText, List, , SysListView321, A

===============

Some further points:

Mozilla Firefox and Google Chrome tabs:
I managed to get Acc.ahk to work with Firefox and Chrome tabs:
Firefox/Chrome, get tab names/focus tab - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26947

UI Automation:
Maybe we need to get back to this, if anyone has the expertise:
https://github.com/jethrow/UIA_Interfac ... erface.ahk

Cheers.
Last edited by jeeswg on 16 Jul 2017, 17:02, edited 2 times in total.
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
Xtra
Posts: 1302
Joined: 02 Oct 2015, 12:15

Re: AccViewer crashing, Acc.ahk failing (invoke items, retrieve text, IE/Explorer/VLC)

22 Jan 2017, 14:47

alpha-release
Alpha
The alpha phase of the release life cycle is the first phase to begin software testing
User avatar
jeeswg
Posts: 5956
Joined: 19 Dec 2016, 01:58
Location: UK

Re: AccViewer crashing, Acc.ahk failing (invoke items, retrieve text, IE/Explorer/VLC)

22 Jan 2017, 20:30

VLC get time elapsed/duration:
one spanner in the works was:
vText2 := oAcc.accName ;this doesn't work
vText2 := oAcc.accName(0) ;this works

Note: I downloaded the version from PortableApps, but I don't think that will make any difference, because it sill uses the original files.

Code: Select all

q:: ;vlc get time elapsed/duration (tested on vlc.exe v2.2.0.0)

;get time elapsed/duration from window
WinGet, hWnd, ID, ahk_class QWidget ahk_exe vlc.exe
oAcc := Acc_Get("Object", "4.3.3", 0, "ahk_id " hWnd)
vText1 := oAcc.accChild(1).accName(0) " / " oAcc.accChild(3).accName(0)
oAcc := ""

;get time elapsed only from window alternative
WinGet, hWnd, ID, ahk_class QWidget ahk_exe vlc.exe
oAcc := Acc_Get("Object", "4.3.3.1", 0, "ahk_id " hWnd)
;vText2 := oAcc.accName ;this doesn't work
vText2 := oAcc.accName(0) ;this works
oAcc := ""

;get duration only from window alternative
WinGet, hWnd, ID, ahk_class QWidget ahk_exe vlc.exe
oAcc := Acc_Get("Object", "4.3.3.3", 0, "ahk_id " hWnd)
vText3 := oAcc.accName(0) ;this works
oAcc := ""

;get time elapsed/duration from control
ControlGet, hCtl, Hwnd, , QWidget5, ahk_class QWidget ahk_exe vlc.exe
oAcc := Acc_Get("Object", "4", 0, "ahk_id " hCtl)
vText4 := oAcc.accChild(1).accName(0) " / " oAcc.accChild(3).accName(0)
oAcc := ""

;get time elapsed only from control alternative
ControlGet, hCtl, Hwnd, , QWidget5, ahk_class QWidget ahk_exe vlc.exe
oAcc := Acc_Get("Object", "4.1", 0, "ahk_id " hCtl)
vText5 := oAcc.accName(0) ;this works
oAcc := ""

;get duration only from control alternative
ControlGet, hCtl, Hwnd, , QWidget5, ahk_class QWidget ahk_exe vlc.exe
oAcc := Acc_Get("Object", "4.3", 0, "ahk_id " hCtl)
vText6 := oAcc.accName(0) ;this works
oAcc := ""

MsgBox % vText1 "`r`n" vText2 "`r`n" vText3 "`r`n" vText4 "`r`n" vText5 "`r`n" vText6
Return
@Xtra, thanks we need to get it to beta!
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
jeeswg
Posts: 5956
Joined: 19 Dec 2016, 01:58
Location: UK

Re: AccViewer crashing, Acc.ahk failing (invoke items, retrieve text, IE/Explorer/VLC)  Topic is solved

23 Jan 2017, 02:58

Eureka! I have now fixed all my Acc problems!
The last one was the Internet Explorer notification bar.

Internet Explorer Save Open Cancel Popup - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=26223
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], boardtc, Brazolek123, Kobaltauge, SALZKARTOFFEEEL and 56 guests