Лабораторная работа: Audio recorder on visual basic
sShortPathName = Space (255)
iLen = Len (sShortPathName)
'Call the function
lRetVal = GetShortPathName (sLongFileName, sShortPathName, iLen)
If lRetVal = 0 Then 'The file does not exist, first create it!
Open sLongFileName For Random As #1
Close #1
lRetVal = GetShortPathName (sLongFileName, sShortPathName, iLen)
'Now another try!
Kill (sLongFileName)
'Delete file now!
End If
'Strip away unwanted characters.
GetShortName = Left (sShortPathName, lRetVal)
End Function
Private Function Has_Space (sName As String) As Boolean
Dim b As Boolean
Dim i As Long
b = False 'not yet any spaces found
i = InStr (sName, " ")
If i <> 0 Then b = True
Has_Space = b
End Function
Public Sub WaveReset ()
Dim rtn As String
Dim i As Long
rtn = Space$ (260)
'Close any MCI operations from previous VB programs
i = mciSendString ("close all", rtn, Len (rtn), 0)