CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Autorun

  1. #1
    Join Date
    May 2001
    Posts
    1

    Autorun

    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!!!!


  2. #2
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: Autorun

    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.


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

Featured