Hi all,
How can I get system and hidden files to display in
a listview control?
I'm using the dir() function with getattr() and am also doing the bitwise comparison but still can't get the
system or hidden folders to display.
BTW, my VB documentation says that I can use the sytem and hidden properties (set to true) with a listview control but those darn things are nowhere to be found in the propety list. They are only listed in the filelistbox control's property list.
Sample code below. Any and all help greatly appreciated. Thanks. *****T Y H A N D
strGetFolder = Dir(Path, vbDirectory)
Do While strGetFolder <> ""
If strGetFolder <> "." And strGetFolder <> ".." Then
If (GetAttr(Path & strGetFolder) And vbDirectory) = vbDirectory Then
Debug.Print strGetFolder
.lvwFolders.SmallIcons = .ImageList1
.lvwFolders.ListItems.Add 1, , strGetFolder, , "ClosedFolder"
ElseIf (GetAttr(Path & strGetFolder) And vbDirectory + vbSystem) = vbDirectory + vbSystem Then
Debug.Print strGetFolder
.lvwFolders.SmallIcons = .ImageList1
.lvwFolders.ListItems.Add 1, , strGetFolder, , "SystemFolder"
ElseIf (GetAttr(Path & strGetFolder) And vbDirectory + vbHidden) = vbDirectory + vbHidden Then
Debug.Print strGetFolder
.lvwFolders.SmallIcons = .ImageList1
.lvwFolders.ListItems.Add 1, , strGetFolder, , "HiddenFolder"
End If
End If
strGetFolder = Dir
Loop
How can I get system and hidden files to display in
a listview control?
I'm using the dir() function with getattr() and am also doing the bitwise comparison but still can't get the
system or hidden folders to display.
BTW, my VB documentation says that I can use the sytem and hidden properties (set to true) with a listview control but those darn things are nowhere to be found in the propety list. They are only listed in the filelistbox control's property list.
Sample code below. Any and all help greatly appreciated. Thanks. *****T Y H A N D
strGetFolder = Dir(Path, vbDirectory)
Do While strGetFolder <> ""
If strGetFolder <> "." And strGetFolder <> ".." Then
If (GetAttr(Path & strGetFolder) And vbDirectory) = vbDirectory Then
Debug.Print strGetFolder
.lvwFolders.SmallIcons = .ImageList1
.lvwFolders.ListItems.Add 1, , strGetFolder, , "ClosedFolder"
ElseIf (GetAttr(Path & strGetFolder) And vbDirectory + vbSystem) = vbDirectory + vbSystem Then
Debug.Print strGetFolder
.lvwFolders.SmallIcons = .ImageList1
.lvwFolders.ListItems.Add 1, , strGetFolder, , "SystemFolder"
ElseIf (GetAttr(Path & strGetFolder) And vbDirectory + vbHidden) = vbDirectory + vbHidden Then
Debug.Print strGetFolder
.lvwFolders.SmallIcons = .ImageList1
.lvwFolders.ListItems.Add 1, , strGetFolder, , "HiddenFolder"
End If
End If
strGetFolder = Dir
Loop