Introduction

Language Structure

IB Statements

File System

Comet 32 Runtime

Index

(ShellExecute)

Mnemonic: (ShellExecute=Action$, File$, Args$, WorkDir$,WinMode)
Discussion: This mnemonic launch a Windows program or document. It is used with the system driver (X00) or TERM$.

The parameters are:

Action$ = A verb associated with the file type. Typically "open" or "play". To specify the default action, use "". You can see the verbs for a given file type from the File Types dialog available via the "View/Folder Options" menu item (in Windows Explorer).

Prog$ = The name of a program (e.g., notepad.exe) or a document (e.g., myfile.txt)

Args$ = Additional command line arguments

WorkDir$ = The current directory to use when executing the Prog$

WinMode =

0Hides the window and activates another window.
1Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
2Activates the window and displays it as a minimized window.
3Activates the window and displays it as a maximized window.
4Displays a window in its most recent size and position. The active window remains active.
5Activates the window and displays it in its current size and position.
6Minimizes the specified window and activates the next top-level window in the Z order.
7Displays the window as a minimized window. The active window remains active.
8Displays the window in its current state. The active window remains active.
9Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when restoring a minimized window.
10Sets the show state based on the SW_ flag specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application.

Also see (ShellExecuteWait).

History: This mnemonic was added in REL 00.06. Support for TERM$ was added in REL 02.04.
Example 1: The following code launches the NOTEPAD program.
PRINT (0) (ShellExecute="open","notepad.exe","","",1)
where:
  • Parameter 1 (open) is the action associated with an EXE file
  • Parameter 2 (notepad.exe) is the program name
  • Parameters 3 and 4 are not needed in this case (thus the "")
  • Parameter 5 (1) activates and displays a window
Example 2: The following code launches the NOTEPAD program. The system driver (X00) is opened on Logical Unit Number 20.
OPEN (20) "X00"
PRINT (20) (ShellExecute="open","notepad.exe","","",1)
CLOSE (20)
where:
  • Parameter 1 (open) is the action associated with an EXE file
  • Parameter 2 (notepad.exe) is the program name
  • Parameters 3 and 4 are not needed in this case (thus the "")
  • Parameter 5 (1) activates and displays a window