Esiste un modo per effettuare la ricerca di un preciso file su c: alla pressione di un tasto?
Esiste un modo per effettuare la ricerca di un preciso file su c: alla pressione di un tasto?
~-~-~*** Hannibal ***~-~-~
Web-site: www.hannibalworks.net
Puoi usare un'API di Win:
codice:Private Declare Function SearchTreeForFile Lib "imagehlp" (ByVal RootPath As String, ByVal InputPathName As String, ByVal OutputPathBuffer As String) As Long Private Const MAX_PATH = 520 Dim strFile As String Private Sub Command1_Click() Dim tempStr As String, Ret As Long Dim strdummy As String tempStr = String(MAX_PATH, 0) strdummy="NOMEFILE.TXT" Ret = SearchTreeForFile("c:\", strdummy, tempStr) If Ret <> 0 Then debug.print Left$(tempStr, InStr(1, tempStr, Chr$(0)) - 1) else MsgBox "File non trovato" end if End Sub
...and I miss you...like the deserts miss the rain...
Per vonKranz
ti ringrazio per l'"API" che hai inserito e cge funziona perfettamente.
Volevo chiederti se il pc ha più di un disco, e non sappiamo quanti, come è possibile cercare anche sugli altri senza usare l'umile "IF" , si può inserire un carattere speciale nella stringa "RET = SearchTreeForFile("??:\", strdummy, tempStr).
Grazie mille.
Windows 7 Home Premium SP1 64 bit - AMD Athlon(tm) 64x2 Dual Core Processor 6000+ 3.00 GHz - 4 GB RAM - NVIDIA GeForce 8400 GS