Jump to content

Recommended Posts

Posted

hello here is my working part of script with 2 example moving items up or down and delete selected but it already working perfect

what way is better button up or down

i also find out that _GUICtrlListView_GetSelectedIndices($LV) return number of selected item also if u select 1 3 4 5 items it return 1|3|4|5

but i dont know how to use it
and _GUICtrlListView_GetItemTextString($LV,$no) return all text from whole index but i cannot read from all selected
anyway what i select it return text from item first from top

also i noticed almost same commands like GUICtrlCreateListView and _GUICtrlListView_Create or 
_GUICtrlListView_AddItem and GUICtrlCreateListViewItem. they working beetwen each other ?? or witch one is better or where are differences ??

 

my main problem is get/store/read text from EACH selected item and way to insert it

#include <GUIConstants.au3>
#include <MsgBoxConstants.au3>
#include <GUIListView.au3>

$width = 670
$GUI = GUICreate("gui", 670, 500,@DesktopWidth - ($width + 1), 0)
GUISetState()
$ListView = GUICtrlCreateListView("Name|No Name|Surrname|Next Name|U cant do it name", 10, 200, 450, 250,$LVS_SHOWSELALWAYS)
$LV = GUICtrlGetHandle($ListView)

For $i = 0 To 20 + 1
        GUICtrlCreateListViewItem("name" & $i & "|how" & $i & "|you" & $i & "|doing" & $i & "|IT ????", $listview)
Next

$button_up = GUICtrlCreateButton("UP", 480, 130, 50, 25)
$button_down = GUICtrlCreateButton("DOWN", 480, 160, 50, 25)
$button_del_selected = GUICtrlCreateButton("DEL", 480, 190, 50, 25)
$button_fix1 = GUICtrlCreateButton("fix1", 480, 300, 50, 25)
$button_fix2 = GUICtrlCreateButton("fix2", 480, 350, 50, 25)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $button_up
            if _GUICtrlListView_GetSelectedIndices($LV) = 0 then
                _GUICtrlListView_ClickItem($listview,0)
                MsgBox(0,"Error", "Cant Move This Item Up")
            Else
                Local $txt_selected[8]
                Local $txt_at_bottom[8]
                $aa_count_column = _GUICtrlListView_GetColumnCount($LV)
                $no = _GUICtrlListView_GetSelectedIndices($LV)
                For $z = 0 To $aa_count_column Step + 1
                    $txt_selected[$z] = _GUICtrlListView_GetItemText($LV,$no,$z)
                    $txt_at_bottom[$z] = _GUICtrlListView_GetItemText($LV,$no-1,$z)
                    _GUICtrlListView_SetItemText($LV, $no - 1, $txt_selected[$z],$z)
                    _GUICtrlListView_SetItemText($LV, $no, $txt_at_bottom[$z],$z)
                Next
                _GUICtrlListView_ClickItem($listview,$no-1)
            EndIf

        Case $button_down
            $no = _GUICtrlListView_GetSelectedIndices($LV)
            $txt_selected0 = _GUICtrlListView_GetItemText($LV,$no,0)
            $txt_selected1 = _GUICtrlListView_GetItemText($LV,$no,1)
            $txt_selected2 = _GUICtrlListView_GetItemText($LV,$no,2)
            $txt_selected3 = _GUICtrlListView_GetItemText($LV,$no,3)
            $txt_selected4 = _GUICtrlListView_GetItemText($LV,$no,4)
            $txt_at_top0 = _GUICtrlListView_GetItemText($LV,$no+1,0)
            $txt_at_top1 = _GUICtrlListView_GetItemText($LV,$no+1,1)
            $txt_at_top2 = _GUICtrlListView_GetItemText($LV,$no+1,2)
            $txt_at_top3 = _GUICtrlListView_GetItemText($LV,$no+1,3)
            $txt_at_top4 = _GUICtrlListView_GetItemText($LV,$no+1,4)
            _GUICtrlListView_SetItemText($LV, $no + 1, $txt_selected0,0)
            _GUICtrlListView_SetItemText($LV, $no + 1, $txt_selected1,1)
            _GUICtrlListView_SetItemText($LV, $no + 1, $txt_selected2,2)
            _GUICtrlListView_SetItemText($LV, $no + 1, $txt_selected3,3)
            _GUICtrlListView_SetItemText($LV, $no + 1, $txt_selected4,4)
            _GUICtrlListView_SetItemText($LV, $no, $txt_at_top0,0)
            _GUICtrlListView_SetItemText($LV, $no, $txt_at_top1,1)
            _GUICtrlListView_SetItemText($LV, $no, $txt_at_top2,2)
            _GUICtrlListView_SetItemText($LV, $no, $txt_at_top3,3)
            _GUICtrlListView_SetItemText($LV, $no, $txt_at_top4,4)
            _GUICtrlListView_ClickItem($listview,$no+1)

        Case $button_del_selected  ; working perfect even multi selection
            $var = _GUICtrlListView_GetSelectedIndices($listview)
            If $var = 0 Then
                _GUICtrlListView_DeleteItemsSelected($ListView)
                _GUICtrlListView_ClickItem($listview,$var)
            Else
                _GUICtrlListView_DeleteItemsSelected($ListView)
                _GUICtrlListView_ClickItem($listview,$var-1)
            EndIf
        Case $button_fix1
            _fix1()
        Case $button_fix2
            _fix2()
    EndSwitch


WEnd
Func _fix1()
    $no = _GUICtrlListView_GetSelectedIndices($LV)
    ConsoleWrite ($no)
EndFunc

Func _fix2()
    $no = _GUICtrlListView_GetSelectedIndices($LV)
    ConsoleWrite(_GUICtrlListView_GetItemTextString($LV,$no))
EndFunc

i spend lot of hours to show u what is my problem meybe u can help me get it better

Posted (edited)

u cant even select 2 or more items so i wont use it

show me way to see all text inside 2 items SELECTEDi think i will do the rest :P (with meybe some sugesstions  :P

Edited by Verssuss
  • 4 weeks later...
Posted

hello. after I made "a lot of" modifications of my gui i still need some help how fix my problem.
is how how store few items with text into array  variables.
I point out that I have never used array variables before and it is difficult for me to understand it right
and these are my beginnings.
 

#include <FileConstants.au3>
#include <ListViewConstants.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <GUIConstants.au3>
#include <ButtonConstants.au3>
#include <GuiListView.au3>
#include <GuiListBox.au3>
#include <GuiImageList.au3>
#include <SendMessage.au3>
#include <Misc.au3>
#include <GuiEdit.au3>
#include <EditConstants.au3>
#include <WinAPI.au3>
#include <File.au3>
#include <AutoItConstants.au3>

$GUI = GUICreate("gui")
GUISetState()

$ListView = GUICtrlCreateListView("Name1|Name2|Surrealneme3|", 10, 10, 250, 350, $LVS_SHOWSELALWAYS)
_GUICtrlListView_SetExtendedListViewStyle($ListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES))
_GUICtrlListView_SetColumnWidth($ListView, 10, 0)
$LV = GUICtrlGetHandle($ListView)

For $i = 0 To 9
        GUICtrlCreateListViewItem("name" & $i & "|surname" & $i & "|surrealizm" & $i, $ListView)
Next
Global $var = _GUICtrlListView_GetSelectedIndices($LV)
$menu_file = GUICtrlCreateMenu("File")
$menu_file_save = GUICtrlCreateMenuItem("Save Settings", $menu_file)
$menu_file_load = GUICtrlCreateMenuItem("Load Settings", $menu_file)
$menu_file_exit = GUICtrlCreateMenuItem("Exit", $menu_file)
GUICtrlCreateMenuItem("", $menu_file)

$button_up = GUICtrlCreateButton("UP", 300, 10, 70, 25)
$button_down = GUICtrlCreateButton("DOWN", 300, 40, 70, 25)
$button_copy = GUICtrlCreateButton("Copy", 300, 70, 70, 25)
$button_paste = GUICtrlCreateButton("Paste", 300, 100, 70, 25)
$button_selectall = GUICtrlCreateButton("Select All", 300, 130, 70, 25)
$button_del_selected = GUICtrlCreateButton("DEL", 300, 160, 70, 25)
$button_exit = GUICtrlCreateButton("Exit", 300, 200, 70, 30)


While 1
    Switch GUIGetMsg()
        Case $button_exit,$menu_file_exit, $GUI_EVENT_CLOSE
            Exit

        Case $menu_file_save
            $index = _GUICtrlListView_GetItemCount($listview)
            $file_save = FileSaveDialog("Choose a filename.", "", "Data (*.ini)", $FD_PROMPTOVERWRITE, $FD_PATHMUSTEXIST)
            For $i = 0 To _GUICtrlListView_GetItemCount($listview) -1 step 1
                IniWrite($file_save, "procedura", $i, _
                _GUICtrlListView_GetItemText($ListView, $i, 0) & "|" & _
                _GUICtrlListView_GetItemText($ListView, $i, 1) & "|" & _
                _GUICtrlListView_GetItemText($ListView, $i, 2))
            Next
            IniWrite($file_save, "procedura", "index",$index )

        Case $menu_file_load
            $file_load = FileOpenDialog("Choose a filename.", "", "Data (*.ini)", $FD_PATHMUSTEXIST)
            $List = IniRead ( $file_load,"procedura","index","" )
                For $i = 0 To $List - 1
                    GUICtrlCreateListViewItem(IniRead ( $file_load,"procedura",$i,""),$ListView)
                Next

        Case $button_up ; how to move more then 1 selected item
            if _GUICtrlListView_GetSelectedIndices($LV) = 0 then
                _GUICtrlListView_ClickItem($listview,0,"left",False)
                MsgBox(0,"Error", "Cant Move This Item Up")
            Else
                Local $txt_selected[_GUICtrlListView_GetColumnCount($LV)+1]
                Local $txt_at_bottom[_GUICtrlListView_GetColumnCount($LV)+1]
                $count_column = _GUICtrlListView_GetColumnCount($LV)
                $var = _GUICtrlListView_GetSelectedIndices($LV)
                _GUICtrlListView_ClickItem($listview,$var-1,"left",False)
                For $i = 0 To $count_column Step + 1
                    $txt_selected[$i] = _GUICtrlListView_GetItemText($LV,$var,$i)
                    $txt_at_bottom[$i] = _GUICtrlListView_GetItemText($LV,$var-1,$i)
                    _GUICtrlListView_SetItemText($LV, $var - 1, $txt_selected[$i],$i)
                    _GUICtrlListView_SetItemText($LV, $var, $txt_at_bottom[$i],$i)
                Next
            EndIf

        Case $button_down ; how to move more then 1 selected item
            if _GUICtrlListView_GetSelectedIndices($LV) + 1 = _GUICtrlListView_GetItemCount($LV) then
                _GUICtrlListView_ClickItem($listview,0,"left",False)
                MsgBox(0,"Error", "Cant Move This Item Down")
            Else
                Local $txt_selected[_GUICtrlListView_GetColumnCount($LV)+1]
                Local $txt_at_top[_GUICtrlListView_GetColumnCount($LV)+1]
                $count_column = _GUICtrlListView_GetColumnCount($LV)
                $var = _GUICtrlListView_GetSelectedIndices($LV)
                _GUICtrlListView_ClickItem($listview,$var+1,"left",False)
                For $i = 0 To $count_column Step + 1
                    $txt_selected[$i] = _GUICtrlListView_GetItemText($LV,$var,$i)
                    $txt_at_top[$i] = _GUICtrlListView_GetItemText($LV,$var+1,$i)
                    _GUICtrlListView_SetItemText($LV, $var + 1, $txt_selected[$i],$i)
                    _GUICtrlListView_SetItemText($LV, $var, $txt_at_top[$i],$i)
                Next
            EndIf
        Case $button_selectall
            _GUICtrlListView_SetItemSelected($Listview, -1,true,True)
            _GUICtrlListView_ClickItem($listview, _GUICtrlListView_GetItemCount($LV),"left",False)

        Case $button_del_selected
            $var = _GUICtrlListView_GetSelectedIndices($listview)
            If $var = 0 Then
                _GUICtrlListView_DeleteItemsSelected($ListView)
                _GUICtrlListView_ClickItem($listview,$var,"left",False)
            Else
                _GUICtrlListView_DeleteItemsSelected($ListView)
                _GUICtrlListView_ClickItem($listview,$var-1,"left",False)
            EndIf

        Case $button_copy ; how to modify it to store more then 1 selected item
            Local $txt_selected[_GUICtrlListView_GetColumnCount($LV)+1]
            $count_column = _GUICtrlListView_GetColumnCount($LV)
            For $i = 0 To $count_column Step + 1
                $txt_selected[$i] = _GUICtrlListView_GetItemText($LV,_GUICtrlListView_GetSelectedIndices($LV),$i)
            Next

        Case $button_paste ; how to paste more then 1 item
            $var = _GUICtrlListView_GetSelectedIndices($listview)
            _GUICtrlListView_InsertItem($LV,$txt_selected[0], $var +1)
            For $i = 1 To $count_column
                _GUICtrlListView_AddSubItem($LV, $var +1, $txt_selected[$i],$i)
            Next
            _GUICtrlListView_ClickItem($listview,$var +1,"left",False)
    EndSwitch
WEnd

and again plz for all tips how make any of function "better" or where im doing strange mistakes

Posted (edited)

Hi

This is how i would do it:

add this code somewhere before the while 1 

dim $copyarray[1]               ; copyarray, has to be pre-defined
$copyarray[0]=-1

dim $clipboard[600]             ; maximum clipboard items (for copy+paste)
$clipboard[0]=-1

and replace the code for the button clicks, from your last post, with:

Case $button_copy ; store more than 1 selected item
            $copyarray = _GUICtrlListView_GetSelectedIndices($LV, 1)
            $clipboard[0] = $copyarray[0]
            For $j = 1 To $copyarray[0]
                $clipboard[$j] = _GUICtrlListView_GetItemTextString($LV, $copyarray[$j])
            Next

;~          for $j=1 to $clipboard[0]           ;Debug info
;~              MsgBox (0,$j,$clipboard[$j])
;~          Next

        Case $button_paste ; paste more than 1 item
            $var = _GUICtrlListView_GetSelectionMark($LV)
            For $j = 1 To $clipboard[0]
                $txt_selected = StringSplit($clipboard[$j], "|")
                _GUICtrlListView_InsertItem($LV, $txt_selected[1], $var + 1)
                For $i = 2 To $txt_selected[0]
                    _GUICtrlListView_AddSubItem($LV, $var + 1, $txt_selected[$i], $i - 1)
                Next
                $var = $var + 1
            Next
            _GUICtrlListView_ClickItem($ListView, $var, "left", False)
    EndSwitch

 

Edited by Dan_555

Some of my script sourcecode

Posted (edited)

hello very thanks it working how i excpeted but so far i try do it myself its looks like this 

#include <GUIConstants.au3>
#include <GuiListView.au3>

$GUI = GUICreate("gui")
GUISetState()

$ListView = GUICtrlCreateListView("Name1|Name2|Surrealneme3|", 10, 10, 250, 350, $LVS_SHOWSELALWAYS)
_GUICtrlListView_SetExtendedListViewStyle($ListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES))
_GUICtrlListView_SetColumnWidth($ListView, 10, 0)
$LV = GUICtrlGetHandle($ListView)

For $i = 0 To 9
        GUICtrlCreateListViewItem("name" & $i & "|surname" & $i & "|surrealizm" & $i, $ListView)
Next

$button_copy = GUICtrlCreateButton("Copy", 300, 70, 70, 25)
$button_paste = GUICtrlCreateButton("Paste", 300, 100, 70, 25)
$button_exit = GUICtrlCreateButton("Exit", 300, 200, 70, 30)

While 1
    Switch GUIGetMsg()
        Case $button_exit,$GUI_EVENT_CLOSE
            Exit

        Case $button_copy ; how to modify it to store more then 1 selected item
            Local $Selected[_GUICtrlListView_GetSelectedCount($LV)]
            $Size = _GUICtrlListView_GetItemCount($LV)
            $j=-1
            For $i = 0 To $Size Step + 1
                If _GUICtrlListView_GetItemSelected($LV, $i) Then
                    $j+=1
                    $Selected[$j] = _GUICtrlListView_GetItemText($LV, $i,0)
                EndIf
            Next

        Case $button_paste ; how to paste more then 1 item
            $var = _GUICtrlListView_GetSelectedIndices($listview)
            For $i=0 to UBound($Selected)-1
            _GUICtrlListView_InsertItem($LV,$Selected[$i],$var +1)
            $var += 1
            Next
    EndSwitch
WEnd

but still not working perfect. i get so far copy just items and think for subitems have to change

Local $Selected[_GUICtrlListView_GetSelectedCount($LV)]

for

Local $Selected[_GUICtrlListView_GetSelectedCount($LV)][_GUICtrlListView_GetColumnCount($LV)]

but i still cant connect it both to work together :P

even it work how i excepted in case i want lern it more i have to find way to finish another way (or someone show me)  ^_^

also thx fot this $var = _GUICtrlListView_GetSelectionMark($LV) :)

Edited by Verssuss
Posted
#include <GUIConstants.au3>
#include <GuiListView.au3>

$GUI = GUICreate("gui")
GUISetState()

$ListView = GUICtrlCreateListView("Name1|Name2|Surrealneme3|", 10, 10, 250, 350, $LVS_SHOWSELALWAYS)
_GUICtrlListView_SetExtendedListViewStyle($ListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES))
_GUICtrlListView_SetColumnWidth($ListView, 10, 0)
$LV = GUICtrlGetHandle($ListView)

For $i = 0 To 9
        GUICtrlCreateListViewItem("name" & $i & "|surname" & $i & "|surrealizm" & $i, $ListView)
Next

$button_copy = GUICtrlCreateButton("Copy", 300, 70, 70, 25)
$button_paste = GUICtrlCreateButton("Paste", 300, 100, 70, 25)
$button_exit = GUICtrlCreateButton("Exit", 300, 200, 70, 30)

While 1
    Switch GUIGetMsg()
        Case $button_exit,$GUI_EVENT_CLOSE
            Exit

        Case $button_copy ; how to modify it to store more then 1 selected item
            Local $Selected[_GUICtrlListView_GetSelectedCount($LV)]
            $Size = _GUICtrlListView_GetItemCount($LV)
            $j=-1
            For $i = 0 To $Size Step + 1
                If _GUICtrlListView_GetItemSelected($LV, $i) Then
                    $j+=1
                    $Selected[$j] = _GUICtrlListView_GetItemText($LV, $i, 0)&'|'&_GUICtrlListView_GetItemText($LV, $i, 1)&'|'&_GUICtrlListView_GetItemText($LV, $i, 2)
                EndIf
            Next

        Case $button_paste ; how to paste more then 1 item
            $var = _GUICtrlListView_GetSelectedIndices($listview)
            For $i=0 to UBound($Selected)-1
            $Split = StringSplit($Selected[$i], '|', 1)
            _GUICtrlListView_InsertItem($LV, $Split[1],$var +1)
            _GUICtrlListView_SetItemText($LV,$var +1, $Split[2], 1)
            _GUICtrlListView_SetItemText($LV,$var +1, $Split[3], 2)
            $var += 1
            Next
    EndSwitch
WEnd

This, maybe?

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Posted (edited)
54 minutes ago, careca said:

This, maybe?

its ok in this example but size of column gonna be random so i think need to use  _GUICtrlListView_GetColumnCount($LV)\

Edited by Verssuss
Posted
#include <GUIConstants.au3>
#include <GuiListView.au3>

$GUI = GUICreate("gui")
GUISetState()

$ListView = GUICtrlCreateListView("Name1|Name2|Surrealneme3|", 10, 10, 250, 350, $LVS_SHOWSELALWAYS)
_GUICtrlListView_SetExtendedListViewStyle($ListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES))
_GUICtrlListView_SetColumnWidth($ListView, 10, 0)
$LV = GUICtrlGetHandle($ListView)

For $i = 0 To 9
        GUICtrlCreateListViewItem("name" & $i & "|surname" & $i & "|surrealizm" & $i, $ListView)
Next

FileDelete('tmp.ini')

$button_copy = GUICtrlCreateButton("Copy", 300, 70, 70, 25)
$button_paste = GUICtrlCreateButton("Paste", 300, 100, 70, 25)
$button_exit = GUICtrlCreateButton("Exit", 300, 200, 70, 30)
Local $ReadAdd = ''

While 1
    Switch GUIGetMsg()
        Case $button_exit,$GUI_EVENT_CLOSE
            Exit
;=============================================================================
        Case $button_copy
            FileDelete('tmp.ini')
            $Size = _GUICtrlListView_GetItemCount($LV)
            For $r = 0 To $Size
                If _GUICtrlListView_GetItemSelected($LV, $r) Then
                    $GetArrayTxt = _GUICtrlListView_GetItemTextArray($LV, $r)
                    For $l = 1 To $GetArrayTxt[0]
                        If $l = $GetArrayTxt[0] Then
                            $ReadAdd &= $GetArrayTxt[$l]
                            Else
                        $ReadAdd &= $GetArrayTxt[$l]&'|'
                        EndIf
                    Next
                    IniWrite('tmp.ini', 'Selected', 'Line'&$r, $ReadAdd)
                    $ReadAdd = ''
                EndIf
            Next
;=============================================================================
        Case $button_paste ; how to paste more then 1 item
            $Size = _GUICtrlListView_GetItemCount($LV)
            $Section = IniReadSection('tmp.ini', 'Selected')
            If IsArray($Section) Then
            For $s=1 to $Section[0][0]
                $NI = _GUICtrlListView_AddItem($LV, '')
                $Split = StringSplit($Section[$s][1], '|', 1)
                For $p=1 to $Split[0]
                    ConsoleWrite('$Split[$p]:'&$p&' - '& $Split[$p]&@CRLF)
                    _GUICtrlListView_SetItemText($LV, $NI, $Split[$p], $p-1)
                Next
                $Size = $Size +1
            Next
            FileDelete('tmp.ini')
            EndIf
    EndSwitch
WEnd

This should be able to deal with multiple, varying amount of columns. As you can notice, it is a different approach.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Posted

this is how i want to finish it but something is wrong
 

Case $button_copy ; how to modify it to store more then 1 selected item
            Global $Selected[_GUICtrlListView_GetSelectedCount($LV)][ _GUICtrlListView_GetColumnCount($LV)]
            $k=-1
            $l=-1
            For $i = 0 To _GUICtrlListView_GetItemCount($LV) Step +1
                If _GUICtrlListView_GetItemSelected($LV, $i) Then
                    $k+=1
                    For $j=0 to _GUICtrlListView_GetColumnCount($LV) Step +1
                        $l+=1
                        $Selected[$k][$l] = _GUICtrlListView_GetItemText($LV, $i,$j)
                    Next
                EndIf
            Next

i think after this load it gonna looks like
$selected [0][0] text of index 0 item
$selected [0][1] text of index 0 subitem 1
$selected [0][2] text of index 0 subitem 1
$selected [1][0] text of index 1 item
$selected [1][0] text of index 1 item
$selected [1][1] text of index 1 subitem 1
$selected [1][2] text of index 1 subitem 2

Posted

thx so much u all guys with your help I created the first own 2d variable in autoit career  xD xD xD

I'm still afraid there are some mistakes but looking good for now

#include <GUIConstants.au3>
#include <GuiListView.au3>

$GUI = GUICreate("gui")
GUISetState()

$ListView = GUICtrlCreateListView("Name1|Name2|Surrealneme3|", 10, 10, 250, 350, $LVS_SHOWSELALWAYS)
_GUICtrlListView_SetExtendedListViewStyle($ListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES))
_GUICtrlListView_SetColumnWidth($ListView, 10, 0)
$LV = GUICtrlGetHandle($ListView)

For $i = 0 To 9
    GUICtrlCreateListViewItem("name" & $i & "|surname" & $i & "|surrealizm" & $i, $ListView)
Next

$button_copy = GUICtrlCreateButton("Copy", 300, 70, 70, 25)
$button_paste = GUICtrlCreateButton("Paste", 300, 100, 70, 25)
$button_exit = GUICtrlCreateButton("Exit", 300, 200, 70, 30)

While 1
    Switch GUIGetMsg()
        Case $button_exit, $GUI_EVENT_CLOSE
            Exit

        Case $button_copy ; how to modify it to store more then 1 selected item
            Local $Selected[_GUICtrlListView_GetSelectedCount($LV)][_GUICtrlListView_GetColumnCount($LV)]
            $k = -1
            For $i = 0 To _GUICtrlListView_GetitemCount($LV)-1
                If _GUICtrlListView_GetItemSelected($LV, $i) Then
                    $k +=1
                    For $j = 0 To _GUICtrlListView_GetColumnCount($LV) - 1
                        $Selected[$k][$j] = _GUICtrlListView_GetItemText($LV, $i, $j)
                    Next
                EndIf
            Next

        Case $button_paste
            $var = _GUICtrlListView_GetSelectionMark($LV)
            For $i = 0 To UBound($Selected)-1
                _GUICtrlListView_InsertItem($LV,$Selected[$i][0],$var+$i+1)
                For $j = 0 To _GUICtrlListView_GetColumnCount($LV) - 1
                    _GUICtrlListView_AddSubItem($LV, $var+$i+1, $Selected[$i][$j], $j)
                Next
            Next
            _GUICtrlListView_ClickItem($LV,$var + UBound($Selected))
    EndSwitch
WEnd

 

Posted

Good job.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...