Results 1 to 3 of 3

Thread: Open Direcory in WINDOWS 95/98

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Location
    Glasgow, MT, USA
    Posts
    44

    Unhappy

    How would I open a window in WIN95/98 like clicking on "My computer"? In my AutoStart of my CD I want to be able to click on "Explore CD" and it will open the window.

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    You can use the ShellExecute API function:
    Code:
    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
    
    Private Sub Command1_Click()
        'replace "d:\" with the path of your CD
        ShellExecute Me.hwnd, "Open", "d:\", vbNullString, _
         vbNullString, vbNormalFocus
    End Sub
    Good luck!

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    If you want to use a control then use the commondialog control, like this:
    cmndlg.InitDir="d:\"
    cmndlg.DialogTitle="Explore CD"
    cmndlg.ShowOpen

    if you want to know what file they opened then use:
    TheirFile=cmndlg.filename

    You can do this throught APIs also or make a form and use the Dirlistbox, FileListBox, DriveBox

    Or if you want them to just explore with no response from you program then:
    Shell "c:\windows\explorer.exe", vbNormalFocus

    although the directory may change according to what OS they have so you may want to get the windows folder:
    first reference the scripting
    Public fs As New Scripting.FileSystemObject

    win = fs.GetSpecialFolder(WindowsFolder)
    Shell fs.BuildPath(win, "explorer.exe"), vbNormalFocus

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