title image


Smiley Re: Wie kann ich in einem TreeView meine HD's anzeigen lassen?
'Zum Test: 1 Treeview, Name TreeView1' 1 CommandButton, Name Command1Option ExplicitPrivate Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As LongPrivate Declare Function GetLogicalDrives Lib "kernel32" () As LongPrivate Sub Command1_Click() Dim l As Long, i As Integer, sDrives As String l = GetLogicalDrives For i = 0 To 25 If (l And 2 ^ i) 0 Then sDrives = sDrives & Chr(65 + i) Next i TreeView1.Nodes.Add , tvwFirst, "xx", "COMPUTER" For i = 1 To Len(sDrives) Select Case GetDriveType(Mid(sDrives, i, 1) & ":") Case 2: TreeView1.Nodes.Add "xx", tvwChild, , Mid(sDrives, i, 1) & ": " & "Diskette" Case 3: TreeView1.Nodes.Add "xx", tvwChild, , Mid(sDrives, i, 1) & ": " & "Festplatte" Case 5: TreeView1.Nodes.Add "xx", tvwChild, , Mid(sDrives, i, 1) & ": " & "CD-Rom" End Select Next iEnd Sub

geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: