Jump to content

Recommended Posts

Posted

Hello, i am a beginner in AutoIt.

My question:

In my GUI i created "GUICtrlCreateEdit", code:

GUICtrlCreateEdit("Enter text here...",5 ,105 ,180, 90)

This idle time field for entering the text...

How do I do that text which I in he entered was is my variable $MyVariable?

GUICtrlCreateEdit("$textmesarea", 5, 105, 180, 90)
- does not work :[

Show example plz...

Thank! Sorry for my bad English...

Posted (edited)

Jos said:

#include <GUIConstants.au3>
GUICreate("Cmd",500,400)
Dim $txt=GUICtrlCreateEdit("Enter text here... Wait 5 seconds..",0,0,500,400)
GUISetState(@SW_SHOW)

enterText()

While 1
$msg=GUIGetMsg()
If $msg=$GUI_EVENT_CLOSE Then ExitLoop
WEnd

Func enterText()
Sleep(5000)
GuiCtrlSetData($txt,"Text has been entered.")
EndFunc

ETA: There are lots and lots of working code segements just like this in the helpfile. Just put your cursor on the command in scite and hit F1.

Edited by John
  • Developers
Posted

I do not understand :[

Which part is it you don't understand or is it all of it ?

Have you opened the helpfile on the provided functions and looked at the descriptions and examples ?

Would help when you are more specific. :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

Programm copy - insert...

  • I write text for copying in clipboard, in window #1.
  • I write name a window in which me it is necessary to insert text, in window #2.
  • I press "Copy" and is copied text which I carried in window #1 ($text).
  • I press "Paste in window" and is switched on window which I carried in window #2 ($progname) & is inserted text which I have copied "Button Copy".
as?

I have done picture...

Help plz...

Posted Image

Posted

? Is this what you're trying to do?

$hWnd = GuiCreate("")
$hEdit1 = GuiCtrlCreateEdit("",5,5,395,20)
$hEdit2 = GuiCtrlCreateEdit("",5,40,395,20)
$hButton1 = GuiCtrlCreateButton(" Copy ",5,70)
$hButton2 = GuiCtrlCreateButton("Paste in Window",50,70)

GuiSetState()

While 1
    $msg = GUIGetMsg()
    
    Switch $msg
        Case -3
            Exit
        Case $hButton1
            ClipPut(GuiCtrlRead($hEdit1))
        Case $hButton2
            WinActivate(GUICtrlRead($hEdit2))
            Send("^v{ENTER}")
    EndSwitch
WEnd
Posted

? Is this what you're trying to do?

$hWnd = GuiCreate("")
$hEdit1 = GuiCtrlCreateEdit("",5,5,395,20)
$hEdit2 = GuiCtrlCreateEdit("",5,40,395,20)
$hButton1 = GuiCtrlCreateButton(" Copy ",5,70)
$hButton2 = GuiCtrlCreateButton("Paste in Window",50,70)

GuiSetState()

While 1
    $msg = GUIGetMsg()
    
    Switch $msg
        Case -3
            Exit
        Case $hButton1
            ClipPut(GuiCtrlRead($hEdit1))
        Case $hButton2
            WinActivate(GUICtrlRead($hEdit2))
            Send("^v{ENTER}")
    EndSwitch
WEnd
Yes! Big thanks & thanks all! :)

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...