Jump to content

WinStartApp: Difference between revisions

From EDM2
m added comment
m formatting tweaking
Line 28: Line 28:


=== Returns ===
=== Returns ===
The invoked applications handle of type [[OS2_API:DataType:HAPP|HAPP]], or [[OS2_API:DataType:NULLHANDLE|NULLHANDLE]] if an error occurred.
;[[OS2_API:DataType:HAPP|HAPP]] : The invoked applications handle of this type.
;[[OS2_API:DataType:NULLHANDLE|NULLHANDLE]] : An error occurred.
Possible returns from [[OS2 API:WinGetLastError|WinGetLastError]]:
Possible returns from [[OS2 API:WinGetLastError|WinGetLastError]]:
* [[OS2 API:PMI:error#PMERR_CANNOT_START|PMERR_CANNOT_START]]
* [[OS2 API:PMI:error#PMERR_CANNOT_START|PMERR_CANNOT_START]]

Revision as of 07:33, 4 March 2006

WinStartApp

WinStartApp(notifyHndl, progDetails, progParams, reserved, flags)

Execute a program.

Parameters

notifyHndl - HWND - input

The window notification handle or NULLHANDLE. If a window handle is passed, the system passes the WM_APPTERMINATENOTIFY message upon program exit.

progDetails - PROGDETAILS - input

The program list structure.

progParams - PSZ - input

NULL or the parameters for the program to be started. The layout is first, the program's exe name; the second, the space separated arguments.

reserved - PVOID - input

Start data. Reserved - pass NULL.

flags - ULONG - input

Zero for no flags or:

Constants

None

Returns

HAPP
The invoked applications handle of this type.
NULLHANDLE
An error occurred.

Possible returns from WinGetLastError:

Module

Define (C/C++)

INCL_WINWINDOWMGR or INCL_WIN or INCL_PM

Export name/Ordinal

Calling conversion

Cdecl32

Example Code

HWND        notifyHndl;
PROGDETAILS progDetails;
PSZ         progParams;
PVOID       reserved = NULL;
ULONG       flags;
HAPP        invokedHndl;
...
// populate PROGDETAILS structure...
...
invokedHndl = WinStartApp(notifyHndl, progDetails, progParams, reserved, flags);
...

Related Functions

WinQueryTaskSizePos WinSetWindowPos WinTerminateApp

Notes

Specifying SAF_STARTCHILDAPP flag, the newly invoked program can be stopped with WinTerminateApp.

OS Version Introduced