home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Begin VB.Form frmQueryDos Caption = "QueryDos" ClientHeight = 3525 ClientLeft = 1095 ClientTop = 1515 ClientWidth = 4185 LinkTopic = "Form1" PaletteMode = 1 'UseZOrder ScaleHeight = 3525 ScaleWidth = 4185 Begin VB.ListBox lstMappings Height = 1005 Left = 180 TabIndex = 2 Top = 2400 Width = 3795 End Begin VB.ListBox List1 Height = 1785 Left = 180 TabIndex = 0 Top = 300 Width = 3795 End Begin VB.Label lblMap Height = 195 Left = 180 TabIndex = 3 Top = 2160 Width = 3795 End Begin VB.Label Label1 Caption = "Dos Mappings" Height = 195 Left = 180 TabIndex = 1 Top = 60 Width = 2955 End Attribute VB_Name = "frmQueryDos" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit ' Copyright 1997 by Desaware Inc. All Rights Reserved Private Declare Function QueryDosDevice Lib "kernel32" Alias "QueryDosDeviceA" (ByVal lpDeviceName As String, ByVal lpTargetPath As String, ByVal ucchMax As Long) As Long Private Sub Form_Load() Dim s$ Dim r& Dim n& s$ = String$(1024, 0) r& = QueryDosDevice(vbNullString, s, 1024) Do n = InStr(s$, Chr$(0)) If n > 1 Then List1.AddItem Left$(s$, n - 1) s$ = Mid$(s$, n + 1) End If Loop Until n <= 1 End Sub Private Sub List1_Click() Dim s$, r&, n& lblMap.Caption = "Mappings for " & List1.Text lstMappings.Clear s$ = String$(1024, 0) r& = QueryDosDevice(List1.Text, s, 1024) Do n = InStr(s$, Chr$(0)) If n > 1 Then lstMappings.AddItem Left$(s$, n - 1) s$ = Mid$(s$, n + 1) End If Loop Until n <= 1 End Sub