When a file is hidden, the file icon is displayed in the Windows Explorer with a Ghost like effect.
How do you ghost an icon?
I'm not using the ListView control, so I can't simply set the Ghosted property to True.
Thanks in advance.
Printable View
When a file is hidden, the file icon is displayed in the Windows Explorer with a Ghost like effect.
How do you ghost an icon?
I'm not using the ListView control, so I can't simply set the Ghosted property to True.
Thanks in advance.
I think explorer does that manually by brightening the color.
I'll give you the code for this tomorrow, what happens is that there is a hidden listview, and a LVM_SETITEMSTATE message gets sent, same as a treeview....I'm 80% thru the code, you'll have it tomorrow, as for the find dialog hack with the findwindow e.t.c it WORKED A TREAT, I was pretty chuffed too, here it is - have fun (I know it's not the best way to do it, but it works)
Here's a better version with a wait for the dialog to load, I tried waiting less time, but it fails...
Here's the code for Windows 2000 I was playing with.
I just can't get it to select the Local Harddrives item in the Look in ComboBox.
i understand now - i'll make it work tonight when i get home to my w2k advanced server machine.....
Here's the code for Windows 2000 which sets the look in combo to Local Harddrives. It works.
you can do it via DOS. i don't know if that's what those examples show but you run this:
Shell("C:\windows\command\attrib.exe +h C:\filename.dat")
that will make it 'ghosted', if you replace it with a -h it unghosts it.
You could use simple VBScript to do it for you.
You just change the Attributes property of the File Object.
Here is an example of a helpful sub that will change the attributes of a file for you:
Private Sub ChangeFileAttributes(Path As String, ReadOnly _
As Boolean, Hidden As Boolean, Archive As Boolean)
Dim FSO As Object
Dim objFile As Object
Dim AttrVal As Integer
Const intReadOnly = 1
Const intHidden = 2
Const intArchive = 32
'Calculate Attribute Number
If ReadOnly = True Then AttrVal = intReadOnly
If Hidden = True Then AttrVal = AttrVal + intHidden
If Archive = True Then AttrVal = AttrVal + intArchive
'Set Attributes
On Error GoTo FileError
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objFile = FSO.GetFile(Path)
objFile.Attributes = AttrVal
Exit Sub
FileError:
'If error occured show msgbox
MsgBox "An error occured, file may not exists."
End Sub