Hello
Which GUI interactions can be done in the background i.e. without the window being active?
Thanks!
Background commands Topic is solved
Re: Background commands
All of them, because you control the GUI.
Re: Background commands
Hallo,
interactions from whom to whom?
An Autohotkey script does not need to "see" its own Guis to be able to interact with them.
With foreign Guis this is more difficult.
interactions from whom to whom?
An Autohotkey script does not need to "see" its own Guis to be able to interact with them.
With foreign Guis this is more difficult.
Re: Background commands
Interactions like:
1) Type 'something' in a minimised Notepad window
2) Open the File menu in a minimised Notepad window
3) Copy the text of a minimised Notepad window
without activating the Notepad window even temporarily (flashing it)
Is that possible?
Re: Background commands Topic is solved
Try:This opens a hidden Notepad window and saves and closes it on ExitApp:
Code: Select all
SetTitleMatchMode, 2
FileEncoding, UTF-8
FileAppend,, BackGround.txt
IFWinNotExist,% BackGround := "BackGround.txt ahk_exe NotePad.exe"
Run, "NotePad.exe" "BackGround.txt",, Min
q:: ;Type 'something' in a minimised Notepad window
ControlSend, Edit1, Hello World`n, %BackGround%
Return
w:: ;Copy the text of a minimised Notepad window
ControlGetText, ClipBoard, Edit1, %BackGround%
MsgBox,% ClipBoard
Return
Code: Select all
SetTitleMatchMode, 2
FileEncoding, UTF-8
FileAppend,, BackGround.txt
DetectHiddenWindows, On
Global BackGround := "BackGround.txt ahk_exe NotePad.exe"
IF !WinExist(BackGround)
Run, "NotePad.exe" "BackGround.txt" ,, Hide
OnExit("SaveBackGround")
q:: ;Type in a hidden Notepad window
ControlSend, Edit1, ^{End}Hello World, %BackGround%
Return
w:: ;Copy the text of a hidden Notepad window
ControlGetText, ClipBoard, Edit1, %BackGround%
MsgBox,% ClipBoard
Return
SaveBackGround()
{
WinActivate, %BackGround%
ControlSend, Edit1, ^s, %BackGround% ;store
WinWaitClose, *%BackGround%
WinClose, %BackGround% ;close
}