Jump to content

Recommended Posts

Posted (edited)

HI there. I'm new i just signed up with the forums cause i am in need of help. I am learned new things about macros, scripting, coding ETC. I'm trying to learn as much as i can cause soon i am starting college for computer and electronic engineering and there allot of programming and what not involved. But I've always for about the past 6 years wanted to know how to script, and code and program and so on.

I've learned how to create a GUI Window, with buttons.

I have a question, how do i make the GUI window stay open until i press the X button to close it?

Edited by naturecrunch
Posted (edited)

Welcome to the forum, you got a nice ideas but unfortunately we don`t talk about games automation here.. read the Rules

Try to avoid the "game" subject next time you post something.

Edited by monoscout999
Posted

Welcome to the forum, you got a nice ideas but unfortunately we don`t talk about games automation here.. read the Rules

Try to avoid the "game" subject next time you post something.

K sorry, i edited the post =)

Posted (edited)

I have a question, how do i make the GUI window stay open until i press the X button to close it?

Simple.

GuiGetMsg() inside the loop will do the trick. Read the help file about it.

Do
Until GuiGetMsg() = -3 ; -3 is the ID that the GUI recives when the Gui is closed(by press ESC or clicking in the right-upper corner "X")

PD : Maybe if you post a little example i write another too

Edited by monoscout999
Posted

Unfortunately this doesn't change the fact your initial intent is breaking the rules & anyway your question can easily be solved by reading the Help File which so many of us "newbies" did.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Posted

Unfortunately this doesn't change the fact your initial intent is breaking the rules & anyway your question can easily be solved by reading the Help File which so many of us "newbies" did.

Oh well it said don't say anything about what i mentioned earlier, that doesn't mean i can't get help with what i need to do with it what i want to do with it, as long as i don't mention what my future plans are. and yes, i've been seaching the help documents i have it open right now but i can't find the answer to make it stay open i've typed in many different questions and keywords but i cant get nothing. idk maybe i'm not useing it properly lol

Posted

Oh well it said don't say anything about what i mentioned earlier, that doesn't mean i can't get help with what i need to do with it what i want to do with it, as long as i don't mention what my future plans are. and yes, i've been seaching the help documents i have it open right now but i can't find the answer to make it stay open i've typed in many different questions and keywords but i cant get nothing. idk maybe i'm not useing it properly lol

mmmmh most examples about functions in the help file show you how to keep a GUI open... maybe you don`t look well.

Posted

HI there. I'm new i just signed up with the forums cause i am in need of help. I am learned new things about macros, scripting, coding ETC. I'm trying to learn as much as i can cause soon i am starting college for computer and electronic engineering and there allot of programming and what not involved. But I've always for about the past 6 years wanted to know how to script, and code and program and so on.

I've learned how to create a GUI Window, with buttons.

I have a question, how do i make the GUI window stay open until i press the X button to close it?

I know this is your edited post. I wasn't here to read your original post, but what you are asking above is extremely simple. Look up Koda for AutoIt. I literally made this example in about 30 seconds. It does what your edited post requested. Note that I'm only answering you because no mods have closed this thread.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 249, 92, -1, -1)
$Button1 = GUICtrlCreateButton("Click Me To Close", 32, 32, 171, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Exit
    EndSwitch
WEnd

#include <ByteMe.au3>

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
×
×
  • Create New...