Non esistono controlli del genere in VB6
, in alternativa: o la costruisci ex novo o ti accontenti di quella di Win (che poi è valida). Se scegli quest'ultima strada usa il seguente codice:
codice:
' Inserire il riferimento a Microsoft Scripting Runtime
Private Sub Command1_Click()
'Controlla che la calcolatrice sia installata sul computer:
Dim FSO As FileSystemObject
Dim fn As String
Dim RetVal
Dim strCheck2 As String
Set FSO = New FileSystemObject
fn = "C:\Windows\system32\CALC.EXE"
With FSO
If .FileExists(fn) Then
strCheck2 = True
Else
strCheck2 = False
End If
End With
Set FSO = Nothing
If strCheck2 = True Then
RetVal = Shell("C:\WINDOWS\System32\CALC.EXE", 1)
ElseIf strCheck2 = False Then
MsgBox "Il programma Calc.exe non é installato sul computer." & Chr(13) _
& "Impossibile continuare!", vbExclamation, "Mia Applicazione"
End If
End Sub