Jump to content

Simple GUI question.


Recommended Posts

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!

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

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