The button I want to click is on a not maximized on top window. It's like a tiny window on top of everything else. I want to address a hotkey to its button, for example pressing D
and the button is pressed.
Meet Window SpyRun your empty script to have the AHK icon appear in the Windows tray. Right-click on it and choose Window Spy from the menu that pops up. Now, whenever you click on any other window, AutoHotkey's Window Spy will present you information about it.
Double click Right mouse button to activate the part of double click code. Click and hold Right mouse button for a moment (more than 200 ms) then release it to activate the the part of single click code. btw, i comment the Send, ^p and Send, {RButton} to make it just focus on the ToolTip. You can change it if you want.
The left mouse button when used with Send, but the primary mouse button when used with hotkeys. In other words, if the user has swapped the buttons via system settings, LButton:: is physically activated by clicking the right mouse button, but Send {LButton} performs the same as physically clicking the left button.
See the AutoHotkey documentation as suggested by @user3419297
https://autohotkey.com/docs/commands/ControlClick.htm
With the window spy, you'll be able to find the control's Name/ID. For example, Button2
or Edit1
. Then use ControlClick
on that control.
ControlClick, Button2, WindowTitle
Most likely you'll be able to use the button's text too. For example, an "OK" button.
ControlClick, OK, WindowTitle
In both examples given, WindowTitle is where you can put the words that show up in a window's title bar. More can be learned from the documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With