Jump to content

Need some help fixing a GUI


rrrm99
 Share

Recommended Posts

AutoItSetOption ("GuiCoordMode",0)

GUICreate("Emailer 1.2", 500,300, 500, 280, -1, 0x00000018)
$To = GUICtrlCreateInput ( "To/Destination", 12,  5, 300, 20)
$From = GUICtrlCreateInput ( "From", 6,  40, 300, 20)
$Subject = GUICtrlCreateInput ( "subject", 4,  50, 300, 20)
$Body = GUICtrlCreateInput ( "Body", 2,  60, 250, 100)
$btn = GUICtrlCreateButton ("Ok", 60,  100, 60, 20)
GUICtrlSetState(-1,$GUI_DROPACCEPTED)

GUISetState () 

$btn = 0
While $btn <> $GUI_EVENT_CLOSE
       $btn    = GUIGetMsg()
       Select
           Case $Body = $btn
               exitloop
       EndSelect
   Wend

im not good at making Guis...

Link to comment
Share on other sites

can u tell us what exactly do u need?

I can help u with ur GUI

#include <guiconstants.au3>
                            ; Create the GUI
            GUICreate("Emailer 1.2", 280,325,-1,-1,$WS_CAPTION)
                            ; Create GUI Items
            GUICtrlCreateGroup ("To / Destination" , 5 , 10 , 270, 50)
$To      =  GUICtrlCreateInput ( "",15 , 30 , 250 , 20)

            GUICtrlCreateGroup ("From" , 5 , 65 , 270, 50)
$From    =    GUICtrlCreateInput ( "", 15 , 85 , 250 , 20)

            GUICtrlCreateGroup ("Subject" , 5 , 120 , 270, 50)
$Subject =  GUICtrlCreateInput ( "", 15,  140, 250, 20)

            GUICtrlCreateGroup ("Body" , 5 , 175 , 270, 110)
$Body    =  GUICtrlCreateEdit ( "", 15, 195, 250, 80)

$ok      =  GUICtrlCreateButton ("Ok", 5,  295, 120, 22,$BS_ICON)
            GUICtrlSetImage (-1, "shell32.dll" ,144,0)         ; To set the Botton Icon
            GUICtrlSetTip (-1, "Press here to Send" , "!!!",1,1)    ; To Set The Control Tip
            
$close   =   GUICtrlCreateButton ("Exit", 155,  295, 120, 22,$BS_ICON)
            GUICtrlSetImage (-1, "shell32.dll" ,131,0)        ; To set the Botton Icon
            GUICtrlSetTip (-1, "Press here to exit" , "!!!",3,1)    ; To Set The Control Tip

        GUISetState () 

$btn = 0
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $gui_event_close
            Exit
        Case $msg = $close
        Exit
    Case $msg = $ok
        MsgBox (-1, "INFO" , "YOU NEED TO PUT YOUR COMMAND FIRST")
    EndSelect
Wend

this is just an example how to make ur GUI there're alot of ways to do so

Edited by star2

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

can u tell us what exactly do u need?

its for an emailer...

i need it to type the to, from etc in another window(already dont that but had a few bugs like the $from suddenly becomes wierd numbers/letters)

heres the code that does the typing

MouseClick ("left", 300, 644, 1)
Sleep (2000)
MouseClick ("left", 400, 308, 1)
Send (GUICtrlRead ($To))
MouseClick ("left", 400, 329, 1)
Send (GUICtrlRead($From))
MouseClick ("left", 400, 352, 1)
Send (GUICtrlRead($Subject))
MouseClick ("left", 400, 375, 1)
Send (GUICtrlRead($Body))
MouseClick ("left", 660, 523, 1)
Sleep (1000)
Edited by rrrm99
Link to comment
Share on other sites

Link to comment
Share on other sites

ok....... so its still becoming weird numbers???

And from what I see, in you example, controlsettext might be a better method :rambo:

works now...except for some weird thingy that clicks "File" at the upper left corner of IE then goes right and clicking something then makes it minimized :rolleyes:

entire code

#include <IE.au3>
#include <guiconstants.au3>
                            ; Create the GUI
            GUICreate("Emailer 1.2", 280,325,-1,-1,$WS_CAPTION)
                            ; Create GUI Items
            GUICtrlCreateGroup ("To / Destination" , 5 , 10 , 270, 50)
$To      =  GUICtrlCreateInput ( "",15 , 30 , 250 , 20)

            GUICtrlCreateGroup ("From" , 5 , 65 , 270, 50)
$From    =    GUICtrlCreateInput ( "", 15 , 85 , 250 , 20)

            GUICtrlCreateGroup ("Subject" , 5 , 120 , 270, 50)
$Subject =  GUICtrlCreateInput ( "", 15,  140, 250, 20)

            GUICtrlCreateGroup ("Body" , 5 , 175 , 270, 110)
$Body    =  GUICtrlCreateEdit ( "", 15, 195, 250, 80)
$btn = GUICtrlCreateButton ("Ok", 5,  295, 60, 20)
GUICtrlSetState(-1,$GUI_DROPACCEPTED)

GUISetState () 

$btn = 0
While $btn <> $GUI_EVENT_CLOSE
       $btn    = GUIGetMsg()
       Select
           Case $Body = $btn
               exitloop
       EndSelect
   Wend

$oIE = _IECreate ("prankmail.org")
WinActivate ("Prankmail | Making email fun again - Microsoft Internet Explorer")
WinWaitActive ("Prankmail | Making email fun again - Microsoft Internet Explorer")
Sleep (2000)
While 1
MouseClick ("left", 300, 644, 1)
Sleep (2000)
MouseClick ("left", 400, 308, 1)
Send (GUICtrlRead ($To))
MouseClick ("left", 400, 329, 1)
Send (GUICtrlRead($From))
MouseClick ("left", 400, 352, 1)
Send (GUICtrlRead($Subject))
MouseClick ("left", 400, 375, 1)
Send (GUICtrlRead($Body))
MouseClick ("left", 660, 523, 1)
Sleep (5000)
WEnd
Link to comment
Share on other sites

$btn = the the gui button, then you redim it to be a gui get msg??? no wonder it wont work :rambo: And prank email??? :rolleyes:

Try:

#include <IE.au3>
#include <guiconstants.au3>
; Create the GUI
GUICreate("Emailer 1.2", 280, 325, -1, -1, $WS_CAPTION)
; Create GUI Items
GUICtrlCreateGroup("To / Destination", 5, 10, 270, 50)
$To = GUICtrlCreateInput("", 15, 30, 250, 20)

GUICtrlCreateGroup("From", 5, 65, 270, 50)
$From = GUICtrlCreateInput("", 15, 85, 250, 20)

GUICtrlCreateGroup("Subject", 5, 120, 270, 50)
$Subject = GUICtrlCreateInput("", 15, 140, 250, 20)

GUICtrlCreateGroup("Body", 5, 175, 270, 110)
$Body = GUICtrlCreateEdit("", 15, 195, 250, 80)
$btn = GUICtrlCreateButton("Ok", 5, 295, 60, 20)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)

GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $btn
            MsgBox(0, "", "")
            ExitLoop
    EndSelect
WEnd

$oIE = _IECreate("prankmail.org")
WinActivate("Prankmail | Making email fun again - Microsoft Internet Explorer")
WinWaitActive("Prankmail | Making email fun again - Microsoft Internet Explorer")
Sleep(2000)
    MouseClick("left", 300, 644, 1)
    Sleep(2000)
    MouseClick("left", 400, 308, 1)
    Send(GUICtrlRead($To))
    MouseClick("left", 400, 329, 1)
    Send(GUICtrlRead($From))
    MouseClick("left", 400, 352, 1)
    Send(GUICtrlRead($Subject))
    MouseClick("left", 400, 375, 1)
    Send(GUICtrlRead($Body))
    MouseClick("left", 660, 523, 1)
    Sleep(5000)
Link to comment
Share on other sites

And from what I see, in you example, controlsettext might be a better method :rolleyes:

controlsettext wont be better becouse when i try to get the controlID through Autoit window info that i got when i downloaded autoit

but maybe i can use clipput and clipget

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