enigmaforceiv Posted September 2, 2012 Share Posted September 2, 2012 (edited) expandcollapse popup#region #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Tidy_Stop_OnError=n #endregion #include <File.au3> #include <Array.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include "RecFileListToArray.au3" Global $font = "Arial" Global $GUI_BGC = "0x660000" $GUI = GUICreate("C21 Chicago's Finest", 800, 600) ; creates window GUISetBkColor($GUI_BGC) Opt("GuiOnEventMode", 1) $BuyerV = GUICtrlCreateButton("Buyers", 50, 50, 100, 30) ;creates buttons $BEvent = GUICtrlSetOnEvent($BuyerV, "Buyers") ;assigns event to button $SellerV = GUICtrlCreateButton("Sellers", 50, 100, 100, 30) $SEvent = GUICtrlSetOnEvent($SellerV, "Sellers") $RenterV = GUICtrlCreateButton("Renters", 50, 150, 100, 30) $REvent = GuiCtrlSetOnEvent($RenterV, "Renters") $list = GUICtrlCreateList("", 200, 50, 300, 290) GUISetState() While 1 Sleep(1000) ;less cpu WEnd Func Buyers() GUICtrlSetData($list, "") Opt("GUICoordMode", 3) GUISetFont(9, 1000, 0, $font) Sleep(10) $FileList = _FileListToArray("C:DropboxCentury21Client DatabaseBuyers", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndFunc Func Sellers() GUICtrlSetData($list, "") Opt("GUICoordMode", 3) GUISetFont(9, 1000, 0, $font) Sleep(10) $FileList = _FileListToArray("C:DropboxCentury21Client DatabaseSellers", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndFunc Func Renters() GUICtrlSetData($list, "") Opt("GUICoordMode", 3) GUISetFont(9, 1000, 0, $font) Sleep(10) $FileList = _FileListToArray("C:DropboxCentury21Client DatabaseRentals", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndFunc GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd I'm having problems getting my script to close, it worked before (I hadn't had much of the code in there as I do now), and ever since I've been updating the script - it suddenly stopped allowing me to exit. I now have to end task through the task manager. Edited September 2, 2012 by enigmaforceiv Link to comment Share on other sites More sharing options...
Danyfirex Posted September 2, 2012 Share Posted September 2, 2012 put the includes again to test the code. Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
enigmaforceiv Posted September 2, 2012 Author Share Posted September 2, 2012 Sorry, had them collapsed. Link to comment Share on other sites More sharing options...
FireFox Posted September 2, 2012 Share Posted September 2, 2012 @enigmaforceiv 1. If you use GuiOnEventMode, then you should use SetOnEvent funcs. 2. You have set 2 main whiles, so the script is blocked to the 1st while and the 2nd while is never executed, so you can't close the GUI And I have cleaned other things, so here you go : expandcollapse popup#region #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Tidy_Stop_OnError=n #endregion #include <File.au3> #include <Array.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include "RecFileListToArray.au3" Global $font = "Arial" Global $GUI_BGC = "0x660000" Opt("GuiOnEventMode", 1) Opt("GUICoordMode", 3) $GUI = GUICreate("C21 Chicago's Finest", 800, 600) ; creates window GUISetBkColor($GUI_BGC) GUISetFont(9, 1000, 0, $font) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $BuyerV = GUICtrlCreateButton("Buyers", 50, 50, 100, 30) ;creates buttons $BEvent = GUICtrlSetOnEvent($BuyerV, "Buyers") ;assigns event to button $SellerV = GUICtrlCreateButton("Sellers", 50, 100, 100, 30) $SEvent = GUICtrlSetOnEvent($SellerV, "Sellers") $RenterV = GUICtrlCreateButton("Renters", 50, 150, 100, 30) $REvent = GUICtrlSetOnEvent($RenterV, "Renters") $list = GUICtrlCreateList("", 200, 50, 300, 290) GUISetState() While 1 Sleep(1000) ;less cpu WEnd Func Buyers() GUICtrlSetData($list, "") $FileList = _FileListToArray("C:DropboxCentury21Client DatabaseBuyers", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndFunc ;==>Buyers Func Sellers() GUICtrlSetData($list, "") $FileList = _FileListToArray("C:DropboxCentury21Client DatabaseSellers", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndFunc ;==>Sellers Func Renters() GUICtrlSetData($list, "") $FileList = _FileListToArray("C:DropboxCentury21Client DatabaseRentals", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndFunc ;==>Renters Func _Exit() Exit EndFunc ;==>_Exit Br, FireFox. Link to comment Share on other sites More sharing options...
Danyfirex Posted September 2, 2012 Share Posted September 2, 2012 take. expandcollapse popup#region #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Tidy_Stop_OnError=n #endregion #include <File.au3> #include <Array.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <RecFileListToArray.au3> Global $font = "Arial" Global $GUI_BGC = "0x660000" $GUI = GUICreate("C21 Chicago's Finest", 800, 600) ; creates window GUISetBkColor($GUI_BGC) Opt("GuiOnEventMode", 1) GUISetOnEvent($GUI_EVENT_CLOSE, "ExitGui") $BuyerV = GUICtrlCreateButton("Buyers", 50, 50, 100, 30) ;creates buttons $BEvent = GUICtrlSetOnEvent($BuyerV, "Buyers") ;assigns event to button $SellerV = GUICtrlCreateButton("Sellers", 50, 100, 100, 30) $SEvent = GUICtrlSetOnEvent($SellerV, "Sellers") $RenterV = GUICtrlCreateButton("Renters", 50, 150, 100, 30) $REvent = GUICtrlSetOnEvent($RenterV, "Renters") $list = GUICtrlCreateList("", 200, 50, 300, 290) GUISetState() While 1 Sleep(1000) ;less cpu WEnd Func Buyers() GUICtrlSetData($list, "") Opt("GUICoordMode", 3) GUISetFont(9, 1000, 0, $font) Sleep(10) $FileList = _FileListToArray("C:DropboxCentury21Client DatabaseBuyers", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndFunc ;==>Buyers Func Sellers() GUICtrlSetData($list, "") Opt("GUICoordMode", 3) GUISetFont(9, 1000, 0, $font) Sleep(10) $FileList = _FileListToArray("C:DropboxCentury21Client DatabaseSellers", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndFunc ;==>Sellers Func Renters() GUICtrlSetData($list, "") Opt("GUICoordMode", 3) GUISetFont(9, 1000, 0, $font) Sleep(10) $FileList = _FileListToArray("C:DropboxCentury21Client DatabaseRentals", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndFunc ;==>Renters GUISetState() Func ExitGui() Exit ; Exit the program EndFunc ;==>ExitGui Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
enigmaforceiv Posted September 2, 2012 Author Share Posted September 2, 2012 Thanks again everyone! Link to comment Share on other sites More sharing options...
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