WinStartApp: Difference between revisions
Appearance
m Martini moved page OS2 API:WinStartApp to OS2 API:PMI:WinStartApp |
No edit summary |
||
Line 3: | Line 3: | ||
=== Parameters === | === Parameters === | ||
; notifyHndl - [[ | ; 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. | |||
; progDetails - [[ | ; 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. | |||
; progParams - [[ | |||
; reserved - [[ | |||
; flags - [[OS2 API:DataType:ULONG|ULONG]] - input : Zero for no flags or: | ; flags - [[OS2 API:DataType:ULONG|ULONG]] - input : Zero for no flags or: | ||
Line 22: | Line 19: | ||
=== Returns === | === Returns === | ||
;[[ | ;[[HAPP]] : The invoked applications handle of this type. | ||
;[[ | ;[[NULLHANDLE]] : An error occurred. | ||
Possible returns from [[ | Possible returns from [[WinGetLastError]]: | ||
* [[OS2 API:PMI:error#PMERR_CANNOT_START|PMERR_CANNOT_START]] | * [[OS2 API:PMI:error#PMERR_CANNOT_START|PMERR_CANNOT_START]] | ||
* [[OS2 API:PMI:error#PMERR_DOS_ERROR|PMERR_DOS_ERROR]] | * [[OS2 API:PMI:error#PMERR_DOS_ERROR|PMERR_DOS_ERROR]] | ||
Line 33: | Line 30: | ||
* [[OS2 API:PMI:error#PMERR_INVALID_WINDOW|PMERR_INVALID_WINDOW]] | * [[OS2 API:PMI:error#PMERR_INVALID_WINDOW|PMERR_INVALID_WINDOW]] | ||
* [[OS2 API:PMI:error#PMERR_STARTED_IN_BACKGROUND|PMERR_STARTED_IN_BACKGROUND]] | * [[OS2 API:PMI:error#PMERR_STARTED_IN_BACKGROUND|PMERR_STARTED_IN_BACKGROUND]] | ||
=== Define (C/C++) === | === Define (C/C++) === | ||
INCL_WINWINDOWMGR or INCL_WIN or INCL_PM | INCL_WINWINDOWMGR or INCL_WIN or INCL_PM | ||
=== Calling conversion === | === Calling conversion === | ||
Line 45: | Line 38: | ||
=== Example Code === | === Example Code === | ||
HWND notifyHndl; | |||
PROGDETAILS progDetails; | |||
PSZ progParams; | |||
PVOID reserved = NULL; | |||
ULONG flags; | |||
HAPP invokedHndl; | |||
... | ... | ||
// populate PROGDETAILS structure... | // populate PROGDETAILS structure... | ||
Line 58: | Line 51: | ||
=== Related Functions === | === Related Functions === | ||
[[ | *[[WinQueryTaskSizePos]] | ||
[[ | *[[WinSetWindowPos]] | ||
[[ | *[[WinTerminateApp]] | ||
=== Notes === | === Notes === | ||
Specifying [[OS2 API:Constant:SAF#SAF_STARTCHILDAPP|SAF_STARTCHILDAPP]] flag, the newly invoked program can be stopped with [[ | Specifying [[OS2 API:Constant:SAF#SAF_STARTCHILDAPP|SAF_STARTCHILDAPP]] flag, the newly invoked program can be stopped with [[WinTerminateApp]]. | ||
[[Category: | [[Category:Win]] |
Revision as of 18:35, 29 November 2016
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:
- PMERR_CANNOT_START
- PMERR_DOS_ERROR
- PMERR_INVALID_APPL
- PMERR_INVALID_HWND
- PMERR_INVALID_PARAMETERS
- PMERR_INVALID_PROGRAM_CATEGORY
- PMERR_INVALID_WINDOW
- PMERR_STARTED_IN_BACKGROUND
Define (C/C++)
INCL_WINWINDOWMGR or INCL_WIN or INCL_PM
Calling conversion
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
Notes
Specifying SAF_STARTCHILDAPP flag, the newly invoked program can be stopped with WinTerminateApp.