Return to Autorun.inf Maker |
Q: Is the source code for Browser Call available? A: In a word, 'No.' But, only because I believe you would not wish to waste your time creating a generic product like Browser Call for your own use as a CD autoplay application. It would be better to create a specific application for each autorun situation. This would allow you to create an application that launches the non-executable files you wish to start either from the autorun.inf file or when the user clicks on it from a file listing. Browser Call does not have the latter capability. To give you a strong pointer in the correct direction, if the only function you would need your application to provide is similar to that found in Browser Call, you would only need to do the following: Note: This assumes you are using a C/C++ compiler. But, creating this type of application in another language would use calls to the same api function. It is up to you to modify these examples from C/C++ to your language of choice. 1 Create an application free of the forms and other automatic features of your compiler suite. How to go about this varies according to your compiler suite. In general, the easiest way to get a reduced application project for this type of coding is to create a console application. Otherwise, you will need to remove everything (forms, .h, .c, .cpp, etc.) from your application's project except the projectname.cpp file. 2 In the projectname.cpp file delete all functions (including WinMain() or main() ). Delete all includes that have nothing to do with windows (if using a console application base) or that are not required for your compiler to function properly. Leaving or inserting windows.h is highly recommended. What you will need for your compiler to function properly varies by compiler. Please check your compiler's documentation. 3 In the now clean projectname.cpp file, recreate WinMain() as follows: 4 Within WinMain(), and before the return value, make use of ShellExecute. (Note: First, you will need to #include <shellapi.h>) before any of these examples will compile. If you want to open an application without parameters, use: If you want to open an application with parameters, use: If you want to open a directory for exploration, use: 5 Before compiling, make sure that your project is set to use static linking. Now, add an icon of your choice and compile. 6 Full examples: Launches index.html in the user's default HTML viewer: 7 To make the application more robust, you may wish to add error checking to the ShellExecute call. Visit ShellExecute (MSDN Library) for the official Microsoft technical information on this command. 8 Since the CD drive letter may vary on users' systems, you may wish to use GetCurrentDirectory to create full paths to files on your cd for the appName, params, and folderPath variables. Visit GetCurrentDirectory (MSDN Library) for the official Microsoft technical information on this command. In Conclusion:
Best of luck with your CD projects;
| |