Jump to content

$i= GUICtrlCreateInput


layer
 Share

Recommended Posts

Im making this program...And I want it to have a twist to it by adding GUI instead of InputBox...I need it to type the text that the user typed in into another window, I have this down except it types the number 3... If I use inputbox, it works fine, but I want to add different styles with the GUI, any suggestions? :)

FootbaG
Link to comment
Share on other sites

I think I know what you mean

Are you trying to do something like this

$password = InputBox("Password prompt", "Please enter your password.", "", "*", 300, 100)

if $password = ("correct") then 
            MsgBox(4096,"", "Bingo.")
else 
           MsgBox(4096,"", "Er wrong.")
endif

Adcept you want to use GUICtrlCreateInput instead of InputBox ?

I actually need help on the same topic,but im not going to start a new thread !

Can anyone give an example like the 1 I have above adcept using GUICtrlCreateInput ?

Edited by nova
Link to comment
Share on other sites

Like this?

#include "GUIConstants.au3"

GUICreate(" My GUI input acceptfile", 320,120, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000018); WS_EX_ACCEPTFILES
$password = GUICtrlCreateInput ( "", 10,  5, 300, 20)
$btn = GUICtrlCreateButton ("Ok", 40,  75, 60, 20)

GuiSetState () 

$msg = 0
While $msg <> $GUI_EVENT_CLOSE
       $msg = GUIGetMsg()
       Select
           Case $msg = $btn
               exitloop
       EndSelect
Wend
$password=GUIRead($password)
if $password = ("correct") then
           MsgBox(4096,"", "Bingo.")
else
          MsgBox(4096,"", "Er wrong.")
endif

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

Nope, I tried GUIRead ("$file") but it didn't work, I used to know how to do this, any more suggestions? In case your wondering, heres the code =D

#include "GUIConstants.au3"

GUICreate("AuHomework",300, 200, -1, -1, 0x00080000, 0x00020000)
GUICtrlCreateLabel ("Please enter some keywords on your work:", -1, -1)
$file = GUICtrlCreateInput ( "", 10,  25, 250, 20)
GUICtrlSetState(-1,$GUI_ACCEPTFILES) 
$hey = GUICtrlCreateButton ("Go!", 40,  75, 60, 20)
GuiSetState ()
Func godo ()
   GUIRead ("$file")
   Send("#r")
Send("http://www.google.com")
Send ("{enter}")
sleep ("2000")
send ($file)
Send ("{enter}")
endfunc
While 1
       $get = GUIGetMsg()
       Select
       case $get= $GUI_EVENT_CLOSE
          exitloop
           Case $get = $hey
godo ()
       EndSelect
    Wend

I don't think that this is all I will be adding...I may be adding some more but this is just to make it work, so any reasons why I can't make the file type the string $file into google?

FootbaG
Link to comment
Share on other sites

w00t, i got it! here it is, just a little change...

#include "GUIConstants.au3"

GUICreate("AuHomework",300, 200, -1, -1, 0x00080000, 0x00020000)
GUICtrlCreateLabel ("Please enter some keywords on your work:", -1, -1)
$file = GUICtrlCreateInput ( "", 10,  25, 250, 20)
GUICtrlSetState(-1,$GUI_ACCEPTFILES) 
$hey = GUICtrlCreateButton ("Go!", 40,  75, 60, 20)
GuiSetState ()
Func godo ()
   Send("#r")
Send("http://www.google.com")
Send ("{enter}")
sleep ("2000")
send (GUIRead ($file))
Send ("{enter}")
endfunc
While 1
       $get = GUIGetMsg()
       Select
       case $get= $GUI_EVENT_CLOSE
          exitloop
           Case $get = $hey
godo ()
       EndSelect
    Wend

thanks all!!

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