Sign in to follow this  
Followers 0
corey822

i dont understand gui

10 posts in this topic

hey i still dont understand gui after reading the help file with autoit

i have no idea wat its used for or if its worth learning i have no idea can someone please enlighten me


C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake

Share this post


Link to post
Share on other sites



Isn't that a bit of a strange question to ask ?

yes i belive it is but can you please tell me what its used for i didnt understand anything

can it be used to creat a multi answer game like turn left or turn right if u turn left theres a monster u die and then it loops to begining?

if so can you please help me create a code and put some comments in it to make it easier to understand please

cheers C.W


C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake

Share this post


Link to post
Share on other sites

yes i belive it is but can you please tell me what its used for i didnt understand anything

can it be used to creat a multi answer game like turn left or turn right if u turn left theres a monster u die and then it loops to begining?

if so can you please help me create a code and put some comments in it to make it easier to understand please

cheers C.W

Merry christmas :)

#include <GuiConstants.au3>

$Menu = GUICreate("Game", 500,150)
Dim $Button[6]
For $i = 1 to 5
    $Button[$i]=GUICtrlCreateButton("Door #"&$i,(75*$i), 75, 75, 35)
Next
GUISetState()

While 1
    $Msg = GUIGetMsg()
    If $Msg = $GUI_EVENT_CLOSE then Exit
    For $x = 1 to 5
        If $Msg = $Button[$x] Then
            Switch $x
                Case 1,2,4,5
                    MsgBox(0,"LOSE", "Oh noes! It's a monster!!! You got eated.  :(")
                    Exit
                Case Else
                    MsgBox(0,"WIN!","Congratulations! No monster, YOU WIN!")
                    Exit
            EndSwitch
        EndIf
    Next
WEnd

Share this post


Link to post
Share on other sites

Merry christmas :)

#include <GuiConstants.au3>

$Menu = GUICreate("Game", 500,150)
Dim $Button[6]
For $i = 1 to 5
    $Button[$i]=GUICtrlCreateButton("Door #"&$i,(75*$i), 75, 75, 35)
Next
GUISetState()

While 1
    $Msg = GUIGetMsg()
    If $Msg = $GUI_EVENT_CLOSE then Exit
    For $x = 1 to 5
        If $Msg = $Button[$x] Then
            Switch $x
                Case 1,2,4,5
                    MsgBox(0,"LOSE", "Oh noes! It's a monster!!! You got eated.  :(")
                    Exit
                Case Else
                    MsgBox(0,"WIN!","Congratulations! No monster, YOU WIN!")
                    Exit
            EndSwitch
        EndIf
    Next
WEnd
merry christmas to u too and thnx for the help ive got koda now and now i have a newthing to learn and now im stuck with functions after making a gui i cant find the syntax or function for minimize maxamize and restore can anyone enlighten me please

cheers C.W


C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake

Share this post


Link to post
Share on other sites

merry christmas to u too and thnx for the help ive got koda now and now i have a newthing to learn and now im stuck with functions after making a gui i cant find the syntax or function for minimize maxamize and restore can anyone enlighten me please

It's times like this, were comma splicing, might not be, a bad thing. :)

Seriously... try reading the help file.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

GUIs are quite easy. Minimize, that's done automatically, what do you need that for? Close use:

Case $GUI_EVENT_CLOSE
      Exit
I saw in another post that he wants to put things like Min, Max, etc. into functions

corey822... help file.

GUISetState

Changes the state of a GUI window.

GUISetState ( [flag [, winhandle]] )

Parameters - flag

@SW_SHOW = Shows a previously hidden window (default)

@SW_HIDE = Hide window

@SW_MINIMIZE = Minimize window

@SW_MAXIMIZE = Maximize window

@SW_RESTORE = Undoes a window minimization

@SW_DISABLE = Disables the window

@SW_ENABLE = Enables the window

@SW_LOCK = Lock the window to avoid repainting.

@SW_UNLOCK = Unlock windows to allow painting.

winhandle [optional] Windows handle as returned by GUICreate (default is the previously used window).

Edited by The Ape

Share this post


Link to post
Share on other sites

merry christmas to u too and thnx for the help ive got koda now and now i have a newthing to learn and now im stuck with functions after making a gui i cant find the syntax or function for minimize maxamize and restore can anyone enlighten me please

cheers C.W

You can toy around with this if it helps :)

#include <GuiConstants.au3>

$GUI = GUICreate("Big - Little Example", 200, 500)
$Label = GUICtrlCreateLabel("Little", 75, 200, 50, 50)
GUICtrlSetFont($Label, 15, 400)
GUISetState()
While 1
    Sleep(3000)
    GUISetState(@SW_MAXIMIZE,$GUI)
    GuiCtrlSetData($Label, "Big")
    ControlMove($GUI, "", $Label, @DesktopWidth/2-25, @DesktopHeight/2-25)
    Sleep(3000)
    GUISetState(@SW_RESTORE,$GUI)
    GuiCtrlSetData($Label, "Little")
WEnd

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  
Followers 0