Okay, so i worked a little bit on a TreeView and i really like it so far. It does what i need.
So far i got this:
Code: Select all
Gui, SetupMenu: Default
Gui, SetupMenu: Add, TreeView, x50 %Distance1% w480 h270 cff9e03 gFileSelect +0x1000 -HScroll
AddSubFoldersToTree("Z:\TEST\FOLDER1")
AddSubFoldersToTree(Folder, ParentItemID = 0)
{
Loop, Files, %Folder%\*.*, D F
if InStr(FileExist(A_LoopFileFullPath), "D")
AddSubFoldersToTree(A_LoopFileFullPath, TV_Add(A_LoopFileName, ParentItemID, "Icon1"))
else
AddSubFoldersToTree(A_LoopFileFullPath, TV_Add(A_LoopFileName, ParentItemID, "Icon2"))
}
FileSelect:
if (A_GuiEvent = "DoubleClick")
{
TV_GetText(RowText, A_EventInfo)
ToolTip You double-clicked "%RowText%"
if (RowText = "*.exe")||RowText = "*.bat")
{
ToolTip You double-clicked a Program! ; This doesn´t work!
}
}
Return
- As you can see, i want that the script notice if i click on a "exe" or a "bat". When i click on one it should give me a different Tooltip. But it´snot
working so far.
- Right now the Script gives me a Tooltip for every item i click in this List, but i would like to disable having a Tooltip when clicking on a Folder only.
- And lastly i would like to know how i sort this File & Folder Hierarchy inside the TreeView like it is in Windows Explorer. So first the Folders and
then the Files in alphabetical order. I read through the help, but now i´m more confused.
Thanks for any help.