Do you want to be able to send something to one window that is not active (or minimised), and still be able to click in another window that is active?
Try the below, open notepad and minimise it. Then start the script. It will right click at the co-ordinates you put, but also will put some text to the notepad window.
Wait 10-15 seconds, then maximise the Notepad window, and you will see that it has the text in there.
Is this what you meant?
Code:
#NoEnv
#Persistent
SetTitleMatchMode, 2
WindowName := "Notepad" ; CHANGE YOUR WINDOW NAME HERE
SetTimer, SendF1, 5000 ; this will send F1 to an active (or inactive/minimised) window every 5 seconds
Click, right, 1259, 351 ; this will just right click, it doesn't matter which window is active
Return
SendF1:
ControlSend,, hello{ENTER}, %WindowName%
Return
Esc::ExitApp