pl123 Posted November 8, 2010 Posted November 8, 2010 (edited) I need to place an array in a GUI. For example, when this code below finishes executing, I want to place the resulting array in a GUI. Is this possible? Func _InstalledPrograms () Local $Count = 1 While 1 $Key = RegEnumKey ($InstalledProgramRegKey, $Count) If Not @error = 0 then ExitLoop $Line = RegRead ($InstalledProgramRegKey & '\' & $Key, 'Displayname') $Line = StringReplace ($Line, ' (remove only)', '') If Not $Line = "" Then ; If Not IsDeclared('ProgramArray') Then Dim $ProgramArray[1] ReDim $ProgramArray[UBound($ProgramArray) + 1] $ProgramArray[0] = UBound($ProgramArray) - 1 $ProgramArray[UBound($ProgramArray) - 1] = $Line EndIf $Count = $Count + 1 WEnd Select Case IsDeclared('ProgramArray') = 0 SetError (1) Return ('') Case IsDeclared('ProgramArray') = 1 SetError (0) Return($ProgramArray) EndSelect EndFunc EDIT: I want the array to show as a list in the GUI. Edited November 8, 2010 by pl123
enaiman Posted November 8, 2010 Posted November 8, 2010 It is possible but you need to be more specific. - you want it displayed in a list - create controls for all the elements (buttons, labels, checkboxes...) - displayed in a treeview Every way has a different coding but IT IS possible. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
Realm Posted November 8, 2010 Posted November 8, 2010 Hello pl123, Try _ArrayDisplay() with the Array.au3 UDF. If that does not suit your needs, than you may want to look into listview functions and the listview UDF. All of which are in your help file. Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.
pl123 Posted November 8, 2010 Author Posted November 8, 2010 enaiman: I think in a list would be best.
Realm Posted November 8, 2010 Posted November 8, 2010 enaiman: I think in a list would be best.I don't think that enaiman caught your Edit pl123. Thus his reply was just from before your edit. At first you did'nt specify how you wanted the output to the GUI. Thus he was asking for specifics following up with a few examples. His suggestion of using a TreeView might work as well, all depending on what you need. Next Time you post for help, try to explain in detail what issue/problem you are having, also in detail what you expect as the final result, and of course and example of the code where you are experiencing an issue/problem(Which you did)It is alot easier to help someone fix their car, if they tell you what is wrong with it Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.
enaiman Posted November 8, 2010 Posted November 8, 2010 You didn't have even a short look at the help file - did you?The answer is straight there: _GUICtrlListView_AddArray --------------------------------------------------------------------------------Adds items from an array to the control#Include <GuiListView.au3>_GUICtrlListView_AddArray($hWnd, ByRef $aItems)... with examples and everything. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
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