Get all controls under the cursor Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
martin12

Get all controls under the cursor

Post by martin12 » 06 Dec 2015, 17:08

I am working with toolbars in a program where the buttons are reported as one control and the frame around the buttons is reported as a different control. The frame control has text naming the toolbar but the button control does not. Is there a way to get all the controls under a mouse click instead of just the top control? Thanks.

timelizards
Posts: 20
Joined: 11 Sep 2015, 21:00

Re: Get all controls under the cursor

Post by timelizards » 06 Dec 2015, 22:46

i find PostMessage works well for me for clicking toolbar buttons (and items in right click menus sometimes)

winget will get all controls in a window with the cmd controllist, but i dont know if the buttons you are looking for will show up - might be worth a look if you havent already

Martin12

Re: Get all controls under the cursor  Topic is solved

Post by Martin12 » 07 Dec 2015, 09:10

Thanks for the response. I think I left too much out in my attempt to avoid tl;dr.

What I need to do is detect which toolbar button is clicked. The toolbars are docked, but the program can open windows of varying sizes on the right side of the screen that move some of the toolbars so I can't just use the mouse position x and y for the screen. There is no text on the toolbar buttons control that I have been able to access. There are unique tool tips on the buttons but the AHK code I've tried so far does not read the tool tips. Since the control below the toolbar button control (should I call that a frame for the toolbar?) has text which names the toolbar I could calculate offsets to determine which button was clicked if I could access that second control, but the options I've tried so far provide data for just the top control with the toolbar buttons or provide data for all the controls on the screen. There are enough controls on the screen that I think it would slow down the program if I looped through all the controls for every mouse click.

LAPIII
Posts: 668
Joined: 01 Aug 2021, 06:01

Re: Get all controls under the cursor

Post by LAPIII » 28 Jan 2022, 11:50

timelizards wrote:
06 Dec 2015, 22:46
i find PostMessage works well for me for clicking toolbar buttons (and items in right click menus sometimes)
Could you post a script please?


Post Reply

Return to “Ask for Help (v1)”