any help would be great
Code: Select all
;;;adopted from https://www.autohotkey.com/boards/viewtopic.php?t=14205
#NoEnv
#SingleInstance force
File2 := "
(Join`r`n
a
b
c
d
)"
File := "
(Join`r`n
abc
apple
bbc
boat
bowl
cat
cotten
coat
dig
dog
)"
SetBatchLines, -1
Gui, Add, ListView, r20 w120 gMyListView, letters
Loop, Parse, File2, `n, `r
{
CurrentRow := LV_Add("", A_LoopField)
}
LV_ModifyCol() ; Auto-size each column to fit its contents.
MyListView:
if (A_GuiEvent = "DoubleClick")
{
LV_GetText(RowText, A_EventInfo) ; Get the text from the row's first field.
}
LVArray := {}
Gui, Add, Text, ,Search:
Gui, Add, Edit, w120 vSearchTerm gSearch
Gui, Add, ListView, grid r20 w120 vLV gLVGO +altsubmit, FileName
Loop, Parse, File, `n, `r
{
LV_Add("", A_Loopfield) ;,a_loopfilefullpath)
LVArray.Push({1:A_LoopField}) ;,2:a_loopfilefullpath})
}
TotalItems := LVArray.Length()
LV_ModifyCol()
Gui, Add, StatusBar, , % " " . TotalItems . " of " . TotalItems . " Items"
Gui, Show,x1750 y0 , Listview
Return
GuiClose1:
ExitApp
Search:
GuiControlGet, SearchTerm
GuiControl, -Redraw, LV
LV_Delete()
For Each, FileName In LVArray
{
If (SearchTerm != "")
{
If (InStr(FileName.1, SearchTerm) = 1) ; for matching at the start
; If InStr(FileName, SearchTerm) ; for overall matching
LV_Add("", FileName.1, FileName.2)
}
Else
LV_Add("", FileName.1,Filename.2)
}
Items := LV_GetCount()
SB_SetText(" " . Items . " of " . TotalItems . " Items")
GuiControl, +Redraw, LV
Return
LVGo:
Gui,1:default
rcon:=a_guicontrol
Gui,1:ListView,%rcon%
RN:=LV_GetNext("C")
RF:=LV_GetNext("F")
GC:=LV_GetCount()
if (rn=0)
return
;-----------------
if A_GuiEvent = DoubleClick
{
LV_GetText(C1,a_eventinfo,1)
msgbox, % c1
}