Jump to content
Sign in to follow this  
SniperSA

Using GUICtrlCreateinput and using the user's input

Recommended Posts

I want to first find out how to get the program so lets say the user types in the input box i want the program to run notepad.exe and type the input. So how could i put $msg = $input and tell it to type what is in the box?

Share this post


Link to post
Share on other sites

ok well first i tested the GUICtrlRead and i told it to send input's data to a notepad, that worked. but now i was trying to make a GUICtrlCreateCombo and i put in my data. so when i test to see if it reads whats in the combo box and it says "3"

#include <GUIconstants.au3>
GUICreate("Script Select",200,200)
$1337 = GUICtrlCreateCombo("AIM Send",0,0)
GUICtrlSetData(-1,"Check Email|Check Myspace|Find X,Y|Starcraft Start")
$ok = GUICtrlCreateButton("Run Script",0,20)
GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    Select
        case $msg = $ok
            GUICtrlRead($1337)
            Msgbox(0,"Test",$1337)
            Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
    WEnd

Share this post


Link to post
Share on other sites

something like this

#include <GUIconstants.au3>
GUICreate("Script Select",200,200)
$1337 = GUICtrlCreateCombo("AIM Send",0,0)
GUICtrlSetData(-1,"Check Email|Check Myspace|Find X,Y|Starcraft Start")
$ok = GUICtrlCreateButton("Run Script",0,20)
GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    Select
        case $msg = $ok
            Run("notepad.exe")
                WinWait("Untitled -")
                ControlSetText("Untitled -", "", "Edit1", GUICtrlRead($1337) )
            Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
    WEnd

Share this post


Link to post
Share on other sites

well, i see that it works but lets say when AIM Send is selected i would want it to run a code, as an example you could use Msgbox(0,"AIM Send","Test")

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...