#include "hiddenDesktopInteract.au3" ;test function for interacting with notepad app on hidden desktop func notepadtest() opt('winwaitdelay', 0) ;to make it run a little bit faster WinWait('[CLASS:Notepad]') $hwin = WinGetHandle('[CLASS:Notepad]') ControlSend($hwin, '', '[CLASS:Edit; INSTANCE:1]', 'hello{ENTER}') WinMenuSelectItem($hwin, '', '&Edit', 'Time/&Date') _hiddenDesktopInteract_cap($hwin, @DesktopDir & '\notepad_cap.jpg') ControlSend($hwin, '', '[CLASS:Edit; INSTANCE:1]', '^a') ControlSend($hwin, '', '[CLASS:Edit; INSTANCE:1]', '{DELETE}') WinClose($hwin) EndFunc ;test function for interacting with cmd.exe on hidden desktop func cmdtest() opt('winwaitdelay', 0) ;to make it run a little bit faster WinWait('[CLASS:ConsoleWindowClass]') $hwin = WinGetHandle('[CLASS:ConsoleWindowClass]') ControlSend($hwin, '', '', 'dir{ENTER}') sleep(500) _hiddenDesktopInteract_cap($hwin, @DesktopDir & '\cmd_cap.jpg') ControlSend($hwin, '', '', 'exit{ENTER}') EndFunc _hiddenDesktopInteract_run("notepad.exe", 'notepadtest') _hiddenDesktopInteract_run("cmd.exe", 'cmdtest')