Results 1 to 3 of 3

Thread: file list box help

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2004
    Posts
    1

    file list box help

    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

  2. #2
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    Code:
    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
    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 Scotty
    Last edited by Acidic; Feb 12th, 2004 at 04:56 PM.
    Have I helped you? Please Rate my posts.

  3. #3
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    Something like this?

    VB Code:
    1. Option Explicit
    2.  
    3. 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
    4.  
    5. Const SW_SHOWNORMAL = 1
    6.  
    7. Private Sub Form_Load()
    8.     Dim S As String
    9.     S = File1.Path
    10.     ShellExecute Me.hwnd, "open", S, vbNullString, "C:\", SW_SHOWNORMAL
    11. End Sub


    Has someone helped you? Then you can Rate their helpful post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width