Introduction

Language Structure

IB Statements

File System

Comet 32 Runtime

Index

(ShellExecuteWait)

Mnemonic: (ShellExecuteWait=Action$, File$, Args$, WorkDir$,WinMode)
Discussion: This mnemonic launches a Windows program and pauses the InternetBasic program. When the Windows program is done, the IB program resumes.

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 (ShellExecute).

History: This mnemonic was added in REL 02.04.
Example:
PRINT (ShellExecuteWait="open","program.exe","","",1)
wait   ! REQUIRED for the "wait" effect of the ShellExecuteWait
where:
  • Parameter 1 (open) is the action associated with an EXE file
  • Parameter 2 (program.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
Note: Either a WAIT or an INPUT is required to get the ShellExecuteWait to wait for the "completed" status before returing to your IB program. Doing an INPUT also allows you to get the result code returned.