Example:
Adding volume control

Actions used:

Control Structure - ELSE

Control Structure - END IF

Control Structure - IF

File - Execute

In this example, we'll use the Windows sndvol32.exe program to let the user adjust their system volume by clicking on a button in our AutoPlay application. Since this file is located in two different places (depending on the operating system), we'll determine which operating system the user is running, and adjust the path accordingly.

Here's what the action list looks like:

First, we use a "Control Structure - IF" action to determine what operating system the user is running. We use the OR operator with the built-in variables %IsWin95%, %IsWin98% and %IsWinME% to form a conditional expression that will be true if the user is running Windows 95, 98 or ME.

If our condition is true, we use a "File - Execute" action to call sndvol32.exe in the folder where Windows is installed, which is represented by the built-in variable %WinDir%. We pass the "/tray" option to sndvol32.exe as a command line argument so it will use the same small pop-up volume control that appears when you click on the speaker icon in the tray bar.

Next, we use a "Control Structure - ELSE" action to split our IF block into two parts.

The next part of the IF block only happens if our conditional expression (%IsWin95% OR %IsWin98% OR %IsWinME%) is false. This means the user is running some other operating system, such as Windows 2000 or XP. So, we use another "File - Execute" action to call sndvol32.exe in the place where it is located on the Windows NT-based operating systems.

Finally, we use a "Control Structure - END IF" action to end our IF block.

Here's a link to the finished example, as an AutoPlay Media Studio 4.0 page that you can import into your own project: