|
-
May 18th, 2000, 01:11 PM
#1
Thread Starter
Member
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.
-
May 18th, 2000, 01:33 PM
#2
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!
-
May 18th, 2000, 01:37 PM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|