Visual Basic Explorer
Visual Basic Explorer
 Navigation
 Home


 Coding
 Source Code

 FAQ Center

 VB Tips

 Downloads

 ToolBox

 Tutorials

 VB Games

 VB News

 VB Award

 VB Forums



 Affiliates
 Planet Source Code

 Rent a Coder

 DirectX4VB


 Misc
 Search

 Feedback

 Advertise

 About


Need to hire
a VB coder?

Please support our sponsor:

 Home 
 Site Map 
 Forums 
 News 
 Feedback 

 

'-------------------------------------
'Author: Jason Buck
'Email: jbuck@how2tv.com
'Added: 12-July-2000
'-------------------------------------
'Program: LAUNCH.ZIP
'-------------------------------------
'Description: I have created an autorun.inf
'that launches my vb program which in turn
'launches an HTML file when my CD is run.
'
'The thing is that it looks like the HTML
'file was autorun instead of the VB.exe.
'
'--------------------------------------
'Note: You must first compile the included
'projects to try this sample. Save them as
'LaunchDefault.exe or LaunchIndex.exe.
'---------------------------------------

 
Place the AUTORUN.INF the LaunchDefault.exe or LaunchIndex.exe
the Default.htm or Index.htm (depending on which exe is used)
in the root of the CD.

 
This will cause your initial HTM page to autoplay, like launching
a CD based program.

 
The Launch______.exe will run, open your HTM file and then
Launch_____.exe will then close itself. The end user never even
notices the program running.

 
This program is provide "as is" with no technical support of any
kind.

 
Program was written using VB 6
The source is as follows:

 
'--------------FORM1-----------------

 
Option Explicit
Private Sub Form_Load()
Navigate Me, "index.htm"

 

 
Dim app_path As String

 
app_path = App.Path
If Right$(app_path, 1) <> "\" Then _
app_path = app_path & "\"

 

 
End
End Sub

 
'-------------END FORM1--------------

 
'-------------MODULE1----------------
Option Explicit

 
Public Const SW_SHOW = 1

 
'----------------Put this next block all on one line--------------
Public 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
'----------------End one line

 
' Invoke the application associated with a
' document type.

 
Public Sub Navigate(frm As Form, ByVal document_name As String)
ShellExecute frm.hwnd, "open", document_name, "", "", SW_SHOW
End Sub

 
'---------------End Module1----------------------

 

 
'-------------------------------------
'Burt Abreu
'http://www.VBExplorer.com
'-------------------------------------

 


Downloads

In IE right-click and select 'Save Target As...' or in Netscape right-click and select 'Save Link As...'

 

View Plain Text View Plain Text
Download Demo Project Download Demo Project
View Code Online Not Available





Home | About | What's New | Source Code | FAQ | Tips & Tricks | Downloads | ToolBox | Tutorials | Game Programming | VB Award | Search | VB Forums | Feedback | VBNews | Copyright & Disclaimer | Advertise | Privacy Policy |

Quick searches: Site Search | Advanced Site Search 

Copyright 2002 by Exhedra Solutions, Inc.
By using this site you agree to its terms and conditions
VB Explorer and VBExplorer.com are trademarks of Exhedra Solutions, Inc.