WinStartApp: Difference between revisions
Appearance
m formatting tweaking |
m formatting |
||
Line 1: | Line 1: | ||
== WinStartApp == | == WinStartApp == | ||
; WinStartApp(notifyHndl, progDetails, progParams, reserved, flags) : | ; WinStartApp(notifyHndl, progDetails, progParams, reserved, flags) : Execute a program. | ||
Execute a program. | |||
=== Parameters === | === Parameters === | ||
; notifyHndl - [[OS2 API:DataType:HWND|HWND]] - input : | ; notifyHndl - [[OS2 API:DataType:HWND|HWND]] - input : The window notification handle or [[OS2 API:DataType:NULLHANDLE|NULLHANDLE]]. If a window handle is passed, the system passes the [[OS2_API:Constant:WM#WM_APPTERMINATENOTIFY|WM_APPTERMINATENOTIFY]] message upon program exit. | ||
The window notification handle or [[OS2 API:DataType:NULLHANDLE|NULLHANDLE]]. If a window handle is passed, the system passes the [[OS2_API:Constant:WM#WM_APPTERMINATENOTIFY|WM_APPTERMINATENOTIFY]] message upon program exit. | |||
; progDetails - [[OS2 API:DataType:PROGDETAILS|PROGDETAILS]] - input : | ; progDetails - [[OS2 API:DataType:PROGDETAILS|PROGDETAILS]] - input : The program list structure. | ||
The program list structure. | |||
; progParams - [[OS2 API:DataType:PSZ|PSZ]] - input : | ; progParams - [[OS2 API:DataType:PSZ|PSZ]] - input : [[OS2 API:Constant:NULL|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. | ||
[[OS2 API:Constant:NULL|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 - [[OS2 API:DataType:PVOID|PVOID]] - input : | ; reserved - [[OS2 API:DataType:PVOID|PVOID]] - input : Start data. Reserved - pass [[OS2 API:Constant:NULL|NULL]]. | ||
Start data. Reserved - pass [[OS2 API:Constant:NULL|NULL]]. | |||
; flags - [[OS2 API:DataType:ULONG|ULONG]] - input : | ; flags - [[OS2 API:DataType:ULONG|ULONG]] - input : Zero for no flags or: | ||
Zero for no flags or: | |||
* [[OS2 API:Constant:SAF#SAF_BACKGROUND|SAF_BACKGROUND]] | * [[OS2 API:Constant:SAF#SAF_BACKGROUND|SAF_BACKGROUND]] | ||
* [[OS2 API:Constant:SAF#SAF_INSTALLEDCMDLINE|SAF_INSTALLEDCMDLINE]] | * [[OS2 API:Constant:SAF#SAF_INSTALLEDCMDLINE|SAF_INSTALLEDCMDLINE]] |
Revision as of 04:08, 1 May 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.
- 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
Module
Define (C/C++)
INCL_WINWINDOWMGR or INCL_WIN or INCL_PM
Export name/Ordinal
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
WinQueryTaskSizePos WinSetWindowPos WinTerminateApp
Notes
Specifying SAF_STARTCHILDAPP flag, the newly invoked program can be stopped with WinTerminateApp.