Jump to content
Sign in to follow this  
Unc3nZureD

Simple GUI question.

Recommended Posts

Unc3nZureD

hi, i tried to do a little "program" with a GUI but i get stucked at the testing.1st i show my source:

msgbox(4096, "Credits", "All credit goes to Unc3nZureD!" & @CRLF & "          Thanks For Using")

#include <GUIConstantsEx.au3>

$GUI = GUICreate("Help", 200, 200)
$B1 = GUICtrlCreateButton("Button 1",0,0,200,50)
$B2 = GUICtrlCreateButton("Button 2",0,50,200,50)
$B3 = GUICtrlCreateButton("Button 3",0,100,200,50)
$B4 = GUICtrlCreateButton("Button 4",0,150,200,50)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
            
        Case $B1
            $sVar = InputBox("Spammer", "Write the text what u want to spam. Avoid for the character limits")
            Global $Paused
            HotKeySet("{F10}", "ShowMe")

            While 1
                Sleep(100)
            WEnd

            Func ShowMe()
            Send("{ENTER}")
            Send($sVar)
            Send("{ENTER}")
            EndFunc
        Case $B2
            
        Case $B3
                
        Case $B4
            
    EndSwitch
WEnd

(the case2,3,4 is currently clear, i'll do more features there)

now my problem:

when i press Button1 the window will open but i can't do other thing in the GUI window. is that possible to let me use the GUI and the opened script too?

thanks!

Share this post


Link to post
Share on other sites
Melba23

Unc3nZureD,

You are stuck in an infinite loop within the $B1 Case structure - remove it. Also put the Func ShowMe() code at the end of your script.

That should get you on your way - although posting code which includes the word "spam" will not make you many friends nor get you much more help around here. :mellow:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Unc3nZureD

oops :mellow: ok i'll try it and sorry for spam text :P

Share this post


Link to post
Share on other sites
CodyBarrett

a different method for the GUI...

msgbox(4096, "Credits", "All credit goes to Unc3nZureD!" & @CRLF & "          Thanks For Using")
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
Opt ('GuiOnEventMode',1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;

#include <GUIConstantsEx.au3>

$GUI = GUICreate("Help", 200, 200)
$B1 = GUICtrlCreateButton("Button 1",0,0,200,50)
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
GUICtrlSetOnEvent ($B1,'_B1')
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;


$B2 = GUICtrlCreateButton("Button 2",0,50,200,50)
$B3 = GUICtrlCreateButton("Button 3",0,100,200,50)
$B4 = GUICtrlCreateButton("Button 4",0,150,200,50)
GUISetState(@SW_SHOW)



;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
GUISetOnEvent ($GUI_EVENT_CLOSE,'_GUI_EVENT_CLOSE',$GUI)
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;


While 1
;~     $nMsg = GUIGetMsg()
;~     Switch $nMsg
;~         Case $GUI_EVENT_CLOSE
;~             Exit

;~         Case $B1
;~             $sVar = InputBox("Spammer", "Write the text what u want to spam. Avoid for the character limits")
;~             Global $Paused
;~             HotKeySet("{F10}", "ShowMe")

;~             While 1
;~                 Sleep(100)
;~             WEnd

;~             Func ShowMe()
;~             Send("{ENTER}")
;~             Send($sVar)
;~             Send("{ENTER}")
;~             EndFunc
;~         Case $B2
;~         Case $B3
;~         Case $B4
;~ EndSwitch
Sleep (100)
WEnd

Func _B1 ()
    MsgBox (0,'Notice','This is an example of ON EVENT, as apposed to GUIGETMSG')
EndFunc
Func _GUI_EVENT_CLOSE ()
    Exit
EndFunc

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  

×