Jump to content

why doesnt this work


Recommended Posts

why doesnt this script work all it needs to do is write what is written in the input box into notepad

#include <GUIConstantsEX.au3>

GUICreate("test",200,200)

Local $words, $msg, $gobutton, $write

$gobutton = GUICtrlCreateButton("go",90,90)

$words = guictrlcreateinput("",90,70,90,20)

GUISetState(@SW_SHOW)

$write = GUICtrlRead($words)

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $gobutton

run("notepad.exe")

Send($write)

EndSelect

WEnd

Link to comment
Share on other sites

That's easy to explain -> $write = GUICtrlRead($words) reads an empty input box!

#include <GUIConstantsEX.au3>
GUICreate("test", 200, 200)
Local $words, $msg, $gobutton, $write
$gobutton = GUICtrlCreateButton("go", 90, 90)
$words = GUICtrlCreateInput("", 90, 70, 90, 20)
GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $gobutton
            $write = GUICtrlRead($words)
            Run("notepad.exe")
            WinWaitActive("[CLASS:Notepad]")
            Send($write)
    EndSelect
WEnd

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...