How to Work With Minimized Windows in AutoIt
Everything you need to know about working with minimized windows.
By. Jacob
Edited: 2021-06-05 12:24
Sending keystrokes and mouse clicks to minimized windows is, in some cases, possible by using the ControlClick and ControlSend functions.
The ControlCLick function is used to send mouse clicks to minimized windows, while ControlSend can be used to send keystrokes.
Trying to send input to minimized windows might not be such a good idea, depending on what you are trying to do. If you are trying to automate something in a browser window, then it is usually better to try and do it with HTTP requests, as it allows you to reach your goal without the need to keep the browser open.
See also: Sending HTTP Requests with AutoIt
Quick examples:
ControlClick($handle,"","","",1,10,135) ; Sends a MouseClick
ControlSend($handle, "", "Edit1", "This is some text") ; Sends a string of text to the "edit1" control in notepad.
Sending mouse clicks with ControlCLick
The below script will attempt to click inside a minimized browser window, about 135 pixels from the top, and 10px from the left. To make it work with your own browser layout, you might need to adjust the location to click.
$handle = WinGetHandle("MyButton - Mozilla Firefox", "")
ControlClick($handle,"","","",1,10,135)
This has been tested with a HTML file in Firefox, the file can be located at: https://beamtic.com/Examples/Minclickautoit.html
The important parameters are mainly the last three – the first of these is the number of times to click, the second and third are the coordinates, given in pixels.
Tell us what you think: