Jump to content

Recommended Posts

Posted

I'm trying to learn autoit since a month, i wanted to send text to IE when its not active using controlsend- it works but when a text cursor containing app or window is active or in the foreground, the text is entered over there like i open chrome and it starts to enter the text in chrome. I guess i'm doing something wrong, if anyone can point it out it would be helpful.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#RequireAdmin

GUICreate("TEST", 270, 100, 850, 300, Default,$WS_EX_TOPMOST)

GUISetState(@SW_SHOW)

HotKeySet ("{numpaddot}", "MyExit")

GUICtrlCreateLabel("Send", 5, 12)
$key1 = GUICtrlCreateInput(IniRead("configTEST.ini", "Config", "$key1",""), 45, 10, 80)

GUICtrlCreateLabel("➽ [ Numpad Dot ] TO EXIT", 4, 65)

Local $startbutton = GUICtrlCreateButton("Start", 165, 8, 60)

Opt("SendKeyDelay", 75)

While 1
   $msg = GUIGetMsg()
   Select

      Case $msg = $startbutton
         $send1 = GUICtrlRead($key1)
         Sleep(2000)
            While 1
               ControlSend("HospitalfilesADMIN - Internet Explorer", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", $send1)
               Sleep(2000)
            WEnd

   EndSelect
WEnd

Func MyExit()
   IniWrite("configTEST.ini","Config","$key1",GUICtrlRead($key1))
   Exit
EndFunc

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...