Jump to content

Why wont this work?


Recommended Posts

Okay I have this

#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", '1')

GUICreate("GUI",400,500)
GUISetState($GUI_EVENT_Close,"QUIT")
GUIsetstate(@SW_SHOW)
While 1
    sleep(20000)
WEnd

Func QUIT()
    Exit
EndFunc

This has always worked before maybe I just did something wrong.. I have tried changing things, but no luck... What can i do... If this is a very stupid question Im VERY sorry....

Please help... Thank You for your help

Edited by Konstig
code
Link to comment
Share on other sites

#include <GUIConstantsEx.au3>

Opt("GUIOnEventMode", '1')

GUICreate("GUI",400,500)

GUISetState($GUI_EVENT_Close,"QUIT")

GUIsetstate(@SW_SHOW)

While 1

sleep(20000)

WEnd

Func QUIT()

Exit

EndFunc

Nuff said...

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Okay..Diff problem...Same topic...

I have this... Why doesnt it work...

$LEVEL = 1
    soundplay("")
    GUICreate("", 678, 586, 218, 117)
    GUISetOnEvent($GUI_EVENT_CLOSE, "quit")
     GUICtrlCreateProgress(144, 552, 513, 25)
    GUICtrlSetData(-1, 100)
    GUICtrlCreateLabel("", 0, 552, 142, 28)
    GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif")
    GUICtrlCreateLabel("", 8, 520, 53, 28)
    GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif")
    GUICtrlCreateLabel("", 72, 520, 34, 28)
    GUICtrlSetColor(-1, 16711680)
    GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif")
    GUICtrlCreateLabel("", 120, 520, 79, 28)
    GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif")
    $1 = GUICtrlCreatePic($PICTURE, 162, 135, 67, 77)
    GUICtrlSetOnEvent($1, "_Event")
    GUICtrlSetCursor(-1, 3)
    $2 = GUICtrlCreatePic($pic2, 162, 135, 67, 77)
    GUICtrlSetOnEvent($1, "Event2")
    GUICtrlSetCursor(-1, 3)
    GUISetState(@SW_SHOW)
    $TIMEY = 100    
    AdlibEnable("_Move",$TIMEY)
    
    While 1
        sleep(1)
        
    WEnd
Func Quit()
Exit
Endfunc

EDIT: how can i forget Almost 300 Posts :)

Edited by Konstig
code
Link to comment
Share on other sites

Okay..Diff problem...Same topic...

I have this... Why doesnt it work...

$LEVEL = 1
    soundplay("")
    GUICreate("", 678, 586, 218, 117)
    GUISetOnEvent($GUI_EVENT_CLOSE, "quit")
     GUICtrlCreateProgress(144, 552, 513, 25)
    GUICtrlSetData(-1, 100)
    GUICtrlCreateLabel("", 0, 552, 142, 28)
    GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif")
    GUICtrlCreateLabel("", 8, 520, 53, 28)
    GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif")
    GUICtrlCreateLabel("", 72, 520, 34, 28)
    GUICtrlSetColor(-1, 16711680)
    GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif")
    GUICtrlCreateLabel("", 120, 520, 79, 28)
    GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif")
    $1 = GUICtrlCreatePic($PICTURE, 162, 135, 67, 77)
    GUICtrlSetOnEvent($1, "_Event")
    GUICtrlSetCursor(-1, 3)
    $2 = GUICtrlCreatePic($pic2, 162, 135, 67, 77)
    GUICtrlSetOnEvent($1, "Event2")
    GUICtrlSetCursor(-1, 3)
    GUISetState(@SW_SHOW)
    $TIMEY = 100    
    AdlibEnable("_Move",$TIMEY)
    
    While 1
        sleep(1)
        
    WEnd
Func Quit()
Exit
Endfunc

EDIT: how can i forget Almost 300 Posts :P

1. You don't have #include <GuiConstants.au3>, so $GUI_EVENT_CLOSE is undefined.

2. You don't have GuiOnEventMode set.

3. You don't have the function _Move() defined, so the AdLibEnable() won't work.

4. All the controls are a useless distraction from the real problem at hand.

5. This works:

#include <GuiConstants.au3>

Opt("GuiOnEventMode", 1)

GUICreate("", 678, 586, 218, 117)
GUISetOnEvent($GUI_EVENT_CLOSE, "quit")

GUISetState(@SW_SHOW)

While 1
    Sleep(1)
WEnd

Func Quit()
    Exit
EndFunc  ;==>Quit

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • Moderators

1. You don't have #include <GuiConstants.au3>, so $GUI_EVENT_CLOSE is undefined.

2. You don't have GuiOnEventMode set.

3. You don't have the function _Move() defined, so the AdLibEnable() won't work.

4. All the controls are a useless distraction from the real problem at hand.

5. This works:

#include <GuiConstants.au3>

Opt("GuiOnEventMode", 1)

GUICreate("", 678, 586, 218, 117)
GUISetOnEvent($GUI_EVENT_CLOSE, "quit")

GUISetState(@SW_SHOW)

While 1
    Sleep(1)
WEnd

Func Quit()
    Exit
EndFunc ;==>Quit

:)

Is that a nice way of saying: "Next time you need some help with something, get off your ass and write a real replication script rather than chopping your code up that wouldn't work for anyone anyway"?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Is that a nice way of saying: "Next time you need some help with something, get off your ass and write a real replication script rather than chopping your code up that wouldn't work for anyone anyway"?

Well, penguins are just not that rude... :)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...