Click to See Complete Forum and Search --> : Autorun


lludlow
May 18th, 2001, 11:13 PM
i have a website which i want to copy to a cd. then when cd is inserted it must pop up to to default htm, but i also want a small window to pop up first with my logo and a button, when pressed goes to the default.htm on the cd. i have made a small app with logo and button but how do i tell that button when clicked to run the default.htm on the cd? please in plain simple terms help!!!!

shree
May 19th, 2001, 02:26 AM
This code should open the html file for you. I assume that it is in the myProg folder in the CD.

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()
ShellExecute me.hwnd, "open", "myProg\default.html", vbNullString, vbNullString, vbMaximizedFocus
me.Hide
End Sub






To autorun the CD to run your program, make a file
autorun.inf
with the contents

[autorun]
open = myProg\myProg.exe

where myProg is your small app with the logo and button.