windows - Replicate text from AutoIt form to Notepad -


I am using this autot code to send text to Notepad on the press of a button:

< Pre> #include & lt; ButtonConstants.au3 & gt; # Include & lt; EditConstants.au3 & gt; # Include & lt; GUIConstantsEx.au3 & gt; # Include & lt; WindowsConstants.au3 & gt; $ Form = GUICreate ("Replicate text for Notepad", 615, 50, 190, 122) $ input = GUICtrlCreateInput ("placeholder text", 0, 0, 609, 21) $ button = GUICtrlCreateButton ("Send to Notepad GUISetState (@SW_SHOW) while $ 1 $ nMsg = GUIGetMsg () switch $ nMsg Case $ GUI_EVENT_CLOSE Exit Case $ button example (GUICtrlRead ($ input)) EndSwitch go Function Example ($ text) Run ("Notepad .exe") Local $ hWnd = WinWait ("[Class: Notepad]", "", 10) ControlSend ($ hWnd, "", "Edit1", $ text) EndFunc

This is doing great work but now I am as soon as I He will press, I would like to send keystroke. Is there something like okay in autight? Therefore, every time I type a character, I will not have to press the send button to send the notepad.

"post-text" itemprop = "text">

How do I do this. Act very beautiful!

  #include & lt; Button Resources 3 & gt; # Include & lt; EditConstants.au3 & gt; # Include & lt; GUIConstantsEx.au3 & gt; # Include & lt; WindowsConstants.au3 & gt; Run ("notepad.exe") Global $ hWnd = WinWait ("[Class: Notepad]", "", 10) $ form = GUICreate ("Text for Notepad", replica 615, 50, 190, 122) $ Input = GUICtrlCreateInput ("placeholder text", 0, 0, 609, 21) $ button = GUICtrlCreateButton ("Send to Notepad", 0, 24, 609, 25) GUISetState (@SW_SHOW) $ OldText = "" While $ 1 NMsg = GUIGetMsg () $ nytext = press GUIC ($ input) if $ old text & lt; & Gt; $ NewText then $ OldText = $ NewText example ($ NewText) endif switch $ nMsg Case $ GUI_EVENT_CLOSE Exit Case $ button example (GUICtrlRead ($ input)) EndSwitch Going Function Example ($ text) ControlSetText ($ hWnd, "", " Edit1 ", $ text) Endfank  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -