Joseph Posted September 28, 2008 Posted September 28, 2008 i made a auto it that presses the right arrow every 15 seconds, but i'm trying to make the gui so that u can click exit and the program shuts down, for now the close at the top right doesn't work either, only the minimize, and the loop i used for the right arrow is supposed to go until the exit message box opens. i know theres a better way i just don't know how to do it #include <GuiConstants.au3> GUICreate("Right Arrow App", 300, 100,) $ExitId = GUICtrlCreateButton("Exit",20,20,20,20) GUISetState() Do $msg = GUIGetMsg() Select Case $msg= $ExitId MsgBox(0,"Closing Down Arrow App", "Exit") Case $msg= $GUI_EVENT_CLOSE MsgBox(0,"Closing Down Arrow App", "Closing") EndSelect Sleep(15000) Send("{right}") Until $msg = $GUI_EVENT_CLOSE or $msg = $ExitId http://runecrue.awardspace.comhttp://demopros.awardspace.com
TehWhale Posted September 28, 2008 Posted September 28, 2008 (edited) #include <GuiConstants.au3> GUICreate("Right Arrow App", 300, 100,) $ExitId = GUICtrlCreateButton("Exit", 20, 20, 20, 20) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $ExitId MsgBox(0, "Closing Down Arrow App", "Exit") Sleep(15000) Send("{RIGHT}") ExitLoop Case - 3 ;GUI_EVENT_CLOSE MsgBox(0, "Closing Down Arrow App", "Closing") Sleep(15000) Send("{RIGHT}") ExitLoop EndSwitch WEnd Edited September 28, 2008 by Alienware
Joseph Posted September 28, 2008 Author Posted September 28, 2008 #include <GuiConstants.au3> GUICreate("Right Arrow App", 300, 100,) $ExitId = GUICtrlCreateButton("Exit", 20, 20, 20, 20) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $ExitId MsgBox(0, "Closing Down Arrow App", "Exit") Sleep(15000) Send("{RIGHT}") ExitLoop Case - 3 ;GUI_EVENT_CLOSE MsgBox(0, "Closing Down Arrow App", "Closing") Sleep(15000) Send("{RIGHT}") ExitLoop EndSwitch WEnd ok i worked with what u edited but i had to change it to this which does the right arrow every 5 seconds (15 sec or 5 doesn't matter yet) .. because your code waited 15 seconds before closing the program #include <GuiConstants.au3> GUICreate("Right Arrow App", 300, 100) $ExitId = GUICtrlCreateButton("Exit", 20, 20, 20, 20) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $ExitId MsgBox(0, "Closing Down Arrow App", "Exit") ExitLoop Case - 3;GUI_EVENT_CLOSE MsgBox(0, "Closing Down Arrow App", "Closing") ExitLoop EndSwitch Sleep(5000) Send("{RIGHT}") WEnd http://runecrue.awardspace.comhttp://demopros.awardspace.com
AdmiralAlkex Posted September 28, 2008 Posted September 28, 2008 @joemac4130 That is a horrid way of pressing the right arrow every 5 secs, you should use AdlibEnable() .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Joseph Posted September 28, 2008 Author Posted September 28, 2008 @joemac4130That is a horrid way of pressing the right arrow every 5 secs, you should use AdlibEnable()can u give me an example of how to work with AdlibEnable http://runecrue.awardspace.comhttp://demopros.awardspace.com
TehWhale Posted September 28, 2008 Posted September 28, 2008 can u give me an example of how to work with AdlibEnableThe helpfile has a great assortment of examples, including one with AdlibEnable and AbLibDisable!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now