johnmcloud Posted July 30, 2012 Posted July 30, 2012 Hi guys, i have some problem to make the output of a _GUICtrlListView_Create: #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <WindowsConstants.au3> $Number = 0 _Main() Func _Main() Local $GUI, $hImage $GUI = GUICreate("(UDF Created) ListView Create", 400, 300) $hListView = _GUICtrlListView_Create($GUI, "", 2, 2, 394, 268) _GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES)) GUISetState() _GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100) _GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100) _GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100) _GUICtrlListView_AddItem($hListView, "1", 0) _GUICtrlListView_AddSubItem($hListView, 0, "Item1", 1) _GUICtrlListView_AddSubItem($hListView, 0, "Item2", 2) _GUICtrlListView_AddItem($hListView, "2", 1) _GUICtrlListView_AddSubItem($hListView, 1, "Item1 - Line 2", 1) _GUICtrlListView_AddSubItem($hListView, 1, "Item1 - Line 2", 2) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() I have make an script like this: $List = FileOpen(@WorkingDir & "\test.txt", 2) $Number_items = _GUICtrlListView_GetItemCount($hListView) For $i = 0 To $Number_items - 1 Step +1 $read = _GUICtrlListView_GetItemTextArray($hListView, $i) _FileWriteFromArray($List, $read, 1) Next FileClose($List) On the txt the layout is: 1 Item1 Item2 2 Item1 - Line 2 Item1 - Line 2 But i want a layout like: 1 - Item1 - Item2 2 - Item1 - Line 2 - Item1 - Line 2 Some advice? Thanks
spudw2k Posted July 30, 2012 Posted July 30, 2012 $List = FileOpen(@WorkingDir & "test.txt", 2) $Number_items = _GUICtrlListView_GetItemCount($hListView) For $i = 0 To $Number_items - 1 Step +1 $read = StringReplace(_GUICtrlListView_GetItemTextString($hListView, $i),"|", " - ") FileWriteLine($List, $read) Next FileClose($List) Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
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