HumperHard Posted March 10, 2009 Share Posted March 10, 2009 my numbering does the following: 1 10 11 12 13 13 14 2 3 4 5 6 7 8 9 How can I fix this? expandcollapse popup#include <Array.au3> #include <File.au3> #include <GuiConstantsEx.au3> #include <Misc.au3> #Include <GuiButton.au3> _Singleton("FileChecker") ; ######################################################################################### ; # Create GUI ; ######################################################################################### GUICreate("File Checker", 300, 300) GUISetBkColor(0xFFFFFFFF) ; PROGRESS $progress = 0 $progressbar = GuiCtrlCreateProgress(60, 10, 210, 20) GuiCtrlSetData($progressbar, $progress) $label = GuiCtrlCreateLabel("Progress:", 5, 15) $label2 = GUICtrlCreateLabel("File Extentions that failed:", 15, 40) $ExtList = GUICtrlCreateList("", 10, 60, 280, 200) $finishedButton = GUICtrlCreateButton("Finished", 120, 260, 60) GuiSetState(@SW_SHOW) ; ######################################################################################### ; # GUI Events ; ######################################################################################### Opt("GUIOnEventMode",1) GUISetOnEvent ($GUI_EVENT_CLOSE, "Close") GUICtrlSetOnEvent ($GUI_EVENT_CLOSE, "Finished") Func Finished() Exit EndFunc Func Close() Exit EndFunc ; ######################################################################################## ; # Check Open Restricted File Type Properties ; ######################################################################################## $checker1 = "" $checker2 = "" $listOfFails = "" $y = 0 $z = 0 ;set keys to check $EditFlags = "EditFlags" $AlwaysShowExt = "AlwaysShowExt" ;set path $RegPath = "HKEY_LOCAL_MACHINE\Software\Classes\" Local $keyArray[50] ;set rest of path $keyArray[0] = "AcroExch.Document" $keyArray[1] = "PowerPoint.Show.8" $keyArray[2] = "AcroExch.FDFDoc" $keyArray[3] = "AcroExch.XFDFDoc" $keyArray[4] = "PowerPoint.SlideShow.8" $keyArray[5] = "lslfile" $keyArray[6] = "PowerPoint.Template.8" $keyArray[7] = "lsofile" $keyArray[8] = "Word.Backup.8" $keyArray[9] = "htafile" $keyArray[10] = "JSfile" $keyArray[11] = "JSEfile" $keyArray[12] = "FirefoxHTML" $keyArray[13] = "lssfile" $keyArray[14] = "Word.document.8" For $x = 0 To $keyArray $checker1 = RegRead($RegPath & $keyArray[$z], $EditFlags) If @error Or $checker1 <> 0 Then $y = $y+1 $listOfFails = $y & " : " & $keyArray[$z] & " : " & $EditFlags $progress = $progress + 2 GUICtrlSetData($ExtList, $listOfFails) GuiCtrlSetData($progressbar, $progress) EndIf $checker2 = RegRead($RegPath & $keyArray[$z], $AlwaysShowExt) If @error Or $AlwaysShowExt = "" Then $y = $y+1 $listOfFails = $y & " : " & $keyArray[$z] & " : " & $AlwaysShowExt $progress = $progress + 2 GUICtrlSetData($ExtList, $listOfFails) GuiCtrlSetData($progressbar, $progress) EndIf $z = $z+1 Next $progress = 100 GuiCtrlSetData($progressbar, $progress) ; ######################################################################################## ; # Keep GUI Alive ; ######################################################################################## While 1 sleep(50) Wend Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 10, 2009 Moderators Share Posted March 10, 2009 HumperHard,You create your list control with the default styles, which according to the ever useful help file are: "$LBS_SORT, $WS_BORDER, $WS_VSCROLL". So your data is always sorted alphabetically (in computer terms!) as you have found out.If you changed your creation line to read:$ExtList = GUICtrlCreateList("", 10, 60, 280, 200, BitOR($WS_BORDER, $WS_VSCROLL))you should see a more normal (to our eyes at least!) numbering order.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
HumperHard Posted March 10, 2009 Author Share Posted March 10, 2009 HumperHard, You create your list control with the default styles, which according to the ever useful help file are: "$LBS_SORT, $WS_BORDER, $WS_VSCROLL". So your data is always sorted alphabetically (in computer terms!) as you have found out. If you changed your creation line to read:$ExtList = GUICtrlCreateList("", 10, 60, 280, 200, BitOR($WS_BORDER, $WS_VSCROLL)) you should see a more normal (to our eyes at least!) numbering order. M23 I included the <ListBoxConstants.au3> and added the above code to my script but I am getting errors stating that $WS_BORDER: possibly used before declaration. Link to comment Share on other sites More sharing options...
weaponx Posted March 10, 2009 Share Posted March 10, 2009 Include WindowsConstants.au3 Link to comment Share on other sites More sharing options...
HumperHard Posted March 10, 2009 Author Share Posted March 10, 2009 Include WindowsConstants.au3Thanks Guys... that worked!!! 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