Example:
Minimizing the AutoPlay application

Actions used:

File - Execute

Window - Minimize

Window - Restore

In this example, we'll minimize our AutoPlay application's window while the user reads a text file in Notepad.

Here's what the action list looks like:

First we use a "Window - Minimize" action to minimize the AutoPlay window. The "Window - Minimize" action takes an integer value that represents the "handle" of a window on the user's desktop. This value is normally referred to as "hWnd". You can use the "Window - Find" action to determine a window's hWnd value, but for this example, we'll use the built-in variable %MenuHWnd%, which already contains the hWnd value for the AutoPlay application.

Then we use a "File - Execute" action to open our text file in Notepad. We put the path to the notepad.exe program in the File to execute field—this is the program that the action will execute. Notepad can accept the full path to a text file as a command line argument, so we put the full run-time path to our readme.txt file in the Command line arguments field. We're using the built-in variable %WinDir% to represent the user's Windows folder, and the built-in variable %SrcDir% to represent the folder where the AutoPlay application is running from.

If the user's Windows folder is "C:\Windows" and the AutoPlay application is running from the root of the D: drive, this is exactly the same as writing:

C:\Windows\notepad.exe D:\readme.txt

...at a DOS prompt.

Note that we've enabled the Wait for program to finish running before continuing option so our AutoPlay application will wait for the user to close Notepad before it continues with the next action.

Finally, we use a "Window - Restore" action to restore the AutoPlay application's window once the executed file (i.e. notepad.exe) is closed.

Here's a link to the finished example, as an AutoPlay Media Studio 4.0 actions XML file that you can import into an action list:

(Note: save this file to your hard drive and use a tool like WinZip to extract the XML file)