Move mouse to taskbar to use AeroPeek Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
magpac
Posts: 4
Joined: 20 Jan 2017, 22:12

Move mouse to taskbar to use AeroPeek

20 Jan 2017, 22:27

I have a script to automate starting a number of apps, and one part I'd like to do but have no idea how to achieve it.

What I want is to start multiple copies of an app (they are VM's and I've got that bit), wait for them to finish loading (I've figured out Winwait, so tha's ok) and then move the mouse to the taskbar, over the icon for the first VM, so I can use Aeropeek to watch all the VMs in parallel to wait for them all to finish an action, before I initiate the next one.

So: Is there any way to launch an app, and then find the screen coordinates of the taskbar button associated with app?

Ideally I want to Start VM1, find the location of the taskbar button for that app and save it, do a bunch more mousemoves/mouseclicks to launch more Vms, then move the mouse back over the button and let Aeropeek do it's thing so I can tell when they are all waiting for further input.
Guest

Re: Move mouse to taskbar to use AeroPeek

21 Jan 2017, 03:09

I found this: http://blog.strixcode.com/2011/01/how-t ... on-on.html which gives a method of doing it, but I don't know how to translate that to Autohotkey.

Though a comment there suggests "Better is to use the Microsoft MSAA API. Use AccChecker_v2.0_x86 ->AccCheckUI.exe to display this object tree. This object tree contains the taskbar buttons, their position and their title."
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Move mouse to taskbar to use AeroPeek  Topic is solved

21 Jan 2017, 05:24

Hopefully this should do it to get the taskbar button coordinates.

Code: Select all

q:: ;taskbar get item names + coords (tested on Windows 7)
DetectHiddenWindows, On
ControlGet, hWnd, Hwnd, , MSTaskListWClass1, ahk_class Shell_TrayWnd
oAcc := Acc_Get("Object", "tool bar", 0, "ahk_id " hWnd)

vOutput := ""
Loop, % oAcc.accChildCount
oRect := Acc_Location(oAcc, A_Index), vOutput .= oRect.x " " oRect.y " " oRect.w " " oRect.h "`t" oAcc.accName(A_Index) "`r`n"
Clipboard := vOutput
MsgBox % "done"
Return
[this code was based on:]
Windows Update: detect if important updates available - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=26727
- JEE_ExpGetSystrayItems
- JEE_ExpUpdatesAvailable
- JEE_ExpGetTaskbarItems

[AccViewer is a very good window spy, and in order to run the Acc functions above:]
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
magpac
Posts: 4
Joined: 20 Jan 2017, 22:12

Re: Move mouse to taskbar to use AeroPeek

21 Jan 2017, 16:03

Thank you.

That seems to work fine, and will be almost directly usable for what I want.
kh_model
Posts: 3
Joined: 20 Jan 2020, 14:21

Re: Move mouse to taskbar to use AeroPeek

20 Jan 2020, 14:37

I am new to AHK programming. My test of the script posted above was conducted with the Windows 7 Professional 64 bit operating system and AHK version 1.0.48.05. When I run the script I get the following error:

-------------------------------------------
Error at Line 7.

The following variable name contains an illegal character:
"oAcc.accChildCount".

The program will exit.
-------------------------------------------

Is there any workaround which would allow me to fix the error without updating to a newer version of AHK? Can anyone explain what might be the cause of this particular error?

Thank you in advance for your time and consideration.
gregster
Posts: 9029
Joined: 30 Sep 2013, 06:48

Re: Move mouse to taskbar to use AeroPeek

20 Jan 2020, 16:07

kh_model wrote:
20 Jan 2020, 14:37
AHK version 1.0.48.05.
This is much too old for the Acc library.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: CastleChou, TAC109 and 123 guests