Jump to content

hey everyone i'm new need some help


Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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>

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