#include <MsgBoxConstants.au3>
Example()
Func Example()
Run("notepad.exe a.txt")
WinWait("a.txt - Notepad")
WinSetState("a.txt - Notepad","", @SW_HIDE)
Sleep(1000)
Local $value = ControlSend("a.txt - Notepad", "", "Edit1", "^a")
Sleep(2000)
MsgBox($MB_SYSTEMMODAL, "AutoIt Example", $value)
Sleep(1000)
Local $value2 = ControlSend("a.txt - Notepad", "", "Edit1", "^c")
Sleep(2000)
MsgBox($MB_SYSTEMMODAL, "AutoIt Example", $value2)
Sleep(1000)
Run("notepad.exe")
WinWait("Untitled - Notepad")
WinSetState("Untitled - Notepad","", @SW_HIDE)
Sleep(2000)
Local $value3 = ControlSend("Untitled - Notepad", "", "Edit1", "^v")
Sleep(1000)
MsgBox($MB_SYSTEMMODAL, "AutoIt Example", $value3)
Sleep(1000)
WinSetState("Untitled - Notepad","", @SW_SHOW)
EndFunc
I tried to execute the above code with having"@SW_HIDE" values in the Run command.
Applications are hidden but the controlSend commands are not working fine.
After removing the "@SW_HIDE" values in the Run command, controlsend command works, but the application window is not hidden.
I tried checking the flags returned from controlsend command. Flag Values are showing 1, I assume it is fine.
Please Could you help me to fix this problem. Thanks in advance.