Code: Select all
if (sss = fn) or (sss="")
{
SendMessage, LB_SETCARETINDEX, A_Index, 1, TMyListBox%panel%, ahk_class TTOTAL_CMD
break
}
Code: Select all
if (sss = fn)
Moderators: Hacker, petermad, Stefan2, white
Code: Select all
if (sss = fn) or (sss="")
{
SendMessage, LB_SETCARETINDEX, A_Index, 1, TMyListBox%panel%, ahk_class TTOTAL_CMD
break
}
Code: Select all
if (sss = fn)
Code: Select all
if (sss = fn) or (sss="")
{
if sss =
break
SendMessage, LB_SETCARETINDEX, A_Index, 1, TMyListBox%panel%, ahk_class TTOTAL_CMD
break
}
Code: Select all
ControlGet, List
Just use the <GuiList.au3> UDF for GuiList Management. List of functions:robinsiebler wrote:That rocks! I wish AutoIT and AHK would merge so I could do stuff like that in AutoIT.
Code: Select all
;*** SetTCFilename
AutoItSetOption("WinTitleMatchMode", 4)
#Include <GuiList.au3>
;*** $strPanelSearched: 2=Left panel, 1=Right panel
;*** $booSelectFilename: TRUE=(Un)Select filename, FALSE=Just set focus on filename
;*** $intSelectFilename: 0=Unselect; 1=Select; -1=Toggle
_SetTCFilename(InputBox("SetTCFilename", "Filename", "Windows", "", Default, 100), "2", True, 1)
Exit
Func _SetTCFilename($strFilenameSearchedFor, $strPanelSearched="2", $booSelectFilename=False, $intSelectFilename=1)
$hndListBox = ControlGetHandle("classname=TTOTAL_CMD", "", "TMyListBox" & $strPanelSearched)
For $intListBoxIndex = 0 To _GUICtrlListCount($hndListBox)
If StringInStr(_GUICtrlListGetText($hndListBox, $intListBoxIndex), $strFilenameSearchedFor) = 1 Then
_GUICtrlListSetCaretIndex($hndListBox, $intListBoxIndex, False)
If $booSelectFilename Then _GUICtrlListSetSel($hndListBox, $intSelectFilename, $intListBoxIndex)
ExitLoop
EndIf
Next
EndFunc
Code: Select all
$intListBoxIndex = _GUICtrlListFindString($hndListBox, $strFilenameSearchedFor)
Code: Select all
$intListBoxIndex = _GUICtrlListSelectString($hndListBox, $strFilenameSearchedFor)