Click here to Skip to main content
13,007,600 members (74,573 online)
Click here to Skip to main content
Add your own
alternative version


22 bookmarked
Posted 18 Mar 2008

Free Autoplay Menu for your CD/DVD Distribution

, 18 Mar 2008
Rate this:
Please Sign up or sign in to vote.
How to create an autoplay menu that runs automatically when the user inserts the CD/DVD


After you finish building your application, you need to distribute it (on a CD …not floppy disks!!!) then you will need an autoplay menu that runs automatically when the CD is inserted.

The autoplay menu should have the following commands

  1. Install (run setup.exe)
  2. Browse (explore the CD)
  3. Read Me (open the readme file)
  4. Visit our web page (open the company web page)
  5. Exit (closes the autoplay menu)


You could use a third party software which may cost you $400. But why not build your own?

The good news is that this article will show you how to build it easily, just like building an HTML page!!!

C++ or C#/VB.NET or HTML

We cannot use .NET because it may not be installed on the target machine ... then you'll lose before you start!!!

I hear somebody saying C++…… OK that is right, because it runs using only shared DLLs which can be included on the CD.

But how do you customize the autoplay application if you do not know (or like) C++?

Even if you like C++, we still need an easy way to customize the autoplay menu.

I hear somebody saying HTML… yeah… HTML (with animated GIF and JavaScripts……).

To summarize, the sample project included in this article is a template that utilizes C++ for the running code and HTML for the interface.

Using the Code

If You do not like C++

  1. Copy the sample into your solution folder and add it to your solution as an existing project.
  2. Open the file Autoplay.cpp and modify the following lines of code according to your needs

    //TODO: set those properties according to you needs
    m_bShowTitleBar = false;//no title bar
    m_bShowMenuBar = false;//no menu bar
    m_bLoadFromResources = false;//load from a file in the Data folder
    m_iWidth = 600;//the size
    m_iHeight = 450;
    m_strReadMeFileName = "ReadMe.htm";//the readme file
    m_strWebPage = "";//the company web page
  3. Build the HTML page in the data folder the way you like, taking into consideration that:

    • A hyper link with the link to app:install will run setup.exe
    • A hyper link with the link to app:browse will explore the CD
    • A hyper link with the link to app:readme will open the readme file
    • A hyper link with the link to app:webpage will open the company web page
    • A hyper link with the link to app:exit will close the autoplay menu
  4. Build the solution
  5. When distributing, you distribute the autoplay.exe file and the data folder containing the HTML work and the autoplay.ini and the autoplay icon and do not forget the shared MFC DLLs </strong />

If You Like C++

You will know how to use it — you will not need my explanation. But I want to point your attention to the fact that you can put (embed) the HTML files into the resources so that they become one part with the executable ... this is the way I like it.

Open Autoplay.rc in the text editor and add the resources for the files you used in the HTML page.

For example:

BK.GIF            HTML             "res\\bk.gif"

And do not forget to add those files in the res folder.

How it Works

It is an SDI with CHtmlView ... with some other easy modifications.

I would like to thank Paul Delaci from MSDN Magazine.

Points of Interest

In the source code you will find small tips like how to remove the title bar and the menu bar for MFC frame windows.

Also, you will find how to prevent IE shortcut keys like F5 and Ctrl+O.


March 2008 first release


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Hany Badrous
United States United States
No Biography provided

You may also be interested in...


Comments and Discussions

GeneralWhy C++ / CHtmlView vs Simple C++ launching an hta Pin
kschlueter220-May-08 10:11
memberkschlueter220-May-08 10:11 
GeneralRe: Why C++ / CHtmlView vs Simple C++ launching an hta Pin
Hany Badrous20-May-08 10:57
memberHany Badrous20-May-08 10:57 
GeneralRe: Why C++ / CHtmlView vs Simple C++ launching an hta Pin
kschlueter219-Jun-08 7:29
memberkschlueter219-Jun-08 7:29 
GeneralRe: Why C++ / CHtmlView vs Simple C++ launching an hta Pin
Hany Badrous21-Jun-08 17:25
memberHany Badrous21-Jun-08 17:25 
GeneralGreat! Pin
TheCardinal18-Mar-08 14:29
memberTheCardinal18-Mar-08 14:29 
GeneralRe: Great! Pin
Hany Badrous18-Mar-08 17:37
memberHany Badrous18-Mar-08 17:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170628.1 | Last Updated 18 Mar 2008
Article Copyright 2008 by Hany Badrous
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid