i have a dir list box, a file list box, and a drive list box and i was wondering how i can open any file i click on in the file list box
Printable View
i have a dir list box, a file list box, and a drive list box and i was wondering how i can open any file i click on in the file list box
This will only run executables, I'm sure that there is a way to use the registry to find what application is accosiated to the file, but I cannae do it ScottyCode:Private sub command1_click()
shell file1.path & "\" & file1.filename
end sub
Private sub dir1_change()
file1.path = dir1.path
end sub
Private sub drive1_change()
dir1.path = drive1.path
End sub
Something like this?
VB Code:
Option Explicit Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Const SW_SHOWNORMAL = 1 Private Sub Form_Load() Dim S As String S = File1.Path ShellExecute Me.hwnd, "open", S, vbNullString, "C:\", SW_SHOWNORMAL End Sub