AP Sublaunch

4D - Documentation   Français   English   German   4D_Pack, Command Theme List   4D_Pack, Command Alphabetical List   Back   Previous   Next

version 6.8.2 (Modified)


AP Sublaunch (filename; mode) Longint

ParameterTypeDescription
filenameStringName of the application or document to launch
modeNumberStatus of windows at time of launch (Windows)
Synchronous mode (Macintosh)
Function resultLongint0, if the command execution succeeded;
otherwise a system error code

Description

AP Sublaunch enables you to launch an application or to open a document from within 4D.

On Windows

Applying this command to an executable file is equivalent to running that file using the Open command from the File menu of the window. Therefore, you can pass switches as well as names of documents to be opened by the executable file.

The mode parameter sets the appearance mode of the window in which the application will be launched:

- if mode is set to 0, the application window is normally displayed.

- if mode is set to 1, the application window is in full screen.

- if mode is set to 2, the application window is reduced and appears in the task bar (Windows 95/98 and NT 4).

On Macintosh

You can pass a filename or an application name in filename. Applying this command to an application or a document is equivalent to double-clicking the icon of the application or the document in the Finder.

The mode parameter set to 0 specifies an asynchronous launch. mode set to 1 specifies a synchronous launch.

When the application is launched with or without documents, you can drive it using DDE Tools, OLE Tools (Windows) or Apple Events (Macintosh).

If the operation is successfully completed, the function returns 0; otherwise it returns a negative error code.

Warning: The behavior of this command depends on many parameters; its result is not guaranteed for all applications.

Examples

1. Windows

   $errCode:=AP Sublaunch("C:\WINDOWS\CALC.EXE";1) 
      ` Will start the Calculator
   $errCode:=AP Sublaunch("C:\WINDOWS\NOTEPAD.EXE D:\DOCS\README.TXT";1)
      ` Will start the Windows Note Pad, which will open the document README.TXT

2. Macintosh

   $errCode:=AP Sublaunch("MyDisk:MyFolder:MyApp";0)  ` Will start MyApp
   $errCode:=AP Sublaunch("MyDisk:MyFolder:MyDoc";0)  
      ` Will start the application to which MyDoc belongs, then open this later

See Also

AP ShellExecute.


4D - Documentation   Français   English   German   4D_Pack, Command Theme List   4D_Pack, Command Alphabetical List   Back   Previous   Next